Commit 28b7c6f0 authored by Matthias Clasen's avatar Matthias Clasen

Rename _gdk_event_mask_table to _gdk_x11_event_mask_table

parent 985eb144
......@@ -8,7 +8,7 @@
*
* This library 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
......@@ -69,9 +69,9 @@ struct _GdkThreadsDispatch
/* Private variable declarations
*/
static int gdk_initialized = 0; /* 1 if the library is initialized,
* 0 otherwise.
*/
static int gdk_initialized = 0; /* 1 if the library is initialized,
* 0 otherwise.
*/
static gchar *gdk_progclass = NULL;
......@@ -82,37 +82,32 @@ static GCallback gdk_threads_unlock = NULL;
#ifdef G_ENABLE_DEBUG
static const GDebugKey gdk_debug_keys[] = {
{"events", GDK_DEBUG_EVENTS},
{"misc", GDK_DEBUG_MISC},
{"dnd", GDK_DEBUG_DND},
{"xim", GDK_DEBUG_XIM},
{"events", GDK_DEBUG_EVENTS},
{"misc", GDK_DEBUG_MISC},
{"dnd", GDK_DEBUG_DND},
{"xim", GDK_DEBUG_XIM},
{"nograbs", GDK_DEBUG_NOGRABS},
{"colormap", GDK_DEBUG_COLORMAP},
{"input", GDK_DEBUG_INPUT},
{"cursor", GDK_DEBUG_CURSOR},
{"multihead", GDK_DEBUG_MULTIHEAD},
{"xinerama", GDK_DEBUG_XINERAMA},
{"draw", GDK_DEBUG_DRAW},
{"eventloop", GDK_DEBUG_EVENTLOOP}
{"colormap", GDK_DEBUG_COLORMAP},
{"input", GDK_DEBUG_INPUT},
{"cursor", GDK_DEBUG_CURSOR},
{"multihead", GDK_DEBUG_MULTIHEAD},
{"xinerama", GDK_DEBUG_XINERAMA},
{"draw", GDK_DEBUG_DRAW},
{"eventloop", GDK_DEBUG_EVENTLOOP}
};
static const int gdk_ndebug_keys = G_N_ELEMENTS (gdk_debug_keys);
#endif /* G_ENABLE_DEBUG */
#ifdef G_ENABLE_DEBUG
static gboolean
gdk_arg_debug_cb (const char *key, const char *value, gpointer user_data, GError **error)
{
guint debug_value = g_parse_debug_string (value,
(GDebugKey *) gdk_debug_keys,
gdk_ndebug_keys);
(GDebugKey *) gdk_debug_keys,
G_N_ELEMENTS (gdk_debug_keys));
if (debug_value == 0 && value != NULL && strcmp (value, "") != 0)
{
g_set_error (error,
G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
_("Error parsing option --gdk-debug"));
g_set_error (error,
G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
_("Error parsing option --gdk-debug"));
return FALSE;
}
......@@ -125,14 +120,14 @@ static gboolean
gdk_arg_no_debug_cb (const char *key, const char *value, gpointer user_data, GError **error)
{
guint debug_value = g_parse_debug_string (value,
(GDebugKey *) gdk_debug_keys,
gdk_ndebug_keys);
(GDebugKey *) gdk_debug_keys,
G_N_ELEMENTS (gdk_debug_keys));
if (debug_value == 0 && value != NULL && strcmp (value, "") != 0)
{
g_set_error (error,
G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
_("Error parsing option --gdk-no-debug"));
g_set_error (error,
G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
_("Error parsing option --gdk-no-debug"));
return FALSE;
}
......@@ -210,10 +205,10 @@ gdk_pre_parse_libgtk_only (void)
gchar *debug_string = getenv("GDK_DEBUG");
if (debug_string != NULL)
_gdk_debug_flags = g_parse_debug_string (debug_string,
(GDebugKey *) gdk_debug_keys,
gdk_ndebug_keys);
(GDebugKey *) gdk_debug_keys,
G_N_ELEMENTS (gdk_debug_keys));
}
#endif /* G_ENABLE_DEBUG */
#endif /* G_ENABLE_DEBUG */
if (getenv ("GDK_NATIVE_WINDOWS"))
{
......@@ -247,7 +242,7 @@ gdk_pre_parse_libgtk_only (void)
**/
void
gdk_parse_args (int *argc,
char ***argv)
char ***argv)
{
GOptionContext *option_context;
GOptionGroup *option_group;
......@@ -527,28 +522,28 @@ gdk_init (int *argc, char ***argv)
* say_something = (yes_or_no != data->what);
*
* if(say_something)
* {
* /<!---->* set the variable *<!---->/
* yes_or_no = data->what;
* }
* {
* /<!---->* set the variable *<!---->/
* yes_or_no = data->what;
* }
*
* /<!---->* Unlock the yes_or_no variable *<!---->/
* G_UNLOCK (yes_or_no);
*
* if (say_something)
* {
* /<!---->* get GTK thread lock *<!---->/
* gdk_threads_enter (<!-- -->);
*
* /<!---->* set label text *<!---->/
* if(data->what == YES_IT_IS)
* gtk_label_set_text (GTK_LABEL (data->label), "O yes, it is!");
* else
* gtk_label_set_text (GTK_LABEL (data->label), "O no, it isn't!");
*
* /<!---->* release GTK thread lock *<!---->/
* gdk_threads_leave (<!-- -->);
* }
* {
* /<!---->* get GTK thread lock *<!---->/
* gdk_threads_enter (<!-- -->);
*
* /<!---->* set label text *<!---->/
* if(data->what == YES_IT_IS)
* gtk_label_set_text (GTK_LABEL (data->label), "O yes, it is!");
* else
* gtk_label_set_text (GTK_LABEL (data->label), "O no, it isn't!");
*
* /<!---->* release GTK thread lock *<!---->/
* gdk_threads_leave (<!-- -->);
* }
* }
*
* return NULL;
......@@ -702,10 +697,10 @@ gdk_threads_init (void)
**/
void
gdk_threads_set_lock_functions (GCallback enter_fn,
GCallback leave_fn)
GCallback leave_fn)
{
g_return_if_fail (gdk_threads_lock == NULL &&
gdk_threads_unlock == NULL);
gdk_threads_unlock == NULL);
gdk_threads_lock = enter_fn;
gdk_threads_unlock = leave_fn;
......@@ -795,9 +790,9 @@ gdk_threads_dispatch_free (gpointer data)
*/
guint
gdk_threads_add_idle_full (gint priority,
GSourceFunc function,
gpointer data,
GDestroyNotify notify)
GSourceFunc function,
gpointer data,
GDestroyNotify notify)
{
GdkThreadsDispatch *dispatch;
......@@ -830,7 +825,7 @@ gdk_threads_add_idle_full (gint priority,
*/
guint
gdk_threads_add_idle (GSourceFunc function,
gpointer data)
gpointer data)
{
return gdk_threads_add_idle_full (G_PRIORITY_DEFAULT_IDLE,
function, data, NULL);
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "glib.h"
#include "gdkdevice-core.h"
#include "gdkinternals.h"
......@@ -368,10 +369,10 @@ gdk_device_core_grab (GdkDevice *device,
xevent_mask = 0;
for (i = 0; i < _gdk_nenvent_masks; i++)
for (i = 0; i < _gdk_x11_event_mask_table_size; i++)
{
if (event_mask & (1 << (i + 1)))
xevent_mask |= _gdk_event_mask_table[i];
xevent_mask |= _gdk_x11_event_mask_table[i];
}
/* We don't want to set a native motion hint mask, as we're emulating motion
......@@ -589,10 +590,10 @@ gdk_device_core_select_window_events (GdkDevice *device,
/* Combine masks */
event_mask |= window_mask;
for (i = 0; i < _gdk_nenvent_masks; i++)
for (i = 0; i < _gdk_x11_event_mask_table_size; i++)
{
if (event_mask & (1 << (i + 1)))
xmask |= _gdk_event_mask_table[i];
xmask |= _gdk_x11_event_mask_table[i];
}
if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window))
......
......@@ -406,10 +406,10 @@ gdk_x11_event_source_select_events (GdkEventSource *source,
list = list->next;
}
for (i = 0; i < _gdk_nenvent_masks; i++)
for (i = 0; i < _gdk_x11_event_mask_table_size; i++)
{
if (event_mask & (1 << (i + 1)))
xmask |= _gdk_event_mask_table[i];
xmask |= _gdk_x11_event_mask_table[i];
}
XSelectInput (GDK_DISPLAY_XDISPLAY (source->display), window, xmask);
......
......@@ -246,10 +246,10 @@ _get_scratch_gc (GdkWindow *window, cairo_region_t *clip_region)
&values);
}
_gdk_region_get_xrectangles (clip_region,
0, 0,
&rectangles,
&n_rects);
_gdk_x11_region_get_xrectangles (clip_region,
0, 0,
&rectangles,
&n_rects);
XSetClipRectangles (screen->xdisplay,
screen->subwindow_gcs[depth],
......
......@@ -500,11 +500,11 @@ _gdk_send_xevent (GdkDisplay *display,
}
void
_gdk_region_get_xrectangles (const cairo_region_t *region,
gint x_offset,
gint y_offset,
XRectangle **rects,
gint *n_rects)
_gdk_x11_region_get_xrectangles (const cairo_region_t *region,
gint x_offset,
gint y_offset,
XRectangle **rects,
gint *n_rects)
{
XRectangle *rectangles;
cairo_rectangle_int_t box;
......
......@@ -83,11 +83,11 @@ void _gdk_xid_table_remove (GdkDisplay *display,
gpointer _gdk_xid_table_lookup (GdkDisplay *display,
XID xid);
gint _gdk_send_xevent (GdkDisplay *display,
Window window,
gboolean propagate,
glong event_mask,
XEvent *event_send);
gint _gdk_send_xevent (GdkDisplay *display,
Window window,
gboolean propagate,
glong event_mask,
XEvent *event_send);
/* Routines from gdkgeometry-x11.c */
void _gdk_window_move_resize_child (GdkWindow *window,
......@@ -110,14 +110,14 @@ void _gdk_selection_window_destroyed (GdkWindow *window);
gboolean _gdk_selection_filter_clear_event (XSelectionClearEvent *event);
cairo_region_t* _gdk_x11_xwindow_get_shape (Display *xdisplay,
Window window,
gint shape_type);
Window window,
gint shape_type);
void _gdk_region_get_xrectangles (const cairo_region_t *region,
gint x_offset,
gint y_offset,
XRectangle **rects,
gint *n_rects);
void _gdk_x11_region_get_xrectangles (const cairo_region_t *region,
gint x_offset,
gint y_offset,
XRectangle **rects,
gint *n_rects);
gboolean _gdk_moveresize_handle_event (XEvent *event);
gboolean _gdk_moveresize_configure_done (GdkDisplay *display,
......@@ -209,9 +209,9 @@ cairo_surface_t * _gdk_x11_window_create_bitmap_surface (GdkWindow *window,
int height);
extern gboolean _gdk_use_xshm;
extern const int _gdk_nenvent_masks;
extern const int _gdk_event_mask_table[];
extern GdkAtom _gdk_selection_property;
extern const gint _gdk_x11_event_mask_table[];
extern const gint _gdk_x11_event_mask_table_size;
extern GdkAtom _gdk_selection_property;
extern gboolean _gdk_synchronize;
#define GDK_SCREEN_DISPLAY(screen) (GDK_SCREEN_X11 (screen)->display)
......
......@@ -72,7 +72,7 @@
#include <X11/extensions/Xdamage.h>
#endif
const int _gdk_event_mask_table[21] =
const int _gdk_x11_event_mask_table[21] =
{
ExposureMask,
PointerMotionMask,
......@@ -91,12 +91,13 @@ const int _gdk_event_mask_table[21] =
StructureNotifyMask,
PropertyChangeMask,
VisibilityChangeMask,
0, /* PROXIMITY_IN */
0, /* PROXIMTY_OUT */
0, /* PROXIMITY_IN */
0, /* PROXIMTY_OUT */
SubstructureNotifyMask,
ButtonPressMask /* SCROLL; on X mouse wheel events is treated as mouse button 4/5 */
};
const int _gdk_nenvent_masks = sizeof (_gdk_event_mask_table) / sizeof (int);
const gint _gdk_x11_event_mask_table_size = G_N_ELEMENTS (_gdk_x11_event_mask_table);
/* Forward declarations */
static void gdk_window_set_static_win_gravity (GdkWindow *window,
......@@ -838,9 +839,9 @@ x_event_mask_to_gdk_event_mask (long mask)
GdkEventMask event_mask = 0;
int i;
for (i = 0; i < _gdk_nenvent_masks; i++)
for (i = 0; i < _gdk_x11_event_mask_table_size; i++)
{
if (mask & _gdk_event_mask_table[i])
if (mask & _gdk_x11_event_mask_table[i])
event_mask |= 1 << (i + 1);
}
......@@ -2883,9 +2884,9 @@ do_shape_combine_region (GdkWindow *window,
gint n_rects = 0;
XRectangle *xrects = NULL;
_gdk_region_get_xrectangles (shape_region,
0, 0,
&xrects, &n_rects);
_gdk_x11_region_get_xrectangles (shape_region,
0, 0,
&xrects, &n_rects);
if (shape == ShapeBounding)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment