annotate src/toolbar.h @ 215:1f0dabaa0855 r20-4b6

Import from CVS: tag r20-4b6
author cvs
date Mon, 13 Aug 2007 10:07:35 +0200
parents e45d5e7c476e
children c5d627a313b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Define general toolbar support.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995 Board of Trustees, University of Illinois.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 Copyright (C) 1996 Chuck Thompson.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #ifndef _XEMACS_TOOLBAR_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #define _XEMACS_TOOLBAR_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include "specifier.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #ifdef HAVE_TOOLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 /* There are 4 of these per frame. They don't really need to be an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 lrecord (they're not lisp-accessible) but it makes marking slightly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 more modular. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 struct toolbar_data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 struct lcrecord_header header;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 /* The last buffer for which the toolbars were displayed. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 Lisp_Object last_toolbar_buffer;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 /* The actual buttons are chained through this. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 Lisp_Object toolbar_buttons;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 DECLARE_LRECORD (toolbar_data, struct toolbar_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 #define XTOOLBAR_DATA(x) XRECORD (x, toolbar_data, struct toolbar_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #define XSETTOOLBAR_DATA(x, p) XSETRECORD (x, p, toolbar_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #define TOOLBAR_DATAP(x) RECORDP (x, toolbar_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 #define GC_TOOLBAR_DATAP(x) GC_RECORDP (x, toolbar_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #define CHECK_TOOLBAR_DATA(x) CHECK_RECORD (x, toolbar_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 #define CONCHECK_TOOLBAR_DATA(x) CONCHECK_RECORD (x, toolbar_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 #define FRAME_TOOLBAR_DATA(frame, position) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (XTOOLBAR_DATA ((frame)->toolbar_data[position]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 #define FRAME_TOOLBAR_BUFFER(frame, position) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (XTOOLBAR_DATA ((frame)->toolbar_data[position])->last_toolbar_buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 /* These are chained together through toolbar_buttons in struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 toolbar_data. These don't need to be an lrecord either, but again,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 it makes marking easier. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 struct toolbar_button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 struct lcrecord_header header;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 Lisp_Object next;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 Lisp_Object frame;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 Lisp_Object up_glyph;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 Lisp_Object down_glyph;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 Lisp_Object disabled_glyph;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 Lisp_Object cap_up_glyph;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 Lisp_Object cap_down_glyph;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 Lisp_Object cap_disabled_glyph;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 Lisp_Object callback;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 Lisp_Object enabled_p;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 Lisp_Object help_string;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 char enabled;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 char down;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 char pushright;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 char blank;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 int x, y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 int width, height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 int dirty;
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 207
diff changeset
89 /* is this button in a left or right toolbar? */
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 207
diff changeset
90 int vertical;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 207
diff changeset
91 /* border_width when this button was layed out */
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 207
diff changeset
92 int border_width;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 DECLARE_LRECORD (toolbar_button, struct toolbar_button);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 #define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 #define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #define GC_TOOLBAR_BUTTONP(x) GC_RECORDP (x, toolbar_button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 #define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 extern void get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 int *y, int *width, int *height, int *vert,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 int for_layout);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 extern Lisp_Object toolbar_button_at_pixpos (struct frame *f, int x_coord,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 int y_coord);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 DECLARE_SPECIFIER_TYPE (toolbar);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 #define XTOOLBAR_SPECIFIER(x) XSPECIFIER_TYPE (x, toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #define XSETTOOLBAR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #define TOOLBAR_SPECIFIERP(x) SPECIFIER_TYPEP (x, toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 #define CHECK_TOOLBAR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #define CONCHECK_TOOLBAR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #define DEFAULT_TOOLBAR_HEIGHT 37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 #define DEFAULT_TOOLBAR_WIDTH 40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #define DEFAULT_TOOLBAR_BLANK_SIZE 8
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 207
diff changeset
118 #define DEFAULT_TOOLBAR_BORDER_WIDTH 0
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 0
diff changeset
119 #define MINIMUM_SHADOW_THICKNESS 1
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 extern Lisp_Object Vtoolbar_size[4];
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 207
diff changeset
122 extern Lisp_Object Vtoolbar_border_width[4];
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 void update_frame_toolbars (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 void init_frame_toolbars (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 void init_device_toolbars (struct device *d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 void init_global_toolbars (struct device *d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 void free_frame_toolbars (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 Lisp_Object get_toolbar_button_glyph (struct window *w,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 struct toolbar_button *tb);
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 207
diff changeset
130 void mark_frame_toolbar_buttons_dirty (struct frame *f, enum toolbar_pos pos);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 #endif /* HAVE_TOOLBARS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 #endif /* _XEMACS_TOOLBAR_H_ */