Permalink
Browse files

Added rudel-color.el and use it in infinote backend

* rudel-color.el: new file; utility functions for color manipulation;
  currently RGB <-> HSV conversion
* Project.ede (target rudel): added rudel-color.el
* infinote/rudel-infinote-group-document.el (require rudel-color): new
  require; used to convert hue values to RGB colors
  (rudel-infinote-group-document-state-idle::rudel-infinote/user-join):
  (rudel-infinote-group-document-state-idle::rudel-infinote/user-rejoin):
  (rudel-infinote-group-document-state-idle::rudel-infinote/user-color-change):
  (rudel-infinote-group-document-state-synchronizing::rudel-infinote/sync-user):
  (rudel-infinote-group-document-state-joining::rudel-infinote/user-join):
  (rudel-infinote-group-document-state-joining::rudel-infinote/user-rejoin):
  use `rudel-hsv->string' and `rudel-color-background-value'
  • Loading branch information...
1 parent fde5eb5 commit d1512b63fa195ebf13b6504c219048261677f0be @scymtym committed Jun 3, 2010
Showing with 333 additions and 26 deletions.
  1. +171 −0 ChangeLog
  2. +2 −2 Project.ede
  3. +13 −24 infinote/rudel-infinote-group-document.el
  4. +147 −0 rudel-color.el
