home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / patches / newbar / Source / NewBar / h / ibarpatch < prev    next >
Encoding:
Text File  |  1998-07-30  |  2.6 KB  |  106 lines

  1.  
  2. /* ibarpatch.h */
  3.  
  4. #ifndef ibarpatch_H
  5. #define ibarpatch_H
  6.  
  7. #include "OS:wimp.h"
  8.  
  9.  
  10. /* Structures and defines */
  11.  
  12. /* These are the structures used by the IconbarPatch module, so any change
  13.    here must naturally be mirrored by a change in the module. */
  14.  
  15. typedef struct ibarpatch_block ibarpatch_block;
  16. typedef struct ibarpatch_list ibarpatch_list;
  17. typedef struct ibarpatch_element ibarpatch_element;
  18. typedef struct ibarpatch_add_info ibarpatch_add_info;
  19.  
  20. /* The add icon event */
  21.  
  22. struct ibarpatch_add_info {
  23.   int icon_handle;
  24.   wimp_t task;     /* Task handle of icon creator */
  25.   union {
  26.     int priority,  /* Priority of icon */
  27.     next_to;   /* Icon to create next to (-1 means extreme left/right) */
  28.   } extra;
  29.   wimp_w position; /* The `window handle' used to create icon with */
  30.   wimp_icon_flags flags;
  31.   wimp_icon_data data;
  32. };
  33.  
  34. /* Queue element */
  35.  
  36. #define ibarpatch_add_type    0
  37. #define ibarpatch_remove_type    1
  38. #define ibarpatch_update_type    2
  39.  
  40. struct ibarpatch_element {
  41.   ibarpatch_element *next;
  42.   int type;
  43.  
  44.   union {
  45.     ibarpatch_add_info add;
  46.     struct {
  47.       int icon_handle;
  48.     } remove;
  49.     struct {
  50.       int bic, eor, icon_handle;
  51.     } update;
  52.   } data;
  53. };
  54.  
  55. /* A list of elements (gives list beginning, end, and number of elements) */
  56.  
  57. struct ibarpatch_list {
  58.   ibarpatch_element *begin, **end;
  59.   int count;
  60. };
  61.  
  62. /* IconbarPatch's main workspace block */
  63.  
  64. #define ibarpatch_remove_title    (1<<0)
  65. #define ibarpatch_y_absolute    (1<<1)
  66.  
  67. struct ibarpatch_block {
  68.   int usage_count; /* Module's usage count. */
  69.   /* The list of events to handle, and record of old events. */
  70.   ibarpatch_list list, list_keep;
  71. //  ibarpatch_element *list_begin, **list_end,
  72. //        *list_keep_begin, **list_keep_end;
  73.   /* These control how menus are opened. */
  74.   int x_offset, y_offset, flags;
  75.   /* IconbarPatch's internal handle count and debug file handle. */
  76.   int icon_count, debug_file;
  77.   /* Whether iconbar can start on Service_StartWimp. */
  78.   int start_flag;
  79.   /* Data to fiddle Wimp_GetPointerInfo and Wimp_SendMessage with. */
  80.   wimp_w window;
  81.   int pointer_icon;
  82.   wimp_t pointer_task;
  83.   /* What to return for Wimp_GetWindowState on the iconbar. */
  84.   wimp_window_state iconbar_state;
  85. };
  86.  
  87.  
  88. /* Functions and structures (in hacky.c) */
  89.  
  90. #include "gadget.h"
  91.  
  92. /* These are independent of IconbarPatch. */
  93.  
  94. typedef struct ibarpatch_icon_properties ibarpatch_icon_properties;
  95. struct ibarpatch_icon_properties {
  96.   char *text;
  97.   sprite_details sprite;
  98. };
  99.  
  100. ibarpatch_icon_properties *ibarpatch_extract_info(wimp_t task,
  101.     wimp_icon_flags flags, const wimp_icon_data *data);
  102. void ibarpatch_free_info(ibarpatch_icon_properties *info);
  103.  
  104.  
  105. #endif
  106.