comparison src/event-xlike-inc.c @ 4908:b3ce27ca7647

various fixes related to gtk, redisplay-xlike-inc.c -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-02-01 Ben Wing <ben@xemacs.org> * compiler.h: Create a USED() macro to force unused-var warnings to go away, in certain cases where it's inconvenient to do otherwise (e.g. when THIS_IS_GTK in redisplay-xlike-inc.c). * console-x.h: Remove unneeded decls, make some static. * redisplay-xlike-inc.c: * console-xlike-inc.h: New file. Include defns from redisplay-xlike-inc.c that may be useful in other XLIKE files. Correct the handling of colors and font-style setting functions in the xlike defns. Lots of fixes in the GTK-specific defns. * depend: Regenerate. * event-xlike-inc.c: * event-xlike-inc.c (USE_UNICODE_MAP): * event-xlike-inc.c (endif): * gccache-gtk.c: * gtk-glue.c (xemacs_list_to_gtklist): * gtk-glue.c (xemacs_gtklist_to_list): * gtk-glue.c (FROB): * gtk-glue.c (face_to_gc): * gtk-glue.c (face_to_style): * gtk-glue.c (gdk_event_to_emacs_event): * gtk-xemacs.h (struct _GtkXEmacs): * gtk-xemacs.h (struct _GtkXEmacsClass): * objects-xlike-inc.c: Cosmetic, comment fixes. * glyphs.c (pixmap_to_lisp_data): Unused var fixes. * gtk-glue.c: * gccache-gtk.c: * gtk-xemacs.c: * gtk-xemacs.h: * objects-xlike-inc.c: * ui-gtk.c: * ui-gtk.h: * xgccache.c: * xgccache.c (GC_CACHE_SIZE): * xgccache.h: Misc include-file fixes. * objects-xlike-inc.c (XFUN): * objects-xlike-inc.c (xlistfonts_checking_charset): Combine some ifdeffed stuff using defs in console-xlike-inc.h. * redisplay-gtk.c: * redisplay-gtk.c (THIS_IS_GTK): * redisplay-gtk.c (XLIKE_bevel_area): * redisplay-gtk.c (XLIKE_ring_bell): * redisplay-gtk.c (gdk_draw_text_image): Fix numerous compile problems. Delete gtk_output_shadows(), which mostly duplicates generic bevel_modeline(). Fix up gtk_bevel_modeline() into XLIKE_bevel_area() and make use of the style var properly to set the appropriate GTK constant. * redisplay-x.c: * redisplay-x.c (XLIKE_window_output_begin): * redisplay-x.c (XLIKE_window_output_end): * redisplay-x.c (XLIKE_bevel_area): * redisplay-x.c (x_output_shadows): * redisplay-x.c (XLIKE_ring_bell): Make x_output_shadows be static. Change the defn of various functions to look like XLIKE_foo() so it matches the calling convention elsewhere. * redisplay-xlike-inc.c: * redisplay-xlike-inc.c (NEED_GCCACHE_H): * redisplay-xlike-inc.c (XLIKE_text_width): * redisplay-xlike-inc.c (XLIKE_get_gc): * redisplay-xlike-inc.c (XLIKE_text_width_single_run): * redisplay-xlike-inc.c (XFT_FROB_LISP_COLOR): * redisplay-xlike-inc.c (XLIKE_output_xlike_pixmap): * redisplay-xlike-inc.c (XLIKE_output_pixmap): * redisplay-xlike-inc.c (XLIKE_output_vertical_divider): * redisplay-xlike-inc.c (XLIKE_flash): Lots of header fixes. Lots of stuff moved to console-xlike-inc.h. Use XFUN() to generate function names instead of directly calling XLIKE_PASTE(). Remove unnecessary prototypes. Unify calls to text_width funs. Make XLIKE_get_gc non-static since it's called from gtk. Change the color-function calls and fill-style-setting calls to match the changes in console-xlike-inc.h. Use USED() to avoid some warnings. * symsinit.h: Sort the prototypes, and add a fun `sort-symsinit' in a comment that does the sorting (using sort-regexp-fields). * symsinit.h (init_number): * sysgtk.h: New file, wraps the various GTK headers. * sysgdkx.h: New file, wraps <gtk/gdkx.h>. Keep this separate to * event-gtk.h: Delete. Combine stuff into console-gtk.h. help isolate X-specific code from GTK. * device-gtk.c: * event-gtk.c: * console-gtk.h: * frame-gtk.c: * gccache-gtk.c: * gccache-gtk.h: * glyphs-gtk.c (gtk_colorize_image_instance): * glyphs-gtk.h: * gtk-xemacs.h: * objects-gtk.c: * objects-gtk.c (MAX_FONT_COUNT): * ui-gtk.h: Use sysgtk.h or sysgdkx.h instead of directly including GTK headers. Don't include event-gtk.h.
author Ben Wing <ben@xemacs.org>
date Mon, 01 Feb 2010 02:15:28 -0600
parents 63c25d1cbecf
children 308d34e9f07d
comparison
equal deleted inserted replaced
4907:9e7f5a77cc84 4908:b3ce27ca7647
1 /* Shared event code between X and GTK -- include file. 1 /* Common code between X and GTK -- event-related.
2 Copyright (C) 1991-5, 1997 Free Software Foundation, Inc. 2 Copyright (C) 1991-5, 1997 Free Software Foundation, Inc.
3 Copyright (C) 1995 Sun Microsystems, Inc. 3 Copyright (C) 1995 Sun Microsystems, Inc.
4 Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. 4 Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
5 5
6 This file is part of XEmacs. 6 This file is part of XEmacs.
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */ 21 Boston, MA 02111-1307, USA. */
22 22
23 /* Synched up with: Not in FSF. */ 23 /* Synched up with: Not in FSF. */
24 24
25 /* For some code it's reasonable to have only one copy and conditionalize 25 /* Before including this file, you need to define either THIS_IS_X or
26 at run-time. For other code it isn't. #### Perhaps all code should be 26 THIS_IS_GTK. */
27 included here, not in event-xlike.c. However, event-xlike.c is always 27
28 X-specific, whereas the following code isn't, in the GTK case. */ 28 /* See comment at top of redisplay-xlike-inc.c for an explanation of
29 how this file works. */
29 30
30 static int 31 static int
31 #ifdef THIS_IS_GTK 32 #ifdef THIS_IS_GTK
32 emacs_gtk_event_pending_p (int how_many) 33 emacs_gtk_event_pending_p (int how_many)
33 #else 34 #else
158 } 159 }
159 160
160 return 0; 161 return 0;
161 } 162 }
162 163
163 #if defined(THIS_IS_X) || !defined(__GDK_KEYS_H__) 164 #if defined (THIS_IS_X) || !defined (__GDK_KEYS_H__)
164 165
165 /* Use an appropriate map to Unicode within x_keysym_to_character. Arguments 166 /* Use an appropriate map to Unicode within x_keysym_to_character. Arguments
166 are evaluated multiple times. 167 are evaluated multiple times.
167 168
168 Breaks if an X11 keysym maps to zero in Unicode. */ 169 Breaks if an X11 keysym maps to zero in Unicode. */
169 170
170 #define USE_UNICODE_MAP(keysym, map) \ 171 #define USE_UNICODE_MAP(keysym, map) \
171 if (keysym >= FIRST_KNOWN_##map \ 172 if (keysym >= FIRST_KNOWN_##map \
172 && (keysym < (FIRST_KNOWN_##map + countof(map))) \ 173 && (keysym < (FIRST_KNOWN_##map + countof (map))) \
173 && map[keysym - FIRST_KNOWN_##map ]) do \ 174 && map[keysym - FIRST_KNOWN_##map ]) do \
174 { \ 175 { \
175 keysym -= FIRST_KNOWN_##map ; \ 176 keysym -= FIRST_KNOWN_##map ; \
176 return Funicode_to_char(make_int(map[keysym]), Qnil); \ 177 return Funicode_to_char (make_int (map[keysym]), Qnil); \
177 } while (0) 178 } while (0)
178 179
179 /* Maps to Unicode for X11 KeySyms, where we don't have a direct internal 180 /* Maps to Unicode for X11 KeySyms, where we don't have a direct internal
180 mapping based on a Mule character set, or whatever. Taken from Markus 181 mapping based on a Mule character set, or whatever. Taken from Markus
181 Kuhn's X11.keysyms--if you're ever comparing with that file, note the 182 Kuhn's X11.keysyms--if you're ever comparing with that file, note the
586 same thing, and this works for it on X11. It should be moved back into 587 same thing, and this works for it on X11. It should be moved back into
587 event-Xt.c when and if the GTK port moves to GTK 2. */ 588 event-Xt.c when and if the GTK port moves to GTK 2. */
588 589
589 #ifndef THIS_IS_GTK 590 #ifndef THIS_IS_GTK
590 static Lisp_Object 591 static Lisp_Object
591 x_keysym_to_character(KeySym keysym) 592 x_keysym_to_character (KeySym keysym)
592 #else 593 #else
593 Lisp_Object 594 Lisp_Object
594 gtk_keysym_to_character(guint keysym) 595 gtk_keysym_to_character (guint keysym)
595 #endif 596 #endif
596 { 597 {
597 Lisp_Object charset = Qzero; 598 Lisp_Object charset = Qzero;
598 int code = 0; 599 int code = 0;
599 600
602 the range #x100-#x10FFFF; actual implementations can have the Latin 1 603 the range #x100-#x10FFFF; actual implementations can have the Latin 1
603 code points do the same thing with keysyms 604 code points do the same thing with keysyms
604 #x01000000-#x01000100. */ 605 #x01000000-#x01000100. */
605 606
606 if (keysym >= 0x01000000 && keysym <= 0x0110FFFF) 607 if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
607 return Funicode_to_char (make_int(keysym & 0xffffff), Qnil); 608 return Funicode_to_char (make_int (keysym & 0xffffff), Qnil);
608 609
609 if ((keysym & 0xff) < 0xa0) 610 if ((keysym & 0xff) < 0xa0)
610 return Qnil; 611 return Qnil;
611 612
612 switch (keysym >> 8) 613 switch (keysym >> 8)
640 USE_CHARSET (charset, ARABIC_ISO8859_6); 641 USE_CHARSET (charset, ARABIC_ISO8859_6);
641 code = keysym & 0x7f; 642 code = keysym & 0x7f;
642 break; 643 break;
643 case 6: /* Cyrillic */ 644 case 6: /* Cyrillic */
644 { 645 {
645 USE_UNICODE_MAP(keysym, CYRILLIC); 646 USE_UNICODE_MAP (keysym, CYRILLIC);
646 break; 647 break;
647 } 648 }
648 case 7: /* Greek */ 649 case 7: /* Greek */
649 { 650 {
650 static UExtbyte const greek[] = /* 0x20 - 0x7f */ 651 static UExtbyte const greek[] = /* 0x20 - 0x7f */
663 USE_CHARSET (charset, GREEK_ISO8859_7); 664 USE_CHARSET (charset, GREEK_ISO8859_7);
664 code = greek[(keysym & 0x7f) - 0x20]; 665 code = greek[(keysym & 0x7f) - 0x20];
665 break; 666 break;
666 } 667 }
667 case 8: 668 case 8:
668 USE_UNICODE_MAP(keysym, TECHNICAL); 669 USE_UNICODE_MAP (keysym, TECHNICAL);
669 break; 670 break;
670 case 9: 671 case 9:
671 USE_UNICODE_MAP(keysym, SPECIAL); 672 USE_UNICODE_MAP (keysym, SPECIAL);
672 break; 673 break;
673 case 10: 674 case 10:
674 USE_UNICODE_MAP(keysym, PUBLISHING); 675 USE_UNICODE_MAP (keysym, PUBLISHING);
675 break; 676 break;
676 case 11: 677 case 11:
677 USE_UNICODE_MAP(keysym, APL); 678 USE_UNICODE_MAP (keysym, APL);
678 break; 679 break;
679 case 12: /* Hebrew */ 680 case 12: /* Hebrew */
680 USE_CHARSET (charset, HEBREW_ISO8859_8); 681 USE_CHARSET (charset, HEBREW_ISO8859_8);
681 code = keysym & 0x7f; 682 code = keysym & 0x7f;
682 break; 683 break;
696 code = keysym & 0x7f; 697 code = keysym & 0x7f;
697 break; 698 break;
698 case 32: /* Currency. The lower sixteen bits of these keysyms happily 699 case 32: /* Currency. The lower sixteen bits of these keysyms happily
699 correspond exactly to the Unicode code points of the 700 correspond exactly to the Unicode code points of the
700 associated characters */ 701 associated characters */
701 return Funicode_to_char(make_int(keysym & 0xffff), Qnil); 702 return Funicode_to_char (make_int (keysym & 0xffff), Qnil);
702 break; 703 break;
703 default: 704 default:
704 break; 705 break;
705 } 706 }
706 707
720 #else 721 #else
721 return make_char (code + 0x80); 722 return make_char (code + 0x80);
722 #endif 723 #endif
723 } 724 }
724 725
725 #endif /* defined(THIS_IS_X) || !defined(__GDK_KEYS_H__) */ 726 #endif /* defined (THIS_IS_X) || !defined (__GDK_KEYS_H__) */