View
171 ChangeLog
@@ -1,3 +1,174 @@
+2010-06-03 Jan Moringen <scymtym@users.sourceforge.net>
+
+ Added rudel-color.el and use it in infinote backend
+ * rudel-color.el: new file; utility functions for color
+ manipulation; currently RGB <-> HSV conversion
+ * Project.ede (target rudel): added rudel-color.el
+ * infinote/rudel-infinote-group-document.el (require rudel-color):
+ new require; used to convert hue values to RGB colors
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-join):
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-rejoin):
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-color-change):
+ (rudel-infinote-group-document-state-synchronizing::rudel-infinote/sync-user):
+ (rudel-infinote-group-document-state-joining::rudel-infinote/user-join):
+ (rudel-infinote-group-document-state-joining::rudel-infinote/user-rejoin):
+ use `rudel-hsv->string' and `rudel-color-background-value'
+
+ New method rudel-document::rudel-clear-users for infinote backend
+ * rudel.el (rudel-document::rudel-clear-users): new method; clear
+ list of subscribed users
+ * infinote/rudel-infinote-group-document.el
+ (rudel-infinote-group-document-state-synchronizing::rudel-enter):
+ use `rudel-clear-users'; users are added by the synchronization
+ process
+
+ Fixed state superclasses in rudel-infinote-group-text-document.el
+ * infinote/rudel-infinote-group-text-document.el
+ (rudel-infinote-group-text-document-state-idle): fixed superclass
+ rudel-infinote-document-state-idle ->
+ rudel-infinote-group-document-state-idle
+ (rudel-infinote-group-text-document-state-synchronizing): fixed
+ superclass rudel-infinote-document-state-synchronizing ->
+ rudel-infinote-group-document-state-synchronizing
+
+ Better updates of user status in rudel-infinote-group-document.el
+ * infinote/rudel-infinote-group-document.el
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-join):
+ update the status slot of the user
+ (rudel-infinote-group-document-state-joining::rudel-infinote/user-join):
+ warn if the self user cannot be found
+
+ Updated user state handlers in rudel-infinote-group-document.el
+ * infinote/rudel-infinote-group-document.el
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-status-change):
+ try to find the user in the list of subscribed user of the
+ document and update its status
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-color-change):
+ new method; handle 'user-color-change' message
+
+ Added comments, docs to infinote/rudel-infinote-group-document.el
+ * infinote/rudel-infinote-group-document.el
+ (rudel-infinote-group-document-state-synchronizing::rudel-infinote/sync-end):
+ added comments and display a warning when the number of received
+ synchronization items differs from the expected number
+ (rudel-infinote-group-document-state-joining): added documentation
+ string
+
+ Added a 'closed' state to infinote group classes
+ * infinote/rudel-infinote-group-text-document.el
+ (rudel-infinote-group-text-document-states): added closed state
+ * infinote/rudel-infinote-group-document.el
+ (rudel-infinote-group-document-states): added closed state
+ * infinote/rudel-infinote-group-directory.el
+ (rudel-infinote-directory-state-new): added a comment
+ (rudel-infinote-group-directory-states): added closed state
+
+ Added new class rudel-infinote-group-state-closed
+ * infinote/rudel-infinote-group.el
+ (rudel-infinote-group-state-closed): new closed; groups enter this
+ state when a close message is received
+ (this rudel-infinote-group-state-closed::rudel-accept): new
+ method; ignore all messages
+
+2010-06-02 Jan Moringen <scymtym@users.sourceforge.net>
+
+ Handle user joining in infinote/rudel-infinote-group-document.el
+ * infinote/rudel-infinote-group-document.el (require warnings):
+ new require; required for displaying warnings
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-join):
+ create a user object and add it to the document
+ (rudel-infinote-group-document-state-idle::rudel-infinote/user-rejoin):
+ find the user in the document and update its slots; warn if the
+ user cannot be found
+ (rudel-infinote-group-document-state-synchronizing::rudel-infinote/sync-user):
+ create a user object and add it to the document
+ (rudel-infinote-group-document-state-joining::rudel-infinote/user-join):
+ find the self user and update its slots; then add it to the
+ document
+ (rudel-infinote-group-document-state-joining::rudel-infinote/user-rejoin):
+ find the self user and update its slots; make the self user and
+ the document user agree; warn if one is not found or they do not
+ agree
+
+ Renamed group states in infinote/rudel-infinote-group-document.el
+ * infinote/rudel-infinote-group-document.el
+ (rudel-infinote-group-document-state-idle): renamed
+ rudel-infinote-document-state-idle ->
+ rudel-infinote-group-document-state-idle
+ (rudel-infinote-group-document-state-synchronizing):
+ rudel-infinote-document-state-synchronizing ->
+ rudel-infinote-group-document-state-synchronizing
+ (rudel-infinote-group-document-states): changed names of group
+ states
+
+ Store and use id in infinote/rudel-infinote-group-directory.el
+ * infinote/rudel-infinote-group-directory.el
+ (rudel-infinote-directory-state-subscribing::id): new slot; stores
+ the id ob the target node of the subscription
+ (rudel-infinote-directory-state-subscribing::rudel-enter): store
+ id; added documentation string
+ (rudel-infinote-directory-state-subscribing::rudel-infinote/subscribe-session):
+ check the received id against the stored id; send message through
+ group
+
+ Subscription ack in infinote/rudel-infinote-group-directory.el
+ * infinote/rudel-infinote-group-directory.el
+ (rudel-infinote-directory-state-subscribing;:rudel-leave): new
+ method; send subscription acknowledgment
+
+ Reversed order of superclasses of rudel-infinote-document
+ * infinote/rudel-infinote-document.el (rudel-infinote-document):
+ reversed order of superclasses; added documentation string
+
+2010-06-01 Jan Moringen <scymtym@users.sourceforge.net>
+
+ Fixed parens in rudel-infinote-embed-in-request
+ * infinote/rudel-infinote-util.el
+ (rudel-infinote-parse-sequence-number): validate input
+ (rudel-infinote-embed-in-request): fixed parens
+
+ Exploit auto sequence numbers in rudel-infinote-group-directory
+ * infinote/rudel-infinote-group-directory.el
+ (rudel-infinote-directory-state-exploring::rudel-enter): do not
+ add sequence number to message since the super class of the group
+ does that automatically
+ (rudel-infinote-group-directory): changed superclass to
+ `rudel-infinote-sequence-number-group' to get automatic sequence
+ number injection
+
+ New rudel-make-and-add-group in rudel-infinote-group-directory.el
+ * infinote/rudel-infinote-group-directory.el
+ (rudel-infinote-group-directory::rudel-add-node): changed call
+ `rudel-add-new-node' -> `rudel-make-and-add-node'
+ * infinote/rudel-infinote-client.el
+ (rudel-infinote-client-connection::rudel-make-and-add-group): new
+ method; create a new group object and add it to the list of groups
+ (rudel-infinote-client-connection::rudel-make-and-add-node):
+ renamed `rudel-add-new-node' -> `rudel-make-and-add-node'
+
+ Use self user in rudel-local-operation in rudel-infinote-client.el
+ * infinote/rudel-infinote-client.el
+ (rudel-infinote-client-connection::rudel-local-operation): obtain
+ self user from session object
+
+ Added methods rudel-self and rudel-find-user in rudel.el
+ * rudel.el (rudel-client-session::rudel-self): new reader method;
+ returns the self user
+ (rudel-document::rudel-find-user): new method; finds ands returns
+ a specified user
+
+ Removed obsolete method from infinote/rudel-infinote-client.el
+ * infinote/rudel-infinote-client.el
+ (rudel-infinote-client-connection::rudel-register-state): removed
+ obsolete method
+
+ Added slot plugins to class rudel-infinote-client-connection
+ * infinote/rudel-infinote-client.el
+ (rudel-infinote-client-connection::plugins): new slot; list of
+ plugins advertised by the remote side
+ (rudel-infinote-client-connection::initialize-instance): minor
+ cleanup
+
2010-05-30 Jan Moringen <scymtym@users.sourceforge.net>
Store remote side id in infinote/rudel-infinote-group.el
View
@@ -4,7 +4,7 @@
:name "rudel"
:version "0.3"
:file "Project.ede"
- :targets (list
+ :targets (list
(ede-proj-target-elisp-autoloads "autoloads"
:name "autoloads"
:path ""
@@ -14,7 +14,7 @@
(ede-proj-target-elisp "compile"
:name "rudel"
:path ""
- :source '("rudel.el" "rudel-util.el" "rudel-xml.el" "rudel-mode.el" "rudel-interactive.el" "rudel-overlay.el" "rudel-speedbar.el" "rudel-operators.el" "rudel-operations.el" "rudel-compat.el" "rudel-errors.el" "rudel-state-machine.el" "rudel-backend.el" "rudel-protocol.el" "rudel-session-initiation.el" "rudel-icons.el" "rudel-hooks.el" "rudel-transport.el" "rudel-transport-util.el" "rudel-chat.el" "rudel-display.el")
+ :source '("rudel.el" "rudel-util.el" "rudel-xml.el" "rudel-mode.el" "rudel-interactive.el" "rudel-overlay.el" "rudel-speedbar.el" "rudel-operators.el" "rudel-operations.el" "rudel-compat.el" "rudel-errors.el" "rudel-state-machine.el" "rudel-backend.el" "rudel-protocol.el" "rudel-session-initiation.el" "rudel-icons.el" "rudel-hooks.el" "rudel-transport.el" "rudel-transport-util.el" "rudel-chat.el" "rudel-display.el" "rudel-color.el")
:versionsource '("rudel.el")
)
)
@@ -40,6 +40,7 @@
(require 'eieio)
+(require 'rudel-color) ;; for HSV color functions
(require 'rudel-xml)
(require 'rudel-infinote-group)
@@ -71,10 +72,8 @@
(hue hue number)) xml
(let ((user (rudel-infinote-user
name
- :color (format "#%04x%04x%04x"
- (* 65535 hue)
- (* 65535 0.8)
- (* 65535 0.8)) ;; TODO temp
+ :color (rudel-hsv->string
+ hue 0.3 (rudel-color-background-value))
:id id
:status (intern-soft status))))
;; Add user to session if necessary.
@@ -110,10 +109,8 @@
(id1 :id)
(status1 :status)) user
(setq name1 name
- color1 (format "#%04x%04x%04x"
- (* 65535 hue)
- (* 65535 0.8)
- (* 65535 0.8)) ;; TODO temp
+ color1 (rudel-hsv->string
+ hue 0.3 (rudel-color-background-value))
id1 id
status1 (intern-soft status)))
(rudel-change-notify user)))))
@@ -155,10 +152,8 @@
:warning)
;; If we found the user, change its status
- (oset user :color (format "#%04x%04x%04x"
- (* 65535 hue)
- (* 65535 0.8)
- (* 65535 0.8))) ;; TODO temp
+ (oset user :color (rudel-hsv->string
+ hue 0.3 (rudel-color-background-value)))
(rudel-change-notify user)))))
nil)
@@ -231,10 +226,8 @@
(hue hue number)) xml
(let ((user (rudel-infinote-user
name
- :color (format "#%04x%04x%04x"
- (* 65535 hue)
- (* 65535 0.8)
- (* 65535 0.8)) ;; TODO temp
+ :color (rudel-hsv->string
+ hue 0.3 (rudel-color-background-value))
:id id
:status (intern-soft status))))
@@ -361,10 +354,8 @@ expect a 'user-join' or 'user-rejoin' message in response.")
(id1 :id)
(status1 :status)) self
(setq name1 name
- color (format "#%04x%04x%04x"
- (* 65535 hue)
- (* 65535 0.8)
- (* 65535 0.8)) ;; TODO temp
+ color (rudel-hsv->string
+ hue 0.3 (rudel-color-background-value))
id1 id
status1 (intern-soft status)))
(rudel-change-notify self)
@@ -403,10 +394,8 @@ expect a 'user-join' or 'user-rejoin' message in response.")
(id1 :id)
(status1 :status)) self
(setq name1 name
- color1 (format "#%04x%04x%04x"
- (* 65535 hue)
- (* 65535 0.8)
- (* 65535 0.8)) ;; TODO temp
+ color1 (rudel-hsv->string
+ hue 0.3 (rudel-color-background-value))
id1 id
status1 (intern-soft status)))
(rudel-change-notify self)))))
Oops, something went wrong.

0 comments on commit d1512b6

Please sign in to comment.