LinuxTV Patchwork [6/8,for,ZBar] Make zbargtk build on Windows

login
register
mail settings
Submitter ?????? ?????????
Date April 9, 2019, 12:38 p.m.
Message ID <20190409123842.19600-7-lrn1986@gmail.com>
Download mbox | patch
Permalink /patch/55580/
State New
Headers show

Comments

?????? ????????? - April 9, 2019, 12:38 p.m.
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@gmail.com>
---
 gtk/zbargtk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch

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);
 }
 

Privacy Policy