xlwmenuP.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /* Internals of a lightweight menubar widget.
  2. Copyright (C) 2002-2012 Free Software Foundation, Inc.
  3. Copyright (C) 1992 Lucid, Inc.
  4. This file is part of the Lucid Widget Library.
  5. The Lucid Widget Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 1, or (at your option)
  8. any later version.
  9. The Lucid Widget Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GNU Emacs; see the file COPYING. If not, write to the
  15. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. Boston, MA 02110-1301, USA. */
  17. #ifndef _XlwMenuP_h
  18. #define _XlwMenuP_h
  19. #include "xlwmenu.h"
  20. #include <X11/CoreP.h>
  21. #ifdef HAVE_XFT
  22. #include <X11/Xft/Xft.h>
  23. #endif
  24. /* Elements in the stack arrays. */
  25. typedef struct _window_state
  26. {
  27. Widget w;
  28. Window window;
  29. Pixmap pixmap;
  30. Position x;
  31. Position y;
  32. Dimension width;
  33. Dimension height;
  34. Dimension label_width;
  35. int max_rest_width;
  36. /* Width of toggle buttons or radio buttons. */
  37. Dimension button_width;
  38. #ifdef HAVE_XFT
  39. XftDraw* xft_draw;
  40. #endif
  41. } window_state;
  42. /* New fields for the XlwMenu widget instance record */
  43. typedef struct _XlwMenu_part
  44. {
  45. /* slots set by the resources */
  46. #ifdef HAVE_X_I18N
  47. XFontSet fontSet;
  48. XFontSetExtents *font_extents;
  49. #endif
  50. #ifdef HAVE_XFT
  51. int default_face;
  52. XftFont* xft_font;
  53. XftColor xft_fg, xft_bg, xft_disabled_fg;
  54. #endif
  55. String fontName;
  56. XFontStruct* font;
  57. Pixel foreground;
  58. Pixel disabled_foreground;
  59. Pixel button_foreground;
  60. Dimension margin;
  61. Dimension horizontal_spacing;
  62. Dimension vertical_spacing;
  63. Dimension arrow_spacing;
  64. Dimension shadow_thickness;
  65. Pixel top_shadow_color;
  66. Pixel bottom_shadow_color;
  67. Pixmap top_shadow_pixmap;
  68. Pixmap bottom_shadow_pixmap;
  69. Cursor cursor_shape;
  70. XtCallbackList open;
  71. XtCallbackList select, highlight;
  72. XtCallbackList enter, leave;
  73. widget_value* contents;
  74. int horizontal;
  75. /* True means top_shadow_color and/or bottom_shadow_color must be freed. */
  76. unsigned free_top_shadow_color_p : 1;
  77. unsigned free_bottom_shadow_color_p : 1;
  78. /* State of the XlwMenu */
  79. int top_depth;
  80. int old_depth;
  81. widget_value** old_stack;
  82. int old_stack_length;
  83. widget_value* inside_entry;
  84. /* New state after the user moved */
  85. int new_depth;
  86. widget_value** new_stack;
  87. int new_stack_length;
  88. /* Window resources */
  89. window_state* windows;
  90. int windows_length;
  91. /* Internal part, set by the XlwMenu */
  92. GC foreground_gc;
  93. GC button_gc;
  94. GC background_gc;
  95. GC disabled_gc;
  96. GC inactive_button_gc;
  97. GC shadow_top_gc;
  98. GC shadow_bottom_gc;
  99. Cursor cursor;
  100. Boolean popped_up;
  101. Pixmap gray_pixmap;
  102. } XlwMenuPart;
  103. /* Full instance record declaration */
  104. typedef struct _XlwMenuRec
  105. {
  106. CorePart core;
  107. XlwMenuPart menu;
  108. } XlwMenuRec;
  109. /* New fields for the XlwMenu widget class record */
  110. typedef struct
  111. {
  112. int dummy;
  113. } XlwMenuClassPart;
  114. /* Full class record declaration. */
  115. typedef struct _XlwMenuClassRec
  116. {
  117. CoreClassPart core_class;
  118. XlwMenuClassPart menu_class;
  119. } XlwMenuClassRec;
  120. /* Class pointer. */
  121. extern XlwMenuClassRec xlwMenuClassRec;
  122. #endif /* _XlwMenuP_h */