gimp r25971 - in branches/soc-2008-tagging: . app app/actions app/config app/core app/dialogs app/gegl app/gui app/paint app/pdb app/plug-in app/tools app/widgets cursors desktop devel-docs devel-docs/app devel-docs/libgimpwidgets devel-docs/libgimpwidgets/tmpl docs etc libgimpwidgets modules plug-ins/common plug-ins/help plug-ins/help-browser plug-ins/imagemap po po-libgimp po-plug-ins po-python po-script-fu po-tips themes/Default/images tools/pdbgen/pdb
- From: aurisj svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25971 - in branches/soc-2008-tagging: . app app/actions app/config app/core app/dialogs app/gegl app/gui app/paint app/pdb app/plug-in app/tools app/widgets cursors desktop devel-docs devel-docs/app devel-docs/libgimpwidgets devel-docs/libgimpwidgets/tmpl docs etc libgimpwidgets modules plug-ins/common plug-ins/help plug-ins/help-browser plug-ins/imagemap po po-libgimp po-plug-ins po-python po-script-fu po-tips themes/Default/images tools/pdbgen/pdb
- Date: Sat, 21 Jun 2008 05:12:58 +0000 (UTC)
Author: aurisj
Date: Sat Jun 21 05:12:58 2008
New Revision: 25971
URL: http://svn.gnome.org/viewvc/gimp?rev=25971&view=rev
Log:
2008-06-21 Aurimas JuÅka <aurisj svn gnome org>
Merged from trunk revisions r25900:r25969.
Added:
branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c
- copied unchanged from r25970, /trunk/app/widgets/gimpsettingsbox.c
branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h
- copied unchanged from r25970, /trunk/app/widgets/gimpsettingsbox.h
branches/soc-2008-tagging/themes/Default/images/stock-user-manual-16.png
- copied unchanged from r25970, /trunk/themes/Default/images/stock-user-manual-16.png
branches/soc-2008-tagging/themes/Default/images/stock-user-manual-24.png
- copied unchanged from r25970, /trunk/themes/Default/images/stock-user-manual-24.png
branches/soc-2008-tagging/themes/Default/images/stock-user-manual-32.png
- copied unchanged from r25970, /trunk/themes/Default/images/stock-user-manual-32.png
branches/soc-2008-tagging/themes/Default/images/stock-user-manual-64.png
- copied unchanged from r25970, /trunk/themes/Default/images/stock-user-manual-64.png
branches/soc-2008-tagging/themes/Default/images/stock-user-manual.svg
- copied unchanged from r25970, /trunk/themes/Default/images/stock-user-manual.svg
Removed:
branches/soc-2008-tagging/plug-ins/help-browser/queue.c
branches/soc-2008-tagging/plug-ins/help-browser/queue.h
branches/soc-2008-tagging/plug-ins/help-browser/wilber-reading.png
branches/soc-2008-tagging/plug-ins/help-browser/wilber-reading.svg
Modified:
branches/soc-2008-tagging/ChangeLog
branches/soc-2008-tagging/INSTALL
branches/soc-2008-tagging/Makefile.am
branches/soc-2008-tagging/NEWS
branches/soc-2008-tagging/app/actions/help-commands.c
branches/soc-2008-tagging/app/config/Makefile.am
branches/soc-2008-tagging/app/config/gimpguiconfig.c
branches/soc-2008-tagging/app/config/gimpguiconfig.h
branches/soc-2008-tagging/app/config/gimprc-blurbs.h
branches/soc-2008-tagging/app/core/gimp-gui.c
branches/soc-2008-tagging/app/core/gimp-gui.h
branches/soc-2008-tagging/app/dialogs/preferences-dialog.c
branches/soc-2008-tagging/app/gegl/gimpoperationcolorbalance.c
branches/soc-2008-tagging/app/gegl/gimpoperationcolorize.c
branches/soc-2008-tagging/app/gegl/gimpoperationcurves.c
branches/soc-2008-tagging/app/gegl/gimpoperationdesaturate.c
branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c
branches/soc-2008-tagging/app/gegl/gimpoperationlevels.c
branches/soc-2008-tagging/app/gegl/gimpoperationposterize.c
branches/soc-2008-tagging/app/gegl/gimpoperationthreshold.c
branches/soc-2008-tagging/app/gegl/gimpoperationtilesink.c
branches/soc-2008-tagging/app/gegl/gimpoperationtilesource.c
branches/soc-2008-tagging/app/gui/gui-vtable.c
branches/soc-2008-tagging/app/gui/gui.c
branches/soc-2008-tagging/app/paint/gimppaintoptions.c
branches/soc-2008-tagging/app/pdb/help-cmds.c
branches/soc-2008-tagging/app/plug-in/gimpplugin.c
branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c
branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c
branches/soc-2008-tagging/app/sanity.c
branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h
branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c
branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c
branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.h
branches/soc-2008-tagging/app/tools/gimpimagemaptool.c
branches/soc-2008-tagging/app/tools/gimpimagemaptool.h
branches/soc-2008-tagging/app/tools/gimprectangletool.c
branches/soc-2008-tagging/app/tools/gimptextoptions.c
branches/soc-2008-tagging/app/widgets/Makefile.am
branches/soc-2008-tagging/app/widgets/gimpdockable.c
branches/soc-2008-tagging/app/widgets/gimphelp.c
branches/soc-2008-tagging/app/widgets/gimphelp.h
branches/soc-2008-tagging/app/widgets/gimpthumbbox.c
branches/soc-2008-tagging/app/widgets/gimpuimanager.c
branches/soc-2008-tagging/app/widgets/gimpuimanager.h
branches/soc-2008-tagging/app/widgets/widgets-types.h
branches/soc-2008-tagging/autogen.sh
branches/soc-2008-tagging/configure.in
branches/soc-2008-tagging/cursors/Makefile.am
branches/soc-2008-tagging/desktop/gimp.desktop.in.in
branches/soc-2008-tagging/devel-docs/ChangeLog
branches/soc-2008-tagging/devel-docs/app/app-docs.sgml
branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt
branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml
branches/soc-2008-tagging/docs/gimprc.5.in
branches/soc-2008-tagging/etc/gimprc
branches/soc-2008-tagging/libgimpwidgets/gimpstock.c
branches/soc-2008-tagging/libgimpwidgets/gimpstock.h
branches/soc-2008-tagging/modules/controller_midi.c
branches/soc-2008-tagging/plug-ins/common/filter-pack.c
branches/soc-2008-tagging/plug-ins/common/sample-colorize.c
branches/soc-2008-tagging/plug-ins/help-browser/Makefile.am
branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
branches/soc-2008-tagging/plug-ins/help-browser/dialog.h
branches/soc-2008-tagging/plug-ins/help-browser/gimpthrobber.c
branches/soc-2008-tagging/plug-ins/help-browser/help-browser.c
branches/soc-2008-tagging/plug-ins/help/gimphelp.c
branches/soc-2008-tagging/plug-ins/help/gimphelplocale.c
branches/soc-2008-tagging/plug-ins/help/help.c
branches/soc-2008-tagging/plug-ins/imagemap/imap_main.c
branches/soc-2008-tagging/po-libgimp/ (props changed)
branches/soc-2008-tagging/po-plug-ins/ (props changed)
branches/soc-2008-tagging/po-plug-ins/ChangeLog
branches/soc-2008-tagging/po-plug-ins/de.po
branches/soc-2008-tagging/po-plug-ins/ru.po
branches/soc-2008-tagging/po-plug-ins/sl.po (props changed)
branches/soc-2008-tagging/po-python/ (props changed)
branches/soc-2008-tagging/po-script-fu/ (props changed)
branches/soc-2008-tagging/po-tips/ (props changed)
branches/soc-2008-tagging/po/ChangeLog
branches/soc-2008-tagging/po/POTFILES.in
branches/soc-2008-tagging/po/ru.po
branches/soc-2008-tagging/themes/Default/images/Makefile.am
branches/soc-2008-tagging/tools/pdbgen/pdb/help.pdb
Modified: branches/soc-2008-tagging/INSTALL
==============================================================================
--- branches/soc-2008-tagging/INSTALL (original)
+++ branches/soc-2008-tagging/INSTALL Sat Jun 21 05:12:58 2008
@@ -28,8 +28,8 @@
1. You need to have installed a recent version of pkg-config available
from http://www.freedesktop.org/software/pkgconfig/.
- 2. You need to have GEGL version 0.0.17 or newer and babl version
- 0.0.21 or newer. You can get it from http://gegl.org/ or check
+ 2. You need to have GEGL version 0.0.18 or newer and babl version
+ 0.0.22 or newer. You can get it from http://gegl.org/ or check
it out from the subversion repository:
http://svn.gnome.org/svn/babl/trunk
@@ -56,7 +56,7 @@
7. You may want to install other third party libraries or programs
that are needed for some of the available plugins. We recommend
to check that the following libraries are installed: libpng,
- libjpeg, libpoppler, libtiff, gtkhtml-2, libmng, librsvg, libwmf.
+ libjpeg, libpoppler, libtiff, webkit, libmng, librsvg, libwmf.
8. The Python extension requires Python development headers to be
present. You will also need PyGTK and the respective development
@@ -150,8 +150,8 @@
use --without-mng to disable it expliticely. The same switch exists
for aalib, use --without-aa if you run into problems.
- --without-gtkhtml2. If for some reason you don't want to build the
- helpbrowser plug-in, you can use --without-gtkhtml2 to disable
+ --without-webkit. If for some reason you don't want to build the
+ helpbrowser plug-in, you can use --without-webkit to disable
it explicitly.
--without-svg. If for some reason you want to build GIMP without
Modified: branches/soc-2008-tagging/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/Makefile.am (original)
+++ branches/soc-2008-tagging/Makefile.am Sat Jun 21 05:12:58 2008
@@ -70,20 +70,12 @@
config.h.win32 \
gimp-zip.in \
gimpdefs.msc \
- intltool-extract.in \
- intltool-merge.in \
- intltool-update.in \
makefile.msc \
mkinstalldirs
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
-DISTCLEANFILES = \
- intltool-extract \
- intltool-merge \
- intltool-update
-
gimpinstall- GIMP_TOOL_VERSION@:
$(LN_S) $(srcdir)/install-sh $(srcdir)/gimpinstall- GIMP_TOOL_VERSION@
Modified: branches/soc-2008-tagging/NEWS
==============================================================================
--- branches/soc-2008-tagging/NEWS (original)
+++ branches/soc-2008-tagging/NEWS Sat Jun 21 05:12:58 2008
@@ -1,4 +1,4 @@
- ------------------------------
+ ------------------------------
GNU Image Manipulation Program
Development Branch
------------------------------
@@ -15,13 +15,30 @@
- improved Alpha to Logo filters
- better cursor feedback in the Intelligent Scissors tool
- rotate JPEG thumbnails according to the EXIF orientation
- - tweaked behavior of the new Polygon Selection tool
- improved event smoothing for paint tools
- prepared PSP plug-in to deal with newer versions of the file format
- allow plug-ins to work in parallel on different layers of the same image
- pass through GEGL command-line options
- added 22 new variations to the Flame plugin
- only show operations from relevant categories in the GEGL tool
+ - allow to enter the zoom ratio in the status bar
+ - don't keep the file-chooser dialogs around
+ - ported scan-convert code to Cairo, removing libart dependency
+ - allow the paint velocity to affect brush size, opacity and the like
+ - allow for random variations of the brush size, opacity and the like
+ - renamed Dialogs menu to Windows
+ - keep a list of recently closed docks in the Windows menu
+ - allow to go from Brightness-Contrast to Levels to Curves
+ - improved the handling of color tool settings
+ - merged the new Polygon Selection tool with the Freehand Select tool
+ - allow to lock dockables
+ - made Desaturate into a tool with preview in the image window
+ - ported translation contexts to msgctxt
+ - added GimpRuler widgets, an improved version of GtkRuler
+ - moving the selection mask now commits a pending rectangle selection
+ - added keyboard shortcut for resetting the brush scale (Backslash)
+ - ported the Help Browser plug-in to WebKit
+ - allow to use the online user manual
- added new translation (Icelandic)
- bug fixes and code cleanup
@@ -79,7 +96,7 @@
- randomize: added previews
- ripple: added a Phase Shift control
- screenshot: optionally add the mouse cursor image on an extra layer
- - uri: use GIO/GVfs where available
+ - uri: use GIO/GVfs where available
- whirlpinch: allow a larger range for the whirl angle
Modified: branches/soc-2008-tagging/app/actions/help-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/help-commands.c (original)
+++ branches/soc-2008-tagging/app/actions/help-commands.c Sat Jun 21 05:12:58 2008
@@ -24,6 +24,10 @@
#include "actions-types.h"
+#include "core/gimpprogress.h"
+
+#include "widgets/gimphelp.h"
+
#include "actions.h"
#include "help-commands.h"
@@ -32,7 +36,12 @@
help_help_cmd_callback (GtkAction *action,
gpointer data)
{
- gimp_standard_help_func (NULL, NULL);
+ Gimp *gimp;
+ GimpDisplay *display;
+ return_if_no_gimp (gimp, data);
+ return_if_no_display (display, data);
+
+ gimp_help_show (gimp, GIMP_PROGRESS (display), NULL, NULL);
}
void
Modified: branches/soc-2008-tagging/app/config/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/config/Makefile.am (original)
+++ branches/soc-2008-tagging/app/config/Makefile.am Sat Jun 21 05:12:58 2008
@@ -40,7 +40,8 @@
gimpxmlparser.h
AM_CPPFLAGS = \
- -DG_LOG_DOMAIN=\"Gimp-Config\"
+ -DG_LOG_DOMAIN=\"Gimp-Config\" \
+ -DGIMP_APP_VERSION_STRING=\"$(GIMP_APP_VERSION)\"
INCLUDES = \
-I$(top_builddir) \
@@ -65,10 +66,11 @@
test_config_DEPENDENCIES = $(gimpconfig_libs)
test_config_LDFLAGS = \
- -u $(SYMPREFIX)xcf_init \
- -u $(SYMPREFIX)internal_procs_init \
- -u $(SYMPREFIX)gimp_coords_mix \
- -u $(SYMPREFIX)gimp_plug_in_manager_restore
+ -u $(SYMPREFIX)xcf_init \
+ -u $(SYMPREFIX)internal_procs_init \
+ -u $(SYMPREFIX)gimp_coords_mix \
+ -u $(SYMPREFIX)gimp_plug_in_manager_restore \
+ -u $(SYMPREFIX)gimp_image_map_config_get_type
test_config_LDADD = \
../widgets/widgets-enums.o \
@@ -83,8 +85,8 @@
../vectors/libappvectors.a \
../paint/libapppaint.a \
../text/libapptext.a \
- libappconfig.a \
../gegl/libappgegl.a \
+ libappconfig.a \
../paint-funcs/libapppaint-funcs.a \
../composite/libappcomposite.a \
../base/libappbase.a \
@@ -95,6 +97,7 @@
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpbase) \
+ $(CAIRO_LIBS) \
$(PANGOFT2_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(LIBART_LIBS) \
Modified: branches/soc-2008-tagging/app/config/gimpguiconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/config/gimpguiconfig.c (original)
+++ branches/soc-2008-tagging/app/config/gimpguiconfig.c Sat Jun 21 05:12:58 2008
@@ -34,15 +34,18 @@
#include "gimp-intl.h"
-#define DEFAULT_GIMP_HELP_BROWSER GIMP_HELP_BROWSER_GIMP
-#define DEFAULT_THEME "Default"
+#define DEFAULT_HELP_BROWSER GIMP_HELP_BROWSER_GIMP
+#define DEFAULT_THEME "Default"
+
+#define DEFAULT_USER_MANUAL_ONLINE_URI \
+ "http://docs.gimp.org/" GIMP_APP_VERSION_STRING
#ifdef G_OS_WIN32
-# define DEFAULT_WEB_BROWSER "not used on Windows"
+# define DEFAULT_WEB_BROWSER "not used on Windows"
#elif HAVE_CARBON
-# define DEFAULT_WEB_BROWSER "open %s"
+# define DEFAULT_WEB_BROWSER "open %s"
#else
-# define DEFAULT_WEB_BROWSER "xdg-open %s"
+# define DEFAULT_WEB_BROWSER "firefox %s"
#endif
@@ -74,6 +77,8 @@
PROP_HELP_LOCALES,
PROP_HELP_BROWSER,
PROP_WEB_BROWSER,
+ PROP_USER_MANUAL_ONLINE,
+ PROP_USER_MANUAL_ONLINE_URI,
PROP_TOOLBOX_WINDOW_HINT,
PROP_DOCK_WINDOW_HINT,
PROP_TRANSIENT_DOCKS,
@@ -217,13 +222,23 @@
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_HELP_BROWSER,
"help-browser", HELP_BROWSER_BLURB,
GIMP_TYPE_HELP_BROWSER_TYPE,
- DEFAULT_GIMP_HELP_BROWSER,
+ DEFAULT_HELP_BROWSER,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_WEB_BROWSER,
"web-browser", WEB_BROWSER_BLURB,
GIMP_CONFIG_PATH_FILE,
DEFAULT_WEB_BROWSER,
GIMP_PARAM_STATIC_STRINGS);
+ GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USER_MANUAL_ONLINE,
+ "user-manual-online",
+ USER_MANUAL_ONLINE_BLURB,
+ FALSE,
+ GIMP_PARAM_STATIC_STRINGS);
+ GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_USER_MANUAL_ONLINE_URI,
+ "user-manual-online-uri",
+ USER_MANUAL_ONLINE_URI_BLURB,
+ DEFAULT_USER_MANUAL_ONLINE_URI,
+ GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_TOOLBOX_WINDOW_HINT,
"toolbox-window-hint",
TOOLBOX_WINDOW_HINT_BLURB,
@@ -263,6 +278,7 @@
g_free (gui_config->theme);
g_free (gui_config->help_locales);
g_free (gui_config->web_browser);
+ g_free (gui_config->user_manual_online_uri);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -356,6 +372,13 @@
g_free (gui_config->web_browser);
gui_config->web_browser = g_value_dup_string (value);
break;
+ case PROP_USER_MANUAL_ONLINE:
+ gui_config->user_manual_online = g_value_get_boolean (value);
+ break;
+ case PROP_USER_MANUAL_ONLINE_URI:
+ g_free (gui_config->user_manual_online_uri);
+ gui_config->user_manual_online_uri = g_value_dup_string (value);
+ break;
case PROP_TOOLBOX_WINDOW_HINT:
gui_config->toolbox_window_hint = g_value_get_enum (value);
break;
@@ -460,6 +483,12 @@
case PROP_WEB_BROWSER:
g_value_set_string (value, gui_config->web_browser);
break;
+ case PROP_USER_MANUAL_ONLINE:
+ g_value_set_boolean (value, gui_config->user_manual_online);
+ break;
+ case PROP_USER_MANUAL_ONLINE_URI:
+ g_value_set_string (value, gui_config->user_manual_online_uri);
+ break;
case PROP_TOOLBOX_WINDOW_HINT:
g_value_set_enum (value, gui_config->toolbox_window_hint);
break;
Modified: branches/soc-2008-tagging/app/config/gimpguiconfig.h
==============================================================================
--- branches/soc-2008-tagging/app/config/gimpguiconfig.h (original)
+++ branches/soc-2008-tagging/app/config/gimpguiconfig.h Sat Jun 21 05:12:58 2008
@@ -65,6 +65,8 @@
gchar *help_locales;
GimpHelpBrowserType help_browser;
gchar *web_browser;
+ gboolean user_manual_online;
+ gchar *user_manual_online_uri;
GimpWindowHint toolbox_window_hint;
GimpWindowHint dock_window_hint;
gboolean transient_docks;
Modified: branches/soc-2008-tagging/app/config/gimprc-blurbs.h
==============================================================================
--- branches/soc-2008-tagging/app/config/gimprc-blurbs.h (original)
+++ branches/soc-2008-tagging/app/config/gimprc-blurbs.h Sat Jun 21 05:12:58 2008
@@ -419,6 +419,14 @@
#define USE_HELP_BLURB \
N_("When enabled, pressing F1 will open the help browser.")
+#define USER_MANUAL_ONLINE_BLURB \
+N_("When enabled, the online user manual will be used by the help system. " \
+ "Otherwise the locally installed copy is used.")
+
+#define USER_MANUAL_ONLINE_URI_BLURB \
+"The location of the online user manual. This is used if " \
+"'user-manual-online' is enabled."
+
#define WEB_BROWSER_BLURB \
N_("Sets the external web browser to be used. This can be an absolute " \
"path or the name of an executable to search for in the user's PATH. " \
Modified: branches/soc-2008-tagging/app/core/gimp-gui.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-gui.c (original)
+++ branches/soc-2008-tagging/app/core/gimp-gui.c Sat Jun 21 05:12:58 2008
@@ -190,14 +190,16 @@
}
void
-gimp_help (Gimp *gimp,
- const gchar *help_domain,
- const gchar *help_id)
+gimp_help (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *help_domain,
+ const gchar *help_id)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
+ g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (gimp->gui.help)
- gimp->gui.help (gimp, help_domain, help_id);
+ gimp->gui.help (gimp, progress, help_domain, help_id);
}
const gchar *
Modified: branches/soc-2008-tagging/app/core/gimp-gui.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-gui.h (original)
+++ branches/soc-2008-tagging/app/core/gimp-gui.h Sat Jun 21 05:12:58 2008
@@ -38,6 +38,7 @@
const gchar *domain,
const gchar *message);
void (* help) (Gimp *gimp,
+ GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id);
@@ -126,6 +127,7 @@
const gchar *domain,
const gchar *message);
void gimp_help (Gimp *gimp,
+ GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id);
Modified: branches/soc-2008-tagging/app/dialogs/preferences-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/preferences-dialog.c (original)
+++ branches/soc-2008-tagging/app/dialogs/preferences-dialog.c Sat Jun 21 05:12:58 2008
@@ -1797,6 +1797,18 @@
_("Show help _buttons"),
GTK_BOX (vbox2));
+ {
+ GtkWidget *combo;
+
+ table = prefs_table_new (1, GTK_CONTAINER (vbox2));
+ combo = prefs_boolean_combo_box_add (object, "user-manual-online",
+ _("Use the online version"),
+ _("Use a locally installed copy"),
+ _("User manual:"),
+ GTK_TABLE (table), 0, size_group);
+ gimp_help_set_help_data (combo, NULL, NULL);
+ }
+
/* Help Browser */
vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationcolorbalance.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationcolorbalance.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationcolorbalance.c Sat Jun 21 05:12:58 2008
@@ -32,11 +32,11 @@
#include "gimpoperationcolorbalance.h"
-static gboolean gimp_operation_color_balance_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_color_balance_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationColorBalance, gimp_operation_color_balance,
@@ -113,11 +113,11 @@
}
static gboolean
-gimp_operation_color_balance_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_color_balance_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpColorBalanceConfig *config = GIMP_COLOR_BALANCE_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationcolorize.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationcolorize.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationcolorize.c Sat Jun 21 05:12:58 2008
@@ -31,11 +31,11 @@
#include "gimpoperationcolorize.h"
-static gboolean gimp_operation_colorize_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_colorize_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationColorize, gimp_operation_colorize,
@@ -76,11 +76,11 @@
}
static gboolean
-gimp_operation_colorize_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_colorize_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpColorizeConfig *config = GIMP_COLORIZE_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationcurves.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationcurves.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationcurves.c Sat Jun 21 05:12:58 2008
@@ -35,11 +35,11 @@
#include "gimpoperationcurves.h"
-static gboolean gimp_operation_curves_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_curves_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationCurves, gimp_operation_curves,
@@ -80,11 +80,11 @@
}
static gboolean
-gimp_operation_curves_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_curves_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpCurvesConfig *config = GIMP_CURVES_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationdesaturate.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationdesaturate.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationdesaturate.c Sat Jun 21 05:12:58 2008
@@ -31,11 +31,11 @@
#include "gimpdesaturateconfig.h"
-static gboolean gimp_operation_desaturate_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_desaturate_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationDesaturate, gimp_operation_desaturate,
@@ -76,11 +76,11 @@
}
static gboolean
-gimp_operation_desaturate_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_desaturate_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpDesaturateConfig *config = GIMP_DESATURATE_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c Sat Jun 21 05:12:58 2008
@@ -32,11 +32,11 @@
#include "gimpoperationhuesaturation.h"
-static gboolean gimp_operation_hue_saturation_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_hue_saturation_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationHueSaturation, gimp_operation_hue_saturation,
@@ -125,11 +125,11 @@
}
static gboolean
-gimp_operation_hue_saturation_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_hue_saturation_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpHueSaturationConfig *config = GIMP_HUE_SATURATION_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationlevels.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationlevels.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationlevels.c Sat Jun 21 05:12:58 2008
@@ -32,11 +32,11 @@
#include "gimpoperationlevels.h"
-static gboolean gimp_operation_levels_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_levels_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationLevels, gimp_operation_levels,
@@ -108,11 +108,11 @@
}
static gboolean
-gimp_operation_levels_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_levels_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpLevelsConfig *config = GIMP_LEVELS_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationposterize.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationposterize.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationposterize.c Sat Jun 21 05:12:58 2008
@@ -32,11 +32,11 @@
#include "gimpposterizeconfig.h"
-static gboolean gimp_operation_posterize_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_posterize_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationPosterize, gimp_operation_posterize,
@@ -77,11 +77,11 @@
}
static gboolean
-gimp_operation_posterize_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_posterize_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpPosterizeConfig *config = GIMP_POSTERIZE_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationthreshold.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationthreshold.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationthreshold.c Sat Jun 21 05:12:58 2008
@@ -31,11 +31,11 @@
#include "gimpthresholdconfig.h"
-static gboolean gimp_operation_threshold_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi);
+static gboolean gimp_operation_threshold_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationThreshold, gimp_operation_threshold,
@@ -76,11 +76,11 @@
}
static gboolean
-gimp_operation_threshold_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples,
- GeglRectangle *roi)
+gimp_operation_threshold_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples,
+ const GeglRectangle *roi)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpThresholdConfig *config = GIMP_THRESHOLD_CONFIG (point->config);
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationtilesink.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationtilesink.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationtilesink.c Sat Jun 21 05:12:58 2008
@@ -218,14 +218,13 @@
pr;
pr = pixel_regions_process (pr))
{
- GeglRectangle rect = { destPR.x, destPR.y, destPR.w, destPR.h };
+ const GeglRectangle rect = { destPR.x, destPR.y, destPR.w, destPR.h };
gegl_buffer_get (input,
1.0, &rect, format, destPR.data, destPR.rowstride);
}
- g_signal_emit (operation, tile_sink_signals[DATA_WRITTEN], 0,
- result);
+ g_signal_emit (operation, tile_sink_signals[DATA_WRITTEN], 0, result);
return TRUE;
}
Modified: branches/soc-2008-tagging/app/gegl/gimpoperationtilesource.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationtilesource.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationtilesource.c Sat Jun 21 05:12:58 2008
@@ -83,7 +83,7 @@
operation_class->description = "GIMP TileManager source";
operation_class->prepare = gimp_operation_tile_source_prepare;
operation_class->get_bounding_box = gimp_operation_tile_source_get_bounding_box;
- operation_class->get_cached_region = NULL; /* the default source is
+ operation_class->get_cached_region = NULL; /* the default source is
expanding to agressivly
make use of available caching,
this behavior is at least a
@@ -238,7 +238,7 @@
pr;
pr = pixel_regions_process (pr))
{
- GeglRectangle rect = { srcPR.x, srcPR.y, srcPR.w, srcPR.h };
+ const GeglRectangle rect = { srcPR.x, srcPR.y, srcPR.w, srcPR.h };
gegl_buffer_set (output, &rect, format, srcPR.data, srcPR.rowstride);
}
Modified: branches/soc-2008-tagging/app/gui/gui-vtable.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gui-vtable.c (original)
+++ branches/soc-2008-tagging/app/gui/gui-vtable.c Sat Jun 21 05:12:58 2008
@@ -86,6 +86,7 @@
static void gui_set_busy (Gimp *gimp);
static void gui_unset_busy (Gimp *gimp);
static void gui_help (Gimp *gimp,
+ GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id);
static const gchar * gui_get_program_class (Gimp *gimp);
@@ -213,11 +214,12 @@
}
static void
-gui_help (Gimp *gimp,
- const gchar *help_domain,
- const gchar *help_id)
+gui_help (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *help_domain,
+ const gchar *help_id)
{
- gimp_help_show (gimp, help_domain, help_id);
+ gimp_help_show (gimp, progress, help_domain, help_id);
}
static const gchar *
Modified: branches/soc-2008-tagging/app/gui/gui.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gui.c (original)
+++ branches/soc-2008-tagging/app/gui/gui.c Sat Jun 21 05:12:58 2008
@@ -296,7 +296,7 @@
{
g_return_if_fail (GIMP_IS_GIMP (the_gui_gimp));
- gimp_help (the_gui_gimp, NULL, help_id);
+ gimp_help (the_gui_gimp, NULL, NULL, help_id);
}
static gboolean
Modified: branches/soc-2008-tagging/app/paint/gimppaintoptions.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintoptions.c (original)
+++ branches/soc-2008-tagging/app/paint/gimppaintoptions.c Sat Jun 21 05:12:58 2008
@@ -51,7 +51,7 @@
#define DEFAULT_VELOCITY_OPACITY FALSE
#define DEFAULT_VELOCITY_HARDNESS FALSE
#define DEFAULT_VELOCITY_RATE FALSE
-#define DEFAULT_VELOCITY_SIZE TRUE
+#define DEFAULT_VELOCITY_SIZE FALSE
#define DEFAULT_VELOCITY_INVERSE_SIZE FALSE
#define DEFAULT_VELOCITY_COLOR FALSE
#define DEFAULT_VELOCITY_PRESCALE 1.0
Modified: branches/soc-2008-tagging/app/pdb/help-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/help-cmds.c (original)
+++ branches/soc-2008-tagging/app/pdb/help-cmds.c Sat Jun 21 05:12:58 2008
@@ -60,7 +60,7 @@
manager->current_plug_in->prog,
NULL);
- gimp_help (gimp, help_domain, help_id);
+ gimp_help (gimp, progress, help_domain, help_id);
}
return gimp_procedure_get_return_values (procedure, success);
Modified: branches/soc-2008-tagging/app/plug-in/gimpplugin.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugin.c (original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugin.c Sat Jun 21 05:12:58 2008
@@ -459,7 +459,7 @@
}
/* Wait for the process to exit. This will happen
- * immediately if it was just killed.
+ * immediately if it was just killed.
*/
waitpid (plug_in->pid, &status, 0);
Modified: branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c (original)
+++ branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c Sat Jun 21 05:12:58 2008
@@ -153,8 +153,7 @@
g_return_val_if_fail (args != NULL, NULL);
g_return_val_if_fail (display == NULL || GIMP_IS_OBJECT (display), NULL);
- plug_in = gimp_plug_in_new (manager, context, progress,
- procedure, NULL);
+ plug_in = gimp_plug_in_new (manager, context, progress, procedure, NULL);
if (plug_in)
{
Modified: branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c (original)
+++ branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c Sat Jun 21 05:12:58 2008
@@ -61,6 +61,7 @@
{ "<Toolbox>/Xtns", NULL, "<Image>/Filters/Extensions" },
{ "<Toolbox>/Help", NULL, "<Image>/Help" },
+ { "<Toolbox>/File/Acquire", NULL, "<Image>/File/New/Acquire" },
{ "<Image>/File/Acquire", NULL, "<Image>/File/New/Acquire" },
{ NULL, NULL, NULL }
};
Modified: branches/soc-2008-tagging/app/sanity.c
==============================================================================
--- branches/soc-2008-tagging/app/sanity.c (original)
+++ branches/soc-2008-tagging/app/sanity.c Sat Jun 21 05:12:58 2008
@@ -260,7 +260,7 @@
#define BABL_REQUIRED_MAJOR 0
#define BABL_REQUIRED_MINOR 0
-#define BABL_REQUIRED_MICRO 21
+#define BABL_REQUIRED_MICRO 22
babl_get_version (&babl_major_version,
&babl_minor_version,
@@ -298,7 +298,7 @@
#define GEGL_REQUIRED_MAJOR 0
#define GEGL_REQUIRED_MINOR 0
-#define GEGL_REQUIRED_MICRO 17
+#define GEGL_REQUIRED_MICRO 18
gegl_get_version (&gegl_major_version,
&gegl_minor_version,
Modified: branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h (original)
+++ branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h Sat Jun 21 05:12:58 2008
@@ -24,10 +24,10 @@
#define GIMP_TYPE_EDIT_SELECTION_TOOL (gimp_edit_selection_tool_get_type ())
-#define GIMP_EDIT_SELECTION_TOOL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_EDIT_SELECTION_TOOL, GimpEditSelectionTool))
-#define GIMP_EDIT_SELECTION_TOOL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_EDIT_SELECTION_TOOL, GimpEditSelectionToolClass))
-#define GIMP_IS_EDIT_SELECTION_TOOL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_EDIT_SELECTION_TOOL))
-#define GIMP_IS_EDIT_SELECTION_TOOL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_EDIT_SELECTION_TOOL))
+#define GIMP_EDIT_SELECTION_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_EDIT_SELECTION_TOOL, GimpEditSelectionTool))
+#define GIMP_EDIT_SELECTION_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_EDIT_SELECTION_TOOL, GimpEditSelectionToolClass))
+#define GIMP_IS_EDIT_SELECTION_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_EDIT_SELECTION_TOOL))
+#define GIMP_IS_EDIT_SELECTION_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_EDIT_SELECTION_TOOL))
typedef struct _GimpEditSelectionTool GimpEditSelectionTool;
Modified: branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c Sat Jun 21 05:12:58 2008
@@ -72,8 +72,8 @@
*/
GimpVector2 *saved_points_lower_segment;
GimpVector2 *saved_points_higher_segment;
- gint n_saved_points_lower_segment;
- gint n_saved_points_higher_segment;
+ gint max_n_saved_points_lower_segment;
+ gint max_n_saved_points_higher_segment;
/* Keeps track wether or not a modification of the polygon has been
* made between _button_press and _button_release
@@ -116,7 +116,7 @@
*/
gboolean supress_handles;
- /* Last _oper_update coords */
+ /* Last _oper_update or _motion coords */
GimpVector2 last_coords;
/* A double-click commits the selection, keep track of last
@@ -128,46 +128,51 @@
} Private;
-static void gimp_free_select_tool_finalize (GObject *object);
-static void gimp_free_select_tool_control (GimpTool *tool,
- GimpToolAction action,
- GimpDisplay *display);
-static void gimp_free_select_tool_oper_update (GimpTool *tool,
- GimpCoords *coords,
- GdkModifierType state,
- gboolean proximity,
- GimpDisplay *display);
-static void gimp_free_select_tool_cursor_update (GimpTool *tool,
- GimpCoords *coords,
- GdkModifierType state,
- GimpDisplay *display);
-static void gimp_free_select_tool_button_press (GimpTool *tool,
- GimpCoords *coords,
- guint32 time,
- GdkModifierType state,
- GimpDisplay *display);
-static void gimp_free_select_tool_button_release (GimpTool *tool,
- GimpCoords *coords,
- guint32 time,
- GdkModifierType state,
- GimpButtonReleaseType release_type,
- GimpDisplay *display);
-static void gimp_free_select_tool_motion (GimpTool *tool,
- GimpCoords *coords,
- guint32 time,
- GdkModifierType state,
- GimpDisplay *display);
-static gboolean gimp_free_select_tool_key_press (GimpTool *tool,
- GdkEventKey *kevent,
- GimpDisplay *display);
-static void gimp_free_select_tool_modifier_key (GimpTool *tool,
- GdkModifierType key,
- gboolean press,
- GdkModifierType state,
- GimpDisplay *display);
-static void gimp_free_select_tool_draw (GimpDrawTool *draw_tool);
-static void gimp_free_select_tool_real_select (GimpFreeSelectTool *fst,
- GimpDisplay *display);
+static void gimp_free_select_tool_finalize (GObject *object);
+static void gimp_free_select_tool_control (GimpTool *tool,
+ GimpToolAction action,
+ GimpDisplay *display);
+static void gimp_free_select_tool_oper_update (GimpTool *tool,
+ GimpCoords *coords,
+ GdkModifierType state,
+ gboolean proximity,
+ GimpDisplay *display);
+static void gimp_free_select_tool_cursor_update (GimpTool *tool,
+ GimpCoords *coords,
+ GdkModifierType state,
+ GimpDisplay *display);
+static void gimp_free_select_tool_button_press (GimpTool *tool,
+ GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpDisplay *display);
+static void gimp_free_select_tool_button_release (GimpTool *tool,
+ GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpButtonReleaseType release_type,
+ GimpDisplay *display);
+static void gimp_free_select_tool_motion (GimpTool *tool,
+ GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpDisplay *display);
+static gboolean gimp_free_select_tool_key_press (GimpTool *tool,
+ GdkEventKey *kevent,
+ GimpDisplay *display);
+static void gimp_free_select_tool_modifier_key (GimpTool *tool,
+ GdkModifierType key,
+ gboolean press,
+ GdkModifierType state,
+ GimpDisplay *display);
+static void gimp_free_select_tool_active_modifier_key (GimpTool *tool,
+ GdkModifierType key,
+ gboolean press,
+ GdkModifierType state,
+ GimpDisplay *display);
+static void gimp_free_select_tool_draw (GimpDrawTool *draw_tool);
+static void gimp_free_select_tool_real_select (GimpFreeSelectTool *fst,
+ GimpDisplay *display);
G_DEFINE_TYPE (GimpFreeSelectTool, gimp_free_select_tool,
@@ -203,20 +208,21 @@
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
- object_class->finalize = gimp_free_select_tool_finalize;
+ object_class->finalize = gimp_free_select_tool_finalize;
- tool_class->control = gimp_free_select_tool_control;
- tool_class->oper_update = gimp_free_select_tool_oper_update;
- tool_class->cursor_update = gimp_free_select_tool_cursor_update;
- tool_class->button_press = gimp_free_select_tool_button_press;
- tool_class->button_release = gimp_free_select_tool_button_release;
- tool_class->motion = gimp_free_select_tool_motion;
- tool_class->key_press = gimp_free_select_tool_key_press;
- tool_class->modifier_key = gimp_free_select_tool_modifier_key;
+ tool_class->control = gimp_free_select_tool_control;
+ tool_class->oper_update = gimp_free_select_tool_oper_update;
+ tool_class->cursor_update = gimp_free_select_tool_cursor_update;
+ tool_class->button_press = gimp_free_select_tool_button_press;
+ tool_class->button_release = gimp_free_select_tool_button_release;
+ tool_class->motion = gimp_free_select_tool_motion;
+ tool_class->key_press = gimp_free_select_tool_key_press;
+ tool_class->modifier_key = gimp_free_select_tool_modifier_key;
+ tool_class->active_modifier_key = gimp_free_select_tool_active_modifier_key;
- draw_tool_class->draw = gimp_free_select_tool_draw;
+ draw_tool_class->draw = gimp_free_select_tool_draw;
- klass->select = gimp_free_select_tool_real_select;
+ klass->select = gimp_free_select_tool_real_select;
g_type_class_add_private (klass, sizeof (Private));
}
@@ -232,31 +238,31 @@
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_FREE_SELECT);
- priv->grabbed_segment_index = INVALID_INDEX;
+ priv->grabbed_segment_index = INVALID_INDEX;
- priv->button1_down = FALSE;
+ priv->button1_down = FALSE;
- priv->saved_points_lower_segment = NULL;
- priv->saved_points_higher_segment = NULL;
- priv->n_saved_points_lower_segment = 0;
- priv->n_saved_points_higher_segment = 0;
+ priv->saved_points_lower_segment = NULL;
+ priv->saved_points_higher_segment = NULL;
+ priv->max_n_saved_points_lower_segment = 0;
+ priv->max_n_saved_points_higher_segment = 0;
- priv->polygon_modified = FALSE;
+ priv->polygon_modified = FALSE;
- priv->show_pending_point = FALSE;
+ priv->show_pending_point = FALSE;
- priv->points = NULL;
- priv->n_points = 0;
- priv->max_n_points = 0;
+ priv->points = NULL;
+ priv->n_points = 0;
+ priv->max_n_points = 0;
- priv->segment_indices = NULL;
- priv->n_segment_indices = 0;
- priv->max_n_segment_indices = 0;
+ priv->segment_indices = NULL;
+ priv->n_segment_indices = 0;
+ priv->max_n_segment_indices = 0;
- priv->constrain_angle = FALSE;
- priv->supress_handles = FALSE;
+ priv->constrain_angle = FALSE;
+ priv->supress_handles = FALSE;
- priv->last_click_time = NO_CLICK_TIME_AVAILABLE;
+ priv->last_click_time = NO_CLICK_TIME_AVAILABLE;
}
static void
@@ -266,10 +272,9 @@
Private *priv = GET_PRIVATE (fst);
g_free (priv->points);
-
- priv->points = NULL;
- priv->n_points = 0;
- priv->max_n_points = 0;
+ g_free (priv->segment_indices);
+ g_free (priv->saved_points_lower_segment);
+ g_free (priv->saved_points_higher_segment);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -290,26 +295,28 @@
}
static void
-gimp_free_select_tool_get_last_point (GimpFreeSelectTool *fst,
- gdouble *start_point_x,
- gdouble *start_point_y)
+gimp_free_select_tool_get_segment_point (GimpFreeSelectTool *fst,
+ gdouble *start_point_x,
+ gdouble *start_point_y,
+ gint segment_index)
{
Private *priv = GET_PRIVATE (fst);
- *start_point_x = priv->points[priv->segment_indices[priv->n_segment_indices - 1]].x;
- *start_point_y = priv->points[priv->segment_indices[priv->n_segment_indices - 1]].y;
+ *start_point_x = priv->points[priv->segment_indices[segment_index]].x;
+ *start_point_y = priv->points[priv->segment_indices[segment_index]].y;
}
static void
-gimp_free_select_tool_cleanup_after_move (GimpFreeSelectTool *fst)
+gimp_free_select_tool_get_last_point (GimpFreeSelectTool *fst,
+ gdouble *start_point_x,
+ gdouble *start_point_y)
{
Private *priv = GET_PRIVATE (fst);
- g_free (priv->saved_points_lower_segment);
- priv->saved_points_lower_segment = NULL;
-
- g_free (priv->saved_points_higher_segment);
- priv->saved_points_higher_segment = NULL;
+ gimp_free_select_tool_get_segment_point (fst,
+ start_point_x,
+ start_point_y,
+ priv->n_segment_indices - 1);
}
static void
@@ -932,7 +939,13 @@
priv->grabbed_segment_index - 1,
priv->grabbed_segment_index);
- priv->saved_points_lower_segment = g_new0 (GimpVector2, n_points);
+ if (n_points > priv->max_n_saved_points_lower_segment)
+ {
+ priv->max_n_saved_points_lower_segment = n_points;
+
+ priv->saved_points_lower_segment = g_realloc (priv->saved_points_lower_segment,
+ sizeof (GimpVector2) * n_points);
+ }
memcpy (priv->saved_points_lower_segment,
source,
@@ -947,7 +960,13 @@
priv->grabbed_segment_index,
priv->grabbed_segment_index + 1);
- priv->saved_points_higher_segment = g_new0 (GimpVector2, n_points);
+ if (n_points > priv->max_n_saved_points_higher_segment)
+ {
+ priv->max_n_saved_points_higher_segment = n_points;
+
+ priv->saved_points_higher_segment = g_realloc (priv->saved_points_higher_segment,
+ sizeof (GimpVector2) * n_points);
+ }
memcpy (priv->saved_points_higher_segment,
source,
@@ -958,7 +977,13 @@
if (priv->grabbed_segment_index == 0 &&
priv->n_segment_indices == 1)
{
- priv->saved_points_lower_segment = g_new0 (GimpVector2, 1);
+ if (priv->max_n_saved_points_lower_segment == 0)
+ {
+ priv->max_n_saved_points_lower_segment = 1;
+
+ priv->saved_points_lower_segment = g_new0 (GimpVector2, 1);
+ }
+
*priv->saved_points_lower_segment = priv->points[0];
}
}
@@ -994,6 +1019,61 @@
}
static void
+gimp_free_select_tool_update_motion (GimpFreeSelectTool *fst,
+ gdouble new_x,
+ gdouble new_y)
+{
+ Private *priv = GET_PRIVATE (fst);
+
+ if (gimp_free_select_tool_is_point_grabbed (fst))
+ {
+ priv->polygon_modified = TRUE;
+
+ if (priv->constrain_angle &&
+ priv->grabbed_segment_index > 0 &&
+ priv->n_points > 0 )
+ {
+ gdouble start_point_x;
+ gdouble start_point_y;
+
+ gimp_free_select_tool_get_segment_point (fst,
+ &start_point_x,
+ &start_point_y,
+ priv->grabbed_segment_index - 1);
+
+ gimp_tool_motion_constrain (start_point_x,
+ start_point_y,
+ &new_x,
+ &new_y,
+ GIMP_TOOL_CONSTRAIN_15_DEGREES);
+ }
+
+ gimp_free_select_tool_move_segment_vertex_to (fst,
+ priv->grabbed_segment_index,
+ new_x,
+ new_y);
+
+ /* We also must update the pending point if we are moving the
+ * first point
+ */
+ if (priv->grabbed_segment_index == 0)
+ {
+ priv->pending_point.x = new_x;
+ priv->pending_point.y = new_y;
+ }
+ }
+ else
+ {
+ /* Don't show the pending point while we are adding points */
+ priv->show_pending_point = FALSE;
+
+ gimp_free_select_tool_add_point (fst,
+ new_x,
+ new_y);
+ }
+}
+
+static void
gimp_free_select_tool_status_update (GimpFreeSelectTool *fst,
GimpDisplay *display,
GimpCoords *coords,
@@ -1276,11 +1356,6 @@
gimp_free_select_tool_handle_normal_release (fst,
coords,
display);
-
- if (priv->polygon_modified)
- {
- gimp_free_select_tool_cleanup_after_move (fst);
- }
break;
case GIMP_BUTTON_RELEASE_CANCEL:
@@ -1313,33 +1388,12 @@
gimp_draw_tool_pause (draw_tool);
- if (gimp_free_select_tool_is_point_grabbed (fst))
- {
- priv->polygon_modified = TRUE;
-
- gimp_free_select_tool_move_segment_vertex_to (fst,
- priv->grabbed_segment_index,
- coords->x,
- coords->y);
-
- /* We also must update the pending point if we are moving the
- * first point
- */
- if (priv->grabbed_segment_index == 0)
- {
- priv->pending_point.x = coords->x;
- priv->pending_point.y = coords->y;
- }
- }
- else
- {
- /* Don't show the pending point while we are adding points */
- priv->show_pending_point = FALSE;
+ priv->last_coords.x = coords->x;
+ priv->last_coords.y = coords->y;
- gimp_free_select_tool_add_point (fst,
+ gimp_free_select_tool_update_motion (fst,
coords->x,
coords->y);
- }
gimp_draw_tool_resume (draw_tool);
}
@@ -1384,6 +1438,9 @@
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
Private *priv = GET_PRIVATE (tool);
+ if (tool->display != display)
+ return;
+
gimp_draw_tool_pause (draw_tool);
priv->constrain_angle = state & GDK_CONTROL_MASK ? TRUE : FALSE;
@@ -1400,6 +1457,42 @@
}
static void
+gimp_free_select_tool_active_modifier_key (GimpTool *tool,
+ GdkModifierType key,
+ gboolean press,
+ GdkModifierType state,
+ GimpDisplay *display)
+{
+ GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
+ Private *priv = GET_PRIVATE (tool);
+
+ if (tool->display != display)
+ return;
+
+ gimp_draw_tool_pause (draw_tool);
+
+ priv->constrain_angle = state & GDK_CONTROL_MASK ? TRUE : FALSE;
+
+ /* If we didn't came here due to a mouse release, immediately update
+ * the position of the thing we move.
+ */
+ if (state & GDK_BUTTON1_MASK)
+ {
+ gimp_free_select_tool_update_motion (GIMP_FREE_SELECT_TOOL (tool),
+ priv->last_coords.x,
+ priv->last_coords.y);
+ }
+
+ gimp_draw_tool_resume (draw_tool);
+
+ GIMP_TOOL_CLASS (parent_class)->active_modifier_key (tool,
+ key,
+ press,
+ state,
+ display);
+}
+
+static void
gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
{
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (draw_tool);
Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c Sat Jun 21 05:12:58 2008
@@ -38,9 +38,7 @@
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
-#include "widgets/gimpcontainercombobox.h"
-#include "widgets/gimpcontainerview.h"
-#include "widgets/gimpwidgets-utils.h"
+#include "widgets/gimpsettingsbox.h"
#include "gimpimagemapoptions.h"
#include "gimpimagemaptool.h"
@@ -51,67 +49,23 @@
/* local function prototypes */
-static void gimp_image_map_tool_recent_deserialize (GimpImageMapTool *im_tool);
-static void gimp_image_map_tool_recent_serialize (GimpImageMapTool *im_tool);
-
-static gboolean
- gimp_image_map_tool_row_separator_func (GtkTreeModel *model,
- GtkTreeIter *iter,
- gpointer data);
-static void gimp_image_map_tool_recent_selected (GimpContainerView *view,
- GimpViewable *object,
- gpointer insert_data,
- GimpImageMapTool *tool);
-
-static gboolean gimp_image_map_tool_menu_press (GtkWidget *widget,
- GdkEventButton *bevent,
- GimpImageMapTool *tool);
-static void gimp_image_map_tool_favorite_activate (GtkWidget *widget,
- GimpImageMapTool *tool);
-static void gimp_image_map_tool_import_activate (GtkWidget *widget,
- GimpImageMapTool *tool);
-static void gimp_image_map_tool_export_activate (GtkWidget *widget,
- GimpImageMapTool *tool);
-
-static void gimp_image_map_tool_settings_dialog (GimpImageMapTool *im_tool,
- const gchar *title,
- gboolean save);
-
-static void gimp_image_map_tool_favorite_callback (GtkWidget *query_box,
- const gchar *string,
- gpointer data);
-static gboolean gimp_image_map_tool_settings_import(GimpImageMapTool *tool,
- const gchar *filename);
-static gboolean gimp_image_map_tool_settings_export(GimpImageMapTool *tool,
- const gchar *filename);
+static void gimp_image_map_tool_import_activate (GtkWidget *widget,
+ GimpImageMapTool *tool);
+static void gimp_image_map_tool_export_activate (GtkWidget *widget,
+ GimpImageMapTool *tool);
+
+static void gimp_image_map_tool_settings_dialog (GimpImageMapTool *im_tool,
+ const gchar *title,
+ gboolean save);
+
+static gboolean gimp_image_map_tool_settings_import (GimpImageMapTool *tool,
+ const gchar *filename);
+static gboolean gimp_image_map_tool_settings_export (GimpImageMapTool *tool,
+ const gchar *filename);
/* public functions */
-static GtkWidget *
-gimp_image_map_tool_menu_item_add (GimpImageMapTool *image_map_tool,
- const gchar *stock_id,
- const gchar *label,
- GCallback callback)
-{
- GtkWidget *item;
- GtkWidget *image;
-
- item = gtk_image_menu_item_new_with_mnemonic (label);
- image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-
- gtk_menu_shell_append (GTK_MENU_SHELL (image_map_tool->favorites_menu),
- item);
- gtk_widget_show (item);
-
- g_signal_connect (item, "activate",
- callback,
- image_map_tool);
-
- return item;
-}
-
gboolean
gimp_image_map_tool_add_settings_gui (GimpImageMapTool *image_map_tool)
{
@@ -119,17 +73,12 @@
GimpToolInfo *tool_info;
GtkWidget *hbox;
GtkWidget *label;
- GtkWidget *combo;
- GtkWidget *button;
- GtkWidget *arrow;
+ gchar *filename;
klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool);
tool_info = GIMP_TOOL (image_map_tool)->tool_info;
- if (gimp_container_num_children (klass->recent_settings) == 0)
- gimp_image_map_tool_recent_deserialize (image_map_tool);
-
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (image_map_tool->main_vbox), hbox,
FALSE, FALSE, 0);
@@ -143,108 +92,36 @@
gtk_size_group_add_widget (image_map_tool->label_group, label);
g_object_unref (image_map_tool->label_group);
- combo = gimp_container_combo_box_new (klass->recent_settings,
- GIMP_CONTEXT (tool_info->tool_options),
- 16, 0);
- gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo),
- gimp_image_map_tool_row_separator_func,
- NULL, NULL);
- gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
- gtk_widget_show (combo);
-
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
-
- gimp_help_set_help_data (combo, _("Pick a setting from the list"),
- NULL);
-
- g_signal_connect_after (combo, "select-item",
- G_CALLBACK (gimp_image_map_tool_recent_selected),
- image_map_tool);
-
- button = gtk_button_new ();
- GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
- gtk_widget_show (button);
-
- arrow = gtk_image_new_from_stock (GIMP_STOCK_MENU_LEFT, GTK_ICON_SIZE_MENU);
- gtk_container_add (GTK_CONTAINER (button), arrow);
- gtk_widget_show (arrow);
-
- g_signal_connect (button, "button-press-event",
- G_CALLBACK (gimp_image_map_tool_menu_press),
- image_map_tool);
-
- /* Favorites menu */
+ filename = gimp_tool_info_build_options_filename (tool_info, ".settings");
- image_map_tool->favorites_menu = gtk_menu_new ();
- gtk_menu_attach_to_widget (GTK_MENU (image_map_tool->favorites_menu),
- button, NULL);
-
- gimp_image_map_tool_menu_item_add (image_map_tool,
- GTK_STOCK_ADD,
- _("Add Settings to _Favorites"),
- G_CALLBACK (gimp_image_map_tool_favorite_activate));
-
- image_map_tool->import_item =
- gimp_image_map_tool_menu_item_add (image_map_tool,
- GTK_STOCK_OPEN,
- _("_Import Settings from File"),
- G_CALLBACK (gimp_image_map_tool_import_activate));
-
- image_map_tool->export_item =
- gimp_image_map_tool_menu_item_add (image_map_tool,
- GTK_STOCK_SAVE,
- _("_Export Settings to File"),
- G_CALLBACK (gimp_image_map_tool_export_activate));
+ image_map_tool->settings_box = gimp_settings_box_new (tool_info->gimp,
+ image_map_tool->config,
+ klass->recent_settings,
+ filename);
+ gtk_box_pack_start (GTK_BOX (hbox), image_map_tool->settings_box,
+ TRUE, TRUE, 0);
+ gtk_widget_show (image_map_tool->settings_box);
- return TRUE;
-}
-
-void
-gimp_image_map_tool_add_recent_settings (GimpImageMapTool *image_map_tool)
-{
- GimpContainer *recent;
- GimpConfig *current;
- GimpConfig *config = NULL;
- GList *list;
-
- recent = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool)->recent_settings;
- current = GIMP_CONFIG (image_map_tool->config);
-
- for (list = GIMP_LIST (recent)->list; list; list = g_list_next (list))
- {
- config = list->data;
+ g_free (filename);
- if (GIMP_IMAGE_MAP_CONFIG (config)->time > 0 &&
- gimp_config_is_equal_to (config, current))
- {
- g_object_set (current,
- "time", (guint) time (NULL),
- NULL);
- break;
- }
- }
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GIMP_SETTINGS_BOX (image_map_tool->settings_box)->combo);
- if (! list)
- {
- config = gimp_config_duplicate (current);
- g_object_set (config,
- "time", (guint) time (NULL),
- NULL);
-
- gimp_container_insert (recent, GIMP_OBJECT (config), 0);
- g_object_unref (config);
- }
+ g_signal_connect (image_map_tool->settings_box, "import",
+ G_CALLBACK (gimp_image_map_tool_import_activate),
+ image_map_tool);
+ g_signal_connect (image_map_tool->settings_box, "export",
+ G_CALLBACK (gimp_image_map_tool_export_activate),
+ image_map_tool);
- gimp_image_map_tool_recent_serialize (image_map_tool);
+ return TRUE;
}
gboolean
-gimp_image_map_tool_real_settings_import (GimpImageMapTool *tool,
- const gchar *filename,
- GError **error)
+gimp_image_map_tool_real_settings_import (GimpImageMapTool *tool,
+ const gchar *filename,
+ GError **error)
{
gboolean success;
@@ -259,9 +136,9 @@
}
gboolean
-gimp_image_map_tool_real_settings_export (GimpImageMapTool *tool,
- const gchar *filename,
- GError **error)
+gimp_image_map_tool_real_settings_export (GimpImageMapTool *tool,
+ const gchar *filename,
+ GError **error)
{
GimpImageMapToolClass *klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool);
gchar *header;
@@ -289,165 +166,6 @@
/* private functions */
static void
-gimp_image_map_tool_separator_add (GimpContainer *container)
-{
- GimpObject *sep = g_object_new (GIMP_TYPE_IMAGE_MAP_CONFIG, NULL);
-
- gimp_container_add (container, sep);
- g_object_unref (sep);
-
- g_object_set_data (G_OBJECT (container), "separator", sep);
-}
-
-static void
-gimp_image_map_tool_separator_remove (GimpContainer *container)
-{
- GimpObject *sep = g_object_get_data (G_OBJECT (container), "separator");
-
- gimp_container_remove (container, sep);
-
- g_object_set_data (G_OBJECT (container), "separator", NULL);
-}
-
-static void
-gimp_image_map_tool_recent_deserialize (GimpImageMapTool *im_tool)
-{
- GimpImageMapToolClass *klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (im_tool);
- GimpToolInfo *tool_info = GIMP_TOOL (im_tool)->tool_info;
- gchar *filename;
- GError *error = NULL;
-
- filename = gimp_tool_info_build_options_filename (tool_info,
- ".settings");
-
- if (tool_info->gimp->be_verbose)
- g_print ("Parsing '%s'\n", gimp_filename_to_utf8 (filename));
-
- if (! gimp_config_deserialize_file (GIMP_CONFIG (klass->recent_settings),
- filename,
- NULL, &error))
- {
- if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)
- gimp_message (tool_info->gimp, NULL, GIMP_MESSAGE_ERROR,
- "%s", error->message);
-
- g_clear_error (&error);
- }
-
- g_free (filename);
-
- gimp_image_map_tool_separator_add (klass->recent_settings);
-}
-
-static void
-gimp_image_map_tool_recent_serialize (GimpImageMapTool *im_tool)
-{
- GimpImageMapToolClass *klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (im_tool);
- GimpToolInfo *tool_info = GIMP_TOOL (im_tool)->tool_info;
- gchar *filename;
- GError *error = NULL;
-
- gimp_image_map_tool_separator_remove (klass->recent_settings);
-
- filename = gimp_tool_info_build_options_filename (tool_info,
- ".settings");
-
- if (tool_info->gimp->be_verbose)
- g_print ("Writing '%s'\n", gimp_filename_to_utf8 (filename));
-
- if (! gimp_config_serialize_to_file (GIMP_CONFIG (klass->recent_settings),
- filename,
- "tool settings",
- "end of tool settings",
- NULL, &error))
- {
- gimp_message (tool_info->gimp, NULL, GIMP_MESSAGE_ERROR,
- "%s", error->message);
- g_clear_error (&error);
- }
-
- g_free (filename);
-
- gimp_image_map_tool_separator_add (klass->recent_settings);
-}
-
-static gboolean
-gimp_image_map_tool_row_separator_func (GtkTreeModel *model,
- GtkTreeIter *iter,
- gpointer data)
-{
- gchar *name = NULL;
-
-#ifdef __GNUC__
-#warning FIXME: dont use magic model column
-#endif
- gtk_tree_model_get (model, iter,
- 1, &name,
- -1);
-
- g_free (name);
-
- return name == NULL;
-}
-
-static void
-gimp_image_map_tool_recent_selected (GimpContainerView *view,
- GimpViewable *object,
- gpointer insert_data,
- GimpImageMapTool *tool)
-{
- if (object)
- {
- gimp_config_copy (GIMP_CONFIG (object),
- GIMP_CONFIG (tool->config), 0);
-
- gimp_container_view_select_item (view, NULL);
- }
-}
-
-static void
-gimp_image_map_tool_menu_position (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data)
-{
- gimp_button_menu_position (user_data, menu, GTK_POS_LEFT, x, y);
-}
-
-static gboolean
-gimp_image_map_tool_menu_press (GtkWidget *widget,
- GdkEventButton *bevent,
- GimpImageMapTool *tool)
-{
- if (bevent->type == GDK_BUTTON_PRESS)
- {
- gtk_menu_popup (GTK_MENU (tool->favorites_menu),
- NULL, NULL,
- gimp_image_map_tool_menu_position, widget,
- bevent->button, bevent->time);
- }
-
- return TRUE;
-}
-
-static void
-gimp_image_map_tool_favorite_activate (GtkWidget *widget,
- GimpImageMapTool *tool)
-{
- GtkWidget *dialog;
-
- dialog = gimp_query_string_box (_("Add Settings to Favorites"),
- tool->shell,
- gimp_standard_help_func, NULL,
- _("Enter a name for the settings"),
- _("Saved Settings"),
- G_OBJECT (tool->shell), "hide",
- gimp_image_map_tool_favorite_callback, tool);
- gtk_widget_show (dialog);
-}
-
-static void
gimp_image_map_tool_import_activate (GtkWidget *widget,
GimpImageMapTool *tool)
{
@@ -489,9 +207,9 @@
}
if (save)
- gtk_widget_set_sensitive (tool->import_item, TRUE);
+ gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->import_item, TRUE);
else
- gtk_widget_set_sensitive (tool->export_item, TRUE);
+ gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->export_item, TRUE);
gtk_widget_destroy (dialog);
}
@@ -517,9 +235,9 @@
}
if (save)
- gtk_widget_set_sensitive (tool->import_item, FALSE);
+ gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->import_item, FALSE);
else
- gtk_widget_set_sensitive (tool->export_item, FALSE);
+ gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->export_item, FALSE);
tool->settings_dialog =
gtk_file_chooser_dialog_new (title, GTK_WINDOW (tool->shell),
@@ -582,23 +300,6 @@
gtk_widget_show (tool->settings_dialog);
}
-static void
-gimp_image_map_tool_favorite_callback (GtkWidget *query_box,
- const gchar *string,
- gpointer data)
-{
- GimpImageMapTool *tool = GIMP_IMAGE_MAP_TOOL (data);
- GimpConfig *config;
-
- config = gimp_config_duplicate (GIMP_CONFIG (tool->config));
- gimp_object_set_name (GIMP_OBJECT (config), string);
- gimp_container_add (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->recent_settings,
- GIMP_OBJECT (config));
- g_object_unref (config);
-
- gimp_image_map_tool_recent_serialize (tool);
-}
-
static gboolean
gimp_image_map_tool_settings_import (GimpImageMapTool *tool,
const gchar *filename)
Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.h (original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.h Sat Jun 21 05:12:58 2008
@@ -24,8 +24,6 @@
gboolean gimp_image_map_tool_add_settings_gui (GimpImageMapTool *image_map_tool);
-void gimp_image_map_tool_add_recent_settings (GimpImageMapTool *image_map_tool);
-
gboolean gimp_image_map_tool_real_settings_import (GimpImageMapTool *tool,
const gchar *filename,
GError **error);
Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool.c Sat Jun 21 05:12:58 2008
@@ -42,6 +42,7 @@
#include "core/gimptoolinfo.h"
#include "widgets/gimpdialogfactory.h"
+#include "widgets/gimpsettingsbox.h"
#include "widgets/gimptooldialog.h"
#include "widgets/gimpwidgets-utils.h"
@@ -171,7 +172,7 @@
static void
gimp_image_map_tool_base_init (GimpImageMapToolClass *klass)
{
- klass->recent_settings = gimp_list_new (GIMP_TYPE_VIEWABLE, TRUE);
+ klass->recent_settings = gimp_list_new (GIMP_TYPE_IMAGE_MAP_CONFIG, TRUE);
gimp_list_set_sort_func (GIMP_LIST (klass->recent_settings),
(GCompareFunc) gimp_image_map_config_compare);
}
@@ -196,9 +197,8 @@
image_map_tool->shell = NULL;
image_map_tool->main_vbox = NULL;
- image_map_tool->favorites_menu = NULL;
- image_map_tool->import_item = NULL;
- image_map_tool->export_item = NULL;
+ image_map_tool->settings_box = NULL;
+ image_map_tool->label_group = NULL;
image_map_tool->settings_dialog = NULL;
}
@@ -243,11 +243,10 @@
if (image_map_tool->shell)
{
gtk_widget_destroy (image_map_tool->shell);
- image_map_tool->shell = NULL;
- image_map_tool->main_vbox = NULL;
- image_map_tool->favorites_menu = NULL;
- image_map_tool->import_item = NULL;
- image_map_tool->export_item = NULL;
+ image_map_tool->shell = NULL;
+ image_map_tool->main_vbox = NULL;
+ image_map_tool->settings_box = NULL;
+ image_map_tool->label_group = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -549,7 +548,7 @@
gimp_image_flush (tool->display->image);
if (image_map_tool->config)
- gimp_image_map_tool_add_recent_settings (image_map_tool);
+ gimp_settings_box_add_current (GIMP_SETTINGS_BOX (image_map_tool->settings_box));
}
tool->display = NULL;
Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool.h (original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool.h Sat Jun 21 05:12:58 2008
@@ -51,9 +51,7 @@
/* dialog */
GtkWidget *shell;
GtkWidget *main_vbox;
- GtkWidget *favorites_menu;
- GtkWidget *import_item;
- GtkWidget *export_item;
+ GtkWidget *settings_box;
GtkSizeGroup *label_group;
/* settings file dialog */
Modified: branches/soc-2008-tagging/app/tools/gimprectangletool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimprectangletool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimprectangletool.c Sat Jun 21 05:12:58 2008
@@ -1077,12 +1077,11 @@
{
gchar *aspect_text;
- aspect_text = g_strdup_printf (" %.2f",
- w / (gdouble) h);
+ aspect_text = g_strdup_printf (" (%.2f:1)", w / (gdouble) h);
gimp_tool_push_status_coords (tool, display,
- _("Rectangle: "), w, " Ã ", h, aspect_text);
-
+ _("Rectangle: "),
+ w, " Ã ", h, aspect_text);
g_free (aspect_text);
}
}
Modified: branches/soc-2008-tagging/app/tools/gimptextoptions.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimptextoptions.c (original)
+++ branches/soc-2008-tagging/app/tools/gimptextoptions.c Sat Jun 21 05:12:58 2008
@@ -91,7 +91,8 @@
GimpContext *context);
-G_DEFINE_TYPE_WITH_CODE (GimpTextOptions, gimp_text_options, GIMP_TYPE_TOOL_OPTIONS,
+G_DEFINE_TYPE_WITH_CODE (GimpTextOptions, gimp_text_options,
+ GIMP_TYPE_TOOL_OPTIONS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_RECTANGLE_OPTIONS,
NULL))
@@ -104,6 +105,15 @@
object_class->set_property = gimp_text_options_set_property;
object_class->get_property = gimp_text_options_get_property;
+ /* The 'highlight' property is defined here because we want different
+ * default values for the Crop, Text and the Rectangle Select tools.
+ */
+ GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class,
+ GIMP_RECTANGLE_OPTIONS_PROP_HIGHLIGHT,
+ "highlight", NULL,
+ FALSE,
+ GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_UNIT,
"font-size-unit", NULL,
TRUE, FALSE, GIMP_UNIT_PIXEL,
Modified: branches/soc-2008-tagging/app/widgets/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/widgets/Makefile.am (original)
+++ branches/soc-2008-tagging/app/widgets/Makefile.am Sat Jun 21 05:12:58 2008
@@ -255,6 +255,8 @@
gimpsessioninfo-dock.h \
gimpsessioninfo-dockable.c \
gimpsessioninfo-dockable.h \
+ gimpsettingsbox.c \
+ gimpsettingsbox.h \
gimpsizebox.c \
gimpsizebox.h \
gimpstringaction.c \
Modified: branches/soc-2008-tagging/app/widgets/gimpdockable.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdockable.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpdockable.c Sat Jun 21 05:12:58 2008
@@ -1245,7 +1245,7 @@
gimp_ui_manager_ui_popup (dockbook_ui_manager, "/dockable-popup",
GTK_WIDGET (dockable),
gimp_dockable_menu_position, dockable,
- (GtkDestroyNotify) gimp_dockable_menu_end, dockable);
+ (GDestroyNotify) gimp_dockable_menu_end, dockable);
return TRUE;
}
Modified: branches/soc-2008-tagging/app/widgets/gimphelp.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphelp.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimphelp.c Sat Jun 21 05:12:58 2008
@@ -34,8 +34,9 @@
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
-#include "core/gimp-utils.h"
#include "core/gimpparamspecs.h"
+#include "core/gimpprogress.h"
+#include "core/gimp-utils.h"
#include "pdb/gimppdb.h"
#include "pdb/gimpprocedure.h"
@@ -55,41 +56,50 @@
struct _GimpIdleHelp
{
- Gimp *gimp;
- gchar *help_domain;
- gchar *help_locales;
- gchar *help_id;
+ Gimp *gimp;
+ GimpProgress *progress;
+ gchar *help_domain;
+ gchar *help_locales;
+ gchar *help_id;
};
/* local function prototypes */
-static gint gimp_idle_help (GimpIdleHelp *idle_help);
+static gint gimp_idle_help (GimpIdleHelp *idle_help);
-static gboolean gimp_help_browser (Gimp *gimp);
-static void gimp_help_browser_error (Gimp *gimp,
- const gchar *title,
- const gchar *primary,
- const gchar *text);
-
-static void gimp_help_call (Gimp *gimp,
- const gchar *procedure_name,
- const gchar *help_domain,
- const gchar *help_locales,
- const gchar *help_id);
-static gchar * gimp_help_get_locales (GimpGuiConfig *config);
+static gboolean gimp_help_browser (Gimp *gimp);
+static void gimp_help_browser_error (Gimp *gimp,
+ const gchar *title,
+ const gchar *primary,
+ const gchar *text);
+
+static void gimp_help_call (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *procedure_name,
+ const gchar *help_domain,
+ const gchar *help_locales,
+ const gchar *help_id);
+
+static gint gimp_help_get_help_domains (Gimp *gimp,
+ gchar ***domain_names,
+ gchar ***domain_uris);
+static gchar * gimp_help_get_default_domain_uri (Gimp *gimp);
+static gchar * gimp_help_get_locales (Gimp *gimp);
/* public functions */
void
-gimp_help_show (Gimp *gimp,
- const gchar *help_domain,
- const gchar *help_id)
+gimp_help_show (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *help_domain,
+ const gchar *help_id)
{
GimpGuiConfig *config;
g_return_if_fail (GIMP_IS_GIMP (gimp));
+ g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
config = GIMP_GUI_CONFIG (gimp->config);
@@ -97,12 +107,13 @@
{
GimpIdleHelp *idle_help = g_slice_new0 (GimpIdleHelp);
- idle_help->gimp = gimp;
+ idle_help->gimp = gimp;
+ idle_help->progress = progress;
if (help_domain && strlen (help_domain))
idle_help->help_domain = g_strdup (help_domain);
- idle_help->help_locales = gimp_help_get_locales (config);
+ idle_help->help_locales = gimp_help_get_locales (gimp);
if (help_id && strlen (help_id))
idle_help->help_id = g_strdup (help_id);
@@ -143,6 +154,7 @@
if (procedure_name)
gimp_help_call (idle_help->gimp,
+ idle_help->progress,
procedure_name,
idle_help->help_domain,
idle_help->help_locales,
@@ -195,9 +207,7 @@
return FALSE;
}
- n_domains = gimp_plug_in_manager_get_help_domains (gimp->plug_in_manager,
- &help_domains,
- &help_uris);
+ n_domains = gimp_help_get_help_domains (gimp, &help_domains, &help_uris);
args = gimp_procedure_get_arguments (procedure);
gimp_value_array_truncate (args, 5);
@@ -280,11 +290,12 @@
}
static void
-gimp_help_call (Gimp *gimp,
- const gchar *procedure_name,
- const gchar *help_domain,
- const gchar *help_locales,
- const gchar *help_id)
+gimp_help_call (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *procedure_name,
+ const gchar *help_domain,
+ const gchar *help_locales,
+ const gchar *help_id)
{
GimpProcedure *procedure;
@@ -303,7 +314,7 @@
return_vals =
gimp_pdb_execute_procedure_by_name (gimp->pdb,
gimp_get_user_context (gimp),
- NULL, &error,
+ progress, &error,
procedure_name,
G_TYPE_STRING, help_domain,
G_TYPE_STRING, help_locales,
@@ -339,9 +350,7 @@
/* FIXME: error msg */
return;
- n_domains = gimp_plug_in_manager_get_help_domains (gimp->plug_in_manager,
- &help_domains,
- &help_uris);
+ n_domains = gimp_help_get_help_domains (gimp, &help_domains, &help_uris);
args = gimp_procedure_get_arguments (procedure);
gimp_value_array_truncate (args, 4);
@@ -352,8 +361,8 @@
gimp_value_take_stringarray (&args->values[3], help_uris, n_domains);
gimp_procedure_execute_async (procedure, gimp,
- gimp_get_user_context (gimp),
- NULL, args, NULL, &error);
+ gimp_get_user_context (gimp), progress,
+ args, NULL, &error);
g_value_array_free (args);
@@ -382,7 +391,7 @@
return_vals =
gimp_pdb_execute_procedure_by_name (gimp->pdb,
gimp_get_user_context (gimp),
- NULL, &error,
+ progress, &error,
"extension-gimp-help-temp",
G_TYPE_STRING, procedure_name,
G_TYPE_STRING, help_domain,
@@ -401,9 +410,62 @@
}
}
+static gint
+gimp_help_get_help_domains (Gimp *gimp,
+ gchar ***domain_names,
+ gchar ***domain_uris)
+{
+ gchar **plug_in_domains = NULL;
+ gchar **plug_in_uris = NULL;
+ gint i, n_domains;
+
+ n_domains = gimp_plug_in_manager_get_help_domains (gimp->plug_in_manager,
+ &plug_in_domains,
+ &plug_in_uris);
+
+ *domain_names = g_new0 (gchar *, n_domains + 1);
+ *domain_uris = g_new0 (gchar *, n_domains + 1);
+
+ *domain_names[0] = g_strdup ("http://www.gimp.org/help");
+ *domain_uris[0] = gimp_help_get_default_domain_uri (gimp);
+
+ for (i = 0; i < n_domains; i++)
+ {
+ *domain_names[i + 1] = plug_in_domains[i];
+ *domain_uris[i + 1] = plug_in_uris[i];
+ }
+
+ g_free (plug_in_domains);
+ g_free (plug_in_uris);
+
+ return n_domains + 1;
+}
+
+static gchar *
+gimp_help_get_default_domain_uri (Gimp *gimp)
+{
+ GimpGuiConfig *config = GIMP_GUI_CONFIG (gimp->config);
+ gchar *dir;
+ gchar *uri;
+
+ if (g_getenv ("GIMP2_HELP_URI"))
+ return g_strdup (g_getenv ("GIMP2_HELP_URI"));
+
+ if (config->user_manual_online)
+ return g_strdup (config->user_manual_online_uri);
+
+ dir = g_build_filename (gimp_data_directory (), "help", NULL);
+ uri = g_filename_to_uri (dir, NULL, NULL);
+ g_free (dir);
+
+ return uri;
+}
+
static gchar *
-gimp_help_get_locales (GimpGuiConfig *config)
+gimp_help_get_locales (Gimp *gimp)
{
+ GimpGuiConfig *config = GIMP_GUI_CONFIG (gimp->config);
+
if (config->help_locales && strlen (config->help_locales))
return g_strdup (config->help_locales);
Modified: branches/soc-2008-tagging/app/widgets/gimphelp.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphelp.h (original)
+++ branches/soc-2008-tagging/app/widgets/gimphelp.h Sat Jun 21 05:12:58 2008
@@ -25,11 +25,12 @@
/* the main help function
*
- * there should be no need to use it in the common case
+ * there should be no need to use it directly
*/
-void gimp_help_show (Gimp *gimp,
- const gchar *help_domain,
- const gchar *help_id);
+void gimp_help_show (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *help_domain,
+ const gchar *help_id);
#endif /* __GIMP_HELP_H__ */
Modified: branches/soc-2008-tagging/app/widgets/gimpthumbbox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpthumbbox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpthumbbox.c Sat Jun 21 05:12:58 2008
@@ -429,13 +429,12 @@
gtk_widget_size_request (box->progress, &progress_requisition);
gtk_widget_set_size_request (box->info,
- progress_requisition.width,
- info_requisition.height);
+ -1, info_requisition.height);
gtk_widget_set_size_request (box->filename,
progress_requisition.width, -1);
- gtk_widget_set_size_request (box->progress, -1,
- progress_requisition.height);
+ gtk_widget_set_size_request (box->progress,
+ -1, progress_requisition.height);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (box->progress), "");
return GTK_WIDGET (box);
Modified: branches/soc-2008-tagging/app/widgets/gimpuimanager.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpuimanager.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpuimanager.c Sat Jun 21 05:12:58 2008
@@ -569,7 +569,7 @@
GtkWidget *parent,
GimpMenuPositionFunc position_func,
gpointer position_data,
- GtkDestroyNotify popdown_func,
+ GDestroyNotify popdown_func,
gpointer popdown_data)
{
GtkWidget *widget;
@@ -937,9 +937,7 @@
while (! help_id)
{
- GtkWidget *menu_item;
-
- menu_item = GTK_MENU_SHELL (widget)->active_menu_item;
+ GtkWidget *menu_item = GTK_MENU_SHELL (widget)->active_menu_item;
/* first, get the help page from the item...
*/
@@ -1021,7 +1019,7 @@
help_string = g_strdup (help_id);
}
- gimp_help (manager->gimp, help_domain, help_string);
+ gimp_help (manager->gimp, NULL, help_domain, help_string);
g_free (help_domain);
g_free (help_string);
Modified: branches/soc-2008-tagging/app/widgets/gimpuimanager.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpuimanager.h (original)
+++ branches/soc-2008-tagging/app/widgets/gimpuimanager.h Sat Jun 21 05:12:58 2008
@@ -97,7 +97,7 @@
GtkWidget *parent,
GimpMenuPositionFunc position_func,
gpointer position_data,
- GtkDestroyNotify popdown_func,
+ GDestroyNotify popdown_func,
gpointer popdown_data);
Modified: branches/soc-2008-tagging/app/widgets/widgets-types.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/widgets-types.h (original)
+++ branches/soc-2008-tagging/app/widgets/widgets-types.h Sat Jun 21 05:12:58 2008
@@ -175,6 +175,7 @@
typedef struct _GimpMessageBox GimpMessageBox;
typedef struct _GimpProgressBox GimpProgressBox;
typedef struct _GimpScaleButton GimpScaleButton;
+typedef struct _GimpSettingsBox GimpSettingsBox;
typedef struct _GimpSizeBox GimpSizeBox;
typedef struct _GimpStrokeEditor GimpStrokeEditor;
typedef struct _GimpTemplateEditor GimpTemplateEditor;
Modified: branches/soc-2008-tagging/autogen.sh
==============================================================================
--- branches/soc-2008-tagging/autogen.sh (original)
+++ branches/soc-2008-tagging/autogen.sh Sat Jun 21 05:12:58 2008
@@ -18,7 +18,7 @@
AUTOCONF_REQUIRED_VERSION=2.54
AUTOMAKE_REQUIRED_VERSION=1.9.6
GLIB_REQUIRED_VERSION=2.16.0
-INTLTOOL_REQUIRED_VERSION=0.31
+INTLTOOL_REQUIRED_VERSION=0.35.5
LIBTOOL_REQUIRED_VERSION=1.5
Modified: branches/soc-2008-tagging/configure.in
==============================================================================
--- branches/soc-2008-tagging/configure.in (original)
+++ branches/soc-2008-tagging/configure.in Sat Jun 21 05:12:58 2008
@@ -8,7 +8,7 @@
m4_define([gimp_major_version], [2])
m4_define([gimp_minor_version], [5])
-m4_define([gimp_micro_version], [1])
+m4_define([gimp_micro_version], [2])
m4_define([gimp_real_version],
[gimp_major_version.gimp_minor_version.gimp_micro_version])
m4_define([gimp_version], [gimp_real_version])
@@ -40,8 +40,8 @@
m4_define([gimp_full_name], [GNU Image Manipulation Program])
# required versions of other packages
-m4_define([babl_required_version], [0.0.21])
-m4_define([gegl_required_version], [0.0.17])
+m4_define([babl_required_version], [0.0.22])
+m4_define([gegl_required_version], [0.0.18])
m4_define([glib_required_version], [2.16.1])
m4_define([gtk_required_version], [2.12.1])
m4_define([gdk_pixbuf_required_version], [gtk_required_version])
@@ -49,7 +49,7 @@
m4_define([fontconfig_required_version], [2.2.0])
m4_define([cairo_required_version], [1.4.10])
m4_define([gtkdoc_required_version], [1.0])
-m4_define([gtkhtml2_required_version], [2.0.0])
+m4_define([webkit_required_version], [0.1])
m4_define([alsa_required_version], [1.0.0])
m4_define([rsvg_required_version], [2.14.0])
m4_define([wmf_required_version], [0.2.8])
@@ -406,7 +406,7 @@
# language code to ALL_LINGUAS.
ALL_LINGUAS="ar bg ca ca valencia cs da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hu hr id is it ja km ko lt mk ms nb ne nl nn oc pa pl pt pt_BR ro ru rw sk sl sr sr Latn sv tr tt uk vi xh yi zh_CN zh_TW"
-AC_PROG_INTLTOOL
+IT_PROG_INTLTOOL(0.35.5)
AM_GLIB_GNU_GETTEXT
@@ -939,7 +939,7 @@
AC_DEFINE(HAVE_XFIXES, 1,
[Define to 1 to if the XFIXES X extension is available])
LIBSCREENSHOT="$LIBSCREENSHOT $XFIXES_LIBS",
- AC_MSG_RESULT([no]))
+ true)
else
enable_gimp_remote="no (building for $gdk_target)"
@@ -1144,8 +1144,7 @@
have_libexif=yes
PKG_CHECK_MODULES(EXIF, libexif >= exif_required_version,
AC_DEFINE(HAVE_EXIF, 1, [Define to 1 if libexif is available]),
- have_libexif="no (libexif not found or too old)"
- AC_MSG_RESULT([$have_libexif]))
+ have_libexif="no (libexif not found or too old)")
fi
AC_SUBST(EXIF_CFLAGS)
@@ -1202,23 +1201,31 @@
AC_SUBST(LIBXPM)
-####################
-# Check for gtkhtml2
-####################
+##################
+# Check for webkit
+##################
-AC_ARG_WITH(gtkhtml2, [ --without-gtkhtml2 build without gtkhtml2 support])
+AC_ARG_WITH(webkit, [ --without-webkit don't build the help-browser plug-in])
-have_gtkhtml2=no
-if test "x$with_gtkhtml2" != xno; then
- PKG_CHECK_MODULES(GTKHTML2, libgtkhtml-2.0 >= gtkhtml2_required_version,
- have_gtkhtml2=yes,
- AC_MSG_RESULT([no])
- have_gtkhtml2="no (GtkHtml2 not found)")
+have_webkit=no
+if test "x$with_webkit" != xno; then
+ PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= webkit_required_version,
+ have_webkit=yes,
+ have_webkit="no (WebKit not found)")
else
- have_gtkhtml2="no (GtkHtml2 support disabled)"
+ have_webkit="no (WebKit support disabled)"
fi
-AM_CONDITIONAL(BUILD_HELP_BROWSER, test "x$have_gtkhtml2" = xyes)
+if test "x$have_webkit" = xyes; then
+ gimp_save_LIBS=$LIBS
+ LIBS="$LIBS $WEBKIT_LIBS"
+ AC_CHECK_LIB(webkit-1.0, webkit_web_view_set_zoom_level,
+ [AC_DEFINE(HAVE_WEBKIT_ZOOM_API, 1,
+ [Define to 1 if webkit has zoom API])])
+ LIBS=$gimp_save_LIBS
+fi
+
+AM_CONDITIONAL(BUILD_HELP_BROWSER, test "x$have_webkit" = xyes)
###################
@@ -1233,7 +1240,6 @@
PKG_CHECK_MODULES(SVG, librsvg-2.0 >= rsvg_required_version,
SVG='svg$(EXEEXT)'
LIBSVG=$SVG_LIBS,
- AC_MSG_RESULT([no])
have_librsvg="no (librsvg not found)")
else
have_librsvg="no (librsvg support disabled)"
@@ -1274,7 +1280,6 @@
LIBPOPPLER=$POPPLER_LIBS
AC_DEFINE(HAVE_POPPLER, 1, [Define to 1 if libpoppler is available])
have_poppler=yes,
- AC_MSG_RESULT([no])
have_poppler="Using PostScript plug-in (libpoppler not found)")
else
have_poppler="Using PostScript plug-in (libpoppler support disabled)"
@@ -1323,7 +1328,6 @@
PKG_CHECK_MODULES(URI_GNOME_VFS, $gnome_vfs_modules,
have_gnomevfs=yes,
- AC_MSG_RESULT([no])
have_gnomevfs="no (gnome-vfs-2.0 not found)")
fi
@@ -1341,7 +1345,6 @@
PKG_CHECK_MODULES(URI_LIBCURL, $libcurl_modules,
have_libcurl=yes,
- AC_MSG_RESULT([no])
have_libcurl="no (libcurl not found)")
fi
@@ -1513,7 +1516,6 @@
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= dbus_glib_required_version,
have_dbus_glib=yes,
- AC_MSG_RESULT([no])
have_dbus_glib=no)
fi
@@ -1549,7 +1551,6 @@
test "x$with_hal" != xno; then
PKG_CHECK_MODULES(HAL, hal >= libhal_required_version,
have_libhal=yes,
- AC_MSG_RESULT([no])
have_libhal="no (libhal not found)"
)
fi
@@ -2095,7 +2096,7 @@
Optional Plug-Ins:
Ascii Art: $have_libaa
- Help Browser: $have_gtkhtml2
+ Help Browser: $have_webkit
LCMS: $have_lcms
JPEG: $jpeg_ok
MNG: $have_libmng
Modified: branches/soc-2008-tagging/cursors/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/cursors/Makefile.am (original)
+++ branches/soc-2008-tagging/cursors/Makefile.am Sat Jun 21 05:12:58 2008
@@ -131,6 +131,8 @@
xbm/modifier-pattern-mask.xbm \
xbm/modifier-join.xbm \
xbm/modifier-join-mask.xbm \
+ xbm/modifier-select.xbm \
+ xbm/modifier-select-mask.xbm \
\
xbm/tool-rect-select.xbm \
xbm/tool-rect-select-mask.xbm \
Modified: branches/soc-2008-tagging/desktop/gimp.desktop.in.in
==============================================================================
--- branches/soc-2008-tagging/desktop/gimp.desktop.in.in (original)
+++ branches/soc-2008-tagging/desktop/gimp.desktop.in.in Sat Jun 21 05:12:58 2008
@@ -1,6 +1,5 @@
[Desktop Entry]
Version=1.0
-Encoding=UTF-8
Type=Application
_Name=GNU Image Manipulation Program
_GenericName=Image Editor
Modified: branches/soc-2008-tagging/devel-docs/app/app-docs.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/app/app-docs.sgml (original)
+++ branches/soc-2008-tagging/devel-docs/app/app-docs.sgml Sat Jun 21 05:12:58 2008
@@ -623,7 +623,6 @@
<chapter id="app-display-utils">
<title>Misc. Widgets & Utilities</title>
- <xi:include href="xml/gimpdbusservice.xml" />
<xi:include href="xml/gimpnavigationeditor.xml" />
<xi:include href="xml/gimpstatusbar.xml" />
</chapter>
@@ -1003,6 +1002,7 @@
<xi:include href="xml/gimpcairo-wilber.xml" />
<xi:include href="xml/gimpclipboard.xml" />
<xi:include href="xml/gimpcursor.xml" />
+ <xi:include href="xml/gimpdbusservice.xml" />
<xi:include href="xml/gimpdnd.xml" />
<xi:include href="xml/gimpdnd-xds.xml" />
<xi:include href="xml/gimppixbuf.xml" />
Modified: branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt (original)
+++ branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt Sat Jun 21 05:12:58 2008
@@ -853,6 +853,7 @@
GIMP_STOCK_QUESTION
GIMP_STOCK_WARNING
GIMP_STOCK_GEGL
+GIMP_STOCK_USER_MANUAL
GIMP_STOCK_WILBER
GIMP_STOCK_WILBER_EEK
GIMP_STOCK_ZOOM_FOLLOW_WINDOW
Modified: branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml (original)
+++ branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml Sat Jun 21 05:12:58 2008
@@ -1063,6 +1063,16 @@
+<!-- ##### MACRO GIMP_STOCK_USER_MANUAL ##### -->
+<para xml:base="../gimpstock.xml">
+<inlinegraphic fileref="stock-user-manual-64.png" format="png"></inlinegraphic>
+<inlinegraphic fileref="stock-user-manual-32.png" format="png"></inlinegraphic>
+<inlinegraphic fileref="stock-user-manual-24.png" format="png"></inlinegraphic>
+<inlinegraphic fileref="stock-user-manual-16.png" format="png"></inlinegraphic>
+</para>
+
+
+
<!-- ##### MACRO GIMP_STOCK_WILBER ##### -->
<para xml:base="../gimpstock.xml">
<inlinegraphic fileref="stock-wilber-64.png" format="png"></inlinegraphic>
Modified: branches/soc-2008-tagging/docs/gimprc.5.in
==============================================================================
--- branches/soc-2008-tagging/docs/gimprc.5.in (original)
+++ branches/soc-2008-tagging/docs/gimprc.5.in Sat Jun 21 05:12:58 2008
@@ -782,7 +782,7 @@
web-browser.
.TP
-(web-browser "xdg-open %s")
+(web-browser "firefox %s")
Sets the external web browser to be used. This can be an absolute path or the
name of an executable to search for in the user's PATH. If the command
@@ -790,6 +790,18 @@
to the command with a space separating the two. This is a single filename.
.TP
+(user-manual-online no)
+
+When enabled, the online user manual will be used by the help system.
+Otherwise the locally installed copy is used. Possible values are yes and no.
+
+.TP
+(user-manual-online-uri "http://docs.gimp.org/2.5")
+
+The location of the online user manual. This is used if 'user-manual-online'
+is enabled. This is a string value.
+
+.TP
(toolbox-window-hint utility)
The window type hint that is set on the toolbox. This may affect how your
Modified: branches/soc-2008-tagging/etc/gimprc
==============================================================================
--- branches/soc-2008-tagging/etc/gimprc (original)
+++ branches/soc-2008-tagging/etc/gimprc Sat Jun 21 05:12:58 2008
@@ -620,7 +620,18 @@
# appended to the command with a space separating the two. This is a single
# filename.
#
-# (web-browser "xdg-open %s")
+# (web-browser "firefox %s")
+
+# When enabled, the online user manual will be used by the help system.
+# Otherwise the locally installed copy is used. Possible values are yes and
+# no.
+#
+# (user-manual-online no)
+
+# The location of the online user manual. This is used if
+# 'user-manual-online' is enabled. This is a string value.
+#
+# (user-manual-online-uri "http://docs.gimp.org/2.5")
# The window type hint that is set on the toolbox. This may affect how your
# window manager decorates and handles the toolbox window. Possible values
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpstock.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpstock.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpstock.c Sat Jun 21 05:12:58 2008
@@ -274,6 +274,7 @@
{ GIMP_STOCK_ERROR, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_INFO, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_QUESTION, NULL, 0, 0, LIBGIMP_DOMAIN },
+ { GIMP_STOCK_USER_MANUAL, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_WARNING, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_WILBER, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_WILBER_EEK, NULL, 0, 0, LIBGIMP_DOMAIN },
@@ -639,6 +640,7 @@
{ GIMP_STOCK_WARNING, stock_warning_16 },
{ GIMP_STOCK_WILBER, stock_wilber_16 },
{ GIMP_TOILET_PAPER, stock_toilet_paper_16 },
+ { GIMP_STOCK_USER_MANUAL, stock_user_manual_16 },
{ GIMP_STOCK_WEB, stock_web_16 },
{ GIMP_STOCK_VIDEO, stock_video_16 },
{ GIMP_STOCK_GEGL, stock_gegl_16 },
@@ -668,11 +670,12 @@
{ GIMP_STOCK_CHANNEL_GRAY, stock_channel_gray_32 },
{ GIMP_STOCK_CHANNEL_INDEXED, stock_channel_indexed_32 },
{ GIMP_STOCK_CHANNEL_ALPHA, stock_channel_alpha_32 },
+ { GIMP_STOCK_FLOATING_SELECTION, stock_floating_selection_32 },
{ GIMP_STOCK_LAYER_MASK, stock_layer_mask_32 },
{ GIMP_STOCK_IMAGE, stock_image_32 },
{ GIMP_STOCK_LAYER, stock_layer_32 },
{ GIMP_STOCK_TEXT_LAYER, stock_text_layer_32 },
- { GIMP_STOCK_FLOATING_SELECTION, stock_floating_selection_32 }
+ { GIMP_STOCK_USER_MANUAL, stock_user_manual_32 }
};
static const struct
@@ -689,15 +692,16 @@
{ GIMP_STOCK_CHANNEL_GRAY, stock_channel_gray_48 },
{ GIMP_STOCK_CHANNEL_INDEXED, stock_channel_indexed_48 },
{ GIMP_STOCK_CHANNEL_ALPHA, stock_channel_alpha_48 },
+ { GIMP_STOCK_FLOATING_SELECTION, stock_floating_selection_48 },
{ GIMP_STOCK_LAYER_MASK, stock_layer_mask_48 },
{ GIMP_STOCK_IMAGE, stock_image_48 },
{ GIMP_STOCK_LAYER, stock_layer_48 },
{ GIMP_STOCK_TEXT_LAYER, stock_text_layer_48 },
- { GIMP_STOCK_FLOATING_SELECTION, stock_floating_selection_48 },
{ GIMP_STOCK_ERROR, stock_error_64 },
{ GIMP_STOCK_INFO, stock_info_64 },
{ GIMP_STOCK_QUESTION, stock_question_64 },
+ { GIMP_STOCK_USER_MANUAL, stock_user_manual_64 },
{ GIMP_STOCK_WARNING, stock_warning_64 },
{ GIMP_STOCK_WILBER, stock_wilber_64 },
{ GIMP_STOCK_WILBER_EEK, stock_wilber_eek_64 },
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpstock.h
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpstock.h (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpstock.h Sat Jun 21 05:12:58 2008
@@ -263,6 +263,7 @@
#define GIMP_STOCK_WILBER_EEK "gimp-wilber-eek"
#define GIMP_STOCK_FRAME "gimp-frame"
#define GIMP_STOCK_TEXTURE "gimp-texture"
+#define GIMP_STOCK_USER_MANUAL "gimp-user-manual"
/* missing icons: */
Modified: branches/soc-2008-tagging/modules/controller_midi.c
==============================================================================
--- branches/soc-2008-tagging/modules/controller_midi.c (original)
+++ branches/soc-2008-tagging/modules/controller_midi.c Sat Jun 21 05:12:58 2008
@@ -841,17 +841,20 @@
switch (event->type)
{
case SND_SEQ_EVENT_NOTEON:
- midi_event (midi, midi->channel, event->data.note.note,
+ midi_event (midi, event->data.note.channel,
+ event->data.note.note,
(gdouble) event->data.note.velocity / 127.0);
break;
case SND_SEQ_EVENT_NOTEOFF:
- midi_event (midi, midi->channel, event->data.note.note + 128,
+ midi_event (midi, event->data.note.channel,
+ event->data.note.note + 128,
(gdouble) event->data.note.velocity / 127.0);
break;
case SND_SEQ_EVENT_CONTROLLER:
- midi_event (midi, midi->channel, event->data.control.param + 256,
+ midi_event (midi, event->data.control.channel,
+ event->data.control.param + 256,
(gdouble) event->data.control.value / 127.0);
break;
Modified: branches/soc-2008-tagging/plug-ins/common/filter-pack.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/filter-pack.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/filter-pack.c Sat Jun 21 05:12:58 2008
@@ -204,7 +204,7 @@
static void fp_frames_checkbutton_in_box (GtkWidget *vbox,
const gchar *label,
- GtkSignalFunc func,
+ GCallback func,
GtkWidget *frame,
gboolean clicked);
@@ -698,19 +698,19 @@
gtk_widget_show (box);
fp_frames_checkbutton_in_box (box, _("_Hue"),
- GTK_SIGNAL_FUNC (fp_show_hide_frame),
+ G_CALLBACK (fp_show_hide_frame),
fp_frames.palette,
fpvals.visible_frames & HUE);
fp_frames_checkbutton_in_box (box, _("_Saturation"),
- GTK_SIGNAL_FUNC (fp_show_hide_frame),
+ G_CALLBACK (fp_show_hide_frame),
fp_frames.satur,
fpvals.visible_frames & SATURATION);
fp_frames_checkbutton_in_box (box, _("_Value"),
- GTK_SIGNAL_FUNC (fp_show_hide_frame),
+ G_CALLBACK (fp_show_hide_frame),
fp_frames.lnd,
fpvals.visible_frames & VALUE);
fp_frames_checkbutton_in_box (box, _("A_dvanced"),
- GTK_SIGNAL_FUNC (fp_show_hide_frame),
+ G_CALLBACK (fp_show_hide_frame),
AW.window,
FALSE);
gtk_widget_show (frame);
@@ -897,7 +897,7 @@
static void
fp_frames_checkbutton_in_box (GtkWidget *vbox,
const gchar *label,
- GtkSignalFunc function,
+ GCallback function,
GtkWidget *frame,
gboolean clicked)
{
@@ -909,7 +909,7 @@
gtk_widget_show (button);
g_signal_connect (button, "clicked",
- G_CALLBACK (function),
+ function,
frame);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clicked);
Modified: branches/soc-2008-tagging/plug-ins/common/sample-colorize.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/sample-colorize.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/sample-colorize.c Sat Jun 21 05:12:58 2008
@@ -1428,7 +1428,7 @@
gtk_widget_show (check_button);
g_signal_connect (check_button, "toggled",
- (GtkSignalFunc)smp_toggle_callback ,
+ G_CALLBACK (smp_toggle_callback),
&g_di.sample_show_selection);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
g_di.sample_show_selection);
@@ -1439,7 +1439,7 @@
gtk_widget_show (check_button);
g_signal_connect (check_button, "toggled",
- (GtkSignalFunc)smp_toggle_callback ,
+ G_CALLBACK (smp_toggle_callback),
&g_di.sample_show_color);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
g_di.sample_show_color);
Modified: branches/soc-2008-tagging/plug-ins/help-browser/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/Makefile.am (original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/Makefile.am Sat Jun 21 05:12:58 2008
@@ -1,13 +1,14 @@
## Process this file with automake to produce Makefile.in
-libgimphelp = $(top_builddir)/plug-ins/help/libgimphelp.a
-libgimpui = $(top_builddir)/libgimp/libgimpui-$(GIMP_API_VERSION).la
-libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
-libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la
libgimp = $(top_builddir)/libgimp/libgimp-$(GIMP_API_VERSION).la
-libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
+libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
+libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
+libgimpui = $(top_builddir)/libgimp/libgimpui-$(GIMP_API_VERSION).la
+libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la
+
+libgimphelp = $(top_builddir)/plug-ins/help/libgimphelp.a
if OS_WIN32
mwindows = -mwindows
@@ -21,7 +22,7 @@
INCLUDES = \
-I$(top_srcdir) \
- $(GTKHTML2_CFLAGS) \
+ $(WEBKIT_CFLAGS) \
-I$(includedir)
LDADD = \
@@ -33,12 +34,12 @@
$(libgimpcolor) \
$(libgimpmath) \
$(libgimpbase) \
- $(GTKHTML2_LIBS) \
+ $(WEBKIT_LIBS) \
$(GIO_LIBS) \
$(RT_LIBS) \
$(INTLLIBS)
-help_browser_sources = \
+help_browser_SOURCES = \
gimpthrobber.c \
gimpthrobber.h \
gimpthrobberaction.c \
@@ -46,21 +47,5 @@
help-browser.c \
dialog.c \
dialog.h \
- queue.c \
- queue.h \
uri.c \
uri.h
-
-help_browser_built_sources = logo-pixbuf.h
-dialog.c: $(help_browser_built_sources)
-
-help_browser_SOURCES = \
- $(help_browser_built_sources) $(help_browser_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
Modified: branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/dialog.c (original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/dialog.c Sat Jun 21 05:12:58 2008
@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* GIMP Help Browser
- * Copyright (C) 1999-2005 Sven Neumann <sven gimp org>
+ * Copyright (C) 1999-2008 Sven Neumann <sven gimp org>
* Michael Natterer <mitch gimp org>
*
* dialog.c
@@ -24,8 +24,10 @@
#include "config.h"
+#include <stdlib.h>
#include <string.h>
#include <errno.h>
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -34,9 +36,7 @@
#include <gtk/gtk.h>
-#undef GDK_PIXBUF_DISABLE_SINGLE_INCLUDES
-#include <libgtkhtml/gtkhtml.h>
-#define GDK_PIXBUF_DISABLE_SINGLE_INCLUDES
+#include <webkit/webkit.h>
#include "libgimpwidgets/gimpwidgets.h"
@@ -53,11 +53,8 @@
#include "gimpthrobberaction.h"
#include "dialog.h"
-#include "queue.h"
#include "uri.h"
-#include "logo-pixbuf.h"
-
#include "libgimp/stdplugins-intl.h"
#ifndef _O_BINARY
@@ -69,10 +66,11 @@
typedef struct
{
- gint width;
- gint height;
- gint paned_position;
- gdouble zoom;
+ gint width;
+ gint height;
+ gint paned_position;
+ gboolean show_index;
+ gdouble zoom;
} DialogData;
enum
@@ -83,99 +81,72 @@
/* local function prototypes */
-static GtkUIManager * ui_manager_new (GtkWidget *window);
-static void browser_dialog_404 (HtmlDocument *doc,
- const gchar *uri,
- const gchar *message);
-
-static void back_callback (GtkAction *action,
- gpointer data);
-static void forward_callback (GtkAction *action,
- gpointer data);
-static void index_callback (GtkAction *action,
- gpointer data);
-static void zoom_in_callback (GtkAction *action,
- gpointer data);
-static void zoom_out_callback (GtkAction *action,
- gpointer data);
-static void close_callback (GtkAction *action,
- gpointer data);
-static void online_callback (GtkAction *action,
- gpointer data);
-
-static void update_toolbar (void);
-
-static void combo_changed (GtkWidget *widget,
- gpointer data);
-
-static void drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- gpointer data);
-static void drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- gpointer data);
-
-static void row_activated (GtkTreeView *tree_view,
- GtkTreePath *path,
- GtkTreeViewColumn *column);
-static void dialog_unmap (GtkWidget *window,
- GtkWidget *paned);
-
-static void view_realize (GtkWidget *widget);
-static void view_unrealize (GtkWidget *widget);
-static gboolean view_popup_menu (GtkWidget *widget,
- GdkEventButton *event);
-static gboolean view_button_press (GtkWidget *widget,
- GdkEventButton *event);
-
-static void title_changed (HtmlDocument *doc,
- const gchar *new_title,
- gpointer data);
-static void link_clicked (HtmlDocument *doc,
- const gchar *uri,
- gpointer data);
-static gboolean request_url (HtmlDocument *doc,
- const gchar *uri,
- HtmlStream *stream,
- GError **error);
-static gboolean io_handler (GIOChannel *io,
- GIOCondition condition,
- gpointer data);
-static void load_remote_page (const gchar *uri);
-
-static void history_add (GtkComboBox *combo,
- const gchar *uri,
- const gchar *title);
+static GtkUIManager * ui_manager_new (GtkWidget *window);
+
+static void back_callback (GtkAction *action,
+ gpointer data);
+static void forward_callback (GtkAction *action,
+ gpointer data);
+static void reload_callback (GtkAction *action,
+ gpointer data);
+static void stop_callback (GtkAction *action,
+ gpointer data);
+static void home_callback (GtkAction *action,
+ gpointer data);
+static void copy_location_callback (GtkAction *action,
+ gpointer data);
+static void show_index_callback (GtkAction *action,
+ gpointer data);
+static void zoom_in_callback (GtkAction *action,
+ gpointer data);
+static void zoom_out_callback (GtkAction *action,
+ gpointer data);
+static void close_callback (GtkAction *action,
+ gpointer data);
+static void website_callback (GtkAction *action,
+ gpointer data);
+
+static void update_actions (void);
+
+static void window_set_icons (GtkWidget *window);
+
+static void row_activated (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column);
+static void dialog_unmap (GtkWidget *window,
+ GtkWidget *paned);
+
+static void view_realize (GtkWidget *widget);
+static void view_unrealize (GtkWidget *widget);
+static gboolean view_popup_menu (GtkWidget *widget,
+ GdkEventButton *event);
+static gboolean view_button_press (GtkWidget *widget,
+ GdkEventButton *event);
+
+static void title_changed (GtkWidget *view,
+ WebKitWebFrame *frame,
+ const gchar *title,
+ GtkWidget *window);
+static void load_started (GtkWidget *view,
+ WebKitWebFrame *frame);
+static void load_finished (GtkWidget *view,
+ WebKitWebFrame *frame);
-static gboolean has_case_prefix (const gchar *haystack,
- const gchar *needle);
+static void select_index (const gchar *uri);
-static gchar * filename_from_uri (const gchar *uri);
/* private variables */
-static const gchar *eek_png_tag = "<h1>Eeek!</h1>";
+static GHashTable *uri_hash_table = NULL;
-static Queue *queue = NULL;
-static gchar *current_uri = NULL;
-static GHashTable *uri_hash_table = NULL;
-
-static GtkWidget *html = NULL;
-static GtkWidget *tree_view = NULL;
-static GtkUIManager *ui_manager = NULL;
-static GtkWidget *button_prev = NULL;
-static GtkWidget *button_next = NULL;
-static GdkCursor *busy_cursor = NULL;
-
-static const GtkTargetEntry help_dnd_target_table[] =
-{
- { "text/uri-list", 0, 0 },
- { "_NETSCAPE_URL", 0, 0 }
-};
+static GtkWidget *view = NULL;
+static GtkWidget *sidebar = NULL;
+static GtkWidget *tree_view = NULL;
+static GtkUIManager *ui_manager = NULL;
+static GtkWidget *button_prev = NULL;
+static GtkWidget *button_next = NULL;
+static GdkCursor *busy_cursor = NULL;
/* public functions */
@@ -183,41 +154,24 @@
void
browser_dialog_open (void)
{
- GtkWidget *window;
- GtkWidget *vbox;
- GtkWidget *toolbar;
- GtkWidget *paned;
- GtkWidget *hbox;
- GtkWidget *scroll;
- GtkWidget *drag_source;
- GtkWidget *image;
- GtkWidget *combo;
- GtkWidget *button;
- GtkToolItem *item;
- GtkAction *action;
- GtkListStore *history;
- GtkCellRenderer *cell;
- GdkPixbuf *pixbuf;
- gchar *eek_png_path;
- DialogData data = { 720, 560, 240, 1.0 };
+ GtkWidget *window;
+ GtkWidget *vbox;
+ GtkWidget *toolbar;
+ GtkWidget *paned;
+ GtkWidget *scrolled;
+ GtkWidget *button;
+ GtkToolItem *item;
+ GtkAction *action;
+ DialogData data = { 720, 560, 240, TRUE, 1.0 };
gimp_ui_init ("helpbrowser", TRUE);
gimp_get_data (GIMP_HELP_BROWSER_DIALOG_DATA, &data);
- eek_png_path = g_build_filename (gimp_data_directory (),
- "themes", "Default", "images",
- "stock-wilber-eek-64.png", NULL);
-
- if (g_file_test (eek_png_path, G_FILE_TEST_EXISTS))
- eek_png_tag = g_strdup_printf ("<img src=\"%s\">", eek_png_path);
-
- g_free (eek_png_path);
-
/* the dialog window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), _("GIMP Help Browser"));
- gtk_window_set_role (GTK_WINDOW (window), "helpbrowser");
+ gtk_window_set_role (GTK_WINDOW (window), "help-browser");
gtk_window_set_default_size (GTK_WINDOW (window), data.width, data.height);
@@ -225,9 +179,7 @@
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);
+ window_set_icons (window);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (window), vbox);
@@ -236,6 +188,7 @@
ui_manager = ui_manager_new (window);
toolbar = gtk_ui_manager_get_widget (ui_manager, "/help-browser-toolbar");
+ gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, FALSE, 0);
gtk_widget_show (toolbar);
@@ -266,25 +219,27 @@
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));
+ "/help-browser-toolbar/website");
/* the horizontal paned */
paned = gtk_hpaned_new ();
gtk_box_pack_start (GTK_BOX (vbox), paned, TRUE, TRUE, 0);
gtk_widget_show (paned);
- scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
+ scrolled = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_paned_add1 (GTK_PANED (paned), scroll);
+ gtk_paned_add1 (GTK_PANED (paned), scrolled);
gtk_paned_set_position (GTK_PANED (paned), data.paned_position);
- gtk_widget_show (scroll);
+
+ sidebar = scrolled;
+
+ if (data.show_index)
+ gtk_widget_show (sidebar);
tree_view = gtk_tree_view_new ();
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
- gtk_container_add (GTK_CONTAINER (scroll), tree_view);
+ gtk_container_add (GTK_CONTAINER (scrolled), tree_view);
gtk_widget_show (tree_view);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), -1,
@@ -297,229 +252,90 @@
G_CALLBACK (row_activated),
NULL);
- vbox = gtk_vbox_new (FALSE, 2);
- gtk_paned_add2 (GTK_PANED (paned), vbox);
- gtk_widget_show (vbox);
-
- hbox = gtk_hbox_new (FALSE, 2);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- gtk_widget_show (hbox);
-
- /* the drag source */
- drag_source = gtk_event_box_new ();
- gtk_box_pack_start (GTK_BOX (hbox), drag_source, FALSE, FALSE, 4);
- gtk_widget_show (drag_source);
-
- gimp_help_set_help_data (drag_source,
- _("Drag and drop this icon to a web browser"),
- NULL);
-
- gtk_drag_source_set (GTK_WIDGET (drag_source),
- GDK_BUTTON1_MASK,
- help_dnd_target_table,
- G_N_ELEMENTS (help_dnd_target_table),
- GDK_ACTION_COPY);
-
- g_signal_connect (drag_source, "drag-begin",
- G_CALLBACK (drag_begin),
- NULL);
- g_signal_connect (drag_source, "drag-data-get",
- G_CALLBACK (drag_data_get),
- NULL);
-
- image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON);
- gtk_container_add (GTK_CONTAINER (drag_source), image);
- gtk_widget_show (image);
-
- /* the title combo */
- history = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
- combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (history));
- g_object_unref (history);
-
- cell = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell,
- "text", HISTORY_TITLE,
- NULL);
-
- gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
- gtk_widget_show (combo);
-
- g_signal_connect (combo, "changed",
- G_CALLBACK (combo_changed),
- NULL);
-
/* HTML view */
- html = html_view_new ();
- queue = queue_new ();
-
- gtk_widget_set_size_request (html, 300, 200);
-
- scroll =
- gtk_scrolled_window_new (gtk_layout_get_hadjustment (GTK_LAYOUT (html)),
- gtk_layout_get_vadjustment (GTK_LAYOUT (html)));
-
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
+ scrolled = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
- gtk_widget_show (scroll);
- gtk_container_add (GTK_CONTAINER (scroll), html);
- gtk_widget_show (html);
+ gtk_widget_set_size_request (scrolled, 300, 200);
+ gtk_paned_add2 (GTK_PANED (paned), scrolled);
+ gtk_widget_show (scrolled);
+
+ view = webkit_web_view_new ();
+ webkit_web_view_set_maintains_back_forward_list (WEBKIT_WEB_VIEW (view),
+ TRUE);
+ gtk_container_add (GTK_CONTAINER (scrolled), view);
+ gtk_widget_show (view);
- g_signal_connect (html, "realize",
+ g_signal_connect (view, "realize",
G_CALLBACK (view_realize),
NULL);
- g_signal_connect (html, "unrealize",
+ g_signal_connect (view, "unrealize",
G_CALLBACK (view_unrealize),
NULL);
- g_signal_connect (html, "popup-menu",
+ g_signal_connect (view, "popup-menu",
G_CALLBACK (view_popup_menu),
NULL);
- g_signal_connect (html, "button-press-event",
+ g_signal_connect (view, "button-press-event",
G_CALLBACK (view_button_press),
NULL);
- html_view_set_magnification (HTML_VIEW (html), data.zoom);
- html_view_set_document (HTML_VIEW (html), html_document_new ());
+#if HAVE_WEBKIT_ZOOM_API
+ webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW (view), data.zoom);
+#endif
- g_signal_connect (HTML_VIEW (html)->document, "title-changed",
+ g_signal_connect (view, "title-changed",
G_CALLBACK (title_changed),
- combo);
- g_signal_connect (HTML_VIEW (html)->document, "link-clicked",
- G_CALLBACK (link_clicked),
+ window);
+
+ g_signal_connect (view, "load-started",
+ G_CALLBACK (load_started),
NULL);
- g_signal_connect (HTML_VIEW (html)->document, "request-url",
- G_CALLBACK (request_url),
+ g_signal_connect (view, "load-finished",
+ G_CALLBACK (load_finished),
NULL);
- gtk_widget_grab_focus (html);
+ gtk_widget_grab_focus (view);
g_signal_connect (window, "unmap",
G_CALLBACK (dialog_unmap),
paned);
-}
-
-static gboolean
-idle_jump_to_anchor (const gchar *anchor)
-{
- if (html && anchor)
- html_view_jump_to_anchor (HTML_VIEW (html), anchor);
- return FALSE;
-}
-
-static gboolean
-idle_scroll_to_pos (gpointer data)
-{
- gint offset = GPOINTER_TO_INT (data);
-
- if (html)
- {
- GtkAdjustment *adj = gtk_layout_get_vadjustment (GTK_LAYOUT (html));
-
- gtk_adjustment_set_value (adj,
- (gdouble) offset / (1 << 16) * adj->upper);
- }
-
- return FALSE;
+ update_actions ();
}
void
-browser_dialog_load (const gchar *uri,
- gboolean add_to_queue)
+browser_dialog_load (const gchar *uri)
{
- HtmlDocument *doc = HTML_VIEW (html)->document;
- GtkAdjustment *adj = gtk_layout_get_vadjustment (GTK_LAYOUT (html));
- gchar *abs;
- gchar *new_uri;
- gchar *anchor;
- gchar *tmp;
-
g_return_if_fail (uri != NULL);
- if (! current_uri)
- {
- gchar *slash;
-
- current_uri = g_strdup (uri);
-
- slash = strrchr (current_uri, '/');
-
- if (slash)
- *slash = '\0';
- }
+ webkit_web_view_open (WEBKIT_WEB_VIEW (view), uri);
- abs = uri_to_abs (uri, current_uri);
- if (! abs)
- return;
+ select_index (uri);
- anchor = strchr (uri, '#');
- if (anchor && anchor[0] && anchor[1])
- {
- new_uri = g_strconcat (abs, anchor, NULL);
- anchor += 1;
- }
- else
- {
- new_uri = g_strdup (abs);
- anchor = NULL;
- }
-
- if (uri_hash_table)
- browser_dialog_goto_index (new_uri);
-
- if (! has_case_prefix (abs, "file:/"))
- {
- load_remote_page (uri);
- return;
- }
-
- tmp = uri_to_abs (current_uri, current_uri);
- if (!tmp || strcmp (tmp, abs))
- {
- GError *error = NULL;
-
- html_document_clear (doc);
- html_document_open_stream (doc, "text/html");
- gtk_adjustment_set_value (adj, 0.0);
-
- if (anchor)
- g_idle_add_full (G_PRIORITY_LOW,
- (GSourceFunc) idle_jump_to_anchor,
- g_strdup (anchor), (GDestroyNotify) g_free);
-
- if (request_url (doc, abs, doc->current_stream, &error))
- {
- if (html->window)
- gdk_window_set_cursor (html->window, busy_cursor);
- }
- else
- {
- browser_dialog_404 (doc, abs, error->message);
- g_error_free (error);
- }
- }
- else
- {
- if (anchor)
- html_view_jump_to_anchor (HTML_VIEW (html), anchor);
- else
- gtk_adjustment_set_value (adj, 0.0);
- }
-
- g_free (tmp);
-
- g_free (current_uri);
- current_uri = new_uri;
+ gtk_window_present (GTK_WINDOW (gtk_widget_get_toplevel (view)));
+}
- if (add_to_queue)
- queue_add (queue, new_uri);
+static void
+window_set_icons (GtkWidget *window)
+{
+ const GtkIconSize sizes[] = { GTK_ICON_SIZE_MENU,
+ GTK_ICON_SIZE_BUTTON,
+ GTK_ICON_SIZE_DND,
+ GTK_ICON_SIZE_DIALOG };
+ GList *list = NULL;
+ gint i;
- update_toolbar ();
+ for (i = 0; i < G_N_ELEMENTS (sizes); i++)
+ list = g_list_prepend (list,
+ gtk_widget_render_icon (window,
+ GIMP_STOCK_USER_MANUAL,
+ sizes[i], NULL));
- gtk_window_present (GTK_WINDOW (gtk_widget_get_toplevel (html)));
+ gtk_window_set_icon_list (GTK_WINDOW (window), list);
+ g_list_foreach (list, (GFunc) g_object_unref, NULL);
+ g_list_free (list);
}
static void
@@ -657,25 +473,25 @@
add_child (store, domain, locale, NULL, item);
}
- gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view),
- GTK_TREE_MODEL (store));
+ gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (store));
g_object_unref (store);
}
-void
-browser_dialog_goto_index (const gchar *ref)
+static void
+select_index (const gchar *uri)
{
- GtkTreeIter *iter = g_hash_table_lookup (uri_hash_table, ref);
+ GtkTreeSelection *selection;
+ GtkTreeIter *iter;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
+
+ iter = g_hash_table_lookup (uri_hash_table, uri);
if (iter)
{
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreePath *path;
- GtkTreePath *scroll_path;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
+ GtkTreePath *path;
+ GtkTreePath *scroll_path;
path = gtk_tree_model_get_path (model, iter);
scroll_path = gtk_tree_path_copy (path);
@@ -690,6 +506,10 @@
gtk_tree_selection_select_iter (selection, iter);
}
+ else
+ {
+ gtk_tree_selection_unselect_all (selection);
+ }
}
@@ -711,9 +531,25 @@
G_CALLBACK (forward_callback)
},
{
- "index", GTK_STOCK_INDEX,
+ "reload", GTK_STOCK_REFRESH,
+ N_("_Reload"), "<control>R", N_("Reload current page"),
+ G_CALLBACK (reload_callback)
+ },
+ {
+ "stop", GTK_STOCK_CANCEL,
+ N_("_Stop"), "Escape", N_("Stop loading this page"),
+ G_CALLBACK (stop_callback)
+ },
+ {
+ "home", GTK_STOCK_HOME,
NULL, "<alt>Home", N_("Go to the index page"),
- G_CALLBACK (index_callback)
+ G_CALLBACK (home_callback)
+ },
+ {
+ "copy-location", GTK_STOCK_COPY,
+ N_("C_opy location"), "",
+ N_("Copy the location of this page to the clipboard"),
+ G_CALLBACK (copy_location_callback)
},
{
"zoom-in", GTK_STOCK_ZOOM_IN,
@@ -737,20 +573,36 @@
}
};
+ static const GtkToggleActionEntry toggle_actions[] =
+ {
+ {
+ "show-index", NULL,
+ N_("S_how Index"), "<control>I",
+ N_("Toggle the visibility of the sidebar"),
+ G_CALLBACK (show_index_callback), FALSE
+ }
+ };
+
GtkUIManager *ui_manager = gtk_ui_manager_new ();
GtkActionGroup *group = gtk_action_group_new ("Actions");
GtkAction *action;
GError *error = NULL;
gtk_action_group_set_translation_domain (group, NULL);
- gtk_action_group_add_actions (group, actions, G_N_ELEMENTS (actions), NULL);
+ gtk_action_group_add_actions (group,
+ actions, G_N_ELEMENTS (actions),
+ NULL);
+ gtk_action_group_add_toggle_actions (group,
+ toggle_actions,
+ G_N_ELEMENTS (toggle_actions),
+ NULL);
- action = gimp_throbber_action_new ("online",
+ action = gimp_throbber_action_new ("website",
"docs.gimp.org",
_("Visit the GIMP documentation website"),
- GIMP_STOCK_WILBER);
+ GIMP_STOCK_USER_MANUAL);
g_signal_connect_closure (action, "activate",
- g_cclosure_new (G_CALLBACK (online_callback),
+ g_cclosure_new (G_CALLBACK (website_callback),
NULL, NULL),
FALSE);
gtk_action_group_add_action (group, action);
@@ -766,9 +618,11 @@
gtk_ui_manager_add_ui_from_string (ui_manager,
"<ui>"
" <toolbar name=\"help-browser-toolbar\">"
- " <toolitem action=\"index\" />"
+ " <toolitem action=\"reload\" />"
+ " <toolitem action=\"stop\" />"
+ " <toolitem action=\"home\" />"
" <separator name=\"space\" />"
- " <toolitem action=\"online\" />"
+ " <toolitem action=\"website\" />"
" </toolbar>"
" <accelerator action=\"close\" />"
" <accelerator action=\"quit\" />"
@@ -786,10 +640,17 @@
" <popup name=\"help-browser-popup\">"
" <menuitem action=\"back\" />"
" <menuitem action=\"forward\" />"
- " <menuitem action=\"index\" />"
+ " <menuitem action=\"reload\" />"
+ " <menuitem action=\"stop\" />"
+ " <separator />"
+ " <menuitem action=\"home\" />"
+ " <menuitem action=\"copy-location\" />"
+ " <menuitem action=\"show-index\" />"
+#ifdef HAVE_WEBKIT_ZOOM_API
" <separator />"
" <menuitem action=\"zoom-in\" />"
" <menuitem action=\"zoom-out\" />"
+#endif
" <separator />"
" <menuitem action=\"close\" />"
" </popup>"
@@ -806,132 +667,154 @@
}
static void
-browser_dialog_404 (HtmlDocument *doc,
- const gchar *uri,
- const gchar *message)
-{
- gchar *msg = g_strdup_printf
- ("<html>"
- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"
- "<head><title>%s</title></head>"
- "<body bgcolor=\"white\">"
- "<div align=\"center\">"
- "<div>%s</div>"
- "<h3>%s</h3>"
- "<tt>%s</tt>"
- "<h3>%s</h3>"
- "</div>"
- "</body>"
- "</html>",
- _("Document not found"),
- eek_png_tag,
- _("The requested URL could not be loaded:"),
- uri,
- message);
+back_callback (GtkAction *action,
+ gpointer data)
+{
+ webkit_web_view_go_back (WEBKIT_WEB_VIEW (view));
+}
+
+static void
+forward_callback (GtkAction *action,
+ gpointer data)
+{
+ webkit_web_view_go_forward (WEBKIT_WEB_VIEW (view));
+}
- html_document_write_stream (doc, msg, strlen (msg));
+static void
+reload_callback (GtkAction *action,
+ gpointer data)
+{
+ webkit_web_view_reload (WEBKIT_WEB_VIEW (view));
+}
- g_free (msg);
+static void
+stop_callback (GtkAction *action,
+ gpointer data)
+{
+ webkit_web_view_stop_loading (WEBKIT_WEB_VIEW (view));
}
static void
-back_callback (GtkAction *action,
+home_callback (GtkAction *action,
gpointer data)
{
- gdouble pos;
- const gchar *uri = queue_prev (queue, GPOINTER_TO_INT (data), &pos);
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
+ GimpHelpDomain *domain = g_object_get_data (G_OBJECT (model), "domain");
+ GimpHelpLocale *locale = g_object_get_data (G_OBJECT (model), "locale");
- if (uri)
+ if (domain && locale)
{
- browser_dialog_load (uri, FALSE);
-
- g_idle_add ((GSourceFunc) idle_scroll_to_pos,
- GINT_TO_POINTER ((gint) (pos * (1 << 16))));
-
- queue_move_prev (queue, GPOINTER_TO_INT (data));
+ gchar *uri = g_strconcat (domain->help_uri, "/",
+ locale->locale_id, "/",
+ gimp_help_locale_map (locale,
+ GIMP_HELP_DEFAULT_ID),
+ NULL);
+ browser_dialog_load (uri);
+ g_free (uri);
}
-
- update_toolbar ();
}
static void
-forward_callback (GtkAction *action,
- gpointer data)
+copy_location_callback (GtkAction *action,
+ gpointer data)
{
- gdouble pos;
- const gchar *uri = queue_next (queue, GPOINTER_TO_INT (data), &pos);
+ WebKitWebFrame *frame;
+ const gchar *uri;
+
+ frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view));
+ uri = webkit_web_frame_get_uri (frame);
if (uri)
{
- browser_dialog_load (uri, FALSE);
-
- g_idle_add ((GSourceFunc) idle_scroll_to_pos,
- GINT_TO_POINTER ((gint) (pos * (1 << 16))));
+ GtkClipboard *clipboard;
- queue_move_next (queue, GPOINTER_TO_INT (data));
+ clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (view),
+ GDK_SELECTION_CLIPBOARD);
+ gtk_clipboard_set_text (clipboard, uri, -1);
}
-
- update_toolbar ();
}
static void
-index_callback (GtkAction *action,
- gpointer data)
+show_index_callback (GtkAction *action,
+ gpointer data)
{
- browser_dialog_load ("index.html", TRUE);
+ if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
+ {
+ gtk_widget_show (sidebar);
+ }
+ else
+ {
+ gtk_widget_hide (sidebar);
+ }
}
static void
zoom_in_callback (GtkAction *action,
gpointer data)
{
- html_view_zoom_in (HTML_VIEW (html));
+#ifdef HAVE_WEBKIT_ZOOM_API
+ webkit_web_view_zoom_in (WEBKIT_WEB_VIEW (view));
+#endif
}
static void
zoom_out_callback (GtkAction *action,
gpointer data)
{
- html_view_zoom_out (HTML_VIEW (html));
+#ifdef HAVE_WEBKIT_ZOOM_API
+ webkit_web_view_zoom_out (WEBKIT_WEB_VIEW (view));
+#endif
}
static void
-online_callback (GtkAction *action,
- gpointer data)
+website_callback (GtkAction *action,
+ gpointer data)
{
- load_remote_page ("http://docs.gimp.org/");
+ browser_dialog_load ("http://docs.gimp.org/");
}
static void
close_callback (GtkAction *action,
gpointer data)
{
- gtk_widget_destroy (gtk_widget_get_toplevel (html));
+ gtk_widget_destroy (gtk_widget_get_toplevel (view));
+}
+
+static void
+menu_callback (GtkWidget *menu,
+ WebKitWebHistoryItem *item)
+{
+ browser_dialog_load (webkit_web_history_item_get_uri (item));
}
+/* this function unrefs the items and frees the list */
static GtkWidget *
-build_menu (GList *list,
- GCallback callback)
+build_menu (GList *list)
{
GtkWidget *menu;
- gint i;
if (! list)
return NULL;
menu = gtk_menu_new ();
- for (i = 0; list && i < 15; list = g_list_next (list), i++)
+ do
{
- GtkWidget *menu_item = gtk_menu_item_new_with_label (list->data);
+ WebKitWebHistoryItem *item = list->data;
+ GtkWidget *menu_item;
+
+ menu_item = gtk_menu_item_new_with_label (webkit_web_history_item_get_title (item));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
- g_signal_connect (menu_item, "activate",
- G_CALLBACK (callback),
- GINT_TO_POINTER (i));
+ g_signal_connect_object (menu_item, "activate",
+ G_CALLBACK (menu_callback),
+ item, 0);
+
+ g_object_unref (item);
}
+ while ((list = g_list_next (list)));
g_list_free (list);
@@ -939,87 +822,69 @@
}
static void
-update_toolbar (void)
+update_actions (void)
{
- GtkAction *action;
+ GtkAction *action;
+ WebKitWebBackForwardList *back_forward_list;
+ WebKitWebFrame *frame;
+
+ back_forward_list =
+ webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW (view));
/* update the back button and its menu */
action = gtk_ui_manager_get_action (ui_manager,
"/ui/help-browser-popup/back");
- gtk_action_set_sensitive (action, queue_has_prev (queue));
+ gtk_action_set_sensitive (action,
+ webkit_web_view_can_go_back (WEBKIT_WEB_VIEW (view)));
- gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (button_prev),
- build_menu (queue_list_prev (queue),
- G_CALLBACK (back_callback)));
+ if (back_forward_list)
+ {
+ GList *list;
+
+ list = webkit_web_back_forward_list_get_back_list_with_limit (back_forward_list,
+ 12);
+ gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (button_prev),
+ build_menu (list));
+ }
+ else
+ {
+ gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (button_prev), NULL);
+ }
/* update the forward button and its menu */
action = gtk_ui_manager_get_action (ui_manager,
"/ui/help-browser-popup/forward");
- gtk_action_set_sensitive (action, queue_has_next (queue));
-
- gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (button_next),
- build_menu (queue_list_next (queue),
- G_CALLBACK (forward_callback)));
-}
+ gtk_action_set_sensitive (action,
+ webkit_web_view_can_go_forward (WEBKIT_WEB_VIEW (view)));
-static void
-combo_changed (GtkWidget *widget,
- gpointer data)
-{
- GtkComboBox *combo = GTK_COMBO_BOX (widget);
- GtkTreeIter iter;
-
- if (gtk_combo_box_get_active_iter (combo, &iter))
+ if (back_forward_list)
{
- GValue value = { 0, };
+ GList *list;
- gtk_tree_model_get_value (gtk_combo_box_get_model (combo),
- &iter, HISTORY_URI, &value);
-
- browser_dialog_load (g_value_get_string (&value), TRUE);
-
- g_value_unset (&value);
+ list = webkit_web_back_forward_list_get_forward_list_with_limit (back_forward_list,
+ 12);
+ gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (button_next),
+ build_menu (list));
}
-}
-
-static void
-drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- gpointer data)
-{
- gtk_drag_set_icon_stock (context, GIMP_STOCK_WEB, -8, -8);
-}
-
-static void
-drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- gpointer data)
-{
- if (! current_uri)
- return;
-
- if (selection_data->target ==
- gdk_atom_intern_static_string ("text/uri-list"))
+ else
{
- gchar *uris[2];
+ gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (button_next), NULL);
+ }
- uris[0] = current_uri;
- uris[1] = NULL;
+ /* update the copy-location action */
+ action = gtk_ui_manager_get_action (ui_manager,
+ "/ui/help-browser-popup/copy-location");
- gtk_selection_data_set_uris (selection_data, uris);
- }
- else if (selection_data->target ==
- gdk_atom_intern_static_string ("_NETSCAPE_URL"))
- {
- gtk_selection_data_set (selection_data,
- selection_data->target,
- 8, (guchar *) current_uri, strlen (current_uri));
- }
+ frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view));
+ gtk_action_set_sensitive (action, webkit_web_frame_get_uri (frame) != NULL);
+
+ /* update the show-index action */
+ action = gtk_ui_manager_get_action (ui_manager,
+ "/ui/help-browser-popup/show-index");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+ GTK_WIDGET_VISIBLE (sidebar));
}
static void
@@ -1048,7 +913,7 @@
item->ref,
NULL);
- browser_dialog_load (uri, TRUE);
+ browser_dialog_load (uri);
g_free (uri);
}
@@ -1057,13 +922,19 @@
dialog_unmap (GtkWidget *window,
GtkWidget *paned)
{
- DialogData data;
+ DialogData data;
gtk_window_get_size (GTK_WINDOW (window), &data.width, &data.height);
data.paned_position = gtk_paned_get_position (GTK_PANED (paned));
+ data.show_index = GTK_WIDGET_VISIBLE (sidebar);
- data.zoom = html ? html_view_get_magnification (HTML_VIEW (html)) : 1.0;
+#ifdef HAVE_WEBKIT_ZOOM_API
+ data.zoom = (view ?
+ webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW (view)) : 1.0);
+#else
+ data.zoom = 1.0;
+#endif
gimp_set_data (GIMP_HELP_BROWSER_DIALOG_DATA, &data, sizeof (data));
@@ -1116,255 +987,39 @@
}
static void
-title_changed (HtmlDocument *doc,
- const gchar *new_title,
- gpointer data)
+title_changed (GtkWidget *view,
+ WebKitWebFrame *frame,
+ const gchar *title,
+ GtkWidget *window)
{
- gchar *title = NULL;
-
- if (new_title)
- {
- gchar *c;
-
- title = g_strdup (new_title);
-
- for (c = title; *c; c++)
- {
- if (*c == '\n' || *c == '\r')
- *c = ' ';
- }
-
- title = g_strstrip (title);
- if (! strlen (title))
- {
- g_free (title);
- title = NULL;
- }
- }
-
- history_add (GTK_COMBO_BOX (data),
- current_uri, title ? title : _("Untitled"));
-
- if (title)
- queue_set_title (queue, title);
-
- g_free (title);
-}
-
-static void
-link_clicked (HtmlDocument *doc,
- const gchar *uri,
- gpointer data)
-{
- GtkAdjustment *adj = gtk_layout_get_vadjustment (GTK_LAYOUT (html));
-
- if (adj->upper > 0.0)
- queue_set_scroll_offset (queue, adj->value / adj->upper);
-
- browser_dialog_load (uri, TRUE);
-}
-
-static gboolean
-request_url (HtmlDocument *doc,
- const gchar *uri,
- HtmlStream *stream,
- GError **error)
-{
- gchar *abs;
- gchar *filename;
-
- g_return_val_if_fail (uri != NULL, TRUE);
- g_return_val_if_fail (stream != NULL, TRUE);
+ gchar *full_title;
- abs = uri_to_abs (uri, current_uri);
- if (! abs)
- return TRUE;
+ full_title = g_strdup_printf ("%s - %s",
+ title ? title : _("Untitled"),
+ _("GIMP Help Browser"));
- filename = filename_from_uri (abs);
- g_free (abs);
+ gtk_window_set_title (GTK_WINDOW (window), full_title);
+ g_free (full_title);
- if (filename)
- {
- gint fd = g_open (filename, O_RDONLY | _O_BINARY, 0);
-
- if (fd != -1)
- {
- GIOChannel *io = g_io_channel_unix_new (fd);
-
- g_io_channel_set_close_on_unref (io, TRUE);
- g_io_channel_set_encoding (io, NULL, NULL);
-
- g_io_add_watch (io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
- io_handler, stream);
- }
-
- g_free (filename);
-
- if (fd == -1)
- {
- g_set_error (error,
- G_FILE_ERROR, g_file_error_from_errno (errno),
- g_strerror (errno));
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-static gboolean
-io_handler (GIOChannel *io,
- GIOCondition condition,
- gpointer data)
-{
- HtmlStream *stream = data;
- gchar buffer[8192];
- gsize bytes;
-
- if (condition & G_IO_IN)
- {
- if (g_io_channel_read_chars (io, buffer, sizeof (buffer),
- &bytes, NULL) != G_IO_STATUS_ERROR
- && bytes > 0)
- {
- html_stream_write (stream, buffer, bytes);
- }
- else
- {
- goto error;
- }
-
- if (condition & G_IO_HUP)
- {
- while (g_io_channel_read_chars (io, buffer, sizeof (buffer),
- &bytes, NULL) != G_IO_STATUS_ERROR
- && bytes > 0)
- {
- html_stream_write (stream, buffer, bytes);
- }
- }
- }
-
- if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
- {
- error:
- html_stream_close (stream);
- g_io_channel_unref (io);
-
- if (html->window)
- gdk_window_set_cursor (html->window, NULL);
-
- return FALSE;
- }
-
- return TRUE;
+ update_actions ();
}
static void
-load_remote_page (const gchar *uri)
+load_started (GtkWidget *view,
+ WebKitWebFrame *frame)
{
- GimpParam *return_vals;
- gint nreturn_vals;
-
- /* try to call the user specified web browser */
- return_vals = gimp_run_procedure ("plug-in-web-browser",
- &nreturn_vals,
- GIMP_PDB_STRING, uri,
- GIMP_PDB_END);
- gimp_destroy_params (return_vals, nreturn_vals);
+ GtkAction *action = gtk_ui_manager_get_action (ui_manager,
+ "/ui/help-browser-popup/stop");
+ gtk_action_set_sensitive (action, TRUE);
}
static void
-history_add (GtkComboBox *combo,
- const gchar *uri,
- const gchar *title)
-{
- GtkTreeModel *model = gtk_combo_box_get_model (combo);
- GtkTreeIter iter;
- gboolean iter_valid;
- GValue value = { 0, };
-
- for (iter_valid = gtk_tree_model_get_iter_first (model, &iter);
- iter_valid;
- iter_valid = gtk_tree_model_iter_next (model, &iter))
- {
- gtk_tree_model_get_value (model, &iter, HISTORY_URI, &value);
-
- if (strcmp (g_value_get_string (&value), uri) == 0)
- {
- gtk_list_store_move_after (GTK_LIST_STORE (model), &iter, NULL);
- g_value_unset (&value);
- break;
- }
-
- g_value_unset (&value);
- }
-
- if (! iter_valid)
- {
- gtk_list_store_prepend (GTK_LIST_STORE (model), &iter);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- HISTORY_TITLE, title,
- HISTORY_URI, uri,
- -1);
- }
-
- g_signal_handlers_block_by_func (combo, combo_changed, NULL);
- gtk_combo_box_set_active_iter (combo, &iter);
- g_signal_handlers_unblock_by_func (combo, combo_changed, NULL);
-}
-
-/* Taken from glib/gconvert.c:
- * Test of haystack has the needle prefix, comparing case
- * insensitive. haystack may be UTF-8, but needle must
- * contain only ascii.
- */
-static gboolean
-has_case_prefix (const gchar *haystack, const gchar *needle)
+load_finished (GtkWidget *view,
+ WebKitWebFrame *frame)
{
- const gchar *h = haystack;
- const gchar *n = needle;
-
- while (*n && *h && g_ascii_tolower (*n) == g_ascii_tolower (*h))
- {
- n++;
- h++;
- }
-
- return (*n == '\0');
-}
-
-static gchar *
-filename_from_uri (const gchar *uri)
-{
- gchar *filename;
- gchar *hostname;
-
- g_return_val_if_fail (uri != NULL, NULL);
-
- filename = g_filename_from_uri (uri, &hostname, NULL);
-
- if (!filename)
- return NULL;
-
- if (hostname)
- {
- /* we have a file: URI with a hostname */
-#ifdef G_OS_WIN32
- /* on Win32, create a valid UNC path and use it as the filename */
-
- gchar *tmp = g_build_filename ("//", hostname, filename, NULL);
-
- g_free (filename);
- filename = tmp;
-#else
- /* otherwise return NULL, caller should use URI then */
- g_free (filename);
- filename = NULL;
-#endif
-
- g_free (hostname);
- }
+ GtkAction *action = gtk_ui_manager_get_action (ui_manager,
+ "/ui/help-browser-popup/stop");
+ gtk_action_set_sensitive (action, FALSE);
- return filename;
+ update_actions ();
}
Modified: branches/soc-2008-tagging/plug-ins/help-browser/dialog.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/dialog.h (original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/dialog.h Sat Jun 21 05:12:58 2008
@@ -27,12 +27,10 @@
void browser_dialog_open (void);
-void browser_dialog_load (const gchar *ref,
- gboolean add_to_queue);
+void browser_dialog_load (const gchar *uri);
void browser_dialog_make_index (GimpHelpDomain *domain,
GimpHelpLocale *locale);
-void browser_dialog_goto_index (const gchar *ref);
#endif /* ! __DIALOG_H__ */
Modified: branches/soc-2008-tagging/plug-ins/help-browser/gimpthrobber.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/gimpthrobber.c (original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/gimpthrobber.c Sat Jun 21 05:12:58 2008
@@ -80,7 +80,7 @@
GType
gimp_throbber_get_type (void)
{
- static GtkType type = 0;
+ static GType type = 0;
if (!type)
{
@@ -101,6 +101,7 @@
"GimpThrobber",
&type_info, 0);
}
+
return type;
}
@@ -169,8 +170,9 @@
static void
gimp_throbber_construct_contents (GtkToolItem *tool_item)
{
- GimpThrobber *button = GIMP_THROBBER (tool_item);
- GtkWidget *image;
+ GimpThrobber *button = GIMP_THROBBER (tool_item);
+ GtkWidget *image;
+ GtkToolbarStyle style;
if (button->priv->image && button->priv->image->parent)
gtk_container_remove (GTK_CONTAINER (button->priv->image->parent),
@@ -179,11 +181,18 @@
if (gtk_bin_get_child (GTK_BIN (button->priv->button)))
gtk_widget_destroy (gtk_bin_get_child (GTK_BIN (button->priv->button)));
- if (gtk_tool_item_get_toolbar_style (tool_item) == GTK_TOOLBAR_TEXT)
+ style = gtk_tool_item_get_toolbar_style (tool_item);
+
+ if (style == GTK_TOOLBAR_TEXT)
{
image = gtk_image_new_from_stock (button->priv->stock_id,
GTK_ICON_SIZE_MENU);
}
+ else if (style == GTK_TOOLBAR_ICONS)
+ {
+ image = gtk_image_new_from_stock (button->priv->stock_id,
+ GTK_ICON_SIZE_LARGE_TOOLBAR);
+ }
else if (button->priv->image)
{
image = button->priv->image;
@@ -191,7 +200,7 @@
else
{
image = gtk_image_new_from_stock (button->priv->stock_id,
- GTK_ICON_SIZE_BUTTON);
+ GTK_ICON_SIZE_DND);
}
gtk_container_add (GTK_CONTAINER (button->priv->button), image);
Modified: branches/soc-2008-tagging/plug-ins/help-browser/help-browser.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/help-browser.c (original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/help-browser.c Sat Jun 21 05:12:58 2008
@@ -46,19 +46,25 @@
/* forward declarations */
-static void query (void);
-static void run (const gchar *name,
- gint nparams,
- const GimpParam *param,
- gint *nreturn_vals,
- GimpParam **return_vals);
-
-static void temp_proc_install (void);
-static void temp_proc_run (const gchar *name,
- gint nparams,
- const GimpParam *param,
- gint *nreturn_vals,
- GimpParam **return_vals);
+static void query (void);
+static void run (const gchar *name,
+ gint nparams,
+ const GimpParam *param,
+ gint *nreturn_vals,
+ GimpParam **return_vals);
+
+static void temp_proc_install (void);
+static void temp_proc_run (const gchar *name,
+ gint nparams,
+ const GimpParam *param,
+ gint *nreturn_vals,
+ GimpParam **return_vals);
+
+static gboolean help_browser_show_help (const gchar *help_domain,
+ const gchar *help_locales,
+ const gchar *help_id);
+
+static GimpHelpProgress * help_browser_progress_new (void);
/* local variables */
@@ -110,7 +116,7 @@
GimpParam **return_vals)
{
GimpRunMode run_mode = param[0].data.d_int32;
- GimpPDBStatusType status = GIMP_PDB_SUCCESS;
+ GimpPDBStatusType status = GIMP_PDB_SUCCESS;
static GimpParam values[1];
@@ -209,7 +215,6 @@
/* make sure all the arguments are there */
if (nparams == 3)
{
- GimpHelpDomain *domain;
const gchar *help_domain = GIMP_HELP_DEFAULT_DOMAIN;
const gchar *help_locales = NULL;
const gchar *help_id = GIMP_HELP_DEFAULT_ID;
@@ -223,36 +228,95 @@
if (param[2].data.d_string && strlen (param[2].data.d_string))
help_id = param[2].data.d_string;
- domain = gimp_help_lookup_domain (help_domain);
-
- if (domain)
+ if (! help_browser_show_help (help_domain, help_locales, help_id))
{
- GList *locales = gimp_help_parse_locales (help_locales);
- GimpHelpLocale *locale;
- gchar *full_uri;
- gboolean fatal_error;
+ gtk_main_quit ();
+ }
+ }
- full_uri = gimp_help_domain_map (domain, locales, help_id, NULL,
- &locale, &fatal_error);
+ values[0].type = GIMP_PDB_STATUS;
+ values[0].data.d_status = status;
+}
- if (full_uri)
- {
- browser_dialog_load (full_uri, TRUE);
- browser_dialog_make_index (domain, locale);
- browser_dialog_goto_index (full_uri);
+static gboolean
+help_browser_show_help (const gchar *help_domain,
+ const gchar *help_locales,
+ const gchar *help_id)
+{
+ GimpHelpDomain *domain;
+ gboolean success = TRUE;
- g_free (full_uri);
- }
- else if (fatal_error)
- {
- gtk_main_quit ();
- }
+ domain = gimp_help_lookup_domain (help_domain);
+
+ if (domain)
+ {
+ GimpHelpProgress *progress = NULL;
+ GimpHelpLocale *locale;
+ GList *locales;
+ gchar *uri;
+ gboolean fatal_error;
+
+ locales = gimp_help_parse_locales (help_locales);
+
+ if (! g_str_has_prefix (domain->help_uri, "file:"))
+ progress = help_browser_progress_new ();
+
+ uri = gimp_help_domain_map (domain, locales, help_id,
+ progress, &locale, &fatal_error);
- g_list_foreach (locales, (GFunc) g_free, NULL);
- g_list_free (locales);
+ if (progress)
+ gimp_help_progress_free (progress);
+
+ g_list_foreach (locales, (GFunc) g_free, NULL);
+ g_list_free (locales);
+
+ if (uri)
+ {
+ browser_dialog_make_index (domain, locale);
+ browser_dialog_load (uri);
+
+ g_free (uri);
+ }
+ else if (fatal_error)
+ {
+ success = FALSE;
}
}
- values[0].type = GIMP_PDB_STATUS;
- values[0].data.d_status = status;
+ return success;
+}
+
+
+static void
+help_browser_progress_start (const gchar *message,
+ gboolean cancelable,
+ gpointer user_data)
+{
+ gimp_progress_init (message);
+}
+
+static void
+help_browser_progress_update (gdouble value,
+ gpointer user_data)
+{
+ gimp_progress_update (value);
+}
+
+static void
+help_browser_progress_end (gpointer user_data)
+{
+ gimp_progress_end ();
+}
+
+static GimpHelpProgress *
+help_browser_progress_new (void)
+{
+ static const GimpHelpProgressVTable vtable =
+ {
+ help_browser_progress_start,
+ help_browser_progress_end,
+ help_browser_progress_update
+ };
+
+ return gimp_help_progress_new (&vtable, NULL);
}
Modified: branches/soc-2008-tagging/plug-ins/help/gimphelp.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help/gimphelp.c (original)
+++ branches/soc-2008-tagging/plug-ins/help/gimphelp.c Sat Jun 21 05:12:58 2008
@@ -55,9 +55,7 @@
gint num_domain_uris,
gchar **domain_uris)
{
- const gchar *default_env_domain_uri;
- gchar *default_domain_uri;
- gint i;
+ gint i;
if (num_domain_names != num_domain_uris)
{
@@ -66,31 +64,9 @@
return FALSE;
}
- /* set default values */
- default_env_domain_uri = g_getenv (GIMP_HELP_ENV_URI);
-
- if (default_env_domain_uri)
- {
- default_domain_uri = g_strdup (default_env_domain_uri);
- }
- else
- {
- gchar *help_root = g_build_filename (gimp_data_directory (),
- GIMP_HELP_PREFIX,
- NULL);
-
- default_domain_uri = g_filename_to_uri (help_root, NULL, NULL);
-
- g_free (help_root);
- }
-
- gimp_help_register_domain (GIMP_HELP_DEFAULT_DOMAIN, default_domain_uri);
-
for (i = 0; i < num_domain_names; i++)
gimp_help_register_domain (domain_names[i], domain_uris[i]);
- g_free (default_domain_uri);
-
return TRUE;
}
@@ -160,7 +136,7 @@
if (*s)
locales = g_list_append (locales, g_strdup (s));
- /* if the list doesn't contain the default domain yet, append it */
+ /* if the list doesn't contain the default locale yet, append it */
for (list = locales; list; list = list->next)
if (strcmp ((const gchar *) list->data, GIMP_HELP_DEFAULT_LOCALE) == 0)
break;
Modified: branches/soc-2008-tagging/plug-ins/help/gimphelplocale.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help/gimphelplocale.c (original)
+++ branches/soc-2008-tagging/plug-ins/help/gimphelplocale.c Sat Jun 21 05:12:58 2008
@@ -64,6 +64,8 @@
void
gimp_help_locale_free (GimpHelpLocale *locale)
{
+ g_return_if_fail (locale != NULL);
+
if (locale->help_id_mapping)
g_hash_table_destroy (locale->help_id_mapping);
@@ -79,6 +81,9 @@
gimp_help_locale_map (GimpHelpLocale *locale,
const gchar *help_id)
{
+ g_return_val_if_fail (locale != NULL, NULL);
+ g_return_val_if_fail (help_id != NULL, NULL);
+
if (locale->help_id_mapping)
{
GimpHelpItem *item = g_hash_table_lookup (locale->help_id_mapping,
Modified: branches/soc-2008-tagging/plug-ins/help/help.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help/help.c (original)
+++ branches/soc-2008-tagging/plug-ins/help/help.c Sat Jun 21 05:12:58 2008
@@ -71,6 +71,8 @@
const gchar *help_id);
static gboolean load_help_idle (gpointer data);
+static GimpHelpProgress * load_help_progress_new (void);
+
/* local variables */
@@ -263,35 +265,43 @@
if (domain)
{
- GList *locales;
- gchar *full_uri;
- gboolean fatal_error;
-
- locales = gimp_help_parse_locales (idle_help->help_locales);
- full_uri = gimp_help_domain_map (domain, locales, idle_help->help_id,
- NULL, NULL, &fatal_error);
+ GimpHelpProgress *progress = NULL;
+ GList *locales;
+ gchar *uri;
+ gboolean fatal_error;
+
+ locales = gimp_help_parse_locales (idle_help->help_locales);
+
+ if (! g_str_has_prefix (domain->help_uri, "file:"))
+ progress = load_help_progress_new ();
+
+ uri = gimp_help_domain_map (domain, locales, idle_help->help_id,
+ progress, NULL, &fatal_error);
+
+ if (progress)
+ gimp_help_progress_free (progress);
g_list_foreach (locales, (GFunc) g_free, NULL);
g_list_free (locales);
- if (full_uri)
+ if (uri)
{
GimpParam *return_vals;
gint n_return_vals;
#ifdef GIMP_HELP_DEBUG
g_printerr ("help: calling '%s' for '%s'\n",
- idle_help->procedure, full_uri);
+ idle_help->procedure, uri);
#endif
return_vals = gimp_run_procedure (idle_help->procedure,
&n_return_vals,
- GIMP_PDB_STRING, full_uri,
+ GIMP_PDB_STRING, uri,
GIMP_PDB_END);
gimp_destroy_params (return_vals, n_return_vals);
- g_free (full_uri);
+ g_free (uri);
}
else if (fatal_error)
{
@@ -308,3 +318,37 @@
return FALSE;
}
+
+static void
+load_help_progress_start (const gchar *message,
+ gboolean cancelable,
+ gpointer user_data)
+{
+ gimp_progress_init (message);
+}
+
+static void
+load_help_progress_update (gdouble value,
+ gpointer user_data)
+{
+ gimp_progress_update (value);
+}
+
+static void
+load_help_progress_end (gpointer user_data)
+{
+ gimp_progress_end ();
+}
+
+static GimpHelpProgress *
+load_help_progress_new (void)
+{
+ static const GimpHelpProgressVTable vtable =
+ {
+ load_help_progress_start,
+ load_help_progress_end,
+ load_help_progress_update
+ };
+
+ return gimp_help_progress_new (&vtable, NULL);
+}
Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_main.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_main.c (original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_main.c Sat Jun 21 05:12:58 2008
@@ -1309,10 +1309,10 @@
gtk_box_pack_start(GTK_BOX(hbox), tools, FALSE, FALSE, 0);
_preview = make_preview(drawable);
- add_preview_motion_event(_preview, (GtkSignalFunc) preview_move);
- add_enter_notify_event(_preview, (GtkSignalFunc) preview_enter);
- add_leave_notify_event(_preview, (GtkSignalFunc) preview_leave);
- add_preview_button_press_event(_preview, (GtkSignalFunc) button_press);
+ add_preview_motion_event(_preview, G_CALLBACK (preview_move));
+ add_enter_notify_event(_preview, G_CALLBACK (preview_enter));
+ add_leave_notify_event(_preview, G_CALLBACK (preview_leave));
+ add_preview_button_press_event(_preview, G_CALLBACK (button_press));
gtk_container_add(GTK_CONTAINER(hbox), _preview->window);
object_list_add_geometry_cb(_shapes, geometry_changed, NULL);
Modified: branches/soc-2008-tagging/po/POTFILES.in
==============================================================================
--- branches/soc-2008-tagging/po/POTFILES.in (original)
+++ branches/soc-2008-tagging/po/POTFILES.in Sat Jun 21 05:12:58 2008
@@ -420,6 +420,7 @@
app/widgets/gimppropwidgets.c
app/widgets/gimpselectiondata.c
app/widgets/gimpselectioneditor.c
+app/widgets/gimpsettingsbox.c
app/widgets/gimpsizebox.c
app/widgets/gimpstrokeeditor.c
app/widgets/gimptemplateeditor.c
Modified: branches/soc-2008-tagging/themes/Default/images/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/themes/Default/images/Makefile.am (original)
+++ branches/soc-2008-tagging/themes/Default/images/Makefile.am Sat Jun 21 05:12:58 2008
@@ -117,6 +117,7 @@
stock-tools-16.png \
stock-transparency-16.png \
stock-undo-history-16.png \
+ stock-user-manual-16.png \
stock-video-16.png \
stock-warning-16.png \
stock-wilber-16.png \
@@ -207,11 +208,12 @@
stock-tool-options-24.png \
stock-tools-24.png \
stock-transparency-24.png \
+ stock-undo-history-24.png \
+ stock-user-manual-24.png \
stock-vcenter-24.png \
stock-vchain-24.png \
stock-vchain-broken-24.png \
stock-video-24.png \
- stock-undo-history-24.png \
stock-warning-24.png \
stock-web-24.png \
stock-wilber-22.png
@@ -228,7 +230,8 @@
stock-image-32.png \
stock-layer-32.png \
stock-layer-mask-32.png \
- stock-text-layer-32.png
+ stock-text-layer-32.png \
+ stock-user-manual-32.png
STOCK_DIALOG_IMAGES = \
stock-channel-48.png \
@@ -248,6 +251,7 @@
stock-question-64.png \
stock-text-layer-48.png \
stock-texture-64.png \
+ stock-user-manual-64.png \
stock-warning-64.png \
stock-wilber-64.png \
stock-wilber-eek-64.png
Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/help.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/help.pdb (original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/help.pdb Sat Jun 21 05:12:58 2008
@@ -49,7 +49,7 @@
manager->current_plug_in->prog,
NULL);
- gimp_help (gimp, help_domain, help_id);
+ gimp_help (gimp, progress, help_domain, help_id);
}
CODE
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]