Explode gdkinternals.h into per-class private headers

At the same time, move some more class and instance structs
out of public headers.
This commit is contained in:
Matthias Clasen 2010-12-11 00:14:53 -05:00
parent ff8a334725
commit ea96e5e16f
41 changed files with 831 additions and 628 deletions

View File

@ -96,9 +96,18 @@ gdk_built_public_sources = \
gdkenumtypes.h
gdk_private_headers = \
gdkinternals.h \
gdkapplaunchcontextprivate.h \
gdkdevicemanagerprivate.h \
gdkdeviceprivate.h \
gdkintl.h
gdkdisplaymanagerprivate.h \
gdkdisplayprivate.h \
gdkdndprivate.h \
gdkscreenprivate.h \
gdkinternals.h \
gdkintl.h \
gdkkeysprivate.h \
gdkvisualprivate.h \
gdkpoly-generic.h
gdk_c_sources = \
gdk.c \

View File

@ -22,9 +22,7 @@
#include "config.h"
#include "gdkapplaunchcontext.h"
#include "gdkinternals.h"
#include "gdkapplaunchcontextprivate.h"
#include "gdkscreen.h"
#include "gdkintl.h"
@ -81,39 +79,29 @@ gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
context_class->get_display = gdk_app_launch_context_get_display;
context_class->get_startup_notify_id = gdk_app_launch_context_get_startup_notify_id;
context_class->launch_failed = gdk_app_launch_context_launch_failed;
g_type_class_add_private (klass, sizeof (GdkAppLaunchContextPrivate));
}
static void
gdk_app_launch_context_init (GdkAppLaunchContext *context)
{
context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context,
GDK_TYPE_APP_LAUNCH_CONTEXT,
GdkAppLaunchContextPrivate);
context->priv->workspace = -1;
context->workspace = -1;
}
static void
gdk_app_launch_context_finalize (GObject *object)
{
GdkAppLaunchContext *context;
GdkAppLaunchContextPrivate *priv;
GdkAppLaunchContext *context = GDK_APP_LAUNCH_CONTEXT (object);
context = GDK_APP_LAUNCH_CONTEXT (object);
if (context->display)
g_object_unref (context->display);
priv = context->priv;
if (context->screen)
g_object_unref (context->screen);
if (priv->display)
g_object_unref (priv->display);
if (context->icon)
g_object_unref (context->icon);
if (priv->screen)
g_object_unref (priv->screen);
if (priv->icon)
g_object_unref (priv->icon);
g_free (priv->icon_name);
g_free (context->icon_name);
G_OBJECT_CLASS (gdk_app_launch_context_parent_class)->finalize (object);
}
@ -123,16 +111,14 @@ gdk_app_launch_context_get_display (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
{
GdkAppLaunchContext *ctx = GDK_APP_LAUNCH_CONTEXT (context);
GdkDisplay *display;
GdkAppLaunchContextPrivate *priv;
priv = GDK_APP_LAUNCH_CONTEXT (context)->priv;
if (ctx->screen)
return gdk_screen_make_display_name (ctx->screen);
if (priv->screen)
return gdk_screen_make_display_name (priv->screen);
if (priv->display)
display = priv->display;
if (ctx->display)
display = ctx->display;
else
display = gdk_display_get_default ();
@ -158,7 +144,7 @@ gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_return_if_fail (display == NULL || GDK_IS_DISPLAY (display));
g_warn_if_fail (display == NULL || display == context->priv->display);
g_warn_if_fail (display == NULL || display == context->display);
}
/**
@ -182,16 +168,16 @@ gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_return_if_fail (screen == NULL || GDK_IS_SCREEN (screen));
g_return_if_fail (screen == NULL || gdk_screen_get_display (screen) == context->priv->display);
g_return_if_fail (screen == NULL || gdk_screen_get_display (screen) == context->display);
if (context->priv->screen)
if (context->screen)
{
g_object_unref (context->priv->screen);
context->priv->screen = NULL;
g_object_unref (context->screen);
context->screen = NULL;
}
if (screen)
context->priv->screen = g_object_ref (screen);
context->screen = g_object_ref (screen);
}
/**
@ -217,7 +203,7 @@ gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
context->priv->workspace = desktop;
context->workspace = desktop;
}
/**
@ -241,7 +227,7 @@ gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context,
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
context->priv->timestamp = timestamp;
context->timestamp = timestamp;
}
/**
@ -266,14 +252,14 @@ gdk_app_launch_context_set_icon (GdkAppLaunchContext *context,
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_return_if_fail (icon == NULL || G_IS_ICON (icon));
if (context->priv->icon)
if (context->icon)
{
g_object_unref (context->priv->icon);
context->priv->icon = NULL;
g_object_unref (context->icon);
context->icon = NULL;
}
if (icon)
context->priv->icon = g_object_ref (icon);
context->icon = g_object_ref (icon);
}
/**
@ -298,8 +284,8 @@ gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_free (context->priv->icon_name);
context->priv->icon_name = g_strdup (icon_name);
g_free (context->icon_name);
context->icon_name = g_strdup (icon_name);
}
/**

View File

@ -40,20 +40,7 @@ G_BEGIN_DECLS
#define GDK_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDK_TYPE_APP_LAUNCH_CONTEXT))
#define GDK_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_APP_LAUNCH_CONTEXT, GdkAppLaunchContextClass))
typedef struct GdkAppLaunchContextClass GdkAppLaunchContextClass;
typedef struct GdkAppLaunchContextPrivate GdkAppLaunchContextPrivate;
struct GdkAppLaunchContext
{
GAppLaunchContext parent_instance;
GdkAppLaunchContextPrivate *priv;
};
struct GdkAppLaunchContextClass
{
GAppLaunchContextClass parent_class;
};
typedef GAppLaunchContextClass GdkAppLaunchContextClass;
GType gdk_app_launch_context_get_type (void);

View File

@ -0,0 +1,43 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_APP_LAUNCH_CONTEXT_PRIVATE_H__
#define __GDK_APP_LAUNCH_CONTEXT_PRIVATE_H__
#include <gio/gio.h>
#include "gdkapplaunchcontext.h"
#include "gdktypes.h"
G_BEGIN_DECLS
struct _GdkAppLaunchContext
{
GAppLaunchContext parent_instance;
GdkDisplay *display;
GdkScreen *screen;
gint workspace;
guint32 timestamp;
GIcon *icon;
char *icon_name;
};
G_END_DECLS
#endif

View File

@ -19,10 +19,9 @@
#include "config.h"
#include "gdkdevice.h"
#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkinternals.h"
#include "gdkintl.h"
typedef struct _GdkAxisInfo GdkAxisInfo;

View File

@ -19,10 +19,9 @@
#include "config.h"
#include "gdkdevicemanager.h"
#include "gdkdevicemanagerprivate.h"
#include "gdkdisplay.h"
#include "gdkintl.h"
#include "gdkinternals.h"
/**

View File

@ -0,0 +1,54 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_DEVICE_MANAGER_PRIVATE_H__
#define __GDK_DEVICE_MANAGER_PRIVATE_H__
#include "gdkdevicemanager.h"
G_BEGIN_DECLS
struct _GdkDeviceManager
{
GObject parent_instance;
GdkDisplay *display;
};
struct _GdkDeviceManagerClass
{
GObjectClass parent_class;
/* Signals */
void (* device_added) (GdkDeviceManager *device_manager,
GdkDevice *device);
void (* device_removed) (GdkDeviceManager *device_manager,
GdkDevice *device);
void (* device_changed) (GdkDeviceManager *device_manager,
GdkDevice *device);
/* VMethods */
GList * (* list_devices) (GdkDeviceManager *device_manager,
GdkDeviceType type);
GdkDevice * (* get_client_pointer) (GdkDeviceManager *device_manager);
};
G_END_DECLS
#endif

