[gitg] Add win32 platform support code



commit 2ca8c5d3dc76e7c68f50ad2c2e1e59c2b4b66783
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Dec 21 13:34:13 2015 +0100

    Add win32 platform support code

 configure.ac                          |    1 +
 libgitg/Makefile.am                   |    5 ++-
 libgitg/gitg-platform-support-win32.c |   55 +++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a95ef0d..c1dad42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,7 @@ done
 
 AC_SUBST(PLATFORM_NAME)
 AM_CONDITIONAL(PLATFORM_OSX, test x"$PLATFORM_NAME" = "xosx")
+AM_CONDITIONAL(PLATFORM_WIN32, test x"$PLATFORM_NAME" = "xwin32")
 
 PKG_CHECK_MODULES(LIBGITG, [
        gthread-2.0 >= $GLIB_REQUIRED_VERSION
diff --git a/libgitg/Makefile.am b/libgitg/Makefile.am
index b192c72..fa1d475 100644
--- a/libgitg/Makefile.am
+++ b/libgitg/Makefile.am
@@ -91,12 +91,15 @@ libgitg_libgitg_1_0_la_SOURCES =                            \
        $(libgitg_libgitg_1_0_la_VALASOURCES)                   \
        libgitg/gitg-resources.c
 
+if PLATFORM_WIN32
+libgitg_libgitg_1_0_la_SOURCES += libgitg/gitg-platform-support-win32.c
+else
 if PLATFORM_OSX
 libgitg_libgitg_1_0_la_SOURCES += libgitg/gitg-platform-support-osx.c
 else
 libgitg_libgitg_1_0_la_SOURCES += libgitg/gitg-platform-support.c
 endif
-
+endif
 
 libgitg_libgitg_1_0_la_headerdir = $(prefix)/include/libgitg-1.0/libgitg
 libgitg_libgitg_1_0_la_header_HEADERS = libgitg/libgitg.h
diff --git a/libgitg/gitg-platform-support-win32.c b/libgitg/gitg-platform-support-win32.c
new file mode 100644
index 0000000..f80c72b
--- /dev/null
+++ b/libgitg/gitg-platform-support-win32.c
@@ -0,0 +1,55 @@
+/*
+ * This file is part of gitg
+ *
+ * Copyright (C) 2015 - Jesse van den Kieboom
+ *
+ * gitg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gitg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gitg. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "gitg-platform-support.h"
+
+gboolean
+gitg_platform_support_use_native_window_controls (GdkDisplay *display)
+{
+       return FALSE;
+}
+
+void
+gitg_platform_support_http_get (GFile               *file,
+                                GCancellable        *cancellable,
+                                GAsyncReadyCallback  callback,
+                                gpointer             user_data)
+{
+       g_file_read_async (file, G_PRIORITY_DEFAULT, cancellable, callback, user_data);
+}
+
+GInputStream *
+gitg_platform_support_http_get_finish (GAsyncResult  *result,
+                                       GError       **error)
+{
+       return G_INPUT_STREAM (g_file_read_finish (g_async_result_get_source_object (result), result, error));
+}
+
+cairo_surface_t *
+gitg_platform_support_create_cursor_surface (GdkDisplay    *display,
+                                             GdkCursorType  cursor_type,
+                                             gint          *hot_x,
+                                             gint          *hot_y,
+                                             gint          *width,
+                                             gint          *height)
+{
+       return NULL;
+}
+
+// ex:ts=4 noet


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