From: Tor Lillqvist Date: Wed, 17 Jan 2001 22:26:19 +0000 (+0000) Subject: gtk/gtkmain.c Use the new X-Git-Url: http://pileus.org/git/?p=~andy%2Fgtk;a=commitdiff_plain;h=576ef7f29addee34537305723645a26987da7615 gtk/gtkmain.c Use the new 2001-01-18 Tor Lillqvist * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Use the new g_win32_get_package_installation_(sub)directory() functions. * config.h.win32.in: New file. * config.h.win32: Removed. * configure.in: Output config.h.win32. * Makefile.am: Add it to EXTRA_DIST. * gtk/gtk.def: Update. 2001-01-16 Tor Lillqvist * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): Eliminate redraws when input-only windows are shown or hidden. Thanks to jpe@archaeopteryx.com. 2001-01-18 Tor Lillqvist * gdk-pixbuf-io.c (get_libdir): (Win32) Use the new g_win32_get_package_installation_subdirectory() function. (gtk_win32_get_installation_directory): Remove this then. --- diff --git a/ChangeLog b/ChangeLog index 1bdaddba8..3ef0b0ec6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2001-01-18 Tor Lillqvist + + * gtk/gtkmain.c + * gtk/gtkrc.c: (Win32) Use the new + g_win32_get_package_installation_(sub)directory() functions. + + * config.h.win32.in: New file. + + * config.h.win32: Removed. + + * configure.in: Output config.h.win32. + + * Makefile.am: Add it to EXTRA_DIST. + + * gtk/gtk.def: Update. + Wed Jan 17 16:22:54 2001 Owen Taylor * gtk/gtklabel.c (gtk_label_size_request): Set the @@ -81,7 +97,12 @@ Mon Jan 8 11:58:05 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_update): Free info->last_event if gdk_drag_motion returned FALSE. ->>>>>>> 1.1676 +2001-01-16 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): + Eliminate redraws when input-only windows are shown or + hidden. Thanks to jpe@archaeopteryx.com. + Tue Jan 16 13:13:13 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: FAQ update: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 1bdaddba8..3ef0b0ec6 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,19 @@ +2001-01-18 Tor Lillqvist + + * gtk/gtkmain.c + * gtk/gtkrc.c: (Win32) Use the new + g_win32_get_package_installation_(sub)directory() functions. + + * config.h.win32.in: New file. + + * config.h.win32: Removed. + + * configure.in: Output config.h.win32. + + * Makefile.am: Add it to EXTRA_DIST. + + * gtk/gtk.def: Update. + Wed Jan 17 16:22:54 2001 Owen Taylor * gtk/gtklabel.c (gtk_label_size_request): Set the @@ -81,7 +97,12 @@ Mon Jan 8 11:58:05 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_update): Free info->last_event if gdk_drag_motion returned FALSE. ->>>>>>> 1.1676 +2001-01-16 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): + Eliminate redraws when input-only windows are shown or + hidden. Thanks to jpe@archaeopteryx.com. + Tue Jan 16 13:13:13 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: FAQ update: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1bdaddba8..3ef0b0ec6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,19 @@ +2001-01-18 Tor Lillqvist + + * gtk/gtkmain.c + * gtk/gtkrc.c: (Win32) Use the new + g_win32_get_package_installation_(sub)directory() functions. + + * config.h.win32.in: New file. + + * config.h.win32: Removed. + + * configure.in: Output config.h.win32. + + * Makefile.am: Add it to EXTRA_DIST. + + * gtk/gtk.def: Update. + Wed Jan 17 16:22:54 2001 Owen Taylor * gtk/gtklabel.c (gtk_label_size_request): Set the @@ -81,7 +97,12 @@ Mon Jan 8 11:58:05 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_update): Free info->last_event if gdk_drag_motion returned FALSE. ->>>>>>> 1.1676 +2001-01-16 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): + Eliminate redraws when input-only windows are shown or + hidden. Thanks to jpe@archaeopteryx.com. + Tue Jan 16 13:13:13 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: FAQ update: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 1bdaddba8..3ef0b0ec6 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,19 @@ +2001-01-18 Tor Lillqvist + + * gtk/gtkmain.c + * gtk/gtkrc.c: (Win32) Use the new + g_win32_get_package_installation_(sub)directory() functions. + + * config.h.win32.in: New file. + + * config.h.win32: Removed. + + * configure.in: Output config.h.win32. + + * Makefile.am: Add it to EXTRA_DIST. + + * gtk/gtk.def: Update. + Wed Jan 17 16:22:54 2001 Owen Taylor * gtk/gtklabel.c (gtk_label_size_request): Set the @@ -81,7 +97,12 @@ Mon Jan 8 11:58:05 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_update): Free info->last_event if gdk_drag_motion returned FALSE. ->>>>>>> 1.1676 +2001-01-16 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): + Eliminate redraws when input-only windows are shown or + hidden. Thanks to jpe@archaeopteryx.com. + Tue Jan 16 13:13:13 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: FAQ update: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 1bdaddba8..3ef0b0ec6 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,19 @@ +2001-01-18 Tor Lillqvist + + * gtk/gtkmain.c + * gtk/gtkrc.c: (Win32) Use the new + g_win32_get_package_installation_(sub)directory() functions. + + * config.h.win32.in: New file. + + * config.h.win32: Removed. + + * configure.in: Output config.h.win32. + + * Makefile.am: Add it to EXTRA_DIST. + + * gtk/gtk.def: Update. + Wed Jan 17 16:22:54 2001 Owen Taylor * gtk/gtklabel.c (gtk_label_size_request): Set the @@ -81,7 +97,12 @@ Mon Jan 8 11:58:05 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_update): Free info->last_event if gdk_drag_motion returned FALSE. ->>>>>>> 1.1676 +2001-01-16 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): + Eliminate redraws when input-only windows are shown or + hidden. Thanks to jpe@archaeopteryx.com. + Tue Jan 16 13:13:13 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: FAQ update: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 1bdaddba8..3ef0b0ec6 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,19 @@ +2001-01-18 Tor Lillqvist + + * gtk/gtkmain.c + * gtk/gtkrc.c: (Win32) Use the new + g_win32_get_package_installation_(sub)directory() functions. + + * config.h.win32.in: New file. + + * config.h.win32: Removed. + + * configure.in: Output config.h.win32. + + * Makefile.am: Add it to EXTRA_DIST. + + * gtk/gtk.def: Update. + Wed Jan 17 16:22:54 2001 Owen Taylor * gtk/gtklabel.c (gtk_label_size_request): Set the @@ -81,7 +97,12 @@ Mon Jan 8 11:58:05 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_update): Free info->last_event if gdk_drag_motion returned FALSE. ->>>>>>> 1.1676 +2001-01-16 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): + Eliminate redraws when input-only windows are shown or + hidden. Thanks to jpe@archaeopteryx.com. + Tue Jan 16 13:13:13 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: FAQ update: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 1bdaddba8..3ef0b0ec6 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,19 @@ +2001-01-18 Tor Lillqvist + + * gtk/gtkmain.c + * gtk/gtkrc.c: (Win32) Use the new + g_win32_get_package_installation_(sub)directory() functions. + + * config.h.win32.in: New file. + + * config.h.win32: Removed. + + * configure.in: Output config.h.win32. + + * Makefile.am: Add it to EXTRA_DIST. + + * gtk/gtk.def: Update. + Wed Jan 17 16:22:54 2001 Owen Taylor * gtk/gtklabel.c (gtk_label_size_request): Set the @@ -81,7 +97,12 @@ Mon Jan 8 11:58:05 2001 Owen Taylor * gtk/gtkdnd.c (gtk_drag_update): Free info->last_event if gdk_drag_motion returned FALSE. ->>>>>>> 1.1676 +2001-01-16 Tor Lillqvist + + * gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide): + Eliminate redraws when input-only windows are shown or + hidden. Thanks to jpe@archaeopteryx.com. + Tue Jan 16 13:13:13 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: FAQ update: diff --git a/Makefile.am b/Makefile.am index e59df953b..1ee167e41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,6 +19,7 @@ EXTRA_DIST = \ README.cvs-commits \ README.win32 \ README.nanox \ + config.h.win32 \ intl/libgettext.h \ intl/po2tbl.sed.in \ po/README.tools \ diff --git a/config.h.win32 b/config.h.win32.in old mode 100755 new mode 100644 similarity index 98% rename from config.h.win32 rename to config.h.win32.in index ecbc5b3d5..28c0e5376 --- a/config.h.win32 +++ b/config.h.win32.in @@ -1,4 +1,4 @@ -/* config.h.win32. Handcrafted for Microsoft C and gcc -mno-cygwin */ +/* config.h.win32. Handcrafted for Microsoft C or mingw */ #if ! (defined(_MSC_VER) || defined(__GNUC__)) #error Unrecognized Win32 compiler, edit config.h.win32 by hand @@ -198,4 +198,4 @@ /* #undef HAVE_SIGSETJMP */ -#define GETTEXT_PACKAGE "gtk20" +#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" diff --git a/configure.in b/configure.in index a333fe0eb..bd3fb3074 100644 --- a/configure.in +++ b/configure.in @@ -1142,6 +1142,7 @@ AC_PATH_PROG(SGML2HTML, sgml2html, no) AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno) AC_OUTPUT([ +config.h.win32 gtk+.spec docs/gtk-config.1 Makefile diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index a7397810b..f23023bec 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +2001-01-18 Tor Lillqvist + + * gdk-pixbuf-io.c (get_libdir): (Win32) Use the new + g_win32_get_package_installation_subdirectory() function. + (gtk_win32_get_installation_directory): Remove this then. + 2001-01-01 Havoc Pennington * Makefile.am (libgdk_pixbuf_1_3_la_LDFLAGS): add diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index b050c25f7..d07462947 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -215,55 +215,17 @@ pixbuf_module_symbol (GModule *module, const char *module_name, const char *symb #ifdef G_OS_WIN32 -/* What would be the right place for this function? Also - * gtk needs this function (to find the gtkrc and themes). - * But it seems stupid for the gdk-pixbuf DLL to depend - * on the gtk DLL. Should it be in the gdk DLL? Or should we - * have a small static library at the top gtk+ level? - */ - -static gchar * -gtk_win32_get_installation_directory (void) -{ - static gboolean been_here = FALSE; - static gchar gtk_installation_dir[200]; - gchar win_dir[100]; - HKEY reg_key = NULL; - DWORD type; - DWORD nbytes = sizeof (gtk_installation_dir); - - if (been_here) - return gtk_installation_dir; - - been_here = TRUE; - - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Software\\GNU\\GTk+", 0, - KEY_QUERY_VALUE, ®_key) != ERROR_SUCCESS - || RegQueryValueEx (reg_key, "InstallationDirectory", 0, - &type, gtk_installation_dir, &nbytes) != ERROR_SUCCESS - || type != REG_SZ) - { - /* Uh oh. Use hard-coded %WinDir%\gtk+ value */ - GetWindowsDirectory (win_dir, sizeof (win_dir)); - sprintf (gtk_installation_dir, "%s\\gtk+", win_dir); - } - - if (reg_key != NULL) - RegCloseKey (reg_key); - - return gtk_installation_dir; -} - static char * get_libdir (void) { static char *libdir = NULL; if (libdir == NULL) - libdir = g_strdup_printf (gtk_win32_get_installation_directory (), - G_DIR_SEPARATOR_S, - "loaders", - NULL); + libdir = g_win32_get_package_installation_subdirectory + (GETTEXT_PACKAGE, + g_strdup_printf ("gdk_pixbug-%d.%d.dll", + GDK_PIXBUF_MAJOR, GDK_PIXBUF_MINOR), + "loaders"); return libdir; } diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 8a516965e..6a7fc6abe 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -816,13 +816,24 @@ gdk_window_show (GdkWindow *window) } else { - ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL); - ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE); - SetForegroundWindow (GDK_WINDOW_HWND (window)); - BringWindowToTop (GDK_WINDOW_HWND (window)); + if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT) + { + SetWindowPos(GDK_WINDOW_HWND (window), HWND_TOP, 0, 0, 0, 0, + SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE); + } + else + { + GdkWindow *parent = private->parent; + + ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL); + ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE); + if (parent == gdk_parent_root) + SetForegroundWindow (GDK_WINDOW_HWND (window)); + BringWindowToTop (GDK_WINDOW_HWND (window)); #if 0 - ShowOwnedPopups (GDK_WINDOW_HWND (window), TRUE); + ShowOwnedPopups (GDK_WINDOW_HWND (window), TRUE); #endif + } } } } @@ -844,7 +855,15 @@ gdk_window_hide (GdkWindow *window) if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL) ShowOwnedPopups (GDK_WINDOW_HWND (window), FALSE); - ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE); + if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT) + { + SetWindowPos(GDK_WINDOW_HWND (window), HWND_BOTTOM, 0, 0, 0, 0, + SWP_HIDEWINDOW | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE); + } + else + { + ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE); + } } } diff --git a/gtk/gtk.def b/gtk/gtk.def index 9430d1f70..a73b96fff 100755 --- a/gtk/gtk.def +++ b/gtk/gtk.def @@ -1555,7 +1555,6 @@ EXPORTS gtk_widget_unparent gtk_widget_unrealize gtk_widget_unref - gtk_win32_get_installation_directory gtk_window_activate_default gtk_window_activate_focus gtk_window_add_accel_group diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index c66f4922d..d3ba241d4 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -406,12 +406,10 @@ gtk_init_check (int *argc, # endif # else /* !G_OS_WIN32 */ { - /* GTk+ locale dir is %WinDir%\gtk+\locale */ bindtextdomain (GETTEXT_PACKAGE, - g_strconcat (gtk_win32_get_installation_directory (), - G_DIR_SEPARATOR_S, - "locale", - NULL)); + g_win32_get_package_installation_subdirectory (GETTEXT_PACKAGE, + g_strdup_printf ("gtk-%d.%d.dll", GTK_MAJOR_VERSION, GTK_MINOR_VERSION), + "locale")); } #endif #endif diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 18ea5a6db..03a12b3bf 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -51,6 +51,7 @@ #include #include "gdkconfig.h" +#include "gtkcompat.h" #include "gtkrc.h" #include "gtkbindings.h" #include "gtkthemes.h" @@ -58,7 +59,6 @@ #include "gtkiconfactory.h" #ifdef G_OS_WIN32 -#include /* For GetWindowsDirectory */ #include #endif @@ -268,45 +268,23 @@ static GtkImageLoader image_loader = NULL; #ifdef G_OS_WIN32 -gchar * -gtk_win32_get_installation_directory (void) +static gchar * +get_gtk_dll_name (void) { - static gboolean been_here = FALSE; - static gchar gtk_installation_dir[200]; - gchar win_dir[100]; - HKEY reg_key = NULL; - DWORD type; - DWORD nbytes = sizeof (gtk_installation_dir); - - if (been_here) - return gtk_installation_dir; - - been_here = TRUE; + static gchar *gtk_dll = NULL; - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Software\\GNU\\GTk+", 0, - KEY_QUERY_VALUE, ®_key) != ERROR_SUCCESS - || RegQueryValueEx (reg_key, "InstallationDirectory", 0, - &type, gtk_installation_dir, &nbytes) != ERROR_SUCCESS - || type != REG_SZ) - { - /* Uh oh. Use the old hard-coded %WinDir%\GTk+ value */ - GetWindowsDirectory (win_dir, sizeof (win_dir)); - sprintf (gtk_installation_dir, "%s\\gtk+", win_dir); - } + if (!gtk_dll) + gtk_dll = g_strdup_printf ("gtk-%d.%d.dll", GTK_MAJOR_VERSION, GTK_MINOR_VERSION); - if (reg_key != NULL) - RegCloseKey (reg_key); - - return gtk_installation_dir; + return gtk_dll; } static gchar * get_themes_directory (void) { - static gchar themes_dir[200]; - - sprintf (themes_dir, "%s\\themes", gtk_win32_get_installation_directory ()); - return themes_dir; + return g_win32_get_package_installation_subdirectory (GETTEXT_PACKAGE, + get_gtk_dll_name (), + "themes"); } #endif @@ -358,7 +336,7 @@ gtk_rc_get_im_module_file (void) #ifndef G_OS_WIN32 result = g_strdup (GTK_SYSCONFDIR G_DIR_SEPARATOR_S "gtk-2.0" G_DIR_SEPARATOR_S "gtk.immodules"); #else - result = g_strdup_printf ("%s\\gtk.immodules", gtk_win32_get_installation_directory ()); + result = g_strdup_printf ("%s\\gtk.immodules", g_win32_get_package_installation_directory (GETTEXT_PACKAGE, get_gtk_dll_name ())); #endif } @@ -462,7 +440,7 @@ gtk_rc_add_initial_default_files (void) #ifndef G_OS_WIN32 str = g_strdup (GTK_SYSCONFDIR G_DIR_SEPARATOR_S "gtk-2.0" G_DIR_SEPARATOR_S "gtkrc"); #else - str = g_strdup_printf ("%s\\gtkrc", gtk_win32_get_installation_directory ()); + str = g_strdup_printf ("%s\\gtkrc", g_win32_get_package_installation_directory (GETTEXT_PACKAGE, get_gtk_dll_name ())); #endif gtk_rc_add_default_file (str);