]> Pileus Git - ~andy/gtk/commitdiff
handle GTK_DATADIR similar as the other filesystem placement 'constants'
authorHans Breuer <hans@breuer.org>
Sun, 14 Dec 2003 19:03:02 +0000 (19:03 +0000)
committerHans Breuer <hans@src.gnome.org>
Sun, 14 Dec 2003 19:03:02 +0000 (19:03 +0000)
2003-12-14  Hans Breuer  <hans@breuer.org>

* gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
similar as the other filesystem placement 'constants' (dynamic
resolving on win32)

* gtk/gtkfilechooserwidget.c : handle file system to win32
renaming here as will
* gtk/gtkfilesystemwin32.c : implement render_icon

* gtk/gtk.def gdk/gdk.def : updated externals

* gdk/win32/gdkdisplay-win32.c : make it compile without
<multimon.h> - i.e. even older sdk

* gdk/win32/gdkevents-win32.c : match resize_timer_proc
with TIMERPROC prototype

* gdk/win32/gdkwindow-win32.c : older msvc does not know
BITMAPV5HEADER (from win xp) either

* gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
not defined

* tests/testfilechooser.c : recent GLib crashes on
g_print ("%s", NULL) so avoid this

16 files changed:
ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdk.def
gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkevents-win32.c
gdk/win32/gdkwindow-win32.c
gtk/gtk.def
gtk/gtkfilechooserwidget.c
gtk/gtkfilesystemwin32.c
gtk/gtkimmodule.c
gtk/gtkmain.c
gtk/gtkprivate.h
tests/testfilechooser.c

index b3cec61911918db10af90d1d314b59622b0019f3..9f9963acef3adbe37b602973e148a4d9562607c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2003-12-14  Hans Breuer  <hans@breuer.org>
+
+       * gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
+       similar as the other filesystem placement 'constants' (dynamic
+       resolving on win32)
+
+       * gtk/gtkfilechooserwidget.c : handle file system to win32
+       renaming here as will
+       * gtk/gtkfilesystemwin32.c : implement render_icon
+
+       * gtk/gtk.def gdk/gdk.def : updated externals
+
+       * gdk/win32/gdkdisplay-win32.c : make it compile without
+       <multimon.h> - i.e. even older sdk
+
+       * gdk/win32/gdkevents-win32.c : match resize_timer_proc
+       with TIMERPROC prototype
+
+       * gdk/win32/gdkwindow-win32.c : older msvc does not know
+       BITMAPV5HEADER (from win xp) either
+
+       * gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
+       not defined
+
+       * tests/testfilechooser.c : recent GLib crashes on 
+       g_print ("%s", NULL) so avoid this
+
 2003-12-14  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkselection-win32.c: Calls to OpenClipboard() must be
index b3cec61911918db10af90d1d314b59622b0019f3..9f9963acef3adbe37b602973e148a4d9562607c2 100644 (file)
@@ -1,3 +1,30 @@
+2003-12-14  Hans Breuer  <hans@breuer.org>
+
+       * gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
+       similar as the other filesystem placement 'constants' (dynamic
+       resolving on win32)
+
+       * gtk/gtkfilechooserwidget.c : handle file system to win32
+       renaming here as will
+       * gtk/gtkfilesystemwin32.c : implement render_icon
+
+       * gtk/gtk.def gdk/gdk.def : updated externals
+
+       * gdk/win32/gdkdisplay-win32.c : make it compile without
+       <multimon.h> - i.e. even older sdk
+
+       * gdk/win32/gdkevents-win32.c : match resize_timer_proc
+       with TIMERPROC prototype
+
+       * gdk/win32/gdkwindow-win32.c : older msvc does not know
+       BITMAPV5HEADER (from win xp) either
+
+       * gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
+       not defined
+
+       * tests/testfilechooser.c : recent GLib crashes on 
+       g_print ("%s", NULL) so avoid this
+
 2003-12-14  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkselection-win32.c: Calls to OpenClipboard() must be
