[gtk+/gdk-backend-quartz] quartz: convert GdkVisual
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend-quartz] quartz: convert GdkVisual
- Date: Wed, 22 Dec 2010 16:34:11 +0000 (UTC)
commit 7b061a5e80c703e75cbddb76e1c3346e0ffc6b91
Author: Kristian Rietveld <kris gtk org>
Date: Wed Dec 22 14:42:25 2010 +0100
quartz: convert GdkVisual
gdk/quartz/gdkprivate-quartz.h | 7 +----
gdk/quartz/gdkvisual-quartz.c | 50 ++++++++++++++++++++++++++++++++++-----
2 files changed, 44 insertions(+), 13 deletions(-)
---
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index 0a28b73..d422325 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -35,11 +35,6 @@
#include "config.h"
-struct _GdkVisualClass
-{
- GObjectClass parent_class;
-};
-
extern GdkDisplay *_gdk_display;
extern GdkScreen *_gdk_screen;
extern GdkWindow *_gdk_root;
@@ -52,7 +47,6 @@ extern GdkDragContext *_gdk_quartz_drag_source_context;
void _gdk_windowing_update_window_sizes (GdkScreen *screen);
void _gdk_windowing_window_init (void);
void _gdk_quartz_events_init (void);
-void _gdk_quartz_visual_init (GdkScreen *screen);
void _gdk_quartz_input_init (void);
void _gdk_quartz_event_loop_init (void);
@@ -209,6 +203,7 @@ void _gdk_quartz_screen_query_depths (GdkScreen *scr
void _gdk_quartz_screen_query_visual_types (GdkScreen *screen,
GdkVisualType **visual_types,
gint *count);
+void _gdk_quartz_screen_init_visuals (GdkScreen *screen);
GList * _gdk_quartz_screen_list_visuals (GdkScreen *screen);
diff --git a/gdk/quartz/gdkvisual-quartz.c b/gdk/quartz/gdkvisual-quartz.c
index 24f24f6..c597185 100644
--- a/gdk/quartz/gdkvisual-quartz.c
+++ b/gdk/quartz/gdkvisual-quartz.c
@@ -23,6 +23,29 @@
#include "gdkvisualprivate.h"
#include "gdkprivate-quartz.h"
+GType gdk_quartz_visual_get_type (void);
+
+#define GDK_TYPE_QUARTZ_VISUAL (gdk_quartz_visual_get_type ())
+#define GDK_QUARTZ_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_VISUAL, GdkQuartzVisual))
+#define GDK_QUARTZ_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_VISUAL, GdkQuartzVisualClass))
+#define GDK_IS_QUARTZ_VISUAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_VISUAL))
+#define GDK_IS_QUARTZ_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_VISUAL))
+#define GDK_QUARTZ_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_VISUAL, GdkQuartzVisualClass))
+
+typedef struct _GdkQuartzVisual GdkQuartzVisual;
+typedef struct _GdkQuartzVisualClass GdkQuartzVisualClass;
+
+struct _GdkQuartzVisual
+{
+ GdkVisual visual;
+};
+
+struct _GdkQuartzVisualClass
+{
+ GdkVisualClass visual_class;
+};
+
+
static GdkVisual *system_visual;
static GdkVisual *rgba_visual;
static GdkVisual *gray_visual;
@@ -52,7 +75,7 @@ static GdkVisual *
create_standard_visual (GdkScreen *screen,
gint depth)
{
- GdkVisual *visual = g_object_new (GDK_TYPE_VISUAL, NULL);
+ GdkVisual *visual = g_object_new (GDK_TYPE_QUARTZ_VISUAL, NULL);
visual->screen = screen;
@@ -82,7 +105,7 @@ create_standard_visual (GdkScreen *screen,
static GdkVisual *
create_gray_visual (GdkScreen *screen)
{
- GdkVisual *visual = g_object_new (GDK_TYPE_VISUAL, NULL);
+ GdkVisual *visual = g_object_new (GDK_TYPE_QUARTZ_VISUAL, NULL);
visual->screen = screen;
@@ -95,12 +118,17 @@ create_gray_visual (GdkScreen *screen)
return visual;
}
-void
-_gdk_quartz_visual_init (GdkScreen *screen)
+
+G_DEFINE_TYPE (GdkQuartzVisual, _gdk_quartz_visual, GDK_TYPE_VISUAL)
+
+static void
+_gdk_quartz_visual_init (GdkQuartzVisual *quartz_visual)
+{
+}
+
+static void
+_gdk_quartz_visual_class_init (GdkQuartzVisualClass *class)
{
- system_visual = create_standard_visual (screen, 24);
- rgba_visual = create_standard_visual (screen, 32);
- gray_visual = create_gray_visual (screen);
}
/* We prefer the system visual for now ... */
@@ -210,6 +238,14 @@ _gdk_quartz_screen_query_visual_types (GdkScreen *screen,
*visual_types = &system_visual->type;
}
+void
+_gdk_quartz_screen_init_visuals (GdkScreen *screen)
+{
+ system_visual = create_standard_visual (screen, 24);
+ rgba_visual = create_standard_visual (screen, 32);
+ gray_visual = create_gray_visual (screen);
+}
+
GList*
_gdk_quartz_screen_list_visuals (GdkScreen *screen)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]