All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Руслан Ижбулатов" <lrn1986@gmail.com>
To: linux-media@vger.kernel.org
Subject: [PATCH 6/8] [PATCH for ZBar] Make zbargtk build on Windows
Date: Tue,  9 Apr 2019 12:38:40 +0000	[thread overview]
Message-ID: <20190409123842.19600-7-lrn1986@gmail.com> (raw)
In-Reply-To: <20190409123842.19600-1-lrn1986@gmail.com>

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(+)

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


  parent reply	other threads:[~2019-04-09 12:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 1/8] [PATCH for ZBar] Include windows.h for vfw Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 2/8] [PATCH for ZBar] Specify correct path to barcode.png Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 3/8] [PATCH for ZBar] Check for clock_gettime on pthread library as well Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 4/8] [PATCH for ZBar] Disable zbarcam-gtk on Windows Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 5/8] [PATCH for ZBar] Use -no-undefined for libzbargtk Руслан Ижбулатов
2019-04-09 12:38 ` Руслан Ижбулатов [this message]
2019-04-09 12:38 ` [PATCH 7/8] [PATCH for ZBar] Make use of glib thread names Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 8/8] [PATCH for ZBar] Correctly generate version.xml and reldate.xml Руслан Ижбулатов
2019-04-25 12:05 ` [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190409123842.19600-7-lrn1986@gmail.com \
    --to=lrn1986@gmail.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.