View File

@ -20,8 +20,8 @@
#ifndef __GDK_DEVICE_PRIVATE_H__
#define __GDK_DEVICE_PRIVATE_H__
#include "gdkdevicemanager.h"
#include "gdkdevice.h"
#include "gdkdevicemanager.h"
#include "gdkevents.h"
G_BEGIN_DECLS

View File

@ -24,6 +24,7 @@
#include "config.h"
#include "gdkdisplay.h"
#include "gdkdisplayprivate.h"
#include "gdkevents.h"
#include "gdkwindowimpl.h"

View File

@ -34,10 +34,6 @@
G_BEGIN_DECLS
typedef struct _GdkDisplayClass GdkDisplayClass;
typedef struct _GdkDisplayPointerHooks GdkDisplayPointerHooks;
typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks;
#define GDK_TYPE_DISPLAY (gdk_display_get_type ())
#define GDK_DISPLAY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY, GdkDisplay))
#define GDK_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY, GdkDisplayClass))
@ -45,76 +41,8 @@ typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks;
#define GDK_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY))
#define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
/* Tracks information about the keyboard grab on this display */
typedef struct
{
GdkWindow *window;
GdkWindow *native_window;
gulong serial;
gboolean owner_events;
guint32 time;
} GdkKeyboardGrabInfo;
/* Tracks information about which window and position the pointer last was in.
* This is useful when we need to synthesize events later.
* Note that we track toplevel_under_pointer using enter/leave events,
* so in the case of a grab, either with owner_events==FALSE or with the
* pointer in no clients window the x/y coordinates may actually be outside
* the window.
*/
typedef struct
{
GdkWindow *toplevel_under_pointer; /* The toplevel window with mouse inside, tracked via native events */
GdkWindow *window_under_pointer; /* The window that last got sent a normal enter event */
gdouble toplevel_x, toplevel_y;
guint32 state;
guint32 button;
} GdkPointerWindowInfo;
typedef struct
{
guint32 button_click_time[2]; /* The last 2 button click times. */
GdkWindow *button_window[2]; /* The last 2 windows to receive button presses. */
gint button_number[2]; /* The last 2 buttons to be pressed. */
gint button_x[2]; /* The last 2 button click positions. */
gint button_y[2];
} GdkMultipleClickInfo;
struct _GdkDisplay
{
GObject parent_instance;
/*< private >*/
GList *GSEAL (queued_events);
GList *GSEAL (queued_tail);
/* Information for determining if the latest button click
* is part of a double-click or triple-click
*/
GHashTable *GSEAL (multiple_click_info);
guint GSEAL (double_click_time); /* Maximum time between clicks in msecs */
GdkDevice *GSEAL (core_pointer); /* Core pointer device */
const GdkDisplayDeviceHooks *GSEAL (device_hooks); /* Current hooks for querying pointer */
guint GSEAL (closed) : 1; /* Whether this display has been closed */
guint GSEAL (ignore_core_events) : 1; /* Don't send core motion and button event */
guint GSEAL (double_click_distance); /* Maximum distance between clicks in pixels */
GHashTable *GSEAL (device_grabs);
GHashTable *GSEAL (motion_hint_info);
/* Hashtable containing a GdkPointerWindowInfo for each device */
GHashTable *GSEAL (pointers_info);
/* Last reported event time from server */
guint32 GSEAL (last_event_time);
/* Device manager associated to the display */
GdkDeviceManager *GSEAL (device_manager);
};
typedef struct _GdkDisplayPointerHooks GdkDisplayPointerHooks;
typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks;
/**
* GdkDisplayPointerHooks:

View File

@ -27,10 +27,7 @@
#include "config.h"
#include "gdkconfig.h"
#include "gdkdisplaymanager.h"
#include "gdkscreen.h"
#include "gdkdisplay.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkinternals.h"
#include "gdkmarshalers.h"
#include "gdkintl.h"

View File

@ -0,0 +1,50 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010, Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_DISPLAY_MANAGER_PRIVATE_H__
#define __GDK_DISPLAY_MANAGER_PRIVATE_H__
#include "gdkdisplaymanager.h"
G_BEGIN_DECLS
struct _GdkDisplayManager
{
GObject parent_instance;
};
struct _GdkDisplayManagerClass
{
GObjectClass parent_class;
GSList * (*list_displays) (GdkDisplayManager *manager);
GdkDisplay * (*get_default_display) (GdkDisplayManager *manager);
void (*set_default_display) (GdkDisplayManager *manager,
GdkDisplay *display);
GdkDisplay * (*open_display) (GdkDisplayManager *manager,
const gchar *name);
/* signals */
void (*display_opened) (GdkDisplayManager *manager,
GdkDisplay *display);
};
G_END_DECLS
#endif

202
gdk/gdkdisplayprivate.h Normal file
View File

