changeset 10297:ec140184437b

[gaim-migrate @ 11480] "After applying this patch, which modifies the make files and makes the @file/@ingroup markers at the top of several gtk files more uniform, the following files should be renamed: dnd-hints.h -> gtkdnd-hints.h dnd-hints.c -> gtkdnd-hints.c gaim-disclosure.h -> gtkgaim-disclosure.h gaim-disclosure.c -> gtkgaim-disclosure.c stock.h -> gtkstock.h stock.c -> gtkstock.c I believe that completes the renaming of files which are explicitly for gtkgaim; all files in /gaim/src which depend upon gtk should now have gtk in their name. There are two candidates which might be considered part of gtkgaim rather than part of the core, but I didn't modify them: session.c and log.c. Both are quite gaim-UI specific, it seems, particularly session, but perhaps other UIs could also make use of their functionality. -Evan " committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 02 Dec 2004 20:34:19 +0000
parents a7b2fd5efcf2
children 02b95a0b88e2
files plugins/docklet/docklet-x11.c plugins/docklet/docklet.c src/Makefile.am src/Makefile.mingw src/dnd-hints.c src/dnd-hints.h src/gaim-disclosure.c src/gaim-disclosure.h src/gtkaccount.c src/gtkblist.c src/gtkcellrendererprogress.c src/gtkconn.c src/gtkconv.c src/gtkdebug.c src/gtkdialogs.c src/gtkgaim-disclosure.c src/gtkgaim-disclosure.h src/gtkimhtml.c src/gtkimhtmltoolbar.c src/gtknotify.c src/gtkpluginpref.c src/gtkprefs.c src/gtkrequest.c src/gtksound.c src/gtksourceiter.c src/gtkstatusselector.c src/gtkstock.c src/gtkstock.h src/main.c src/stock.c src/stock.h
diffstat 31 files changed, 754 insertions(+), 1000 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/docklet/docklet-x11.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/plugins/docklet/docklet-x11.c	Thu Dec 02 20:34:19 2004 +0000
@@ -25,7 +25,7 @@
 #include "internal.h"
 #include "gtkgaim.h"
 #include "debug.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 #include "gaim.h"
 #include "gtkdialogs.h"
--- a/plugins/docklet/docklet.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/plugins/docklet/docklet.c	Thu Dec 02 20:34:19 2004 +0000
@@ -47,7 +47,7 @@
 #include "gtkprefs.h"
 #include "gtksound.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 #include "docklet.h"
 
 #include "gaim.h"
--- a/src/Makefile.am	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/Makefile.am	Thu Dec 02 20:34:19 2004 +0000
@@ -143,8 +143,6 @@
 
 gaim_SOURCES = \
 	$(gaim_coresources) \
-	dnd-hints.c \
-	gaim-disclosure.c \
 	gtkaccount.c \
 	gtkcellrendererprogress.c \
 	gtkblist.c \
@@ -152,6 +150,8 @@
 	gtkconv.c \
 	gtkdebug.c \
 	gtkdialogs.c \
+	gtkdnd-hints.c \
+	gtkgaim-disclosure.c \
 	gtkeventloop.c \
 	gtkft.c \
 	gtkimhtml.c \
@@ -168,18 +168,16 @@
 	gtksound.c \
 	gtksourceiter.c \
 	gtkstatusselector.c \
+	gtkstock.c \
 	gtkthemes.c \
 	gtkutils.c \
 	idle.c \
 	main.c \
-	session.c \
-	stock.c 
+	session.c
 
 gaim_headers = \
 	$(gaim_coreheaders) \
-	dnd-hints.h \
 	gaim.h \
-	gaim-disclosure.h \
 	gtkaccount.h \
 	gtkcellrendererprogress.h \
 	gtkblist.h \
@@ -187,9 +185,11 @@
 	gtkconv.h \
 	gtkdebug.h \
 	gtkdialogs.h \
+	gtkdnd-hints.h \
 	gtkeventloop.h \
 	gtkft.h \
 	gtkgaim.h \
+	gtkgaim-disclosure.h \
 	gtkimhtml.h \
 	gtkimhtmltoolbar.h \
 	gtklog.h \
@@ -204,9 +204,9 @@
 	gtksound.h \
 	gtksourceiter.h \
 	gtkstatusselector.h \
+	gtkstock.h \
 	gtkutils.h \
-	internal.h \
-	stock.h
+	internal.h
 
 gaimincludedir=$(includedir)/gaim
 gaiminclude_HEADERS = \
--- a/src/Makefile.mingw	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/Makefile.mingw	Thu Dec 02 20:34:19 2004 +0000
@@ -86,10 +86,8 @@
 			conversation.c \
 			core.c \
 			debug.c \
-			dnd-hints.c \
 			eventloop.c \
 			ft.c \
-			gaim-disclosure.c \
 			gtkaccount.c \
 			gtkblist.c \
 			gtkconn.c \
@@ -97,8 +95,10 @@
 			gtkcellrendererprogress.c \
 			gtkdebug.c \
 			gtkdialogs.c \
+			gtkdnd-hints.c \
 			gtkeventloop.c \
 			gtkft.c \
+			gtkgaim-disclosure.c \
 			gtkimhtml.c \
 			gtkimhtmltoolbar.c \
 			gtklog.c \
@@ -113,6 +113,7 @@
 			gtksound.c \
 			gtksourceiter.c \
 			gtkstatusselector.c \
+			gtkstock.c \
 			gtkthemes.c \
 			gtkutils.c \
 			idle.c \
@@ -137,7 +138,6 @@
 			sound.c \
 			sslconn.c \
 			status.c \
-			stock.c \
 			stringref.c \
 			util.c \
 			value.c \
