aboutsummaryrefslogtreecommitdiffstats
path: root/matchbox/mb-wm-comp-mgr.h
blob: 9e7224c00ed1c4fea588d96f11e61d8eaaee36c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
 *  Matchbox Window Manager - A lightweight window manager not for the
 *                            desktop.
 *
 *  Authored By Tomas Frydrych <tf@o-hand.com>
 *
 *  Copyright (c) 2002, 2004, 2007 OpenedHand Ltd - http://o-hand.com
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 */

#ifndef _HAVE_MB_WM_COMP_MGR_H
#define _HAVE_MB_WM_COMP_MGR_H

#include <matchbox/mb-wm-client.h>

#include <X11/extensions/Xdamage.h>

/* XXX: We have a circular dependency between mb-wm-comp-mgr.h
 * and mb-wm-client.h */
#ifndef MB_WM_CLIENT_TYPEDEF_DEFINED
typedef struct MBWindowManagerClient MBWindowManagerClient;
#define MB_WM_CLIENT_TYPEDEF_DEFINED
#endif

#define MB_WM_COMP_MGR(c) ((MBWMCompMgr*)(c))
#define MB_WM_COMP_MGR_CLASS(c) ((MBWMCompMgrClass*)(c))
#define MB_WM_TYPE_COMP_MGR (mb_wm_comp_mgr_class_type ())

/* XXX: We have a circular dependency between mb-wm-comp-mgr.h
 * and mb-wm-client.h */
#ifndef MB_WM_COMP_MGR_TYPEDEF_DEFINED
typedef struct MBWMCompMgr                 MBWMCompMgr;
#define MB_WM_COMP_MGR_TYPEDEF_DEFINED
#endif
typedef struct MBWMCompMgrClass            MBWMCompMgrClass;

#define MB_WM_COMP_MGR_CLIENT(c) ((MBWMCompMgrClient*)(c))
#define MB_WM_COMP_MGR_CLIENT_CLASS(c) ((MBWMCompMgrClientClass*)(c))
#define MB_WM_TYPE_COMP_MGR_CLIENT (mb_wm_comp_mgr_client_class_type ())

typedef struct MBWMCompMgrClient           MBWMCompMgrClient;
typedef struct MBWMCompMgrClientClass      MBWMCompMgrClientClass;

struct MBWMCompMgr
{
  MBWMObject           parent;

  MBWindowManager     *wm;
  Bool                 disabled;
  unsigned long        damage_cb_id;
};

struct MBWMCompMgrClass
{
  MBWMObjectClass        parent;

  void   (*register_client)   (MBWMCompMgr * mgr, MBWindowManagerClient *c);
  void   (*unregister_client) (MBWMCompMgr * mgr, MBWindowManagerClient *c);
  void   (*turn_on)           (MBWMCompMgr * mgr);
  void   (*turn_off)          (MBWMCompMgr * mgr);
  void   (*render)            (MBWMCompMgr * mgr);
  void   (*restack)           (MBWMCompMgr * mgr);
  void   (*map_notify)        (MBWMCompMgr * mgr, MBWindowManagerClient *c);
  void   (*unmap_notify)      (MBWMCompMgr * mgr, MBWindowManagerClient *c);
  Bool   (*handle_damage)     (XDamageNotifyEvent * xev, MBWMCompMgr * mgr);
  Bool   (*my_window)         (MBWMCompMgr * mgr, Window xwin);
  void   (*client_event)      (MBWMCompMgr * mgr,
			       MBWindowManagerClient *c1,
			       MBWMCompMgrClientEvent event);
  void   (*client_transition) (MBWMCompMgr * mgr,
			       MBWindowManagerClient *c1,
			       MBWindowManagerClient *c2,
			       Bool reverse);

  void   (*select_desktop)    (MBWMCompMgr * mgr,
			       int desktop, int old_desktop);
};

int
mb_wm_comp_mgr_class_type ();

void
mb_wm_comp_mgr_register_client (MBWMCompMgr * mgr, MBWindowManagerClient *c);

void
mb_wm_comp_mgr_unregister_client (MBWMCompMgr * mgr,
				  MBWindowManagerClient *client);

void
mb_wm_comp_mgr_turn_off (MBWMCompMgr *mgr);

void
mb_wm_comp_mgr_turn_on (MBWMCompMgr *mgr);

void
mb_wm_comp_mgr_render (MBWMCompMgr *mgr);

void
mb_wm_comp_mgr_restack (MBWMCompMgr *mgr);

void
mb_wm_comp_mgr_map_notify (MBWMCompMgr *mgr, MBWindowManagerClient *c);

void
mb_wm_comp_mgr_unmap_notify (MBWMCompMgr *mgr, MBWindowManagerClient *c);

Bool
mb_wm_comp_mgr_enabled (MBWMCompMgr *mgr);

Bool
mb_wm_comp_mgr_handle_events (MBWMCompMgr * mgr, XEvent *ev);

Bool
mb_wm_comp_mgr_is_my_window (MBWMCompMgr * mgr, Window xwin);

void
mb_wm_comp_mgr_do_transition (MBWMCompMgr           * mgr,
			      MBWindowManagerClient * c1,
			      MBWindowManagerClient * c2,
			      Bool                    reverse);

void
mb_wm_comp_mgr_do_effect (MBWMCompMgr            * mgr,
			  MBWindowManagerClient  * client,
			  MBWMCompMgrClientEvent   event);

void
mb_wm_comp_mgr_select_desktop (MBWMCompMgr * mgr,
			       int           desktop,
			       int           old_desktop);

struct MBWMCompMgrClient
{
  MBWMObject              parent;

  MBWindowManager       * wm;
  MBWindowManagerClient * wm_client;

  /* Make private ? */
  Bool                    is_argb32;
};

struct MBWMCompMgrClientClass
{
  MBWMObjectClass        parent;

  void (*show)      (MBWMCompMgrClient * client);
  void (*hide)      (MBWMCompMgrClient * client);
  void (*repair)    (MBWMCompMgrClient * client);
  void (*configure) (MBWMCompMgrClient * client);
};

int
mb_wm_comp_mgr_client_class_type ();

void
mb_wm_comp_mgr_client_show (MBWMCompMgrClient * client);

void
mb_wm_comp_mgr_client_hide (MBWMCompMgrClient * client);

void
mb_wm_comp_mgr_client_repair (MBWMCompMgrClient * client);

void
mb_wm_comp_mgr_client_configure (MBWMCompMgrClient * client);


#endif