declare smobs in alloc.c
[bpt/emacs.git] / lwlib / lwlib-widget.h
CommitLineData
181f08a7
PE
1/*
2Copyright (C) 1992, 1993 Lucid, Inc.
3Copyright (C) 1994, 1999-2014 Free Software Foundation, Inc.
4
5This file is part of the Lucid Widget Library.
6
7The Lucid Widget Library is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 1, or (at your option)
10any later version.
11
12The Lucid Widget Library is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20/* This part is separate from lwlib.h because it does not need X,
21 and thus can be used by non-X code in Emacs proper. */
22
23#ifndef LWLIB_WIDGET_H
24#define LWLIB_WIDGET_H
25
26typedef enum
27{
28 NO_CHANGE = 0,
29 INVISIBLE_CHANGE = 1,
30 VISIBLE_CHANGE = 2,
31 STRUCTURAL_CHANGE = 3
32} change_type;
33
34enum button_type
35{
36 BUTTON_TYPE_NONE,
37 BUTTON_TYPE_TOGGLE,
38 BUTTON_TYPE_RADIO
39};
40
41typedef struct _widget_value
42{
43 /* Name of widget. */
44 Lisp_Object lname;
45 char *name;
46
47 /* Value (meaning depend on widget type). */
48 char *value;
49
50 /* Keyboard equivalent. no implications for XtTranslations. */
51 Lisp_Object lkey;
52 char *key;
53
54 /* Help string or nil if none.
55 GC finds this string through the frame's menu_bar_vector
56 or through menu_items. */
57 Lisp_Object help;
58
59 /* True if enabled. */
60 bool enabled;
61
62 /* True if selected. */
63 bool selected;
64
65 /* True if was edited (maintained by get_value). */
66 bool edited;
67
68#ifdef HAVE_NTGUI
69 /* True if menu title. */
70 bool title;
71#endif
72
73 /* The type of a button. */
74 enum button_type button_type;
75
181f08a7
PE
76 /* Contents of the sub-widgets, also selected slot for checkbox. */
77 struct _widget_value *contents;
78
79 /* Data passed to callback. */
80 void *call_data;
81
82 /* Next one in the list. */
83 struct _widget_value *next;
84
39ec0314
DA
85#ifdef USE_X_TOOLKIT
86 /* Type of change (maintained by lw library). */
87 change_type change;
88
89 /* Type of this widget's change, but not counting the other widgets
90 found in the `next' field. */
91 change_type this_one_change;
92
181f08a7
PE
93 /* Slot for the toolkit dependent part. Always initialize to NULL. */
94 void *toolkit_data;
95
96 /* Whether we should free the toolkit data slot when freeing the
97 widget_value itself. */
98 bool free_toolkit_data;
39ec0314
DA
99#endif
100
181f08a7
PE
101} widget_value;
102
103#endif