--- a/src/dnd-hints.c	Thu Dec 02 16:07:26 2004 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
- * Gaim is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or(at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "dnd-hints.h"
-
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
-typedef struct
-{
-	GtkWidget *widget;
-	gchar *filename;
-	gint ox;
-	gint oy;
-
-} HintWindowInfo;
-
-/**
- * Info about each hint widget. See DndHintWindowId enum.
- */
-HintWindowInfo hint_windows[] = { 
-	{ NULL, "tb_drag_arrow_up.xpm",   -13/2,     0 },
-	{ NULL, "tb_drag_arrow_down.xpm", -13/2,   -16 },
-	{ NULL, "tb_drag_arrow_left.xpm",     0, -13/2 },
-	{ NULL, "tb_drag_arrow_right.xpm",  -16, -13/2 },
-	{ NULL, NULL, 0, 0 }
-};
-
-static GtkWidget *
-dnd_hints_init_window(const gchar *fname)
-{
-	GdkPixbuf *pixbuf;
-	GdkPixmap *pixmap;
-	GdkBitmap *bitmap;
-	GtkWidget *pix;
-	GtkWidget *win;
-
-	pixbuf = gdk_pixbuf_new_from_file(fname, NULL);
-	g_return_val_if_fail(pixbuf, NULL);
-
-	gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap, &bitmap, 128);
-	g_object_unref(G_OBJECT(pixbuf));
-
-	gtk_widget_push_colormap(gdk_rgb_get_colormap());
-	win = gtk_window_new(GTK_WINDOW_POPUP);
-	pix = gtk_image_new_from_pixmap(pixmap, bitmap);
-	gtk_container_add(GTK_CONTAINER(win), pix);
-	gtk_widget_shape_combine_mask(win, bitmap, 0, 0);
-	gtk_widget_pop_colormap();
-
-	g_object_unref(G_OBJECT(pixmap));
-	g_object_unref(G_OBJECT(bitmap));
-
-	gtk_widget_show_all(pix);
-
-	return win;
-}
-
-static void
-get_widget_coords(GtkWidget *w, gint *x1, gint *y1, gint *x2, gint *y2)
-{
-	gint ox, oy, width, height;
-
-	if (w->parent && w->parent->window == w->window)
-	{
-		get_widget_coords(w->parent, &ox, &oy, NULL, NULL);
-		ox += w->allocation.x;
-		oy += w->allocation.y;
-		height = w->allocation.height;
-		width = w->allocation.width;
-	}
-	else
-	{
-		gdk_window_get_origin(w->window, &ox, &oy);
-		gdk_drawable_get_size(w->window, &width, &height);
-	}
-
-	if (x1) *x1 = ox;
-	if (y1) *y1 = oy;
-	if (x2) *x2 = ox + width;
-	if (y2) *y2 = oy + height;
-}
-
-static void
-dnd_hints_init(void)
-{
-	static gboolean done = FALSE;
-	gint i;
-
-	if (done)
-		return;
-
-	done = TRUE;
-
-	for (i = 0; hint_windows[i].filename != NULL; i++) {
-		gchar *fname;
-
-		fname = g_build_filename(DATADIR, "pixmaps", "gaim",
-								 hint_windows[i].filename, NULL);
-
-		hint_windows[i].widget = dnd_hints_init_window(fname);
-
-		g_free(fname);
-	}
-}
-
-void
-dnd_hints_hide_all(void)
-{
-	gint i;
-
-	for (i = 0; hint_windows[i].filename != NULL; i++)
-		dnd_hints_hide(i);
-}
-
-void 
-dnd_hints_hide(DndHintWindowId i)
-{
-	GtkWidget *w = hint_windows[i].widget;
-
-	if (w && GTK_IS_WIDGET(w))
-		gtk_widget_hide(w);
-}
-
-void 
-dnd_hints_show(DndHintWindowId id, gint x, gint y)
-{
-	GtkWidget *w;
-
-	dnd_hints_init();
-
-	w = hint_windows[id].widget;
-
-	if (w && GTK_IS_WIDGET(w))
-	{
-		gtk_window_move(GTK_WINDOW(w), hint_windows[id].ox + x,
-								 hint_windows[id].oy + y);
-		gtk_widget_show(w);
-	}
-}
-
-void 
-dnd_hints_show_relative(DndHintWindowId id, GtkWidget *widget,
-						DndHintPosition horiz, DndHintPosition vert)
-{
-	gint x1, x2, y1, y2;
-	gint x = 0, y = 0;
-
-	get_widget_coords(widget, &x1, &y1, &x2, &y2);
-
-	switch (horiz)
-	{
-		case HINT_POSITION_RIGHT:  x = x2;            break;
-		case HINT_POSITION_LEFT:   x = x1;            break;
-		case HINT_POSITION_CENTER: x = (x1 + x2) / 2; break;
-		default:
-			/* should not happen */
-			g_warning("Invalid parameter to dnd_hints_show_relative");
-			break;
-	}
-
-	switch (vert)
-	{
-		case HINT_POSITION_TOP:    y = y1;            break;
-		case HINT_POSITION_BOTTOM: y = y2;            break;
-		case HINT_POSITION_CENTER: y = (y1 + y2) / 2; break;
-		default:
-			/* should not happen */
-			g_warning("Invalid parameter to dnd_hints_show_relative");
-			break;
-	}
-
-	dnd_hints_show(id, x, y);
-}
-
--- a/src/dnd-hints.h	Thu Dec 02 16:07:26 2004 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/**
- * @file dnd-hints.h Drag-and-Drop arrow hints
- * @ingroup gtkui
- *
- * Gaim is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef _GAIM_DND_HINTS_H_
-#define _GAIM_DND_HINTS_H_
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-
-/**
- * Conversation drag-and-drop arrow types.
- */
-typedef enum
-{
-	HINT_ARROW_UP,    /**< Up arrow.    */
-	HINT_ARROW_DOWN,  /**< Down arrow.  */
-	HINT_ARROW_LEFT,  /**< Left arrow.  */
-	HINT_ARROW_RIGHT  /**< Right arrow. */
-
-} DndHintWindowId;
-
-/**
- * Conversation drag-and-drop arrow positions.
- */
-typedef enum {
-
-	HINT_POSITION_RIGHT,  /**< Position to the right of a tab.  */
-	HINT_POSITION_LEFT,   /**< Position to the left of a tab.   */
-	HINT_POSITION_TOP,    /**< Position above a tab.            */
-	HINT_POSITION_BOTTOM, /**< Position below a tab.            */
-	HINT_POSITION_CENTER  /**< Position in the center of a tab. */
-
-} DndHintPosition;
-
-/**
- * Shows a drag-and-drop hint at the specified location.
- *
- * @param id The ID of the hint to show.
- * @param x  The X location to show it at.
- * @param y  The Y location to show it at.
- */
-void dnd_hints_show(DndHintWindowId id, gint x, gint y);
-
-/**
- * Hides the specified drag-and-drop hint.
- *
- * @param id The ID of the hint to hide.
- */
-void dnd_hints_hide(DndHintWindowId id);
-
-/**
- * Hides all drag-and-drop hints.
- */
-void dnd_hints_hide_all(void);
-
-/**
- * Shows a drag-and-drop hint relative to a widget.
- *
- * @param id     The ID of the hint.
- * @param widget The widget that the hint is relative to.
- * @param horiz  The horizontal relative position.
- * @param vert   The vertical relative position.
- */
-void dnd_hints_show_relative(DndHintWindowId id, GtkWidget *widget,
-							 DndHintPosition horiz, DndHintPosition vert);
-
-#endif /* _GAIM_DND_HINTS_H_ */
--- a/src/gaim-disclosure.c	Thu Dec 02 16:07:26 2004 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *  Gaim is the legal property of its developers, whose names are too numerous
- *  to list here.  Please refer to the COPYRIGHT file distributed with this
- *  source distribution.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtktogglebutton.h>
-
-#include "gaim-disclosure.h"
-
-#ifdef ENABLE_NLS
-#  include <libintl.h>
-#  define _(x) gettext(x)
-#  ifdef gettext_noop
-#    define N_(String) gettext_noop (String)
-#  else
-#    define N_(String) (String)
-#  endif
-#else
-#  define N_(String) (String)
-#  define _(x) (x)
-#endif
-
-static GtkCheckButtonClass *parent_class = NULL;
-
-struct _GaimDisclosurePrivate {
-	GtkWidget *container;
-	char *shown;
-	char *hidden;
-	
-	guint32 expand_id;
-	GtkExpanderStyle style;
-
-	int expander_size;
-	int direction;
-};
-
-static void
-finalize (GObject *object)
-{
-	GaimDisclosure *disclosure;
-
-	disclosure = GAIM_DISCLOSURE (object);
-	if (disclosure->priv == NULL) {
-		return;
-	}
-
-	g_free (disclosure->priv->hidden);
-	g_free (disclosure->priv->shown);
-
-	if (disclosure->priv->container != NULL) {
-		g_object_unref (G_OBJECT (disclosure->priv->container));
-	}
-	
-	g_free (disclosure->priv);
-	disclosure->priv = NULL;
-
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-get_x_y (GaimDisclosure *disclosure,
-	 int *x,
-	 int *y,
-	 GtkStateType *state_type)
-{
-	GtkCheckButton *check_button;
-	int indicator_size = 0;
-	int focus_width;
-	int focus_pad;
-	gboolean interior_focus;
-	GtkWidget *widget = GTK_WIDGET (disclosure);
-	GtkBin *bin = GTK_BIN (disclosure);
-	int width;
-	
-	if (GTK_WIDGET_VISIBLE (disclosure) &&
-	    GTK_WIDGET_MAPPED (disclosure)) {
-		check_button = GTK_CHECK_BUTTON (disclosure);
-		
-		gtk_widget_style_get (widget,
-				      "interior_focus", &interior_focus,
-				      "focus-line-width", &focus_width,
-				      "focus-padding", &focus_pad,
-				      NULL);
-		
-		*state_type = GTK_WIDGET_STATE (widget);
-		if ((*state_type != GTK_STATE_NORMAL) &&
-		    (*state_type != GTK_STATE_PRELIGHT)) {
-			*state_type = GTK_STATE_NORMAL;
-		}
-
-		if (bin->child) {
-			width = bin->child->allocation.x - widget->allocation.x - (2 * GTK_CONTAINER (widget)->border_width);
-		} else {
-			width = widget->allocation.width;
-		}
-		
-		*x = widget->allocation.x + (width) / 2;
-		*y = widget->allocation.y + widget->allocation.height / 2;
-
-		if (interior_focus == FALSE) {
-			*x += focus_width + focus_pad;
-		}
-
-		*state_type = GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE ? GTK_STATE_NORMAL : GTK_WIDGET_STATE (widget);
-
-		if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) {
-			*x = widget->allocation.x + widget->allocation.width - (indicator_size + *x - widget->allocation.x);
-		}
-	} else {
-		*x = 0;
-		*y = 0;
-		*state_type = GTK_STATE_NORMAL;
-	}
-}
-
-static gboolean
-expand_collapse_timeout (gpointer data)
-{
-	GtkWidget *widget = data;
-	GaimDisclosure *disclosure = data;
-	GtkStateType state_type;
-	int x, y;
-	
-	gdk_window_invalidate_rect (widget->window, &widget->allocation, TRUE);
-	get_x_y (disclosure, &x, &y, &state_type);
-	
-	gtk_paint_expander (widget->style,
-			    widget->window,
-			    state_type,
-			    &widget->allocation,
-			    widget,
-			    "disclosure",
-			    x, y,
-			    disclosure->priv->style);
-
-	disclosure->priv->style += disclosure->priv->direction;
-	if ((int) disclosure->priv->style > (int) GTK_EXPANDER_EXPANDED) {
-		disclosure->priv->style = GTK_EXPANDER_EXPANDED;
-
-		if (disclosure->priv->container != NULL) {
-			gtk_widget_show (disclosure->priv->container);
-		}
-
-		g_object_set (G_OBJECT (disclosure),
-			      "label", disclosure->priv->hidden,
-			      NULL);
-		return FALSE;
-	} else if ((int) disclosure->priv->style < (int) GTK_EXPANDER_COLLAPSED) {
-		disclosure->priv->style = GTK_EXPANDER_COLLAPSED;
-
-		if (disclosure->priv->container != NULL) {
-			gtk_widget_hide (disclosure->priv->container);
-		}
-
-		g_object_set (G_OBJECT (disclosure),
-			      "label", disclosure->priv->shown,
-			      NULL);
-
-		return FALSE;
-	} else {
-		return TRUE;
-	}
-}
-
-static void
-do_animation (GaimDisclosure *disclosure,
-	      gboolean opening)
-{
-	if (disclosure->priv->expand_id > 0) {
-		gaim_timeout_remove(disclosure->priv->expand_id);
-	}
-
-	disclosure->priv->direction = opening ? 1 : -1;
-	disclosure->priv->expand_id = gaim_timeout_add (50, expand_collapse_timeout, disclosure);
-}
-
-static void
-toggled (GtkToggleButton *tb)
-{
-	GaimDisclosure *disclosure;
-
-	disclosure = GAIM_DISCLOSURE (tb);
-	do_animation (disclosure, gtk_toggle_button_get_active (tb));
-
-	if (disclosure->priv->container == NULL) {
-		return;
-	}
-}
-
-static void
-draw_indicator (GtkCheckButton *check,
-		GdkRectangle *area)
-{
-	GtkWidget *widget = GTK_WIDGET (check);
-	GaimDisclosure *disclosure = GAIM_DISCLOSURE (check);
-	GtkStateType state_type;
-	int x, y;
-
-	get_x_y (disclosure, &x, &y, &state_type);
-	gtk_paint_expander (widget->style,
-			    widget->window,
-			    state_type,
-			    area,
-			    widget,
-			    "treeview",
-			    x, y,
-			    disclosure->priv->style);
-}
-
-static void
-class_init (GaimDisclosureClass *klass)
-{
-	GObjectClass *object_class;
-	GtkWidgetClass *widget_class;
-	GtkCheckButtonClass *button_class;
-	GtkToggleButtonClass *toggle_class;
-	
-	object_class = G_OBJECT_CLASS (klass);
-	widget_class = GTK_WIDGET_CLASS (klass);
-	button_class = GTK_CHECK_BUTTON_CLASS (klass);
-	toggle_class = GTK_TOGGLE_BUTTON_CLASS (klass);
-	
-	toggle_class->toggled = toggled;
-	button_class->draw_indicator = draw_indicator;
-
-	object_class->finalize = finalize;
-
-	parent_class = g_type_class_peek_parent (klass);
-
-	gtk_widget_class_install_style_property (widget_class,
-						 g_param_spec_int ("expander_size",
-								   _("Expander Size"),
-								   _("Size of the expander arrow"),
-								   0, G_MAXINT,
-								   10, G_PARAM_READABLE));
-}
-
-static void
-init (GaimDisclosure *disclosure)
-{
-	disclosure->priv = g_new0 (GaimDisclosurePrivate, 1);
-	disclosure->priv->expander_size = 10;
-}
-
-GType
-gaim_disclosure_get_type (void)
-{
-	static GType type = 0;
-
-	if (type == 0) {
-		GTypeInfo info = {
-			sizeof (GaimDisclosureClass),
-			NULL, NULL, (GClassInitFunc) class_init, NULL, NULL,
-			sizeof (GaimDisclosure), 0, (GInstanceInitFunc) init
-		};
-
-		type = g_type_register_static (GTK_TYPE_CHECK_BUTTON, "GaimDisclosure", &info, 0);
-	}
-
-	return type;
-}
-
-GtkWidget *
-gaim_disclosure_new (const char *shown,
-		     const char *hidden)
-{
-	GaimDisclosure *disclosure;
-
-	disclosure = g_object_new (gaim_disclosure_get_type (), "label", shown, NULL);
-
-	disclosure->priv->shown = g_strdup (shown);
-	disclosure->priv->hidden = g_strdup (hidden);
-	return GTK_WIDGET (disclosure);
-}
-
-void
-gaim_disclosure_set_container (GaimDisclosure *disclosure,
-			       GtkWidget *container)
-{
-	g_object_ref (G_OBJECT (container));
-	disclosure->priv->container = container;
-}
--- a/src/gaim-disclosure.h	Thu Dec 02 16:07:26 2004 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *  Gaim is the legal property of its developers, whose names are too numerous
- *  to list here.  Please refer to the COPYRIGHT file distributed with this
- *  source distribution.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-#ifndef __GAIM_GAIM_DISCLOSURE_H__
-#define __GAIM_GAIM_DISCLOSURE_H__
-
-#include "eventloop.h"
-
-#include <gtk/gtkcheckbutton.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif
-
-#define GAIM_DISCLOSURE_TYPE (gaim_disclosure_get_type ())
-#define GAIM_DISCLOSURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIM_DISCLOSURE_TYPE, GaimDisclosure))
-#define GAIM_DISCLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIM_DISCLOSURE_TYPE, GaimDisclosureClass))
-#define IS_GAIM_DISCLOSURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIM_DISCLOSURE_TYPE))
-#define IS_GAIM_DISCLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIM_DISCLOSURE_TYPE))
-
-typedef struct _GaimDisclosure GaimDisclosure;
-typedef struct _GaimDisclosureClass GaimDisclosureClass;
-typedef struct _GaimDisclosurePrivate GaimDisclosurePrivate;
-
-struct _GaimDisclosure {
-	GtkCheckButton parent;
-
-	GaimDisclosurePrivate *priv;
-};
-
-struct _GaimDisclosureClass {
-	GtkCheckButtonClass parent_class;
-};
-
-GType gaim_disclosure_get_type (void);
-GtkWidget *gaim_disclosure_new (const char *shown, const char *hidden);
-void gaim_disclosure_set_container (GaimDisclosure *disclosure,
-									GtkWidget *container);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
--- a/src/gtkaccount.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkaccount.c	Thu Dec 02 20:34:19 2004 +0000
@@ -38,12 +38,12 @@
 #include "signals.h"
 #include "util.h"
 
