[gtk+] Windows: Update code for monolithic GTK DLL
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Windows: Update code for monolithic GTK DLL
- Date: Thu, 3 Nov 2016 08:55:49 +0000 (UTC)
commit abef8d4860a057b0f98840d48afdb65997e10acc
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Nov 3 16:03:08 2016 +0800
Windows: Update code for monolithic GTK DLL
Now that the autotools build folded the GDK/GSK bits into the main GTK+
DLL, there are some updates that need to be done for this. We need to:
-Fold the DllMain() of GDK-Win32 into the main GTK+ DllMain(), as we need
the HINSTANCE to register the window. We can't have two DllMain()'s in a
single DLL.
-Remove the GDK rc(.in) files, as that is not used anymore. Make the GTK+
.rc(.in) file load the gtk.ico GTK+ logo file instead so that we still
get the GTK+ logo for the application icon by default. Update the
autotools build files as well.
-Revert commit b9f9980 as LRN pointed out in comment 25 in bug 773299, as
GTK+ is now a monolithic DLL, and we ought not to export this private
function.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
gdk/Makefile.am | 2 --
gdk/win32/gdkmain-win32.c | 10 ----------
gdk/win32/rc/Makefile.am | 12 +-----------
gdk/win32/rc/gdk.rc.in | 32 --------------------------------
gsk/gskrendernodeprivate.h | 1 -
gtk/Makefile.am | 4 ++--
gtk/gtk-win32.rc.body.in | 2 ++
gtk/gtkwin32.c | 4 +++-
8 files changed, 8 insertions(+), 59 deletions(-)
---
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 8f0ba00..e933cb0 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -203,8 +203,6 @@ endif # USE_QUARTZ
if USE_WIN32
libgdk_4_la_LIBADD += win32/libgdk-win32.la
-libgdk_4_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o
-libgdk_4_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o
endif # USE_WIN32
if USE_BROADWAY
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index 5d17072..79dc35f 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -63,16 +63,6 @@ const GOptionEntry _gdk_windowing_args[] = {
{ NULL }
};
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL,
- DWORD dwReason,
- LPVOID reserved)
-{
- _gdk_dll_hinstance = hinstDLL;
-
- return TRUE;
-}
-
void
_gdk_win32_windowing_init (void)
{
diff --git a/gdk/win32/rc/Makefile.am b/gdk/win32/rc/Makefile.am
index 4196109..beee6fd 100644
--- a/gdk/win32/rc/Makefile.am
+++ b/gdk/win32/rc/Makefile.am
@@ -1,15 +1,5 @@
include $(top_srcdir)/Makefile.decl
-EXTRA_DIST += \
- gdk.rc \
- gdk.rc.in \
- gtk.ico
-
-if USE_WIN32
-noinst_DATA = gdk-win32-res.o
-endif
-
-gdk-win32-res.o : gdk.rc gtk.ico
- $(WINDRES) -I $(srcdir) gdk.rc $@
+EXTRA_DIST += gtk.ico
-include $(top_srcdir)/git.mk
diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h
index 08c8c7e..20e6084 100644
--- a/gsk/gskrendernodeprivate.h
+++ b/gsk/gskrendernodeprivate.h
@@ -77,7 +77,6 @@ GskRenderNode *gsk_render_node_new (void);
void gsk_render_node_make_immutable (GskRenderNode *node);
-_GDK_EXTERN
void gsk_render_node_get_bounds (GskRenderNode *node,
graphene_rect_t *frame);
void gsk_render_node_get_transform (GskRenderNode *node,
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 582a687..7eaf237 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -41,8 +41,8 @@ gtk_win32_symbols = -export-symbols $(srcdir)/gtk.def
gtk_win32_res = gtk-win32-res.o
gtk_win32_res_ldflag = -Wl,gtk-win32-res.o
-gtk-win32-res.o : gtk-win32.rc libgtk4.manifest
- $(WINDRES) gtk-win32.rc $@
+gtk-win32-res.o : $(top_srcdir)/gdk/win32/rc/gtk.ico gtk-win32.rc libgtk4.manifest
+ $(WINDRES) -I $(top_srcdir)/gdk/win32/rc gtk-win32.rc $@
gtk-win32.rc: gtk-win32.rc.body
echo "#include <winuser.h>" >>$@
diff --git a/gtk/gtk-win32.rc.body.in b/gtk/gtk-win32.rc.body.in
index 4a42d5a..251128f 100644
--- a/gtk/gtk-win32.rc.body.in
+++ b/gtk/gtk-win32.rc.body.in
@@ -1,5 +1,7 @@
#include <winver.h>
+GTK_ICON ICON "gtk.ico"
+
VS_VERSION_INFO VERSIONINFO
FILEVERSION @GTK_MAJOR_VERSION@,@GTK_MINOR_VERSION@,@GTK_MICRO_VERSION@,0
PRODUCTVERSION @GTK_MAJOR_VERSION@,@GTK_MINOR_VERSION@,@GTK_MICRO_VERSION@,0
diff --git a/gtk/gtkwin32.c b/gtk/gtkwin32.c
index bf707ad..d290505 100644
--- a/gtk/gtkwin32.c
+++ b/gtk/gtkwin32.c
@@ -39,7 +39,8 @@
#define EMPIRIC_MANIFEST_RESOURCE_INDEX 2
-static HMODULE gtk_dll;
+static HMODULE gtk_dll;
+extern HINSTANCE _gdk_dll_hinstance;
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
@@ -50,6 +51,7 @@ DllMain (HINSTANCE hinstDLL,
{
case DLL_PROCESS_ATTACH:
gtk_dll = (HMODULE) hinstDLL;
+ _gdk_dll_hinstance = hinstDLL;
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]