summaryrefslogtreecommitdiff
path: root/iup/src/gtk/iupgtk_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/src/gtk/iupgtk_open.c')
-rwxr-xr-xiup/src/gtk/iupgtk_open.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/iup/src/gtk/iupgtk_open.c b/iup/src/gtk/iupgtk_open.c
index 66e46e8..962f760 100755
--- a/iup/src/gtk/iupgtk_open.c
+++ b/iup/src/gtk/iupgtk_open.c
@@ -20,7 +20,52 @@
#include "iupgtk_drv.h"
+#ifdef GTK_MAC
+#include <gdk/gdk.h>
+char* iupgtkGetNativeWindowHandle(Ihandle* ih)
+{
+ GdkWindow* window = ih->handle->window;
+ if (window)
+ return (char*)window;
+ else
+ return NULL;
+}
+
+void* iupgtkGetNativeGraphicsContext(GtkWidget* widget)
+{
+ return (void*)gdk_gc_new((GdkDrawable*)widget->window);
+}
+
+void iupgtkReleaseNativeGraphicsContext(GtkWidget* widget, void* gc)
+{
+ g_object_unref(gc);
+ (void)widget;
+}
+
+void* iupdrvGetDisplay(void)
+{
+ GdkDisplay* display = gdk_display_get_default();
+ return display;
+}
+
+void iupgtkPushVisualAndColormap(void* visual, void* colormap)
+{
+ GdkColormap* gdk_colormap;
+ GdkVisual *gdk_visual = gdk_visual_get_best();
+
+ gdk_colormap = gdk_colormap_new(gdk_visual, FALSE);
+
+ gtk_widget_push_colormap(gdk_colormap);
+
+ /* gtk_widget_push_visual is now deprecated */
+}
+
+static void gtkSetDrvGlobalAttrib(void)
+{
+}
+
+#else
#ifdef WIN32 /******************************** WIN32 ************************************/
#include <gdk/gdkwin32.h>
@@ -115,6 +160,8 @@ static void gtkSetDrvGlobalAttrib(void)
#endif
+#endif
+
static void gtkSetGlobalColorAttrib(const char* name, GdkColor *color)
{
iupGlobalSetDefaultColorAttrib(name, (int)iupCOLOR16TO8(color->red),