2005-03-12 23:38:43 +00:00
|
|
|
/* Internals of a lightweight menubar widget.
|
2005-08-07 10:56:27 +00:00
|
|
|
Copyright (C) 1999, 2000, 2002, 2003, 2004,
|
2006-02-05 23:44:47 +00:00
|
|
|
2005, 2006 Free Software Foundation, Inc.
|
2005-03-12 23:38:43 +00:00
|
|
|
|
|
|
|
This file is part of the Lucid Widget Library.
|
|
|
|
|
|
|
|
The Lucid Widget Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
The Lucid Widget Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GNU Emacs; see the file COPYING. If not, write to the
|
2005-07-04 15:47:28 +00:00
|
|
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA. */
|
2005-03-12 23:38:43 +00:00
|
|
|
|
1994-05-06 17:28:42 +00:00
|
|
|
#ifndef _XlwMenuP_h
|
|
|
|
#define _XlwMenuP_h
|
|
|
|
|
|
|
|
#include "xlwmenu.h"
|
|
|
|
#include <X11/CoreP.h>
|
|
|
|
|
|
|
|
/* Elements in the stack arrays. */
|
|
|
|
typedef struct _window_state
|
|
|
|
{
|
|
|
|
Window window;
|
|
|
|
Position x;
|
|
|
|
Position y;
|
|
|
|
Dimension width;
|
|
|
|
Dimension height;
|
|
|
|
Dimension label_width;
|
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
/* Width of toggle buttons or radio buttons. */
|
|
|
|
Dimension button_width;
|
1994-05-06 17:28:42 +00:00
|
|
|
} window_state;
|
|
|
|
|
|
|
|
|
|
|
|
/* New fields for the XlwMenu widget instance record */
|
2002-05-06 18:54:28 +00:00
|
|
|
typedef struct _XlwMenu_part
|
1994-05-06 17:28:42 +00:00
|
|
|
{
|
|
|
|
/* slots set by the resources */
|
2005-03-18 04:19:41 +00:00
|
|
|
#ifdef HAVE_X_I18N
|
2005-04-01 18:42:33 +00:00
|
|
|
XFontSet fontSet;
|
2005-03-18 04:19:41 +00:00
|
|
|
XFontSetExtents *font_extents;
|
|
|
|
#endif
|
2005-04-01 18:42:33 +00:00
|
|
|
XFontStruct* font;
|
1994-05-06 17:29:23 +00:00
|
|
|
Pixel foreground;
|
2002-05-06 18:54:28 +00:00
|
|
|
Pixel disabled_foreground;
|
1994-05-06 17:28:42 +00:00
|
|
|
Pixel button_foreground;
|
|
|
|
Dimension margin;
|
|
|
|
Dimension horizontal_spacing;
|
|
|
|
Dimension vertical_spacing;
|
|
|
|
Dimension arrow_spacing;
|
|
|
|
Dimension shadow_thickness;
|
|
|
|
Pixel top_shadow_color;
|
|
|
|
Pixel bottom_shadow_color;
|
|
|
|
Pixmap top_shadow_pixmap;
|
|
|
|
Pixmap bottom_shadow_pixmap;
|
1994-05-06 17:29:23 +00:00
|
|
|
Cursor cursor_shape;
|
1994-05-06 17:28:42 +00:00
|
|
|
XtCallbackList open;
|
2000-01-17 09:11:23 +00:00
|
|
|
XtCallbackList select, highlight;
|
1994-05-06 17:28:42 +00:00
|
|
|
widget_value* contents;
|
|
|
|
int horizontal;
|
2000-06-16 18:33:58 +00:00
|
|
|
|
|
|
|
/* True means top_shadow_color and/or bottom_shadow_color must be freed. */
|
|
|
|
unsigned free_top_shadow_color_p : 1;
|
|
|
|
unsigned free_bottom_shadow_color_p : 1;
|
2002-05-06 18:54:28 +00:00
|
|
|
|
1994-05-06 17:28:42 +00:00
|
|
|
/* State of the XlwMenu */
|
2004-01-12 01:45:22 +00:00
|
|
|
int top_depth;
|
1994-05-06 17:28:42 +00:00
|
|
|
int old_depth;
|
|
|
|
widget_value** old_stack;
|
|
|
|
int old_stack_length;
|
|
|
|
|
|
|
|
/* New state after the user moved */
|
|
|
|
int new_depth;
|
|
|
|
widget_value** new_stack;
|
|
|
|
int new_stack_length;
|
|
|
|
|
|
|
|
/* Window resources */
|
|
|
|
window_state* windows;
|
|
|
|
int windows_length;
|
|
|
|
|
|
|
|
/* Internal part, set by the XlwMenu */
|
|
|
|
GC foreground_gc;
|
|
|
|
GC button_gc;
|
|
|
|
GC background_gc;
|
2002-05-06 18:54:28 +00:00
|
|
|
GC disabled_gc;
|
1994-05-06 17:28:42 +00:00
|
|
|
GC inactive_button_gc;
|
|
|
|
GC shadow_top_gc;
|
|
|
|
GC shadow_bottom_gc;
|
|
|
|
Cursor cursor;
|
|
|
|
Boolean popped_up;
|
|
|
|
Pixmap gray_pixmap;
|
|
|
|
} XlwMenuPart;
|
|
|
|
|
|
|
|
/* Full instance record declaration */
|
2002-05-06 18:54:28 +00:00
|
|
|
typedef struct _XlwMenuRec
|
1994-05-06 17:28:42 +00:00
|
|
|
{
|
|
|
|
CorePart core;
|
|
|
|
XlwMenuPart menu;
|
|
|
|
} XlwMenuRec;
|
|
|
|
|
|
|
|
/* New fields for the XlwMenu widget class record */
|
2002-05-06 18:54:28 +00:00
|
|
|
typedef struct
|
1994-05-06 17:28:42 +00:00
|
|
|
{
|
|
|
|
int dummy;
|
|
|
|
} XlwMenuClassPart;
|
|
|
|
|
|
|
|
/* Full class record declaration. */
|
2002-05-06 18:54:28 +00:00
|
|
|
typedef struct _XlwMenuClassRec
|
1994-05-06 17:28:42 +00:00
|
|
|
{
|
|
|
|
CoreClassPart core_class;
|
|
|
|
XlwMenuClassPart menu_class;
|
|
|
|
} XlwMenuClassRec;
|
|
|
|
|
|
|
|
/* Class pointer. */
|
|
|
|
extern XlwMenuClassRec xlwMenuClassRec;
|
|
|
|
|
|
|
|
#endif /* _XlwMenuP_h */
|
2003-09-01 15:45:59 +00:00
|
|
|
|
|
|
|
/* arch-tag: 18d7fc41-ffa0-47a3-a49f-3469900c7a25
|
|
|
|
(do not change this comment) */
|