gimp r24818 - in trunk: . app/tools app/widgets
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r24818 - in trunk: . app/tools app/widgets
- Date: Wed, 6 Feb 2008 09:09:34 +0000 (GMT)
Author: mitch
Date: Wed Feb 6 09:09:34 2008
New Revision: 24818
URL: http://svn.gnome.org/viewvc/gimp?rev=24818&view=rev
Log:
2008-02-06 Michael Natterer <mitch gimp org>
* app/tools/gimpgegltool.c (gimp_param_spec_duplicate)
* app/widgets/gimppropwidgets.c (gimp_prop_table_new): support
multiline text and file paths. The multiline support is hacked up
and needs some proper solution.
Modified:
trunk/ChangeLog
trunk/app/tools/gimpgegltool.c
trunk/app/widgets/gimppropwidgets.c
Modified: trunk/app/tools/gimpgegltool.c
==============================================================================
--- trunk/app/tools/gimpgegltool.c (original)
+++ trunk/app/tools/gimpgegltool.c Wed Feb 6 09:09:34 2008
@@ -21,6 +21,7 @@
#include <string.h>
#include <gegl.h>
+#include <gegl-paramspecs.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
@@ -307,11 +308,37 @@
{
GParamSpecString *spec = G_PARAM_SPEC_STRING (pspec);
- return g_param_spec_string (pspec->name,
- g_param_spec_get_nick (pspec),
- g_param_spec_get_blurb (pspec),
- spec->default_value,
- pspec->flags);
+ if (GEGL_IS_PARAM_SPEC_PATH (pspec))
+ {
+ return gimp_param_spec_config_path (pspec->name,
+ g_param_spec_get_nick (pspec),
+ g_param_spec_get_blurb (pspec),
+ GIMP_CONFIG_PATH_FILE,
+ spec->default_value,
+ pspec->flags);
+ }
+ else
+ {
+ static GQuark multiline_quark = 0;
+ GParamSpec *new;
+
+ if (! multiline_quark)
+ multiline_quark = g_quark_from_static_string ("multiline");
+
+ new = g_param_spec_string (pspec->name,
+ g_param_spec_get_nick (pspec),
+ g_param_spec_get_blurb (pspec),
+ spec->default_value,
+ pspec->flags);
+
+ if (GEGL_IS_PARAM_SPEC_MULTILINE (pspec))
+ {
+ g_param_spec_set_qdata (new, multiline_quark,
+ GINT_TO_POINTER (TRUE));
+ }
+
+ return new;
+ }
}
else if (G_IS_PARAM_SPEC_BOOLEAN (pspec))
{
Modified: trunk/app/widgets/gimppropwidgets.c
==============================================================================
--- trunk/app/widgets/gimppropwidgets.c (original)
+++ trunk/app/widgets/gimppropwidgets.c Wed Feb 6 09:09:34 2008
@@ -754,7 +754,37 @@
if (G_IS_PARAM_SPEC_STRING (pspec))
{
- widget = gimp_prop_entry_new (config, pspec->name, -1);
+ static GQuark multiline_quark = 0;
+
+ if (! multiline_quark)
+ multiline_quark = g_quark_from_static_string ("multiline");
+
+ if (GIMP_IS_PARAM_SPEC_CONFIG_PATH (pspec))
+ {
+ widget = gimp_prop_file_chooser_button_new (config,
+ pspec->name,
+ g_param_spec_get_nick (pspec),
+ GTK_FILE_CHOOSER_ACTION_OPEN);
+ }
+ else if (g_param_spec_get_qdata (pspec, multiline_quark))
+ {
+ GtkTextBuffer *buffer;
+ GtkWidget *view;
+
+ buffer = gimp_prop_text_buffer_new (config, pspec->name, -1);
+ view = gtk_text_view_new_with_buffer (buffer);
+
+ widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget),
+ GTK_SHADOW_IN);
+ gtk_container_add (GTK_CONTAINER (widget), view);
+ gtk_widget_show (view);
+ }
+ else
+ {
+ widget = gimp_prop_entry_new (config, pspec->name, -1);
+ }
+
label = g_param_spec_get_nick (pspec);
}
else if (G_IS_PARAM_SPEC_BOOLEAN (pspec))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]