root/lwlib/xlwmenuP.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


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

/* [<][>][^][v][top][bottom][index][help] */