@ -0,0 +1,202 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_DISPLAY_PRIVATE_H__
#define __GDK_DISPLAY_PRIVATE_H__
#include "gdkdisplay.h"
G_BEGIN_DECLS
typedef struct _GdkDisplayClass GdkDisplayClass;
/* Tracks information about the keyboard grab on this display */
typedef struct
{
GdkWindow *window;
GdkWindow *native_window;
gulong serial;
gboolean owner_events;
guint32 time;
} GdkKeyboardGrabInfo;
/* Tracks information about the pointer grab on this display */
typedef struct
{
GdkWindow *window;
GdkWindow *native_window;
gulong serial_start;
gulong serial_end; /* exclusive, i.e. not active on serial_end */
gboolean owner_events;
guint event_mask;
gboolean implicit;
guint32 time;
GdkGrabOwnership ownership;
guint activated : 1;
guint implicit_ungrab : 1;
} GdkDeviceGrabInfo;
/* Tracks information about which window and position the pointer last was in.
* This is useful when we need to synthesize events later.
* Note that we track toplevel_under_pointer using enter/leave events,
* so in the case of a grab, either with owner_events==FALSE or with the
* pointer in no clients window the x/y coordinates may actually be outside
* the window.
*/
typedef struct
{
GdkWindow *toplevel_under_pointer; /* toplevel window containing the pointer, */
/* tracked via native events */
GdkWindow *window_under_pointer; /* window that last got a normal enter event */
gdouble toplevel_x, toplevel_y;
guint32 state;
guint32 button;
} GdkPointerWindowInfo;
typedef struct
{
guint32 button_click_time[2]; /* last 2 button click times */
GdkWindow *button_window[2]; /* last 2 windows to receive button presses */
gint button_number[2]; /* last 2 buttons to be pressed */
gint button_x[2]; /* last 2 button click positions */
gint button_y[2];
} GdkMultipleClickInfo;
struct _GdkDisplay
{
GObject parent_instance;
GList *queued_events;
GList *queued_tail;
/* Information for determining if the latest button click
* is part of a double-click or triple-click
*/
GHashTable *multiple_click_info;
guint double_click_time; /* Maximum time between clicks in msecs */
GdkDevice *core_pointer; /* Core pointer device */
const GdkDisplayDeviceHooks *device_hooks; /* Hooks for querying pointer */
guint closed : 1; /* Whether this display has been closed */
guint ignore_core_events : 1; /* Don't send core motion and button event */
guint double_click_distance; /* Maximum distance between clicks in pixels */
GHashTable *device_grabs;
GHashTable *motion_hint_info;
GHashTable *pointers_info; /* GdkPointerWindowInfo for each device */
guint32 last_event_time; /* Last reported event time from server */
GdkDeviceManager *device_manager;
};
struct _GdkDisplayClass
{
GObjectClass parent_class;
G_CONST_RETURN gchar * (*get_name) (GdkDisplay *display);
gint (*get_n_screens) (GdkDisplay *display);
GdkScreen * (*get_screen) (GdkDisplay *display,
gint screen_num);
GdkScreen * (*get_default_screen) (GdkDisplay *display);
void (*beep) (GdkDisplay *display);
void (*sync) (GdkDisplay *display);
void (*flush) (GdkDisplay *display);
gboolean (*has_pending) (GdkDisplay *display);
void (*queue_events) (GdkDisplay *display);
GdkWindow * (*get_default_group) (GdkDisplay *display);
gboolean (*supports_selection_notification) (GdkDisplay *display);
gboolean (*request_selection_notification) (GdkDisplay *display,
GdkAtom selection);
gboolean (*supports_clipboard_persistence) (GdkDisplay *display);
void (*store_clipboard) (GdkDisplay *display,
GdkWindow *clipboard_window,
guint32 time_,
const GdkAtom *targets,
gint n_targets);
gboolean (*supports_shapes) (GdkDisplay *display);
gboolean (*supports_input_shapes) (GdkDisplay *display);
gboolean (*supports_composite) (GdkDisplay *display);
GList * (*list_devices) (GdkDisplay *display);
gboolean (*send_client_message) (GdkDisplay *display,
GdkEvent *event,
GdkNativeWindow winid);
void (*add_client_message_filter) (GdkDisplay *display,
GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
GdkNativeWindow (*get_drag_protocol) (GdkDisplay *display,
GdkNativeWindow winid,
GdkDragProtocol *protocol,
guint *version);
/* Signals */
void (*closed) (GdkDisplay *display,
gboolean is_error);
};
typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
GdkDevice *device,
GdkPointerWindowInfo *device_info,
gpointer user_data);
void _gdk_display_device_grab_update (GdkDisplay *display,
GdkDevice *device,
GdkDevice *source_device,
gulong current_serial);
GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDevice *device);
GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
GdkWindow *native_window,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
gulong serial_start,
guint32 time,
gboolean implicit);
GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display,
GdkDevice *device,
gulong serial);
gboolean _gdk_display_end_device_grab (GdkDisplay *display,
GdkDevice *device,
gulong serial,
GdkWindow *if_child,
gboolean implicit);
gboolean _gdk_display_check_grab_ownership (GdkDisplay *display,
GdkDevice *device,
gulong serial);
void _gdk_display_enable_motion_hints (GdkDisplay *display,
GdkDevice *device);
GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device);
void _gdk_display_pointer_info_foreach (GdkDisplay *display,
GdkDisplayPointerInfoForeach func,
gpointer user_data);
G_END_DECLS
#endif /* __GDK_DISPLAY_PRIVATE_H__ */

View File

@ -26,8 +26,7 @@
#include "config.h"
#include "gdkdnd.h"
#include "gdkinternals.h"
#include "gdkdndprivate.h"
#include "gdkdisplay.h"
#include "gdkwindow.h"

82
gdk/gdkdndprivate.h Normal file
View File

@ -0,0 +1,82 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010, Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_DND_PRIVATE_H__
#define __GDK_DND_PRIVATE_H__
#include "gdkdnd.h"
G_BEGIN_DECLS
struct _GdkDragContextClass {
GObjectClass parent_class;
GdkWindow * (*find_window) (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
gint x_root,
gint y_root,
GdkDragProtocol *protocol);
GdkAtom (*get_selection) (GdkDragContext *context);
gboolean (*drag_motion) (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
gint root_x,
gint root_y,
GdkDragAction suggested_action,
GdkDragAction possible_actions,
guint32 time_);
void (*drag_status) (GdkDragContext *context,
GdkDragAction action,
guint32 time_);
void (*drag_abort) (GdkDragContext *context,
guint32 time_);
void (*drag_drop) (GdkDragContext *context,
guint32 time_);
void (*drop_reply) (GdkDragContext *context,
gboolean accept,
guint32 time_);
void (*drop_finish) (GdkDragContext *context,
gboolean success,
guint32 time_);
gboolean (*drop_status) (GdkDragContext *context);
};
struct _GdkDragContext {
GObject parent_instance;
GdkDragProtocol protocol;
gboolean is_source;
GdkWindow *source_window;
GdkWindow *dest_window;
GList *targets;
GdkDragAction actions;
GdkDragAction suggested_action;
GdkDragAction action;
guint32 start_time;
GdkDevice *device;
};
G_END_DECLS
#endif

View File

@ -27,6 +27,7 @@
#include "config.h"
#include "gdkinternals.h"
#include "gdkdisplayprivate.h"
#include <string.h>
#include <math.h>

View File

