~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/display/sp-ctrlline.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Kees Cook, Ted Gould
  • Date: 2008-02-10 14:20:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080210142016-vcnb2zqyhszu0xvb
Tags: 0.46~pre1-0ubuntu1
[ Kees Cook ]
* debian/control:
  - add libgtkspell-dev build-dep to gain GtkSpell features (LP: #183547).
  - update Standards version (no changes needed).
  - add Vcs and Homepage fields.
  - switch to new python-lxml dep.
* debian/{control,rules}: switch from dpatch to quilt for more sanity.
* debian/patches/20_fix_glib_and_gxx43_ftbfs.patch:
  - merged against upstream fixes.
  - added additional fixes for newly written code.
* debian/rules: enable parallel building.

[ Ted Gould ]
* Updating POTFILES.in to make it so things build correctly.
* debian/control:
  - add ImageMagick++ and libboost-dev to build-deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * Author:
7
7
 *   Lauris Kaplinski <lauris@kaplinski.com>
 
8
 *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
8
9
 *
 
10
 * Copyright (C) 2007 Johan Engelen
9
11
 * Copyright (C) 1999-2002 Lauris Kaplinski
10
12
 *
11
13
 * Released under GNU GPL
24
26
#ifdef HAVE_CONFIG_H
25
27
# include "config.h"
26
28
#endif
27
 
#include <livarot/Shape.h>
28
29
#include <livarot/Path.h>
29
 
 
30
 
struct SPCtrlLine : public SPCanvasItem{
31
 
    guint32 rgba;
32
 
    NRPoint s, e;
33
 
    Shape* shp;
34
 
};
35
 
 
36
 
struct SPCtrlLineClass : public SPCanvasItemClass{};
 
30
#include <color.h>
 
31
 
37
32
 
38
33
static void sp_ctrlline_class_init (SPCtrlLineClass *klass);
39
34
static void sp_ctrlline_init (SPCtrlLine *ctrlline);
83
78
    ctrlline->rgba = 0x0000ff7f;
84
79
    ctrlline->s.x = ctrlline->s.y = ctrlline->e.x = ctrlline->e.y = 0.0;
85
80
    ctrlline->shp=NULL;
 
81
    ctrlline->item=NULL;
86
82
}
87
83
 
88
84
static void
98
94
        ctrlline->shp = NULL;
99
95
    }
100
96
 
 
97
    ctrlline->item=NULL;
 
98
 
101
99
    if (GTK_OBJECT_CLASS (parent_class)->destroy)
102
100
        (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
103
101
}
113
111
    area.y0=buf->rect.y0;
114
112
    area.y1=buf->rect.y1;
115
113
 
 
114
/*
 
115
// CAIRO FIXME: after SPCanvasBuf is switched to unpacked 32bit rgb, rendering can be done via cairo:
 
116
    cairo_surface_t* cst = cairo_image_surface_create_for_data (
 
117
        buf->buf,
 
118
        CAIRO_FORMAT_RGB24,
 
119
        buf->rect.x1 - buf->rect.x0,
 
120
        buf->rect.y1 - buf->rect.y0,
 
121
        buf->buf_rowstride
 
122
        );
 
123
    cairo_t *ct = cairo_create (cst);
 
124
 
 
125
    guint32 rgba = ctrlline->rgba;
 
126
    cairo_set_source_rgba(ct, SP_RGBA32_R_F(rgba), SP_RGBA32_G_F(rgba), SP_RGBA32_B_F(rgba), SP_RGBA32_A_F(rgba));
 
127
 
 
128
    cairo_set_line_width(ct, 0.5);
 
129
    cairo_new_path(ct);
 
130
 
 
131
    cairo_move_to (ct, ctrlline->s.x - buf->rect.x0, ctrlline->s.y - buf->rect.y0);
 
132
    cairo_line_to (ct, ctrlline->e.x - buf->rect.x0, ctrlline->e.y - buf->rect.y0);
 
133
 
 
134
    cairo_stroke(ct);
 
135
    cairo_destroy (ct);
 
136
    cairo_surface_finish (cst);
 
137
    cairo_surface_destroy (cst);
 
138
*/
 
139
 
 
140
// CAIRO FIXME: instead of this:
116
141
    if (ctrlline->shp) {
117
142
        sp_canvas_prepare_buffer (buf);
118
143
        nr_pixblock_render_ctrl_rgba (ctrlline->shp,ctrlline->rgba,area,(char*)buf->buf, buf->buf_rowstride);
122
147
static void
123
148
sp_ctrlline_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags)
124
149
{
125
 
    NRRect dbox;
126
 
 
127
150
    SPCtrlLine *cl = SP_CTRLLINE (item);
128
151
 
129
152
    sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
133
156
 
134
157
    sp_canvas_item_reset_bounds (item);
135
158
 
 
159
/*
 
160
// CAIRO FIXME: all that is needed for update with cairo:
 
161
    NR::Point s = NR::Point(cl->s.x, cl->s.y) * affine;
 
162
    NR::Point e = NR::Point(cl->e.x, cl->e.y) * affine;
 
163
 
 
164
    cl->s.x = s[NR::X];
 
165
    cl->s.y = s[NR::Y];
 
166
    cl->e.x = e[NR::X];
 
167
    cl->e.y = e[NR::Y];
 
168
 
 
169
    item->x1 = (int)(MIN(s[NR::X], e[NR::X]) - 1);
 
170
    item->y1 = (int)(MIN(s[NR::Y], e[NR::Y]) - 1);
 
171
    item->x2 = (int)(MAX(s[NR::X], e[NR::X]) + 1);
 
172
    item->y2 = (int)(MAX(s[NR::Y], e[NR::Y]) + 1);
 
173
*/
 
174
 
 
175
// CAIRO FIXME: instead of:
 
176
    NRRect dbox;
136
177
    dbox.x0=dbox.x1=dbox.y0=dbox.y1=0;
137
178
    if (cl->shp) {
138
179
        delete cl->shp;