Commit dc398572 authored by Michael Natterer's avatar Michael Natterer 😴

app: add GimpSegment as replacement for GdkSegment

parent 1948feb6
......@@ -221,7 +221,7 @@ gimp_canvas_boundary_get_property (GObject *object,
static void
gimp_canvas_boundary_transform (GimpCanvasItem *item,
GimpDisplayShell *shell,
GdkSegment *segs)
GimpSegment *segs)
{
GimpCanvasBoundaryPrivate *private = GET_PRIVATE (item);
gint i;
......@@ -288,9 +288,9 @@ gimp_canvas_boundary_draw (GimpCanvasItem *item,
cairo_t *cr)
{
GimpCanvasBoundaryPrivate *private = GET_PRIVATE (item);
GdkSegment *segs;
GimpSegment *segs;
segs = g_new0 (GdkSegment, private->n_segs);
segs = g_new0 (GimpSegment, private->n_segs);
gimp_canvas_boundary_transform (item, shell, segs);
......@@ -307,11 +307,11 @@ gimp_canvas_boundary_get_extents (GimpCanvasItem *item,
{
GimpCanvasBoundaryPrivate *private = GET_PRIVATE (item);
GdkRectangle rectangle;
GdkSegment *segs;
GimpSegment *segs;
gint x1, y1, x2, y2;
gint i;
segs = g_new0 (GdkSegment, private->n_segs);
segs = g_new0 (GimpSegment, private->n_segs);
gimp_canvas_boundary_transform (item, shell, segs);
......
......@@ -118,7 +118,7 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
void
gimp_display_shell_draw_selection_out (GimpDisplayShell *shell,
cairo_t *cr,
GdkSegment *segs,
GimpSegment *segs,
gint n_segs)
{
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
......
......@@ -30,7 +30,7 @@ void gimp_display_shell_draw_get_scaled_image_size_for_scale
void gimp_display_shell_draw_selection_out (GimpDisplayShell *shell,
cairo_t *cr,
GdkSegment *segs,
GimpSegment *segs,
gint n_segs);
void gimp_display_shell_draw_selection_in (GimpDisplayShell *shell,
cairo_t *cr,
......
......@@ -45,10 +45,10 @@ struct _Selection
{
GimpDisplayShell *shell; /* shell that owns the selection */
GdkSegment *segs_in; /* gdk segments of area boundary */
GimpSegment *segs_in; /* gdk segments of area boundary */
gint n_segs_in; /* number of segments in segs_in */
GdkSegment *segs_out; /* gdk segments of area boundary */
GimpSegment *segs_out; /* gdk segments of area boundary */
gint n_segs_out; /* number of segments in segs_out */
guint index; /* index of current stipple pattern */
......@@ -72,7 +72,7 @@ static void selection_render_mask (Selection *selection);
static void selection_transform_segs (Selection *selection,
const BoundSeg *src_segs,
GdkSegment *dest_segs,
GimpSegment *dest_segs,
gint n_segs);
static void selection_generate_segs (Selection *selection);
static void selection_free_segs (Selection *selection);
......@@ -303,7 +303,7 @@ selection_render_mask (Selection *selection)
static void
selection_transform_segs (Selection *selection,
const BoundSeg *src_segs,
GdkSegment *dest_segs,
GimpSegment *dest_segs,
gint n_segs)
{
const gint xclamp = selection->shell->disp_width + 1;
......@@ -352,7 +352,7 @@ selection_generate_segs (Selection *selection)
const BoundSeg *segs_out;
/* Ask the image for the boundary of its selected region...
* Then transform that information into a new buffer of GdkSegments
* Then transform that information into a new buffer of GimpSegments
*/
gimp_channel_boundary (gimp_image_get_mask (image),
&segs_in, &segs_out,
......@@ -361,7 +361,7 @@ selection_generate_segs (Selection *selection)
if (selection->n_segs_in)
{
selection->segs_in = g_new (GdkSegment, selection->n_segs_in);
selection->segs_in = g_new (GimpSegment, selection->n_segs_in);
selection_transform_segs (selection, segs_in,
selection->segs_in, selection->n_segs_in);
......@@ -375,7 +375,7 @@ selection_generate_segs (Selection *selection)
/* Possible secondary boundary representation */
if (selection->n_segs_out)
{
selection->segs_out = g_new (GdkSegment, selection->n_segs_out);
selection->segs_out = g_new (GimpSegment, selection->n_segs_out);
selection_transform_segs (selection, segs_out,
selection->segs_out, selection->n_segs_out);
}
......
......@@ -236,7 +236,7 @@ gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
void
gimp_display_shell_transform_segments (const GimpDisplayShell *shell,
const BoundSeg *src_segs,
GdkSegment *dest_segs,
GimpSegment *dest_segs,
gint n_segs,
gdouble offset_x,
gdouble offset_y)
......
......@@ -51,7 +51,7 @@ void gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
void gimp_display_shell_transform_segments (const GimpDisplayShell *shell,
const BoundSeg *src_segs,
GdkSegment *dest_segs,
GimpSegment *dest_segs,
gint n_segs,
gdouble offset_x,
gdouble offset_y);
......
......@@ -112,9 +112,9 @@ gimp_cairo_add_arc (cairo_t *cr,
}
void
gimp_cairo_add_segments (cairo_t *cr,
GdkSegment *segs,
gint n_segs)
gimp_cairo_add_segments (cairo_t *cr,
GimpSegment *segs,
gint n_segs)
{
gint i;
......
......@@ -36,7 +36,7 @@ void gimp_cairo_add_arc (cairo_t *cr,
gdouble start_angle,
gdouble slice_angle);
void gimp_cairo_add_segments (cairo_t *cr,
GdkSegment *segs,
GimpSegment *segs,
gint n_segs);
void gimp_cairo_draw_toolbox_wilber (GtkWidget *widget,
......
......@@ -272,4 +272,17 @@ typedef gboolean (* GimpPanedBoxDroppedFunc) (GtkWidget *source,
gpointer data);
/* temp hack as replacement for GdkSegment */
typedef struct _GimpSegment GimpSegment;
struct _GimpSegment
{
gint x1;
gint y1;
gint x2;
gint y2;
};
#endif /* __WIDGETS_TYPES_H__ */
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