@ -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
@ -30,8 +30,9 @@
#define __GDK_INTERNALS_H__
#include <gio/gio.h>
#include <gdk/gdkwindowimpl.h>
#include <gdk/gdkprivate.h>
#include "gdkwindowimpl.h"
#include "gdkdisplay.h"
#include "gdkprivate.h"
G_BEGIN_DECLS
@ -42,8 +43,8 @@ G_BEGIN_DECLS
/* Debugging support */
typedef struct _GdkColorInfo GdkColorInfo;
typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkClientFilter GdkClientFilter;
typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkClientFilter GdkClientFilter;
typedef enum {
GDK_COLOR_WRITEABLE = 1 << 0
@ -78,26 +79,26 @@ typedef enum {
GDK_DEBUG_DND = 1 << 2,
GDK_DEBUG_XIM = 1 << 3,
GDK_DEBUG_NOGRABS = 1 << 4,
GDK_DEBUG_COLORMAP = 1 << 5,
GDK_DEBUG_INPUT = 1 << 6,
GDK_DEBUG_CURSOR = 1 << 7,
GDK_DEBUG_MULTIHEAD = 1 << 8,
GDK_DEBUG_XINERAMA = 1 << 9,
GDK_DEBUG_DRAW = 1 <<10,
GDK_DEBUG_COLORMAP = 1 << 5,
GDK_DEBUG_INPUT = 1 << 6,
GDK_DEBUG_CURSOR = 1 << 7,
GDK_DEBUG_MULTIHEAD = 1 << 8,
GDK_DEBUG_XINERAMA = 1 << 9,
GDK_DEBUG_DRAW = 1 <<10,
GDK_DEBUG_EVENTLOOP = 1 <<11
} GdkDebugFlag;
extern GList *_gdk_default_filters;
extern GdkWindow *_gdk_parent_root;
extern GdkWindow *_gdk_parent_root;
extern guint _gdk_debug_flags;
extern gboolean _gdk_native_windows;
#ifdef G_ENABLE_DEBUG
#define GDK_NOTE(type,action) G_STMT_START { \
if (_gdk_debug_flags & GDK_DEBUG_##type) \
{ action; }; } G_STMT_END
#define GDK_NOTE(type,action) G_STMT_START { \
if (_gdk_debug_flags & GDK_DEBUG_##type) \
{ action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
@ -157,30 +158,8 @@ struct _GdkEventPrivate
GdkDevice *source_device;
};
/* Tracks information about the pointer grab on this display */
typedef struct
{
GdkWindow *window;
GdkWindow *native_window;
gulong serial_start;
gulong serial_end; /* exclusive, i.e. not active on serial_end */
gboolean owner_events;
guint event_mask;
gboolean implicit;
guint32 time;
GdkGrabOwnership ownership;
guint activated : 1;
guint implicit_ungrab : 1;
} GdkDeviceGrabInfo;
typedef struct _GdkWindowPaint GdkWindowPaint;
typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
GdkDevice *device,
GdkPointerWindowInfo *device_info,
gpointer user_data);
struct _GdkWindow
{
GObject parent_instance;
@ -269,290 +248,6 @@ struct _GdkWindow
#define GDK_WINDOW_TYPE(d) (((GDK_WINDOW (d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (GDK_WINDOW (d)->destroyed)
struct _GdkDisplayManager
{
GObject parent_instance;
};
struct _GdkDisplayManagerClass
{
GObjectClass parent_class;
GSList * (*list_displays) (GdkDisplayManager *manager);
GdkDisplay * (*get_default_display) (GdkDisplayManager *manager);
void (*set_default_display) (GdkDisplayManager *manager,
GdkDisplay *display);
GdkDisplay * (*open_display) (GdkDisplayManager *manager,
const gchar *name);
/* signals */
void (*display_opened) (GdkDisplayManager *manager,
GdkDisplay *display);
};
struct _GdkDisplayClass
{
GObjectClass parent_class;
G_CONST_RETURN gchar * (*get_name) (GdkDisplay *display);
gint (*get_n_screens) (GdkDisplay *display);
GdkScreen * (*get_screen) (GdkDisplay *display,
gint screen_num);
GdkScreen * (*get_default_screen) (GdkDisplay *display);
void (*beep) (GdkDisplay *display);
void (*sync) (GdkDisplay *display);
void (*flush) (GdkDisplay *display);
gboolean (*has_pending) (GdkDisplay *display);
void (*queue_events) (GdkDisplay *display);
GdkWindow * (*get_default_group) (GdkDisplay *display);
gboolean (*supports_selection_notification) (GdkDisplay *display);
gboolean (*request_selection_notification) (GdkDisplay *display,
GdkAtom selection);
gboolean (*supports_clipboard_persistence) (GdkDisplay *display);
void (*store_clipboard) (GdkDisplay *display,
GdkWindow *clipboard_window,
guint32 time_,
const GdkAtom *targets,
gint n_targets);
gboolean (*supports_shapes) (GdkDisplay *display);
gboolean (*supports_input_shapes) (GdkDisplay *display);
gboolean (*supports_composite) (GdkDisplay *display);
GList * (*list_devices) (GdkDisplay *display);
gboolean (*send_client_message) (GdkDisplay *display,
GdkEvent *event,
GdkNativeWindow winid);
void (*add_client_message_filter) (GdkDisplay *display,
GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
GdkNativeWindow (*get_drag_protocol) (GdkDisplay *display,
GdkNativeWindow winid,
GdkDragProtocol *protocol,
guint *version);
/* Signals */
void (*closed) (GdkDisplay *display,
gboolean is_error);
};
struct _GdkKeymapClass
{
GObjectClass parent_class;
PangoDirection (* get_direction) (GdkKeymap *keymap);
gboolean (* have_bidi_layouts) (GdkKeymap *keymap);
gboolean (* get_caps_lock_state) (GdkKeymap *keymap);
gboolean (* get_num_lock_state) (GdkKeymap *keymap);
gboolean (* get_entries_for_keyval) (GdkKeymap *keymap,
guint keyval,
GdkKeymapKey **keys,
gint *n_keys);
gboolean (* get_entries_for_keycode) (GdkKeymap *keymap,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries);
guint (* lookup_key) (GdkKeymap *keymap,
const GdkKeymapKey *key);
gboolean (* translate_keyboard_state) (GdkKeymap *keymap,
guint hardware_keycode,
GdkModifierType state,
gint group,
guint *keyval,
gint *effective_group,
gint *level,
GdkModifierType *consumed_modifiers);
void (* add_virtual_modifiers) (GdkKeymap *keymap,
GdkModifierType *state);
gboolean (* map_virtual_modifiers) (GdkKeymap *keymap,
GdkModifierType *state);
/* Signals */
void (*direction_changed) (GdkKeymap *keymap);
void (*keys_changed) (GdkKeymap *keymap);
void (*state_changed) (GdkKeymap *keymap);
};
struct _GdkScreen
{
GObject parent_instance;
guint closed : 1;
cairo_font_options_t *font_options;
double resolution; /* pixels/points scale factor for fonts */
};
struct _GdkScreenClass
{
GObjectClass parent_class;
GdkDisplay * (* get_display) (GdkScreen *screen);
gint (* get_width) (GdkScreen *screen);
gint (* get_height) (GdkScreen *screen);
gint (* get_width_mm) (GdkScreen *screen);
gint (* get_height_mm) (GdkScreen *screen);
gint (* get_number) (GdkScreen *screen);
GdkWindow * (* get_root_window) (GdkScreen *screen);
gint (* get_n_monitors) (GdkScreen *screen);
gint (* get_primary_monitor) (GdkScreen *screen);
gint (* get_monitor_width_mm) (GdkScreen *screen,
gint monitor_num);
gint (* get_monitor_height_mm) (GdkScreen *screen,
gint monitor_num);
gchar * (* get_monitor_plug_name) (GdkScreen *screen,
gint monitor_num);
void (* get_monitor_geometry) (GdkScreen *screen,
gint monitor_num,
GdkRectangle *dest);
GList * (* list_visuals) (GdkScreen *screen);
GdkVisual * (* get_system_visual) (GdkScreen *screen);
GdkVisual * (* get_rgba_visual) (GdkScreen *screen);
gboolean (* is_composited) (GdkScreen *screen);
gchar * (* make_display_name) (GdkScreen *screen);
GdkWindow * (* get_active_window) (GdkScreen *screen);
GList * (* get_window_stack) (GdkScreen *screen);
void (* broadcast_client_message) (GdkScreen *screen,
GdkEvent *event);
gboolean (* get_setting) (GdkScreen *screen,
const gchar *name,
GValue *value);
gint (* visual_get_best_depth) (GdkScreen *screen);
GdkVisualType (* visual_get_best_type) (GdkScreen *screen);
GdkVisual * (* visual_get_best) (GdkScreen *screen);
GdkVisual * (* visual_get_best_with_depth) (GdkScreen *screen,
gint depth);
GdkVisual * (* visual_get_best_with_type) (GdkScreen *screen,
GdkVisualType visual_type);
GdkVisual * (* visual_get_best_with_both) (GdkScreen *screen,
gint depth,
GdkVisualType visual_type);
void (* query_depths) (GdkScreen *screen,
gint **depths,
gint *count);
void (* query_visual_types) (GdkScreen *screen,
GdkVisualType **visual_types,
gint *count);
/* Signals: */
void (*size_changed) (GdkScreen *screen);
void (*composited_changed) (GdkScreen *screen);
void (*monitors_changed) (GdkScreen *screen);
};
struct _GdkDragContextClass {
GObjectClass parent_class;
GdkWindow * (*find_window) (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
gint x_root,
gint y_root,
GdkDragProtocol *protocol);
GdkAtom (*get_selection) (GdkDragContext *context);
gboolean (*drag_motion) (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
gint root_x,
gint root_y,
GdkDragAction suggested_action,
GdkDragAction possible_actions,
guint32 time_);
void (*drag_status) (GdkDragContext *context,
GdkDragAction action,
guint32 time_);
void (*drag_abort) (GdkDragContext *context,
guint32 time_);
void (*drag_drop) (GdkDragContext *context,
guint32 time_);
void (*drop_reply) (GdkDragContext *context,
gboolean accept,
guint32 time_);
void (*drop_finish) (GdkDragContext *context,
gboolean success,
guint32 time_);
gboolean (*drop_status) (GdkDragContext *context);
};
struct _GdkDragContext {
GObject parent_instance;
GdkDragProtocol protocol;
gboolean is_source;
GdkWindow *source_window;
GdkWindow *dest_window;
GList *targets;
GdkDragAction actions;
GdkDragAction suggested_action;
GdkDragAction action;
guint32 start_time;
GdkDevice *device;
};
struct _GdkVisual
{
GObject parent_instance;
GdkVisualType type;
gint depth;
GdkByteOrder byte_order;
gint colormap_size;
gint bits_per_rgb;
guint32 red_mask;
gint red_shift;
gint red_prec;
guint32 green_mask;
gint green_shift;
gint green_prec;
guint32 blue_mask;
gint blue_shift;
gint blue_prec;
GdkScreen *screen;
};
struct _GdkVisualClass
{
GObjectClass parent_class;
};
struct _GdkDeviceManager
{
GObject parent_instance;
GdkDisplay *display;
};
struct _GdkDeviceManagerClass
{
GObjectClass parent_class;
/* Signals */
void (* device_added) (GdkDeviceManager *device_manager,
GdkDevice *device);
void (* device_removed) (GdkDeviceManager *device_manager,
GdkDevice *device);
void (* device_changed) (GdkDeviceManager *device_manager,
GdkDevice *device);
/* VMethods */
GList * (* list_devices) (GdkDeviceManager *device_manager,
GdkDeviceType type);
GdkDevice * (* get_client_pointer) (GdkDeviceManager *device_manager);
};
extern gchar *_gdk_display_name;
extern gint _gdk_screen_number;
extern gchar *_gdk_display_arg_name;
@ -566,11 +261,11 @@ void _gdk_event_filter_unref (GdkWindow *window,
void _gdk_event_emit (GdkEvent *event);
GList* _gdk_event_queue_find_first (GdkDisplay *display);
void _gdk_event_queue_remove_link (GdkDisplay *display,
GList *node);
GList *node);
GList* _gdk_event_queue_prepend (GdkDisplay *display,
GdkEvent *event);
GdkEvent *event);
GList* _gdk_event_queue_append (GdkDisplay *display,
GdkEvent *event);
GdkEvent *event);
GList* _gdk_event_queue_insert_after (GdkDisplay *display,
GdkEvent *after_event,
GdkEvent *event);
@ -578,7 +273,7 @@ GList* _gdk_event_queue_insert_before(GdkDisplay *display,
GdkEvent *after_event,
GdkEvent *event);
void _gdk_event_button_generate (GdkDisplay *display,
GdkEvent *event);
GdkEvent *event);
void _gdk_windowing_event_data_copy (const GdkEvent *src,
GdkEvent *dst);
@ -601,9 +296,9 @@ cairo_surface_t *
_gdk_window_ref_cairo_surface (GdkWindow *window);
void _gdk_window_impl_new (GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask);
void _gdk_window_destroy (GdkWindow *window,
@ -629,20 +324,20 @@ void _gdk_cursor_destroy (GdkCursor *cursor);
extern const GOptionEntry _gdk_windowing_args[];
gchar *_gdk_windowing_substitute_screen_number (const gchar *display_name,
gint screen_number);
gint screen_number);
gulong _gdk_windowing_window_get_next_serial (GdkDisplay *display);
void _gdk_windowing_window_get_offsets (GdkWindow *window,
gint *x_offset,
gint *y_offset);
gint *x_offset,
gint *y_offset);
void _gdk_windowing_get_device_state (GdkDisplay *display,
GdkDevice *device,
GdkScreen **screen,
gint *x,
gint *y,
GdkModifierType *mask);
GdkScreen **screen,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow* _gdk_windowing_window_at_device_position (GdkDisplay *display,
GdkDevice *device,
gint *win_x,
@ -650,9 +345,9 @@ GdkWindow* _gdk_windowing_window_at_device_position (GdkDisplay *display,
GdkModifierType *mask,
gboolean get_toplevel);
void _gdk_windowing_got_event (GdkDisplay *display,
GList *event_link,
GdkEvent *event,
gulong serial);
GList *event_link,
GdkEvent *event,
gulong serial);
void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
cairo_region_t *expose_region);
@ -663,11 +358,11 @@ void _gdk_windowing_after_process_all_updates (void);
#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
void _gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
const gchar *sm_client_id);
const gchar *sm_client_id);
#define GDK_TYPE_PAINTABLE (_gdk_paintable_get_type ())
#define GDK_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_PAINTABLE, GdkPaintable))
#define GDK_IS_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PAINTABLE))
#define GDK_IS_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PAINTABLE))
#define GDK_PAINTABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_PAINTABLE, GdkPaintableIface))
typedef struct _GdkPaintable GdkPaintable;
@ -685,76 +380,29 @@ struct _GdkPaintableIface
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
struct GdkAppLaunchContextPrivate
{
GdkDisplay *display;
GdkScreen *screen;
gint workspace;
guint32 timestamp;
GIcon *icon;
char *icon_name;
};
void _gdk_display_device_grab_update (GdkDisplay *display,
GdkDevice *device,
GdkDevice *source_device,
gulong current_serial);
GdkDeviceGrabInfo *_gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDevice *device);
GdkDeviceGrabInfo *_gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
GdkWindow *native_window,
GdkGrabOwnership grab_ownership,
gboolean owner_events,
GdkEventMask event_mask,
unsigned long serial_start,
guint32 time,
gboolean implicit);
GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display,
GdkDevice *device,
gulong serial);
gboolean _gdk_display_end_device_grab (GdkDisplay *display,
GdkDevice *device,
gulong serial,
GdkWindow *if_child,
gboolean implicit);
gboolean _gdk_display_check_grab_ownership (GdkDisplay *display,
GdkDevice *device,
gulong serial);
void _gdk_display_enable_motion_hints (GdkDisplay *display,
GdkDevice *device);
GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device);
void _gdk_display_pointer_info_foreach (GdkDisplay *display,
GdkDisplayPointerInfoForeach func,
gpointer user_data);
void _gdk_window_invalidate_for_expose (GdkWindow *window,
cairo_region_t *region);
cairo_region_t *region);
GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
int x, int y);
int x, int y);
GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
double x, double y,
double *found_x,
double *found_y);
double x, double y,
double *found_x,
double *found_y);
void _gdk_window_add_damage (GdkWindow *toplevel,
cairo_region_t *damaged_region);
cairo_region_t *damaged_region);
GdkEvent * _gdk_make_event (GdkWindow *window,
GdkEventType type,
GdkEvent *event_in_queue,
gboolean before_event);
GdkEventType type,
GdkEvent *event_in_queue,
gboolean before_event);
gboolean _gdk_window_event_parent_of (GdkWindow *parent,
GdkWindow *child);
void _gdk_synthesize_crossing_events (GdkDisplay *display,
GdkWindow *src,
GdkWindow *dest,
GdkWindow *src,
GdkWindow *dest,
GdkDevice *device,
GdkDevice *source_device,
GdkCrossingMode mode,
@ -767,7 +415,7 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display,
gboolean non_linear);
void _gdk_display_set_window_under_pointer (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window);
GdkWindow *window);
void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
@ -785,8 +433,8 @@ GdkWindow * _gdk_window_get_impl_window (GdkWindow *window);
*****************************/
GType gdk_offscreen_window_get_type (void);
void _gdk_offscreen_window_new (GdkWindow *window,
GdkWindowAttr *attributes,
gint attributes_mask);
GdkWindowAttr *attributes,
gint attributes_mask);
cairo_surface_t * _gdk_offscreen_window_create_surface (GdkWindow *window,
gint width,
gint height);

