comparison src/event-gtk.c @ 2054:91d4c8c65a0f

[xemacs-hg @ 2004-05-02 04:06:51 by malcolmp] Fix warnings and errors when building GTK using C++ and --use-union-type.
author malcolmp
date Sun, 02 May 2004 04:07:01 +0000
parents a8d8f419b459
children e8db6a10ad42
comparison
equal deleted inserted replaced
2053:11e709117623 2054:91d4c8c65a0f
80 80
81 /* Mask of bits indicating the descriptors that we wait for input on */ 81 /* Mask of bits indicating the descriptors that we wait for input on */
82 extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask; 82 extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask;
83 extern SELECT_TYPE process_only_mask, tty_only_mask; 83 extern SELECT_TYPE process_only_mask, tty_only_mask;
84 84
85 static Lisp_Object gtk_keysym_to_emacs_keysym (); 85 static Lisp_Object gtk_keysym_to_emacs_keysym (guint keysym, int simple_p);
86 void debug_process_finalization (struct Lisp_Process *p); 86 void debug_process_finalization (struct Lisp_Process *p);
87 gboolean emacs_gtk_event_handler (GtkWidget *wid /* unused */, 87 gboolean emacs_gtk_event_handler (GtkWidget *wid /* unused */,
88 GdkEvent *event, 88 GdkEvent *event,
89 gpointer closure /* unused */); 89 gpointer closure /* unused */);
90 90
1390 SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); 1390 SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame));
1391 1391
1392 SET_EVENT_BUTTON_MODIFIERS (emacs_event, modifiers); 1392 SET_EVENT_BUTTON_MODIFIERS (emacs_event, modifiers);
1393 SET_EVENT_TIMESTAMP (emacs_event, button_event->time); 1393 SET_EVENT_TIMESTAMP (emacs_event, button_event->time);
1394 SET_EVENT_BUTTON_BUTTON (emacs_event, button_event->button); 1394 SET_EVENT_BUTTON_BUTTON (emacs_event, button_event->button);
1395 SET_EVENT_BUTTON_X (emacs_event, button_event->x); 1395 SET_EVENT_BUTTON_X (emacs_event, (int) button_event->x);
1396 SET_EVENT_BUTTON_Y (emacs_event, button_event->y); 1396 SET_EVENT_BUTTON_Y (emacs_event, (int) button_event->y);
1397 } 1397 }
1398 } 1398 }
1399 break; 1399 break;
1400 case GDK_KEY_RELEASE: 1400 case GDK_KEY_RELEASE:
1401 return 0; 1401 return 0;
1718 static void 1718 static void
1719 gtk_reset_key_mapping (struct device *d) 1719 gtk_reset_key_mapping (struct device *d)
1720 { 1720 {
1721 Display *display = GDK_DISPLAY (); 1721 Display *display = GDK_DISPLAY ();
1722 struct gtk_device *xd = DEVICE_GTK_DATA (d); 1722 struct gtk_device *xd = DEVICE_GTK_DATA (d);
1723 XModifierKeymap *map = (XModifierKeymap *) xd->x_keysym_map;
1724 KeySym *keysym, *keysym_end; 1723 KeySym *keysym, *keysym_end;
1725 Lisp_Object hashtable; 1724 Lisp_Object hashtable;
1726 int key_code_count, keysyms_per_code; 1725 int key_code_count, keysyms_per_code;
1727 1726
1728 if (map) 1727 if (xd->x_keysym_map)
1729 XFree ((char *) map); 1728 XFree ((char *) xd->x_keysym_map);
1730 XDisplayKeycodes (display, 1729 XDisplayKeycodes (display,
1731 &xd->x_keysym_map_min_code, 1730 &xd->x_keysym_map_min_code,
1732 &xd->x_keysym_map_max_code); 1731 &xd->x_keysym_map_max_code);
1733 key_code_count = xd->x_keysym_map_max_code - xd->x_keysym_map_min_code + 1; 1732 key_code_count = xd->x_keysym_map_max_code - xd->x_keysym_map_min_code + 1;
1734 map = (XModifierKeymap *) 1733 xd->x_keysym_map =
1735 XGetKeyboardMapping (display, xd->x_keysym_map_min_code, key_code_count, 1734 XGetKeyboardMapping (display, xd->x_keysym_map_min_code, key_code_count,
1736 &xd->x_keysym_map_keysyms_per_code); 1735 &xd->x_keysym_map_keysyms_per_code);
1737 1736
1738 xd->x_keysym_map = (void *)map;
1739 hashtable = xd->x_keysym_map_hashtable; 1737 hashtable = xd->x_keysym_map_hashtable;
1740 if (HASH_TABLEP (hashtable)) 1738 if (HASH_TABLEP (hashtable))
1741 { 1739 {
1742 Fclrhash (hashtable); 1740 Fclrhash (hashtable);
1743 } 1741 }
1745 { 1743 {
1746 xd->x_keysym_map_hashtable = hashtable = 1744 xd->x_keysym_map_hashtable = hashtable =
1747 make_lisp_hash_table (128, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); 1745 make_lisp_hash_table (128, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
1748 } 1746 }
1749 1747
1750 for (keysym = (KeySym *) map, 1748 for (keysym = xd->x_keysym_map,
1751 keysyms_per_code = xd->x_keysym_map_keysyms_per_code, 1749 keysyms_per_code = xd->x_keysym_map_keysyms_per_code,
1752 keysym_end = keysym + (key_code_count * keysyms_per_code); 1750 keysym_end = keysym + (key_code_count * keysyms_per_code);
1753 keysym < keysym_end; 1751 keysym < keysym_end;
1754 keysym += keysyms_per_code) 1752 keysym += keysyms_per_code)
1755 { 1753 {