plug-ins/Lighting/images/Makefile.am plug-ins/gfig/images/Makefile.am

2005-04-20  Sven Neumann  <sven@gimp.org>

	* plug-ins/Lighting/images/Makefile.am
	* plug-ins/gfig/images/Makefile.am
	* plug-ins/gimpressionist/Makefile.am
	* plug-ins/imagemap/images/Makefile.am
	* plug-ins/pagecurl/Makefile.am
	* plug-ins/rcm/images/Makefile.am: use $(GDK_PIXBUF_CSOURCE) as
	defined by the configure script.

	* plug-ins/helpbrowser/Makefile.am
	* plug-ins/helpbrowser/wilber-reading.png: added icon.

	* plug-ins/helpbrowser/gimpthrobber.[ch]: added API to set an image
	to be used instead of the stock-id.

	* plug-ins/helpbrowser/dialog.c: use the Reading Wilber icon for
	the throbber and as window icon.
This commit is contained in:
Sven Neumann 2005-04-20 20:19:14 +00:00 committed by Sven Neumann
parent 92f1be2b16
commit ba09519000
13 changed files with 150 additions and 33 deletions

View File

@ -1,3 +1,22 @@
2005-04-20 Sven Neumann <sven@gimp.org>
* plug-ins/Lighting/images/Makefile.am
* plug-ins/gfig/images/Makefile.am
* plug-ins/gimpressionist/Makefile.am
* plug-ins/imagemap/images/Makefile.am
* plug-ins/pagecurl/Makefile.am
* plug-ins/rcm/images/Makefile.am: use $(GDK_PIXBUF_CSOURCE) as
defined by the configure script.
* plug-ins/helpbrowser/Makefile.am
* plug-ins/helpbrowser/wilber-reading.png: added icon.
* plug-ins/helpbrowser/gimpthrobber.[ch]: added API to set an image
to be used instead of the stock-id.
* plug-ins/helpbrowser/dialog.c: use the Reading Wilber icon for
the throbber and as window icon.
2005-04-20 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpstock.c

View File

@ -26,4 +26,4 @@ stock-icons.list: $(STOCK_IMAGES) Makefile.am
done )
$(srcdir)/stock-pixbufs.h: stock-icons.list
gdk-pixbuf-csource --raw --build-list `cat stock-icons.list` > $(@F)
$(GDK_PIXBUF_CSOURCE) --raw --build-list `cat stock-icons.list` > $(@F)

View File

@ -32,4 +32,4 @@ stock-icons.list: $(STOCK_IMAGES) Makefile.am
done )
$(srcdir)/gfig-stock-pixbufs.h: stock-icons.list
gdk-pixbuf-csource --raw --build-list `cat stock-icons.list` > $(@F)
$(GDK_PIXBUF_CSOURCE) --raw --build-list `cat stock-icons.list` > $(@F)

View File

@ -83,7 +83,7 @@ LDADD = \
$(srcdir)/logo-pixbuf.h: logo.png
gdk-pixbuf-csource --raw --name=logo_data $< > $(@F)
$(GDK_PIXBUF_CSOURCE) --raw --name=logo_data $< > $(@F)
EXTRA_DIST = \
README \

View File

@ -4,4 +4,4 @@ Makefile
_libs
.libs
helpbrowser
.xvpics
logo-pixbuf.h

View File

@ -12,19 +12,6 @@ libexecdir = $(gimpplugindir)/plug-ins
libexec_PROGRAMS = helpbrowser
helpbrowser_SOURCES = \
gimpthrobber.c \
gimpthrobber.h \
gimpthrobberaction.c \
gimpthrobberaction.h \
helpbrowser.c \
dialog.c \
dialog.h \
queue.c \
queue.h \
uri.c \
uri.h
INCLUDES = \
-I$(top_srcdir) \
$(GTKHTML2_CFLAGS) \
@ -41,3 +28,30 @@ LDADD = \
$(GTKHTML2_LIBS) \
$(RT_LIBS) \
$(INTLLIBS)
helpbrowser_sources = \
gimpthrobber.c \
gimpthrobber.h \
gimpthrobberaction.c \
gimpthrobberaction.h \
helpbrowser.c \
dialog.c \
dialog.h \
queue.c \
queue.h \
uri.c \
uri.h
helpbrowser_built_sources = logo-pixbuf.h
dialog.c: $(helpbrowser_built_sources)
helpbrowser_SOURCES = \
$(helpbrowser_built_sources) $(helpbrowser_sources)
$(srcdir)/logo-pixbuf.h: wilber-reading.png
$(GDK_PIXBUF_CSOURCE) --raw --name=logo_data $< > $(@F)
EXTRA_DIST = wilber-reading.png
CLEANFILES = logo-pixbuf.h

