Commit 2252863e authored by GMT 1999 Andy Thomas's avatar GMT 1999 Andy Thomas Committed by Andy Thomas
Browse files

This is a bit of a biggy. Added paths to layers & channels dialog. This is

Fri Mar  5 21:45:39 GMT 1999 Andy Thomas <alt@picnic.demon.co.uk>

	This is a bit of a biggy. Added paths to layers & channels
	dialog. This is not complete yet (it still has some rough edges ;-)

	New:-

	* paths_dialog.c
	* paths_dialog.h
	* pathsP.h

	These are the core parts of the paths dialog & interaction.

	* tools/penadd.xpm
	* tools/pendel.xpm
	* tools/pennorm.xpm
	* tools/penedit.xpm
	* tools/penstroke.xpm

	New images found in the dialog. Maybe someone with a better
	artistic flair could replace these?

	Changed:-

	* Makefile.am

	Added new files for build

	* layers_dialog.c

	Added new tab for paths.

	* bezier_select.h
	* bezier_selectP.h
	* bezier_select.c

	Rearrangement & fixes. Not finished yet.

	* iscissors.c

	Header file changes. (Need to include more headers).

	* gdisplay.c
	* gdisplay.h

	Hmmm... Added a function that did a mapping from gimage to gdisp.
	This is a little bit of a "hack", but it was needed.. really.

	* ops_buttons.h
	* ops_buttons.c

	Enhanced to create more types of button ops. Used in the paths dialog.

	* channels_dialog.c

	Header file changes?

	* xcf.c

	Paths stored in new PROP. Yosh.. I did as you and Adam suggested.

	* gimpimage.c
	* gimpimage.h
	* gimpimageP.h

	Added paths items to the image structures.
