[gtk+] Rename _gdk_event_mask_table to _gdk_x11_event_mask_table
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Rename _gdk_event_mask_table to _gdk_x11_event_mask_table
- Date: Tue, 21 Dec 2010 17:13:07 +0000 (UTC)
commit 28b7c6f05dc1b7469745a13d1e5f5c9ba43b8392
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 15 17:32:29 2010 -0500
Rename _gdk_event_mask_table to _gdk_x11_event_mask_table
gdk/gdk.c | 109 +++++++++++++++++++++-----------------------
gdk/x11/gdkdevice-core.c | 9 ++--
gdk/x11/gdkeventsource.c | 4 +-
gdk/x11/gdkgeometry-x11.c | 8 ++--
gdk/x11/gdkmain-x11.c | 10 ++--
gdk/x11/gdkprivate-x11.h | 30 ++++++------
gdk/x11/gdkwindow-x11.c | 19 ++++----
7 files changed, 93 insertions(+), 96 deletions(-)
---
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 7af9134..c0b5d0a 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -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);
diff --git a/gdk/x11/gdkdevice-core.c b/gdk/x11/gdkdevice-core.c
index 7e4613b..e4b35dd 100644
--- a/gdk/x11/gdkdevice-core.c
+++ b/gdk/x11/gdkdevice-core.c
@@ -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))
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index bd05031..e501fd2 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -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);
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index 8ad8c24..1f853f4 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -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],
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 1bf9db8..361a434 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -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;
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index d45f385..b4dc1d1 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -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)
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 7fcc44a..3250cbc 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]