-#include "gaim-disclosure.h"
+#include "gtkgaim-disclosure.h"
 #include "gtkaccount.h"
 #include "gtkblist.h"
 #include "gtkdialogs.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 enum
 {
--- a/src/gtkblist.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkblist.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,4 +1,7 @@
 /*
+ * @file gtkblist.c GTK+ BuddyList API
+ * @ingroup gtkui
+ *
  * gaim
  *
  * Gaim is the legal property of its developers, whose names are too numerous
@@ -34,7 +37,7 @@
 #include "request.h"
 #include "signals.h"
 #include "sound.h"
-#include "stock.h"
+#include "gtkstock.h"
 #include "util.h"
 
 #include "gtkaccount.h"
--- a/src/gtkcellrendererprogress.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkcellrendererprogress.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,4 +1,9 @@
-/* gtkcellrendererprogress.c
+/*
+ * @file gtkcellrendererprogress.c GTK+ Cell Renderer Progress
+ * @ingroup gtkui
+ *
+ * gaim
+ *
  * Gaim is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
--- a/src/gtkconn.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkconn.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,4 +1,7 @@
 /*
+ * @file gtkconn.c GTK+ Connection API
+ * @ingroup gtkui
+ *
  * gaim
  *
  * Gaim is the legal property of its developers, whose names are too numerous
@@ -26,7 +29,7 @@
 #include "debug.h"
 #include "notify.h"
 #include "prefs.h"
-#include "stock.h"
+#include "gtkstock.h"
 #include "util.h"
 
 #include "gtkblist.h"
--- a/src/gtkconv.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkconv.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,7 +1,9 @@
 /**
- * @file gtkconv.h GTK+ Conversation API
+ * @file gtkconv.c GTK+ Conversation API
  * @ingroup gtkui
  *
+ * gaim
+ *
  * Gaim is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
@@ -49,7 +51,7 @@
 #include "sound.h"
 #include "util.h"
 
-#include "dnd-hints.h"
+#include "gtkdnd-hints.h"
 #include "gtkblist.h"
 #include "gtkconv.h"
 #include "gtkdialogs.h"
@@ -59,7 +61,7 @@
 #include "gtkpounce.h"
 #include "gtkprivacy.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 /* XXX */
 #include "gaim.h"
--- a/src/gtkdebug.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkdebug.c	Thu Dec 02 20:34:19 2004 +0000
@@ -34,7 +34,7 @@
 #include "gtkdialogs.h"
 #include "gtkimhtml.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 extern int opt_debug;
 
--- a/src/gtkdialogs.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkdialogs.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,4 +1,7 @@
 /*
+ * @file gtkdialogs.c GTK+ Dialogs
+ * @ingroup gtkui
+ *
  * gaim
  *
  * Gaim is the legal property of its developers, whose names are too numerous
@@ -33,7 +36,7 @@
 #include "gtkimhtmltoolbar.h"
 #include "gtklog.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 static GList *dialogwindows = NULL;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gtkgaim-disclosure.c	Thu Dec 02 20:34:19 2004 +0000
@@ -0,0 +1,308 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * @file gtkgaim-disclosure.c GTK+ Gaim Disclosure
+ * @ingroup gtkui
+ *
+ * gaim
+ *
+ *  Gaim is the legal property of its developers, whose names are too numerous
+ *  to list here.  Please refer to the COPYRIGHT file distributed with this
+ *  source distribution.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtktogglebutton.h>
+
+#include "gtkgaim-disclosure.h"
+
+#ifdef ENABLE_NLS
+#  include <libintl.h>
+#  define _(x) gettext(x)
+#  ifdef gettext_noop
+#    define N_(String) gettext_noop (String)
+#  else
+#    define N_(String) (String)
+#  endif
+#else
+#  define N_(String) (String)
+#  define _(x) (x)
+#endif
+
+static GtkCheckButtonClass *parent_class = NULL;
+
+struct _GaimDisclosurePrivate {
+	GtkWidget *container;
+	char *shown;
+	char *hidden;
+	
+	guint32 expand_id;
+	GtkExpanderStyle style;
+
+	int expander_size;
+	int direction;
+};
+
+static void
+finalize (GObject *object)
+{
+	GaimDisclosure *disclosure;
+
+	disclosure = GAIM_DISCLOSURE (object);
+	if (disclosure->priv == NULL) {
+		return;
+	}
+
+	g_free (disclosure->priv->hidden);
+	g_free (disclosure->priv->shown);
+
+	if (disclosure->priv->container != NULL) {
+		g_object_unref (G_OBJECT (disclosure->priv->container));
+	}
+	
+	g_free (disclosure->priv);
+	disclosure->priv = NULL;
+
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+get_x_y (GaimDisclosure *disclosure,
+	 int *x,
+	 int *y,
+	 GtkStateType *state_type)
+{
+	GtkCheckButton *check_button;
+	int indicator_size = 0;
+	int focus_width;
+	int focus_pad;
+	gboolean interior_focus;
+	GtkWidget *widget = GTK_WIDGET (disclosure);
+	GtkBin *bin = GTK_BIN (disclosure);
+	int width;
+	
+	if (GTK_WIDGET_VISIBLE (disclosure) &&
+	    GTK_WIDGET_MAPPED (disclosure)) {
+		check_button = GTK_CHECK_BUTTON (disclosure);
+		
+		gtk_widget_style_get (widget,
+				      "interior_focus", &interior_focus,
+				      "focus-line-width", &focus_width,
+				      "focus-padding", &focus_pad,
+				      NULL);
+		
+		*state_type = GTK_WIDGET_STATE (widget);
+		if ((*state_type != GTK_STATE_NORMAL) &&
+		    (*state_type != GTK_STATE_PRELIGHT)) {
+			*state_type = GTK_STATE_NORMAL;
+		}
+
+		if (bin->child) {
+			width = bin->child->allocation.x - widget->allocation.x - (2 * GTK_CONTAINER (widget)->border_width);
+		} else {
+			width = widget->allocation.width;
+		}
+		
+		*x = widget->allocation.x + (width) / 2;
+		*y = widget->allocation.y + widget->allocation.height / 2;
+
+		if (interior_focus == FALSE) {
+			*x += focus_width + focus_pad;
+		}
+
+		*state_type = GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE ? GTK_STATE_NORMAL : GTK_WIDGET_STATE (widget);
+
+		if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) {
+			*x = widget->allocation.x + widget->allocation.width - (indicator_size + *x - widget->allocation.x);
+		}
+	} else {
+		*x = 0;
+		*y = 0;
+		*state_type = GTK_STATE_NORMAL;
+	}
+}
+
+static gboolean
+expand_collapse_timeout (gpointer data)
+{
+	GtkWidget *widget = data;
+	GaimDisclosure *disclosure = data;
+	GtkStateType state_type;
+	int x, y;
+	
+	gdk_window_invalidate_rect (widget->window, &widget->allocation, TRUE);
+	get_x_y (disclosure, &x, &y, &state_type);
+	
+	gtk_paint_expander (widget->style,
+			    widget->window,
+			    state_type,
+			    &widget->allocation,
+			    widget,
+			    "disclosure",
+			    x, y,
+			    disclosure->priv->style);
+
+	disclosure->priv->style += disclosure->priv->direction;
+	if ((int) disclosure->priv->style > (int) GTK_EXPANDER_EXPANDED) {
+		disclosure->priv->style = GTK_EXPANDER_EXPANDED;
+
+		if (disclosure->priv->container != NULL) {
+			gtk_widget_show (disclosure->priv->container);
+		}
+
+		g_object_set (G_OBJECT (disclosure),
+			      "label", disclosure->priv->hidden,
+			      NULL);
+		return FALSE;
+	} else if ((int) disclosure->priv->style < (int) GTK_EXPANDER_COLLAPSED) {
+		disclosure->priv->style = GTK_EXPANDER_COLLAPSED;
+
+		if (disclosure->priv->container != NULL) {
+			gtk_widget_hide (disclosure->priv->container);
+		}
+
+		g_object_set (G_OBJECT (disclosure),
+			      "label", disclosure->priv->shown,
+			      NULL);
+
+		return FALSE;
+	} else {
+		return TRUE;
+	}
+}
+
+static void
+do_animation (GaimDisclosure *disclosure,
+	      gboolean opening)
+{
+	if (disclosure->priv->expand_id > 0) {
+		gaim_timeout_remove(disclosure->priv->expand_id);
+	}
+
+	disclosure->priv->direction = opening ? 1 : -1;
+	disclosure->priv->expand_id = gaim_timeout_add (50, expand_collapse_timeout, disclosure);
+}
+
+static void
+toggled (GtkToggleButton *tb)
+{
+	GaimDisclosure *disclosure;
+
+	disclosure = GAIM_DISCLOSURE (tb);
+	do_animation (disclosure, gtk_toggle_button_get_active (tb));
+
+	if (disclosure->priv->container == NULL) {
+		return;
+	}
+}
+
+static void
+draw_indicator (GtkCheckButton *check,
+		GdkRectangle *area)
+{
+	GtkWidget *widget = GTK_WIDGET (check);
+	GaimDisclosure *disclosure = GAIM_DISCLOSURE (check);
+	GtkStateType state_type;
+	int x, y;
+
+	get_x_y (disclosure, &x, &y, &state_type);
+	gtk_paint_expander (widget->style,
+			    widget->window,
+			    state_type,
+			    area,
+			    widget,
+			    "treeview",
+			    x, y,
+			    disclosure->priv->style);
+}
+
+static void
+class_init (GaimDisclosureClass *klass)
+{
+	GObjectClass *object_class;
+	GtkWidgetClass *widget_class;
+	GtkCheckButtonClass *button_class;
+	GtkToggleButtonClass *toggle_class;
+	
+	object_class = G_OBJECT_CLASS (klass);
+	widget_class = GTK_WIDGET_CLASS (klass);
+	button_class = GTK_CHECK_BUTTON_CLASS (klass);
+	toggle_class = GTK_TOGGLE_BUTTON_CLASS (klass);
+	
+	toggle_class->toggled = toggled;
+	button_class->draw_indicator = draw_indicator;
+
+	object_class->finalize = finalize;
+
+	parent_class = g_type_class_peek_parent (klass);
+
+	gtk_widget_class_install_style_property (widget_class,
+						 g_param_spec_int ("expander_size",
+								   _("Expander Size"),
+								   _("Size of the expander arrow"),
+								   0, G_MAXINT,
+								   10, G_PARAM_READABLE));
+}
+
+static void
+init (GaimDisclosure *disclosure)
+{
+	disclosure->priv = g_new0 (GaimDisclosurePrivate, 1);
+	disclosure->priv->expander_size = 10;
+}
+
+GType
+gaim_disclosure_get_type (void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		GTypeInfo info = {
+			sizeof (GaimDisclosureClass),
+			NULL, NULL, (GClassInitFunc) class_init, NULL, NULL,
+			sizeof (GaimDisclosure), 0, (GInstanceInitFunc) init
+		};
+
+		type = g_type_register_static (GTK_TYPE_CHECK_BUTTON, "GaimDisclosure", &info, 0);
+	}
+
+	return type;
+}
+
+GtkWidget *
+gaim_disclosure_new (const char *shown,
+		     const char *hidden)
+{
+	GaimDisclosure *disclosure;
+
+	disclosure = g_object_new (gaim_disclosure_get_type (), "label", shown, NULL);
+
+	disclosure->priv->shown = g_strdup (shown);
+	disclosure->priv->hidden = g_strdup (hidden);
+	return GTK_WIDGET (disclosure);
+}
+
+void
+gaim_disclosure_set_container (GaimDisclosure *disclosure,
+			       GtkWidget *container)
+{
+	g_object_ref (G_OBJECT (container));
+	disclosure->priv->container = container;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gtkgaim-disclosure.h	Thu Dec 02 20:34:19 2004 +0000
@@ -0,0 +1,63 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Gaim is the legal property of its developers, whose names are too numerous
+ *  to list here.  Please refer to the COPYRIGHT file distributed with this
+ *  source distribution.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+#ifndef __GAIM_GAIM_DISCLOSURE_H__
+#define __GAIM_GAIM_DISCLOSURE_H__
+
+#include "eventloop.h"
+
+#include <gtk/gtkcheckbutton.h>
+
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif
+
+#define GAIM_DISCLOSURE_TYPE (gaim_disclosure_get_type ())
+#define GAIM_DISCLOSURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIM_DISCLOSURE_TYPE, GaimDisclosure))
+#define GAIM_DISCLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIM_DISCLOSURE_TYPE, GaimDisclosureClass))
+#define IS_GAIM_DISCLOSURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIM_DISCLOSURE_TYPE))
+#define IS_GAIM_DISCLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIM_DISCLOSURE_TYPE))
+
+typedef struct _GaimDisclosure GaimDisclosure;
+typedef struct _GaimDisclosureClass GaimDisclosureClass;
+typedef struct _GaimDisclosurePrivate GaimDisclosurePrivate;
+
+struct _GaimDisclosure {
+	GtkCheckButton parent;
+
+	GaimDisclosurePrivate *priv;
+};
+
+struct _GaimDisclosureClass {
+	GtkCheckButtonClass parent_class;
+};
+
+GType gaim_disclosure_get_type (void);
+GtkWidget *gaim_disclosure_new (const char *shown, const char *hidden);
+void gaim_disclosure_set_container (GaimDisclosure *disclosure,
+									GtkWidget *container);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- a/src/gtkimhtml.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkimhtml.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,5 +1,8 @@
 /*
- * GtkIMHtml
+ * @file gtkimhtml.c GTK+ IMHtml
+ * @ingroup gtkui
+ *
+ * gaim
  *
  * Gaim is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
--- a/src/gtkimhtmltoolbar.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkimhtmltoolbar.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,5 +1,8 @@
 /*
- * GtkIMHtmlToolbar
+ * @file gtkimhtmltoolbar.c GTK+ IMHtml Toolbar
+ * @ingroup gtkui
+ *
+ * gaim
  *
  * Gaim is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
@@ -26,7 +29,7 @@
 #include "imgstore.h"
 #include "notify.h"
 #include "request.h"
-#include "stock.h"
+#include "gtkstock.h"
 #include "util.h"
 
 #include "gtkdialogs.h"
--- a/src/gtknotify.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtknotify.c	Thu Dec 02 20:34:19 2004 +0000
@@ -30,7 +30,7 @@
 #include "connection.h"
 #include "debug.h"
 #include "prefs.h"
-#include "stock.h"
+#include "gtkstock.h"
 #include "util.h"
 
 #include "gtkimhtml.h"
--- a/src/gtkpluginpref.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkpluginpref.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,4 +1,7 @@
 /**
+ * @file gtkpluginpref.c GTK+ Plugin preferences
+ * @ingroup gtkui
+ *
  * gaim
  *
  * Gaim is the legal property of its developers, whose names are too numerous
--- a/src/gtkprefs.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkprefs.c	Thu Dec 02 20:34:19 2004 +0000
@@ -47,7 +47,7 @@
 #include "gtkprefs.h"
 #include "gtksound.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 #define PROXYHOST 0
 #define PROXYPORT 1
--- a/src/gtkrequest.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkrequest.c	Thu Dec 02 20:34:19 2004 +0000
@@ -31,7 +31,7 @@
 #include "gtkimhtmltoolbar.h"
 #include "gtkrequest.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 #include <gdk/gdkkeysyms.h>
 
--- a/src/gtksound.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtksound.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,4 +1,7 @@
 /*
+ * @file gtksound.h GTK+ Sound
+ * @ingroup gtkui
+ *
  * gaim
  *
  * Gaim is the legal property of its developers, whose names are too numerous
--- a/src/gtksourceiter.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtksourceiter.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,5 +1,8 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 
- *  gtksourceiter.h
+ * @file gtksourceiter.h GTK+ Source iterator
+ * @ingroup gtkui
+ *
+ *  gaim
  *
  *  Gaim is the legal property of its developers, whose names are too numerous
  *  to list here.  Please refer to the COPYRIGHT file distributed with this
--- a/src/gtkstatusselector.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/gtkstatusselector.c	Thu Dec 02 20:34:19 2004 +0000
@@ -1,5 +1,5 @@
 /**
- * @file gtkstatusselector.c Status selector widget
+ * @file gtkstatusselector.c GTK+ Status selector widget
  * @ingroup gtkui
  *
  * gaim
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gtkstock.c	Thu Dec 02 20:34:19 2004 +0000
@@ -0,0 +1,229 @@
+/**
+ * @file gtkstock.c GTK+ Stock resources
+ * @ingroup gtkui
+ *
+ * gaim
+ *
+ * Gaim is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+#include "internal.h"
+#include "gtkgaim.h"
+
+#include "gtkstock.h"
+
+static struct StockIcon
+{
+	const char *name;
+	const char *dir;
+	const char *filename;
+
+} const stock_icons[] =
+{
+	{ GAIM_STOCK_ABOUT,           "buttons", "about_menu.png"           },
+	{ GAIM_STOCK_ACCOUNTS,        "buttons", "accounts.png"             },
+	{ GAIM_STOCK_ALIAS,           "buttons", "edit.png"                 },
+	{ GAIM_STOCK_BGCOLOR,         "buttons", "change-bgcolor-small.png" },
+	{ GAIM_STOCK_BLOCK,           NULL,      GTK_STOCK_STOP             },
+	{ GAIM_STOCK_CHAT,            NULL,      GTK_STOCK_JUMP_TO          },
+	{ GAIM_STOCK_DOWNLOAD,        NULL,      GTK_STOCK_GO_DOWN          },
+	{ GAIM_STOCK_DIALOG_AUTH,     "dialogs", "gaim_auth.png"            },
+	{ GAIM_STOCK_DIALOG_COOL,     "dialogs", "gaim_cool.png"            },
+	{ GAIM_STOCK_DIALOG_ERROR,    "dialogs", "gaim_error.png"           },
+	{ GAIM_STOCK_DIALOG_INFO,     "dialogs", "gaim_info.png"            },
+	{ GAIM_STOCK_DIALOG_QUESTION, "dialogs", "gaim_question.png"        },
+	{ GAIM_STOCK_DIALOG_WARNING,  "dialogs", "gaim_warning.png"         },
+	{ GAIM_STOCK_FGCOLOR,         "buttons", "change-fgcolor-small.png" },
+	{ GAIM_STOCK_EDIT,            "buttons", "edit.png"                 },
+	{ GAIM_STOCK_FILE_CANCELED,   NULL,      GTK_STOCK_CANCEL           },
+	{ GAIM_STOCK_FILE_DONE,       NULL,      GTK_STOCK_APPLY            },
+	{ GAIM_STOCK_FILE_TRANSFER,   NULL,      GTK_STOCK_REVERT_TO_SAVED  },
+	{ GAIM_STOCK_ICON_AWAY,       "icons",   "away.png"                 },
+	{ GAIM_STOCK_ICON_AWAY_MSG,   "icons",   "msgpend.png"              },
+	{ GAIM_STOCK_ICON_CONNECT,    "icons",   "connect.png"              },
+	{ GAIM_STOCK_ICON_OFFLINE,    "icons",   "offline.png"              },
+	{ GAIM_STOCK_ICON_ONLINE,     "icons",   "online.png"               },
+	{ GAIM_STOCK_ICON_ONLINE_MSG, "icons",   "msgunread.png"            },
+	{ GAIM_STOCK_IGNORE,          NULL,      GTK_STOCK_DIALOG_ERROR     },
+	{ GAIM_STOCK_IM,              "buttons", "send-im.png"		        },
+	{ GAIM_STOCK_IMAGE,           "buttons", "insert-image-small.png"   },
+	{ GAIM_STOCK_INFO,            "icons",   "info.png",                },
+	{ GAIM_STOCK_INVITE,          NULL,      GTK_STOCK_JUMP_TO          },
+	{ GAIM_STOCK_LINK,            "buttons", "insert-link-small.png"    },
+	{ GAIM_STOCK_LOGO,            "gaim",    "logo.png"                 },
+	{ GAIM_STOCK_MODIFY,          NULL,      GTK_STOCK_PREFERENCES      },
+	{ GAIM_STOCK_PAUSE,           "buttons", "pause.png"                },
+	{ GAIM_STOCK_OPEN_MAIL,       NULL,      GTK_STOCK_JUMP_TO          },
+	{ GAIM_STOCK_SEND,            "buttons", "send-im.png"              },
+	{ GAIM_STOCK_SIGN_ON,         NULL,      GTK_STOCK_EXECUTE          },
+	{ GAIM_STOCK_SIGN_OFF,        NULL,      GTK_STOCK_CLOSE            },
+	{ GAIM_STOCK_SMILEY,          "buttons", "insert-smiley-small.png"  },
+	{ GAIM_STOCK_TEXT_BIGGER,     "buttons", "text_bigger.png"          },
+	{ GAIM_STOCK_TEXT_NORMAL,     "buttons", "text_normal.png"          },
+	{ GAIM_STOCK_TEXT_SMALLER,    "buttons", "text_smaller.png"         },
+	{ GAIM_STOCK_TYPED,           "gaim",    "typed.png"                },
+	{ GAIM_STOCK_TYPING,          "gaim",    "typing.png"               },
+	{ GAIM_STOCK_UPLOAD,          NULL,      GTK_STOCK_GO_UP            },
+	{ GAIM_STOCK_WARN,            NULL,      GTK_STOCK_DIALOG_WARNING   }
+};
+
+const GtkStockItem stock_items[] =
+{
+	{ GAIM_STOCK_ALIAS,     N_("_Alias"),     0, 0, NULL },
+	{ GAIM_STOCK_CHAT,      N_("_Join"),      0, 0, NULL },
+	{ GAIM_STOCK_INVITE,    N_("_Invite"),    0, 0, NULL },
+	{ GAIM_STOCK_MODIFY,    N_("_Modify"),    0, 0, NULL },
+	{ GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL },
+	{ GAIM_STOCK_PAUSE,     N_("_Pause"),     0, 0, NULL },
+	{ GAIM_STOCK_WARN,      N_("_Warn"),      0, 0, NULL }
+};
+
+static gchar *
+find_file(const char *dir, const char *base)
+{
+	char *filename;
+
+	if (base == NULL)
+		return NULL;
+
+	if (!strcmp(dir, "gaim"))
+		filename = g_build_filename(DATADIR, "pixmaps", "gaim", base, NULL);
+	else
+	{
+		filename = g_build_filename(DATADIR, "pixmaps", "gaim", dir,
+									base, NULL);
+	}
+
+	if (!g_file_test(filename, G_FILE_TEST_EXISTS))
+	{
+		g_critical("Unable to load stock pixmap %s\n", base);
+
+		g_free(filename);
+
+		return NULL;
+	}
+
+	return filename;
+}
+
+static void
+gaim_gtk_stock_versionize(GdkPixbuf **original, GtkWidget *widget) {
+	GdkPixmap *pixmap;
+	GtkStyle *style;
+	PangoContext *context;
+	PangoLayout *layout;
+	gchar *markup;
+	gint width, height;
+	gint lwidth = 0, lheight = 0;
+
+	style = gtk_widget_get_style(widget);
+
+	gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255);
+	width = gdk_pixbuf_get_width(*original);
+	height = gdk_pixbuf_get_height(*original);
+	g_object_unref(G_OBJECT(*original));
+
+	context = gtk_widget_get_pango_context(widget);
+	layout = pango_layout_new(context);
+
+	markup = g_strdup_printf("<span foreground=\"#FFFFFF\" size=\"larger\">%s</span>", VERSION);
+	pango_layout_set_font_description(layout, style->font_desc);
+	pango_layout_set_markup(layout, markup, strlen(markup));
+	g_free(markup);
+
+	pango_layout_get_pixel_size(layout, &lwidth, &lheight);
+	gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL],
+					width - (lwidth + 3), height - (lheight + 1), layout);
+	g_object_unref(G_OBJECT(layout));
+
+	*original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL,
+											 0, 0, 0, 0,
+											 width, height);
+	g_object_unref(G_OBJECT(pixmap));
+}
+
+void
+gaim_gtk_stock_init(void)
+{
+	static gboolean stock_initted = FALSE;
+	GtkIconFactory *icon_factory;
+	int i;
+	GtkWidget *win;
+
+	if (stock_initted)
+		return;
+
+	stock_initted = TRUE;
+
+	/* Setup the icon factory. */
+	icon_factory = gtk_icon_factory_new();
+
+	gtk_icon_factory_add_default(icon_factory);
+
+	/* Er, yeah, a hack, but it works. :) */
+	win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+	gtk_widget_realize(win);
+
+	for (i = 0; i < G_N_ELEMENTS(stock_icons); i++)
+	{
+		GdkPixbuf *pixbuf;
+		GtkIconSet *iconset;
+		gchar *filename;
+
+		if (stock_icons[i].dir == NULL)
+		{
+			/* GTK+ Stock icon */
+			iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win),
+												stock_icons[i].filename);
+		}
+		else
+		{
+			filename = find_file(stock_icons[i].dir, stock_icons[i].filename);
+
+			if (filename == NULL)
+				continue;
+
+			pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
+
+			g_free(filename);
+
+			if (!strcmp(stock_icons[i].name, GAIM_STOCK_LOGO))
+				gaim_gtk_stock_versionize(&pixbuf, win);
+
+			iconset = gtk_icon_set_new_from_pixbuf(pixbuf);
+
+			g_object_unref(G_OBJECT(pixbuf));
+		}
+
+		gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset);
+
+		gtk_icon_set_unref(iconset);
+	}
+
+	gtk_widget_destroy(win);
+
+	/* register custom icon sizes */
+	gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 330, 90);
+	gtk_icon_size_register(GAIM_ICON_SIZE_DIALOG_COOL, 40, 60);
+
+	g_object_unref(G_OBJECT(icon_factory));
+
+	/* Register the stock items. */
+	gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gtkstock.h	Thu Dec 02 20:34:19 2004 +0000
@@ -0,0 +1,91 @@
+/**
+ * @file gtkstock.h GTK+ Stock resources
+ * @ingroup gtkui
+ *
+ * gaim
+ *
+ * Gaim is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef _GAIM_STOCK_H_
+#define _GAIM_STOCK_H_
+
+/**************************************************************************/
+/** @name Stock images                                                    */
+/**************************************************************************/
+/*@{*/
+#define GAIM_STOCK_ABOUT           "gaim-about"
+#define GAIM_STOCK_ACCOUNTS        "gaim-accounts"
+#define GAIM_STOCK_ALIAS           "gaim-alias"
+#define GAIM_STOCK_AWAY            "gaim-away"
+#define GAIM_STOCK_BGCOLOR         "gaim-bgcolor"
+#define GAIM_STOCK_BLOCK           "gaim-block"
+#define GAIM_STOCK_CHAT            "gaim-chat"
+#define GAIM_STOCK_DIALOG_AUTH     "gaim-dialog-auth"
+#define GAIM_STOCK_DIALOG_COOL     "gaim-dialog-cool"
+#define GAIM_STOCK_DIALOG_ERROR    "gaim-dialog-error"
+#define GAIM_STOCK_DIALOG_INFO     "gaim-dialog-info"
+#define GAIM_STOCK_DIALOG_QUESTION "gaim-dialog-question"
+#define GAIM_STOCK_DIALOG_WARNING  "gaim-dialog-warning"
+#define GAIM_STOCK_DOWNLOAD        "gaim-download"
+#define GAIM_STOCK_EDIT            "gaim-edit"
+#define GAIM_STOCK_FGCOLOR         "gaim-fgcolor"
+#define GAIM_STOCK_FILE_CANCELED   "gaim-file-canceled"
+#define GAIM_STOCK_FILE_DONE       "gaim-file-done"
+#define GAIM_STOCK_FILE_TRANSFER   "gaim-file-transfer"
+#define GAIM_STOCK_ICON_AWAY       "gaim-icon-away"
+#define GAIM_STOCK_ICON_AWAY_MSG   "gaim-icon-away-msg"
+#define GAIM_STOCK_ICON_CONNECT    "gaim-icon-away-connect"
+#define GAIM_STOCK_ICON_OFFLINE    "gaim-icon-offline"
+#define GAIM_STOCK_ICON_ONLINE     "gaim-icon-online"
+#define GAIM_STOCK_ICON_ONLINE_MSG "gaim-icon-online-msg"
+#define GAIM_STOCK_IGNORE          "gaim-ignore"
+#define GAIM_STOCK_IM              "gaim-im"
+#define GAIM_STOCK_IMAGE           "gaim-image"
+#define GAIM_STOCK_INFO            "gaim-info"
+#define GAIM_STOCK_INVITE          "gaim-invite"
+#define GAIM_STOCK_LINK            "gaim-link"
+#define GAIM_STOCK_LOGO            "gaim-logo"
+#define GAIM_STOCK_MODIFY          "gaim-modify"
+#define GAIM_STOCK_OPEN_MAIL       "gaim-stock-open-mail"
+#define GAIM_STOCK_PAUSE           "gaim-pause"
+#define GAIM_STOCK_SEND            "gaim-send"
+#define GAIM_STOCK_SIGN_OFF        "gaim-sign-off"
+#define GAIM_STOCK_SIGN_ON         "gaim-sign-on"
+#define GAIM_STOCK_SMILEY          "gaim-smiley"
+#define GAIM_STOCK_TEXT_BIGGER     "gaim-text-bigger"
+#define GAIM_STOCK_TEXT_NORMAL     "gaim-text-normal"
+#define GAIM_STOCK_TEXT_SMALLER    "gaim-text-smaller"
+#define GAIM_STOCK_TYPED           "gaim-typed"
+#define GAIM_STOCK_TYPING          "gaim-typing"
+#define GAIM_STOCK_UPLOAD          "gaim-upload"
+#define GAIM_STOCK_WARN            "gaim-warn"
+/*@}*/
+
+/**
+ * For using icons that aren't one of the default GTK_ICON_SIZEs
+ */
+#define GAIM_ICON_SIZE_DIALOG_COOL "gaim-icon-size-dialog-cool"
+#define GAIM_ICON_SIZE_LOGO        "gaim-icon-size-logo"
+
+/**
+ * Sets up the gaim stock repository.
+ */
+void gaim_gtk_stock_init(void);
+
+#endif /* _GAIM_STOCK_H_ */
--- a/src/main.c	Thu Dec 02 16:07:26 2004 +0000
+++ b/src/main.c	Thu Dec 02 20:34:19 2004 +0000
@@ -56,7 +56,7 @@
 #include "gtkroomlist.h"
 #include "gtksound.h"
 #include "gtkutils.h"