parent 73566254
Fri Mar 5 21:45:39 GMT 1999 Andy Thomas <alt@picnic.demon.co.uk>
This is a bit of a biggy. Added paths to layers & channels
dialog. This is not complete yet (it still has some rough edges ;-)
New:-
* paths_dialog.c
* paths_dialog.h
* pathsP.h
These are the core parts of the paths dialog & interaction.
* tools/penadd.xpm
* tools/pendel.xpm
* tools/pennorm.xpm
* tools/penedit.xpm
* tools/penstroke.xpm
New images found in the dialog. Maybe someone with a better
artistic flair could replace these?
Changed:-
* Makefile.am
Added new files for build
* layers_dialog.c
Added new tab for paths.
* bezier_select.h
* bezier_selectP.h
* bezier_select.c
Rearrangement & fixes. Not finished yet.
* iscissors.c
Header file changes. (Need to include more headers).
* gdisplay.c
* gdisplay.h
Hmmm... Added a function that did a mapping from gimage to gdisp.
This is a little bit of a "hack", but it was needed.. really.
* ops_buttons.h
* ops_buttons.c
Enhanced to create more types of button ops. Used in the paths dialog.
* channels_dialog.c
Header file changes?
* xcf.c
Paths stored in new PROP. Yosh.. I did as you and Adam suggested.
* gimpimage.c
* gimpimage.h
* gimpimageP.h
Added paths items to the image structures.
1999-03-04 Tomas Ogren <stric@ing.umu.se>
* app/gimprc.c: Added a g_strdup() on DEFAULT_IMAGE_TITLE_FORMAT,
......
......@@ -272,6 +272,9 @@ gimp_SOURCES = \
parasitelist.h \
parasitelistF.h \
parasitelistP.h \
paths_dialog.h \
paths_dialog.c \
pathsP.h \
pattern_header.h \
pattern_select.c \
pattern_select.h \
......@@ -360,7 +363,14 @@ EXTRA_DIST = \
tools/lower.xpm \
tools/mask.xbm \
tools/new.xpm \
tools/raise.xpm
tools/raise.xpm \
tools/penadd.xpm \
tools/pendel.xpm \
tools/penedit.xpm \
tools/pennorm.xpm \
tools/penstroke.xpm \
tools/ptoselection.xpm
CPPFLAGS = \
-DLIBDIR=\""$(gimpplugindir)"\" \
......
This diff is collapsed.
......@@ -18,9 +18,23 @@
#ifndef __BEZIER_SELECTP_H__
#define __BEZIER_SELECTP_H__
#define BEZIER_START 1
#define BEZIER_ADD 2
#define BEZIER_EDIT 4
#define BEZIER_DRAG 8
#define BEZIER_ANCHOR 1
#define BEZIER_CONTROL 2
#define IMAGE_COORDS 1
#define AA_IMAGE_COORDS 2
#define SCREEN_COORDS 3
#define SUBDIVIDE 1000
enum { EXTEND_EDIT, EXTEND_ADD, EXTEND_REMOVE, EXTEND_NEW };
typedef struct _bezier_point BezierPoint;
struct _bezier_point
......@@ -32,8 +46,34 @@ struct _bezier_point
BezierPoint *prev; /* prev point on curve */
};
typedef struct _bezier_select BezierSelect;
struct _bezier_select
{
int state; /* start, add, edit or drag */
int draw; /* all or part */
int closed; /* is the curve closed */
DrawCore *core; /* Core drawing object */
BezierPoint *points; /* the curve */
BezierPoint *cur_anchor; /* the current active anchor point */
BezierPoint *cur_control; /* the current active control point */
BezierPoint *last_point; /* the last point on the curve */
int num_points; /* number of points in the curve */
Channel *mask; /* null if the curve is open */
GSList **scanlines; /* used in converting a curve */
};
typedef void (*BezierPointsFunc) (BezierSelect *, GdkPoint *, int);
/* Functions */
int bezier_select_load (void *, BezierPoint *, int, int);
int bezier_select_load (void *, BezierPoint *, int, int);
void bezier_draw_curve (BezierSelect *,BezierPointsFunc, int);
void bezier_select_reset (BezierSelect *);
void bezier_add_point (BezierSelect *, int, int, int);
void bezier_paste_bezierselect_to_current (GDisplay *,BezierSelect *);
void bezier_select_mode (gint);
void bezier_stroke (BezierSelect *, GDisplay *, int, int);
void bezier_to_selection (BezierSelect *, GDisplay *);
#endif /* __BEZIER_SELECTP_H__ */
......@@ -234,7 +234,7 @@ channels_dialog_create ()
/* The ops buttons */
button_box = ops_button_box_new (lc_shell, tool_tips, channels_ops_buttons);
button_box = ops_button_box_new (lc_shell, tool_tips, channels_ops_buttons,OPS_BUTTON_NORMAL);
gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2);
gtk_widget_show (button_box);
......
......@@ -31,6 +31,7 @@
#include "undo.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "pathsP.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -173,6 +174,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->yresolution = default_yresolution;
gimage->unit = default_units;
gimage->save_proc= NULL;
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
......@@ -1036,6 +1038,18 @@ gimp_image_colormap_changed (GimpImage *image, gint col)
gimp_image_signals[COLORMAP_CHANGED],
col);
}
void
gimp_image_set_paths(GimpImage *gimage,PathsList *paths)
{
gimage->paths = paths;
}
PathsList *
gimp_image_get_paths(GimpImage *gimage)
{
return gimage->paths;
}
/************************************************************/
/* Projection functions */
......
......@@ -13,6 +13,7 @@
#include "plug_in.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "pathsP.h"
#define GIMP_TYPE_IMAGE gimp_image_get_type()
......@@ -153,6 +154,9 @@ void gimp_image_detach_parasite (GimpImage *, const char *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
void gimp_image_set_paths (GimpImage *,PathsList *);
PathsList * gimp_image_get_paths (GimpImage *);
/* Temporary hack till colormap manipulation is encapsulated in functions.
Call this whenever you modify an image's colormap. The ncol argument
specifies which color has changed, or negative if there's a bigger change.
......
......@@ -31,6 +31,7 @@
#include "undo.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "pathsP.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -173,6 +174,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->yresolution = default_yresolution;
gimage->unit = default_units;
gimage->save_proc= NULL;
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
......@@ -1036,6 +1038,18 @@ gimp_image_colormap_changed (GimpImage *image, gint col)
gimp_image_signals[COLORMAP_CHANGED],
col);
}
void
gimp_image_set_paths(GimpImage *gimage,PathsList *paths)
{
gimage->paths = paths;
}
PathsList *
gimp_image_get_paths(GimpImage *gimage)
{
return gimage->paths;
}
/************************************************************/
/* Projection functions */
......
......@@ -13,6 +13,7 @@
#include "plug_in.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "pathsP.h"
#define GIMP_TYPE_IMAGE gimp_image_get_type()
......@@ -153,6 +154,9 @@ void gimp_image_detach_parasite (GimpImage *, const char *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
void gimp_image_set_paths (GimpImage *,PathsList *);
PathsList * gimp_image_get_paths (GimpImage *);
/* Temporary hack till colormap manipulation is encapsulated in functions.
Call this whenever you modify an image's colormap. The ncol argument
specifies which color has changed, or negative if there's a bigger change.
......
......@@ -31,6 +31,7 @@
#include "undo.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "pathsP.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -173,6 +174,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->yresolution = default_yresolution;
gimage->unit = default_units;
gimage->save_proc= NULL;
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
......@@ -1036,6 +1038,18 @@ gimp_image_colormap_changed (GimpImage *image, gint col)
gimp_image_signals[COLORMAP_CHANGED],
col);
}
void
gimp_image_set_paths(GimpImage *gimage,PathsList *paths)
{
gimage->paths = paths;
}
PathsList *
gimp_image_get_paths(GimpImage *gimage)
{
return gimage->paths;
}
/************************************************************/
/* Projection functions */
......
......@@ -13,6 +13,7 @@
#include "plug_in.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "pathsP.h"
#define GIMP_TYPE_IMAGE gimp_image_get_type()
......@@ -153,6 +154,9 @@ void gimp_image_detach_parasite (GimpImage *, const char *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
void gimp_image_set_paths (GimpImage *,PathsList *);
PathsList * gimp_image_get_paths (GimpImage *);
/* Temporary hack till colormap manipulation is encapsulated in functions.
Call this whenever you modify an image's colormap. The ncol argument
specifies which color has changed, or negative if there's a bigger change.
......
......@@ -31,6 +31,7 @@
#include "undo.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "pathsP.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -173,6 +174,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->yresolution = default_yresolution;
gimage->unit = default_units;
gimage->save_proc= NULL;
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
......@@ -1036,6 +1038,18 @@ gimp_image_colormap_changed (GimpImage *image, gint col)
gimp_image_signals[COLORMAP_CHANGED],
col);
}
void
gimp_image_set_paths(GimpImage *gimage,PathsList *paths)
{
gimage->paths = paths;
}
PathsList *
gimp_image_get_paths(GimpImage *gimage)
{
return gimage->paths;
}
/************************************************************/
/* Projection functions */
......
......@@ -13,6 +13,7 @@
#include "plug_in.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "pathsP.h"
#define GIMP_TYPE_IMAGE gimp_image_get_type()
......@@ -153,6 +154,9 @@ void gimp_image_detach_parasite (GimpImage *, const char *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
void gimp_image_set_paths (GimpImage *,PathsList *);
PathsList * gimp_image_get_paths (GimpImage *);
/* Temporary hack till colormap manipulation is encapsulated in functions.
Call this whenever you modify an image's colormap. The ncol argument
specifies which color has changed, or negative if there's a bigger change.
......
......@@ -31,6 +31,7 @@
#include "undo.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "pathsP.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -173,6 +174,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->yresolution = default_yresolution;
gimage->unit = default_units;
gimage->save_proc= NULL;
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
......@@ -1036,6 +1038,18 @@ gimp_image_colormap_changed (GimpImage *image, gint col)
gimp_image_signals[COLORMAP_CHANGED],
col);
}
void
gimp_image_set_paths(GimpImage *gimage,PathsList *paths)
{
gimage->paths = paths;
}
PathsList *
gimp_image_get_paths(GimpImage *gimage)
{
return gimage->paths;
}
/************************************************************/
/* Projection functions */
......
......@@ -13,6 +13,7 @@
#include "plug_in.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "pathsP.h"
#define GIMP_TYPE_IMAGE gimp_image_get_type()
......@@ -153,6 +154,9 @@ void gimp_image_detach_parasite (GimpImage *, const char *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
void gimp_image_set_paths (GimpImage *,PathsList *);
PathsList * gimp_image_get_paths (GimpImage *);
/* Temporary hack till colormap manipulation is encapsulated in functions.
Call this whenever you modify an image's colormap. The ncol argument
specifies which color has changed, or negative if there's a bigger change.
......
......@@ -31,6 +31,7 @@
#include "undo.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "pathsP.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -173,6 +174,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->yresolution = default_yresolution;
gimage->unit = default_units;
gimage->save_proc= NULL;
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
......@@ -1036,6 +1038,18 @@ gimp_image_colormap_changed (GimpImage *image, gint col)
gimp_image_signals[COLORMAP_CHANGED],
col);
}
void
gimp_image_set_paths(GimpImage *gimage,PathsList *paths)
{
gimage->paths = paths;
}
PathsList *
gimp_image_get_paths(GimpImage *gimage)
{
return gimage->paths;
}
/************************************************************/
/* Projection functions */
......
......@@ -13,6 +13,7 @@
#include "plug_in.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "pathsP.h"
#define GIMP_TYPE_IMAGE gimp_image_get_type()
......@@ -153,6 +154,9 @@ void gimp_image_detach_parasite (GimpImage *, const char *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
void gimp_image_set_paths (GimpImage *,PathsList *);
PathsList * gimp_image_get_paths (GimpImage *);
/* Temporary hack till colormap manipulation is encapsulated in functions.
Call this whenever you modify an image's colormap. The ncol argument
specifies which color has changed, or negative if there's a bigger change.
......
......@@ -31,6 +31,7 @@
#include "undo.h"
#include "gimpsignal.h"
#include "gimpparasite.h"
#include "pathsP.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -173,6 +174,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->yresolution = default_yresolution;
gimage->unit = default_units;
gimage->save_proc= NULL;
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
......@@ -1036,6 +1038,18 @@ gimp_image_colormap_changed (GimpImage *image, gint col)
gimp_image_signals[COLORMAP_CHANGED],
col);
}
void
gimp_image_set_paths(GimpImage *gimage,PathsList *paths)
{
gimage->paths = paths;
}
PathsList *
gimp_image_get_paths(GimpImage *gimage)
{
return gimage->paths;
}
/************************************************************/
/* Projection functions */
......
......@@ -13,6 +13,7 @@
#include "plug_in.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "pathsP.h"
#define GIMP_TYPE_IMAGE gimp_image_get_type()
......@@ -153,6 +154,9 @@ void gimp_image_detach_parasite (GimpImage *, const char *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
void gimp_image_set_paths (GimpImage *,PathsList *);
PathsList * gimp_image_get_paths (GimpImage *);
/* Temporary hack till colormap manipulation is encapsulated in functions.
Call this whenever you modify an image's colormap. The ncol argument
specifies which color has changed, or negative if there's a bigger change.
......
......@@ -2003,6 +2003,32 @@ gdisplays_delete ()
g_slist_free (display_list);
}
GDisplay *
gdisplays_check_valid (GDisplay *gtest, GimpImage *gimage)
{
/* Give a gdisp check that it is still valid and points to the require
* GimpImage. If not return the first gDisplay that does point to the
* gimage. If none found return NULL;
*/
GSList *list = display_list;
GDisplay *gdisp;
GDisplay *gdisp_found = NULL;
/* traverse the linked list of displays */
while (list)
{
gdisp = (GDisplay *) list->data;
if(gdisp == gtest)
return (gtest);
if(!gdisp_found && gdisp->gimage == gimage)
gdisp_found = gdisp;
list = g_slist_next (list);
}
return (gdisp_found);
}
static void
gdisplays_flush_whenever (gboolean now)
......
......@@ -185,6 +185,7 @@ void gdisplay_snap_rectangle (GDisplay *, int, int, int, int, int
void gdisplay_update_cursor (GDisplay *, int, int);
void gdisplay_set_dot_for_dot (GDisplay *, int);
void gdisplay_resize_cursor_label (GDisplay *);
GDisplay * gdisplays_check_valid (GDisplay *, GimpImage *);
/* function declarations */
......
......@@ -2003,6 +2003,32 @@ gdisplays_delete ()
g_slist_free (display_list);
}
GDisplay *
gdisplays_check_valid (GDisplay *gtest, GimpImage *gimage)
{
/* Give a gdisp check that it is still valid and points to the require
* GimpImage. If not return the first gDisplay that does point to the
* gimage. If none found return NULL;
*/
GSList *list = display_list;
GDisplay *gdisp;
GDisplay *gdisp_found = NULL;
/* traverse the linked list of displays */
while (list)
{
gdisp = (GDisplay *) list->data;
if(gdisp == gtest)
return (gtest);
if(!gdisp_found && gdisp->gimage == gimage)
gdisp_found = gdisp;
list = g_slist_next (list);
}
return (gdisp_found);
}
static void
gdisplays_flush_whenever (gboolean now)
......
......@@ -185,6 +185,7 @@ void gdisplay_snap_rectangle (GDisplay *, int, int, int, int, int
void gdisplay_update_cursor (GDisplay *, int, int);
void gdisplay_set_