~ubuntu-branches/ubuntu/natty/mutter/natty

« back to all changes in this revision

Viewing changes to src/core/core.h

  • Committer: Bazaar Package Importer
  • Author(s): Rico Tzschichholz
  • Date: 2011-04-10 22:27:59 UTC
  • mfrom: (0.7.1 upstream) (0.3.20 experimental)
  • Revision ID: james.westby@ubuntu.com-20110410222759-o6n1i5p0unsti44n
Tags: 3.0.0-0ubuntu1
* New upstream release

* Merge with debian experimental (LP: #742458), remaining changes:
  + debian/patches/03_link_gles2.patch: Link to clutter-glx-1.0
    explicitily at the end of link flags, to bring in libGLESv2 on armel.
* debian/control.in:
  + rename gir package to gir1.2-mutter-3.0
* debian/libmutter0.symbols:
  + updated
* debian/patches:
  + fix 03_link_gles2.patch 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 
2
 
 
3
/* Mutter interface used by GTK+ UI to talk to core */
 
4
 
 
5
/* 
 
6
 * Copyright (C) 2001 Havoc Pennington
 
7
 * Copyright (C) 2005 Elijah Newren
 
8
 * 
 
9
 * This program is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU General Public License as
 
11
 * published by the Free Software Foundation; either version 2 of the
 
12
 * License, or (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful, but
 
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * General Public License for more details.
 
18
 * 
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
22
 * 02111-1307, USA.
 
23
 */
 
24
 
 
25
#ifndef META_CORE_H
 
26
#define META_CORE_H
 
27
 
 
28
/* Don't include core headers here */
 
29
#include <gdk/gdkx.h>
 
30
#include <meta/common.h>
 
31
 
 
32
typedef enum
 
33
{
 
34
  META_CORE_GET_END = 0,
 
35
  META_CORE_WINDOW_HAS_FRAME,
 
36
  META_CORE_GET_CLIENT_WIDTH,
 
37
  META_CORE_GET_CLIENT_HEIGHT,
 
38
  META_CORE_IS_TITLEBAR_ONSCREEN,
 
39
  META_CORE_GET_CLIENT_XWINDOW,
 
40
  META_CORE_GET_FRAME_FLAGS,
 
41
  META_CORE_GET_FRAME_TYPE,
 
42
  META_CORE_GET_MINI_ICON,
 
43
  META_CORE_GET_ICON,
 
44
  META_CORE_GET_X,
 
45
  META_CORE_GET_Y,
 
46
  META_CORE_GET_FRAME_WORKSPACE,
 
47
  META_CORE_GET_FRAME_X,
 
48
  META_CORE_GET_FRAME_Y,
 
49
  META_CORE_GET_FRAME_WIDTH,
 
50
  META_CORE_GET_FRAME_HEIGHT,
 
51
  META_CORE_GET_SCREEN_WIDTH,
 
52
  META_CORE_GET_SCREEN_HEIGHT,
 
53
} MetaCoreGetType;
 
54
 
 
55
/* General information function about the given window. Pass in a sequence of
 
56
 * pairs of MetaCoreGetTypes and pointers to variables; the variables will be
 
57
 * filled with the requested values. End the list with META_CORE_GET_END.
 
58
 * For example:
 
59
 *
 
60
 *   meta_core_get (my_display, my_window,
 
61
 *                  META_CORE_GET_X, &x,
 
62
 *                  META_CORE_GET_Y, &y,
 
63
 *                  META_CORE_GET_END);
 
64
 *
 
65
 * If the window doesn't have a frame, this will raise a meta_bug. To suppress
 
66
 * this behaviour, ask META_CORE_WINDOW_HAS_FRAME as the *first* question in
 
67
 * the list. If the window has no frame, the answer to this question will be
 
68
 * False, and anything else you asked will be undefined. Otherwise, the answer
 
69
 * will be True. The answer will necessarily be True if you ask the question
 
70
 * in any other position. The positions of all other questions don't matter.
 
71
 *
 
72
 * The reason for this function is that some parts of the program don't know
 
73
 * about MetaWindows. But they *can* see core.h. So we used to have a whole
 
74
 * load of functions which took a display and an X window, looked up the
 
75
 * relevant MetaWindow, and returned information about it. The trouble with
 
76
 * that is that looking up the MetaWindow is a nontrivial operation, and
 
77
 * consolidating the calls in this way makes (for example) frame exposes
 
78
 * 33% faster, according to valgrind.
 
79
 *
 
80
 * This function would perhaps be slightly better if the questions were
 
81
 * represented by pointers, perhaps gchar*s, because then we could take
 
82
 * advantage of gcc's automatic sentinel checking. On the other hand, this
 
83
 * immediately suggests string comparison, and that's slow.
 
84
 *
 
85
 * Another possible improvement is that core.h still has a bunch of
 
86
 * functions which can't be described by the formula "give a display and
 
87
 * an X window, get a single value" (meta_core_user_move, for example), but
 
88
 * which could theoretically be handled by this function if we relaxed the
 
89
 * requirement that all questions should have exactly one argument.
 
90
 */
 
91
void meta_core_get (Display *xdisplay,
 
92
                    Window window,
 
93
                    ...);
 
94
 
 
95
void meta_core_queue_frame_resize (Display *xdisplay,
 
96
                                   Window frame_xwindow);
 
97
 
 
98
/* Move as a result of user operation */
 
99
void meta_core_user_move    (Display *xdisplay,
 
100
                             Window   frame_xwindow,
 
101
                             int      x,
 
102
                             int      y);
 
103
void meta_core_user_resize  (Display *xdisplay,
 
104
                             Window   frame_xwindow,
 
105
                             int      gravity,
 
106
                             int      width,
 
107
                             int      height);
 
108
 
 
109
void meta_core_user_raise   (Display *xdisplay,
 
110
                             Window   frame_xwindow);
 
111
void meta_core_user_lower_and_unfocus (Display *xdisplay,
 
112
                                       Window   frame_xwindow,
 
113
                                       guint32  timestamp);
 
114
 
 
115
void meta_core_user_focus   (Display *xdisplay,
 
116
                             Window   frame_xwindow,
 
117
                             guint32  timestamp);
 
118
 
 
119
void meta_core_lower_beneath_focus_window (Display *xdisplay,
 
120
                                           Window   xwindow,
 
121
                                           guint32  timestamp);
 
122
 
 
123
void meta_core_minimize         (Display *xdisplay,
 
124
                                 Window   frame_xwindow);
 
125
void meta_core_toggle_maximize  (Display *xdisplay,
 
126
                                 Window   frame_xwindow);
 
127
void meta_core_toggle_maximize_horizontally  (Display *xdisplay,
 
128
                                              Window   frame_xwindow);
 
129
void meta_core_toggle_maximize_vertically    (Display *xdisplay,
 
130
                                              Window   frame_xwindow);
 
131
void meta_core_unmaximize       (Display *xdisplay,
 
132
                                 Window   frame_xwindow);
 
133
void meta_core_maximize         (Display *xdisplay,
 
134
                                 Window   frame_xwindow);
 
135
void meta_core_delete           (Display *xdisplay,
 
136
                                 Window   frame_xwindow,
 
137
                                 guint32  timestamp);
 
138
void meta_core_unshade          (Display *xdisplay,
 
139
                                 Window   frame_xwindow,
 
140
                                 guint32  timestamp);
 
141
void meta_core_shade            (Display *xdisplay,
 
142
                                 Window   frame_xwindow,
 
143
                                 guint32  timestamp);
 
144
void meta_core_unstick          (Display *xdisplay,
 
145
                                 Window   frame_xwindow);
 
146
void meta_core_stick            (Display *xdisplay,
 
147
                                 Window   frame_xwindow);
 
148
void meta_core_unmake_above     (Display *xdisplay,
 
149
                                 Window   frame_xwindow);
 
150
void meta_core_make_above       (Display *xdisplay,
 
151
                                 Window   frame_xwindow);
 
152
void meta_core_change_workspace (Display *xdisplay,
 
153
                                 Window   frame_xwindow,
 
154
                                 int      new_workspace);
 
155
 
 
156
int meta_core_get_num_workspaces (Screen  *xscreen);
 
157
int meta_core_get_active_workspace (Screen *xscreen);
 
158
int meta_core_get_frame_workspace (Display *xdisplay,
 
159
                                   Window frame_xwindow);
 
160
const char* meta_core_get_workspace_name_with_index (Display *xdisplay,
 
161
                                                     Window xroot,
 
162
                                                     int    index);
 
163
 
 
164
void meta_core_show_window_menu (Display *xdisplay,
 
165
                                 Window   frame_xwindow,
 
166
                                 int      root_x,
 
167
                                 int      root_y,
 
168
                                 int      button,
 
169
                                 guint32  timestamp);
 
170
 
 
171
void meta_core_get_menu_accelerator (MetaMenuOp           menu_op,
 
172
                                     int                  workspace,
 
173
                                     unsigned int        *keysym,
 
174
                                     MetaVirtualModifier *modifiers);
 
175
 
 
176
gboolean   meta_core_begin_grab_op (Display    *xdisplay,
 
177
                                    Window      frame_xwindow,
 
178
                                    MetaGrabOp  op,
 
179
                                    gboolean    pointer_already_grabbed,
 
180
                                    gboolean    frame_action,
 
181
                                    int         button,
 
182
                                    gulong      modmask,
 
183
                                    guint32     timestamp,
 
184
                                    int         root_x,
 
185
                                    int         root_y);
 
186
void       meta_core_end_grab_op   (Display    *xdisplay,
 
187
                                    guint32     timestamp);
 
188
MetaGrabOp meta_core_get_grab_op     (Display    *xdisplay);
 
189
Window     meta_core_get_grab_frame  (Display   *xdisplay);
 
190
int        meta_core_get_grab_button (Display  *xdisplay);
 
191
 
 
192
 
 
193
void       meta_core_grab_buttons  (Display *xdisplay,
 
194
                                    Window   frame_xwindow);
 
195
 
 
196
void       meta_core_set_screen_cursor (Display *xdisplay,
 
197
                                        Window   frame_on_screen,
 
198
                                        MetaCursor cursor);
 
199
 
 
200
/* Used because we ignore EnterNotify when a window is unmapped that
 
201
 * really shouldn't cause focus changes, by comparing the event serial
 
202
 * of the EnterNotify and the UnmapNotify.
 
203
 */
 
204
void meta_core_increment_event_serial (Display *display);
 
205
 
 
206
void meta_invalidate_default_icons (void);
 
207
 
 
208
#endif
 
209
 
 
210
 
 
211
 
 
212