1
/* LIBGIMP - The GIMP Library
2
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
4
* gimpwidgets-private.c
5
* Copyright (C) 2003 Sven Neumann <sven@gimp.org>
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the
19
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
* Boston, MA 02111-1307, USA.
27
#include "libgimpbase/gimpbase.h"
29
#include "gimpwidgetstypes.h"
31
#include "gimphelpui.h"
32
#include "gimpstock.h"
33
#include "gimpwidgets-private.h"
35
#include "themes/Default/images/gimp-wilber-pixbufs.h"
38
GimpHelpFunc _gimp_standard_help_func = NULL;
39
GimpGetColorFunc _gimp_get_foreground_func = NULL;
40
GimpGetColorFunc _gimp_get_background_func = NULL;
41
GimpEnsureModulesFunc _gimp_ensure_modules_func = NULL;
45
gimp_widgets_init (GimpHelpFunc standard_help_func,
46
GimpGetColorFunc get_foreground_func,
47
GimpGetColorFunc get_background_func,
48
GimpEnsureModulesFunc ensure_modules_func)
50
static gboolean gimp_widgets_initialized = FALSE;
53
GList *icon_list = NULL;
56
const guint8 *inline_pixbufs[] =
64
g_return_if_fail (standard_help_func != NULL);
66
if (gimp_widgets_initialized)
67
g_error ("gimp_widgets_init() must only be called once!");
69
_gimp_standard_help_func = standard_help_func;
70
_gimp_get_foreground_func = get_foreground_func;
71
_gimp_get_background_func = get_background_func;
72
_gimp_ensure_modules_func = ensure_modules_func;
76
for (i = 0; i < G_N_ELEMENTS (inline_pixbufs); i++)
78
pixbuf = gdk_pixbuf_new_from_inline (-1, inline_pixbufs[i], FALSE, NULL);
79
icon_list = g_list_prepend (icon_list, pixbuf);
82
gtk_window_set_default_icon_list (icon_list);
84
g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
85
g_list_free (icon_list);
89
gimp_widgets_initialized = TRUE;