View File

@ -26,9 +26,7 @@
#include "config.h"
#include "gdkinternals.h"
#include "gdkkeys.h"
#include "gdkkeysprivate.h"
#include "gdkdisplay.h"

View File

@ -70,7 +70,6 @@ struct _GdkKeymapKey
#define GDK_IS_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_KEYMAP))
#define GDK_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_KEYMAP, GdkKeymapClass))
typedef struct _GdkKeymap GdkKeymap;
typedef struct _GdkKeymapClass GdkKeymapClass;
/**
@ -83,11 +82,6 @@ typedef struct _GdkKeymapClass GdkKeymapClass;
* state; the second phase is to look up the keycode/group/level triplet
* in the keymap and see what keyval it corresponds to.
*/
struct _GdkKeymap
{
GObject parent_instance;
GdkDisplay *GSEAL (display);
};
GType gdk_keymap_get_type (void) G_GNUC_CONST;

74
gdk/gdkkeysprivate.h Normal file
View File

@ -0,0 +1,74 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_KEYS_PRIVATE_H__
#define __GDK_KEYS_PRIVATE_H__
#include "gdkkeys.h"
G_BEGIN_DECLS
struct _GdkKeymapClass
{
GObjectClass parent_class;
PangoDirection (* get_direction) (GdkKeymap *keymap);
gboolean (* have_bidi_layouts) (GdkKeymap *keymap);
gboolean (* get_caps_lock_state) (GdkKeymap *keymap);
gboolean (* get_num_lock_state) (GdkKeymap *keymap);
gboolean (* get_entries_for_keyval) (GdkKeymap *keymap,
guint keyval,
GdkKeymapKey **keys,
gint *n_keys);
gboolean (* get_entries_for_keycode) (GdkKeymap *keymap,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries);
guint (* lookup_key) (GdkKeymap *keymap,
const GdkKeymapKey *key);
gboolean (* translate_keyboard_state) (GdkKeymap *keymap,
guint hardware_keycode,
GdkModifierType state,
gint group,
guint *keyval,
gint *effective_group,
gint *level,
GdkModifierType *consumed_modifiers);
void (* add_virtual_modifiers) (GdkKeymap *keymap,
GdkModifierType *state);
gboolean (* map_virtual_modifiers) (GdkKeymap *keymap,
GdkModifierType *state);
/* Signals */
void (*direction_changed) (GdkKeymap *keymap);
void (*keys_changed) (GdkKeymap *keymap);
void (*state_changed) (GdkKeymap *keymap);
};
struct _GdkKeymap
{
GObject parent_instance;
GdkDisplay *display;
};
G_END_DECLS
#endif

