annotate src/extw-Xlib.c @ 5885:c8bbb32fe124

Always return a string, #'current-message. lisp/ChangeLog addition: 2015-04-04 Aidan Kehoe <kehoea@parhasard.net> * gutter-items.el (append-progress-feedback): * gutter-items.el (abort-progress-feedback): Correct comments in both these functions, it's the progress stack being adjusted, not the message stack. * simple.el (message-stack): Describe my recent change in the structure of this. * simple.el (current-message): Adjust the implementation of this to always return the string displayed.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 04 Apr 2015 13:49:30 +0100
parents 2aa9cd456ae7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Common code between client and shell widgets; not Xt-specific.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
5405
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
4 This library is free software: you can redistribute it and/or modify it
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
5 under the terms of the GNU General Public License as published by the
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
6 Free Software Foundation, either version 3 of the License, or (at your
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
7 option) any later version.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
5405
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
9 This library is distributed in the hope that it will be useful, but WITHOUT
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
12 for more details.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
5405
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
14 You should have received a copy of the GNU General Public License
2aa9cd456ae7 Move src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 0
diff changeset
15 along with this library. If not, see <http://www.gnu.org/licenses/>. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 /* Written by Ben Wing, September 1993. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 #ifdef emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #ifndef EXTERNAL_WIDGET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ERROR! This ought not be getting compiled if EXTERNAL_WIDGET is undefined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include <X11/Xlib.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include "extw-Xlib.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 int extw_which_side;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 static int atoms_initialized;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 Atom a_EXTW_QUERY_GEOMETRY, a_EXTW_GEOMETRY_MANAGER, a_EXTW_WIDGET_GEOMETRY,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 a_EXTW_NOTIFY;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 extw_initialize_atoms(Display *display)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 if (!atoms_initialized) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 a_EXTW_QUERY_GEOMETRY =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 XInternAtom(display, "EXTW_QUERY_GEOMETRY", False);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 a_EXTW_GEOMETRY_MANAGER =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 XInternAtom(display, "EXTW_GEOMETRY_MANAGER", False);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 a_EXTW_WIDGET_GEOMETRY =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 XInternAtom(display, "EXTW_WIDGET_GEOMETRY", False);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 a_EXTW_NOTIFY =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 XInternAtom(display, "EXTW_NOTIFY", False);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 atoms_initialized = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 /* send a notification to the other-side widget. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 extw_send_notify_3(Display *display, Window win, en_extw_notify type,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 long data0, long data1, long data2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 XClientMessageEvent xev;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 xev.type = ClientMessage;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 xev.message_type = a_EXTW_NOTIFY;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 xev.format = 32;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 xev.display = display;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 xev.window = win;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 xev.data.l[0] = extw_which_side;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 xev.data.l[1] = type;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 xev.data.l[2] = data0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 xev.data.l[3] = data1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 xev.data.l[4] = data2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 /* UGGGHHHH! All I want to do is ensure that the ClientMessage gets
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 received. Unfortunately X doesn't provide any simple way to do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 that but instead has this event_mask bogosity in XSendEvent. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 XSendEvent(display, win, False,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 extw_which_side == extw_shell_send ? 0 : StructureNotifyMask,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (XEvent *) &xev);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 }