]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/artgtk.cpp
Fix broken and missing DataView interface items for Phoenix
[wxWidgets.git] / src / gtk / artgtk.cpp
index 99142b5f156fb3941769eaf414b4b85d6103f00a..533eab7619b48397da450e7ec4524402016da4ea 100644 (file)
@@ -21,6 +21,8 @@
 #endif
 
 #include "wx/artprov.h"
 #endif
 
 #include "wx/artprov.h"
+
+#include <gtk/gtk.h>
 #include "wx/gtk/private.h"
 
 // compatibility with older GTK+ versions:
 #include "wx/gtk/private.h"
 
 // compatibility with older GTK+ versions:
@@ -47,7 +49,7 @@ protected:
 
 /*static*/ void wxArtProvider::InitNativeProvider()
 {
 
 /*static*/ void wxArtProvider::InitNativeProvider()
 {
-    Push(new wxGTK2ArtProvider);
+    PushBack(new wxGTK2ArtProvider);
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -203,7 +205,7 @@ GdkPixbuf *CreateStockIcon(const char *stockid, GtkIconSize size)
     //        with "stock-id" representation (in addition to pixmap and pixbuf
     //        ones) and would convert it to pixbuf when rendered.
 
     //        with "stock-id" representation (in addition to pixmap and pixbuf
     //        ones) and would convert it to pixbuf when rendered.
 
-    GtkStyle* style = wxGTKPrivate::GetButtonWidget()->style;
+    GtkStyle* style = gtk_widget_get_style(wxGTKPrivate::GetButtonWidget());
     GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid);
 
     if (!iconset)
     GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid);
 
     if (!iconset)
@@ -259,7 +261,7 @@ wxIconBundle DoCreateIconBundle(const char *stockid,
             continue;
 
         wxIcon icon;
             continue;
 
         wxIcon icon;
-        icon.SetPixbuf(pixbuf);
+        icon.CopyFromBitmap(wxBitmap(pixbuf));
         bundle.AddIcon(icon);
     }
 
         bundle.AddIcon(icon);
     }
 
@@ -296,28 +298,25 @@ wxBitmap wxGTK2ArtProvider::CreateBitmap(const wxArtID& id,
         }
     }
 
         }
     }
 
-    wxBitmap bmp;
-    if (pixbuf != NULL)
-        bmp.SetPixbuf(pixbuf);
-
-    return bmp;
+    return wxBitmap(pixbuf);
 }
 
 wxIconBundle
 wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
                                     const wxArtClient& WXUNUSED(client))
 {
 }
 
 wxIconBundle
 wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
                                     const wxArtClient& WXUNUSED(client))
 {
+    wxIconBundle bundle;
     const wxString stockid = wxArtIDToStock(id);
 
     // try to load the bundle as stock icon first
     const wxString stockid = wxArtIDToStock(id);
 
     // try to load the bundle as stock icon first
-    GtkStyle* style = wxGTKPrivate::GetButtonWidget()->style;
+    GtkStyle* style = gtk_widget_get_style(wxGTKPrivate::GetButtonWidget());
     GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid.utf8_str());
     if ( iconset )
     {
         GtkIconSize *sizes;
         gint n_sizes;
         gtk_icon_set_get_sizes(iconset, &sizes, &n_sizes);
     GtkIconSet* iconset = gtk_style_lookup_icon_set(style, stockid.utf8_str());
     if ( iconset )
     {
         GtkIconSize *sizes;
         gint n_sizes;
         gtk_icon_set_get_sizes(iconset, &sizes, &n_sizes);
-        wxIconBundle bundle = DoCreateIconBundle
+        bundle = DoCreateIconBundle
                               (
                                   stockid.utf8_str(),
                                   sizes, sizes + n_sizes,
                               (
                                   stockid.utf8_str(),
                                   sizes, sizes + n_sizes,
@@ -328,33 +327,27 @@ wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
     }
 
     // otherwise try icon themes
     }
 
     // otherwise try icon themes
-#ifdef __WXGTK26__
-    if ( !gtk_check_version(2,6,0) )
-    {
-        gint *sizes = gtk_icon_theme_get_icon_sizes
-                      (
-                          gtk_icon_theme_get_default(),
-                          stockid.utf8_str()
-                      );
-        if ( !sizes )
-            return wxNullIconBundle;
-
-        gint *last = sizes;
-        while ( *last )
-            last++;
-
-        wxIconBundle bundle = DoCreateIconBundle
-                              (
-                                  stockid.utf8_str(),
-                                  sizes, last,
-                                  &CreateThemeIcon
-                              );
-        g_free(sizes);
+    gint *sizes = gtk_icon_theme_get_icon_sizes
+                  (
+                      gtk_icon_theme_get_default(),
+                      stockid.utf8_str()
+                  );
+    if ( !sizes )
         return bundle;
         return bundle;
-    }
-#endif // __WXGTK26__
 
 
-    return wxNullIconBundle;
+    gint *last = sizes;
+    while ( *last )
+        last++;
+
+    bundle = DoCreateIconBundle
+                          (
+                              stockid.utf8_str(),
+                              sizes, last,
+                              &CreateThemeIcon
+                          );
+    g_free(sizes);
+
+    return bundle;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------