View File

@ -23,9 +23,7 @@
#include "config.h"
#include "gdkscreen.h"
#include "gdkinternals.h"
#include "gdkscreenprivate.h"
#include "gdkrectangle.h"
#include "gdkwindow.h"
#include "gdkintl.h"

View File

@ -44,7 +44,7 @@ typedef struct _GdkScreenClass GdkScreenClass;
#define GDK_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SCREEN, GdkScreenClass))
GType gdk_screen_get_type (void) G_GNUC_CONST;
GdkVisual* gdk_screen_get_system_visual (GdkScreen *screen);
GdkVisual * gdk_screen_get_system_visual (GdkScreen *screen);
GdkVisual * gdk_screen_get_rgba_visual (GdkScreen *screen);
gboolean gdk_screen_is_composited (GdkScreen *screen);

98
gdk/gdkscreenprivate.h Normal file
View File

@ -0,0 +1,98 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_SCREEN_PRIVATE_H__
#define __GDK_SCREEN_PRIVATE_H__
#include "gdkscreen.h"
#include "gdkvisual.h"
G_BEGIN_DECLS
struct _GdkScreen
{
GObject parent_instance;
guint closed : 1;
cairo_font_options_t *font_options;
double resolution; /* pixels/points scale factor for fonts */
};
struct _GdkScreenClass
{
GObjectClass parent_class;
GdkDisplay * (* get_display) (GdkScreen *screen);
gint (* get_width) (GdkScreen *screen);
gint (* get_height) (GdkScreen *screen);
gint (* get_width_mm) (GdkScreen *screen);
gint (* get_height_mm) (GdkScreen *screen);
gint (* get_number) (GdkScreen *screen);
GdkWindow * (* get_root_window) (GdkScreen *screen);
gint (* get_n_monitors) (GdkScreen *screen);
gint (* get_primary_monitor) (GdkScreen *screen);
gint (* get_monitor_width_mm) (GdkScreen *screen,
gint monitor_num);
gint (* get_monitor_height_mm) (GdkScreen *screen,
gint monitor_num);
gchar * (* get_monitor_plug_name) (GdkScreen *screen,
gint monitor_num);
void (* get_monitor_geometry) (GdkScreen *screen,
gint monitor_num,
GdkRectangle *dest);
GList * (* list_visuals) (GdkScreen *screen);
GdkVisual * (* get_system_visual) (GdkScreen *screen);
GdkVisual * (* get_rgba_visual) (GdkScreen *screen);
gboolean (* is_composited) (GdkScreen *screen);
gchar * (* make_display_name) (GdkScreen *screen);
GdkWindow * (* get_active_window) (GdkScreen *screen);
GList * (* get_window_stack) (GdkScreen *screen);
void (* broadcast_client_message) (GdkScreen *screen,
GdkEvent *event);
gboolean (* get_setting) (GdkScreen *screen,
const gchar *name,
GValue *value);
gint (* visual_get_best_depth) (GdkScreen *screen);
GdkVisualType (* visual_get_best_type) (GdkScreen *screen);
GdkVisual * (* visual_get_best) (GdkScreen *screen);
GdkVisual * (* visual_get_best_with_depth) (GdkScreen *screen,
gint depth);
GdkVisual * (* visual_get_best_with_type) (GdkScreen *screen,
GdkVisualType visual_type);
GdkVisual * (* visual_get_best_with_both) (GdkScreen *screen,
gint depth,
GdkVisualType visual_type);
void (* query_depths) (GdkScreen *screen,
gint **depths,
gint *count);
void (* query_visual_types) (GdkScreen *screen,
GdkVisualType **visual_types,
gint *count);
/* Signals: */
void (*size_changed) (GdkScreen *screen);
void (*composited_changed) (GdkScreen *screen);
void (*monitors_changed) (GdkScreen *screen);
};
G_END_DECLS
#endif /* __GDK_SCREEN_PRIVATE_H__ */

