tools/Makefile.am tools/shooter.c fixed includes and dependencies, expand
2005-04-20 Sven Neumann <sven@gimp.org> * tools/Makefile.am * tools/shooter.c * tools/widgets.c: fixed includes and dependencies, expand the path returned from gimp_config_build_data_path(), use common color code.
This commit is contained in:

committed by
Sven Neumann

parent
35d697bd31
commit
7dc25e618a
@ -1,12 +1,11 @@
|
|||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
libgimpui = $(top_builddir)/libgimp/libgimpui-$(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
|
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
|
libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
|
||||||
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
|
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
|
||||||
|
libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la
|
||||||
|
libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la
|
||||||
|
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
@ -14,11 +13,10 @@ INCLUDES = \
|
|||||||
$(GTK_CFLAGS)
|
$(GTK_CFLAGS)
|
||||||
|
|
||||||
LDADDS = \
|
LDADDS = \
|
||||||
$(libgimpui) \
|
|
||||||
$(libgimpwidgets) \
|
$(libgimpwidgets) \
|
||||||
$(libgimpconfig) \
|
$(libgimpconfig) \
|
||||||
|
$(libgimpmodule) \
|
||||||
$(libgimpmath) \
|
$(libgimpmath) \
|
||||||
$(libgimp) \
|
|
||||||
$(libgimpcolor) \
|
$(libgimpcolor) \
|
||||||
$(libgimpbase) \
|
$(libgimpbase) \
|
||||||
$(GTK_LIBS)
|
$(GTK_LIBS)
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "libgimp/gimp.h"
|
|
||||||
#include "libgimpconfig/gimpconfig.h"
|
#include "libgimpconfig/gimpconfig.h"
|
||||||
#include "libgimpmodule/gimpmodule.h"
|
#include "libgimpmodule/gimpmodule.h"
|
||||||
#include "libgimpwidgets/gimpwidgets.h"
|
#include "libgimpwidgets/gimpwidgets.h"
|
||||||
@ -202,7 +201,6 @@ static void
|
|||||||
shooter_standard_help (const gchar *help_id,
|
shooter_standard_help (const gchar *help_id,
|
||||||
gpointer help_data)
|
gpointer help_data)
|
||||||
{
|
{
|
||||||
gimp_help (NULL, help_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -212,12 +210,14 @@ shooter_ensure_modules (void)
|
|||||||
|
|
||||||
if (! module_db)
|
if (! module_db)
|
||||||
{
|
{
|
||||||
gchar *path = gimp_config_build_plug_in_path ("modules");
|
gchar *config = gimp_config_build_plug_in_path ("modules");
|
||||||
|
gchar *path = gimp_config_path_expand (config, TRUE, NULL);
|
||||||
|
|
||||||
module_db = gimp_module_db_new (FALSE);
|
module_db = gimp_module_db_new (FALSE);
|
||||||
|
|
||||||
gimp_module_db_load (module_db, path);
|
gimp_module_db_load (module_db, path);
|
||||||
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
|
g_free (config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,19 +2,23 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "libgimpconfig/gimpconfig.h"
|
||||||
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
#include "libgimpwidgets/gimpwidgets.h"
|
||||||
|
#include "libgimpwidgets/gimpwidgets-private.h"
|
||||||
|
|
||||||
#include "libgimp/gimp.h"
|
|
||||||
#include "libgimp/gimpui.h"
|
|
||||||
|
|
||||||
#include "widgets.h"
|
#include "widgets.h"
|
||||||
|
|
||||||
|
|
||||||
#define SMALL_WIDTH 240
|
#define SMALL_WIDTH 240
|
||||||
#define SMALL_HEIGHT 75
|
#define SMALL_HEIGHT 75
|
||||||
#define MEDIUM_WIDTH 240
|
#define MEDIUM_WIDTH 240
|
||||||
#define MEDIUM_HEIGHT 165
|
#define MEDIUM_HEIGHT 165
|
||||||
#define LARGE_WIDTH 240
|
#define LARGE_WIDTH 240
|
||||||
#define LARGE_HEIGHT 240
|
#define LARGE_HEIGHT 240
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -124,6 +128,13 @@ new_widget_info (const char *name,
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
color_init (GimpRGB *rgb)
|
||||||
|
{
|
||||||
|
gimp_rgb_parse_name (rgb, "goldenrod", -1);
|
||||||
|
gimp_rgb_set_alpha (rgb, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
static WidgetInfo *
|
static WidgetInfo *
|
||||||
create_button (void)
|
create_button (void)
|
||||||
{
|
{
|
||||||
@ -190,12 +201,10 @@ create_color_area (void)
|
|||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
|
|
||||||
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 3);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
||||||
color.r = 0.8;
|
|
||||||
color.g = 0.4;
|
|
||||||
color.b = 0.2;
|
|
||||||
color.a = 0.7;
|
|
||||||
area = gimp_color_area_new (&color,
|
area = gimp_color_area_new (&color,
|
||||||
GIMP_COLOR_AREA_SMALL_CHECKS,
|
GIMP_COLOR_AREA_SMALL_CHECKS,
|
||||||
GDK_SHIFT_MASK);
|
GDK_SHIFT_MASK);
|
||||||
@ -218,12 +227,10 @@ create_color_button (void)
|
|||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
|
|
||||||
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 3);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
||||||
color.r = 0.8;
|
|
||||||
color.g = 0.4;
|
|
||||||
color.b = 0.2;
|
|
||||||
color.a = 0.7;
|
|
||||||
button = gimp_color_button_new ("Color Button",
|
button = gimp_color_button_new ("Color Button",
|
||||||
80, 20, &color,
|
80, 20, &color,
|
||||||
GIMP_COLOR_AREA_SMALL_CHECKS);
|
GIMP_COLOR_AREA_SMALL_CHECKS);
|
||||||
@ -244,13 +251,11 @@ create_color_hex_entry (void)
|
|||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
|
|
||||||
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 3);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
||||||
entry = gimp_color_hex_entry_new ();
|
entry = gimp_color_hex_entry_new ();
|
||||||
color.r = 0.8;
|
|
||||||
color.g = 0.4;
|
|
||||||
color.b = 0.2;
|
|
||||||
color.a = 0.7;
|
|
||||||
gimp_color_hex_entry_set_color (GIMP_COLOR_HEX_ENTRY (entry), &color);
|
gimp_color_hex_entry_set_color (GIMP_COLOR_HEX_ENTRY (entry), &color);
|
||||||
gtk_container_add (GTK_CONTAINER (align), entry);
|
gtk_container_add (GTK_CONTAINER (align), entry);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||||
@ -270,17 +275,14 @@ create_color_scale (void)
|
|||||||
GimpRGB rgb;
|
GimpRGB rgb;
|
||||||
GimpHSV hsv;
|
GimpHSV hsv;
|
||||||
|
|
||||||
|
color_init (&rgb);
|
||||||
|
gimp_rgb_to_hsv (&rgb, &hsv);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 3);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.8, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.8, 0.0);
|
||||||
scale = gimp_color_scale_new (GTK_ORIENTATION_HORIZONTAL,
|
scale = gimp_color_scale_new (GTK_ORIENTATION_HORIZONTAL,
|
||||||
GIMP_COLOR_SELECTOR_HUE);
|
GIMP_COLOR_SELECTOR_HUE);
|
||||||
rgb.r = 0.8;
|
gimp_color_scale_set_color (GIMP_COLOR_SCALE (scale), &rgb, &hsv);
|
||||||
rgb.g = 0.4;
|
|
||||||
rgb.b = 0.2;
|
|
||||||
rgb.a = 0.7;
|
|
||||||
gimp_rgb_to_hsv (&rgb, &hsv);
|
|
||||||
gimp_color_scale_set_color (GIMP_COLOR_SCALE (scale),
|
|
||||||
&rgb, &hsv);
|
|
||||||
gtk_range_set_value (GTK_RANGE (scale), 40);
|
gtk_range_set_value (GTK_RANGE (scale), 40);
|
||||||
gtk_container_add (GTK_CONTAINER (align), scale);
|
gtk_container_add (GTK_CONTAINER (align), scale);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||||
@ -299,13 +301,11 @@ create_color_selection (void)
|
|||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
|
|
||||||
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 3);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||||
selection = gimp_color_selection_new ();
|
selection = gimp_color_selection_new ();
|
||||||
color.r = 0.8;
|
|
||||||
color.g = 0.4;
|
|
||||||
color.b = 0.2;
|
|
||||||
color.a = 0.7;
|
|
||||||
gimp_color_selection_set_show_alpha(GIMP_COLOR_SELECTION (selection),
|
gimp_color_selection_set_show_alpha(GIMP_COLOR_SELECTION (selection),
|
||||||
TRUE);
|
TRUE);
|
||||||
gimp_color_selection_set_color (GIMP_COLOR_SELECTION (selection),
|
gimp_color_selection_set_color (GIMP_COLOR_SELECTION (selection),
|
||||||
@ -361,12 +361,12 @@ create_path_editor (void)
|
|||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *editor;
|
GtkWidget *editor;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
gchar *config = gimp_config_build_data_path ("patterns");
|
||||||
|
gchar *path = gimp_config_path_expand (config, TRUE, NULL);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 3);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||||
editor = gimp_path_editor_new ("Path Editor",
|
editor = gimp_path_editor_new ("Path Editor", path);
|
||||||
"/usr/local/share/gimp/2.0/patterns/:"
|
|
||||||
"~/.gimp-2.3/patterns");
|
|
||||||
gtk_widget_set_size_request (editor, -1, 240);
|
gtk_widget_set_size_request (editor, -1, 240);
|
||||||
gtk_container_add (GTK_CONTAINER (align), editor);
|
gtk_container_add (GTK_CONTAINER (align), editor);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||||
@ -374,6 +374,9 @@ create_path_editor (void)
|
|||||||
gtk_label_new ("Path Editor"),
|
gtk_label_new ("Path Editor"),
|
||||||
FALSE, FALSE, 0);
|
FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
g_free (path);
|
||||||
|
g_free (config);
|
||||||
|
|
||||||
return new_widget_info ("gimp-path-editor", vbox, ASIS);
|
return new_widget_info ("gimp-path-editor", vbox, ASIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user