buttonbar.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /** \file buttonbar.h
  2. * \brief Header: WButtonBar widget
  3. */
  4. #ifndef MC__WIDGET_BUTTONBAR_H
  5. #define MC__WIDGET_BUTTONBAR_H
  6. /*** typedefs(not structures) and defined constants **********************************************/
  7. #define BUTTONBAR(x) ((WButtonBar *)(x))
  8. /* number of bttons in buttonbar */
  9. #define BUTTONBAR_LABELS_NUM 10
  10. #define buttonbar_clear_label(bb, idx, recv) buttonbar_set_label (bb, idx, "", NULL, recv)
  11. /*** enums ***************************************************************************************/
  12. /*** structures declarations (and typedefs of structures)*****************************************/
  13. struct global_keymap_t;
  14. typedef struct WButtonBar
  15. {
  16. Widget widget;
  17. gboolean visible; /* Is it visible? */
  18. struct
  19. {
  20. char *text;
  21. unsigned long command;
  22. Widget *receiver;
  23. int end_coord; /* cumulative width of buttons so far */
  24. } labels[BUTTONBAR_LABELS_NUM];
  25. } WButtonBar;
  26. struct global_keymap_t;
  27. /*** global variables defined in .c file *********************************************************/
  28. /*** declarations of public functions ************************************************************/
  29. WButtonBar *buttonbar_new (gboolean visible);
  30. void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
  31. const struct global_keymap_t *keymap, const Widget * receiver);
  32. WButtonBar *find_buttonbar (const WDialog * h);
  33. /*** inline functions ****************************************************************************/
  34. static inline void
  35. buttonbar_set_visible (WButtonBar * bb, gboolean visible)
  36. {
  37. bb->visible = visible;
  38. }
  39. #endif /* MC__WIDGET_BUTTONBAR_H */