View File

@ -52,6 +52,8 @@
#include "queue.h"
#include "uri.h"
#include "logo-pixbuf.h"
#include "libgimp/stdplugins-intl.h"
@ -160,10 +162,12 @@ browser_dialog_open (void)
GtkWidget *drag_source;
GtkWidget *image;
GtkWidget *combo;
GtkWidget *button;
GtkToolItem *item;
GtkAction *action;
GtkListStore *history;
GtkCellRenderer *cell;
GdkPixbuf *pixbuf;
gchar *eek_png_path;
gimp_ui_init ("helpbrowser", TRUE);
@ -188,6 +192,10 @@ browser_dialog_open (void)
G_CALLBACK (gtk_main_quit),
NULL);
pixbuf = gdk_pixbuf_new_from_inline (-1, logo_data, FALSE, NULL);
gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
g_object_unref (pixbuf);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show (vbox);
@ -224,6 +232,11 @@ browser_dialog_open (void)
gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (item), FALSE);
gtk_tool_item_set_expand (item, TRUE);
button = gtk_ui_manager_get_widget (ui_manager,
"/help-browser-toolbar/online");
gimp_throbber_set_image (GIMP_THROBBER (button),
gtk_image_new_from_pixbuf (pixbuf));
hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);

View File

@ -35,7 +35,8 @@ enum
enum
{
PROP_0,
PROP_STOCK_ID
PROP_STOCK_ID,
PROP_IMAGE
};
@ -71,6 +72,7 @@ static guint toolbutton_signals[LAST_SIGNAL] = { 0 };
struct _GimpThrobberPrivate
{
GtkWidget *button;
GtkWidget *image;
gchar *stock_id;
};
@ -121,6 +123,13 @@ gimp_throbber_class_init (GimpThrobberClass *klass)
PROP_STOCK_ID,
g_param_spec_string ("stock-id", NULL, NULL,
NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
PROP_IMAGE,
g_param_spec_object ("image", NULL, NULL,
GTK_TYPE_IMAGE,
G_PARAM_READWRITE));
toolbutton_signals[CLICKED] =
@ -160,24 +169,31 @@ gimp_throbber_init (GimpThrobber *button)
static void
gimp_throbber_construct_contents (GtkToolItem *tool_item)
{
GimpThrobber *button = GIMP_THROBBER (tool_item);
GtkWidget *image;
GtkToolbarStyle style;
GtkIconSize icon_size;
GimpThrobber *button = GIMP_THROBBER (tool_item);
GtkWidget *image;
if (button->priv->image && button->priv->image->parent)
gtk_container_remove (GTK_CONTAINER (button->priv->image->parent),
button->priv->image);
if (GTK_BIN (button->priv->button)->child)
gtk_widget_destroy (GTK_BIN (button->priv->button)->child);
style = gtk_tool_item_get_toolbar_style (tool_item);
icon_size = gtk_tool_item_get_icon_size (tool_item);
if (style == GTK_TOOLBAR_TEXT)
icon_size = GTK_ICON_SIZE_MENU;
if (gtk_tool_item_get_toolbar_style (tool_item) == GTK_TOOLBAR_TEXT)
{
image = gtk_image_new_from_stock (button->priv->stock_id,
GTK_ICON_SIZE_MENU);
}
else if (button->priv->image)
{
image = button->priv->image;
}
else
icon_size = MIN (icon_size + 1, GTK_ICON_SIZE_BUTTON);
{
image = gtk_image_new_from_stock (button->priv->stock_id,
GTK_ICON_SIZE_BUTTON);
}
image = gtk_image_new_from_stock (button->priv->stock_id, icon_size);
gtk_container_add (GTK_CONTAINER (button->priv->button), image);
gtk_widget_show (image);
@ -201,6 +217,10 @@ gimp_throbber_set_property (GObject *object,
gimp_throbber_set_stock_id (button, g_value_get_string (value));
break;
case PROP_IMAGE:
gimp_throbber_set_image (button, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -221,6 +241,10 @@ gimp_throbber_get_property (GObject *object,
g_value_set_string (value, button->priv->stock_id);
break;
case PROP_IMAGE:
g_value_set_object (value, button->priv->image);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -235,6 +259,9 @@ gimp_throbber_finalize (GObject *object)
if (button->priv->stock_id)
g_free (button->priv->stock_id);
if (button->priv->image)
g_object_unref (button->priv->image);
parent_class->finalize (object);
}
@ -292,3 +319,43 @@ gimp_throbber_get_stock_id (GimpThrobber *button)
return button->priv->stock_id;
}
void
gimp_throbber_set_image (GimpThrobber *button,
GtkWidget *image)
{
g_return_if_fail (GIMP_IS_THROBBER (button));
g_return_if_fail (image == NULL || GTK_IS_IMAGE (image));
if (image != button->priv->image)
{
if (button->priv->image)
{
if (button->priv->image->parent)
gtk_container_remove (GTK_CONTAINER (button->priv->image->parent),
button->priv->image);
g_object_unref (button->priv->image);
}
if (image)
{
g_object_ref (image);
gtk_object_sink (GTK_OBJECT (image));
}
button->priv->image = image;
gimp_throbber_construct_contents (GTK_TOOL_ITEM (button));
g_object_notify (G_OBJECT (button), "image");
}
}
GtkWidget *
gimp_throbber_get_image (GimpThrobber *button)
{
g_return_val_if_fail (GIMP_IS_THROBBER (button), NULL);
return button->priv->image;
}

View File

@ -24,6 +24,7 @@
G_BEGIN_DECLS
#define GIMP_TYPE_THROBBER (gimp_throbber_get_type ())
#define GIMP_THROBBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_THROBBER, GimpThrobber))
#define GIMP_THROBBER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_THROBBER, GimpThrobberClass))
@ -58,6 +59,9 @@ GtkToolItem * gimp_throbber_new (const gchar *stock_id);
void gimp_throbber_set_stock_id (GimpThrobber *button,
const gchar *stock_id);
const gchar * gimp_throbber_get_stock_id (GimpThrobber *button);
void gimp_throbber_set_image (GimpThrobber *button,
GtkWidget *image);
GtkWidget * gimp_throbber_get_image (GimpThrobber *button);
G_END_DECLS

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -25,4 +25,4 @@ stock-icons.list: $(STOCK_IMAGES) Makefile.am
done )
$(srcdir)/imap-stock-pixbufs.h: stock-icons.list
gdk-pixbuf-csource --raw --build-list `cat stock-icons.list` > $(@F)
$(GDK_PIXBUF_CSOURCE) --raw --build-list `cat stock-icons.list` > $(@F)

View File

@ -68,4 +68,4 @@ pagecurl-icons.list: $(PAGECURL_IMAGES) Makefile.am
done )
$(srcdir)/pagecurl-icons.h: pagecurl-icons.list
gdk-pixbuf-csource --raw --build-list `cat pagecurl-icons.list` > $(@F)
$(GDK_PIXBUF_CSOURCE) --raw --build-list `cat pagecurl-icons.list` > $(@F)

View File

@ -20,4 +20,4 @@ stock-icons.list: $(STOCK_IMAGES) Makefile.am
done )
$(srcdir)/rcm-stock-pixbufs.h: stock-icons.list
gdk-pixbuf-csource --raw --build-list `cat stock-icons.list` > $(@F)
$(GDK_PIXBUF_CSOURCE) --raw --build-list `cat stock-icons.list` > $(@F)