summaryrefslogtreecommitdiff
path: root/gdk/x11
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-12-20 23:14:47 -0500
committerMatthias Clasen <mclasen@redhat.com>2010-12-21 12:07:09 -0500
commit146fd989d65ce062845238e0cef42b8bf1594974 (patch)
treea66b76f1ed3371bd0fe84189412045604e231af5 /gdk/x11
parent36893a9ef8b724e283038f0d538c411cdd5b1ddb (diff)
downloadgtk+-146fd989d65ce062845238e0cef42b8bf1594974.tar.gz
Rename GdkDisplayManagerX11 to GdkX11DisplayManager
And add a gdkx11displaymanager.h header file.
Diffstat (limited to 'gdk/x11')
-rw-r--r--gdk/x11/Makefile.am1
-rw-r--r--gdk/x11/gdkdisplaymanager-x11.c60
-rw-r--r--gdk/x11/gdkx.h1
-rw-r--r--gdk/x11/gdkx11displaymanager.h49
4 files changed, 79 insertions, 32 deletions
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index bf33c4adae..a0489b4951 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -78,6 +78,7 @@ libgdkinclude_HEADERS = \
libgdkx11include_HEADERS = \
gdkx11cursor.h \
gdkx11display.h \
+ gdkx11displaymanager.h \
gdkx11property.h \
gdkx11screen.h \
gdkx11selection.h \
diff --git a/gdk/x11/gdkdisplaymanager-x11.c b/gdk/x11/gdkdisplaymanager-x11.c
index d073c3c727..b0cd9dee3e 100644
--- a/gdk/x11/gdkdisplaymanager-x11.c
+++ b/gdk/x11/gdkdisplaymanager-x11.c
@@ -23,19 +23,14 @@
#include "config.h"
+#include "gdkx11displaymanager.h"
+#include "gdkdisplaymanagerprivate.h"
#include "gdkdisplay-x11.h"
#include "gdkprivate-x11.h"
-#include "gdkdisplaymanagerprivate.h"
#include "gdkinternals.h"
-#define GDK_TYPE_DISPLAY_MANAGER_X11 (gdk_display_manager_x11_get_type ())
-#define GDK_DISPLAY_MANAGER_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_MANAGER_X11, GdkDisplayManagerX11))
-
-typedef struct _GdkDisplayManagerX11 GdkDisplayManagerX11;
-typedef struct _GdkDisplayManagerClass GdkDisplayManagerX11Class;
-
-struct _GdkDisplayManagerX11
+struct _GdkX11DisplayManager
{
GdkDisplayManager parent;
@@ -43,65 +38,66 @@ struct _GdkDisplayManagerX11
GSList *displays;
};
-G_DEFINE_TYPE (GdkDisplayManagerX11, gdk_display_manager_x11, GDK_TYPE_DISPLAY_MANAGER)
+struct _GdkX11DisplayManagerClass
+{
+ GdkDisplayManagerClass parent_class;
+};
+
+G_DEFINE_TYPE (GdkX11DisplayManager, gdk_x11_display_manager, GDK_TYPE_X11_DISPLAY_MANAGER)
static GdkDisplay *
-gdk_display_manager_x11_open_display (GdkDisplayManager *manager,
+gdk_x11_display_manager_open_display (GdkDisplayManager *manager,
const gchar *name)
{
return _gdk_x11_display_open (name);
}
static GSList *
-gdk_display_manager_x11_list_displays (GdkDisplayManager *manager)
+gdk_x11_display_manager_list_displays (GdkDisplayManager *manager)
{
- GdkDisplayManagerX11 *manager_x11 = GDK_DISPLAY_MANAGER_X11 (manager);
-
- return g_slist_copy (manager_x11->displays);
+ return g_slist_copy (GDK_X11_DISPLAY_MANAGER (manager)->displays);
}
static GdkDisplay *
-gdk_display_manager_x11_get_default_display (GdkDisplayManager *manager)
+gdk_x11_display_manager_get_default_display (GdkDisplayManager *manager)
{
- return GDK_DISPLAY_MANAGER_X11 (manager)->default_display;
+ return GDK_X11_DISPLAY_MANAGER (manager)->default_display;
}
static void
-gdk_display_manager_x11_set_default_display (GdkDisplayManager *manager,
+gdk_x11_display_manager_set_default_display (GdkDisplayManager *manager,
GdkDisplay *display)
{
- GdkDisplayManagerX11 *manager_x11 = GDK_DISPLAY_MANAGER_X11 (manager);
-
- manager_x11->default_display = display;
+ GDK_X11_DISPLAY_MANAGER (manager)->default_display = display;
_gdk_x11_display_make_default (display);
}
static void
-gdk_display_manager_x11_init (GdkDisplayManagerX11 *manager)
+gdk_x11_display_manager_init (GdkX11DisplayManager *manager)
{
_gdk_x11_windowing_init ();
}
static void
-gdk_display_manager_x11_finalize (GObject *object)
+gdk_x11_display_manager_finalize (GObject *object)
{
- g_error ("A GdkDisplayManagerX11 object was finalized. This should not happen");
- G_OBJECT_CLASS (gdk_display_manager_x11_parent_class)->finalize (object);
+ g_error ("A GdkX11DisplayManager object was finalized. This should not happen");
+ G_OBJECT_CLASS (gdk_x11_display_manager_parent_class)->finalize (object);
}
static void
-gdk_display_manager_x11_class_init (GdkDisplayManagerX11Class *class)
+gdk_x11_display_manager_class_init (GdkX11DisplayManagerClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GdkDisplayManagerClass *manager_class = GDK_DISPLAY_MANAGER_CLASS (class);
- object_class->finalize = gdk_display_manager_x11_finalize;
+ object_class->finalize = gdk_x11_display_manager_finalize;
- manager_class->open_display = gdk_display_manager_x11_open_display;
- manager_class->list_displays = gdk_display_manager_x11_list_displays;
- manager_class->set_default_display = gdk_display_manager_x11_set_default_display;
- manager_class->get_default_display = gdk_display_manager_x11_get_default_display;
+ manager_class->open_display = gdk_x11_display_manager_open_display;
+ manager_class->list_displays = gdk_x11_display_manager_list_displays;
+ manager_class->set_default_display = gdk_x11_display_manager_set_default_display;
+ manager_class->get_default_display = gdk_x11_display_manager_get_default_display;
manager_class->atom_intern = _gdk_x11_display_manager_atom_intern;
manager_class->get_atom_name = _gdk_x11_display_manager_get_atom_name;
manager_class->lookup_keyval = _gdk_x11_display_manager_lookup_keyval;
@@ -113,7 +109,7 @@ void
_gdk_x11_display_manager_add_display (GdkDisplayManager *manager,
GdkDisplay *display)
{
- GdkDisplayManagerX11 *manager_x11 = GDK_DISPLAY_MANAGER_X11 (manager);
+ GdkX11DisplayManager *manager_x11 = GDK_X11_DISPLAY_MANAGER (manager);
if (manager_x11->displays == NULL)
gdk_display_manager_set_default_display (manager, display);
@@ -125,7 +121,7 @@ void
_gdk_x11_display_manager_remove_display (GdkDisplayManager *manager,
GdkDisplay *display)
{
- GdkDisplayManagerX11 *manager_x11 = GDK_DISPLAY_MANAGER_X11 (manager);
+ GdkX11DisplayManager *manager_x11 = GDK_X11_DISPLAY_MANAGER (manager);
manager_x11->displays = g_slist_remove (manager_x11->displays, display);
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 20d596b029..f496b2de69 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -57,6 +57,7 @@
#include <gdk/x11/gdkx11cursor.h>
#include <gdk/x11/gdkx11display.h>
+#include <gdk/x11/gdkx11displaymanager.h>
#include <gdk/x11/gdkx11property.h>
#include <gdk/x11/gdkx11screen.h>
#include <gdk/x11/gdkx11selection.h>
diff --git a/gdk/x11/gdkx11displaymanager.h b/gdk/x11/gdkx11displaymanager.h
new file mode 100644
index 0000000000..b729a046ed
--- /dev/null
+++ b/gdk/x11/gdkx11displaymanager.h
@@ -0,0 +1,49 @@
+/* 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.
+ */
+
+#if !defined (__GDKX_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdkx.h> can be included directly."
+#endif
+
+#ifndef __GDK_X11_DISPLAY_MANAGER_H__
+#define __GDK_X11_DISPLAY_MANAGER_H__
+
+#include <gdk/gdk.h>
+
+G_BEGIN_DECLS
+
+#ifdef GDK_COMPILATION
+typedef struct _GdkX11DisplayManager GdkX11DisplayManager;
+#else
+typedef GdkDisplayManager GdkX11DisplayManager;
+#endif
+typedef struct _GdkX11DisplayManagerClass GdkX11DisplayManagerClass;
+
+#define GDK_TYPE_X11_DISPLAY_MANAGER (gdk_x11_display_manager_get_type())
+#define GDK_X11_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_DISPLAY_MANAGER, GdkX11DisplayManager))
+#define GDK_X11_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_DISPLAY_MANAGER, GdkX11DisplayManagerClass))
+#define GDK_IS_X11_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_DISPLAY_MANAGER))
+#define GDK_IS_X11_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_DISPLAY_MANAGER))
+#define GDK_X11_DISPLAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_DISPLAY_MANAGER, GdkX11DisplayManagerClass))
+
+GType gdk_x11_display_manager_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GDK_X11_DISPLAY_MANAGER_H__ */