index b3cec61911918db10af90d1d314b59622b0019f3..9f9963acef3adbe37b602973e148a4d9562607c2 100644 (file)
@@ -1,3 +1,30 @@
+2003-12-14  Hans Breuer  <hans@breuer.org>
+
+       * gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
+       similar as the other filesystem placement 'constants' (dynamic
+       resolving on win32)
+
+       * gtk/gtkfilechooserwidget.c : handle file system to win32
+       renaming here as will
+       * gtk/gtkfilesystemwin32.c : implement render_icon
+
+       * gtk/gtk.def gdk/gdk.def : updated externals
+
+       * gdk/win32/gdkdisplay-win32.c : make it compile without
+       <multimon.h> - i.e. even older sdk
+
+       * gdk/win32/gdkevents-win32.c : match resize_timer_proc
+       with TIMERPROC prototype
+
+       * gdk/win32/gdkwindow-win32.c : older msvc does not know
+       BITMAPV5HEADER (from win xp) either
+
+       * gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
+       not defined
+
+       * tests/testfilechooser.c : recent GLib crashes on 
+       g_print ("%s", NULL) so avoid this
+
 2003-12-14  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkselection-win32.c: Calls to OpenClipboard() must be
index b3cec61911918db10af90d1d314b59622b0019f3..9f9963acef3adbe37b602973e148a4d9562607c2 100644 (file)
@@ -1,3 +1,30 @@
+2003-12-14  Hans Breuer  <hans@breuer.org>
+
+       * gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
+       similar as the other filesystem placement 'constants' (dynamic
+       resolving on win32)
+
+       * gtk/gtkfilechooserwidget.c : handle file system to win32
+       renaming here as will
+       * gtk/gtkfilesystemwin32.c : implement render_icon
+
+       * gtk/gtk.def gdk/gdk.def : updated externals
+
+       * gdk/win32/gdkdisplay-win32.c : make it compile without
+       <multimon.h> - i.e. even older sdk
+
+       * gdk/win32/gdkevents-win32.c : match resize_timer_proc
+       with TIMERPROC prototype
+
+       * gdk/win32/gdkwindow-win32.c : older msvc does not know
+       BITMAPV5HEADER (from win xp) either
+
+       * gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
+       not defined
+
+       * tests/testfilechooser.c : recent GLib crashes on 
+       g_print ("%s", NULL) so avoid this
+
 2003-12-14  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkselection-win32.c: Calls to OpenClipboard() must be
index b3cec61911918db10af90d1d314b59622b0019f3..9f9963acef3adbe37b602973e148a4d9562607c2 100644 (file)
@@ -1,3 +1,30 @@
+2003-12-14  Hans Breuer  <hans@breuer.org>
+
+       * gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
+       similar as the other filesystem placement 'constants' (dynamic
+       resolving on win32)
+
+       * gtk/gtkfilechooserwidget.c : handle file system to win32
+       renaming here as will
+       * gtk/gtkfilesystemwin32.c : implement render_icon
+
+       * gtk/gtk.def gdk/gdk.def : updated externals
+
+       * gdk/win32/gdkdisplay-win32.c : make it compile without
+       <multimon.h> - i.e. even older sdk
+
+       * gdk/win32/gdkevents-win32.c : match resize_timer_proc
+       with TIMERPROC prototype
+
+       * gdk/win32/gdkwindow-win32.c : older msvc does not know
+       BITMAPV5HEADER (from win xp) either
+
+       * gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
+       not defined
+
+       * tests/testfilechooser.c : recent GLib crashes on 
+       g_print ("%s", NULL) so avoid this
+
 2003-12-14  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkselection-win32.c: Calls to OpenClipboard() must be
index 280da60ba1c6f5733f43c6c9956a0b7960e3f8e8..a0739746cb4dd9c27775321b90fe77439e6227da 100644 (file)
@@ -507,6 +507,7 @@ EXPORTS
        gdk_window_reparent
        gdk_window_resize
        gdk_window_scroll
