]> Pileus Git - ~andy/gtk/commitdiff
Fix copyrights
authorHavoc Pennington <hp@redhat.com>
Wed, 4 Oct 2000 16:39:44 +0000 (16:39 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Wed, 4 Oct 2000 16:39:44 +0000 (16:39 +0000)
2000-10-04  Havoc Pennington  <hp@redhat.com>

* gtk/gtkstock.h, gtk/gtkstock.c, gtk/gtkiconfactory.h,
gtk/gtkiconfactory.c: Fix copyrights

* demos/testpixbuf.c: add inline pixbuf test

demos/Makefile.am
demos/testpixbuf.c
docs/reference/ChangeLog
docs/reference/gtk/tmpl/gtkrc.sgml
gtk/gtkiconfactory.c
gtk/gtkiconfactory.h
gtk/gtkstock.c
gtk/gtkstock.h

index eefb30f09ef879f2e9df8a8b3bd0d89316050edd..13d3b26367dd9572bd3a6e9c3e0fa84eca857ee3 100644 (file)
@@ -37,6 +37,11 @@ noinst_PROGRAMS =            \
        testpixbuf-scale        \
        pixbuf-demo
 
+BUILT_SOURCES=test-inline-pixbufs.h
+
+test-inline-pixbufs.h: $(top_builddir)/gdk-pixbuf/make-inline-pixbuf apple-red.png gnome-foot.png
+       GDK_PIXBUF_MODULEDIR=$(top_builddir)/gdk-pixbuf/.libs $(top_builddir)/gdk-pixbuf/make-inline-pixbuf test-inline-pixbufs.h apple_red apple-red.png gnome_foot gnome-foot.png 
+
 testpixbuf_DEPENDENCIES = $(DEPS)
 testpixbuf_drawable_DEPENDENCIES = $(DEPS)
 testpixbuf_scale_DEPENDENCIES = $(DEPS)
index fe96bd390135d16ff47704b34dee2d339a5712b1..c6d5a45c54a3489058edd6654099e9cea2826dbb 100644 (file)
@@ -25,6 +25,8 @@
 #include <gtk/gtk.h>
 #include <gtk/gdk-pixbuf-loader.h>
 
+#include "test-inline-pixbufs.h"
+
 typedef struct {
        FILE             *imagefile;
        GdkPixbufLoader  *loader;
@@ -375,7 +377,7 @@ new_testrgb_window (GdkPixbuf *pixbuf, gchar *title)
        window = gtk_widget_new (gtk_window_get_type (),
                                 "GtkObject::user_data", NULL,
                                 "GtkWindow::type", GTK_WINDOW_TOPLEVEL,
-                                "GtkWindow::title", "testrgb",
+                                "GtkWindow::title", title ? title : "testrgb",
                                 "GtkWindow::allow_shrink", TRUE,
                                 NULL);
        gtk_signal_connect (GTK_OBJECT (window), "destroy",
@@ -535,6 +537,13 @@ main (int argc, char **argv)
                         new_testrgb_window (pixbuf, NULL);
                         ++xpmp;
                 }
+
+                /* Test loading from inline data. */
+                pixbuf = gdk_pixbuf_new_from_inline (apple_red, FALSE, -1);
+                new_testrgb_window (pixbuf, "Red apple from inline data");
+
+                pixbuf = gdk_pixbuf_new_from_inline (gnome_foot, TRUE, sizeof (gnome_foot));
+                new_testrgb_window (pixbuf, "Foot from inline data");
                 
                found_valid = TRUE;
        } else {
index 8e2332f8f25ae0fa05c94aa3eeba9c0f2c7ecb9d..7021e4b4f6f97b44cf3d1d05f23cb8c1f40c3979 100644 (file)
@@ -1,3 +1,7 @@
+2000-09-26  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/tmpl/gtkrc.sgml: Document stock icon stuff
+
 Thu Sep  7 14:15:03 2000  Owen Taylor  <otaylor@redhat.com>
 
         * gdk/* gtk/*: Move gtk-reference files into GTK+ tree proper.
index df392bf6f1b21590e122c44ddf1c1cf7600d3acd..08a457665b4a68e365b82077937d3a8cd2187250 100644 (file)
@@ -265,6 +265,14 @@ elements are:
        </para>
      </listitem>
   </varlistentry>
+  <varlistentry>
+    <term><literal>stock[<replaceable>"stock-id"</replaceable>]</literal> = { <replaceable>icon source specifications</replaceable> }</literal></term>
+     <listitem>
+       <para>
+        Defines the icon for a stock item.
+       </para>
+     </listitem>
+  </varlistentry>
 </variablelist>
 </para>
 <para>
@@ -335,6 +343,70 @@ hex digits, or they can be specified as a triplet of floats
 <literal>{ <replaceable>r</replaceable>, <replaceable>g</replaceable>,
 <replaceable>b</replaceable>}</literal>.
 </para>
+
+<para>
+In a <literal>stock</literal> definition, icon sources are specified as a
+4-tuple of image filename, text direction, widget state, and size, in that
+order.  Each icon source specifies an image filename to use with a given
+direction, state, and size. The <literal>*</literal> character can be used as a
+wildcard, and if direction/state/size are omitted they default to
+<literal>*</literal>. So for example, the following specifies different icons to
+use for left-to-right and right-to-left languages:
+<programlisting>
+stock["my-stock-item"] = 
+{
+  { "itemltr.png", LTR, *, * },
+  { "itemrtl.png", RTL, *, * }
+}
+</programlisting>
+This could be abbreviated as follows:
+<programlisting>
+stock["my-stock-item"] = 
+{
+  { "itemltr.png", LTR },
+  { "itemrtl.png", RTL }
+}
+</programlisting>
+</para>
+
+<para>
+You can specify custom icons for specific sizes, as follows:
+<programlisting>
+stock["my-stock-item"] = 
+{
+  { "itemmenusize.png", *, *, "gtk-menu" },
+  { "itemtoolbarsize.png", *, *, "gtk-large-toolbar" }
+  { "itemgeneric.png" } /* implicit *, *, * as a fallback */
+}
+</programlisting>
+The sizes that come with GTK+ itself are <literal>"gtk-menu"</literal>,
+<literal>"gtk-small-toolbar"</literal>, <literal>"gtk-large-toolbar"</literal>,
+<literal>"gtk-button"</literal>, <literal>"gtk-dialog"</literal>. Applications
+can define other sizes.
+</para>
+
+<para>
+It's also possible to use custom icons for a given state, for example:
+You can specify custom icons for specific sizes, as follows:
+<programlisting>
+stock["my-stock-item"] = 
+{
+  { "itemprelight.png", *, PRELIGHT },
+  { "iteminsensitive.png", *, INSENSITIVE }, 
+  { "itemgeneric.png" } /* implicit *, *, * as a fallback */
+}
+</programlisting>
+</para>
+
+<para>
+When selecting an icon source to use, GTK+ will consider text direction most
+important, state second, and size third. It will select the best match based on
+those criteria. If an attribute matches exactly (e.g. you specified
+<literal>PRELIGHT</literal> or specified the size), GTK+ won't modify the image;
+if the attribute matches with a wildcard, GTK+ will scale or modify the image to
+match the state and size the user requested.
+</para>
+
 </refsect2>
 
 <refsect2><title>Key bindings</title>
index a7de61d2c32cd53a7f7614cfd2872c7837f61aba..249568ce5008969c9d9ef93f0a4ee30091940b58 100644 (file)
@@ -1,5 +1,5 @@
 /* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ * Copyright (C) 2000 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
index 357e37eb7ccfbc348d146a019a43d933031448cb..23f605986566815366905d9e53220b2d2c6accf9 100644 (file)
@@ -1,5 +1,5 @@
 /* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ * Copyright (C) 2000 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
index ecb30797365f0f1f88df046e73177a3ad6f254f1..64700232aa22b1414a221f276685589aaa3443be 100644 (file)
@@ -1,5 +1,5 @@
 /* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ * Copyright (C) 2000 Red Hat, Inc. 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
index 02b51ff97915c751e681569ead9ff57f61949616..a11fa951548194909845e6b1b084d80e881597cb 100644 (file)
@@ -1,5 +1,5 @@
 /* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ * Copyright (C) 2000 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public