Commit 8f0f5f11 authored by David Odin's avatar David Odin
Browse files

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.
parent c0d91794
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):
......
......@@ -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";
......
......@@ -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";
......
......@@ -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__ */
......@@ -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";
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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";
......