home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / patches / newbar / Source / NewBar / h / iconmgr < prev    next >
Encoding:
Text File  |  1998-08-01  |  2.1 KB  |  63 lines

  1.  
  2. /* iconmgr.h */
  3.  
  4. #ifndef iconbar_manager_H
  5. #define iconbar_manager_H
  6.  
  7. #include "OS:wimp.h"
  8.  
  9. #include "gadget.h"
  10. #include "ibarpatch.h"
  11.  
  12.  
  13. /* Abstract structures used to delegate the task of arranging icons */
  14.  
  15. typedef struct iconbar_arranger iconbar_arranger;
  16. typedef struct iconbar_arranger_add_info iconbar_arranger_add_info;
  17.  
  18. /* This structure provides two functions, for adding and removing icons in
  19.    a host window.  The client can return a handle to be used when later
  20.    removing the icon. */
  21. struct iconbar_arranger {
  22.   void *(*add_icon)(iconbar_arranger *arranger, iconbar_gadget *gadget,
  23.         const iconbar_arranger_add_info *info);
  24.   void (*remove_icon)(iconbar_arranger *arranger, iconbar_gadget *gadget,
  25.         void *handle);
  26. };
  27.  
  28. /* This is passed to the add function above, with positional information
  29.    about the icon in question.  Taking note of this info is optional. */
  30. struct iconbar_arranger_add_info {
  31.   /* Icon priority:  negative numbers are on the left, positive (and zero)
  32.      numbers are on the right; numbers closest to zero are nearest to the
  33.      middle of the iconbar. */
  34.   int priority;
  35.   /* If the new icon has the same priority as another, setting this means the
  36.      new icon should be on the higher priority side of the icon (ie. to the
  37.      right of it). */
  38.   unsigned tend_higher: 1;
  39.   /* Handle of icon to create the new icon next to.  May be 0.  This should
  40.      be used in preference to icon priority; tend_higher also still
  41.      applies. */
  42.   void *next_to;
  43. };
  44.  
  45.  
  46. /* Contents private */
  47. typedef struct iconbar_manager_task iconbar_manager_task;
  48.  
  49. extern iconbar_manager_task *iconbar_manager_this_task;
  50.  
  51. iconbar_manager_task *iconbar_manager_initialise(iconbar_arranger *arranger);
  52. void iconbar_manager_finalise(iconbar_manager_task *task);
  53.  
  54. /* The arranger's method for informing that it is closing down. */
  55. void iconbar_manager_losing_icon(iconbar_manager_task *task,
  56.     iconbar_gadget *gadget);
  57. /* Does wimp_get_pointer_info without fudging window handles, etc. */
  58. void iconbar_manager_get_pointer_info(iconbar_manager_task *task,
  59.     wimp_pointer *pointer);
  60.  
  61.  
  62. #endif
  63.