Mercurial > hg > xemacs-beta
changeset 589:37fe04af1590
[xemacs-hg @ 2001-05-31 02:00:29 by wmperry]
Regenerated some .c files from their lisp equivalents for GTK bindings. Fix buttons as modifiers code so that text selection works in GTK event loop.
author | wmperry |
---|---|
date | Thu, 31 May 2001 02:00:31 +0000 |
parents | ed8e2ee8d29d |
children | ea7687dc2b34 |
files | src/ChangeLog src/emacs-marshals.c src/emacs-widget-accessors.c src/event-gtk.c |
diffstat | 4 files changed, 147 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Thu May 31 00:30:41 2001 +0000 +++ b/src/ChangeLog Thu May 31 02:00:31 2001 +0000 @@ -1,3 +1,12 @@ +2001-05-30 William M. Perry <wmperry@gnu.org> + + * emacs-marshals.c: Regenerated from lisp. + + * emacs-widget-accessors.c: Regenerated from lisp. + + * event-gtk.c (gtk_event_to_emacs_event): Buttons are now + modifiers, so selection with the mouse works again. + 2001-05-24 Kirill 'Big K' Katsnelson <kkm@dtmx.com> * redisplay.c (redisplay_device): Allow preemption on redisplay.
--- a/src/emacs-marshals.c Thu May 31 00:30:41 2001 +0000 +++ b/src/emacs-marshals.c Thu May 31 02:00:31 2001 +0000 @@ -1,3 +1,5 @@ +/* This file was automatically generated by ../lisp/gtk-widget-accessors.el */ +/* DO NOT EDIT BY HAND!!! */ #define GTK_VALUE_ARRAY(x) GTK_VALUE_POINTER(x) #define GTK_VALUE_LIST(x) GTK_VALUE_POINTER(x) @@ -235,6 +237,46 @@ } static void +emacs_gtk_marshal_INT__POINTER_INT (ffi_actual_function func, GtkArg *args) +{ + __INT_fn rfunc = (__INT_fn) func; + guint *return_val; + + return_val = GTK_RETLOC_INT (args[2]); + *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_INT (args[1])); +} + +static void +emacs_gtk_marshal_INT__POINTER_STRING_INT (ffi_actual_function func, GtkArg *args) +{ + __INT_fn rfunc = (__INT_fn) func; + guint *return_val; + + return_val = GTK_RETLOC_INT (args[3]); + *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_INT (args[2])); +} + +static void +emacs_gtk_marshal_INT__POINTER_STRING_STRING (ffi_actual_function func, GtkArg *args) +{ + __INT_fn rfunc = (__INT_fn) func; + guint *return_val; + + return_val = GTK_RETLOC_INT (args[3]); + *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_STRING (args[2])); +} + +static void +emacs_gtk_marshal_INT__POINTER_STRING (ffi_actual_function func, GtkArg *args) +{ + __INT_fn rfunc = (__INT_fn) func; + guint *return_val; + + return_val = GTK_RETLOC_INT (args[2]); + *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1])); +} + +static void emacs_gtk_marshal_INT__POINTER (ffi_actual_function func, GtkArg *args) { __INT_fn rfunc = (__INT_fn) func; @@ -302,6 +344,13 @@ } static void +emacs_gtk_marshal_NONE__INT_INT_INT_INT (ffi_actual_function func, GtkArg *args) +{ + __NONE_fn rfunc = (__NONE_fn) func; + (*rfunc) (GTK_VALUE_INT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_INT (args[2]), GTK_VALUE_INT (args[3])); +} + +static void emacs_gtk_marshal_NONE__INT_INT (ffi_actual_function func, GtkArg *args) { __NONE_fn rfunc = (__NONE_fn) func; @@ -711,6 +760,13 @@ } static void +emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_INT_INT_INT_INT_INT_INT (ffi_actual_function func, GtkArg *args) +{ + __NONE_fn rfunc = (__NONE_fn) func; + (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_POINTER (args[1]), GTK_VALUE_POINTER (args[2]), GTK_VALUE_INT (args[3]), GTK_VALUE_INT (args[4]), GTK_VALUE_INT (args[5]), GTK_VALUE_INT (args[6]), GTK_VALUE_INT (args[7]), GTK_VALUE_INT (args[8])); +} + +static void emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_POINTER_STRING_INT (ffi_actual_function func, GtkArg *args) { __NONE_fn rfunc = (__NONE_fn) func; @@ -753,6 +809,13 @@ } static void +emacs_gtk_marshal_NONE__OBJECT_STRING_INT_INT_INT (ffi_actual_function func, GtkArg *args) +{ + __NONE_fn rfunc = (__NONE_fn) func; + (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_INT (args[2]), GTK_VALUE_INT (args[3]), GTK_VALUE_INT (args[4])); +} + +static void emacs_gtk_marshal_NONE__OBJECT_STRING_POINTER_INT_INT_INT (ffi_actual_function func, GtkArg *args) { __NONE_fn rfunc = (__NONE_fn) func; @@ -795,6 +858,13 @@ } static void +emacs_gtk_marshal_NONE__POINTER_INT_INT (ffi_actual_function func, GtkArg *args) +{ + __NONE_fn rfunc = (__NONE_fn) func; + (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_INT (args[2])); +} + +static void emacs_gtk_marshal_NONE__POINTER_POINTER_BOOL_INT_INT_INT_INT_INT_INT (ffi_actual_function func, GtkArg *args) { __NONE_fn rfunc = (__NONE_fn) func; @@ -851,6 +921,13 @@ } static void +emacs_gtk_marshal_NONE__POINTER_STRING_STRING (ffi_actual_function func, GtkArg *args) +{ + __NONE_fn rfunc = (__NONE_fn) func; + (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_STRING (args[2])); +} + +static void emacs_gtk_marshal_NONE__POINTER_STRING (ffi_actual_function func, GtkArg *args) { __NONE_fn rfunc = (__NONE_fn) func; @@ -1348,6 +1425,26 @@ } static void +emacs_gtk_marshal_STRING__POINTER_STRING (ffi_actual_function func, GtkArg *args) +{ + __STRING_fn rfunc = (__STRING_fn) func; + gchar * *return_val; + + return_val = GTK_RETLOC_STRING (args[2]); + *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0]), GTK_VALUE_STRING (args[1])); +} + +static void +emacs_gtk_marshal_STRING__POINTER (ffi_actual_function func, GtkArg *args) +{ + __STRING_fn rfunc = (__STRING_fn) func; + gchar * *return_val; + + return_val = GTK_RETLOC_STRING (args[1]); + *return_val = (*rfunc) (GTK_VALUE_POINTER (args[0])); +} + +static void emacs_gtk_marshal_STRING__NONE (ffi_actual_function func, GtkArg *args) { __STRING_fn rfunc = (__STRING_fn) func; @@ -1357,68 +1454,15 @@ *return_val = (*rfunc) (); } -static void -emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_INT_INT_INT_INT_INT_INT (ffi_actual_function func, GtkArg *args) -{ - __NONE_fn rfunc = (__NONE_fn) func; - (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_POINTER (args[1]), GTK_VALUE_POINTER (args[2]), GTK_VALUE_INT (args[3]), GTK_VALUE_INT (args[4]), GTK_VALUE_INT (args[5]), GTK_VALUE_INT (args[6]), GTK_VALUE_INT (args[7]), GTK_VALUE_INT (args[8])); -} - -static void -emacs_gtk_marshal_NONE__OBJECT_STRING_INT_INT_INT (ffi_actual_function func, GtkArg *args) -{ - __NONE_fn rfunc = (__NONE_fn) func; - (*rfunc) (GTK_VALUE_OBJECT (args[0]), GTK_VALUE_STRING (args[1]), GTK_VALUE_INT (args[2]), GTK_VALUE_INT (args[3]), GTK_VALUE_INT (args[4])); -} - -static void -emacs_gtk_marshal_NONE__INT_INT_INT_INT (ffi_actual_function func, GtkArg *args) -{ - __NONE_fn rfunc = (__NONE_fn) func; - (*rfunc) (GTK_VALUE_INT (args[0]), GTK_VALUE_INT (args[1]), GTK_VALUE_INT (args[2]), GTK_VALUE_INT (args[3])); -} - #include "hash.h" -static struct hash_table * marshaller_hashtable; - -extern unsigned long string_hash (const char *xv); - -static int -our_string_eq (const void *st1, const void *st2) -{ - if (!st1) - return st2 ? 0 : 1; - else if (!st2) - return 0; - else - return !strcmp ( (const char *) st1, (const char *) st2); -} - -unsigned long -our_string_hash (const void *xv) -{ - unsigned int h = 0; - unsigned const char *x = (unsigned const char *) xv; - - if (!x) return 0; - - while (*x) - { - unsigned int g; - h = (h << 4) + *x++; - if ((g = h & 0xf0000000) != 0) - h = (h ^ (g >> 24)) ^ g; - } - - return h; -} +static c_hashtable marshaller_hashtable; static void initialize_marshaller_storage (void) { if (!marshaller_hashtable) { - marshaller_hashtable = make_general_hash_table (100, our_string_hash, our_string_eq); + marshaller_hashtable = make_strings_hashtable (100); puthash ("emacs_gtk_marshal_BOOL__OBJECT_INT", (void *) emacs_gtk_marshal_BOOL__OBJECT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_BOOL__OBJECT_OBJECT_OBJECT", (void *) emacs_gtk_marshal_BOOL__OBJECT_OBJECT_OBJECT, marshaller_hashtable); puthash ("emacs_gtk_marshal_BOOL__OBJECT_OBJECT", (void *) emacs_gtk_marshal_BOOL__OBJECT_OBJECT, marshaller_hashtable); @@ -1442,6 +1486,10 @@ puthash ("emacs_gtk_marshal_INT__OBJECT_POINTER", (void *) emacs_gtk_marshal_INT__OBJECT_POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_INT__OBJECT_STRING", (void *) emacs_gtk_marshal_INT__OBJECT_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_INT__OBJECT", (void *) emacs_gtk_marshal_INT__OBJECT, marshaller_hashtable); + puthash ("emacs_gtk_marshal_INT__POINTER_INT", (void *) emacs_gtk_marshal_INT__POINTER_INT, marshaller_hashtable); + puthash ("emacs_gtk_marshal_INT__POINTER_STRING_INT", (void *) emacs_gtk_marshal_INT__POINTER_STRING_INT, marshaller_hashtable); + puthash ("emacs_gtk_marshal_INT__POINTER_STRING_STRING", (void *) emacs_gtk_marshal_INT__POINTER_STRING_STRING, marshaller_hashtable); + puthash ("emacs_gtk_marshal_INT__POINTER_STRING", (void *) emacs_gtk_marshal_INT__POINTER_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_INT__POINTER", (void *) emacs_gtk_marshal_INT__POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_INT__STRING_STRING_INT_ARRAY", (void *) emacs_gtk_marshal_INT__STRING_STRING_INT_ARRAY, marshaller_hashtable); puthash ("emacs_gtk_marshal_INT__STRING", (void *) emacs_gtk_marshal_INT__STRING, marshaller_hashtable); @@ -1449,6 +1497,7 @@ puthash ("emacs_gtk_marshal_LIST__OBJECT", (void *) emacs_gtk_marshal_LIST__OBJECT, marshaller_hashtable); puthash ("emacs_gtk_marshal_LIST__NONE", (void *) emacs_gtk_marshal_LIST__NONE, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__BOOL", (void *) emacs_gtk_marshal_NONE__BOOL, marshaller_hashtable); + puthash ("emacs_gtk_marshal_NONE__INT_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__INT_INT_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__INT_INT", (void *) emacs_gtk_marshal_NONE__INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__INT", (void *) emacs_gtk_marshal_NONE__INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_BOOL_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_BOOL_INT, marshaller_hashtable); @@ -1506,18 +1555,21 @@ puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_INT_STRING_INT_POINTER_POINTER", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_INT_STRING_INT_POINTER_POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_INT_STRING", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_INT_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_INT, marshaller_hashtable); + puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_INT_INT_INT_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_INT_INT_INT_INT_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_POINTER_STRING_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_POINTER_STRING_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_POINTER", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_STRING_INT_POINTER_POINTER_POINTER_POINTER_BOOL_BOOL", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_STRING_INT_POINTER_POINTER_POINTER_POINTER_BOOL_BOOL, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_STRING_BOOL", (void *) emacs_gtk_marshal_NONE__OBJECT_STRING_BOOL, marshaller_hashtable); + puthash ("emacs_gtk_marshal_NONE__OBJECT_STRING_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_STRING_INT_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_STRING_POINTER_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_STRING_POINTER_INT_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_STRING_POINTER_INT_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_STRING_POINTER_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_STRING_STRING", (void *) emacs_gtk_marshal_NONE__OBJECT_STRING_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT_STRING", (void *) emacs_gtk_marshal_NONE__OBJECT_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__OBJECT", (void *) emacs_gtk_marshal_NONE__OBJECT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER_INT", (void *) emacs_gtk_marshal_NONE__POINTER_INT, marshaller_hashtable); + puthash ("emacs_gtk_marshal_NONE__POINTER_INT_INT", (void *) emacs_gtk_marshal_NONE__POINTER_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER_POINTER_BOOL_INT_INT_INT_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__POINTER_POINTER_BOOL_INT_INT_INT_INT_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER_POINTER_BOOL_INT_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__POINTER_POINTER_BOOL_INT_INT_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER_POINTER_INT_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__POINTER_POINTER_INT_INT_INT_INT, marshaller_hashtable); @@ -1526,6 +1578,7 @@ puthash ("emacs_gtk_marshal_NONE__POINTER_POINTER_POINTER_INT_INT_STRING", (void *) emacs_gtk_marshal_NONE__POINTER_POINTER_POINTER_INT_INT_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER_POINTER_POINTER_POINTER", (void *) emacs_gtk_marshal_NONE__POINTER_POINTER_POINTER_POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER_POINTER", (void *) emacs_gtk_marshal_NONE__POINTER_POINTER, marshaller_hashtable); + puthash ("emacs_gtk_marshal_NONE__POINTER_STRING_STRING", (void *) emacs_gtk_marshal_NONE__POINTER_STRING_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER_STRING", (void *) emacs_gtk_marshal_NONE__POINTER_STRING, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__POINTER", (void *) emacs_gtk_marshal_NONE__POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_NONE__NONE", (void *) emacs_gtk_marshal_NONE__NONE, marshaller_hashtable); @@ -1576,10 +1629,9 @@ puthash ("emacs_gtk_marshal_STRING__OBJECT_INT_INT", (void *) emacs_gtk_marshal_STRING__OBJECT_INT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_STRING__OBJECT_INT", (void *) emacs_gtk_marshal_STRING__OBJECT_INT, marshaller_hashtable); puthash ("emacs_gtk_marshal_STRING__OBJECT", (void *) emacs_gtk_marshal_STRING__OBJECT, marshaller_hashtable); + puthash ("emacs_gtk_marshal_STRING__POINTER_STRING", (void *) emacs_gtk_marshal_STRING__POINTER_STRING, marshaller_hashtable); + puthash ("emacs_gtk_marshal_STRING__POINTER", (void *) emacs_gtk_marshal_STRING__POINTER, marshaller_hashtable); puthash ("emacs_gtk_marshal_STRING__NONE", (void *) emacs_gtk_marshal_STRING__NONE, marshaller_hashtable); - puthash ("emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_INT_INT_INT_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_POINTER_POINTER_INT_INT_INT_INT_INT_INT, marshaller_hashtable); - puthash ("emacs_gtk_marshal_NONE__OBJECT_STRING_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__OBJECT_STRING_INT_INT_INT, marshaller_hashtable); - puthash ("emacs_gtk_marshal_NONE__INT_INT_INT_INT", (void *) emacs_gtk_marshal_NONE__INT_INT_INT_INT, marshaller_hashtable); }; }
--- a/src/emacs-widget-accessors.c Thu May 31 00:30:41 2001 +0000 +++ b/src/emacs-widget-accessors.c Thu May 31 02:00:31 2001 +0000 @@ -1,3 +1,5 @@ +/* This file was automatically generated by ../lisp/gtk-widget-accessors.el */ +/* DO NOT EDIT BY HAND!!! */ DEFUN ("gtk-adjustment-lower", Fgtk_adjustment_lower, 1, 1, 0, /* Access the `lower' slot of OBJ, a GtkAdjustment object. */
--- a/src/event-gtk.c Thu May 31 00:30:41 2001 +0000 +++ b/src/event-gtk.c Thu May 31 02:00:31 2001 +0000 @@ -1253,6 +1253,26 @@ if (*state & gd->HyperMask) modifiers |= XEMACS_MOD_HYPER; if (*state & gd->AltMask) modifiers |= XEMACS_MOD_ALT; + { + int numero_de_botao = -1; + + if (!key_event_p) + numero_de_botao = gdk_event->button.button; + + /* the button gets noted either in the button or the modifiers + field, but not both. */ + if (numero_de_botao != 1 && (*state & GDK_BUTTON1_MASK)) + modifiers |= XEMACS_MOD_BUTTON1; + if (numero_de_botao != 2 && (*state & GDK_BUTTON2_MASK)) + modifiers |= XEMACS_MOD_BUTTON2; + if (numero_de_botao != 3 && (*state & GDK_BUTTON3_MASK)) + modifiers |= XEMACS_MOD_BUTTON3; + if (numero_de_botao != 4 && (*state & GDK_BUTTON4_MASK)) + modifiers |= XEMACS_MOD_BUTTON4; + if (numero_de_botao != 5 && (*state & GDK_BUTTON5_MASK)) + modifiers |= XEMACS_MOD_BUTTON5; + } + /* Ignore the Caps_Lock key if: - any other modifiers are down, so that Caps_Lock doesn't turn C-x into C-X, which would suck. @@ -1374,6 +1394,12 @@ if (mask & gd->SuperMask) modifiers |= XEMACS_MOD_SUPER; if (mask & gd->HyperMask) modifiers |= XEMACS_MOD_HYPER; if (mask & gd->AltMask) modifiers |= XEMACS_MOD_ALT; + if (mask & GDK_BUTTON1_MASK) modifiers |= XEMACS_MOD_BUTTON1; + if (mask & GDK_BUTTON2_MASK) modifiers |= XEMACS_MOD_BUTTON2; + if (mask & GDK_BUTTON3_MASK) modifiers |= XEMACS_MOD_BUTTON3; + if (mask & GDK_BUTTON4_MASK) modifiers |= XEMACS_MOD_BUTTON4; + if (mask & GDK_BUTTON5_MASK) modifiers |= XEMACS_MOD_BUTTON5; + /* Currently ignores Shift_Lock but probably shouldn't (but it definitely should ignore Caps_Lock). */ emacs_event->event.motion.modifiers = modifiers;