]> Pileus Git - ~andy/gtk/blobdiff - gtk/tests/defaultvalue.c
treeview: fix a critical warning
[~andy/gtk] / gtk / tests / defaultvalue.c
index a3534b176da852c17cdf95f5b8841af730572a39..ce1ad3b613b371858fb69006f98c75d89ce83c53 100644 (file)
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#undef GTK_DISABLE_DEPRECATED
-#define GTK_ENABLE_BROKEN
 #include <string.h>
 #include <gtk/gtk.h>
 #include <gtk/gtkunixprint.h>
@@ -29,7 +25,7 @@ check_property (const char *output,
                GParamSpec *pspec,
                GValue *value)
 {
-  GValue default_value = { 0, };
+  GValue default_value = G_VALUE_INIT;
   char *v, *dv, *msg;
 
   if (g_param_value_defaults (pspec, value))
@@ -77,27 +73,15 @@ test_type (gconstpointer data)
 
   /* These can't be freely constructed/destroyed */
   if (g_type_is_a (type, GTK_TYPE_PRINT_JOB) ||
+      g_type_is_a (type, GTK_TYPE_APPLICATION) ||
       g_type_is_a (type, GDK_TYPE_PIXBUF_LOADER) ||
       g_type_is_a (type, gdk_pixbuf_simple_anim_iter_get_type ()))
     return;
 
-  /* The gtk_arg compat wrappers can't set up default values */
-  if (g_type_is_a (type, GTK_TYPE_CLIST) ||
-      g_type_is_a (type, GTK_TYPE_CTREE) ||
-      g_type_is_a (type, GTK_TYPE_LIST) ||
-      g_type_is_a (type, GTK_TYPE_TIPS_QUERY)) 
-    return;
-
   klass = g_type_class_ref (type);
   
   if (g_type_is_a (type, GTK_TYPE_SETTINGS))
     instance = g_object_ref (gtk_settings_get_default ());
-  else if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER))
-    instance = g_object_ref (gdk_pango_renderer_get_default (gdk_screen_get_default ()));
-  else if (g_type_is_a (type, GDK_TYPE_PIXMAP))
-    instance = g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1));
-  else if (g_type_is_a (type, GDK_TYPE_COLORMAP))
-    instance = g_object_ref (gdk_colormap_new (gdk_visual_get_best (), TRUE));
   else if (g_type_is_a (type, GDK_TYPE_WINDOW))
     {
       GdkWindowAttr attributes;
@@ -117,7 +101,7 @@ test_type (gconstpointer data)
   for (i = 0; i < n_pspecs; ++i)
     {
       GParamSpec *pspec = pspecs[i];
-      GValue value = { 0, };
+      GValue value = G_VALUE_INIT;
       
       if (pspec->owner_type != type)
        continue;
@@ -129,10 +113,6 @@ test_type (gconstpointer data)
          (strcmp (pspec->name, "default-display") == 0))
        continue;
 
-      if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER) &&
-         (strcmp (pspec->name, "screen") == 0))
-       continue;
-
       if (g_type_is_a (type, GTK_TYPE_ABOUT_DIALOG) &&
          (strcmp (pspec->name, "program-name") == 0))
        continue;
@@ -177,11 +157,6 @@ test_type (gconstpointer data)
            strcmp (pspec->name, "buffer") == 0))
        continue;
 
-      /* Gets set to the cwd */
-      if (g_type_is_a (type, GTK_TYPE_FILE_SELECTION) &&
-         strcmp (pspec->name, "filename") == 0)
-       continue;
-
       if (g_type_is_a (type, GTK_TYPE_FONT_SELECTION) &&
          strcmp (pspec->name, "font") == 0)
        continue;
@@ -192,7 +167,12 @@ test_type (gconstpointer data)
        continue;
 
       if (g_type_is_a (type, GTK_TYPE_MESSAGE_DIALOG) &&
-         strcmp (pspec->name, "image") == 0)
+          (strcmp (pspec->name, "image") == 0 ||
+           strcmp (pspec->name, "message-area") == 0))
+       continue;
+
+      if (g_type_is_a (type, GTK_TYPE_PANED) &&
+         strcmp (pspec->name, "max-position") == 0)
        continue;
 
       if (g_type_is_a (type, GTK_TYPE_PRINT_OPERATION) &&
@@ -269,15 +249,14 @@ test_type (gconstpointer data)
           strcmp (pspec->name, "font-desc") == 0))
         continue;
 
-      if (g_type_is_a (type, GTK_TYPE_TEXT) &&
-         (strcmp (pspec->name, "hadjustment") == 0 ||
-           strcmp (pspec->name, "vadjustment") == 0))
-        continue;
-
       if (g_type_is_a (type, GTK_TYPE_TEXT_VIEW) &&
           strcmp (pspec->name, "buffer") == 0)
         continue;
 
+      if (g_type_is_a (type, GTK_TYPE_TOOL_ITEM_GROUP) &&
+          strcmp (pspec->name, "label-widget") == 0)
+        continue;
+
       if (g_type_is_a (type, GTK_TYPE_TREE_VIEW) &&
          (strcmp (pspec->name, "hadjustment") == 0 ||
            strcmp (pspec->name, "vadjustment") == 0))
@@ -294,6 +273,11 @@ test_type (gconstpointer data)
           strcmp (pspec->name, "style") == 0))
        continue;
 
+      /* resize-grip-visible is determined at runtime */
+      if (g_type_is_a (type, GTK_TYPE_WINDOW) &&
+          (strcmp (pspec->name, "resize-grip-visible") == 0))
+        continue;
+
       if (g_test_verbose ())
       g_print ("Property %s.%s\n", 
             g_type_name (pspec->owner_type),
@@ -312,7 +296,7 @@ test_type (gconstpointer data)
       for (i = 0; i < n_pspecs; ++i)
        {
          GParamSpec *pspec = pspecs[i];
-         GValue value = { 0, };
+         GValue value = G_VALUE_INIT;
          
          if (pspec->owner_type != type)
            continue;
@@ -337,8 +321,6 @@ test_type (gconstpointer data)
   g_type_class_unref (klass);
 }
 
-extern void pixbuf_init (void);
-
 int
 main (int argc, char **argv)
 {
@@ -346,7 +328,6 @@ main (int argc, char **argv)
   guint i;
 
   gtk_test_init (&argc, &argv);
-  pixbuf_init ();
   gtk_test_register_all_types();
   
   otypes = gtk_test_list_all_types (NULL);