annotate src/gui-msw.c @ 384:bbff43aa5eb7 r21-2-7

Import from CVS: tag r21-2-7
author cvs
date Mon, 13 Aug 2007 11:08:24 +0200
parents
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
1 /* mswindows GUI code. (menubars, scrollbars, toolbars, dialogs)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
2 Copyright (C) 1998 Andy Piper.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
3
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
4 This file is part of XEmacs.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
5
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
9 later version.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
10
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
14 for more details.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
15
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
20
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
22
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
23 #include <config.h>
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
24 #include "lisp.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
25 #include "gui.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
26 #include "redisplay.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
27 #include "frame.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
28 #include "elhash.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
29 #include "console-msw.h"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
30
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
31 /*
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
32 * Return value is Qt if we have dispatched the command,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
33 * or Qnil if id has not been mapped to a callback.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
34 * Window procedure may try other targets to route the
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
35 * command if we return nil
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
36 */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
37 Lisp_Object
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
38 mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, WORD id)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
39 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
40 /* Try to map the command id through the proper hash table */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
41 Lisp_Object data, fn, arg, frame;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
42
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
43 data = Fgethash (make_int (id),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
44 FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f), Qnil);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
45
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
46 if (NILP (data) || UNBOUNDP (data))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
47 return Qnil;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
48
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
49 MARK_SUBWINDOWS_CHANGED;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
50 /* Ok, this is our one. Enqueue it. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
51 get_gui_callback (data, &fn, &arg);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
52 XSETFRAME (frame, f);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
53 mswindows_enqueue_misc_user_event (frame, fn, arg);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
54
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
55 return Qt;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
56 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
57