comparison src/gtkutil.h @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 23a1cea22d13
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 /* Definitions and headers for GTK widgets. 1 /* Definitions and headers for GTK widgets.
2 Copyright (C) 2003 2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3 Free Software Foundation, Inc.
4 3
5 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
6 5
7 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details. 14 GNU General Public License for more details.
16 15
17 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
18 along with GNU Emacs; see the file COPYING. If not, write to 17 along with GNU Emacs; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02110-1301, USA. */
21 20
22 #ifndef GTKUTIL_H 21 #ifndef GTKUTIL_H
23 #define GTKUTIL_H 22 #define GTKUTIL_H
24 23
25 24
28 #include <gtk/gtk.h> 27 #include <gtk/gtk.h>
29 #include "frame.h" 28 #include "frame.h"
30 29
31 /* Minimum and maximum values used for GTK scroll bars */ 30 /* Minimum and maximum values used for GTK scroll bars */
32 31
33 #define XG_SB_MIN 0 32 #define XG_SB_MIN 1
34 #define XG_SB_MAX 10000000 33 #define XG_SB_MAX 10000000
34 #define XG_SB_RANGE (XG_SB_MAX-XG_SB_MIN)
35 35
36 /* Key for data that is valid for menus in a frame */ 36 /* Key for data that is valid for menus in a frame */
37 #define XG_FRAME_DATA "emacs_frame" 37 #define XG_FRAME_DATA "emacs_frame"
38 38
39 /* Key for data that is the last scrollbar value */ 39 /* Key for data that is the last scrollbar value */
93 This is an adaption from lwlib for Gtk so we can use more of the same 93 This is an adaption from lwlib for Gtk so we can use more of the same
94 code as lwlib in xmenu.c. */ 94 code as lwlib in xmenu.c. */
95 typedef struct _widget_value 95 typedef struct _widget_value
96 { 96 {
97 /* name of widget */ 97 /* name of widget */
98 Lisp_Object lname;
98 char *name; 99 char *name;
99 /* value (meaning depend on widget type) */ 100 /* value (meaning depend on widget type) */
100 char *value; 101 char *value;
101 /* keyboard equivalent. no implications for XtTranslations */ 102 /* keyboard equivalent. no implications for XtTranslations */
103 Lisp_Object lkey;
102 char *key; 104 char *key;
103 /* Help string or nil if none. 105 /* Help string or nil if none.
104 GC finds this string through the frame's menu_bar_vector 106 GC finds this string through the frame's menu_bar_vector
105 or through menu_items. */ 107 or through menu_items. */
106 Lisp_Object help; 108 Lisp_Object help;
121 one on the free list if this one has been deallocated. 123 one on the free list if this one has been deallocated.
122 */ 124 */
123 struct _widget_value *free_list; 125 struct _widget_value *free_list;
124 } widget_value; 126 } widget_value;
125 127
128 #ifdef HAVE_GTK_FILE_BOTH
129 extern int use_old_gtk_file_dialog;
130 #endif
131
126 extern widget_value *malloc_widget_value P_ ((void)); 132 extern widget_value *malloc_widget_value P_ ((void));
127 extern void free_widget_value P_ ((widget_value *)); 133 extern void free_widget_value P_ ((widget_value *));
134
135 extern int xg_uses_old_file_dialog P_ ((void));
128 136
129 extern char *xg_get_file_name P_ ((FRAME_PTR f, 137 extern char *xg_get_file_name P_ ((FRAME_PTR f,
130 char *prompt, 138 char *prompt,
131 char *default_filename, 139 char *default_filename,
132 int mustmatch_p)); 140 int mustmatch_p,
141 int only_dir_p));
133 142
134 extern GtkWidget *xg_create_widget P_ ((char *type, 143 extern GtkWidget *xg_create_widget P_ ((char *type,
135 char *name, 144 char *name,
136 FRAME_PTR f, 145 FRAME_PTR f,
137 widget_value *val, 146 widget_value *val,
147 GCallback deactivate_cb, 156 GCallback deactivate_cb,
148 GCallback hightlight_cb)); 157 GCallback hightlight_cb));
149 158
150 extern int xg_update_frame_menubar P_ ((FRAME_PTR f)); 159 extern int xg_update_frame_menubar P_ ((FRAME_PTR f));
151 160
152 extern void xg_keep_popup P_ ((GtkWidget *menu, GtkWidget *submenu)); 161 extern int xg_have_tear_offs P_ ((void));
162
163 extern int xg_get_scroll_id_for_window P_ ((Display *dpy, Window wid));
153 164
154 extern void xg_create_scroll_bar P_ ((FRAME_PTR f, 165 extern void xg_create_scroll_bar P_ ((FRAME_PTR f,
155 struct scroll_bar *bar, 166 struct scroll_bar *bar,
156 GCallback scroll_callback, 167 GCallback scroll_callback,
157 char *scroll_bar_name)); 168 char *scroll_bar_name));
176 187
177 extern void xg_resize_widgets P_ ((FRAME_PTR f, 188 extern void xg_resize_widgets P_ ((FRAME_PTR f,
178 int pixelwidth, 189 int pixelwidth,
179 int pixelheight)); 190 int pixelheight));
180 extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows)); 191 extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows));
181 extern GtkWidget * xg_win_to_widget P_ ((Window)); 192 extern GtkWidget * xg_win_to_widget P_ ((Display *dpy, Window wdesc));
193
194 extern int xg_display_open P_ ((char *display_name, Display **dpy));
195 extern void xg_display_close P_ ((Display *dpy));
196 extern GdkCursor * xg_create_default_cursor P_ ((Display *dpy));
197
182 extern int xg_create_frame_widgets P_ ((FRAME_PTR f)); 198 extern int xg_create_frame_widgets P_ ((FRAME_PTR f));
183 extern void x_wm_set_size_hint P_ ((FRAME_PTR f, 199 extern void x_wm_set_size_hint P_ ((FRAME_PTR f,
184 long flags, 200 long flags,
185 int user_position)); 201 int user_position));
186 extern void xg_set_background_color P_ ((FRAME_PTR f, unsigned long bg)); 202 extern void xg_set_background_color P_ ((FRAME_PTR f, unsigned long bg));
187 203
204 extern void xg_set_frame_icon P_ ((FRAME_PTR f,
205 Pixmap icon_pixmap,
206 Pixmap icon_mask));
207
188 /* Mark all callback data that are Lisp_object:s during GC. */ 208 /* Mark all callback data that are Lisp_object:s during GC. */
189 extern void xg_mark_data P_ ((void)); 209 extern void xg_mark_data P_ ((void));
190 210
191 /* Initialize GTK specific parts. */ 211 /* Initialize GTK specific parts. */
192 extern void xg_initialize P_ ((void)); 212 extern void xg_initialize P_ ((void));
193 213
194 /* Setting scrollbar values invokes the callback. Use this variable 214 /* Setting scrollbar values invokes the callback. Use this variable
195 to indicate that the callback should do nothing. */ 215 to indicate that the callback should do nothing. */
196 extern int xg_ignore_gtk_scrollbar; 216 extern int xg_ignore_gtk_scrollbar;
197 217
198 /* After we send a scroll bar event, x_set_toolkit_scroll_bar_thumb will
199 be called. For some reason that needs to be debugged, it gets called
200 with bad values. Thus, we set this variable to ignore those calls. */
201 extern int xg_ignore_next_thumb;
202
203 /* If a detach of a menu is done, this is the menu widget that got
204 detached. Must be set to NULL before popping up popup menus.
205 Used with xg_keep_popup to delay deleting popup menus when they
206 have been detached. */
207 extern GtkWidget *xg_did_tearoff;
208
209 #endif /* USE_GTK */ 218 #endif /* USE_GTK */
210 #endif /* GTKUTIL_H */ 219 #endif /* GTKUTIL_H */
220
221 /* arch-tag: 0757f3dc-00c7-4cee-9e4c-282cf1d34c72
222 (do not change this comment) */