1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
3
/* Mutter interface used by GTK+ UI to talk to core */
6
* Copyright (C) 2001 Havoc Pennington
7
* Copyright (C) 2005 Elijah Newren
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.
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.
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
28
/* Don't include core headers here */
30
#include <meta/common.h>
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,
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,
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.
60
* meta_core_get (my_display, my_window,
61
* META_CORE_GET_X, &x,
62
* META_CORE_GET_Y, &y,
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.
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.
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.
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.
91
void meta_core_get (Display *xdisplay,
95
void meta_core_queue_frame_resize (Display *xdisplay,
96
Window frame_xwindow);
98
/* Move as a result of user operation */
99
void meta_core_user_move (Display *xdisplay,
100
Window frame_xwindow,
103
void meta_core_user_resize (Display *xdisplay,
104
Window frame_xwindow,
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,
115
void meta_core_user_focus (Display *xdisplay,
116
Window frame_xwindow,
119
void meta_core_lower_beneath_focus_window (Display *xdisplay,
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,
138
void meta_core_unshade (Display *xdisplay,
139
Window frame_xwindow,
141
void meta_core_shade (Display *xdisplay,
142
Window frame_xwindow,
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,
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,
164
void meta_core_show_window_menu (Display *xdisplay,
165
Window frame_xwindow,
171
void meta_core_get_menu_accelerator (MetaMenuOp menu_op,
173
unsigned int *keysym,
174
MetaVirtualModifier *modifiers);
176
gboolean meta_core_begin_grab_op (Display *xdisplay,
177
Window frame_xwindow,
179
gboolean pointer_already_grabbed,
180
gboolean frame_action,
186
void meta_core_end_grab_op (Display *xdisplay,
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);
193
void meta_core_grab_buttons (Display *xdisplay,
194
Window frame_xwindow);
196
void meta_core_set_screen_cursor (Display *xdisplay,
197
Window frame_on_screen,
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.
204
void meta_core_increment_event_serial (Display *display);
206
void meta_invalidate_default_icons (void);