comparison src/event-gtk.c @ 793:e38acbeb1cae

[xemacs-hg @ 2002-03-29 04:46:17 by ben] lots o' fixes etc/ChangeLog: New file. Separated out all entries for etc/ into their own ChangeLog. Includes entries for the following files: etc/BABYL, etc/BETA, etc/CHARSETS, etc/DISTRIB, etc/Emacs.ad, etc/FTP, etc/GNUS-NEWS, etc/GOATS, etc/HELLO, etc/INSTALL, etc/MACHINES, etc/MAILINGLISTS, etc/MSDOS, etc/MYTHOLOGY, etc/NEWS, etc/OXYMORONS, etc/PACKAGES, etc/README, etc/TUTORIAL, etc/TUTORIAL.de, etc/TUTORIAL.ja, etc/TUTORIAL.ko, etc/TUTORIAL.se, etc/aliases.ksh, etc/altrasoft-logo.xpm, etc/check_cygwin_setup.sh, etc/custom/example-themes/europe-theme.el, etc/custom/example-themes/ex-custom-file, etc/custom/example-themes/example-theme.el, etc/e/eterm.ti, etc/edt-user.doc, etc/enriched.doc, etc/etags.1, etc/gnuserv.1, etc/gnuserv.README, etc/package-index.LATEST.gpg, etc/package-index.LATEST.pgp, etc/photos/jan.png, etc/recycle.xpm, etc/refcard.tex, etc/sample.Xdefaults, etc/sample.emacs, etc/sgml/CATALOG, etc/sgml/HTML32.dtd, etc/skk/SKK.tut.E, etc/smilies/Face_ase.xbm, etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm, etc/smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm, etc/sounds, etc/toolbar, etc/toolbar/workshop-cap-up.xpm, etc/xemacs-ja.1, etc/xemacs.1, etc/yow.lines, etc\BETA, etc\NEWS, etc\README, etc\TUTORIAL, etc\TUTORIAL.de, etc\check_cygwin_setup.sh, etc\sample.init.el, etc\unicode\README, etc\unicode\mule-ucs\*, etc\unicode\other\* unicode/unicode-consortium/8859-16.TXT: New file. mule/english.el: Define this charset now, since a bug was fixed that formerly prevented it. mule/ethio-util.el: Fix compile errors involving Unicode `characters', which should be integers. Makefile.in.in: Always include gui.c, to fix compile error when TTY-only. EmacsFrame.c, abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, bytecode.h, callint.c, callproc.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.c, console-msw.h, console-tty.c, console-x.c, console-x.h, console.c, console.h, data.c, database.c, device-gtk.c, device-msw.c, device-x.c, device.c, device.h, dialog-msw.c, doc.c, doprnt.c, dumper.c, dynarr.c, editfns.c, eldap.c, eldap.h, elhash.c, elhash.h, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, events.h, extents.c, extents.h, faces.c, faces.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, free-hook.c, general-slots.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gtk-xemacs.c, gui-msw.c, gui-x.c, gui-x.h, gui.c, gui.h, gutter.c, gutter.h, indent.c, input-method-xlib.c, insdel.c, keymap.c, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-canna.c, mule-ccl.c, mule-charset.c, mule-wnnfns.c, native-gtk-toolbar.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, opaque.c, opaque.h, postgresql.c, postgresql.h, print.c, process-unix.c, process.c, process.h, rangetab.c, rangetab.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, search.c, select-gtk.c, select-x.c, sound.c, specifier.c, specifier.h, strftime.c, symbols.c, symeval.h, syntax.h, text.c, text.h, toolbar-common.c, toolbar-msw.c, toolbar.c, toolbar.h, tooltalk.c, tooltalk.h, ui-gtk.c, ui-gtk.h, undo.c, vm-limit.c, window.c, window.h: Eliminate XSETFOO. Replace all usages with wrap_foo(). Make symbol->name a Lisp_Object, not Lisp_String *. Eliminate nearly all uses of Lisp_String * in favor of Lisp_Object, and correct macros so most of them favor Lisp_Object. Create new error-behavior ERROR_ME_DEBUG_WARN -- output warnings, but at level `debug' (usually ignored). Use it when instantiating specifiers, so problems can be debugged. Move log-warning-minimum-level into C so that we can optimize ERROR_ME_DEBUG_WARN. Fix warning levels consistent with new definitions. Add default_ and parent fields to char table; not yet implemented. New fun Dynarr_verify(); use for further error checking on Dynarrs. Rearrange code at top of lisp.h in conjunction with dynarr changes. Fix eifree(). Use Eistrings in various places (format_event_object(), where_is_to_char(), and callers thereof) to avoid fixed-size strings buffers. New fun write_eistring(). Reindent and fix GPM code to follow standards. Set default MS Windows font to Lucida Console (same size as Courier New but less interline spacing, so more lines fit). Increase default frame size on Windows to 50 lines. (If that's too big for the workspace, the frame will be shrunk as necessary.) Fix problem with text files with no newlines (). (Change `convert-eol' coding system to use `nil' for autodetect, consistent with make-coding-system.) Correct compile warnings in vm-limit.c. Fix handling of reverse-direction charsets to avoid errors when opening (e.g.) mule-ucs/lisp/reldata/uiso8859-6.el. Recode some object printing methods to use write_fmt_string() instead of a fixed buffer and sprintf. Turn on display of png comments as warnings (level `info'), now that they're unobtrusive. Revamped the sound documentation. Fixed bug in redisplay w.r.t. hscroll/truncation/continuation glyphs causing jumping up and down of the lines, since they're bigger than the line size. (It was seen most obviously when there's a horizontal scroll bar, e.g. do C-h a glyph or something like that.) The problem was that the glyph-contrib-p setting on glyphs was ignored even if it was set properly, which it wasn't until now.
author ben
date Fri, 29 Mar 2002 04:49:13 +0000
parents 755d0acc05ea
children a5954632b187
comparison
equal deleted inserted replaced
792:4e83fdb13eb9 793:e38acbeb1cae
124 { 124 {
125 Lisp_Object frm; 125 Lisp_Object frm;
126 Lisp_Object conser; 126 Lisp_Object conser;
127 struct gcpro gcpro1; 127 struct gcpro gcpro1;
128 128
129 XSETFRAME (frm, f); 129 frm = wrap_frame (f);
130 conser = Fcons (frm, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil)); 130 conser = Fcons (frm, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil));
131 GCPRO1 (conser); 131 GCPRO1 (conser);
132 132
133 emacs_handle_focus_change_preliminary (conser); 133 emacs_handle_focus_change_preliminary (conser);
134 enqueue_magic_eval_event (emacs_handle_focus_change_final, 134 enqueue_magic_eval_event (emacs_handle_focus_change_final,
140 /* both GDK_MAP and GDK_VISIBILITY_NOTIFY can cause this 140 /* both GDK_MAP and GDK_VISIBILITY_NOTIFY can cause this
141 JV is_visible has the same semantics as f->visible*/ 141 JV is_visible has the same semantics as f->visible*/
142 static void 142 static void
143 change_frame_visibility (struct frame *f, int is_visible) 143 change_frame_visibility (struct frame *f, int is_visible)
144 { 144 {
145 Lisp_Object frame; 145 Lisp_Object frame = wrap_frame (f);
146 146
147 XSETFRAME (frame, f);
148 147
149 if (!FRAME_VISIBLE_P (f) && is_visible) 148 if (!FRAME_VISIBLE_P (f) && is_visible)
150 { 149 {
151 FRAME_VISIBLE_P (f) = is_visible; 150 FRAME_VISIBLE_P (f) = is_visible;
152 /* This improves the double flicker when uniconifying a frame 151 /* This improves the double flicker when uniconifying a frame
171 } 170 }
172 171
173 static void 172 static void
174 handle_map_event (struct frame *f, GdkEvent *event) 173 handle_map_event (struct frame *f, GdkEvent *event)
175 { 174 {
176 Lisp_Object frame; 175 Lisp_Object frame = wrap_frame (f);
177 176
178 XSETFRAME (frame, f);
179 if (event->any.type == GDK_MAP) 177 if (event->any.type == GDK_MAP)
180 { 178 {
181 FRAME_GTK_TOTALLY_VISIBLE_P (f) = 1; 179 FRAME_GTK_TOTALLY_VISIBLE_P (f) = 1;
182 change_frame_visibility (f, 1); 180 change_frame_visibility (f, 1);
183 } 181 }
192 } 190 }
193 191
194 static void 192 static void
195 handle_client_message (struct frame *f, GdkEvent *event) 193 handle_client_message (struct frame *f, GdkEvent *event)
196 { 194 {
197 Lisp_Object frame; 195 Lisp_Object frame = wrap_frame (f);
198 196
199 XSETFRAME (frame, f);
200 197
201 /* The event-Xt code used to handle WM_DELETE_WINDOW here, but we 198 /* The event-Xt code used to handle WM_DELETE_WINDOW here, but we
202 handle that directly in frame-gtk.c */ 199 handle that directly in frame-gtk.c */
203 200
204 if (event->client.message_type == gdk_atom_intern ("WM_PROTOCOLS", 0) && 201 if (event->client.message_type == gdk_atom_intern ("WM_PROTOCOLS", 0) &&
267 break; 264 break;
268 265
269 case GDK_ENTER_NOTIFY: 266 case GDK_ENTER_NOTIFY:
270 if (event->crossing.detail != GDK_NOTIFY_INFERIOR) 267 if (event->crossing.detail != GDK_NOTIFY_INFERIOR)
271 { 268 {
272 Lisp_Object frame; 269 Lisp_Object frame = wrap_frame (f);
273 270
274 XSETFRAME (frame, f);
275 /* FRAME_X_MOUSE_P (f) = 1; */ 271 /* FRAME_X_MOUSE_P (f) = 1; */
276 va_run_hook_with_args (Qmouse_enter_frame_hook, 1, frame); 272 va_run_hook_with_args (Qmouse_enter_frame_hook, 1, frame);
277 } 273 }
278 break; 274 break;
279 275
280 case GDK_LEAVE_NOTIFY: 276 case GDK_LEAVE_NOTIFY:
281 if (event->crossing.detail != GDK_NOTIFY_INFERIOR) 277 if (event->crossing.detail != GDK_NOTIFY_INFERIOR)
282 { 278 {
283 Lisp_Object frame; 279 Lisp_Object frame = wrap_frame (f);
284 280
285 XSETFRAME (frame, f);
286 /* FRAME_X_MOUSE_P (f) = 0; */ 281 /* FRAME_X_MOUSE_P (f) = 0; */
287 va_run_hook_with_args (Qmouse_leave_frame_hook, 1, frame); 282 va_run_hook_with_args (Qmouse_leave_frame_hook, 1, frame);
288 } 283 }
289 break; 284 break;
290 285
786 emacs_gtk_select_process (struct Lisp_Process *p) 781 emacs_gtk_select_process (struct Lisp_Process *p)
787 { 782 {
788 Lisp_Object process; 783 Lisp_Object process;
789 int infd = event_stream_unixoid_select_process (p); 784 int infd = event_stream_unixoid_select_process (p);
790 785
791 XSETPROCESS (process, p); 786 process = wrap_process (p);
792 select_filedesc (infd, process); 787 select_filedesc (infd, process);
793 } 788 }
794 789
795 static void 790 static void
796 emacs_gtk_unselect_process (struct Lisp_Process *p) 791 emacs_gtk_unselect_process (struct Lisp_Process *p)
870 int infd; 865 int infd;
871 866
872 if (CONSOLE_GTK_P (con)) 867 if (CONSOLE_GTK_P (con))
873 return; /* Gtk consoles are automatically selected for when we initialize them */ 868 return; /* Gtk consoles are automatically selected for when we initialize them */
874 infd = event_stream_unixoid_select_console (con); 869 infd = event_stream_unixoid_select_console (con);
875 XSETCONSOLE (console, con); 870 console = wrap_console (con);
876 select_filedesc (infd, console); 871 select_filedesc (infd, console);
877 } 872 }
878 873
879 static void 874 static void
880 emacs_gtk_unselect_console (struct console *con) 875 emacs_gtk_unselect_console (struct console *con)
883 int infd; 878 int infd;
884 879
885 if (CONSOLE_GTK_P (con)) 880 if (CONSOLE_GTK_P (con))
886 return; /* X consoles are automatically selected for when we initialize them */ 881 return; /* X consoles are automatically selected for when we initialize them */
887 infd = event_stream_unixoid_unselect_console (con); 882 infd = event_stream_unixoid_unselect_console (con);
888 XSETCONSOLE (console, con); 883 console = wrap_console (con);
889 unselect_filedesc (infd); 884 unselect_filedesc (infd);
890 } 885 }
891 886
892 /* read an event from a tty, if one is available. Returns non-zero 887 /* read an event from a tty, if one is available. Returns non-zero
893 if an event was available. Note that when this function is 888 if an event was available. Note that when this function is
952 GCPRO4 (l_type, l_data, l_dndlist, l_item); 947 GCPRO4 (l_type, l_data, l_dndlist, l_item);
953 948
954 ev->event_type = misc_user_event; 949 ev->event_type = misc_user_event;
955 ev->timestamp = time; 950 ev->timestamp = time;
956 951
957 XSETFRAME (ev->channel, f); 952 ev->channel = wrap_frame (f);
958 953
959 ev->event.misc.x = x; 954 ev->event.misc.x = x;
960 ev->event.misc.y = y; 955 ev->event.misc.y = y;
961 956
962 if (data->type == preferred_targets[TARGET_URI_LIST]) 957 if (data->type == preferred_targets[TARGET_URI_LIST])
1157 } 1152 }
1158 1153
1159 if (!NILP (dispatch_event_queue)) 1154 if (!NILP (dispatch_event_queue))
1160 { 1155 {
1161 Lisp_Object event, event2; 1156 Lisp_Object event, event2;
1162 XSETEVENT (event2, emacs_event); 1157 event2 = wrap_event (emacs_event);
1163 event = dequeue_gtk_dispatch_event (); 1158 event = dequeue_gtk_dispatch_event ();
1164 Fcopy_event (event, event2); 1159 Fcopy_event (event, event2);
1165 Fdeallocate_event (event); 1160 Fdeallocate_event (event);
1166 } 1161 }
1167 else if (tty_events_occurred) 1162 else if (tty_events_occurred)
1363 emacs_event->event.key.keysym = keysym; 1358 emacs_event->event.key.keysym = keysym;
1364 } 1359 }
1365 else /* Mouse press/release event */ 1360 else /* Mouse press/release event */
1366 { 1361 {
1367 GdkEventButton *button_event = &gdk_event->button; 1362 GdkEventButton *button_event = &gdk_event->button;
1368 XSETFRAME (emacs_event->channel, frame); 1363 emacs_event->channel = wrap_frame (frame);
1369 1364
1370 emacs_event->event_type = (button_event->type == GDK_BUTTON_RELEASE) ? 1365 emacs_event->event_type = (button_event->type == GDK_BUTTON_RELEASE) ?
1371 button_release_event : button_press_event; 1366 button_release_event : button_press_event;
1372 1367
1373 emacs_event->event.button.modifiers = modifiers; 1368 emacs_event->event.button.modifiers = modifiers;
1398 waiting for us next time around. */ 1393 waiting for us next time around. */
1399 gdk_window_get_pointer (ev->window, &x, &y, &mask); 1394 gdk_window_get_pointer (ev->window, &x, &y, &mask);
1400 1395
1401 DEVICE_GTK_MOUSE_TIMESTAMP (d) = ev->time; 1396 DEVICE_GTK_MOUSE_TIMESTAMP (d) = ev->time;
1402 1397
1403 XSETFRAME (emacs_event->channel, frame); 1398 emacs_event->channel = wrap_frame (frame);
1404 emacs_event->event_type = pointer_motion_event; 1399 emacs_event->event_type = pointer_motion_event;
1405 emacs_event->timestamp = ev->time; 1400 emacs_event->timestamp = ev->time;
1406 emacs_event->event.motion.x = x; 1401 emacs_event->event.motion.x = x;
1407 emacs_event->event.motion.y = y; 1402 emacs_event->event.motion.y = y;
1408 if (mask & GDK_SHIFT_MASK) modifiers |= XEMACS_MOD_SHIFT; 1403 if (mask & GDK_SHIFT_MASK) modifiers |= XEMACS_MOD_SHIFT;
1508 break; 1503 break;
1509 } 1504 }
1510 #undef FROB 1505 #undef FROB
1511 1506
1512 emacs_event->event_type = magic_event; 1507 emacs_event->event_type = magic_event;
1513 XSETFRAME (emacs_event->channel, frame); 1508 emacs_event->channel = wrap_frame (frame);
1514 1509
1515 if (ignore_p) 1510 if (ignore_p)
1516 { 1511 {
1517 stderr_out ("Ignoring event... (%s)\n", event_name (event)); 1512 stderr_out ("Ignoring event... (%s)\n", event_name (event));
1518 Fdeallocate_event (lisp_event); 1513 Fdeallocate_event (lisp_event);
1519 return (FALSE); 1514 return (FALSE);
1520 } 1515 }
1521 else 1516 else
1522 { 1517 {
1523 enqueue_gtk_dispatch_event (lisp_event); 1518 enqueue_gtk_dispatch_event (lisp_event);
1524 return (TRUE); 1519 return (TRUE);
1525 } 1520 }
1526 } 1521 }
1527 1522
1528 1523
1529 /************************************************************************/ 1524 /************************************************************************/
1530 /* input pending / C-g checking */ 1525 /* input pending / C-g checking */