renamed the DObject type to GfigObject, according to our common type

* plug-ins/gfig/gfig-dobject.h: renamed the DObject type to
  GfigObject, according to our common type naming.  This type will
  certainly become an abstract class in a near future.

* plug-ins/gfig/gfig-arc.c
* plug-ins/gfig/gfig-bezier.c
* plug-ins/gfig/gfig-bezier.h
* plug-ins/gfig/gfig-circle.c
* plug-ins/gfig/gfig-dialog.c
* plug-ins/gfig/gfig-dobject.c
* plug-ins/gfig/gfig-ellipse.c
* plug-ins/gfig/gfig-line.c
* plug-ins/gfig/gfig-line.h
* plug-ins/gfig/gfig-poly.c
* plug-ins/gfig/gfig-poly.h
* plug-ins/gfig/gfig-spiral.c
* plug-ins/gfig/gfig-star.c
* plug-ins/gfig/gfig-types.h
* plug-ins/gfig/gfig.c
* plug-ins/gfig/gfig.h: changed accordingly.
This commit is contained in:
David Odin 2004-11-16 14:10:20 +00:00
parent c0d9179492
commit 8f0f5f11f5
18 changed files with 222 additions and 199 deletions

View file

@ -1,3 +1,26 @@
2004-11-16 DindinX <dindinx@gimp.org>
* plug-ins/gfig/gfig-dobject.h: renamed the DObject type to
GfigObject, according to our common type naming. This type will
certainly become an abstract class in a near future.
* plug-ins/gfig/gfig-arc.c
* plug-ins/gfig/gfig-bezier.c
* plug-ins/gfig/gfig-bezier.h
* plug-ins/gfig/gfig-circle.c
* plug-ins/gfig/gfig-dialog.c
* plug-ins/gfig/gfig-dobject.c
* plug-ins/gfig/gfig-ellipse.c
* plug-ins/gfig/gfig-line.c
* plug-ins/gfig/gfig-line.h
* plug-ins/gfig/gfig-poly.c
* plug-ins/gfig/gfig-poly.h
* plug-ins/gfig/gfig-spiral.c
* plug-ins/gfig/gfig-star.c
* plug-ins/gfig/gfig-types.h
* plug-ins/gfig/gfig.c
* plug-ins/gfig/gfig.h: changed accordingly.
2004-11-16 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem-linked.[ch] (gimp_item_linked_get_list):

View file

