Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2169 lines
68 KiB

  1. //
  2. // Whiteboard Applet Functions
  3. //
  4. #ifndef _HPP_WB
  5. #define _HPP_WB
  6. extern "C"
  7. {
  8. #include <al.h>
  9. }
  10. //
  11. // Page in use flag for page state structure
  12. //
  13. #define PAGE_IN_USE 1
  14. #define PAGE_NOT_IN_USE 2
  15. //
  16. // Page sub-states used during add and delete of pages. Different actions
  17. // are required depending on whether the page is being added/deleted
  18. // locally or remotely.
  19. //
  20. #define PAGE_STATE_EMPTY 1
  21. #define PAGE_STATE_LOCAL_OPEN_CONFIRM 2
  22. #define PAGE_STATE_EXTERNAL_OPEN_CONFIRM 3
  23. #define PAGE_STATE_READY 4
  24. #define PAGE_STATE_EXTERNAL_ADD 5
  25. #define PAGE_STATE_LOCAL_DELETE 6
  26. #define PAGE_STATE_LOCAL_DELETE_CONFIRM 7
  27. #define PAGE_STATE_EXTERNAL_DELETE 8
  28. #define PAGE_STATE_EXTERNAL_DELETE_CONFIRM 9
  29. //
  30. // Page manipulation values
  31. //
  32. #define OPEN_LOCAL 1
  33. #define OPEN_EXTERNAL 2
  34. #define PAGE_FIRST 1
  35. #define PAGE_LAST 2
  36. #define PAGE_BEFORE 3
  37. #define PAGE_AFTER 4
  38. //
  39. // Workset Ids
  40. //
  41. #define USER_INFORMATION_WORKSET 0
  42. #define PAGE_CONTROL_WORKSET 1
  43. #define SYNC_CONTROL_WORKSET 2
  44. #define FIRST_PAGE_WORKSET 5
  45. //
  46. // Number of pages to initialize during registration. During registration
  47. // the number of pages defined here will have worksets opened for them and
  48. // will be ready to be allocated through WBP_PageAdd calls.
  49. //
  50. #define PREINITIALIZE_PAGES 10
  51. //
  52. // Object types for Page Control Workset objects
  53. //
  54. #define TYPE_CONTROL_PAGE_ORDER 1
  55. #define TYPE_CONTROL_LOCK 2
  56. //
  57. // Registration state table
  58. //
  59. // The following table shows the transitions made during registration.
  60. //
  61. // S0 = STATE_ERROR
  62. // S1 = STATE_REG_START
  63. // S2 = STATE_REG_PENDING_WSGROUP_CON
  64. // S3 = STATE_REG_PENDING_WORKSET_OPEN
  65. // S4 = STATE_REG_PENDING_LOCK
  66. // S5 = STATE_REG_PENDING_PAGE_CONTROL
  67. // S6 = STATE_REG_PENDING_UNLOCK
  68. // SIDLE = STATE_IDLE
  69. //
  70. // S0 S1 S2 S3 S4 S5 S6 SIDLE
  71. //
  72. // WBP_Start - A1 AE AE AE AE AE AE
  73. // OM_WSGROUP_REGISTER_CON i i A2 e e e e e
  74. // OM_WORKSET_OPEN_CON i i e A3 e e e *
  75. // OM_WORKSET_LOCK_CON i i e e A4 e e e
  76. // OM_OBJECT_ADD_IND i i i i i A5 e *
  77. // OM_WORKSET_UNLOCK_IND i i i i i i A6 *
  78. // OM_NETWORK_LOST_IND A7 i A7 A7 A7 A7 A7 A7
  79. // OM_OUT_OF_RESOURCES_IND i i AR1 AR1 AR2 AR2 AR1 AR1
  80. // WBP_Stop AD0 AN AD0 AD0 AD2 AD2 AD0 AD0
  81. //
  82. // WBP_... called AE AN AN AN AN AN AN *
  83. //
  84. // Actions:
  85. //
  86. // e Error - log unexpected event and ignore
  87. // i Ignore
  88. // * Not described in this table
  89. //
  90. // AN Return a "Not registered" error to caller
  91. // (No state change)
  92. //
  93. // AE Return an "Out of resources" error to caller
  94. // (No state change)
  95. //
  96. // A1 Call OM_Register
  97. // Call OM_WSGroupRegister
  98. // Move to S2
  99. //
  100. // A2 Open all worksets (0, 1, 2, and 5-254)
  101. // If error perform AD0
  102. // Else move to S3
  103. //
  104. // A3 If all worksets open
  105. // If Page Control Object exists
  106. // Move to SIDLE
  107. // Else
  108. // Request lock
  109. // Move to S4
  110. // Endif
  111. // Endif
  112. //
  113. // A4 If lock acquired OK
  114. // Add Page Control Object
  115. // Move to S5
  116. // Else
  117. // If locked by another person
  118. // Move to S5
  119. // Else
  120. // Perform AD
  121. // Endif
  122. // Endif
  123. //
  124. // A5 If add is for Page Control Object
  125. // If we have the Page Control Workset lock
  126. // Release the lock
  127. // Else
  128. // Perform A6
  129. // Endif
  130. // Endif
  131. //
  132. // A6 Post WBP_EVENT_REGISTERED to client
  133. // If a lock is present
  134. // Post lock notification to client
  135. // Endif
  136. // Move to SIDLE
  137. //
  138. // A7 Post WBP_EVENT_NETWORK_LOST to client
  139. // (No state change.)
  140. //
  141. // AD2 Unlock Page Control Workset
  142. // AD0 Deregister from ObMan
  143. // Post WBP_EVENT_DEREGISTERED to client
  144. // Move to S1
  145. //
  146. //
  147. //
  148. // Major states occupied by a client
  149. //
  150. #define STATE_EMPTY 0
  151. #define STATE_STARTING 1
  152. #define STATE_STARTED 2
  153. #define STATE_REGISTERING 3
  154. #define STATE_IDLE 4
  155. //
  156. // Sub-states occupied during start-up
  157. //
  158. #define STATE_START_START 1
  159. #define STATE_START_REGISTERED_EVENT 2
  160. #define STATE_START_REGISTERED_OM 3
  161. #define STATE_START_REGISTERED_EXIT 4
  162. //
  163. // Sub-states occupied after start-up, but before joining a call.
  164. //
  165. #define STATE_STARTED_START 5
  166. //
  167. // Sub-states occupied during registration. These must be defined to
  168. // increase monotonically as we step through the registration process.
  169. //
  170. #define STATE_REG_START 6
  171. #define STATE_REG_PENDING_WSGROUP_CON 7
  172. #define STATE_REG_PENDING_USER_WORKSET 8
  173. #define STATE_REG_PENDING_WORKSET_OPEN 9
  174. #define STATE_REG_USER_OBJECT_ADDED 10
  175. #define STATE_REG_PENDING_LOCK 11
  176. #define STATE_REG_PENDING_PAGE_CONTROL 12
  177. #define STATE_REG_PENDING_SYNC_CONTROL 13
  178. #define STATE_REG_PENDING_UNLOCK 14
  179. #define STATE_REG_PENDING_PAGE_ORDER 15
  180. #define STATE_REG_PENDING_READY_PAGES 16
  181. #define STATE_REG_END 17
  182. #define STATE_REG_PENDING_WSGROUP_MOVE 18
  183. #define STATE_REG_PENDING_NEW_USER_OBJECT 19
  184. //
  185. // Error states
  186. //
  187. #define ERROR_STATE_EMPTY 0
  188. #define ERROR_STATE_FATAL 1
  189. //
  190. // Lock states
  191. //
  192. typedef enum
  193. {
  194. LOCK_STATE_EMPTY = 0,
  195. LOCK_STATE_PENDING_LOCK,
  196. LOCK_STATE_PENDING_ADD,
  197. LOCK_STATE_GOT_LOCK,
  198. LOCK_STATE_PENDING_DELETE,
  199. LOCK_STATE_LOCKED_OUT,
  200. LOCK_STATE_CANCEL_LOCK
  201. }
  202. WB_LOCK_STATE;
  203. //
  204. // Load states
  205. //
  206. #define LOAD_STATE_EMPTY 0
  207. #define LOAD_STATE_PENDING_CLEAR 1
  208. #define LOAD_STATE_PENDING_DELETE 2
  209. #define LOAD_STATE_LOADING 3
  210. #define LOAD_STATE_PENDING_NEW_PAGE 4
  211. //
  212. // Call id for local calls
  213. //
  214. #define WB_NO_CALL OM_NO_CALL
  215. //
  216. // Limit defines
  217. //
  218. // Maximum number of pages allowed in the Whiteboard
  219. //
  220. #define WB_MAX_PAGES 250
  221. //
  222. // Length of font face (must be a multiple of 4)
  223. //
  224. #define WB_FACENAME_LEN 32
  225. //
  226. // Lock type definitions
  227. //
  228. typedef enum
  229. {
  230. WB_LOCK_TYPE_NONE = 0,
  231. WB_LOCK_TYPE_PAGE_ORDER,
  232. WB_LOCK_TYPE_CONTENTS
  233. }
  234. WB_LOCK_TYPE;
  235. //
  236. // Graphic lock definitions
  237. //
  238. typedef enum
  239. {
  240. WB_GRAPHIC_LOCK_NONE = 0,
  241. WB_GRAPHIC_LOCK_LOCAL,
  242. WB_GRAPHIC_LOCK_REMOTE
  243. }
  244. WB_GRAPHIC_LOCK_TYPE;
  245. //
  246. // Return codes
  247. //
  248. enum
  249. {
  250. WB_RC_NOT_LOCKED = WB_BASE_RC,
  251. WB_RC_LOCKED,
  252. WB_RC_BAD_FILE_FORMAT,
  253. WB_RC_WRITE_FAILED,
  254. WB_RC_BAD_PAGE_HANDLE,
  255. WB_RC_BAD_PAGE_NUMBER,
  256. WB_RC_CHANGED,
  257. WB_RC_NOT_CHANGED,
  258. WB_RC_NO_SUCH_PAGE,
  259. WB_RC_NO_SUCH_GRAPHIC,
  260. WB_RC_NO_SUCH_PERSON,
  261. WB_RC_TOO_MANY_PAGES,
  262. WB_RC_ALREADY_LOADING,
  263. WB_RC_BUSY,
  264. WB_RC_GRAPHIC_LOCKED,
  265. WB_RC_GRAPHIC_NOT_LOCKED,
  266. WB_RC_NOT_LOADING,
  267. WB_RC_CREATE_FAILED,
  268. WB_RC_READ_FAILED
  269. };
  270. //
  271. // Events
  272. //
  273. enum
  274. {
  275. WBPI_EVENT_LOAD_NEXT = WB_BASE_EVENT,
  276. WBP_EVENT_JOIN_CALL_OK,
  277. WBP_EVENT_JOIN_CALL_FAILED,
  278. WBP_EVENT_NETWORK_LOST,
  279. WBP_EVENT_ERROR,
  280. WBP_EVENT_CONTENTS_LOCKED,
  281. WBP_EVENT_UNLOCKED,
  282. WBP_EVENT_LOCK_FAILED,
  283. WBP_EVENT_PAGE_CLEAR_IND,
  284. WBP_EVENT_PAGE_ORDER_UPDATED,
  285. WBP_EVENT_PAGE_DELETE_IND,
  286. WBP_EVENT_PAGE_ORDER_LOCKED,
  287. WBP_EVENT_GRAPHIC_ADDED,
  288. WBP_EVENT_GRAPHIC_MOVED,
  289. WBP_EVENT_GRAPHIC_UPDATE_IND,
  290. WBP_EVENT_GRAPHIC_REPLACE_IND,
  291. WBP_EVENT_GRAPHIC_DELETE_IND,
  292. WBP_EVENT_PERSON_JOINED,
  293. WBP_EVENT_PERSON_LEFT,
  294. WBP_EVENT_PERSON_UPDATE,
  295. WBP_EVENT_PERSON_REPLACE,
  296. WBP_EVENT_LOAD_FAILED,
  297. WBP_EVENT_INSERT_OBJECTS,
  298. WBP_EVENT_INSERT_NEXT,
  299. WBP_EVENT_SYNC_POSITION_UPDATED,
  300. WBP_EVENT_LOAD_COMPLETE
  301. };
  302. //
  303. // Type declarations
  304. //
  305. //
  306. // Page handle. This is actually an index into the array of pages.
  307. //
  308. typedef OM_WORKSET_ID WB_PAGE_HANDLE;
  309. typedef WB_PAGE_HANDLE * PWB_PAGE_HANDLE;
  310. typedef PWB_PAGE_HANDLE * PPWB_PAGE_HANDLE;
  311. #define WB_PAGE_HANDLE_NULL ((WB_PAGE_HANDLE) 0)
  312. //
  313. // Graphic handle. These are handles to graphic objects in the various
  314. // page worksets.
  315. //
  316. typedef POM_OBJECT WB_GRAPHIC_HANDLE;
  317. typedef WB_GRAPHIC_HANDLE * PWB_GRAPHIC_HANDLE;
  318. typedef PWB_GRAPHIC_HANDLE * PPWB_GRAPHIC_HANDLE;
  319. //
  320. // Workset type constants
  321. //
  322. #define TYPE_FILE_HEADER 0
  323. #define TYPE_END_OF_PAGE 1
  324. #define TYPE_END_OF_FILE 2
  325. //
  326. // Graphic type constants
  327. //
  328. #define TYPE_GRAPHIC_FREEHAND 3
  329. #define TYPE_GRAPHIC_LINE 4
  330. #define TYPE_GRAPHIC_RECTANGLE 5
  331. #define TYPE_GRAPHIC_FILLED_RECTANGLE 6
  332. #define TYPE_GRAPHIC_ELLIPSE 7
  333. #define TYPE_GRAPHIC_FILLED_ELLIPSE 8
  334. #define TYPE_GRAPHIC_TEXT 9
  335. #define TYPE_GRAPHIC_DIB 10
  336. //
  337. // Objects used in the Page Control and Lock worksets are used only by the
  338. // API functions. They are never passed back to the Client.
  339. //
  340. //
  341. // Structure used to build the Page Control Object kept in the Page Control
  342. // Workset. This object contains a list of workset IDs in page order (i.e.
  343. // the ID for page 1 comes first).
  344. //
  345. // The structure allows for the maximum number of pages. When it is
  346. // written to the Page Control Object only as many entries as are in use
  347. // are written.
  348. //
  349. // Note that the generation number field has been split into a hiword and
  350. // a loword - this is because the original definition had an unaligned
  351. // TSHR_UINT32 which caused the compiler to insert padding into the structure,
  352. // thus breaking backwards compatibility.
  353. //
  354. typedef struct tagWB_PAGE_ORDER
  355. {
  356. TSHR_UINT16 objectType; // Object type = TYPE_CONTROL_PAGES
  357. TSHR_UINT16 generationLo; // Generation number of object
  358. TSHR_UINT16 generationHi;
  359. TSHR_UINT16 countPages; // Number of active pages
  360. OM_WORKSET_ID pages[WB_MAX_PAGES]; // List of worksets (in page order)
  361. } WB_PAGE_ORDER;
  362. typedef WB_PAGE_ORDER * PWB_PAGE_ORDER;
  363. typedef PWB_PAGE_ORDER * PPWB_PAGE_ORDER;
  364. //
  365. // Lock object - kept in the Page Control Workset indicating the type and
  366. // owner of the current lock.
  367. //
  368. typedef struct tagWB_LOCK
  369. {
  370. TSHR_UINT16 objectType; // Object type = TYPE_CONTROL_LOCK
  371. TSHR_UINT16 lockType; // Type of lock
  372. // WB_LOCK_TYPE_NONE
  373. // WB_LOCK_TYPE_PAGE_ORDER
  374. // WB_LOCK_TYPE_CONTENTS
  375. OM_OBJECT_ID personID; // Id of person holding lock
  376. } WB_LOCK;
  377. typedef WB_LOCK * PWB_LOCK;
  378. typedef PWB_LOCK * PPWB_LOCK;
  379. //
  380. // Graphic object header.
  381. //
  382. //
  383. // WB Tool Types (not type; toolType)
  384. //
  385. #define WBTOOL_PEN 1
  386. #define WBTOOL_TEXT 3
  387. typedef struct tagWB_GRAPHIC
  388. {
  389. //
  390. // All graphic and file objects must start with these three fields
  391. //
  392. TSHR_UINT32 length; // Total length of structure
  393. TSHR_UINT16 type; // Type of object
  394. TSHR_UINT16 dataOffset; // Offset to graphic data from start
  395. //
  396. // All graphic objects have these fields
  397. //
  398. TSHR_RECT16 rectBounds; // Bounding rectangle
  399. TSHR_COLOR color; // Pen color (3 bytes)
  400. TSHR_UINT8 locked; // Flag indicating a person is editing
  401. TSHR_UINT16 penWidth; // Pen width
  402. TSHR_UINT16 penStyle; // Pen style
  403. TSHR_RECT16 rect; // Rectangle used for defining object
  404. OM_OBJECT_ID lockPersonID; // ID of locking person. This field is
  405. // maintained by the core and should not
  406. // be altered by clients.
  407. TSHR_UINT16 rasterOp; // Drawing mode
  408. TSHR_UINT8 smoothed; // Use curve smoothing algorithm
  409. TSHR_UINT8 toolType; // Type of tool used
  410. TSHR_UINT16 loadedFromFile; // Was this object loaded from file?
  411. NET_UID loadingClientID; // ID of the client which loaded this
  412. // object from file (only used if the
  413. // loadedFromFile field is set).
  414. // (This is defined as a TSHR_UINT16).
  415. TSHR_UINT32 reserved1; // Extra space for later additions
  416. TSHR_UINT32 reserved2; // Extra space for later additions
  417. } WB_GRAPHIC;
  418. typedef WB_GRAPHIC * PWB_GRAPHIC;
  419. typedef PWB_GRAPHIC * PPWB_GRAPHIC;
  420. //
  421. // Freehand line
  422. //
  423. typedef struct tagWB_GRAPHIC_FREEHAND
  424. {
  425. WB_GRAPHIC header; // Basic information
  426. TSHR_UINT16 pointCount; // Number of points in the polyline
  427. TSHR_POINT16 points[1]; // Array of points
  428. } WB_GRAPHIC_FREEHAND;
  429. typedef WB_GRAPHIC_FREEHAND * PWB_GRAPHIC_FREEHAND;
  430. typedef PWB_GRAPHIC_FREEHAND * PPWB_GRAPHIC_FREEHAND;
  431. //
  432. // Text
  433. //
  434. typedef struct tagWB_GRAPHIC_TEXT
  435. {
  436. WB_GRAPHIC header; // Basic information
  437. TSHR_INT16 charHeight; // Character height
  438. TSHR_UINT16 averageCharWidth; // Average character width
  439. TSHR_UINT16 strokeWeight; // Stroke weight (normal, bold)
  440. TSHR_UINT8 italic; // Italic flag
  441. TSHR_UINT8 underline; // Underline flag
  442. TSHR_UINT8 strikeout; // Strikeout flag
  443. TSHR_UINT8 pitch; // Fixed/variable pitch
  444. TSHR_CHAR faceName[WB_FACENAME_LEN]; // Font face name
  445. TSHR_UINT16 codePage; // Font code page
  446. TSHR_UINT16 stringCount; // Number of lines of text
  447. TSHR_CHAR text[1]; // Null-terminated text strings
  448. }
  449. WB_GRAPHIC_TEXT;
  450. typedef WB_GRAPHIC_TEXT * PWB_GRAPHIC_TEXT;
  451. typedef PWB_GRAPHIC_TEXT * PPWB_GRAPHIC_TEXT;
  452. //
  453. // Bitmap image
  454. //
  455. typedef struct tagWB_GRAPHIC_DIB
  456. {
  457. WB_GRAPHIC header; // Basic information
  458. // Data bytes follow this structure
  459. } WB_GRAPHIC_DIB;
  460. typedef WB_GRAPHIC_DIB * PWB_GRAPHIC_DIB;
  461. typedef PWB_GRAPHIC_DIB * PPWB_GRAPHIC_DIB;
  462. //
  463. // Person object
  464. //
  465. typedef struct tagWB_PERSON
  466. {
  467. TSHR_CHAR personName[TSHR_MAX_PERSON_NAME_LEN]; // Person name
  468. TSHR_UINT16 colorId; // Color identifier for the person
  469. TSHR_UINT8 synced; // Sync flag
  470. WB_PAGE_HANDLE currentPage; // Handle of current page
  471. TSHR_RECT16 visibleRect; // Area person can see in window
  472. TSHR_UINT8 pointerActive; // Remote pointer in use flag
  473. WB_PAGE_HANDLE pointerPage; // Page for remote pointer
  474. TSHR_POINT16 pointerPos; // Position of pointer in page
  475. TSHR_PERSONID cmgPersonID; // Call Manager personID.
  476. TSHR_UINT32 reserved1; // Reserved for future use.
  477. TSHR_UINT32 reserved2; // Reserved for future use.
  478. }
  479. WB_PERSON;
  480. typedef WB_PERSON * PWB_PERSON;
  481. typedef PWB_PERSON * PPWB_PERSON;
  482. //
  483. // size used by core to update the user object - front ends should only
  484. // replace user objects via the WBP_SetLocalPersonData API function.
  485. //
  486. #define WB_PERSON_OBJECT_UPDATE_SIZE (FIELD_OFFSET(WB_PERSON, synced))
  487. //
  488. // Sync object
  489. //
  490. typedef struct tagWB_SYNC
  491. {
  492. TSHR_UINT32 length; // Length of the structure
  493. TSHR_UINT16 dataOffset; // Offset to data from start
  494. WB_PAGE_HANDLE currentPage; // Handle of current page
  495. TSHR_UINT8 pad; // Pad
  496. TSHR_RECT16 visibleRect; // Area visible in person's window
  497. TSHR_UINT16 zoomed; // Zoom sync participants
  498. }
  499. WB_SYNC;
  500. typedef WB_SYNC * PWB_SYNC;
  501. typedef PWB_SYNC * PPWB_SYNC;
  502. //
  503. // Constant to use instead of sizeof(WB_SYNC).
  504. //
  505. // The WB_SYNC structure was not defined correctly in previous versions
  506. // of Groupware (it was not padded correctly to a multiple of 4 bytes).
  507. // Some compilers (e.g. on NT) insert padding, so the structure is not the
  508. // same size as on Win95 for example. This results in an assert from
  509. // Obman... So we define a constant which is the same whatever compiler we
  510. // use.
  511. //
  512. #define WB_SYNC_SIZE 18
  513. //
  514. // File header for Whiteboard format files
  515. //
  516. typedef struct tagWB_FILE_HEADER
  517. {
  518. TSHR_UINT32 length; // Total length of object
  519. TSHR_UINT16 type; // Type of file object
  520. TSHR_UINT16 dataOffset; // Not used (but must be here)
  521. char functionProfile[OM_MAX_FP_NAME_LEN];
  522. } WB_FILE_HEADER;
  523. typedef WB_FILE_HEADER * PWB_FILE_HEADER;
  524. typedef PWB_FILE_HEADER * PPWB_FILE_HEADER;
  525. //
  526. // End-of-page object for writing to file
  527. //
  528. typedef struct tagWB_END_OF_PAGE
  529. {
  530. TSHR_UINT32 length; // Total length of object
  531. TSHR_UINT16 type; // Type of file object
  532. TSHR_UINT16 dataOffset; // Not used (but must be here)
  533. } WB_END_OF_PAGE;
  534. typedef WB_END_OF_PAGE * PWB_END_OF_PAGE;
  535. typedef PWB_END_OF_PAGE * PPWB_END_OF_PAGE;
  536. //
  537. // End-of-file object
  538. //
  539. typedef WB_END_OF_PAGE WB_END_OF_FILE;
  540. typedef WB_END_OF_FILE * PWB_END_OF_FILE;
  541. typedef PWB_END_OF_FILE * PPWB_END_OF_FILE;
  542. //
  543. // Structure used for determining the current sync page
  544. //
  545. typedef struct tagWB_SYNC_CONTROL
  546. {
  547. OM_OBJECT_ID personID; // ID of person who wrote object
  548. WB_SYNC sync; // Sync position details
  549. } WB_SYNC_CONTROL;
  550. typedef WB_SYNC_CONTROL * PWB_SYNC_CONTROL;
  551. typedef PWB_SYNC_CONTROL * PPWB_SYNC_CONTROL;
  552. //
  553. // Constant to use instead of sizeof(WB_SYNC_CONTROL).
  554. //
  555. // The WB_SYNC structure was not defined correctly in previous versions
  556. // of Groupware (it was not padded correctly to a multiple of 4 bytes).
  557. // Some compilers (e.g. on NT) insert padding, so the structure is not the
  558. // same size as on Win95 for example. This results in an assert from
  559. // Obman... So we define a constant which is the same whatever compiler we
  560. // use.
  561. //
  562. #define WB_SYNC_CONTROL_SIZE (sizeof(OM_OBJECT_ID) + WB_SYNC_SIZE)
  563. //
  564. // Structures used for maintaining and accessing the page list internally.
  565. // The page state structure combine the internal and external page state.
  566. //
  567. typedef struct tagWB_PAGE_STATE
  568. {
  569. TSHR_UINT16 state; // Page in use flag
  570. TSHR_UINT16 subState; // Page state
  571. OM_CORRELATOR worksetOpenCorrelator;
  572. }
  573. WB_PAGE_STATE;
  574. typedef WB_PAGE_STATE * PWB_PAGE_STATE;
  575. typedef PWB_PAGE_STATE * PPWB_PAGE_STATE;
  576. //
  577. // Secondary shared memory structure.
  578. //
  579. // Although we are adding objects, not pages, since each objects can be
  580. // placed on a new page, this structure is limited to the max number of
  581. // pages.
  582. //
  583. #define WB_MAX_INSERTS 250
  584. #if WB_MAX_PAGES > WB_MAX_INSERTS
  585. #error Number of pages is now greater than number of insertable objects
  586. #endif // WB_MAX_PAGES > WB_MAX_INSERTS
  587. //
  588. // Values for changedFlagAction
  589. //
  590. #define RESET_CHANGED_FLAG 0
  591. #define DONT_RESET_CHANGED_FLAG 1
  592. //
  593. // Convert between page handles, workset IDs and indices into the page list
  594. // array of pages.
  595. //
  596. #define PAGE_HANDLE_TO_INDEX(hPage) \
  597. ((TSHR_UINT16) ((hPage) - FIRST_PAGE_WORKSET))
  598. #define PAGE_INDEX_TO_HANDLE(index) \
  599. ((WB_PAGE_HANDLE) ((index) + FIRST_PAGE_WORKSET))
  600. #define PAGE_WORKSET_ID_TO_INDEX(worksetID) \
  601. ((TSHR_UINT16) ((worksetID) - FIRST_PAGE_WORKSET))
  602. #define PAGE_INDEX_TO_WORKSET_ID(index) \
  603. ((OM_WORKSET_ID) ((index) + FIRST_PAGE_WORKSET))
  604. //
  605. // Client interface
  606. //
  607. #undef INTERFACE
  608. #define INTERFACE IWbClient
  609. DECLARE_INTERFACE(IWbClient)
  610. {
  611. STDMETHOD_(void, WBP_Stop)(THIS_ UTEVENT_PROC) PURE;
  612. STDMETHOD_(void, WBP_PostEvent)(THIS_ UINT delay, UINT event, UINT_PTR param1, UINT_PTR param2) PURE;
  613. STDMETHOD_(UINT, WBP_JoinCall)(THIS_ BOOL keep, UINT callID) PURE;
  614. STDMETHOD_(UINT, WBP_ValidateFile)(THIS_ LPCSTR fileName, HANDLE * phFile) PURE;
  615. STDMETHOD_(UINT, WBP_CancelLoad)(THIS_) PURE;
  616. STDMETHOD_(UINT, WBP_ContentsLoad)(THIS_ LPCSTR fileName) PURE;
  617. STDMETHOD_(UINT, WBP_ContentsSave)(THIS_ LPCSTR fileName) PURE;
  618. STDMETHOD_(UINT, WBP_ContentsDelete)(THIS_) PURE;
  619. STDMETHOD_(UINT, WBP_ContentsCountPages)(THIS_) PURE;
  620. STDMETHOD_(BOOL, WBP_ContentsChanged)(THIS_) PURE;
  621. STDMETHOD_(void, WBP_ContentsLock)(THIS_) PURE;
  622. STDMETHOD_(void, WBP_PageOrderLock)(THIS_) PURE;
  623. STDMETHOD_(void, WBP_Unlock)(THIS_) PURE;
  624. STDMETHOD_(WB_LOCK_TYPE, WBP_LockStatus)(THIS_ POM_OBJECT * ppObjPersonLock) PURE;
  625. STDMETHOD_(UINT, WBP_PageClear)(THIS_ WB_PAGE_HANDLE hPage) PURE;
  626. STDMETHOD_(void, WBP_PageClearConfirm)(THIS_ WB_PAGE_HANDLE hPage) PURE;
  627. STDMETHOD_(UINT, WBP_PageAddBefore)(THIS_ WB_PAGE_HANDLE hRefPage, PWB_PAGE_HANDLE phPage) PURE;
  628. STDMETHOD_(UINT, WBP_PageAddAfter)(THIS_ WB_PAGE_HANDLE hRefPage, PWB_PAGE_HANDLE phPage) PURE;
  629. STDMETHOD_(UINT, WBP_PageHandle)(THIS_ WB_PAGE_HANDLE hRefPage, UINT where, PWB_PAGE_HANDLE phPageResult) PURE;
  630. STDMETHOD_(UINT, WBP_PageHandleFromNumber)(THIS_ UINT pageNumber, PWB_PAGE_HANDLE phPage) PURE;
  631. STDMETHOD_(UINT, WBP_PageNumberFromHandle)(THIS_ WB_PAGE_HANDLE hPage) PURE;
  632. STDMETHOD_(UINT, WBP_PageDelete)(THIS_ WB_PAGE_HANDLE hPage) PURE;
  633. STDMETHOD_(void, WBP_PageDeleteConfirm)(THIS_ WB_PAGE_HANDLE hPage) PURE;
  634. STDMETHOD_(UINT, WBP_PageMove)(THIS_ WB_PAGE_HANDLE hRefPage, WB_PAGE_HANDLE hPage, UINT where) PURE;
  635. STDMETHOD_(UINT, WBP_PageCountGraphics)(THIS_ WB_PAGE_HANDLE hPage) PURE;
  636. STDMETHOD_(UINT, WBP_GraphicAllocate)(THIS_ WB_PAGE_HANDLE hPage, UINT length, PPWB_GRAPHIC ppGraphic) PURE;
  637. STDMETHOD_(UINT, WBP_GraphicAddLast)(THIS_ WB_PAGE_HANDLE hPage, PWB_GRAPHIC pGraphic, PWB_GRAPHIC_HANDLE phGraphic) PURE;
  638. STDMETHOD_(UINT, WBP_GraphicUpdateRequest)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PWB_GRAPHIC pGraphic) PURE;
  639. STDMETHOD_(void, WBP_GraphicUpdateConfirm)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic) PURE;
  640. STDMETHOD_(UINT, WBP_GraphicReplaceRequest)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PWB_GRAPHIC pGraphic) PURE;
  641. STDMETHOD_(void, WBP_GraphicReplaceConfirm)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic) PURE;
  642. STDMETHOD_(UINT, WBP_GraphicDeleteRequest)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic) PURE;
  643. STDMETHOD_(void, WBP_GraphicDeleteConfirm)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic) PURE;
  644. STDMETHOD_(UINT, WBP_GraphicMove)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, UINT where) PURE;
  645. STDMETHOD_(UINT, WBP_GraphicSelect)(THIS_ WB_PAGE_HANDLE hPage, POINT pt, WB_GRAPHIC_HANDLE hRefGraphic, UINT where, PWB_GRAPHIC_HANDLE phGraphic) PURE;
  646. STDMETHOD_(UINT, WBP_GraphicGet)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PPWB_GRAPHIC ppGraphic) PURE;
  647. STDMETHOD_(void, WBP_GraphicRelease)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PWB_GRAPHIC pGraphic) PURE;
  648. STDMETHOD_(void, WBP_GraphicUnlock)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic) PURE;
  649. STDMETHOD_(UINT, WBP_GraphicHandle)(THIS_ WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hRefGraphic, UINT where, PWB_GRAPHIC_HANDLE phGraphic) PURE;
  650. STDMETHOD_(void, WBP_PersonHandleFirst)(THIS_ POM_OBJECT * ppObjUser) PURE;
  651. STDMETHOD_(UINT, WBP_PersonHandleNext)(THIS_ POM_OBJECT pObj, POM_OBJECT * ppObjNext) PURE;
  652. STDMETHOD_(void, WBP_PersonHandleLocal)(THIS_ POM_OBJECT * ppObjLocal) PURE;
  653. STDMETHOD_(UINT, WBP_PersonCountInCall)(THIS_) PURE;
  654. STDMETHOD_(UINT, WBP_GetPersonData)(THIS_ POM_OBJECT pObjPerson, PWB_PERSON pPerson) PURE;
  655. STDMETHOD_(UINT, WBP_SetLocalPersonData)(THIS_ PWB_PERSON pPerson) PURE;
  656. STDMETHOD_(void, WBP_PersonUpdateConfirm)(THIS_ POM_OBJECT pObj) PURE;
  657. STDMETHOD_(void, WBP_PersonReplaceConfirm)(THIS_ POM_OBJECT pObj) PURE;
  658. STDMETHOD_(void, WBP_PersonLeftConfirm)(THIS_ POM_OBJECT pObj) PURE;
  659. STDMETHOD_(UINT, WBP_SyncPositionGet)(THIS_ PWB_SYNC pSync) PURE;
  660. STDMETHOD_(UINT, WBP_SyncPositionUpdate)(THIS_ PWB_SYNC pSync) PURE;
  661. };
  662. class WbClient : public IWbClient
  663. {
  664. public:
  665. // IWbClient interface
  666. STDMETHODIMP_(void) WBP_Stop(UTEVENT_PROC eventProc);
  667. STDMETHODIMP_(void) WBP_PostEvent(UINT delay, UINT event, UINT_PTR param1, UINT_PTR param2);
  668. STDMETHODIMP_(UINT) WBP_JoinCall(BOOL keep, UINT callID);
  669. STDMETHODIMP_(UINT) WBP_ValidateFile(LPCSTR fileName, HANDLE * phFile);
  670. STDMETHODIMP_(UINT) WBP_CancelLoad(void);
  671. STDMETHODIMP_(UINT) WBP_ContentsLoad(LPCSTR fileName);
  672. STDMETHODIMP_(UINT) WBP_ContentsSave(LPCSTR fileName);
  673. STDMETHODIMP_(UINT) WBP_ContentsDelete(void);
  674. STDMETHODIMP_(UINT) WBP_ContentsCountPages(void);
  675. STDMETHODIMP_(BOOL) WBP_ContentsChanged(void);
  676. STDMETHODIMP_(void) WBP_ContentsLock(void);
  677. STDMETHODIMP_(void) WBP_PageOrderLock(void);
  678. STDMETHODIMP_(void) WBP_Unlock(void);
  679. STDMETHODIMP_(WB_LOCK_TYPE) WBP_LockStatus(POM_OBJECT * ppObjPersonLock);
  680. STDMETHODIMP_(UINT) WBP_PageClear(WB_PAGE_HANDLE hPage);
  681. STDMETHODIMP_(void) WBP_PageClearConfirm(WB_PAGE_HANDLE hPage);
  682. STDMETHODIMP_(UINT) WBP_PageAddBefore(WB_PAGE_HANDLE hRefPage, PWB_PAGE_HANDLE phPage);
  683. STDMETHODIMP_(UINT) WBP_PageAddAfter(WB_PAGE_HANDLE hRefPage, PWB_PAGE_HANDLE phPage);
  684. STDMETHODIMP_(UINT) WBP_PageHandle(WB_PAGE_HANDLE hRefPage, UINT where, PWB_PAGE_HANDLE phPageResult);
  685. STDMETHODIMP_(UINT) WBP_PageHandleFromNumber(UINT pageNumber, PWB_PAGE_HANDLE phPage);
  686. STDMETHODIMP_(UINT) WBP_PageNumberFromHandle(WB_PAGE_HANDLE hPage);
  687. STDMETHODIMP_(UINT) WBP_PageDelete(WB_PAGE_HANDLE hPage);
  688. STDMETHODIMP_(void) WBP_PageDeleteConfirm(WB_PAGE_HANDLE hPage);
  689. STDMETHODIMP_(UINT) WBP_PageMove(WB_PAGE_HANDLE hRefPage, WB_PAGE_HANDLE hPage, UINT where);
  690. STDMETHODIMP_(UINT) WBP_PageCountGraphics(WB_PAGE_HANDLE hPage);
  691. STDMETHODIMP_(UINT) WBP_GraphicAllocate(WB_PAGE_HANDLE hPage, UINT length, PPWB_GRAPHIC ppGraphic);
  692. STDMETHODIMP_(UINT) WBP_GraphicAddLast(WB_PAGE_HANDLE hPage, PWB_GRAPHIC pGraphic, PWB_GRAPHIC_HANDLE phGraphic);
  693. STDMETHODIMP_(UINT) WBP_GraphicUpdateRequest(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PWB_GRAPHIC pGraphic);
  694. STDMETHODIMP_(void) WBP_GraphicUpdateConfirm(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic);
  695. STDMETHODIMP_(UINT) WBP_GraphicReplaceRequest(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PWB_GRAPHIC pGraphic);
  696. STDMETHODIMP_(void) WBP_GraphicReplaceConfirm(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic);
  697. STDMETHODIMP_(UINT) WBP_GraphicDeleteRequest(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic);
  698. STDMETHODIMP_(void) WBP_GraphicDeleteConfirm(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic);
  699. STDMETHODIMP_(UINT) WBP_GraphicMove(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, UINT where);
  700. STDMETHODIMP_(UINT) WBP_GraphicSelect(WB_PAGE_HANDLE hPage, POINT pt, WB_GRAPHIC_HANDLE hRefGraphic, UINT where, PWB_GRAPHIC_HANDLE phGraphic);
  701. STDMETHODIMP_(UINT) WBP_GraphicGet(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PPWB_GRAPHIC ppGraphic);
  702. STDMETHODIMP_(void) WBP_GraphicRelease(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, PWB_GRAPHIC pGraphic);
  703. STDMETHODIMP_(void) WBP_GraphicUnlock(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic);
  704. STDMETHODIMP_(UINT) WBP_GraphicHandle(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hRefGraphic, UINT where, PWB_GRAPHIC_HANDLE phGraphic);
  705. STDMETHODIMP_(void) WBP_PersonHandleFirst(POM_OBJECT * ppObjUser);
  706. STDMETHODIMP_(UINT) WBP_PersonHandleNext(POM_OBJECT pObj, POM_OBJECT * ppObjNext);
  707. STDMETHODIMP_(void) WBP_PersonHandleLocal(POM_OBJECT * ppObjLocal);
  708. STDMETHODIMP_(UINT) WBP_PersonCountInCall(void);
  709. STDMETHODIMP_(UINT) WBP_GetPersonData(POM_OBJECT pObjPerson, PWB_PERSON pPerson);
  710. STDMETHODIMP_(UINT) WBP_SetLocalPersonData(PWB_PERSON pPerson);
  711. STDMETHODIMP_(void) WBP_PersonUpdateConfirm(POM_OBJECT pObj);
  712. STDMETHODIMP_(void) WBP_PersonReplaceConfirm(POM_OBJECT pObj);
  713. STDMETHODIMP_(void) WBP_PersonLeftConfirm(POM_OBJECT pObj);
  714. STDMETHODIMP_(UINT) WBP_SyncPositionGet(PWB_SYNC pSync);
  715. STDMETHODIMP_(UINT) WBP_SyncPositionUpdate(PWB_SYNC pSync);
  716. BOOL WbInit(PUT_CLIENT putClient, UTEVENT_PROC eventProc);
  717. protected:
  718. // Internal functions
  719. PWB_PAGE_STATE GetPageState(WB_PAGE_HANDLE hPage)
  720. {
  721. ASSERT((hPage >= FIRST_PAGE_WORKSET) && (hPage <= FIRST_PAGE_WORKSET + WB_MAX_PAGES - 1));
  722. return(&((m_pageStates)[PAGE_HANDLE_TO_INDEX(hPage)]));
  723. }
  724. void wbContentsDelete(UINT changedFlagAction);
  725. UINT wbLock(WB_LOCK_TYPE lockType);
  726. void wbUnlock(void);
  727. UINT wbPageHandle(WB_PAGE_HANDLE hPage, UINT where, PWB_PAGE_HANDLE phPage);
  728. UINT wbPageHandleFromNumber(UINT pageNumber, PWB_PAGE_HANDLE phPage);
  729. UINT wbPageClear(WB_PAGE_HANDLE hPage, UINT changedFlagAction);
  730. void wbPageClearConfirm(WB_PAGE_HANDLE hPage);
  731. UINT wbPageAdd(WB_PAGE_HANDLE hRefPage, UINT where, PWB_PAGE_HANDLE phPage, UINT changedFlagAction);
  732. BOOL wbGetNetUserID(void);
  733. UINT wbPageMove(WB_PAGE_HANDLE hRefPage, WB_PAGE_HANDLE hPage, UINT where);
  734. UINT wbPersonGet(POM_OBJECT pObjPerson, PWB_PERSON pPerson);
  735. UINT wbWriteSyncControl(PWB_SYNC pSync, BOOL create);
  736. BOOL wbGraphicLocked(WB_PAGE_HANDLE hPage, WB_GRAPHIC_HANDLE hGraphic, POM_OBJECT* ppObjPersonLock);
  737. UINT wbGraphicSelectPrevious(WB_PAGE_HANDLE hPage, LPPOINT pPoint, WB_GRAPHIC_HANDLE hGraphic, PWB_GRAPHIC_HANDLE phGraphic);
  738. void wbError(void);
  739. void wbJoinCallError(void);
  740. UINT wbAddLocalUserObject(void);
  741. UINT wbPersonUpdate(PWB_PERSON pUser);
  742. WB_PAGE_HANDLE wbGetEmptyPageHandle(void);
  743. WB_PAGE_HANDLE wbGetReadyPageHandle(void);
  744. PWB_PAGE_STATE wbPageState(WB_PAGE_HANDLE hPage);
  745. void wbPagesPageAdd(WB_PAGE_HANDLE hRefPage, WB_PAGE_HANDLE hPage, UINT where);
  746. UINT wbPageOrderPageNumber(PWB_PAGE_ORDER pPageOrder, WB_PAGE_HANDLE hPage);
  747. void wbPageOrderPageAdd(PWB_PAGE_ORDER pPageOrder, WB_PAGE_HANDLE hRefPage, WB_PAGE_HANDLE hPage, UINT where);
  748. void wbPageOrderPageDelete(PWB_PAGE_ORDER pPageOrder, WB_PAGE_HANDLE hPage);
  749. friend BOOL CALLBACK wbCoreEventHandler(LPVOID clientData, UINT event, UINT_PTR param1, UINT_PTR param2);
  750. BOOL wbEventHandler(UINT event, UINT_PTR param1, UINT_PTR param2);
  751. friend void CALLBACK wbCoreExitHandler(LPVOID clientData);
  752. void wbExitHandler(void);
  753. BOOL wbOnWsGroupRegisterCon(UINT_PTR param1, UINT_PTR param2);
  754. BOOL wbOnWsGroupMoveCon(UINT_PTR param1, UINT_PTR param2);
  755. BOOL wbOnWsGroupMoveInd(UINT_PTR param1, UINT_PTR param2);
  756. BOOL wbOnWorksetOpenCon(UINT_PTR param1, UINT_PTR param2);
  757. void wbOnControlWorksetOpenCon(UINT_PTR param1, UINT_PTR param2);
  758. BOOL wbOnPageWorksetOpenCon(UINT_PTR param1, UINT_PTR param2);
  759. BOOL wbOnWorksetLockCon(UINT_PTR param1, UINT_PTR param2);
  760. BOOL wbOnWorksetUnlockInd(UINT_PTR param1, UINT_PTR param2);
  761. BOOL wbOnWorksetClearInd(UINT_PTR param1, UINT_PTR param2);
  762. BOOL wbOnObjectAddInd(UINT_PTR param1, POM_OBJECT pObj);
  763. BOOL wbOnObjectMoveInd(UINT_PTR param1, UINT_PTR param2);
  764. BOOL wbOnObjectDeleteInd(UINT_PTR param1, POM_OBJECT pObj);
  765. BOOL wbOnObjectUpdateInd(UINT_PTR param1, POM_OBJECT pObj);
  766. BOOL wbOnObjectReplaceInd(UINT_PTR param1, POM_OBJECT pObj);
  767. void wbOnControlWorksetsReady(void);
  768. void wbProcessLockNotification(void);
  769. void wbCompleteRegistration(void);
  770. void wbLeaveCall(void);
  771. void wbOnGraphicObjectAddInd(OM_WORKSET_ID worksetID, POM_OBJECT pObj);
  772. void wbOnGraphicObjectUpdateInd(OM_WORKSET_ID worksetID, POM_OBJECT pObj);
  773. void wbOnGraphicObjectReplaceInd(OM_WORKSET_ID worksetID, POM_OBJECT pObj);
  774. void wbOnGraphicObjectMoveInd(OM_WORKSET_ID worksetID, POM_OBJECT pObj);
  775. void wbOnGraphicObjectDeleteInd(OM_WORKSET_ID worksetID, POM_OBJECT pObj);
  776. UINT wbPageWorksetOpen(WB_PAGE_HANDLE hPage, UINT localOrExternal);
  777. BOOL wbOnWBPPageClearInd(WB_PAGE_HANDLE hPage);
  778. void wbOnPageDelete(void);
  779. UINT wbPageSave(WB_PAGE_HANDLE hPage, HANDLE hFile);
  780. UINT wbObjectSave(HANDLE hFile, LPBYTE pData, UINT length);
  781. void wbStartContentsLoad(void);
  782. void wbPageLoad(void);
  783. UINT wbObjectLoad(HANDLE hFile, WB_PAGE_HANDLE hPage, PPWB_GRAPHIC ppGraphic);
  784. UINT wbGetPageObjectType(POM_OBJECT pObj, UINT * pObjectType);
  785. void wbOnPageObjectAddInd(POM_OBJECT pObj);
  786. void wbOnPageControlObjectAddInd(POM_OBJECT pObj);
  787. void wbOnPageObjectReplaceInd(POM_OBJECT pObj);
  788. void wbOnPageObjectDeleteInd(POM_OBJECT pObj);
  789. void wbOnLockControlObjectDeleteInd(POM_OBJECT pObj);
  790. void wbOnPageControlObjectReplaceInd(void);
  791. void wbProcessPageControlChanges(void);
  792. UINT wbWriteLock(void);
  793. void wbReadLock(void);
  794. void wbSendLockNotification(void);
  795. UINT wbWritePageControl(BOOL create);
  796. UINT wbCreateSyncControl(void);
  797. void wbOnSyncObjectAddInd(POM_OBJECT pObj);
  798. void wbOnSyncObjectReplaceInd(POM_OBJECT pObj);
  799. void wbOnUserObjectAddInd(POM_OBJECT pObj);
  800. void wbOnUserObjectDeleteInd(POM_OBJECT pObj);
  801. void wbOnUserObjectUpdateInd(POM_OBJECT pObj);
  802. void wbOnUserObjectReplaceInd(POM_OBJECT pObj);
  803. UINT wbSelectPersonColor(void);
  804. void wbCheckPersonColor(POM_OBJECT hCheckObject);
  805. BOOL wbOnWBPLock(void);
  806. BOOL wbOnWBPLockFailed(void);
  807. BOOL wbOnWBPUnlocked(void);
  808. BOOL wbOnWBPPageOrderUpdated(void);
  809. void wbProcessInsertObjects(void);
  810. UINT wbDiscardInsertObjects(UINT cObject);
  811. void wbClientReset(void);
  812. BOOL wbCheckReadyPages(void);
  813. // Data
  814. PUT_CLIENT m_putTask; // Task handle
  815. POM_CLIENT m_pomClient; // ObMan handle
  816. PCM_CLIENT m_pcmClient; // Call Manager secondary handle.
  817. OM_WSGROUP_HANDLE m_hWSGroup;
  818. BYTE m_changed;
  819. NET_UID m_clientNetID; // Net ID of local person
  820. UINT m_state; // Major state
  821. UINT m_subState; // Sub-state of major state
  822. UINT m_errorState; // Fatal error indicator
  823. OM_CORRELATOR m_wsgroupCorrelator;
  824. OM_CORRELATOR m_worksetOpenCorrelator;
  825. POM_OBJECT m_pObjPageControl;
  826. POM_OBJECT m_pObjSyncControl;
  827. POM_OBJECT m_pObjLocal; // Ptr to local person
  828. OM_OBJECT_ID m_personID; // OM ID of local person
  829. // adding clientNetID field
  830. WB_LOCK_STATE m_lockState; // Lock state
  831. OM_CORRELATOR m_lockCorrelator; // Correlator for locking
  832. WORD m_lockRequestType; // Type of lock request
  833. WB_LOCK_TYPE m_lockType; // Current lock type
  834. POM_OBJECT m_pObjLock; // Handle of the lock object
  835. POM_OBJECT m_pObjPersonLock; // Person who has lock.
  836. UINT m_loadState; // Load state
  837. HANDLE m_hLoadFile; // File handle (used during loading)
  838. WB_PAGE_HANDLE m_loadPageHandle; // Page handle (used during loading)
  839. UINT m_colorId; // Color id for the local person
  840. UINT m_countReadyPages; // Number of page worksets ready
  841. // for use.
  842. WB_PAGE_ORDER m_pageOrder; // List of active pages
  843. WB_PAGE_STATE m_pageStates[WB_MAX_PAGES]; // List of page state flags
  844. };
  845. //
  846. //
  847. // Name: CreateWBObject()
  848. //
  849. // Purpose: Register the caller with the Whiteboard Core. This function
  850. // gives the core the ability to inform the front-end of events
  851. // caused by other call participants.
  852. //
  853. // The front-end should follow this call by a call to WBP_JoinCall.
  854. //
  855. //
  856. BOOL WINAPI CreateWBObject(UTEVENT_PROC eventProc, IWbClient** ppwbClient);
  857. //
  858. // Convert between ObMan object pointers and core graphic pointers
  859. //
  860. PWB_GRAPHIC __inline GraphicPtrFromObjectData(POM_OBJECTDATA pData)
  861. {
  862. return((PWB_GRAPHIC)&(pData->data));
  863. }
  864. POM_OBJECTDATA __inline ObjectDataPtrFromGraphic(PWB_GRAPHIC pGraphic)
  865. {
  866. return((POM_OBJECTDATA)((LPBYTE)pGraphic - offsetof(OM_OBJECTDATA, data)));
  867. }
  868. //
  869. // QUIT_LOCKED
  870. //
  871. // Leave the function if another person has the contents or page order
  872. // lock.
  873. //
  874. //
  875. #define QUIT_LOCKED(result) \
  876. if (m_lockState == LOCK_STATE_LOCKED_OUT) \
  877. { \
  878. result = WB_RC_LOCKED; \
  879. DC_QUIT; \
  880. }
  881. //
  882. // QUIT_IF_CANCELLING_LOCK
  883. //
  884. // Leave the function if we are processing a lock-cancel request
  885. //
  886. //
  887. #define QUIT_IF_CANCELLING_LOCK(result, errCode) \
  888. if (m_lockState == LOCK_STATE_CANCEL_LOCK) \
  889. { \
  890. TRACE_OUT(("Already cancelling lock")); \
  891. result = errCode; \
  892. DC_QUIT; \
  893. }
  894. //
  895. // QUIT_CONTENTS_LOCKED
  896. //
  897. // Leave the function if another person has the contents lock.
  898. //
  899. //
  900. #define QUIT_CONTENTS_LOCKED(result) \
  901. if ( (m_lockState == LOCK_STATE_LOCKED_OUT) \
  902. && (m_lockType == WB_LOCK_TYPE_CONTENTS)) \
  903. { \
  904. result = WB_RC_LOCKED; \
  905. DC_QUIT; \
  906. }
  907. //
  908. // QUIT_NOT_GOT_LOCK
  909. //
  910. // Leave the function if the client does not have a lock.
  911. //
  912. //
  913. #define QUIT_NOT_GOT_LOCK(result) \
  914. if (m_lockState != LOCK_STATE_GOT_LOCK) \
  915. { \
  916. result = WB_RC_NOT_LOCKED; \
  917. DC_QUIT; \
  918. }
  919. //
  920. // QUIT_NOT_PROCESSING_LOCK
  921. //
  922. // Leave the function if the client has not previoulsy requested a lock.
  923. //
  924. //
  925. #define QUIT_NOT_PROCESSING_LOCK(result) \
  926. if ( (m_lockState != LOCK_STATE_GOT_LOCK ) && \
  927. (m_lockState != LOCK_STATE_PENDING_LOCK) && \
  928. (m_lockState != LOCK_STATE_PENDING_ADD) ) \
  929. { \
  930. TRACE_OUT(( \
  931. "Not locked: Client lock state %d", m_lockState)); \
  932. result = WB_RC_NOT_LOCKED; \
  933. DC_QUIT; \
  934. }
  935. //
  936. // QUIT_NOT_GOT_CONTENTS_LOCK
  937. //
  938. // Leave the function if the client does not have the contents lock.
  939. //
  940. //
  941. #define QUIT_NOT_GOT_CONTENTS_LOCK(result) \
  942. \
  943. QUIT_NOT_GOT_LOCK(result); \
  944. \
  945. if (m_lockType != WB_LOCK_TYPE_CONTENTS) \
  946. { \
  947. result = WB_RC_NOT_LOCKED; \
  948. DC_QUIT; \
  949. }
  950. //
  951. // QUIT_NOT_GOT_PAGE_ORDER_LOCK
  952. //
  953. // This is currently the same as QUIT_NOT_GOT_LOCK as there are only the
  954. // page order and contents locks. The contents lock is considered to
  955. // include the page order lock.
  956. //
  957. //
  958. #define QUIT_NOT_GOT_PAGE_ORDER_LOCK(result) \
  959. QUIT_NOT_GOT_LOCK(result)
  960. //
  961. // QUIT_GRAPHIC_LOCKED
  962. //
  963. // Leave the function if another person has the graphic locked.
  964. //
  965. //
  966. #define QUIT_GRAPHIC_LOCKED(hPage, hGraphic, result) \
  967. { \
  968. POM_OBJECT pObjPerson; \
  969. if (wbGraphicLocked(hPage, hGraphic, &pObjPerson)) \
  970. { \
  971. if (pObjPerson != m_pObjLocal) \
  972. { \
  973. result = WB_RC_GRAPHIC_LOCKED; \
  974. DC_QUIT; \
  975. } \
  976. } \
  977. }
  978. //
  979. // QUIT_GRAPHIC_NOT_LOCKED
  980. //
  981. // Leave the function if the local user does not have the graphic locked.
  982. //
  983. //
  984. #define QUIT_GRAPHIC_NOT_LOCKED(pGraphic, result) \
  985. if (pGraphic->locked != WB_GRAPHIC_LOCK_LOCAL) \
  986. { \
  987. result = WB_RC_GRAPHIC_NOT_LOCKED; \
  988. DC_QUIT; \
  989. }
  990. //
  991. //
  992. // Name: WBP_JoinCall
  993. //
  994. // Purpose: Join a call. This function registers with the Whiteboard
  995. // workset group. It is asynchronous giving one of the following
  996. // events as a result:
  997. //
  998. // WBP_EVENT_JOIN_CALL_OK
  999. // WBP_EVENT_JOIN_CALL_FAILED.
  1000. //
  1001. // No other WBP_... functions should be called until the call
  1002. // has been successfully joined.
  1003. //
  1004. // Returns: 0 if successful
  1005. // OM_RC_... - in case of workset registration/move failure:
  1006. // see om.h
  1007. //
  1008. //
  1009. //
  1010. //
  1011. // Name: WBP_ContentsLoad
  1012. //
  1013. // Purpose: Load a new file from disc into the Whiteboard worksets. The
  1014. // caller must hold the Whiteboard page order lock before calling
  1015. // this function. This function is asynchronous; when it returns,
  1016. // the file will not be completely loaded. The front-end will
  1017. // receive a WBP_EVENT_LOAD_COMPLETE when the load completes, or
  1018. // a WBP_EVENT_LOAD_FAILED if an asynchronous error occurs
  1019. //
  1020. // Returns: 0 if successful
  1021. // WB_RC_LOCKED - the whiteboard is locked by another user
  1022. // WB_RC_NOT_LOCKED - the caller doesnt have the contents lock
  1023. // WB_RC_NO_FILE - the specified file could not be found
  1024. // WB_RC_BAD_FILE_FORMAT - the file is not of the correct format
  1025. //
  1026. //
  1027. //
  1028. //
  1029. // Name: WBP_ContentsSave
  1030. //
  1031. // Purpose: Save the current Whiteboard contents to disc. The Whiteboard
  1032. // contents can be updated by other users while this function is
  1033. // processing. To prevent this acquire the Whiteboard contents
  1034. // lock before calling it.
  1035. //
  1036. // Returns: 0 if successful
  1037. // WB_RC_DISK_FULL - not enough space on disk
  1038. // WB_RC_PATH_NOT_FOUND - the specified path does not exist
  1039. // WB_RC_WRITE_FAILED - writing to the file failed - the file is
  1040. // read-only.
  1041. //
  1042. //
  1043. //
  1044. //
  1045. // Name: WBP_ContentsDelete
  1046. //
  1047. // Purpose: Delete all the Whiteboard pages (leaving only an empty page 1).
  1048. // The caller must hold the Whiteboard contents or page order lock
  1049. // before calling this function.
  1050. //
  1051. // For each page to be deleted, each person in the call receives
  1052. // the following event:
  1053. //
  1054. // WBP_EVENT_PAGE_DELETE_IND
  1055. //
  1056. // Returns: 0 if successful
  1057. // WB_RC_LOCKED - another person has the contents lock
  1058. // WB_RC_NOT_LOCKED - the local person does not hold the page order
  1059. // lock.
  1060. //
  1061. //
  1062. //
  1063. //
  1064. // Name: WBP_ContentsChanged
  1065. //
  1066. // Purpose: Returns an indication of whether the contents of the Whiteboard
  1067. // have changed since WBP_ContentsSave) WBP_ContentsLoad or
  1068. // WBP_ContentsDelete was last called.
  1069. //
  1070. //
  1071. //
  1072. //
  1073. // Name: WBP_ContentsLock
  1074. //
  1075. // Purpose: Lock the Whiteboard contents. This is an asynchronous function
  1076. // generating one of the following events:
  1077. //
  1078. // WBP_EVENT_CONTENTS_LOCKED
  1079. // WBP_EVENT_LOCK_FAILED.
  1080. //
  1081. // Returns: none
  1082. //
  1083. //
  1084. //
  1085. //
  1086. // Name: WBP_PageOrderLock
  1087. //
  1088. // Purpose: Lock the Whiteboard page order. This is an asynchronous
  1089. // function generating one of the following events:
  1090. //
  1091. // WBP_EVENT_PAGES_LOCKED
  1092. // WBP_EVENT_LOCK_FAILED.
  1093. //
  1094. //
  1095. // Returns: none
  1096. //
  1097. //
  1098. //
  1099. //
  1100. // Name: WBP_Unlock
  1101. //
  1102. // Purpose: Unlock the Whiteboard. This is an asynchronous function
  1103. // generating the following event:
  1104. //
  1105. // WBP_EVENT_UNLOCKED
  1106. //
  1107. // This function may be called anytine after a call to WBP_Lock -
  1108. // an application does not need to wait for a WBP_EVENT_LOCKED
  1109. // event after calling WBP_Lock before calling WBP_Unlock.
  1110. //
  1111. //
  1112. //
  1113. //
  1114. // Name: WBP_LockStatus
  1115. //
  1116. // Purpose: Return the current state of the available locks
  1117. //
  1118. //
  1119. // Returns: None (always succeeds)
  1120. //
  1121. //
  1122. //
  1123. //
  1124. // Name: WBP_ContentsCountPages
  1125. //
  1126. // Purpose: Return the number of pages in the Whiteboard.
  1127. //
  1128. // Returns: None
  1129. //
  1130. //
  1131. //
  1132. //
  1133. // Name: WBP_PageClear
  1134. //
  1135. // Purpose: Clear the page (deleting all graphic objects on it). This is
  1136. // an asynchronous function generating the following event:
  1137. //
  1138. // WBP_EVENT_PAGE_CLEARED
  1139. //
  1140. // No objects are actually deleted until the WBP_PageClearConfirm
  1141. // function is called in response to the event.
  1142. //
  1143. // Returns: 0 if successful
  1144. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is bad
  1145. // WB_RC_LOCKED - another user has a lock on the white-
  1146. // board contents.
  1147. //
  1148. //
  1149. //
  1150. //
  1151. // Name: WBP_PageClearConfirm
  1152. //
  1153. // Purpose: Confirm the clearing of a page. All graphic objects on the page
  1154. // will be removed.
  1155. //
  1156. // Returns: none
  1157. //
  1158. //
  1159. //
  1160. //
  1161. // Name: WBP_PageAddBefore
  1162. //
  1163. // Purpose: Add a new page before a specified page. This
  1164. // function requires that the caller hold the Whiteboard contents
  1165. // or page order lock before it is called. The following event is
  1166. // generated for each user in the call:
  1167. //
  1168. // WBP_EVENT_PAGE_ORDER_UPDATED
  1169. //
  1170. // Returns: 0 if successful
  1171. // WB_RC_BAD_PAGE_HANDLE - the hRefPage handle is invalid
  1172. // WB_RC_LOCKED - the whiteboard is locked by another
  1173. // user
  1174. // WB_RC_NOT_LOCKED - the local user does not hold the page
  1175. // order lock
  1176. // WB_RC_TOO_MANY_PAGES - the maximum number of pages has been
  1177. // reached.
  1178. //
  1179. //
  1180. //
  1181. //
  1182. // Name: WBP_PageAddAfter
  1183. //
  1184. // Purpose: Add a new page after a specified page. This
  1185. // function requires that the caller hold the Whiteboard contents
  1186. // or page order lock before it is called. The following event is
  1187. // generated for each user in the call:
  1188. //
  1189. // WBP_EVENT_PAGE_ORDER_UPDATED
  1190. //
  1191. // Returns: 0 if successful
  1192. // WB_RC_BAD_PAGE_HANDLE - the hRefPage handle is invalid
  1193. // WB_RC_LOCKED - the whiteboard is locked by another user
  1194. // WB_RC_NOT_LOCKED - the local user does not hold the page
  1195. // order lock
  1196. // WB_RC_TOO_MANY_PAGES - the maximum number of pages has been
  1197. // reached.
  1198. //
  1199. //
  1200. //
  1201. //
  1202. // Name: WBP_PageHandle
  1203. //
  1204. // Purpose: Return the handle of another page in the Whiteboard.
  1205. //
  1206. // Returns: 0 if successful
  1207. //
  1208. //
  1209. //
  1210. //
  1211. // Name: WBP_PageHandleFromNumber
  1212. //
  1213. // Purpose: Return the handle of the page specified by page number
  1214. //
  1215. // Returns: 0 if successful
  1216. // WB_RC_BAD_PAGE_NUMBER - pageNumber is not a valid page number
  1217. //
  1218. //
  1219. //
  1220. //
  1221. // Name: WBP_PageNumberFromHandle
  1222. //
  1223. // Purpose: Return the number of the page specified by handle
  1224. //
  1225. //
  1226. //
  1227. //
  1228. // Name: WBP_PageDelete
  1229. //
  1230. // Purpose: Delete the specified page. The local user must have the white-
  1231. // board contents or page order lock before calling this function.
  1232. // This call gives rise to two events:
  1233. //
  1234. // WBP_EVENT_PAGE_CLEARED_IND - indicating that all the objects in
  1235. // the page have been deleted. The front-end
  1236. // must respond by calling
  1237. // WBP_PageClearConFirm - no graphic objects
  1238. // will be deleted until this is done.
  1239. //
  1240. // WBP_EVENT_PAGE_ORDER_UPDATED - informing the front-end that the
  1241. // list of pages has changed
  1242. //
  1243. // Returns: 0 if successful
  1244. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1245. // WB_RC_LOCKED - another client has the contents locked
  1246. // WB_RC_NOT_LOCKED - the local user does not have the page
  1247. // order lock.
  1248. //
  1249. //
  1250. //
  1251. //
  1252. // Name: WBP_PageDeleteConfirm
  1253. //
  1254. // Purpose: Confirm the deletion of a page.
  1255. //
  1256. // Returns: none
  1257. //
  1258. //
  1259. //
  1260. //
  1261. // Name: WBP_PageMove
  1262. //
  1263. // Purpose: Moves one page after or before another. The user must hold
  1264. // the Whiteboard contents or page order lock before calling this
  1265. // function. If successful this function will result in a
  1266. // WBP_EVENT_PAGE_ORDER_UPDATED event.
  1267. //
  1268. // Returns: 0 if successful
  1269. // WB_RC_LOCKED - another client has the contents locked
  1270. // WB_RC_NOT_LOCKED - the local user does not have the page
  1271. // order lock.
  1272. // WB_RC_BAD_PAGE_HANDLE - either hRefPage or hPage is not a valid
  1273. // page handle
  1274. //
  1275. //
  1276. //
  1277. //
  1278. // Name: WBP_PageCountGraphics
  1279. //
  1280. // Purpose: Return the number of graphics on the page
  1281. //
  1282. // Returns: none
  1283. //
  1284. //
  1285. //
  1286. //
  1287. // Name: WBP_GraphicAllocate
  1288. //
  1289. // Purpose: Allocate memory for a graphic object. Note: All memory used for
  1290. // graphics passed to the Whiteboard core must be allocated using
  1291. // the function described here.
  1292. //
  1293. // Returns: 0 if successful
  1294. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1295. // WB_RC_OUT_OF_MEMORY - could not allocate the amount of memory
  1296. // requested.
  1297. //
  1298. //
  1299. //
  1300. //
  1301. // Name: WBP_GraphicAddLast
  1302. //
  1303. // Purpose: Add a graphic object to the Whiteboard contents. The graphic
  1304. // must previously have been allocated using WBP_GraphicAllocate.
  1305. // It is added to the end (topmost Z-Order) of the specified page.
  1306. // The following event is generated:
  1307. //
  1308. // WBP_EVENT_GRAPHIC_ADDED.
  1309. //
  1310. // Returns: 0 if successful
  1311. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1312. //
  1313. //
  1314. //
  1315. //
  1316. // Name: WBP_GraphicUpdateRequest
  1317. //
  1318. // Purpose: Update a graphic object in the Whiteboard contents. This call
  1319. // allows only the WB_GRAPHIC header part of the graphic object
  1320. // to be altered.
  1321. //
  1322. // This call only starts the process of updating a graphic. If
  1323. // this function is successful a WBP_EVENT_GRAPHIC_UPDATE_IND event
  1324. // will be posted to the caller. The caller must then call
  1325. // WBP_GraphicUpdateConfirm.
  1326. //
  1327. // Returns: 0 if successful
  1328. // WB_RC_LOCKED - another client has the whiteboard
  1329. // contents locked
  1330. // WB_RC_OBJECT_LOCKED - another client has the specified
  1331. // graphic object locked.
  1332. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1333. // WB_RC_BAD_GRAPHIC_HANDLE - the specified graphic handle is
  1334. // invalid
  1335. //
  1336. //
  1337. //
  1338. //
  1339. //
  1340. // Name: WBP_GraphicUpdateConfirm
  1341. //
  1342. // Purpose: Complete the process of updating a graphic object.
  1343. // (See WBP_GraphicUpdateRequest.)
  1344. //
  1345. // Returns: none
  1346. //
  1347. //
  1348. //
  1349. //
  1350. // Name: WBP_GraphicReplaceRequest
  1351. //
  1352. // Purpose: Replace a graphic object in the Whiteboard contents. This call
  1353. // allows the entire object to be replaced with another object.
  1354. //
  1355. // This call only starts the process of replacing a graphic. If
  1356. // this function is successful a WBP_EVENT_GRAPHIC_REPLACE_IND
  1357. // event will be posted to the caller. The caller must then call
  1358. // WBP_GraphicReplaceConfirm.
  1359. //
  1360. // Returns: 0 if successful
  1361. // WB_RC_LOCKED - another client has the whiteboard
  1362. // contents locked
  1363. // WB_RC_OBJECT_LOCKED - another client has the specified
  1364. // graphic object locked.
  1365. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1366. // WB_RC_BAD_GRAPHIC_HANDLE - the specified graphic handle is
  1367. // invalid
  1368. //
  1369. //
  1370. //
  1371. //
  1372. // Name: WBP_GraphicReplaceConfirm
  1373. //
  1374. // Purpose: Complete the process of replacing a graphic object.
  1375. // (See WBP_GraphicReplaceRequest.)
  1376. //
  1377. // Returns: none
  1378. //
  1379. //
  1380. //
  1381. //
  1382. // Name: WBP_GraphicDeleteRequest
  1383. //
  1384. // Purpose: Delete a graphic object in the Whiteboard contents.
  1385. //
  1386. // This call only starts the process of deleting a graphic. If
  1387. // this function is successful a WBP_EVENT_GRAPHIC_DELETE_IND event
  1388. // will be posted to the caller. The caller must then call
  1389. // WBP_GraphicDeleteConfirm.
  1390. //
  1391. // Returns: 0 if successful
  1392. //
  1393. // WB_RC_LOCKED - another client has the whiteboard
  1394. // contents locked
  1395. // WB_RC_OBJECT_LOCKED - another client has the specified
  1396. // graphic object locked.
  1397. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1398. // WB_RC_BAD_GRAPHIC_HANDLE - the specified graphic handle is
  1399. // invalid
  1400. //
  1401. //
  1402. //
  1403. // Name: WBP_GraphicDeleteConfirm
  1404. //
  1405. // Purpose: Complete the process of deleting a graphic object.
  1406. // (See WBP_UpdateGraphicRequest.)
  1407. //
  1408. // Returns: none
  1409. //
  1410. //
  1411. //
  1412. //
  1413. // Name: WBP_GraphicMove
  1414. //
  1415. // Purpose: Move a graphic to the end of the page (topmost Z-order).
  1416. // On successful completion, the following event is generated:
  1417. //
  1418. // WBP_EVENT_GRAPHIC_MOVED
  1419. //
  1420. // Returns: 0 if successful
  1421. // WB_RC_LOCKED - another user has the whiteboard
  1422. // contents locked.
  1423. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1424. // WB_RC_BAD_GRAPHIC_HANDLE - the specified graphic handle is
  1425. // invalid
  1426. //
  1427. //
  1428. //
  1429. //
  1430. // Name: WBP_GraphicSelect
  1431. //
  1432. // Purpose: Retrieve the handle of the topmost Z-order graphic whose
  1433. // bounding rectangle contains the specified point.
  1434. //
  1435. // Returns: 0 if successful
  1436. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1437. // WB_RC_NO_SUCH_GRAPHIC - there is no graphic at the point
  1438. // specified.
  1439. //
  1440. //
  1441. //
  1442. //
  1443. // Name: WBP_GraphicGet
  1444. //
  1445. // Purpose: Retrieve a graphic object. After this graphic has been
  1446. // retrieved it will remain in memory until explicitly released
  1447. // by a call to WBP_ReleaseGraphic.
  1448. //
  1449. // Returns: 0 if successful
  1450. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1451. // WB_RC_BAD_OBJECT_HANDLE - the specified graphic handle is
  1452. // invalid.
  1453. //
  1454. //
  1455. //
  1456. //
  1457. // Name: WBP_GraphicRelease
  1458. //
  1459. // Purpose: Release a previously retrieved graphic.
  1460. //
  1461. // Returns: none
  1462. //
  1463. //
  1464. //
  1465. //
  1466. // Name: WBP_GraphicUnlock
  1467. //
  1468. // Purpose: Unlock a graphic. This function succeeds even if the contents
  1469. // are locked.
  1470. //
  1471. // Returns: none
  1472. //
  1473. //
  1474. //
  1475. //
  1476. // Name: WBP_GraphicHandle
  1477. //
  1478. // Purpose: Return the handle of the first graphic in the specified page.
  1479. //
  1480. // Returns: 0 if successful
  1481. // WB_RC_BAD_PAGE_HANDLE - the specified page handle is invalid
  1482. //
  1483. //
  1484. //
  1485. //
  1486. // Name: WBP_PersonHandleFirst
  1487. //
  1488. // Purpose: Return the handle of the first user in the call
  1489. //
  1490. // Returns: None
  1491. //
  1492. //
  1493. //
  1494. //
  1495. // Name: WBP_PersonHandleNext
  1496. //
  1497. // Purpose: Return the handle of the next user in the call
  1498. //
  1499. // Returns: 0 if successful
  1500. // WB_RC_BAD_USER_HANDLE - the specified user handle is invalid
  1501. // WB_RC_NO_SUCH_USER - there is no next user: hRefUser is
  1502. // the last in the users workset.
  1503. //
  1504. //
  1505. //
  1506. //
  1507. // Name: WBP_PersonHandleLocal
  1508. //
  1509. // Purpose: Return the handle of the local user
  1510. //
  1511. // Returns: None
  1512. //
  1513. //
  1514. //
  1515. //
  1516. // Name: WBP_PersonCountInCall
  1517. //
  1518. // Purpose: Retrieves information about the global state of the Whiteboard
  1519. // FP in the call.
  1520. //
  1521. //
  1522. //
  1523. //
  1524. // Name: WBP_GetPersonData
  1525. //
  1526. // Purpose: Retrieve the person object specified by <hPerson>.
  1527. //
  1528. // Returns: 0 if successful
  1529. // OM_RC_...
  1530. // WB_RC_BAD_PERSON_HANDLE - the specified person handle is invalid
  1531. //
  1532. //
  1533. //
  1534. //
  1535. // Name: WBP_SetLocalPersonData
  1536. //
  1537. // Purpose: Sets the data for the local person.
  1538. //
  1539. // Returns: 0 if successful
  1540. // OM_RC_...
  1541. // WB_RC_BAD_PERSON_HANDLE - the specified person handle is invalid
  1542. //
  1543. //
  1544. //
  1545. //
  1546. // Name: WBP_PersonUpdateConfirm
  1547. //
  1548. // Purpose: Complete the process of updating a user object.
  1549. //
  1550. // Returns: None
  1551. //
  1552. //
  1553. //
  1554. //
  1555. // Name: WBP_PersonReplaceConfirm
  1556. //
  1557. // Purpose: Complete the process of replacing a user object.
  1558. //
  1559. // Returns: None
  1560. //
  1561. //
  1562. //
  1563. //
  1564. // Name: WBP_PersonLeftConfirm
  1565. //
  1566. // Purpose: Complete the process of updating a user object.
  1567. //
  1568. // Returns: None
  1569. //
  1570. //
  1571. //
  1572. //
  1573. // Name: WBP_SyncPositionGet
  1574. //
  1575. // Purpose: Retrieve the details of the current sync position.
  1576. //
  1577. // Returns: 0 if successful
  1578. //
  1579. //
  1580. //
  1581. //
  1582. // Name: WBP_SyncPositionUpdate
  1583. //
  1584. // Purpose: Set the current sync details
  1585. //
  1586. // Returns: 0 if successful
  1587. //
  1588. //
  1589. //
  1590. //
  1591. // Name: WBP_CancelLoad
  1592. //
  1593. // Purpose: Cancel a load in progress
  1594. //
  1595. // Returns: 0 if successful
  1596. // WB_RC_NOT_LOADING if a load is not in progress
  1597. //
  1598. //
  1599. //
  1600. //
  1601. // Name: WBP_ValidateFile
  1602. //
  1603. // Purpose: Validate a whiteboard file
  1604. //
  1605. // Returns: 0 if successful
  1606. // Error if not
  1607. //
  1608. //
  1609. //
  1610. //
  1611. // Event Descriptions
  1612. //
  1613. // The following event are generated during core processing.
  1614. //
  1615. //
  1616. //
  1617. //
  1618. //
  1619. // Name: WBP_EVENT_JOIN_CALL_OK
  1620. //
  1621. // Purpose: Inform the client that the call was joined successfully.
  1622. // This is the very first event that the client will receive
  1623. // after successful registration and joining of a call.
  1624. //
  1625. // Params: None
  1626. //
  1627. //
  1628. //
  1629. //
  1630. // Name: WBP_EVENT_JOIN_CALL_FAILED
  1631. //
  1632. // Purpose: Inform the client that joining of the call failed. The core is
  1633. // not in any call. The next call made to it should be one of
  1634. // WBP_JoinCall and WBP_Stop.
  1635. //
  1636. // Params: None
  1637. //
  1638. //
  1639. //
  1640. //
  1641. // Name: WBP_EVENT_NETWORK_LOST
  1642. //
  1643. // Purpose: Inform the client that communication with other clients
  1644. // is no longer possible. The contents of the core are still
  1645. // available. Any locks held by remote people have been released.
  1646. //
  1647. // Params: None
  1648. //
  1649. //
  1650. //
  1651. //
  1652. // Name: WBP_EVENT_ERROR
  1653. //
  1654. // Purpose: Inform the client that a fatal error has occurred in the core.
  1655. // The client should deregister (WBP_ContentsSave can be called
  1656. // before the application quits but may not be successful).
  1657. //
  1658. // Params: None
  1659. //
  1660. //
  1661. //
  1662. //
  1663. // Name: WBP_EVENT_CONTENTS_LOCKED
  1664. // WBP_EVENT_PAGE_ORDER_LOCKED
  1665. //
  1666. // Purpose: Inform the client that the contents are now locked. This event
  1667. // is be generated both when remote clients get the lock and when
  1668. // the local client acquires it. The parameter indicates who now
  1669. // has the lock. Note that this should always be tested even if
  1670. // this event arrives when the local client is waiting for lock
  1671. // confirmation: it may indicate that the remote client got in
  1672. // just before the local.
  1673. //
  1674. // These events can indicate a change in lock status rather than a
  1675. // lock being acquired. For example a client which holds the
  1676. // Page Order Lock can upgrade that lock to a Contents Lock by
  1677. // calling WBP_ContentsLock. All other clients will then receive
  1678. // WBP_EVENT_CONTENTS_LOCKED events informing them of the change.
  1679. //
  1680. // Params: param16 reserved
  1681. // param32 Handle of person who has acquired the lock
  1682. //
  1683. //
  1684. //
  1685. //
  1686. // Name: WBP_EVENT_UNLOCKED
  1687. //
  1688. // Purpose: Inform the client that the contents are no longer locked. This
  1689. // event is only received when a remote client releases the lock.
  1690. // Local clients call the synchronous WBP_Unlock - the lock is
  1691. // released on return from the function.
  1692. //
  1693. // Params: param16 reserved
  1694. // param32 Handle of person who has released the lock
  1695. //
  1696. //
  1697. //
  1698. //
  1699. // Name: WBP_EVENT_LOCK_FAILED
  1700. //
  1701. // Purpose: Inform the client that the lock request issued previously has
  1702. // failed. This will usually be because another person has acquired
  1703. // the lock.
  1704. //
  1705. // Params: None
  1706. //
  1707. //
  1708. //
  1709. //
  1710. // Name: WBP_EVENT_PAGE_CLEAR_IND
  1711. //
  1712. // Purpose: Inform the client that a page clear has been requested. The
  1713. // client should call WBP_PageClearConfirm as soon as possible.
  1714. //
  1715. // Params: param16 Handle of the page to be cleared
  1716. //
  1717. //
  1718. //
  1719. //
  1720. // Name: WBP_EVENT_PAGE_ORDER_UPDATED
  1721. //
  1722. // Purpose: Inform the client that the order of pages has changed. This
  1723. // event is generated by WBP_PageMove... and WBP_PageAdd...
  1724. // functions (from both the local and remote clients).
  1725. //
  1726. // Params: None
  1727. //
  1728. //
  1729. //
  1730. //
  1731. // Name: WBP_EVENT_PAGE_DELETE_IND
  1732. //
  1733. // Purpose: Inform the client that a delete request has been issued for
  1734. // a page. The client should call WBP_PageDeleteConfirm as soon
  1735. // as possible.
  1736. //
  1737. // Params: param16 Handle of the page being deleted
  1738. //
  1739. //
  1740. //
  1741. //
  1742. // Name: WBP_EVENT_GRAPHIC_ADDED
  1743. //
  1744. // Purpose: Inform the client that a new graphic object has been added to
  1745. // a page. This event is generated for all object adds including
  1746. // those originating with the client.
  1747. //
  1748. // Params: param16 Handle of the page to which the object has been added
  1749. // param32 Handle of the object which has been added
  1750. //
  1751. //
  1752. //
  1753. //
  1754. // Name: WBP_EVENT_GRAPHIC_MOVED
  1755. //
  1756. // Purpose: Inform the client that a graphic object has been moved within
  1757. // a page. This event is generated for all object moves including
  1758. // those originating with the client.
  1759. //
  1760. // Params: param16 Handle of the page affected
  1761. // param32 Handle of the object affected
  1762. //
  1763. //
  1764. //
  1765. //
  1766. // Name: WBP_EVENT_GRAPHIC_UPDATE_IND
  1767. //
  1768. // Purpose: Inform the client that a request to update a graphic object has
  1769. // been issued. No changes have yet been made to the graphic.
  1770. // The client should call WBP_GraphicUpdateConfirm as soon as
  1771. // possible.
  1772. //
  1773. // Params: param16 Handle of the page affected
  1774. // param32 Handle of the object affected
  1775. //
  1776. //
  1777. //
  1778. //
  1779. // Name: WBP_EVENT_GRAPHIC_REPLACE_IND
  1780. //
  1781. // Purpose: Inform the client that a request to replace a graphic object has
  1782. // been issued. No changes have yet been made to the graphic.
  1783. // The client should call WBP_GraphicReplaceConfirm as soon as
  1784. // possible.
  1785. //
  1786. // Params: param16 Handle of the page affected
  1787. // param32 Handle of the object affected
  1788. //
  1789. //
  1790. //
  1791. //
  1792. // Name: WBP_EVENT_GRAPHIC_DELETE_IND
  1793. //
  1794. // Purpose: Inform the client that a request to delete a graphic object has
  1795. // been issued. No changes have yet been made to the graphic.
  1796. // The client should call WBP_GraphicDeleteConfirm as soon as
  1797. // possible.
  1798. //
  1799. // Params: param16 Handle of the page affected
  1800. // param32 Handle of the object affected
  1801. //
  1802. //
  1803. //
  1804. //
  1805. // Name: WBP_EVENT_PERSON_JOINED
  1806. //
  1807. // Purpose: Inform the client that a new person has joined the call.
  1808. //
  1809. // Params: param16 reserved
  1810. // param32 Handle of the person that has just joined
  1811. //
  1812. //
  1813. //
  1814. //
  1815. // Name: WBP_EVENT_PERSON_LEFT
  1816. //
  1817. // Purpose: Inform the client that a person has left the call.
  1818. //
  1819. // Params: param16 reserved
  1820. // param32 Handle of the person that has just left
  1821. //
  1822. //
  1823. //
  1824. //
  1825. // Name: WBP_EVENT_PERSON_UPDATED
  1826. //
  1827. // Purpose: Inform the client that the some person information has changed.
  1828. //
  1829. // Params: param16 reserved
  1830. // param32 Handle of the person affected
  1831. //
  1832. //
  1833. //
  1834. //
  1835. // Name: WBP_EVENT_LOAD_COMPLETE
  1836. //
  1837. // Purpose: Inform the client that an attempt to load a Whiteboard file
  1838. // has completed successfully.
  1839. //
  1840. // Params: none
  1841. //
  1842. //
  1843. //
  1844. //
  1845. // Name: WBP_EVENT_LOAD_FAILED
  1846. //
  1847. // Purpose: Inform the client that an attempt to load a page from a
  1848. // whiteboard file has failed. The load is cancelled at the point
  1849. // the error occurred, but any objects/pages which were
  1850. // successfully read in will remain.
  1851. //
  1852. // Params: none
  1853. //
  1854. //
  1855. //
  1856. //
  1857. // Name: WBP_EVENT_INSERT_OBJECTS
  1858. //
  1859. // Purpose: Inform the client that objects created by the secondary api
  1860. // client may be inserted. This event is posted when the whiteboard
  1861. // lock has been released.
  1862. //
  1863. // Params: none
  1864. //
  1865. //
  1866. //
  1867. //
  1868. // Name: WBP_EVENT_INSERT_NEXT
  1869. //
  1870. // Purpose: Inform the client that the next secondary api object may be
  1871. // inserted.
  1872. //
  1873. // Params: param16 index of the object to be inserted
  1874. // param32 reserved
  1875. //
  1876. //
  1877. //
  1878. //
  1879. // Name: WBP_EVENT_SYNC_POSITION_UPDATED
  1880. //
  1881. // Purpose: Inform the client that the sync position information has been
  1882. // updated.
  1883. //
  1884. // Params: param16 reserved
  1885. // param32 reserved
  1886. //
  1887. //
  1888. #endif // _HPP_WB