]> Pileus Git - ~andy/gtk/commitdiff
Make the MS Windows engine compile again.
authorFridrich Štrba <fridrich.strba@bluewin.ch>
Thu, 2 Sep 2010 13:02:48 +0000 (15:02 +0200)
committerFridrich Štrba <fridrich.strba@bluewin.ch>
Thu, 2 Sep 2010 13:04:14 +0000 (15:04 +0200)
Nevertheless, it is not working and needs a lot of fixing before
it can be useful.

modules/engines/ms-windows/xp_theme.c
modules/engines/ms-windows/xp_theme.h

index 5f083d9014ba39a8af784368c46ee307029e0e89..a1ed6b0b11b84ece09ebb606c831a411af518ace 100755 (executable)
@@ -37,6 +37,9 @@
 #include "gdk/win32/gdkwin32.h"
 #endif
 
+#include <cairo-win32.h>
+#include <gdk/gdk.h>
+
 #include "xp_theme_defs.h"
 
 #ifndef TMT_CAPTIONFONT
@@ -897,6 +900,7 @@ get_window_dc (GtkStyle *style,
               gint x, gint y, gint width, gint height,
               RECT *rect_out)
 {
+#if 0
   GdkDrawable *drawable = NULL;
   GdkGC *gc = style->dark_gc[state_type];
   gint x_offset, y_offset;
@@ -920,14 +924,43 @@ get_window_dc (GtkStyle *style,
   dc_info_out->y_offset = y_offset;
   
   return gdk_win32_hdc_get (drawable, gc, 0);
+#else
+  cairo_t *cr;
+  cairo_surface_t *crs;
+  gint x_offset, y_offset;
+  GdkWindowObject *private = (GdkWindowObject *)GDK_DRAWABLE(window);
+
+  cr = gdk_cairo_create (window);
+  crs = cairo_get_target (cr);
+  x_offset = -private->abs_x;
+  y_offset = -private->abs_y;
+
+
+  dc_info_out->data = NULL;
+  
+  rect_out->left = x - x_offset;
+  rect_out->top = y - y_offset;
+  rect_out->right = rect_out->left + width;
+  rect_out->bottom = rect_out->top + height;
+  
+  dc_info_out->cr = cr;
+  dc_info_out->x_offset = x_offset;
+  dc_info_out->y_offset = y_offset;
+  
+  return cairo_win32_surface_get_dc (crs);
+#endif
 }
 
 void
 release_window_dc (XpDCInfo *dc_info)
 {
+#if 0
   gdk_win32_hdc_release (dc_info->drawable, dc_info->gc, 0);
 
   gdk_win32_end_direct_draw_libgtk_only (dc_info->data);
+#else
+  cairo_destroy (dc_info->cr);
+#endif
 }
 
 gboolean
index dfacb434cc1fb935661a867b7cea9317d4f9d77b..4e2a1f14041fde268922bc9840866e93690664d4 100755 (executable)
@@ -115,8 +115,13 @@ typedef enum
 
 typedef struct
 {
+#if 0
   GdkDrawable *drawable;
   GdkGC *gc;
+#else
+  cairo_t *cr;
+  cairo_surface_t *crs;
+#endif
   
   gint x_offset;
   gint y_offset;