View File

@ -143,7 +143,8 @@ typedef struct _GdkDisplayManager GdkDisplayManager;
typedef struct _GdkDisplay GdkDisplay;
typedef struct _GdkScreen GdkScreen;
typedef struct _GdkWindow GdkWindow;
typedef struct GdkAppLaunchContext GdkAppLaunchContext;
typedef struct _GdkKeymap GdkKeymap;
typedef struct _GdkAppLaunchContext GdkAppLaunchContext;
/**
* GdkByteOrder:

View File

@ -23,9 +23,8 @@
#include "config.h"
#include "gdkinternals.h"
#include "gdkvisual.h"
#include "gdkscreen.h"
#include "gdkvisualprivate.h"
#include "gdkscreenprivate.h"
/**

59
gdk/gdkvisualprivate.h Normal file
View File

@ -0,0 +1,59 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2010 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_VISUAL_PRIVATE_H__
#define __GDK_VISUAL_PRIVATE_H__
#include "gdkvisual.h"
G_BEGIN_DECLS
struct _GdkVisual
{
GObject parent_instance;
GdkVisualType type;
gint depth;
GdkByteOrder byte_order;
gint colormap_size;
gint bits_per_rgb;
guint32 red_mask;
gint red_shift;
gint red_prec;
guint32 green_mask;
gint green_shift;
gint green_prec;
guint32 blue_mask;
gint blue_shift;
gint blue_prec;
GdkScreen *screen;
};
struct _GdkVisualClass
{
GObjectClass parent_class;
};
G_END_DECLS
#endif

View File

@ -40,6 +40,7 @@
#include "gdkintl.h"
#include "gdkscreen.h"
#include "gdkdeviceprivate.h"
#include "gdkvisualprivate.h"
#include "gdkmarshalers.h"
#include "gdkscreen.h"
#include "gdkwindowimpl.h"

View File

@ -22,8 +22,7 @@
#include "config.h"
#include "gdkapplaunchcontext.h"
#include "gdkinternals.h"
#include "gdkapplaunchcontextprivate.h"
#include "gdkx.h"
#include "gdkscreen.h"
@ -264,7 +263,6 @@ gdk_app_launch_context_x11_get_startup_notify_id (GAppLaunchContext *context,
GList *files)
{
static int sequence = 0;
GdkAppLaunchContextPrivate *priv;
GdkDisplay *display;
GdkScreen *screen;
int files_count;
@ -278,14 +276,15 @@ gdk_app_launch_context_x11_get_startup_notify_id (GAppLaunchContext *context,
guint32 timestamp;
char *startup_id;
GFileInfo *fileinfo;
GdkAppLaunchContext *ctx;
priv = GDK_APP_LAUNCH_CONTEXT (context)->priv;
ctx = GDK_APP_LAUNCH_CONTEXT (context);
display = priv->display;
if (priv->screen)
screen = priv->screen;
display = ctx->display;
if (ctx->screen)
screen = ctx->screen;
else
screen = gdk_display_get_default_screen (priv->display);
screen = gdk_display_get_default_screen (ctx->display);
fileinfo = NULL;
@ -315,14 +314,14 @@ gdk_app_launch_context_x11_get_startup_notify_id (GAppLaunchContext *context,
files_count), files_count);
icon_name = NULL;
if (priv->icon_name)
icon_name = g_strdup (priv->icon_name);
if (ctx->icon_name)
icon_name = g_strdup (ctx->icon_name);
else
{
icon = NULL;
if (priv->icon != NULL)
icon = g_object_ref (priv->icon);
if (ctx->icon != NULL)
icon = g_object_ref (ctx->icon);
else if (files_count == 1)
icon = get_icon (files->data, fileinfo);
@ -340,13 +339,13 @@ gdk_app_launch_context_x11_get_startup_notify_id (GAppLaunchContext *context,
binary_name = g_app_info_get_executable (info);
timestamp = priv->timestamp;
timestamp = ctx->timestamp;
if (timestamp == GDK_CURRENT_TIME)
timestamp = gdk_x11_display_get_user_time (display);
screen_str = g_strdup_printf ("%d", gdk_screen_get_number (screen));
if (priv->workspace > -1)
workspace_str = g_strdup_printf ("%d", priv->workspace);
if (ctx->workspace > -1)
workspace_str = g_strdup_printf ("%d", ctx->workspace);
else
workspace_str = NULL;
@ -392,18 +391,18 @@ static void
gdk_app_launch_context_x11_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id)
{
GdkAppLaunchContextPrivate *priv;
GdkAppLaunchContext *ctx;
GdkScreen *screen;
StartupTimeoutData *data;
StartupNotificationData *sn_data;
GSList *l;
priv = GDK_APP_LAUNCH_CONTEXT (context)->priv;
ctx = GDK_APP_LAUNCH_CONTEXT (context);
if (priv->screen)
screen = priv->screen;
if (ctx->screen)
screen = ctx->screen;
else
screen = gdk_display_get_default_screen (priv->display);
screen = gdk_display_get_default_screen (ctx->display);
data = g_object_get_data (G_OBJECT (screen), "appinfo-startup-data");
@ -430,8 +429,8 @@ gdk_app_launch_context_x11_launch_failed (GAppLaunchContext *context,
}
}
typedef struct GdkAppLaunchContext GdkAppLaunchContextX11;
typedef struct GdkAppLaunchContextClass GdkAppLaunchContextX11Class;
typedef GdkAppLaunchContext GdkAppLaunchContextX11;
typedef GdkAppLaunchContextClass GdkAppLaunchContextX11Class;
G_DEFINE_TYPE (GdkAppLaunchContextX11, _gdk_app_launch_context_x11, GDK_TYPE_APP_LAUNCH_CONTEXT)

View File

@ -21,7 +21,7 @@
#ifndef __GDK_ASYNC_H__
#define __GDK_ASYNC_H__
#include <gdk/gdkdisplay.h>
#include "gdkdisplay.h"
#include <X11/Xlib.h>
G_BEGIN_DECLS

View File

@ -22,7 +22,7 @@
#include "gdkdevicemanager-core.h"
#include "gdktypes.h"
#include "gdkdevicemanager.h"
#include "gdkdevicemanagerprivate.h"
#include "gdkeventtranslator.h"
#include "gdkdevice-core.h"
#include "gdkkeysyms.h"

View File

@ -20,8 +20,7 @@
#ifndef __GDK_DEVICE_MANAGER_CORE_H__
#define __GDK_DEVICE_MANAGER_CORE_H__
#include "gdkinternals.h"
#include "gdkdevicemanager.h"
#include "gdkdevicemanagerprivate.h"
G_BEGIN_DECLS

View File

@ -20,7 +20,6 @@
#ifndef __GDK_DEVICE_MANAGER_XI_H__
#define __GDK_DEVICE_MANAGER_XI_H__
#include "gdkinternals.h"
#include "gdkdevicemanager-core.h"
G_BEGIN_DECLS

View File

@ -20,8 +20,7 @@
#ifndef __GDK_DEVICE_MANAGER_XI2_H__
#define __GDK_DEVICE_MANAGER_XI2_H__
#include "gdkinternals.h"
#include "gdkdevicemanager.h"
#include "gdkdevicemanagerprivate.h"
#include <X11/extensions/XInput2.h>

View File

@ -1,7 +1,7 @@
/*
* gdkdisplay-x11.h
*
* Copyright 2001 Sun Microsystems Inc.
*
* Copyright 2001 Sun Microsystems Inc.
*
* Erwann Chenede <erwann.chenede@sun.com>
*
@ -24,11 +24,12 @@
#ifndef __GDK_DISPLAY_X11__
#define __GDK_DISPLAY_X11__
#include <gdk/gdkdisplay.h>
#include <gdk/gdkkeys.h>
#include <gdk/gdkwindow.h>
#include <gdk/gdkinternals.h>
#include <gdk/gdkmain.h>
#include "gdkdisplayprivate.h"
#include "gdkkeys.h"
#include "gdkwindow.h"
#include "gdkinternals.h"
#include "gdkmain.h"
#include <X11/X.h>
#include <X11/Xlib.h>
@ -56,17 +57,17 @@ struct _GdkDisplayX11
gint grab_count;
/* Keyboard related information */
gint xkb_event_type;
gboolean use_xkb;
/* Whether we were able to turn on detectable-autorepeat using
* XkbSetDetectableAutorepeat. If FALSE, we'll fall back
* to checking the next event with XPending(). */
* to checking the next event with XPending().
*/
gboolean have_xkb_autorepeat;
GdkKeymap *keymap;
guint keymap_serial;
guint keymap_serial;
gboolean have_xfixes;
gint xfixes_event_base;
@ -78,23 +79,22 @@ struct _GdkDisplayX11
gboolean have_randr13;
gint xrandr_event_base;
/* If the SECURITY extension is in place, whether this client holds
* a trusted authorization and so is allowed to make various requests
* (grabs, properties etc.) Otherwise always TRUE. */
/* If the SECURITY extension is in place, whether this client holds
* a trusted authorization and so is allowed to make various requests
* (grabs, properties etc.) Otherwise always TRUE.
*/
gboolean trusted_client;
/* drag and drop information */
GdkDragContext *current_dest_drag;
/* data needed for MOTIF DnD */
Window motif_drag_window;
GdkWindow *motif_drag_gdk_window;
GList **motif_target_lists;
gint motif_n_target_lists;
/* Mapping to/from virtual atoms */
GHashTable *atom_from_virtual;
GHashTable *atom_to_virtual;
@ -102,13 +102,13 @@ struct _GdkDisplayX11
Window leader_window;
GdkWindow *leader_gdk_window;
gboolean leader_window_title_set;
/* list of filters for client messages */
GList *client_filters;
/* List of functions to go from extension event => X window */
GSList *event_types;
/* X ID hashtable */
GHashTable *xid_ht;
@ -151,10 +151,10 @@ struct _GdkDisplayX11Class
GType _gdk_display_x11_get_type (void);
GdkScreen *_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
Window xrootwin);
Window xrootwin);
void _gdk_x11_display_error_event (GdkDisplay *display,
XErrorEvent *error);
G_END_DECLS
#endif /* __GDK_DISPLAY_X11__ */
#endif /* __GDK_DISPLAY_X11__ */

