Debian Codegraph @

xo/messages.h

raw
1 /* messages.h -*- C++ -*-
2 $Id: messages.h,v 1.2 1997/10/18 04:57:40 elf Exp $
3
4 written by Marc Singer
5 12 May 1997
6
7 This file is part of the project XO. See the file README for
8 more information.
9
10 Copyright (C) 1997 Marc Singer
11
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 in a file called COPYING along with this program; if not, write to
24 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
25 02139, USA.
26
27 -----------
28 DESCRIPTION
29 -----------
30
31 We have some of our own messages to piggyback onto the core message
32 sending code. We do this in a simple way. We define message
33 identifiers that cannot practically collide with the protocol
34 messages. We choose to avoid the X client message as it is best
35 suited to inter-application messaging which does not suit us. Ours
36 is a more efficient mechanism.
37
38 */
39
40 #if !defined (__MESSAGES_H__)
41 # define __MESSAGES_H__
42
43 /* ----- Includes */
44
45 /* ----- Globals */
46
47 #define FIRSTXoEventBase 0x8000
48 #define CreateSelfNotify 0x8001 // Notify to window that it is created
49 #define ChildNotify 0x8002 // Button notifying parent of event
50
51 typedef struct {
52 int type;
53 unsigned long serial; // We don't use this
54 Bool send_event; // We always set this, only because it is true
55 Display* display; // Display where child and this window reside
56 Window window; // Window receiving the event
57 } XoAnyEvent;
58
59 typedef struct {
60 int type;
61 unsigned long serial; // We don't use this
62 Bool send_event; // We always set this, only because it is true
63 Display* display; // Display where child and this window reside
64 Window window; // Window receiving the event
65 // -- Event specific portion
66 Window parent; // Parent that owns this window
67 void* pvParentData; // Context pointer returned to parent on notify
68 int x, y; // Window origin relative to parent
69 int width, height; // Window extent
70 int border_width; // I'm not sure if this is important
71 } XoCreateSelfWindowEvent;
72
73 typedef struct {
74 int type;
75 unsigned long serial; // We don't use this
76 Bool send_event; // We always set this, only because it is true
77 Display* display; // Display where child and this window reside
78 Window window; // Window receiving the event
79 // -- Event specific portion
80 LWindow* pWindowChild; // Child window sending the event
81 void* pvParentData; // Context pointer, a type of ID
82 int child_type; // Child's event type, class specific
83 int rgData[4]; // Some data from the child
84 } XoChildNotifyEvent;
85
86 typedef union {
87 int type;
88 XoAnyEvent xany;
89 XoCreateSelfWindowEvent xcreatewindow;
90 XoChildNotifyEvent xchildnotify;
91 } XoEvent;
92
93 #endif /* __MESSAGES_H__ */