Mercurial > hg > xemacs-beta
annotate src/gui.h @ 4906:6ef8256a020a
implement equalp in C, fix case-folding, add equal() method for keymaps
-------------------- ChangeLog entries follow: --------------------
lisp/ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* cl-extra.el:
* cl-extra.el (cl-string-vector-equalp): Removed.
* cl-extra.el (cl-bit-vector-vector-equalp): Removed.
* cl-extra.el (cl-vector-array-equalp): Removed.
* cl-extra.el (cl-hash-table-contents-equalp): Removed.
* cl-extra.el (equalp): Removed.
* cl-extra.el (cl-mapcar-many):
Comment out the whole `equalp' implementation for the moment;
remove once we're sure the C implementation works.
* cl-macs.el:
* cl-macs.el (equalp):
Simplify the compiler-macro for `equalp' -- once it's in C,
we don't need to try so hard to expand it.
src/ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* abbrev.c (abbrev_match_mapper):
* buffer.h (CANON_TABLE_OF):
* buffer.h:
* editfns.c (Fchar_equal):
* minibuf.c (scmp_1):
* text.c (qxestrcasecmp_i18n):
* text.c (qxestrncasecmp_i18n):
* text.c (qxetextcasecmp):
* text.c (qxetextcasecmp_matching):
Create new macro CANONCASE that converts to a canonical mapping
and use it to do caseless comparisons instead of DOWNCASE.
* alloc.c:
* alloc.c (cons_equal):
* alloc.c (vector_equal):
* alloc.c (string_equal):
* bytecode.c (compiled_function_equal):
* chartab.c (char_table_entry_equal):
* chartab.c (char_table_equal):
* data.c (weak_list_equal):
* data.c (weak_box_equal):
* data.c (ephemeron_equal):
* device-msw.c (equal_devmode):
* elhash.c (hash_table_equal):
* events.c (event_equal):
* extents.c (properties_equal):
* extents.c (extent_equal):
* faces.c:
* faces.c (face_equal):
* faces.c (face_hash):
* floatfns.c (float_equal):
* fns.c:
* fns.c (bit_vector_equal):
* fns.c (plists_differ):
* fns.c (Fplists_eq):
* fns.c (Fplists_equal):
* fns.c (Flax_plists_eq):
* fns.c (Flax_plists_equal):
* fns.c (internal_equal):
* fns.c (internal_equalp):
* fns.c (internal_equal_0):
* fns.c (syms_of_fns):
* glyphs.c (image_instance_equal):
* glyphs.c (glyph_equal):
* glyphs.c (glyph_hash):
* gui.c (gui_item_equal):
* lisp.h:
* lrecord.h (struct lrecord_implementation):
* marker.c (marker_equal):
* number.c (bignum_equal):
* number.c (ratio_equal):
* number.c (bigfloat_equal):
* objects.c (color_instance_equal):
* objects.c (font_instance_equal):
* opaque.c (equal_opaque):
* opaque.c (equal_opaque_ptr):
* rangetab.c (range_table_equal):
* specifier.c (specifier_equal):
Add a `foldcase' param to the equal() method and use it to implement
`equalp' comparisons. Also add to plists_differ(), although we
don't currently use it here.
Rewrite internal_equalp(). Implement cross-type vector comparisons.
Don't implement our own handling of numeric promotion -- just use
the `=' primitive.
Add internal_equal_0(), which takes a `foldcase' param and calls
either internal_equal() or internal_equalp().
* buffer.h:
When given a 0 for buffer (which is the norm when functions don't
have a specific buffer available), use the current buffer's table,
not `standard-case-table'; otherwise the current settings are
ignored.
* casetab.c:
* casetab.c (set_case_table):
When handling old-style vectors of 256 in `set-case-table' don't
overwrite the existing table! Instead create a new table and
populate.
* device-msw.c (sync_printer_with_devmode):
* lisp.h:
* text.c (lisp_strcasecmp_ascii):
Rename lisp_strcasecmp to lisp_strcasecmp_ascii and use
lisp_strcasecmp_i18n for caseless comparisons in some places.
* elhash.c:
Delete unused lisp_string_hash and lisp_string_equal().
* events.h:
* keymap-buttons.h:
* keymap.h:
* keymap.c (keymap_lookup_directly):
* keymap.c (keymap_store):
* keymap.c (FROB):
* keymap.c (key_desc_list_to_event):
* keymap.c (describe_map_mapper):
* keymap.c (INCLUDE_BUTTON_ZERO):
New file keymap-buttons.h; use to handle buttons 1-26 in place of
duplicating code 26 times.
* frame-gtk.c (allocate_gtk_frame_struct):
* frame-msw.c (mswindows_init_frame_1):
Fix some comments about internal_equal() in redisplay that don't
apply any more.
* keymap-slots.h:
* keymap.c:
New file keymap-slots.h. Use it to notate the slots in a keymap
structure, similar to frameslots.h or coding-system-slots.h.
* keymap.c (MARKED_SLOT):
* keymap.c (keymap_equal):
* keymap.c (keymap_hash):
Implement.
tests/ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* automated/case-tests.el:
* automated/case-tests.el (uni-mappings):
* automated/search-tests.el:
Delete old pristine-case-table code. Rewrite the Unicode torture
test to take into account whether overlapping mappings exist for
more than one character, and not doing the upcase/downcase
comparisons in such cases.
* automated/lisp-tests.el (foo):
* automated/lisp-tests.el (string-variable):
* automated/lisp-tests.el (featurep):
Replace Assert (equal ... with Assert-equal; same for other types
of equality. Replace some awkward equivalents of Assert-equalp
with Assert-equalp. Add lots of equalp tests.
* automated/case-tests.el:
* automated/regexp-tests.el:
* automated/search-tests.el:
Fix up the comments at the top of the files. Move rules about where
to put tests into case-tests.el.
* automated/test-harness.el:
* automated/test-harness.el (test-harness-aborted-summary-template): New.
* automated/test-harness.el (test-harness-from-buffer):
* automated/test-harness.el (batch-test-emacs):
Fix Assert-test-not. Create Assert-not-equal and variants.
Delete the doc strings from all these convenience functions to avoid
excessive repetition; instead use one copy in a comment.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 01 Feb 2010 01:02:40 -0600 |
parents | 1e7cc382eb16 |
children | e0db3c197671 |
rev | line source |
---|---|
428 | 1 /* Generic GUI code. (menubars, scrollbars, toolbars, dialogs) |
2 Copyright (C) 1995 Board of Trustees, University of Illinois. | |
826 | 3 Copyright (C) 1995, 1996, 2002 Ben Wing. |
428 | 4 Copyright (C) 1995 Sun Microsystems, Inc. |
5 | |
6 This file is part of XEmacs. | |
7 | |
8 XEmacs is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
10 Free Software Foundation; either version 2, or (at your option) any | |
11 later version. | |
12 | |
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with XEmacs; see the file COPYING. If not, write to | |
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
21 Boston, MA 02111-1307, USA. */ | |
22 | |
23 /* Synched up with: Not in FSF. */ | |
24 | |
25 /* Written by kkm on 12/24/97 */ | |
26 | |
440 | 27 #ifndef INCLUDED_gui_h_ |
28 #define INCLUDED_gui_h_ | |
428 | 29 |
867 | 30 int separator_string_p (const Ibyte *s); |
428 | 31 void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *); |
1318 | 32 int gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, |
1913 | 33 int depth); |
454 | 34 |
35 | |
36 | |
428 | 37 extern int popup_up_p; |
38 | |
39 /************************************************************************/ | |
40 /* Image Instance Object */ | |
41 /************************************************************************/ | |
42 | |
43 /* This structure describes gui button, | |
44 menu item or submenu properties */ | |
45 struct Lisp_Gui_Item | |
46 { | |
3017 | 47 struct LCRECORD_HEADER header; |
428 | 48 Lisp_Object name; /* String */ |
49 Lisp_Object callback; /* Symbol or form */ | |
442 | 50 Lisp_Object callback_ex; /* Form taking context arguments */ |
428 | 51 Lisp_Object suffix; /* String */ |
52 Lisp_Object active; /* Form */ | |
53 Lisp_Object included; /* Form */ | |
54 Lisp_Object config; /* Anything EQable */ | |
55 Lisp_Object filter; /* Form */ | |
56 Lisp_Object style; /* Symbol */ | |
57 Lisp_Object selected; /* Form */ | |
58 Lisp_Object keys; /* String */ | |
59 Lisp_Object accelerator; /* Char or Symbol */ | |
442 | 60 Lisp_Object value; /* Anything you like */ |
428 | 61 }; |
62 | |
440 | 63 DECLARE_LRECORD (gui_item, Lisp_Gui_Item); |
64 #define XGUI_ITEM(x) XRECORD (x, gui_item, Lisp_Gui_Item) | |
617 | 65 #define wrap_gui_item(p) wrap_record (p, gui_item) |
440 | 66 #define GUI_ITEMP(x) RECORDP (x, gui_item) |
67 #define CHECK_GUI_ITEM(x) CHECK_RECORD (x, gui_item) | |
68 #define CONCHECK_GUI_ITEM(x) CONCHECK_RECORD (x, gui_item) | |
69 | |
454 | 70 int update_gui_item_keywords (Lisp_Object gui_item, Lisp_Object item); |
71 Lisp_Object copy_gui_item (Lisp_Object gui_item); | |
72 Lisp_Object widget_gui_parse_item_keywords (Lisp_Object item); | |
73 int gui_item_add_keyval_pair (Lisp_Object gui_item, | |
74 Lisp_Object key, Lisp_Object val, | |
578 | 75 Error_Behavior errb); |
428 | 76 Lisp_Object gui_parse_item_keywords (Lisp_Object item); |
77 Lisp_Object gui_parse_item_keywords_no_errors (Lisp_Object item); | |
430 | 78 void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item); |
1913 | 79 int gui_item_active_p (Lisp_Object); |
80 int gui_item_selected_p (Lisp_Object); | |
442 | 81 Lisp_Object gui_item_list_find_selected (Lisp_Object gui_item_list); |
1318 | 82 int gui_item_included_p (Lisp_Object, Lisp_Object into); |
428 | 83 Lisp_Object gui_item_accelerator (Lisp_Object gui_item); |
84 Lisp_Object gui_name_accelerator (Lisp_Object name); | |
1318 | 85 int gui_item_id_hash (Lisp_Object, Lisp_Object gui_item, int); |
771 | 86 Lisp_Object gui_item_display_flush_left (Lisp_Object gui_item); |
87 Lisp_Object gui_item_display_flush_right (Lisp_Object gui_item); | |
428 | 88 Lisp_Object allocate_gui_item (void); |
89 void gui_item_init (Lisp_Object gui_item); | |
90 Lisp_Object parse_gui_item_tree_children (Lisp_Object list); | |
442 | 91 Lisp_Object copy_gui_item_tree (Lisp_Object arg); |
92 | |
93 extern Lisp_Object Qmenu_no_selection_hook, Qdelete_dialog_box_hook; | |
428 | 94 |
95 /* this is mswindows biased but reasonably safe I think */ | |
96 #define GUI_ITEM_ID_SLOTS 8 | |
97 #define GUI_ITEM_ID_MIN(s) (s * 0x2000) | |
98 #define GUI_ITEM_ID_MAX(s) (0x1FFF + GUI_ITEM_ID_MIN (s)) | |
99 #define GUI_ITEM_ID_BITS(x,s) (((x) & 0x1FFF) + GUI_ITEM_ID_MIN (s)) | |
100 | |
101 #define MAX_MENUITEM_LENGTH 128 | |
102 | |
440 | 103 #endif /* INCLUDED_gui_h_ */ |