buttonbar.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. typedef struct WButtonBar
  14. {
  15. Widget widget;
  16. gboolean visible; /* Is it visible? */
  17. struct
  18. {
  19. char *text;
  20. long command;
  21. Widget *receiver;
  22. int end_coord; /* cumulative width of buttons so far */
  23. } labels[BUTTONBAR_LABELS_NUM];
  24. } WButtonBar;
  25. /*** global variables defined in .c file *********************************************************/
  26. /*** declarations of public functions ************************************************************/
  27. WButtonBar *buttonbar_new (gboolean visible);
  28. void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
  29. const global_keymap_t * keymap, Widget * receiver);
  30. WButtonBar *find_buttonbar (const WDialog * h);
  31. /*** inline functions ****************************************************************************/
  32. static inline void
  33. buttonbar_set_visible (WButtonBar * bb, gboolean visible)
  34. {
  35. bb->visible = visible;
  36. }
  37. #endif /* MC__WIDGET_BUTTONBAR_H */