View File

@ -26,7 +26,7 @@
#include "gdkdisplay-x11.h"
#include "gdkprivate-x11.h"
#include "gdkdisplaymanager.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkinternals.h"
#define GDK_TYPE_DISPLAY_MANAGER_X11 (gdk_display_manager_x11_get_type ())

View File

@ -26,7 +26,7 @@
#include "config.h"
#include "gdkdnd.h"
#include "gdkdndprivate.h"
#include "gdkmain.h"
#include "gdkx.h"

View File

@ -26,11 +26,11 @@
#include "config.h"
#include "gdkx.h"
#include "gdkprivate-x11.h"
#include "gdkinternals.h"
#include "gdkdisplay-x11.h"
#include "gdkkeysprivate.h"
#include "gdkkeysyms.h"
#include "gdkprivate-x11.h"
#include "gdkdisplay-x11.h"
#include "gdkx.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -31,9 +31,9 @@
#ifndef __GDK_PRIVATE_X11_H__
#define __GDK_PRIVATE_X11_H__
#include <gdk/gdkcursor.h>
#include <gdk/gdkprivate.h>
#include <gdk/gdkinternals.h>
#include "gdkcursor.h"
#include "gdkprivate.h"
#include "gdkinternals.h"
#include "gdkwindow-x11.h"
#include "gdkdisplay-x11.h"
#include <cairo-xlib.h>

View File

@ -1,7 +1,7 @@
/*
* gdkscreen-x11.h
*
* Copyright 2001 Sun Microsystems Inc.
*
* Copyright 2001 Sun Microsystems Inc.
*
* Erwann Chenede <erwann.chenede@sun.com>
*
@ -24,8 +24,8 @@
#ifndef __GDK_SCREEN_X11_H__
#define __GDK_SCREEN_X11_H__
#include <gdk/gdkscreen.h>
#include <gdk/gdkvisual.h>
#include "gdkscreenprivate.h"
#include "gdkvisual.h"
#include "gdkprivate-x11.h"
#include "xsettings-client.h"
#include <X11/X.h>

View File

@ -26,12 +26,11 @@
#include "config.h"
#include "gdkvisual.h"
#include "gdkvisualprivate.h"
#include "gdkx.h"
#include "gdkprivate-x11.h"
#include "gdkscreen-x11.h"
#include "gdkinternals.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>

View File

@ -35,6 +35,7 @@
#include "gdkasync.h"
#include "gdkdisplay-x11.h"
#include "gdkprivate-x11.h"
#include "gdkvisualprivate.h"
#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
#include "gdkeventsource.h"