Commit 06c12d97 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

libgimpwidgets/gimpwidgetsmarshal.list added signals ::added(),

2003-11-22  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpwidgetsmarshal.list
	* libgimpwidgets/gimpcolordisplaystack.[ch]: added signals
	::added(), ::removed() and ::reordered() and emit them in the
	resp. functions.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpcolordisplayeditor.[ch]: new widget implementing
	an editable view on a GimpColorDisplayStack. Most code taken from
	below...

	* app/display/gimpdisplayshell-filter-dialog.c: ...and removed
	here. Only creates a GimpDialog around a GimpColorDisplayEditor
	now.
parent c105447b
2003-11-22 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpwidgetsmarshal.list
* libgimpwidgets/gimpcolordisplaystack.[ch]: added signals
::added(), ::removed() and ::reordered() and emit them in the
resp. functions.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpcolordisplayeditor.[ch]: new widget implementing
an editable view on a GimpColorDisplayStack. Most code taken from
below...
* app/display/gimpdisplayshell-filter-dialog.c: ...and removed
here. Only creates a GimpDialog around a GimpColorDisplayEditor
now.
2003-11-22 Sven Neumann <sven@gimp.org>
 
* app/paint-funcs/paint-funcs.c (color_erase_inten_pixels): handle
......@@ -31,6 +31,8 @@ libappwidgets_a_sources = \
gimpcellrendererviewable.h \
gimpchanneltreeview.c \
gimpchanneltreeview.h \
gimpcolordisplayeditor.c \
gimpcolordisplayeditor.h \
gimpcoloreditor.c \
gimpcoloreditor.h \
gimpcolorframe.c \
......
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcolordisplayeditor.h
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_COLOR_DISPLAY_EDITOR_H__
#define __GIMP_COLOR_DISPLAY_EDITOR_H__
#include "gimpeditor.h"
#define GIMP_TYPE_COLOR_DISPLAY_EDITOR (gimp_color_display_editor_get_type ())
#define GIMP_COLOR_DISPLAY_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLOR_DISPLAY_EDITOR, GimpColorDisplayEditor))
#define GIMP_COLOR_DISPLAY_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_DISPLAY_EDITOR, GimpColorDisplayEditorClass))
#define GIMP_IS_COLOR_DISPLAY_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLOR_DISPLAY_EDITOR))
#define GIMP_IS_COLOR_DISPLAY_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_DISPLAY_EDITOR))
#define GIMP_COLOR_DISPLAY_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_COLOR_DISPLAY_EDITOR, GimpColorDisplayEditorClass))
typedef struct _GimpColorDisplayEditorClass GimpColorDisplayEditorClass;
struct _GimpColorDisplayEditor
{
GtkVBox parent_instance;
GimpColorDisplayStack *stack;
GtkListStore *src;
GtkListStore *dest;
GtkTreeSelection *src_sel;
GtkTreeSelection *dest_sel;
GimpColorDisplay *selected;
GtkWidget *add_button;
GtkWidget *remove_button;
GtkWidget *up_button;
GtkWidget *down_button;
GtkWidget *config_frame;
GtkWidget *config_box;
GtkWidget *config_widget;
GtkWidget *reset_button;
};
struct _GimpColorDisplayEditorClass
{
GtkVBoxClass parent_class;
};
GType gimp_color_display_editor_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_color_display_editor_new (GimpColorDisplayStack *stack);
#endif /* __GIMP_COLOR_DISPLAY_EDITOR_H__ */
......@@ -111,6 +111,7 @@ typedef struct _GimpHistogramBox GimpHistogramBox;
typedef struct _GimpHistogramEditor GimpHistogramEditor;
typedef struct _GimpTextEditor GimpTextEditor;
typedef struct _GimpColorDisplayEditor GimpColorDisplayEditor;
/* structs */
......
......@@ -29,11 +29,15 @@
#include "gimpcolordisplay.h"
#include "gimpcolordisplaystack.h"
#include "gimpwidgetsmarshal.h"
enum
{
CHANGED,
ADDED,
REMOVED,
REORDERED,
LAST_SIGNAL
};
......@@ -94,9 +98,44 @@ gimp_color_display_stack_class_init (GimpColorDisplayStackClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
stack_signals[ADDED] =
g_signal_new ("added",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpColorDisplayStackClass, added),
NULL, NULL,
_gimp_widgets_marshal_VOID__OBJECT_INT,
G_TYPE_NONE, 2,
GIMP_TYPE_COLOR_DISPLAY,
G_TYPE_INT);
stack_signals[REMOVED] =
g_signal_new ("removed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpColorDisplayStackClass, removed),
NULL, NULL,
_gimp_widgets_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_COLOR_DISPLAY);
stack_signals[REORDERED] =
g_signal_new ("reordered",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpColorDisplayStackClass, reordered),
NULL, NULL,
_gimp_widgets_marshal_VOID__OBJECT_INT,
G_TYPE_NONE, 2,
GIMP_TYPE_COLOR_DISPLAY,
G_TYPE_INT);
object_class->finalize = gimp_color_display_stack_finalize;
klass->changed = NULL;
klass->added = NULL;
klass->removed = NULL;
klass->reordered = NULL;
}
static void
......@@ -176,6 +215,9 @@ gimp_color_display_stack_add (GimpColorDisplayStack *stack,
G_OBJECT (stack),
G_CONNECT_SWAPPED);
g_signal_emit (stack, stack_signals[ADDED], 0,
display, g_list_length (stack->filters) - 1);
gimp_color_display_stack_changed (stack);
}
......@@ -192,9 +234,12 @@ gimp_color_display_stack_remove (GimpColorDisplayStack *stack,
stack);
stack->filters = g_list_remove (stack->filters, display);
g_object_unref (display);
g_signal_emit (stack, stack_signals[REMOVED], 0, display);
gimp_color_display_stack_changed (stack);
g_object_unref (display);
}
void
......@@ -215,6 +260,9 @@ gimp_color_display_stack_reorder_up (GimpColorDisplayStack *stack,
list->data = list->prev->data;
list->prev->data = display;
g_signal_emit (stack, stack_signals[REORDERED], 0,
display, g_list_position (stack->filters, list->prev));
gimp_color_display_stack_changed (stack);
}
}
......@@ -237,6 +285,9 @@ gimp_color_display_stack_reorder_down (GimpColorDisplayStack *stack,
list->data = list->next->data;
list->next->data = display;
g_signal_emit (stack, stack_signals[REORDERED], 0,
display, g_list_position (stack->filters, list->next));
gimp_color_display_stack_changed (stack);
}
}
......
......@@ -48,7 +48,16 @@ struct _GimpColorDisplayStackClass
{
GObjectClass parent_class;
void (* changed) (GimpColorDisplayStack *stack);
void (* changed) (GimpColorDisplayStack *stack);
void (* added) (GimpColorDisplayStack *stack,
GimpColorDisplay *display,
gint position);
void (* removed) (GimpColorDisplayStack *stack,
GimpColorDisplay *display);
void (* reordered) (GimpColorDisplayStack *stack,
GimpColorDisplay *display,
gint position);
};
......
......@@ -24,4 +24,6 @@
VOID: INT
VOID: INT, INT
VOID: OBJECT
VOID: OBJECT, INT
VOID: POINTER, POINTER
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment