index 7e06cd625cac3555c0d8e1ad0b7161a6c741f908..43a75cb7c21ce3a5a4ccd262a8c9d34fed6e206a 100644 (file)
namespace Whiteboard {
-char const * const MessageString[] = {
- // image and internal data
- "CHANGE_NOT_REPEATABLE",
- "CHANGE_REPEATABLE",
- "DUMMY_CHANGE",
- "CHANGE_COMMIT",
- "DOCUMENT_BEGIN",
- "DOCUMENT_END",
-
- // 1-1 connections
- "connect-request",
- "CONNECT_REQUEST_RESPONSE_USER",
- // chat connections
- "CONNECT_REQUEST_RESPONSE_CHAT",
-
- // chatroom document synchronization
- "CHATROOM_SYNCHRONIZE_REQUEST",
- "CHATROOM_SYNCHRONIZE_RESPONSE",
-
- // requests
- "DOCUMENT_SENDER_REQUEST",
- "DOCUMENT_SENDER_REQUEST_RESPONSE",
- "DOCUMENT_REQUEST",
-
- // notifications
- "CONNECTED_SIGNAL",
- "DISCONNECTED_FROM_USER_SIGNAL",
-
- // error responses
- "CONNECT_REQUEST_REFUSED_BY_PEER",
- "UNSUPPORTED_PROTOCOL_VERSION",
- "ALREADY_IN_SESSION",
-
- // error cases, i.e. garbled messages or bad clients. These should
- // never actually be transmitted
- "UNKNOWN"
-};
+namespace Message {
+
+ Wrapper PROTOCOL = "protocol";
+ Wrapper NEW = "new";
+ Wrapper REMOVE = "remove";
+ Wrapper CONFIGURE = "configure";
+ Wrapper MOVE = "move";
+
+ Message CONNECT_REQUEST = "connect-request";
+ Message CONNECTED = "connected";
+ Message ACCEPT_INVITATION = "accept-invitation";
+ Message DECLINE_INVITATION = "decline-invitation";
+ Message DOCUMENT_BEGIN = "document-begin";
+ Message DOCUMENT_END = "document-end";
+}
+
+namespace Vars {
+
+ char const* INKBOARD_XMLNS = "http://inkscape.org/inkboard";
+
+}
+
+namespace State {
+
+ SessionType WHITEBOARD_MUC = "groupchat";
+ SessionType WHITEBOARD_PEER = "chat";
+
+}
+
+// Protocol versions
+char const* MESSAGE_PROTOCOL_V1 = "1";
+char const* MESSAGE_PROTOCOL_V2 = "2";
+int const HIGHEST_SUPPORTED = 1;
+
+// Node types (as strings)
+char const* NODETYPE_DOCUMENT_STR = "document";
+char const* NODETYPE_ELEMENT_STR = "element";
+char const* NODETYPE_TEXT_STR = "text";
+char const* NODETYPE_COMMENT_STR = "comment";
+
+// Number of chars to allocate for type field (in SessionManager::sendMessage)
+int const TYPE_FIELD_SIZE = 5;
+
+// Number of chars to allocate for sequence number field (in SessionManager::sendMessage)
+int const SEQNUM_FIELD_SIZE = 70;
+
+// Designators for certain "special" nodes in the document
+// These nodes are "special" because they are generally present in all documents,
+// and we generally only want one copy of them
+char const* DOCUMENT_ROOT_NODE = "ROOT";
+char const* DOCUMENT_NAMEDVIEW_NODE = "NAMEDVIEW";
+
+// Names of these special nodes
+char const* DOCUMENT_ROOT_NAME = "svg:svg";
+char const* DOCUMENT_NAMEDVIEW_NAME = "sodipodi:namedview";
+
+// Inkboard client states
+int const IN_WHITEBOARD = 0;
+int const LOGGED_IN = 1;
+int const IN_CHATROOM = 2;
+int const WAITING_FOR_INVITE_RESPONSE = 3;
+int const CONNECTING_TO_CHAT = 4;
+int const WAITING_TO_SYNC_TO_CHAT = 5;
+int const SYNCHRONIZING_WITH_CHAT = 6;
+int const OPEN_FOR_DOC = 7;
+int const PLAYING_SESSION_FILE = 8;
+
+// TODO: make this user-configurable, within sane limits
+// ("sane" limits being roughly in the range (10, 100], from personal testing)
+// Based on discussions with Ted, it seems that we're going to make the Jabber guys
+// accomodate Inkscape, not the other way around...
+// Dispatch interval (in milliseconds)
+int const SEND_TIMEOUT = 35;
}
}