+       gdk_window_set_accept_focus
        gdk_window_set_back_pixmap
        gdk_window_set_background
        gdk_window_set_child_shapes
index 546339d9c264fccc8c7de1f09932575a6006158c..4ae4e5374e3a315369d9e277495d77ebecd1d22c 100644 (file)
 #include "gdk.h"
 #include "gdkprivate-win32.h"
 
-#if defined(_MSC_VER) && (WINVER < 0x500)
+#define HAVE_MONITOR_INFO
+
+#if defined(_MSC_VER) && (WINVER < 0x500) && (WINVER > 0x0400)
 #include <multimon.h>
+#elif (WINVER <= 0x0400)
+#undef HAVE_MONITOR_INFO
 #endif
 
+#ifdef HAVE_MONITOR_INFO
 typedef BOOL (WINAPI *t_EnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM);
 typedef BOOL (WINAPI *t_GetMonitorInfoA)(HMONITOR, LPMONITORINFO);
 
 static t_EnumDisplayMonitors p_EnumDisplayMonitors = NULL;
 static t_GetMonitorInfoA p_GetMonitorInfoA = NULL;
+#endif
 
 void
 _gdk_windowing_set_default_display (GdkDisplay *display)
@@ -37,6 +43,7 @@ _gdk_windowing_set_default_display (GdkDisplay *display)
   g_assert (_gdk_display == display);
 }
 
+#ifdef HVAE_MONITOR_INFO
 static BOOL CALLBACK
 count_monitor (HMONITOR hmonitor,
               HDC      hdc,
@@ -105,6 +112,7 @@ enum_monitor (HMONITOR hmonitor,
 
   return TRUE;
 }
+#endif /* HAVE_MONITOR_INFO */
 
 GdkDisplay *
 gdk_display_open (const gchar *display_name)
@@ -117,6 +125,7 @@ gdk_display_open (const gchar *display_name)
   _gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
   _gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
 
+#ifdef HAVE_MONITOR_INFO
   user32 = GetModuleHandle ("user32.dll");
   g_assert (user32 != NULL);
 
@@ -160,6 +169,7 @@ gdk_display_open (const gchar *display_name)
 #endif
     }
   else
