Mercurial > emacs
annotate oldXMenu/XLookAssoc.c @ 71504:2b4e59cd1121
(Qeql): Add extern.
(x_set_mouse_pixel_position) [MAC_OSX]: Use CGWarpMouseCursorPosition.
(fm_style_face_attributes_alist) [USE_ATSUI]: New variable.
(syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it.
Change keys of Vmac_atsu_font_table from strings to numbers.
(fm_style_to_face_attributes) [USE_ATSUI]: New function.
(init_font_name_table) [USE_ATSUI]: Use it.
(saved_ts_script_language_on_focus) [USE_MAC_TSM]: New variable.
(syms_of_macterm) [USE_MAC_TSM]: Initialize and staticpro it.
[USE_MAC_TSM] (mac_tsm_resume): Restore script and language codes
only when saved_ts_script_language_on_focus coincides with
Vmac_ts_script_language_on_focus.
[USE_MAC_TSM] (mac_tsm_suspend): Save value of
Vmac_ts_script_language_on_focus to saved_ts_script_language_on_focus.
(XTread_socket) [USE_MAC_TSM]: Add Mac OS Classic support.
[USE_MAC_TSM] (mac_handle_text_input_event, init_tsm): Likewise.
| author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
|---|---|
| date | Wed, 28 Jun 2006 08:31:32 +0000 |
| parents | e8a3fb527b77 |
| children | ce127a46b1ca c5406394f567 |
| rev | line source |
|---|---|
| 25858 | 1 /* Copyright Massachusetts Institute of Technology 1985 */ |
|
68640
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
2 /* Copyright (C) 2002, 2003, 2004, 2005, |
|
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
3 2006 Free Software Foundation, Inc. */ |
| 25858 | 4 |
| 5 /* | |
| 6 Permission to use, copy, modify, distribute, and sell this software and its | |
| 7 documentation for any purpose is hereby granted without fee, provided that | |
| 8 the above copyright notice appear in all copies and that both that | |
| 9 copyright notice and this permission notice appear in supporting | |
| 10 documentation, and that the name of M.I.T. not be used in advertising or | |
| 11 publicity pertaining to distribution of the software without specific, | |
| 12 written prior permission. M.I.T. makes no representations about the | |
| 13 suitability of this software for any purpose. It is provided "as is" | |
| 14 without express or implied warranty. | |
| 15 */ | |
| 16 | |
| 17 #include <X11/Xlib.h> | |
| 18 #include <X11/Xresource.h> | |
| 19 #include "X10.h" | |
| 20 | |
| 21 #ifndef NULL | |
| 22 #define NULL 0 | |
| 23 #endif | |
| 24 | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
25 /* |
| 25858 | 26 * XLookUpAssoc - Retrieve the data stored in an XAssocTable by its XId. |
| 27 * If an appropriately matching XId can be found in the table the routine will | |
| 28 * return apointer to the data associated with it. If the XId can not be found | |
| 29 * in the table the routine will return a NULL pointer. All XId's are relative | |
| 30 * to the currently active Display. | |
| 31 */ | |
| 32 caddr_t XLookUpAssoc(dpy, table, x_id) | |
| 33 register Display *dpy; | |
| 34 register XAssocTable *table; /* XAssocTable to search in. */ | |
| 35 register XID x_id; /* XId to search for. */ | |
| 36 { | |
| 37 int hash; | |
| 38 register XAssoc *bucket; | |
| 39 register XAssoc *Entry; | |
| 40 | |
| 41 /* Hash the XId to get the bucket number. */ | |
| 42 hash = x_id & (table->size - 1); | |
| 43 /* Look up the bucket to get the entries in that bucket. */ | |
| 44 bucket = &table->buckets[hash]; | |
| 45 /* Get the first entry in the bucket. */ | |
| 46 Entry = bucket->next; | |
| 47 | |
| 48 /* Scan through the entries in the bucket for the right XId. */ | |
| 49 for (; Entry != bucket; Entry = Entry->next) { | |
| 50 if (Entry->x_id == x_id) { | |
| 51 /* We have the right XId. */ | |
| 52 if (Entry->display == dpy) { | |
| 53 /* We have the right display. */ | |
| 54 /* We have the right entry! */ | |
| 55 return(Entry->data); | |
| 56 } | |
| 57 /* Oops, identical XId's on different displays! */ | |
| 58 continue; | |
| 59 } | |
| 60 if (Entry->x_id > x_id) { | |
| 61 /* We have gone past where it should be. */ | |
| 62 /* It is apparently not in the table. */ | |
| 63 return(NULL); | |
| 64 } | |
| 65 } | |
| 66 /* It is apparently not in the table. */ | |
| 67 return(NULL); | |
| 68 } | |
| 69 | |
| 52401 | 70 /* arch-tag: d5075d0c-4b71-467d-b33c-3f5c4c4afcf2 |
| 71 (do not change this comment) */ |
