[PATCH 6/8] [PATCH for ZBar] Make zbargtk build on Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The code is mostly platform-agnostic, except for this small part
that is written for X. Add ifdefs with an appropriate W32 header,
and call zbar_window_attach() with correct W32 arguments.
Use HAVE_X as a condition.

Signed-off-by: Руслан Ижбулатов <lrn1986@xxxxxxxxx>
---
 gtk/zbargtk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gtk/zbargtk.c b/gtk/zbargtk.c
index c7e05e3..595acfe 100644
--- a/gtk/zbargtk.c
+++ b/gtk/zbargtk.c
@@ -22,7 +22,11 @@
  *------------------------------------------------------------------------*/
 
 #include <gtk/gtksignal.h>
+#ifdef HAVE_X
 #include <gdk/gdkx.h>
+#elif defined(_WIN32)
+#include <gdk/gdkwin32.h>
+#endif
 
 #include <zbar/zbargtk.h>
 #include "zbargtkprivate.h"
@@ -380,9 +384,15 @@ static void zbar_gtk_realize (GtkWidget *widget)
     gdk_window_set_back_pixmap(widget->window, NULL, TRUE);
 
     /* attach zbar_window to underlying X window */
+#ifdef HAVE_X
     if(zbar_window_attach(zbar->window,
                            gdk_x11_drawable_get_xdisplay(widget->window),
                            gdk_x11_drawable_get_xid(widget->window)))
+#elif defined(_WIN32)
+    if(zbar_window_attach(zbar->window,
+                           GDK_WINDOW_HWND (widget->window),
+                           0))
+#endif
         zbar_window_error_spew(zbar->window, 0);
 }
 
-- 
2.4.0




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux