comparison src/gui.c @ 286:57709be46d1b r21-0b41

Import from CVS: tag r21-0b41
author cvs
date Mon, 13 Aug 2007 10:35:03 +0200
parents c5d627a313b1
children e11d67e05968
comparison
equal deleted inserted replaced
285:9a3756523c1b 286:57709be46d1b
24 /* Synched up with: Not in FSF. */ 24 /* Synched up with: Not in FSF. */
25 25
26 #include <config.h> 26 #include <config.h>
27 #include "lisp.h" 27 #include "lisp.h"
28 #include "gui.h" 28 #include "gui.h"
29 #include "bytecode.h" /* for struct Lisp_Compiled_Function */
29 30
30 Lisp_Object Q_active, Q_suffix, Q_keys, Q_style, Q_selected; 31 Lisp_Object Q_active, Q_suffix, Q_keys, Q_style, Q_selected;
31 Lisp_Object Q_filter, Q_config, Q_included; 32 Lisp_Object Q_filter, Q_config, Q_included;
32 Lisp_Object Q_accelerator; 33 Lisp_Object Q_accelerator;
33 Lisp_Object Qtoggle, Qradio; 34 Lisp_Object Qtoggle, Qradio;
59 return 0; 60 return 0;
60 for (p = s; *p == first; p++) 61 for (p = s; *p == first; p++)
61 ; 62 ;
62 63
63 return (*p == '!' || *p == ':' || *p == '\0'); 64 return (*p == '!' || *p == ':' || *p == '\0');
65 }
66
67 /* Massage DATA to find the correct function and argument. Used by
68 popup_selection_callback() and the msw code. */
69 void
70 get_callback (Lisp_Object data, Lisp_Object *fn, Lisp_Object *arg)
71 {
72 if (SYMBOLP (data)
73 || (COMPILED_FUNCTIONP (data)
74 && XCOMPILED_FUNCTION (data)->flags.interactivep)
75 || (EQ (XCAR (data), Qlambda)
76 && !NILP (Fassq (Qinteractive, Fcdr (Fcdr (data))))))
77 {
78 *fn = Qcall_interactively;
79 *arg = data;
80 }
81 else if (CONSP (data))
82 {
83 *fn = Qeval;
84 *arg = data;
85 }
86 else
87 {
88 *fn = Qeval;
89 *arg = list3 (Qsignal,
90 list2 (Qquote, Qerror),
91 list2 (Qquote, list2 (build_translated_string
92 ("illegal callback"),
93 data)));
94 }
64 } 95 }
65 96
66 /* 97 /*
67 * Initialize the gui_item structure by setting all (GC-protected) 98 * Initialize the gui_item structure by setting all (GC-protected)
68 * fields to their default values. The defaults are t for :active and 99 * fields to their default values. The defaults are t for :active and