aboutsummaryrefslogtreecommitdiffstats
path: root/matchbox/comp-mgr/mb-wm-comp-mgr.h
blob: fb799845927d04350825c03a838b0e2d734fe228 (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
/*
 *  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 <X11/extensions/Xdamage.h>

#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 ())

#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 ())

#define MB_WM_COMP_MGR_EFFECT(c) ((MBWMCompMgrEffect*)(c))
#define MB_WM_COMP_MGR_EFFECT_CLASS(c) ((MBWMCompMgrEffectClass*)(c))
#define MB_WM_TYPE_COMP_MGR_EFFECT (mb_wm_comp_mgr_effect_class_type ())

struct MBWMCompMgr
{
  MBWMObject           parent;

  MBWindowManager     *wm;
  Bool                 disabled;
};

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   (*map_notify)        (MBWMCompMgr * mgr, MBWindowManagerClient *c);
  Bool   (*handle_events)     (MBWMCompMgr * mgr, XEvent *ev);
  Bool   (*my_window)         (MBWMCompMgr * mgr, Window xwin);
};

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_map_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);

struct MBWMCompMgrClient
{
  MBWMObject              parent;

  MBWindowManagerClient * wm_client;

  /* Make private ? */
  MBWMList              * effects; /* List of MBWMCompMgrEffectAssociation */
  Bool                    is_argb32;
};

struct MBWMCompMgrClientClass
{
  MBWMObjectClass        parent;

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

  MBWMCompMgrEffect * (*effect_new)    (MBWMCompMgrClient * client,
					MBWMCompMgrEffectEvent event,
					MBWMCompMgrEffectType type,
					unsigned long duration,
					MBWMGravity   gravity);

};

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);

void
mb_wm_comp_mgr_client_add_effects (MBWMCompMgrClient      * client,
				   MBWMCompMgrEffectEvent   event,
				   MBWMList               * effects);

void
mb_wm_comp_mgr_client_run_effect (MBWMCompMgrClient         * client,
				  MBWMCompMgrEffectEvent      event,
				  MBWMCompMgrEffectCallback   completed_cb,
				  void                      * data);

MBWMList *
mb_wm_comp_mgr_client_get_effects (MBWMCompMgrClient      * client,
				   MBWMCompMgrEffectEvent   event,
				   MBWMCompMgrEffectType    type,
				   unsigned long            duration,
				   MBWMGravity              gravity);

/*
 * Generic effect that can applied to a client
 */
struct MBWMCompMgrEffect
{
  MBWMObject              parent;
  MBWMCompMgrEffectType   type;
  unsigned long           duration;
  MBWMGravity             gravity;
};

struct MBWMCompMgrEffectClass
{
  MBWMObjectClass        parent;

  void (*run)  (MBWMList                  * effects,
		MBWMCompMgrClient         * cm_client,
		MBWMCompMgrEffectEvent      event,
		MBWMCompMgrEffectCallback   completed_cb,
		void                      * data);
};

int
mb_wm_comp_mgr_effect_class_type ();

#endif