Commit 594496b1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

configure.in new directory containing all widgets. Some of them will go to

2001-04-11  Michael Natterer  <mitch@gimp.org>

	* configure.in
	* app/widgets/*: new directory containing all widgets. Some of them
	will go to libgimpwidgets.

	* app/color_panel.[ch]
	* app/gimpbrushpreview.[ch]
	* app/gimpconstrainedhwrapbox.[ch]
	* app/gimpcontainergridview.[ch]
	* app/gimpcontainerlistview.[ch]
	* app/gimpcontainerview.[ch]
	* app/gimpdatafactoryview.[ch]
	* app/gimpdock.[ch]
	* app/gimpdockable.[ch]
	* app/gimpdockbook.[ch]
	* app/gimpdrawablelistitem.[ch]
	* app/gimpdrawablelistview.[ch]
	* app/gimpdrawablepreview.[ch]
	* app/gimpgradientpreview.[ch]
	* app/gimpimagepreview.[ch]
	* app/gimplayerlistitem.[ch]
	* app/gimplayerlistview.{ch]
	* app/gimplistitem.[ch]
	* app/gimppalettepreview.[ch]
	* app/gimppatternpreview.[ch]
	* app/gimppreview.[ch]
	* app/gimptoolinfopreview.[ch]
	* app/gtkhwrapbox.[ch]
	* app/gtkvwrapbox.[ch]
	* app/gtkwrapbox.[ch]
	* app/histogramwidget.[ch]: removed from here.

	* app/Makefile.am
	* app/appenums.h
	* app/brush_select.c
	* app/channels_dialog.c
	* app/devices.c
	* app/gimpdnd.c
	* app/gimpdrawable-preview.c
	* app/gimphistogram.h
	* app/gradient_editor.c
	* app/gradient_select.c
	* app/indicator_area.c
	* app/info_window.c
	* app/palette.c
	* app/palette_select.c
	* app/pattern_select.c
	* app/qmask.c
	* app/test_commands.c
	* app/toolbox.c
	* app/pdb/color_cmds.c
	* app/tools/paint_options.c
	* app/tools/tool_options_dialog.c
	* tools/pdbgen/pdb/color.pdb: changed accordingly.
parent e44303ae
2001-04-11 Michael Natterer <mitch@gimp.org>
* configure.in
* app/widgets/*: new directory containing all widgets. Some of them
will go to libgimpwidgets.
* app/color_panel.[ch]
* app/gimpbrushpreview.[ch]
* app/gimpconstrainedhwrapbox.[ch]
* app/gimpcontainergridview.[ch]
* app/gimpcontainerlistview.[ch]
* app/gimpcontainerview.[ch]
* app/gimpdatafactoryview.[ch]
* app/gimpdock.[ch]
* app/gimpdockable.[ch]
* app/gimpdockbook.[ch]
* app/gimpdrawablelistitem.[ch]
* app/gimpdrawablelistview.[ch]
* app/gimpdrawablepreview.[ch]
* app/gimpgradientpreview.[ch]
* app/gimpimagepreview.[ch]
* app/gimplayerlistitem.[ch]
* app/gimplayerlistview.{ch]
* app/gimplistitem.[ch]
* app/gimppalettepreview.[ch]
* app/gimppatternpreview.[ch]
* app/gimppreview.[ch]
* app/gimptoolinfopreview.[ch]
* app/gtkhwrapbox.[ch]
* app/gtkvwrapbox.[ch]
* app/gtkwrapbox.[ch]
* app/histogramwidget.[ch]: removed from here.
* app/Makefile.am
* app/appenums.h
* app/brush_select.c
* app/channels_dialog.c
* app/devices.c
* app/gimpdnd.c
* app/gimpdrawable-preview.c
* app/gimphistogram.h
* app/gradient_editor.c
* app/gradient_select.c
* app/indicator_area.c
* app/info_window.c
* app/palette.c
* app/palette_select.c
* app/pattern_select.c
* app/qmask.c
* app/test_commands.c
* app/toolbox.c
* app/pdb/color_cmds.c
* app/tools/paint_options.c
* app/tools/tool_options_dialog.c
* tools/pdbgen/pdb/color.pdb: changed accordingly.
2001-04-10 Michael Natterer <mitch@gimp.org>
* app/gimpdock.c: started to add some more separator event handling.
......
## Process this file with automake to produce Makefile.in
SUBDIRS = paint-funcs pdb tools
SUBDIRS = paint-funcs pdb tools widgets
scriptdata =
......@@ -51,8 +51,6 @@ gimp_SOURCES = \
color_area.h \
color_notebook.c \
color_notebook.h \
color_panel.c \
color_panel.h \
color_select.c \
color_select.h \
color_transfer.c \
......@@ -305,57 +303,6 @@ gimp_SOURCES = \
tile_swap.c \
tile_swap.h \
\
gimpbrushpreview.c \
gimpbrushpreview.h \
gimpcontainergridview.h \
gimpcontainergridview.c \
gimpcontainerlistview.h \
gimpcontainerlistview.c \
gimpcontainerview.h \
gimpcontainerview.c \
gimpdatafactoryview.h \
gimpdatafactoryview.c \
gimpdock.c \
gimpdock.h \
gimpdockable.c \
gimpdockable.h \
gimpdockbook.c \
gimpdockbook.h \
gimpdrawablelistitem.c \
gimpdrawablelistitem.h \
gimpdrawablelistview.c \
gimpdrawablelistview.h \
gimpdrawablepreview.c \
gimpdrawablepreview.h \
gimpgradientpreview.h \
gimpgradientpreview.c \
gimpimagepreview.h \
gimpimagepreview.c \
gimplayerlistitem.h \
gimplayerlistitem.c \
gimplayerlistview.h \
gimplayerlistview.c \
gimplistitem.h \
gimplistitem.c \
gimppalettepreview.h \
gimppalettepreview.c \
gimppatternpreview.h \
gimppatternpreview.c \
gimppreview.h \
gimppreview.c \
gimptoolinfopreview.h \
gimptoolinfopreview.c \
gtkwrapbox.c \
gtkwrapbox.h \
gtkhwrapbox.c \
gtkhwrapbox.h \
gtkvwrapbox.c \
gtkvwrapbox.h \
gimpconstrainedhwrapbox.c \
gimpconstrainedhwrapbox.h \
histogramwidget.c \
histogramwidget.h \
\
marching_ants.h \
pixmaps2.h
......@@ -390,6 +337,7 @@ gimp_LDADD = \
paint-funcs/libapppaint-funcs.la \
pdb/libapppdb.la \
tools/libapptools.la \
widgets/libappwidgets.la \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la \
$(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \
......
......@@ -29,7 +29,8 @@
#include "apptypes.h"
#include "color_panel.h"
#include "widgets/gimpcolorpanel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
......
......@@ -29,7 +29,8 @@
#include "apptypes.h"
#include "color_panel.h"
#include "widgets/gimpcolorpanel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
......
......@@ -263,6 +263,16 @@ typedef enum /*< skip >*/
CURSOR_MODE_CROSSHAIR
} CursorMode;
typedef enum /*< skip >*/
{
GIMP_HISTOGRAM_VALUE = 0,
GIMP_HISTOGRAM_RED = 1,
GIMP_HISTOGRAM_GREEN = 2,
GIMP_HISTOGRAM_BLUE = 3,
GIMP_HISTOGRAM_ALPHA = 4
} GimpHistogramChannel;
typedef enum /*< skip >*/
{
GIMP_TOOL_CURSOR_NONE,
......
......@@ -22,16 +22,6 @@
#define __GIMP_HISTOGRAM_H__
typedef enum
{
GIMP_HISTOGRAM_VALUE = 0,
GIMP_HISTOGRAM_RED = 1,
GIMP_HISTOGRAM_GREEN = 2,
GIMP_HISTOGRAM_BLUE = 3,
GIMP_HISTOGRAM_ALPHA = 4
} GimpHistogramChannel;
GimpHistogram * gimp_histogram_new (void);
void gimp_histogram_free (GimpHistogram *histogram);
void gimp_histogram_calculate (GimpHistogram *historgam,
......
......@@ -26,6 +26,8 @@
#include "apptypes.h"
#include "widgets/gimpdatafactoryview.h"
#include "appenv.h"
#include "context_manager.h"
#include "brush_edit.h"
......@@ -33,7 +35,6 @@
#include "dialog_handler.h"
#include "gimpbrushgenerated.h"
#include "gimpcontainer.h"
#include "gimpdatafactoryview.h"
#include "gimpcontext.h"
#include "gimpdata.h"
#include "gimpdatafactory.h"
......
......@@ -29,9 +29,10 @@
#include "paint-funcs/paint-funcs.h"
#include "widgets/gimpcolorpanel.h"
#include "appenv.h"
#include "channels_dialog.h"
#include "color_panel.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimage.h"
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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.
*/
#include "config.h"
#include <stdio.h>
#include <gtk/gtk.h>
#include "apptypes.h"
#include "appenv.h"
#include "color_panel.h"
#include "color_notebook.h"
struct _GimpColorPanel
{
GimpColorButton parent;
ColorNotebook *color_notebook;
gboolean color_notebook_active;
};
/* local function prototypes */
static void gimp_color_panel_class_init (GimpColorPanelClass *klass);
static void gimp_color_panel_init (GimpColorPanel *panel);
static void gimp_color_panel_destroy (GtkObject *object);
static void gimp_color_panel_color_changed (GimpColorButton *button);
static void gimp_color_panel_clicked (GtkButton *button);
static void gimp_color_panel_select_callback (ColorNotebook *notebook,
const GimpRGB *color,
ColorNotebookState state,
gpointer data);
static GimpColorButtonClass *parent_class = NULL;
GtkType
gimp_color_panel_get_type (void)
{
static guint panel_type = 0;
if (!panel_type)
{
GtkTypeInfo panel_info =
{
"GimpColorPanel",
sizeof (GimpColorPanel),
sizeof (GimpColorPanelClass),
(GtkClassInitFunc) gimp_color_panel_class_init,
(GtkObjectInitFunc) gimp_color_panel_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL
};
panel_type = gtk_type_unique (GIMP_TYPE_COLOR_BUTTON, &panel_info);
}
return panel_type;
}
static void
gimp_color_panel_class_init (GimpColorPanelClass *klass)
{
GtkObjectClass *object_class;
GtkButtonClass *button_class;
GimpColorButtonClass *color_button_class;
object_class = (GtkObjectClass *) klass;
button_class = (GtkButtonClass *) klass;
color_button_class = (GimpColorButtonClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_COLOR_BUTTON);
object_class->destroy = gimp_color_panel_destroy;
button_class->clicked = gimp_color_panel_clicked;
color_button_class->color_changed = gimp_color_panel_color_changed;
}
static void
gimp_color_panel_init (GimpColorPanel *panel)
{
panel->color_notebook = NULL;
panel->color_notebook_active = FALSE;
}
static void
gimp_color_panel_destroy (GtkObject *object)
{
GimpColorPanel *panel;
g_return_if_fail (object != NULL);
g_return_if_fail (GIMP_IS_COLOR_PANEL (object));
panel = GIMP_COLOR_PANEL (object);
/* make sure we hide and free color_notebook */
if (panel->color_notebook)
{
color_notebook_hide (panel->color_notebook);
color_notebook_free (panel->color_notebook);
}
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
GtkWidget *
gimp_color_panel_new (const gchar *title,
const GimpRGB *color,
GimpColorAreaType type,
gint width,
gint height)
{
GimpColorPanel *panel;
g_return_val_if_fail (color != NULL, NULL);
panel = gtk_type_new (GIMP_TYPE_COLOR_PANEL);
GIMP_COLOR_BUTTON (panel)->title = g_strdup (title);
gimp_color_button_set_type (GIMP_COLOR_BUTTON (panel), type);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (panel), color);
gtk_widget_set_usize (GTK_WIDGET (panel), width, height);
return GTK_WIDGET (panel);
}
static void
gimp_color_panel_color_changed (GimpColorButton *button)
{
GimpColorPanel *panel;
GimpRGB color;
panel = GIMP_COLOR_PANEL (button);
if (panel->color_notebook_active)
{
gimp_color_button_get_color (GIMP_COLOR_BUTTON (button), &color);
color_notebook_set_color (panel->color_notebook, &color);
}
}
static void
gimp_color_panel_clicked (GtkButton *button)
{
GimpColorPanel *panel;
GimpRGB color;
panel = GIMP_COLOR_PANEL (button);
gimp_color_button_get_color (GIMP_COLOR_BUTTON (button), &color);
if (! panel->color_notebook)
{
panel->color_notebook =
color_notebook_new (GIMP_COLOR_BUTTON (button)->title,
(const GimpRGB *) &color,
gimp_color_panel_select_callback,
panel,
FALSE,
gimp_color_button_has_alpha (GIMP_COLOR_BUTTON (button)));
panel->color_notebook_active = TRUE;
}
else
{
if (! panel->color_notebook_active)
{
color_notebook_show (panel->color_notebook);
panel->color_notebook_active = TRUE;
}
color_notebook_set_color (panel->color_notebook, &color);
}
}
static void
gimp_color_panel_select_callback (ColorNotebook *notebook,
const GimpRGB *color,
ColorNotebookState state,
gpointer data)
{
GimpColorPanel *panel;
panel = GIMP_COLOR_PANEL (data);
if (panel->color_notebook)
{
switch (state)
{
case COLOR_NOTEBOOK_UPDATE:
break;
case COLOR_NOTEBOOK_OK:
gimp_color_button_set_color (GIMP_COLOR_BUTTON (panel), color);
/* Fallthrough */
case COLOR_NOTEBOOK_CANCEL:
color_notebook_hide (panel->color_notebook);
panel->color_notebook_active = FALSE;
}
}
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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 __COLOR_PANEL_H__
#define __COLOR_PANEL_H__
#include "libgimpwidgets/gimpcolorbutton.h"
#define GIMP_TYPE_COLOR_PANEL (gimp_color_panel_get_type ())
#define GIMP_COLOR_PANEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_COLOR_PANEL, GimpColorPanel))
#define GIMP_COLOR_PANEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_PANEL, GimpColorPanelClass))
#define GIMP_IS_COLOR_PANEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_COLOR_PANEL))
#define GIMP_IS_COLOR_PANEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_PANEL))
typedef struct _GimpColorPanel GimpColorPanel;
typedef struct _GimpColorPanelClass GimpColorPanelClass;
struct _GimpColorPanelClass
{
GimpColorButtonClass parent_class;
};
GtkType gimp_color_panel_get_type (void);
GtkWidget * gimp_color_panel_new (const gchar *title,
const GimpRGB *color,
GimpColorAreaType type,
gint width,
gint height);
#endif /* __COLOR_PANEL_H__ */
......@@ -28,10 +28,11 @@
#include "paint-funcs/paint-funcs.h"
#include "widgets/gimpdrawablepreview.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimpdrawable.h"
#include "gimpdrawablepreview.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
#include "pixel_region.h"
......
......@@ -29,7 +29,8 @@
#include "apptypes.h"
#include "color_panel.h"
#include "widgets/gimpcolorpanel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
......
......@@ -29,7 +29,8 @@
#include "apptypes.h"
#include "color_panel.h"
#include "widgets/gimpcolorpanel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
......
......@@ -31,6 +31,8 @@
#include "tools/gimptoolinfo.h"
#include "tools/tool_manager.h"
#include "widgets/gimppreview.h"
#include "appenv.h"
#include "context_manager.h"
#include "devices.h"
......@@ -41,7 +43,6 @@
#include "gimpdnd.h"
#include "gimpgradient.h"
#include "gimppattern.h"
#include "gimppreview.h"
#include "gimplist.h"
#include "gimprc.h"
#include "session.h"
......
......@@ -28,13 +28,14 @@
#include "tools/gimpcolorpickertool.h"
#include "tools/tool_manager.h"
#include "widgets/gimppreview.h"
#include "context_manager.h"
#include "colormaps.h"
#include "gdisplay.h"
#include "gimpcontainer.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimppreview.h"
#include "info_dialog.h"
#include "info_window.h"
......
......@@ -29,7 +29,8 @@
#include "apptypes.h"
#include "color_panel.h"
#include "widgets/gimpcolorpanel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* GimpBrushPreview Widget
* Copyright (C) 2001 Michael Natterer
*
* 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.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "apptypes.h"
#include "gimpbrush.h"
#include "gimpbrushpipe.h"
#include "gimpbrushpreview.h"
#include "gimpdnd.h"
#include "temp_buf.h"
static void gimp_brush_preview_class_init (GimpBrushPreviewClass *klass);
static void gimp_brush_preview_init (GimpBrushPreview *preview);
static void gimp_brush_preview_destroy (GtkObject *object);
static void gimp_brush_preview_render (GimpPreview *preview);
static GtkWidget * gimp_brush_preview_create_popup (GimpPreview *preview);
static gboolean gimp_brush_preview_needs_popup (GimpPreview *preview);
static gboolean gimp_brush_preview_render_timeout_func (GimpBrushPreview *preview);
static GimpPreviewClass *parent_class = NULL;
GtkType
gimp_brush_preview_get_type (void)
{
static GtkType preview_type = 0;
if (! preview_type)
{
GtkTypeInfo preview_info =
{
"GimpBrushPreview",
sizeof (GimpBrushPreview),
sizeof (GimpBrushPreviewClass),
(GtkClassInitFunc) gimp_brush_preview_class_init,
(GtkObjectInitFunc) gimp_brush_preview_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL
};
preview_type = gtk_type_unique (GIMP_TYPE_PREVIEW, &preview_info);
}
return preview_type;
}
static void
gimp_brush_preview_class_init (GimpBrushPreviewClass *klass)
{
GtkObjectClass *object_class;
GimpPreviewClass *preview_class;
object_class = (GtkObjectClass *) klass;
preview_class = (GimpPreviewClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_PREVIEW);
object_class->destroy = gimp_brush_preview_destroy;
preview_class->render = gimp_brush_preview_render;
preview_class->create_popup = gimp_brush_preview_create_popup;
preview_class->needs_popup = gimp_brush_preview_needs_popup;
}
static void
gimp_brush_preview_init (GimpBrushPreview *brush_preview)
{
brush_preview->pipe_timeout_id = 0;
brush_preview->pipe_animation_index = 0;
}
static void
gimp_brush_preview_destroy (GtkObject *object)
{
GimpBrushPreview *brush_preview;
brush_preview = GIMP_BRUSH_PREVIEW (object);
if (brush_preview->pipe_timeout_id)
{
g_source_remove (brush_preview->pipe_timeout_id);
brush_preview->pipe_timeout_id = 0;
brush_preview->pipe_animation_index = 0;
}
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
#define indicator_width 7
#define indicator_height 7
#define WHT { 255, 255, 255 }
#define BLK { 0, 0, 0 }
#define RED { 255, 127, 127 }
static void
gimp_brush_preview_render (GimpPreview *preview)
{
GimpBrushPreview *brush_preview;
GimpBrush *brush;
TempBuf *temp_buf;
gint width;
gint height;
gint brush_width;
gint brush_height;
guchar *buf;
guchar *b;
gint x, y;
gint offset_x;
gint offset_y;
brush_preview = GIMP_BRUSH_PREVIEW (preview);
if (brush_preview->pipe_timeout_id)