+#endif /* HAVE_MONITOR_INFO */
     {
       RECT rect;
 
index 128c7fcce6d00008011cabd5ddf3ae705166fa0a..4bc9f13fb914977ae2fdca5a4531dd1c3d8dc524 100644 (file)
@@ -155,7 +155,7 @@ static HKL latin_locale = NULL;
 
 static gboolean in_ime_composition = FALSE;
 static gboolean resizing = FALSE;
-static UINT_PTR resize_timer;
+static UINT     resize_timer;
 
 static int debug_indent = 0;
 
@@ -1992,7 +1992,7 @@ handle_stuff_while_moving_or_resizing (void)
 static VOID CALLBACK
 resize_timer_proc (HWND     hwnd,
                   UINT     msg,
-                  UINT_PTR id,
+                  UINT     id,
                   DWORD    time)
 {
   if (resizing)
index 76d66235d85f8bee55c5668bcd67aeea11ac3f07..c45bbce8756ebe8c6dae42afe1b4b4a5574a5aeb 100644 (file)
@@ -35,7 +35,7 @@
 #include "gdkprivate-win32.h"
 #include "gdkinput-win32.h"
 
-#ifdef __MINGW32__
+#if defined __MINGW32__ || (WINVER < 0x0500)
 typedef struct { 
   DWORD        bV5Size; 
   LONG         bV5Width; 
index 24103055d0587b396aea9fc51b1b250b4697836f..1b3874f3470694dea4cf6375ee11bccf0c7e6820 100755 (executable)
@@ -376,6 +376,8 @@ EXPORTS
        gtk_combo_disable_activate
        gtk_combo_get_type
        gtk_combo_new
+       gtk_combo_box_entry_new_with_model
+       gtk_combo_box_new_with_model
        gtk_combo_set_case_sensitive
        gtk_combo_set_item_string
        gtk_combo_set_popdown_strings
@@ -717,7 +719,7 @@ EXPORTS
        gtk_file_info_free
        gtk_file_info_get_display_key
        gtk_file_info_get_display_name
-       gtk_file_info_get_icon_type
+;      gtk_file_info_get_icon_type
        gtk_file_info_get_is_folder
        gtk_file_info_get_is_hidden
        gtk_file_info_get_mime_type
@@ -725,9 +727,9 @@ EXPORTS
        gtk_file_info_get_size
        gtk_file_info_get_type
        gtk_file_info_new
-       gtk_file_info_render_icon
+;      gtk_file_info_render_icon
        gtk_file_info_set_display_name
-       gtk_file_info_set_icon_type
+;      gtk_file_info_set_icon_type
        gtk_file_info_set_is_folder
        gtk_file_info_set_is_hidden
        gtk_file_info_set_mime_type
@@ -760,9 +762,9 @@ EXPORTS
        gtk_file_system_path_to_filename
        gtk_file_system_path_to_uri
        gtk_file_system_remove_bookmark
-       gtk_file_system_unix_get_type
-       gtk_file_system_unix_new
        gtk_file_system_uri_to_path
+       gtk_file_system_win32_get_type
+       gtk_file_system_win32_new
        gtk_fixed_get_has_window
        gtk_fixed_get_type
        gtk_fixed_move
@@ -2055,7 +2057,6 @@ EXPORTS
        gtk_toolbar_set_tooltips
        gtk_toolbar_space_style_get_type
        gtk_toolbar_style_get_type
-       gtk_toolbar_unhighlight_drop_location
        gtk_toolbar_unset_icon_size
        gtk_toolbar_unset_style
        gtk_tooltips_data_get
index caf445cbd7d2f31ca5082e2640a17ed554c7fd5b..9937607adc6e71ce6a08ce5b75d89a4f99be1688 100644 (file)
@@ -23,8 +23,7 @@
 #include "gtkfilechooserutils.h"
 #ifdef G_OS_UNIX
 #include "gtkfilesystemunix.h"
-#endif
-#ifdef G_OS_WIN32
+#else if defined G_OS_WIN32
 #include "gtkfilesystemwin32.h"
 #endif
 #include "gtktypebuiltins.h"
@@ -135,7 +134,13 @@ gtk_file_chooser_widget_constructor (GType                  type,
   gtk_widget_push_composite_child ();
 
   if (!priv->file_system)
-    priv->file_system = gtk_file_system_unix_new ();
+    {
+#if defined G_OS_UNIX
+      priv->file_system = gtk_file_system_unix_new ();
+#else if defined G_OS_WIN32
+      priv->file_system = gtk_file_system_win32_new ();
+#endif
+    }
       
   priv->impl = _gtk_file_chooser_default_new (priv->file_system);
   gtk_box_pack_start (GTK_BOX (object), priv->impl, TRUE, TRUE, 0);
index 787f08b5fae20718ddb6488bf2964c065cb3f499..f233ffeb8a45c98444a7ebcc801788416b9cfb3c 100644 (file)
@@ -22,6 +22,7 @@
 #include "gtkfilesystemwin32.h"
 #include "gtkintl.h"
 #include "gtkstock.h"
+#include "gtkiconfactory.h"
 
 #include <errno.h>
 #include <stdio.h>
 #ifdef G_OS_WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
+#include <shellapi.h> /* ExtractAssociatedIcon */
 #include <direct.h>
 #include <io.h>
 #define mkdir(p,m) _mkdir(p)
+#include <gdk/win32/gdkwin32.h> /* gdk_win32_hdc_get */
 #else
 #error "The implementation is win32 only yet."
 #endif /* G_OS_WIN32 */
@@ -118,6 +121,12 @@ static GtkFilePath *  gtk_file_system_win32_uri_to_path      (GtkFileSystem
                                                              const gchar              *uri);
 static GtkFilePath *  gtk_file_system_win32_filename_to_path (GtkFileSystem            *file_system,
                                                              const gchar              *filename);
+static GdkPixbuf *gtk_file_system_win32_render_icon (GtkFileSystem     *file_system,
+                                                     const GtkFilePath *path,
+                                                     GtkWidget         *widget,
+                                                     gint               pixel_size,
+                                                     GError           **error);
+
 static gboolean       gtk_file_system_win32_add_bookmark     (GtkFileSystem            *file_system,
                                                              const GtkFilePath        *path,
                                                              GError                  **error);
@@ -224,6 +233,7 @@ gtk_file_system_win32_iface_init (GtkFileSystemIface *iface)
   iface->path_to_filename = gtk_file_system_win32_path_to_filename;
   iface->uri_to_path = gtk_file_system_win32_uri_to_path;
   iface->filename_to_path = gtk_file_system_win32_filename_to_path;
+  iface->render_icon = gtk_file_system_win32_render_icon;
   iface->add_bookmark = gtk_file_system_win32_add_bookmark;
   iface->remove_bookmark = gtk_file_system_win32_remove_bookmark;
   iface->list_bookmarks = gtk_file_system_win32_list_bookmarks;
@@ -304,6 +314,7 @@ gtk_file_system_win32_get_root_info (GtkFileSystem    *file_system,
         gtk_file_info_set_display_name (info, filename);
     }
 
+#if 0 /* it's dead in GtkFileSystemUnix.c, too */
   if (GTK_FILE_INFO_ICON & types)
     {
       switch (dt)
@@ -326,6 +337,7 @@ gtk_file_system_win32_get_root_info (GtkFileSystem    *file_system,
           g_assert_not_reached ();
         }
     }
+#endif
   g_free (filename);
   return info;
 }
@@ -633,7 +645,7 @@ bookmarks_serialize (GSList  **bookmarks,
     {
       gchar *contents = NULL;
       gsize  len = 0;
-      GList *entry;
+      GSList *entry;
       FILE  *f;   
        
       if (g_file_test (filename, G_FILE_TEST_EXISTS))
@@ -685,6 +697,168 @@ bookmarks_serialize (GSList  **bookmarks,
   return ok;
 }
 
+static GdkPixbuf*
+extract_icon (const char* filename)
+{
+  GdkPixbuf *pixbuf = NULL;
+  WORD iicon;
+  HICON hicon;
+  
+  if (!filename || !filename[0])
+    return NULL;
+
+  hicon = ExtractAssociatedIcon (GetModuleHandle (NULL), filename, &iicon);
+  if (hicon > (HICON)1)
+    {
+      ICONINFO ii;
+
+      if (GetIconInfo (hicon, &ii))
+        {
+          SIZE   size;
+          GdkPixmap *pixmap;
+          GdkGC *gc;
+          HDC    hdc;
+
+          if (!GetBitmapDimensionEx (ii.hbmColor, &size))
+            g_warning ("GetBitmapDimensionEx failed.");
+
+         if (size.cx < 1) size.cx = 32;
+         if (size.cy < 1) size.cy = 32;
+           
+          pixmap = gdk_pixmap_new (NULL, size.cx, size.cy, 
+                                  gdk_screen_get_system_visual (gdk_screen_get_default ())->depth);
+          gc = gdk_gc_new (pixmap);
+          hdc = gdk_win32_hdc_get (GDK_DRAWABLE (pixmap), gc, 0);
+
+          if (!DrawIcon (hdc, 0, 0, hicon))
+            g_warning ("DrawIcon failed");
+
+          gdk_win32_hdc_release (GDK_DRAWABLE (pixmap), gc, 0);
+
+          pixbuf = gdk_pixbuf_get_from_drawable (
+                    NULL, pixmap, 
+                    gdk_screen_get_system_colormap (gdk_screen_get_default ()),
+                    0, 0, 0, 0, size.cx, size.cy);
+          g_object_unref (pixmap);
+          g_object_unref (gc);
+        }
+      else
+        g_print ("GetIconInfo failed: %s\n", g_win32_error_message (GetLastError ())); 
+
+      if (!DestroyIcon (hicon))
+        g_warning ("DestroyIcon failed");
+    }
+  else
+    g_print ("ExtractAssociatedIcon failed: %s\n", g_win32_error_message (GetLastError ()));
+
+  return pixbuf;
+}
+
+static GtkIconSet *
+win32_pseudo_mime_lookup (const char* name)
+{
+  static GHashTable *mime_hash = NULL;
+  GtkIconSet *is = NULL;
+  char *p = strrchr(name, '.');
+  char *extension = p ? g_ascii_strdown (p, -1) : g_strdup ("");
+
+  if (!mime_hash)
+    mime_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
+  /* do we already have it ? */
+  is = g_hash_table_lookup (mime_hash, extension);
+  if (is)
+    {
+      g_free (extension);
+      return is;
+    }
+  /* create icon and set */
+  {
+    GdkPixbuf *pixbuf = extract_icon (name);
+    if (pixbuf)
+      {
+        GtkIconSource* source = gtk_icon_source_new ();
+
+        is = gtk_icon_set_new_from_pixbuf (pixbuf);
+       gtk_icon_source_set_pixbuf (source, pixbuf);
+       gtk_icon_set_add_source (is, source);
+
+       gtk_icon_source_free (source);
+      }
+
+    g_hash_table_insert (mime_hash, extension, is);
+    return is;
+  }
+}
+
+static GdkPixbuf *
+gtk_file_system_win32_render_icon (GtkFileSystem     *file_system,
+                                   const GtkFilePath *path,
+                                   GtkWidget         *widget,
+                                   gint               pixel_size,
+                                   GError           **error)
+{
+  GtkIconSet *icon_set = NULL;
+  const char* filename = gtk_file_path_get_string (path);
+
+  /* handle drives with stock icons */
+  if (filename_is_root (filename))
+    {
+      gchar *filename2 = g_strconcat(filename, "\\", NULL);
+      DWORD dt = GetDriveType (filename2);
+
+      switch (dt)
+        {
+        case DRIVE_REMOVABLE :
+          icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_FLOPPY);
+          break;
+        case DRIVE_CDROM :
+          icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_CDROM);
+          break;
+        case DRIVE_FIXED : /* need a hard disk icon */
+          icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_CDROM);
+          break;
+        default :
+          break;
+        }
+      g_free (filename2);
+    }
+  else if (g_file_test (filename, G_FILE_TEST_IS_DIR))
+    {
+      if (0 == strcmp (g_get_home_dir(), filename))
+        icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_HOME);
+      else
+        icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_OPEN);
+    }
+  else if (g_file_test (filename, G_FILE_TEST_IS_EXECUTABLE))
+    {
+      /* don't lookup all executable icons */
+      icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_EXECUTE);
+    }
+  else if (g_file_test (filename, G_FILE_TEST_EXISTS))
+    {
+      icon_set = win32_pseudo_mime_lookup (filename);
+    }
+
+  if (!icon_set)
+    {
+       g_set_error (error,
+                 GTK_FILE_SYSTEM_ERROR,
+                 GTK_FILE_SYSTEM_ERROR_FAILED,
+                 _("This file system does not support icons for everything"));
+       return NULL;
+    }
+
+  // FIXME : I'd like to get from pixel_size (=20) back to
+  // icon size, which is an index, but there appears to be no way ?
+  return gtk_icon_set_render_icon (icon_set, 
+                                   widget->style,
+                                   gtk_widget_get_direction (widget),
+                                   GTK_STATE_NORMAL,
+                                   GTK_ICON_SIZE_BUTTON,
+                                  widget, NULL); 
+}
+
 static GSList *_bookmarks = NULL;
 
 static gboolean
@@ -881,7 +1055,9 @@ filename_get_info (const gchar     *filename,
                   GError         **error)
 {
   GtkFileInfo *info;
+#if 0 /* it's dead in GtkFileSystemUnix.c, too */
   GtkFileIconType icon_type = GTK_FILE_ICON_REGULAR;
+#endif
   WIN32_FILE_ATTRIBUTE_DATA wfad;
 
   if (!GetFileAttributesEx (filename, GetFileExInfoStandard, &wfad))
@@ -940,6 +1116,7 @@ filename_get_info (const gchar     *filename,
       gtk_file_info_set_is_folder (info, !!(wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY));
    }
 
+#if 0 /* it's dead in GtkFileSystemUnix.c, too */
   if (types & GTK_FILE_INFO_ICON)
     {
       if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
@@ -947,9 +1124,13 @@ filename_get_info (const gchar     *filename,
 
       gtk_file_info_set_icon_type (info, icon_type);
     }
+#endif
 
-  if ((types & GTK_FILE_INFO_MIME_TYPE) ||
-      ((types & GTK_FILE_INFO_ICON) && icon_type == GTK_FILE_ICON_REGULAR))
+  if ((types & GTK_FILE_INFO_MIME_TYPE)
+#if 0 /* it's dead in GtkFileSystemUnix.c, too */
+      || ((types & GTK_FILE_INFO_ICON) && icon_type == GTK_FILE_ICON_REGULAR)
+#endif
+     )
     {
 #if 0
       const char *mime_type = xdg_mime_get_mime_type_for_file (filename);
index 4af34a0786751ae0da48efafe0f9f717563ac070..c68644332f2ca91c0ade343aec16f9af8dd3b011 100644 (file)
@@ -418,7 +418,11 @@ _gtk_im_module_list (const GtkIMContextInfo ***contexts,
     SIMPLE_ID,
     N_("Default"),
     GETTEXT_PACKAGE,
+#ifdef GTK_LOCALEDIR
     GTK_LOCALEDIR,
+#else
+    "",
+#endif
     ""
   };
 
index 8681457452425100757c459464a35d60aafff3bc..27e8a61f412fea2fd1f7bef0aed9d16c5686719d 100644 (file)
@@ -274,6 +274,17 @@ check_setugid (void)
 
 G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
 
+const gchar *
+_gtk_get_datadir (void)
+{
+  static char *gtk_datadir = NULL;
+  if (gtk_datadir == NULL)
+    gtk_datadir = g_win32_get_package_installation_subdirectory
+      (GETTEXT_PACKAGE, dll_name, "share");
+
+  return gtk_datadir;
+}
+
 const gchar *
 _gtk_get_libdir (void)
 {
index c42c26f05c58ebf45d683a7ce5d8a8611797cd2e..6d043809fa9282d8fab63b2e81e03817852b040a 100644 (file)
@@ -80,11 +80,14 @@ typedef enum
 
 #ifdef G_OS_WIN32
 
+const gchar *_gtk_get_datadir ();
 const gchar *_gtk_get_libdir ();
 const gchar *_gtk_get_sysconfdir ();
 const gchar *_gtk_get_localedir ();
 const gchar *_gtk_get_data_prefix ();
 
+#undef GTK_DATADIR
+#define GTK_DATADIR _gtk_get_datadir ()
 #undef GTK_LIBDIR
 #define GTK_LIBDIR _gtk_get_libdir ()
 #undef GTK_LOCALEDIR
index 193bba2d8f0b06f925160f524267cdc0922b05da..16ee76447ed8241fb8b8462f54b2d396d1823caf 100644 (file)
@@ -32,7 +32,7 @@ print_current_folder (GtkFileChooser *chooser)
   gchar *uri;
 
   uri = gtk_file_chooser_get_current_folder_uri (chooser);
-  g_print ("Current folder changed :\n  %s\n", uri);
+  g_print ("Current folder changed :\n  %s\n", uri ? uri : "(null)");
   g_free (uri);
 }