@ -312,13 +312,13 @@ arc_angle (GdkPoint *pnt,
}
static void
arc_drawing_details (Dobject *obj,
gdouble *minang,
GdkPoint *center_pnt,
gdouble *arcang,
gdouble *radius,
gint draw_cnts,
gint do_scale)
arc_drawing_details (GfigObject *obj,
gdouble *minang,
GdkPoint *center_pnt,
gdouble *arcang,
gdouble *radius,
gint draw_cnts,
gint do_scale)
{
DobjPoints *pnt1 = NULL;
DobjPoints *pnt2 = NULL;
@ -403,7 +403,7 @@ arc_drawing_details (Dobject *obj,
}
static void
d_draw_arc (Dobject * obj)
d_draw_arc (GfigObject * obj)
{
GdkPoint center_pnt;
gdouble radius, minang, arcang;
@ -419,7 +419,7 @@ d_draw_arc (Dobject * obj)
}
static void
d_paint_arc (Dobject *obj)
d_paint_arc (GfigObject *obj)
{
/* first point center */
/* Next point is radius */
@ -524,10 +524,10 @@ d_paint_arc (Dobject *obj)
g_free (line_pnts);
}
static Dobject *
d_copy_arc (Dobject *obj)
static GfigObject *
d_copy_arc (GfigObject *obj)
{
Dobject *nc;
GfigObject *nc;
g_assert (obj->type == ARC);
@ -540,7 +540,7 @@ d_copy_arc (Dobject *obj)
void
d_arc_object_class_init (void)
{
DobjClass *class = &dobj_class[ARC];
GfigObjectClass *class = &dobj_class[ARC];
class->type = ARC;
class->name = "Arc";

View file

@ -42,10 +42,10 @@
static gint bezier_closed = 0; /* Closed curve 0 = false 1 = true */
static gint bezier_line_frame = 0; /* Show frame = false 1 = true */
Dobject *tmp_bezier; /* Needed when drawing bezier curves */
GfigObject *tmp_bezier; /* Needed when drawing bezier curves */
static void d_paint_bezier (Dobject *obj);
static Dobject * d_copy_bezier (Dobject * obj);
static void d_paint_bezier (GfigObject *obj);
static GfigObject *d_copy_bezier (GfigObject *obj);
#define FP_PNT_MAX 10
@ -123,7 +123,7 @@ DrawBezier (gdouble (*points)[2],
gdouble mid,
gint depth)
{
gint i, j, x0 = 0, y0 = 0, x1, y1;
gint i, j, x0 = 0, y0 = 0, x1, y1;
fp_pnt left;
fp_pnt right;
@ -175,7 +175,7 @@ DrawBezier (gdouble (*points)[2],
}
void
d_draw_bezier (Dobject *obj)
d_draw_bezier (GfigObject *obj)
{
DobjPoints *spnt;
gint seg_count = 0;
@ -220,7 +220,7 @@ d_draw_bezier (Dobject *obj)
}
static void
d_paint_bezier (Dobject *obj)
d_paint_bezier (GfigObject *obj)
{
gdouble *line_pnts;
gdouble (*bz_line_pnts)[2];
@ -280,10 +280,10 @@ d_paint_bezier (Dobject *obj)
/* Don't free line_pnts - may need again */
}
static Dobject *
d_copy_bezier (Dobject *obj)
static GfigObject *
d_copy_bezier (GfigObject *obj)
{
Dobject *np;
GfigObject *np;
g_assert (obj->type == BEZIER);
@ -297,7 +297,7 @@ d_copy_bezier (Dobject *obj)
void
d_bezier_object_class_init (void)
{
DobjClass *class = &dobj_class[BEZIER];
GfigObjectClass *class = &dobj_class[BEZIER];
class->type = BEZIER;
class->name = "Bezier";

View file

@ -26,17 +26,17 @@
#ifndef __GFIG_BEZIER_H__
#define __GFIG_BEZIER_H__
extern Dobject *tmp_bezier;
extern GfigObject *tmp_bezier;
void d_draw_bezier (Dobject *obj);
void d_draw_bezier (GfigObject *obj);
void d_update_bezier (GdkPoint *pnt);
void d_bezier_start (GdkPoint *pnt,
gint shift_down);
void d_bezier_end (GdkPoint *pnt,
gint shift_down);
void d_update_bezier (GdkPoint *pnt);
void d_bezier_start (GdkPoint *pnt,
gboolean shift_down);
void d_bezier_end (GdkPoint *pnt,
gboolean shift_down);
void d_bezier_object_class_init (void);
void tool_options_bezier (GtkWidget *notebook);
void tool_options_bezier (GtkWidget *notebook);
#endif /* __GFIG_BEZIER_H__ */

View file

@ -50,7 +50,7 @@ calc_radius (GdkPoint *center, GdkPoint *edge)
}
static void
d_draw_circle (Dobject *obj)
d_draw_circle (GfigObject *obj)
{
DobjPoints *center_pnt;
DobjPoints *edge_pnt;
@ -76,7 +76,7 @@ d_draw_circle (Dobject *obj)
}
static void
d_paint_circle (Dobject *obj)
d_paint_circle (GfigObject *obj)
{
DobjPoints *center_pnt;
DobjPoints *edge_pnt;
@ -135,10 +135,10 @@ d_paint_circle (Dobject *obj)
}
static Dobject*
d_copy_circle (Dobject * obj)
static GfigObject*
d_copy_circle (GfigObject * obj)
{
Dobject *nc;
GfigObject *nc;
g_assert (obj->type == CIRCLE);
@ -151,7 +151,7 @@ d_copy_circle (Dobject * obj)
void
d_circle_object_class_init (void)
{
DobjClass *class = &dobj_class[CIRCLE];
GfigObjectClass *class = &dobj_class[CIRCLE];
class->type = CIRCLE;
class->name = "Circle";

View file

@ -1415,12 +1415,12 @@ save_file_chooser_response (GtkFileChooser *chooser,
gtk_widget_destroy (GTK_WIDGET (chooser));
}
static Dobject *
static GfigObject *
gfig_select_obj_by_number (gint count)
{
GList *objs;
Dobject *object = NULL;
gint k;
GList *objs;
GfigObject *object = NULL;
gint k;
gfig_context->selected_obj = NULL;
@ -1721,13 +1721,13 @@ paint_layer_fill (void)
void
gfig_paint_callback (void)
{
GList *objs;
gint layer_count = 0;
gchar buf[128];
gint count;
gint ccount = 0;
Style *style0;
Dobject *object;
GList *objs;
gint layer_count = 0;
gchar buf[128];
gint count;
gint ccount = 0;
Style *style0;
GfigObject *object;
if (!gfig_context->enable_repaint || !gfig_context->current_obj)
return;

View file

@ -51,24 +51,24 @@
#include "libgimp/stdplugins-intl.h"
static Dobject *operation_obj = NULL;
static GdkPoint *move_all_pnt; /* Point moving all from */
static GfigObject *operation_obj = NULL;
static GdkPoint *move_all_pnt; /* Point moving all from */
static void draw_one_obj (Dobject *obj);
static void do_move_obj (Dobject *obj,
static void draw_one_obj (GfigObject *obj);
static void do_move_obj (GfigObject *obj,
GdkPoint *to_pnt);
static void do_move_all_obj (GdkPoint *to_pnt);
static void do_move_obj_pnt (Dobject *obj,
static void do_move_obj_pnt (GfigObject *obj,
GdkPoint *to_pnt);
static void remove_obj_from_list (GFigObj *obj,
Dobject *del_obj);
GfigObject *del_obj);
static gint scan_obj_points (DobjPoints *opnt,
GdkPoint *pnt);
void
d_save_object (Dobject *obj,
GString *string)
d_save_object (GfigObject *obj,
GString *string)
{
do_save_obj (obj, string);
@ -106,15 +106,15 @@ gfig_read_object_type (gchar *desc)
return OBJ_TYPE_NONE;
}
Dobject *
GfigObject *
d_load_object (gchar *desc,
FILE *fp)
{
Dobject *new_obj = NULL;
gint xpnt;
gint ypnt;
gchar buf[MAX_LOAD_LINE];
DobjType type;
GfigObject *new_obj = NULL;
gint xpnt;
gint ypnt;
gchar buf[MAX_LOAD_LINE];
DobjType type;
type = gfig_read_object_type (desc);
if (type == OBJ_TYPE_NONE)
@ -166,12 +166,12 @@ d_load_object (gchar *desc,
return new_obj;
}
Dobject *
GfigObject *
d_new_object (DobjType type,
gint x,
gint y)
{
Dobject *nobj = g_new0 (Dobject, 1);
GfigObject *nobj = g_new0 (GfigObject, 1);
nobj->type = type;
nobj->class = &dobj_class[type];
@ -265,10 +265,10 @@ d_copy_dobjpoints (DobjPoints *pnts)
}
static DobjPoints *
get_diffs (Dobject *obj,
gint *xdiff,
gint *ydiff,
GdkPoint *to_pnt)
get_diffs (GfigObject *obj,
gint *xdiff,
gint *ydiff,
GdkPoint *to_pnt)
{
DobjPoints *spnt;
@ -316,14 +316,14 @@ scan_obj_points (DobjPoints *opnt,
return FALSE;
}
static Dobject *
static GfigObject *
get_nearest_objs (GFigObj *obj,
GdkPoint *pnt)
{
/* Nearest object to given point or NULL */
GList *all;
Dobject *test_obj;
gint count = 0;
GList *all;
GfigObject *test_obj;
gint count = 0;
if (!obj)
return NULL;
@ -346,7 +346,7 @@ void
object_operation_start (GdkPoint *pnt,
gint shift_down)
{
Dobject *new_obj;
GfigObject *new_obj;
/* Find point in given object list */
operation_obj = get_nearest_objs (gfig_context->current_obj, pnt);
@ -411,7 +411,7 @@ object_operation_start (GdkPoint *pnt,
/* Copy the "operation object" */
/* Then bung us into "copy/move" mode */
new_obj = (Dobject*) operation_obj->class->copyfunc (operation_obj);
new_obj = (GfigObject*) operation_obj->class->copyfunc (operation_obj);
if (new_obj)
{
gfig_style_copy (&new_obj->style, &operation_obj->style, "Object");
@ -537,9 +537,9 @@ object_operation (GdkPoint *to_pnt,
}
static void
update_pnts (Dobject *obj,
gint xdiff,
gint ydiff)
update_pnts (GfigObject *obj,
gint xdiff,
gint ydiff)
{
DobjPoints *spnt;
@ -554,8 +554,8 @@ update_pnts (Dobject *obj,
}
static void
remove_obj_from_list (GFigObj *obj,
Dobject *del_obj)
remove_obj_from_list (GFigObj *obj,
GfigObject *del_obj)
{
/* Nearest object to given point or NULL */
@ -571,7 +571,7 @@ remove_obj_from_list (GFigObj *obj,
if (obj->obj_list)
{
Dobject *new_current = obj->obj_list->data;
GfigObject *new_current = obj->obj_list->data;
gfig_style_set_context_from_style (&new_current->style);
}
else
@ -602,7 +602,7 @@ do_move_all_obj (GdkPoint *to_pnt)
for (all = gfig_context->current_obj->obj_list; all; all = all->next)
{
Dobject *obj = all->data;
GfigObject *obj = all->data;
/* undraw ! */
draw_one_obj (obj);
@ -618,8 +618,8 @@ do_move_all_obj (GdkPoint *to_pnt)
}
void
do_save_obj (Dobject *obj,
GString *string)
do_save_obj (GfigObject *obj,
GString *string)
{
DobjPoints *spnt;
@ -630,8 +630,8 @@ do_save_obj (Dobject *obj,
}
static void
do_move_obj (Dobject *obj,
GdkPoint *to_pnt)
do_move_obj (GfigObject *obj,
GdkPoint *to_pnt)
{
/* Move the whole line - undraw the line to start with */
/* Then draw in new pos */
@ -653,8 +653,8 @@ do_move_obj (Dobject *obj,
}
static void
do_move_obj_pnt (Dobject *obj,
GdkPoint *to_pnt)
do_move_obj_pnt (GfigObject *obj,
GdkPoint *to_pnt)
{
/* Move the whole line - undraw the line to start with */
/* Then draw in new pos */
@ -685,8 +685,8 @@ copy_all_objs (GList *objs)
while (objs)
{
Dobject *object = objs->data;
Dobject *new_object = (Dobject *) object->class->copyfunc (object);
GfigObject *object = objs->data;
GfigObject *new_object = (GfigObject *) object->class->copyfunc (object);
new_all_objs = g_list_append (new_all_objs, new_object);
@ -698,7 +698,7 @@ copy_all_objs (GList *objs)
/* Screen refresh */
static void
draw_one_obj (Dobject * obj)
draw_one_obj (GfigObject * obj)
{
obj->class->drawfunc (obj);
}
@ -746,8 +746,8 @@ scale_obj_points (DobjPoints *opnt,
}
void
add_to_all_obj (GFigObj *fobj,
Dobject *obj)
add_to_all_obj (GFigObj *fobj,
GfigObject *obj)
{
GList *nobj = NULL;
@ -939,7 +939,7 @@ object_update (GdkPoint *pnt)
*/
void
free_one_obj (Dobject *obj)
free_one_obj (GfigObject *obj)
{
d_delete_dobjpoints (obj->points);
g_free (obj);

View file

@ -28,8 +28,8 @@
#include "gfig-types.h"
#include "gfig-style.h"
typedef void (*DobjFunc) (Dobject *);
typedef Dobject *(*DobjGenFunc) (Dobject *);
typedef void (*DobjFunc) (GfigObject *);
typedef GfigObject *(*DobjGenFunc) (GfigObject *);
typedef struct DobjPoints
{
@ -45,19 +45,19 @@ typedef struct
DobjFunc drawfunc; /* How do I draw myself */
DobjFunc paintfunc; /* Draw me on canvas */
DobjGenFunc copyfunc; /* copy */
} DobjClass;
} GfigObjectClass;
DobjClass dobj_class[10];
GfigObjectClass dobj_class[10];
/* The object itself */
struct _Dobject
struct _GfigObject
{
DobjType type; /* What is the type? */
DobjClass *class; /* What class does it belong to? */
gint type_data; /* Extra data needed by the object */
DobjPoints *points; /* List of points */
Style style; /* this object's individual style settings */
gint style_no; /* style index of this specific object */
DobjType type; /* What is the type? */
GfigObjectClass *class; /* What class does it belong to? */
gint type_data; /* Extra data needed by the object */
DobjPoints *points; /* List of points */
Style style; /* this object's individual style settings */
gint style_no; /* style index of this specific object */
};
/* States of the object */
@ -65,36 +65,36 @@ struct _Dobject
#define GFIG_MODIFIED 0x1
#define GFIG_READONLY 0x2
extern Dobject *obj_creating;
extern Dobject *tmp_line;
extern GfigObject *obj_creating;
extern GfigObject *tmp_line;
void d_pnt_add_line (Dobject *obj,
void d_pnt_add_line (GfigObject *obj,
gint x,
gint y,
gint pos);
DobjPoints *new_dobjpoint (gint x,
gint y);
void do_save_obj (Dobject *obj,
void do_save_obj (GfigObject *obj,
GString *to);
DobjPoints *d_copy_dobjpoints (DobjPoints *pnts);
void free_one_obj (Dobject *obj);
void free_one_obj (GfigObject *obj);
void d_delete_dobjpoints (DobjPoints *pnts);
void object_update (GdkPoint *pnt);
GList *copy_all_objs (GList *objs);
void draw_objects (GList *objs,
gboolean show_single);
Dobject *d_load_object (gchar *desc,
GfigObject *d_load_object (gchar *desc,
FILE *fp);
Dobject *d_new_object (DobjType type,
GfigObject *d_new_object (DobjType type,
gint x,
gint y);
void d_save_object (Dobject *obj,
void d_save_object (GfigObject *obj,
GString *string);
void free_all_objs (GList *objs);

View file

@ -42,7 +42,7 @@
#include "libgimp/stdplugins-intl.h"
static void
d_draw_ellipse (Dobject * obj)
d_draw_ellipse (GfigObject * obj)
{
DobjPoints *center_pnt;
DobjPoints *edge_pnt;
@ -83,7 +83,7 @@ d_draw_ellipse (Dobject * obj)
}
static void
d_paint_approx_ellipse (Dobject *obj)
d_paint_approx_ellipse (GfigObject *obj)
{
/* first point center */
/* Next point is radius */
@ -197,7 +197,7 @@ d_paint_approx_ellipse (Dobject *obj)
static void
d_paint_ellipse (Dobject *obj)
d_paint_ellipse (GfigObject *obj)
{
DobjPoints *center_pnt;
DobjPoints *edge_pnt;
@ -269,10 +269,10 @@ d_paint_ellipse (Dobject *obj)
gimp_edit_stroke (gfig_context->drawable_id);
}
static Dobject *
d_copy_ellipse (Dobject * obj)
static GfigObject *
d_copy_ellipse (GfigObject * obj)
{
Dobject *nc;
GfigObject *nc;
g_assert (obj->type == ELLIPSE);
@ -285,7 +285,7 @@ d_copy_ellipse (Dobject * obj)
void
d_ellipse_object_class_init (void)
{
DobjClass *class = &dobj_class[ELLIPSE];
GfigObjectClass *class = &dobj_class[ELLIPSE];
class->type = ELLIPSE;
class->name = "Ellipse";

View file

@ -39,10 +39,10 @@
#include "libgimp/stdplugins-intl.h"
Dobject *
d_copy_line (Dobject *obj)
GfigObject *
d_copy_line (GfigObject *obj)
{
Dobject *nl;
GfigObject *nl;
g_assert (obj->type == LINE);
@ -53,7 +53,7 @@ d_copy_line (Dobject *obj)
}
void
d_draw_line (Dobject *obj)
d_draw_line (GfigObject *obj)
{
DobjPoints *spnt;
DobjPoints *epnt;
@ -77,7 +77,7 @@ d_draw_line (Dobject *obj)
}
void
d_paint_line (Dobject *obj)
d_paint_line (GfigObject *obj)
{
DobjPoints *spnt;
gdouble *line_pnts;
@ -136,7 +136,7 @@ d_paint_line (Dobject *obj)
void
d_line_object_class_init (void)
{
DobjClass *class = &dobj_class[LINE];
GfigObjectClass *class = &dobj_class[LINE];
class->type = LINE;
class->name = "Line";
@ -164,10 +164,10 @@ d_delete_line (Dobject *obj)
*/
void
d_pnt_add_line (Dobject *obj,
gint x,
gint y,
gint pos)
d_pnt_add_line (GfigObject *obj,
gint x,
gint y,
gint pos)
{
DobjPoints *npnts = new_dobjpoint (x, y);

View file

@ -26,18 +26,18 @@
#ifndef __GFIG_LINE_H__
#define __GFIG_LINE_H__
void d_save_line (Dobject *obj,
GString *string);
void d_save_line (GfigObject *obj,
GString *string);
void d_draw_line (Dobject *obj);
void d_paint_line (Dobject *obj);
Dobject *d_copy_line (Dobject *obj);
void d_draw_line (GfigObject *obj);
void d_paint_line (GfigObject *obj);
GfigObject *d_copy_line (GfigObject *obj);
void d_update_line (GdkPoint *pnt);
void d_line_start (GdkPoint *pnt,
gboolean shift_down);
void d_line_end (GdkPoint *pnt,
gboolean shift_down);
void d_line_object_class_init (void);
void d_update_line (GdkPoint *pnt);
void d_line_start (GdkPoint *pnt,
gboolean shift_down);
void d_line_end (GdkPoint *pnt,
gboolean shift_down);
void d_line_object_class_init (void);
#endif /* __GFIG_LINE_H__ */

View file

@ -43,8 +43,8 @@
static gint poly_num_sides = 3; /* Default to three sided object */
static void d_draw_poly (Dobject *obj);
static Dobject *d_copy_poly (Dobject *obj);
static void d_draw_poly (GfigObject *obj);
static GfigObject *d_copy_poly (GfigObject *obj);
void
tool_options_poly (GtkWidget *notebook)
@ -57,7 +57,7 @@ tool_options_poly (GtkWidget *notebook)
}
static void
d_draw_poly (Dobject *obj)
d_draw_poly (GfigObject *obj)
{
DobjPoints *center_pnt;
DobjPoints *radius_pnt;
@ -141,7 +141,7 @@ d_draw_poly (Dobject *obj)
}
void
d_paint_poly (Dobject *obj)
d_paint_poly (GfigObject *obj)
{
/* first point center */
/* Next point is radius */
@ -248,7 +248,7 @@ d_paint_poly (Dobject *obj)
}
void
d_poly2lines (Dobject *obj)
d_poly2lines (GfigObject *obj)
{
/* first point center */
/* Next point is radius */
@ -340,7 +340,7 @@ d_poly2lines (Dobject *obj)
}
void
d_star2lines (Dobject *obj)
d_star2lines (GfigObject *obj)
{
/* first point center */
/* Next point is radius */
@ -463,10 +463,10 @@ d_star2lines (Dobject *obj)
obj->class->drawfunc (obj);
}
static Dobject *
d_copy_poly (Dobject *obj)
static GfigObject *
d_copy_poly (GfigObject *obj)
{
Dobject *np;
GfigObject *np;
g_assert (obj->type == POLY);
@ -480,7 +480,7 @@ d_copy_poly (Dobject *obj)
void
d_poly_object_class_init (void)
{
DobjClass *class = &dobj_class[POLY];
GfigObjectClass *class = &dobj_class[POLY];
class->type = POLY;
class->name = "Poly";
@ -541,7 +541,7 @@ d_update_poly (GdkPoint *pnt)
void
d_poly_start (GdkPoint *pnt,
gint shift_down)
gboolean shift_down)
{
obj_creating = d_new_object (POLY, pnt->x, pnt->y);
obj_creating->type_data = poly_num_sides;
@ -549,7 +549,7 @@ d_poly_start (GdkPoint *pnt,
void
d_poly_end (GdkPoint *pnt,
gint shift_down)
gboolean shift_down)
{
draw_circle (pnt);
add_to_all_obj (gfig_context->current_obj, obj_creating);

View file

@ -26,18 +26,18 @@
#ifndef __GFIG_POLY_H__
#define __GFIG_POLY_H__
void tool_options_poly (GtkWidget *notebook);
void tool_options_poly (GtkWidget *notebook);
void d_update_poly (GdkPoint *pnt);
void d_poly_start (GdkPoint *pnt,
gint shift_down);
void d_poly_end (GdkPoint *pnt,
gint shift_down);
void d_update_poly (GdkPoint *pnt);
void d_poly_start (GdkPoint *pnt,
gboolean shift_down);
void d_poly_end (GdkPoint *pnt,
gboolean shift_down);
void d_paint_poly (Dobject *obj);
void d_paint_poly (GfigObject *obj);
void d_poly2lines (Dobject *obj);
void d_star2lines (Dobject *obj);
void d_poly2lines (GfigObject *obj);
void d_star2lines (GfigObject *obj);
void d_poly_object_class_init (void);
#endif /* __GFIG_POLY_H__ */

View file

@ -41,9 +41,9 @@
#include "libgimp/stdplugins-intl.h"
static void d_draw_spiral (Dobject *obj);
static void d_paint_spiral (Dobject *obj);
static Dobject *d_copy_spiral (Dobject * obj);
static void d_draw_spiral (GfigObject *obj);
static void d_paint_spiral (GfigObject *obj);
static GfigObject *d_copy_spiral (GfigObject *obj);
static gint spiral_num_turns = 4; /* Default to 4 turns */
static gint spiral_toggle = 0; /* 0 = clockwise -1 = anti-clockwise */
@ -59,7 +59,7 @@ tool_options_spiral (GtkWidget *notebook)
}
static void
d_draw_spiral (Dobject *obj)
d_draw_spiral (GfigObject *obj)
{
DobjPoints *center_pnt;
DobjPoints *radius_pnt;
@ -151,7 +151,7 @@ d_draw_spiral (Dobject *obj)
}
static void
d_paint_spiral (Dobject *obj)
d_paint_spiral (GfigObject *obj)
{
/* first point center */
/* Next point is radius */
@ -261,10 +261,10 @@ d_paint_spiral (Dobject *obj)
g_free (line_pnts);
}
static Dobject *
d_copy_spiral (Dobject *obj)
static GfigObject *
d_copy_spiral (GfigObject *obj)
{
Dobject *np;
GfigObject *np;
g_assert (obj->type == SPIRAL);
@ -278,7 +278,7 @@ d_copy_spiral (Dobject *obj)
void
d_spiral_object_class_init (void)
{
DobjClass *class = &dobj_class[SPIRAL];
GfigObjectClass *class = &dobj_class[SPIRAL];
class->type = SPIRAL;
class->name = "Spiral";

View file

@ -42,9 +42,9 @@
static gint star_num_sides = 3; /* Default to three sided object */
static void d_draw_star (Dobject *obj);
static void d_paint_star (Dobject *obj);
static Dobject *d_copy_star (Dobject * obj);
static void d_draw_star (GfigObject *obj);
static void d_paint_star (GfigObject *obj);
static GfigObject *d_copy_star (GfigObject * obj);
void
tool_options_star (GtkWidget *notebook)
@ -57,7 +57,7 @@ tool_options_star (GtkWidget *notebook)
}
static void
d_draw_star (Dobject *obj)
d_draw_star (GfigObject *obj)
{
DobjPoints *center_pnt;
DobjPoints *outer_radius_pnt;
@ -167,7 +167,7 @@ d_draw_star (Dobject *obj)
}
static void
d_paint_star (Dobject *obj)
d_paint_star (GfigObject *obj)
{
/* first point center */
/* Next point is radius */
@ -304,10 +304,10 @@ d_paint_star (Dobject *obj)
g_free (line_pnts);
}
static Dobject *
d_copy_star (Dobject *obj)
static GfigObject *
d_copy_star (GfigObject *obj)
{
Dobject *np;
GfigObject *np;
g_assert (obj->type == STAR);
@ -321,7 +321,7 @@ d_copy_star (Dobject *obj)
void
d_star_object_class_init (void)
{
DobjClass *class = &dobj_class[STAR];
GfigObjectClass *class = &dobj_class[STAR];
class->type = STAR;
class->name = "Star";

View file

@ -107,8 +107,8 @@ typedef enum
NULL_OPER
} DobjType;
typedef struct _GFigObj GFigObj;
typedef struct _Dobject Dobject;
typedef struct _Style Style;
typedef struct _GFigObj GFigObj;
typedef struct _GfigObject GfigObject;
typedef struct _Style Style;
#endif /* __GFIG_ENUMS_H__ */

View file

@ -86,12 +86,10 @@ gint obj_show_single = -1; /* -1 all >= 0 object number */
/* Points used to draw the object */
Dobject *obj_creating; /* Object we are creating */
Dobject *tmp_line; /* Needed when drawing lines */
gint need_to_scale;
GfigObject *obj_creating; /* Object we are creating */
GfigObject *tmp_line; /* Needed when drawing lines */
gboolean need_to_scale;
static gint load_options (GFigObj *gfig,
FILE *fp);
@ -372,11 +370,11 @@ gfig_load_objs (GFigObj *gfig,
gint load_count,
FILE *fp)
{
Dobject *obj;
gchar load_buf[MAX_LOAD_LINE];
glong offset;
glong offset2;
Style style;
GfigObject *obj;
gchar load_buf[MAX_LOAD_LINE];
glong offset;
glong offset2;
Style style;
while (load_count-- > 0)
{
@ -543,8 +541,8 @@ save_options (GString *string)
}
static void
gfig_save_obj_start (Dobject *obj,
GString *string)
gfig_save_obj_start (GfigObject *obj,
GString *string)
{
g_string_append_printf (string, "<%s ", obj->class->name);
gfig_style_save_as_attributes (&obj->style, string);
@ -552,8 +550,8 @@ gfig_save_obj_start (Dobject *obj,
}
static void
gfig_save_obj_end (Dobject *obj,
GString *string)
gfig_save_obj_end (GfigObject *obj,
GString *string)
{
g_string_append_printf (string, "</%s>\n",obj->class->name);
}
@ -691,7 +689,7 @@ gfig_save_as_string (void)
objs;
objs = g_list_next (objs))
{
Dobject *object = objs->data;
GfigObject *object = objs->data;
gfig_save_obj_start (object, string);

View file

@ -130,7 +130,7 @@ typedef struct
gint32 image_id; /* Gimp image id */
gint32 drawable_id; /* Gimp drawable to paint on */
GFigObj *current_obj;
Dobject *selected_obj;
GfigObject *selected_obj;
GtkWidget *preview;
Style *style[1000]; /* hack, but hopefully way more than enough! */
gint num_styles;
@ -155,7 +155,8 @@ GFigContext *gfig_context;
extern selection_option selopt;
extern SelectItVals selvals;
void add_to_all_obj (GFigObj * fobj, Dobject *obj);
void add_to_all_obj (GFigObj *fobj,
GfigObject *obj);
gchar *get_line (gchar *buf,
gint s,
@ -179,6 +180,7 @@ void draw_circle (GdkPoint *p);
void draw_sqr (GdkPoint *p);
void list_button_update (GFigObj *obj);
GtkWidget *num_sides_widget (gchar *d_title,
gint *num_sides,
gint *which_way,