summaryrefslogtreecommitdiffstats
path: root/src/dialogs
diff options
context:
space:
mode:
authorAbhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom>2010-06-29 18:05:42 +0000
committerAbhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom>2010-06-29 18:05:42 +0000
commit8867de5daf309e4cdd3fce177b408618490be4f3 (patch)
tree19a528d472e7a63f9cab97daa5c979d977db821b /src/dialogs
parentminor fix in Dutch translation of win32 installer (diff)
downloadinkscape-8867de5daf309e4cdd3fce177b408618490be4f3.tar.gz
inkscape-8867de5daf309e4cdd3fce177b408618490be4f3.zip
This is the first c++ification commit from me. It handles sp-line, sp-polyline, sp-item and marks the onset of document c++ification as well. Users can check performace increase with [/usr/bin/time -v inkscape_binary_with_commandline_options].
(bzr r9546.1.1)
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/clonetiler.cpp13
-rw-r--r--src/dialogs/export.cpp8
-rw-r--r--src/dialogs/spellcheck.cpp6
3 files changed, 13 insertions, 14 deletions
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp
index 55884fe4a..550370e90 100644
--- a/src/dialogs/clonetiler.cpp
+++ b/src/dialogs/clonetiler.cpp
@@ -851,7 +851,7 @@ clonetiler_trace_hide_tiled_clones_recursively (SPObject *from)
for (SPObject *o = sp_object_first_child(from); o != NULL; o = SP_OBJECT_NEXT(o)) {
if (SP_IS_ITEM(o) && clonetiler_is_a_clone_of (o, NULL))
- sp_item_invoke_hide(SP_ITEM(o), trace_visionkey); // FIXME: hide each tiled clone's original too!
+ SP_ITEM(o)->invoke_hide(trace_visionkey); // FIXME: hide each tiled clone's original too!
clonetiler_trace_hide_tiled_clones_recursively (o);
}
}
@@ -861,13 +861,12 @@ clonetiler_trace_setup (SPDocument *doc, gdouble zoom, SPItem *original)
{
trace_arena = NRArena::create();
/* Create ArenaItem and set transform */
- trace_visionkey = sp_item_display_key_new(1);
+ trace_visionkey = SPItem::display_key_new(1);
trace_doc = doc;
- trace_root = sp_item_invoke_show( SP_ITEM(SP_DOCUMENT_ROOT (trace_doc)),
- (NRArena *) trace_arena, trace_visionkey, SP_ITEM_SHOW_DISPLAY);
+ trace_root = SP_ITEM(SP_DOCUMENT_ROOT (trace_doc))->invoke_show((NRArena *) trace_arena, trace_visionkey, SP_ITEM_SHOW_DISPLAY);
// hide the (current) original and any tiled clones, we only want to pick the background
- sp_item_invoke_hide(original, trace_visionkey);
+ original->invoke_hide(trace_visionkey);
clonetiler_trace_hide_tiled_clones_recursively (SP_OBJECT(SP_DOCUMENT_ROOT (trace_doc)));
sp_document_root (trace_doc)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
@@ -954,7 +953,7 @@ static void
clonetiler_trace_finish ()
{
if (trace_doc) {
- sp_item_invoke_hide(SP_ITEM(sp_document_root(trace_doc)), trace_visionkey);
+ SP_ITEM(sp_document_root(trace_doc))->invoke_hide(trace_visionkey);
}
if (trace_arena) {
((NRObject *) trace_arena)->unreference();
@@ -1232,7 +1231,7 @@ clonetiler_apply( GtkWidget */*widget*/, void * )
bool prefs_bbox = prefs->getBool("/tools/bounding_box", false);
SPItem::BBoxType bbox_type = ( prefs_bbox ?
SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX );
- Geom::OptRect r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)),
+ Geom::OptRect r = SP_ITEM(obj)->getBounds(SP_ITEM(obj)->i2doc_affine(),
bbox_type);
if (r) {
w = r->dimensions()[Geom::X];
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index 696f38b77..463339534 100644
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
@@ -780,7 +780,7 @@ sp_export_selection_modified ( Inkscape::Application */*inkscape*/,
if ( SP_ACTIVE_DESKTOP ) {
SPDocument *doc;
doc = sp_desktop_document (SP_ACTIVE_DESKTOP);
- Geom::OptRect bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)), SPItem::RENDERING_BBOX);
+ Geom::OptRect bbox = SP_ITEM (SP_DOCUMENT_ROOT (doc))->getBboxDesktop (SPItem::RENDERING_BBOX);
if (bbox) {
sp_export_set_area (base, bbox->min()[Geom::X],
bbox->min()[Geom::Y],
@@ -861,7 +861,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base)
/** \todo
* This returns wrong values if the document has a viewBox.
*/
- bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)), SPItem::RENDERING_BBOX);
+ bbox = SP_ITEM (SP_DOCUMENT_ROOT (doc))->getBboxDesktop (SPItem::RENDERING_BBOX);
/* If the drawing is valid, then we'll use it and break
otherwise we drop through to the page settings */
if (bbox) {
@@ -1127,7 +1127,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
}
Geom::OptRect area;
- sp_item_invoke_bbox(item, area, sp_item_i2d_affine((SPItem *) item), TRUE);
+ item->invoke_bbox( area, static_cast<SPItem *>(item)->i2d_affine(), TRUE);
if (area) {
gint width = (gint) (area->width() * dpi / PX_PER_IN + 0.5);
gint height = (gint) (area->height() * dpi / PX_PER_IN + 0.5);
@@ -1498,7 +1498,7 @@ sp_export_detect_size(GtkObject * base) {
case SELECTION_DRAWING: {
SPDocument *doc = sp_desktop_document (SP_ACTIVE_DESKTOP);
- Geom::OptRect bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)), SPItem::RENDERING_BBOX);
+ Geom::OptRect bbox = SP_ITEM (SP_DOCUMENT_ROOT (doc))->getBboxDesktop (SPItem::RENDERING_BBOX);
// std::cout << "Drawing " << bbox2;
if ( bbox && sp_export_bbox_equal(*bbox,current_bbox) ) {
diff --git a/src/dialogs/spellcheck.cpp b/src/dialogs/spellcheck.cpp
index 1645218c6..24890f8eb 100644
--- a/src/dialogs/spellcheck.cpp
+++ b/src/dialogs/spellcheck.cpp
@@ -236,8 +236,8 @@ gint compare_text_bboxes (gconstpointer a, gconstpointer b)
SPItem *i1 = SP_ITEM(a);
SPItem *i2 = SP_ITEM(b);
- Geom::OptRect bbox1 = i1->getBounds(sp_item_i2d_affine(i1));
- Geom::OptRect bbox2 = i2->getBounds(sp_item_i2d_affine(i2));
+ Geom::OptRect bbox1 = i1->getBounds(i1->i2d_affine());
+ Geom::OptRect bbox2 = i2->getBounds(i2->i2d_affine());
if (!bbox1 || !bbox2) {
return 0;
}
@@ -570,7 +570,7 @@ spellcheck_next_word()
// draw rect
std::vector<Geom::Point> points =
- _layout->createSelectionShape(_begin_w, _end_w, sp_item_i2d_affine(_text));
+ _layout->createSelectionShape(_begin_w, _end_w, _text->i2d_affine());
Geom::Point tl, br;
tl = br = points.front();
for (unsigned i = 0 ; i < points.size() ; i ++) {