-#include "stock.h"
+#include "gtkstock.h"
 
 #if HAVE_SIGNAL_H
 # include <signal.h>
--- a/src/stock.c	Thu Dec 02 16:07:26 2004 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,228 +0,0 @@
-/**
- * @file stock.c GTK+ Stock resources
- *
- * gaim
- *
- * Gaim is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-#include "internal.h"
-#include "gtkgaim.h"
-
-#include "stock.h"
-
-static struct StockIcon
-{
-	const char *name;
-	const char *dir;
-	const char *filename;
-
-} const stock_icons[] =
-{
-	{ GAIM_STOCK_ABOUT,           "buttons", "about_menu.png"           },
-	{ GAIM_STOCK_ACCOUNTS,        "buttons", "accounts.png"             },
-	{ GAIM_STOCK_ALIAS,           "buttons", "edit.png"                 },
-	{ GAIM_STOCK_BGCOLOR,         "buttons", "change-bgcolor-small.png" },
-	{ GAIM_STOCK_BLOCK,           NULL,      GTK_STOCK_STOP             },
-	{ GAIM_STOCK_CHAT,            NULL,      GTK_STOCK_JUMP_TO          },
-	{ GAIM_STOCK_DOWNLOAD,        NULL,      GTK_STOCK_GO_DOWN          },
-	{ GAIM_STOCK_DIALOG_AUTH,     "dialogs", "gaim_auth.png"            },
-	{ GAIM_STOCK_DIALOG_COOL,     "dialogs", "gaim_cool.png"            },
-	{ GAIM_STOCK_DIALOG_ERROR,    "dialogs", "gaim_error.png"           },
-	{ GAIM_STOCK_DIALOG_INFO,     "dialogs", "gaim_info.png"            },
-	{ GAIM_STOCK_DIALOG_QUESTION, "dialogs", "gaim_question.png"        },
-	{ GAIM_STOCK_DIALOG_WARNING,  "dialogs", "gaim_warning.png"         },
-	{ GAIM_STOCK_FGCOLOR,         "buttons", "change-fgcolor-small.png" },
-	{ GAIM_STOCK_EDIT,            "buttons", "edit.png"                 },
-	{ GAIM_STOCK_FILE_CANCELED,   NULL,      GTK_STOCK_CANCEL           },
-	{ GAIM_STOCK_FILE_DONE,       NULL,      GTK_STOCK_APPLY            },
-	{ GAIM_STOCK_FILE_TRANSFER,   NULL,      GTK_STOCK_REVERT_TO_SAVED  },
-	{ GAIM_STOCK_ICON_AWAY,       "icons",   "away.png"                 },
-	{ GAIM_STOCK_ICON_AWAY_MSG,   "icons",   "msgpend.png"              },
-	{ GAIM_STOCK_ICON_CONNECT,    "icons",   "connect.png"              },
-	{ GAIM_STOCK_ICON_OFFLINE,    "icons",   "offline.png"              },
-	{ GAIM_STOCK_ICON_ONLINE,     "icons",   "online.png"               },
-	{ GAIM_STOCK_ICON_ONLINE_MSG, "icons",   "msgunread.png"            },
-	{ GAIM_STOCK_IGNORE,          NULL,      GTK_STOCK_DIALOG_ERROR     },
-	{ GAIM_STOCK_IM,              "buttons", "send-im.png"		        },
-	{ GAIM_STOCK_IMAGE,           "buttons", "insert-image-small.png"   },
-	{ GAIM_STOCK_INFO,            "icons",   "info.png",                },
-	{ GAIM_STOCK_INVITE,          NULL,      GTK_STOCK_JUMP_TO          },
-	{ GAIM_STOCK_LINK,            "buttons", "insert-link-small.png"    },
-	{ GAIM_STOCK_LOGO,            "gaim",    "logo.png"                 },
-	{ GAIM_STOCK_MODIFY,          NULL,      GTK_STOCK_PREFERENCES      },
-	{ GAIM_STOCK_PAUSE,           "buttons", "pause.png"                },
-	{ GAIM_STOCK_OPEN_MAIL,       NULL,      GTK_STOCK_JUMP_TO          },
-	{ GAIM_STOCK_SEND,            "buttons", "send-im.png"              },
-	{ GAIM_STOCK_SIGN_ON,         NULL,      GTK_STOCK_EXECUTE          },
-	{ GAIM_STOCK_SIGN_OFF,        NULL,      GTK_STOCK_CLOSE            },
-	{ GAIM_STOCK_SMILEY,          "buttons", "insert-smiley-small.png"  },
-	{ GAIM_STOCK_TEXT_BIGGER,     "buttons", "text_bigger.png"          },
-	{ GAIM_STOCK_TEXT_NORMAL,     "buttons", "text_normal.png"          },
-	{ GAIM_STOCK_TEXT_SMALLER,    "buttons", "text_smaller.png"         },
-	{ GAIM_STOCK_TYPED,           "gaim",    "typed.png"                },
-	{ GAIM_STOCK_TYPING,          "gaim",    "typing.png"               },
-	{ GAIM_STOCK_UPLOAD,          NULL,      GTK_STOCK_GO_UP            },
-	{ GAIM_STOCK_WARN,            NULL,      GTK_STOCK_DIALOG_WARNING   }
-};
-
-const GtkStockItem stock_items[] =
-{
-	{ GAIM_STOCK_ALIAS,     N_("_Alias"),     0, 0, NULL },
-	{ GAIM_STOCK_CHAT,      N_("_Join"),      0, 0, NULL },
-	{ GAIM_STOCK_INVITE,    N_("_Invite"),    0, 0, NULL },
-	{ GAIM_STOCK_MODIFY,    N_("_Modify"),    0, 0, NULL },
-	{ GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL },
-	{ GAIM_STOCK_PAUSE,     N_("_Pause"),     0, 0, NULL },
-	{ GAIM_STOCK_WARN,      N_("_Warn"),      0, 0, NULL }
-};
-
-static gchar *
-find_file(const char *dir, const char *base)
-{
-	char *filename;
-
-	if (base == NULL)
-		return NULL;
-
-	if (!strcmp(dir, "gaim"))
-		filename = g_build_filename(DATADIR, "pixmaps", "gaim", base, NULL);
-	else
-	{
-		filename = g_build_filename(DATADIR, "pixmaps", "gaim", dir,
-									base, NULL);
-	}
-
-	if (!g_file_test(filename, G_FILE_TEST_EXISTS))
-	{
-		g_critical("Unable to load stock pixmap %s\n", base);
-
-		g_free(filename);
-
-		return NULL;
-	}
-
-	return filename;
-}
-
-static void
-gaim_gtk_stock_versionize(GdkPixbuf **original, GtkWidget *widget) {
-	GdkPixmap *pixmap;
-	GtkStyle *style;
-	PangoContext *context;
-	PangoLayout *layout;
-	gchar *markup;
-	gint width, height;
-	gint lwidth = 0, lheight = 0;
-
-	style = gtk_widget_get_style(widget);
-
-	gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255);
-	width = gdk_pixbuf_get_width(*original);
-	height = gdk_pixbuf_get_height(*original);
-	g_object_unref(G_OBJECT(*original));
-
-	context = gtk_widget_get_pango_context(widget);
-	layout = pango_layout_new(context);
-
-	markup = g_strdup_printf("<span foreground=\"#FFFFFF\" size=\"larger\">%s</span>", VERSION);
-	pango_layout_set_font_description(layout, style->font_desc);
-	pango_layout_set_markup(layout, markup, strlen(markup));
-	g_free(markup);
-
-	pango_layout_get_pixel_size(layout, &lwidth, &lheight);
-	gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL],
-					width - (lwidth + 3), height - (lheight + 1), layout);
-	g_object_unref(G_OBJECT(layout));
-
-	*original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL,
-											 0, 0, 0, 0,
-											 width, height);
-	g_object_unref(G_OBJECT(pixmap));
-}
-
-void
-gaim_gtk_stock_init(void)
-{
-	static gboolean stock_initted = FALSE;
-	GtkIconFactory *icon_factory;
-	int i;
-	GtkWidget *win;
-
-	if (stock_initted)
-		return;
-
-	stock_initted = TRUE;
-
-	/* Setup the icon factory. */
-	icon_factory = gtk_icon_factory_new();
-
-	gtk_icon_factory_add_default(icon_factory);
-
-	/* Er, yeah, a hack, but it works. :) */
-	win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-	gtk_widget_realize(win);
-
-	for (i = 0; i < G_N_ELEMENTS(stock_icons); i++)
-	{
-		GdkPixbuf *pixbuf;
-		GtkIconSet *iconset;
-		gchar *filename;
-
-		if (stock_icons[i].dir == NULL)
-		{
-			/* GTK+ Stock icon */
-			iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win),
-												stock_icons[i].filename);
-		}
-		else
-		{
-			filename = find_file(stock_icons[i].dir, stock_icons[i].filename);
-
-			if (filename == NULL)
-				continue;
-
-			pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-
-			g_free(filename);
-
-			if (!strcmp(stock_icons[i].name, GAIM_STOCK_LOGO))
-				gaim_gtk_stock_versionize(&pixbuf, win);
-
-			iconset = gtk_icon_set_new_from_pixbuf(pixbuf);
-
-			g_object_unref(G_OBJECT(pixbuf));
-		}
-
-		gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset);
-
-		gtk_icon_set_unref(iconset);
-	}
-
-	gtk_widget_destroy(win);
-
-	/* register custom icon sizes */
-	gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 330, 90);
-	gtk_icon_size_register(GAIM_ICON_SIZE_DIALOG_COOL, 40, 60);
-
-	g_object_unref(G_OBJECT(icon_factory));
-
-	/* Register the stock items. */
-	gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items));
-}
--- a/src/stock.h	Thu Dec 02 16:07:26 2004 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/**
- * @file stock.h GTK+ Stock resources
- * @ingroup gtkui
- *
- * gaim
- *
- * Gaim is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- * 
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef _GAIM_STOCK_H_
-#define _GAIM_STOCK_H_
-
-/**************************************************************************/
-/** @name Stock images                                                    */
-/**************************************************************************/
-/*@{*/
-#define GAIM_STOCK_ABOUT           "gaim-about"
-#define GAIM_STOCK_ACCOUNTS        "gaim-accounts"
-#define GAIM_STOCK_ALIAS           "gaim-alias"
-#define GAIM_STOCK_AWAY            "gaim-away"
-#define GAIM_STOCK_BGCOLOR         "gaim-bgcolor"
-#define GAIM_STOCK_BLOCK           "gaim-block"
-#define GAIM_STOCK_CHAT            "gaim-chat"
-#define GAIM_STOCK_DIALOG_AUTH     "gaim-dialog-auth"
-#define GAIM_STOCK_DIALOG_COOL     "gaim-dialog-cool"
-#define GAIM_STOCK_DIALOG_ERROR    "gaim-dialog-error"
-#define GAIM_STOCK_DIALOG_INFO     "gaim-dialog-info"
-#define GAIM_STOCK_DIALOG_QUESTION "gaim-dialog-question"
-#define GAIM_STOCK_DIALOG_WARNING  "gaim-dialog-warning"
-#define GAIM_STOCK_DOWNLOAD        "gaim-download"
-#define GAIM_STOCK_EDIT            "gaim-edit"
-#define GAIM_STOCK_FGCOLOR         "gaim-fgcolor"
-#define GAIM_STOCK_FILE_CANCELED   "gaim-file-canceled"
-#define GAIM_STOCK_FILE_DONE       "gaim-file-done"
-#define GAIM_STOCK_FILE_TRANSFER   "gaim-file-transfer"
-#define GAIM_STOCK_ICON_AWAY       "gaim-icon-away"
-#define GAIM_STOCK_ICON_AWAY_MSG   "gaim-icon-away-msg"
-#define GAIM_STOCK_ICON_CONNECT    "gaim-icon-away-connect"
-#define GAIM_STOCK_ICON_OFFLINE    "gaim-icon-offline"
-#define GAIM_STOCK_ICON_ONLINE     "gaim-icon-online"
-#define GAIM_STOCK_ICON_ONLINE_MSG "gaim-icon-online-msg"
-#define GAIM_STOCK_IGNORE          "gaim-ignore"
-#define GAIM_STOCK_IM              "gaim-im"
-#define GAIM_STOCK_IMAGE           "gaim-image"
-#define GAIM_STOCK_INFO            "gaim-info"
-#define GAIM_STOCK_INVITE          "gaim-invite"
-#define GAIM_STOCK_LINK            "gaim-link"
-#define GAIM_STOCK_LOGO            "gaim-logo"
-#define GAIM_STOCK_MODIFY          "gaim-modify"
-#define GAIM_STOCK_OPEN_MAIL       "gaim-stock-open-mail"
-#define GAIM_STOCK_PAUSE           "gaim-pause"
-#define GAIM_STOCK_SEND            "gaim-send"
-#define GAIM_STOCK_SIGN_OFF        "gaim-sign-off"
-#define GAIM_STOCK_SIGN_ON         "gaim-sign-on"
-#define GAIM_STOCK_SMILEY          "gaim-smiley"
-#define GAIM_STOCK_TEXT_BIGGER     "gaim-text-bigger"
-#define GAIM_STOCK_TEXT_NORMAL     "gaim-text-normal"
-#define GAIM_STOCK_TEXT_SMALLER    "gaim-text-smaller"
-#define GAIM_STOCK_TYPED           "gaim-typed"
-#define GAIM_STOCK_TYPING          "gaim-typing"
-#define GAIM_STOCK_UPLOAD          "gaim-upload"
-#define GAIM_STOCK_WARN            "gaim-warn"
-/*@}*/
-
-/**
- * For using icons that aren't one of the default GTK_ICON_SIZEs
- */
-#define GAIM_ICON_SIZE_DIALOG_COOL "gaim-icon-size-dialog-cool"
-#define GAIM_ICON_SIZE_LOGO        "gaim-icon-size-logo"
-
-/**
- * Sets up the gaim stock repository.
- */
-void gaim_gtk_stock_init(void);
-
-#endif /* _GAIM_STOCK_H_ */