summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-18 18:07:14 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-18 18:07:14 +0000
commite77956b4dbd029c9f6949f81fe083606f995c624 (patch)
tree74adda4df8986d65f70efb341c6235277361fd35 /src/desktop.cpp
parentupdated code to work on 0.92 code (diff)
parentLatvian translation update (diff)
downloadinkscape-e77956b4dbd029c9f6949f81fe083606f995c624.tar.gz
inkscape-e77956b4dbd029c9f6949f81fe083606f995c624.zip
update to trunk
(bzr r12588.1.39)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp71
1 files changed, 32 insertions, 39 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 74dea3ca1..1152184c9 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -37,7 +37,7 @@
#include "color.h"
#include "desktop-events.h"
#include "desktop.h"
-#include "desktop-handles.h"
+
#include "desktop-style.h"
#include "device-manager.h"
#include "display/canvas-arena.h"
@@ -56,7 +56,6 @@
#include "event-log.h"
#include "helper/action-context.h"
#include "ui/interface.h"
-#include "inkscape-private.h"
#include "layer-fns.h"
#include "layer-manager.h"
#include "layer-model.h"
@@ -94,28 +93,28 @@ static void _reconstruction_finish(SPDesktop * desktop);
static void _namedview_modified (SPObject *obj, guint flags, SPDesktop *desktop);
SPDesktop::SPDesktop() :
- _dlg_mgr( 0 ),
- namedview( 0 ),
- canvas( 0 ),
- layers( 0 ),
- selection( 0 ),
- event_context( 0 ),
- layer_manager( 0 ),
- event_log( 0 ),
- temporary_item_list( 0 ),
- snapindicator( 0 ),
- acetate( 0 ),
- main( 0 ),
- gridgroup( 0 ),
- guides( 0 ),
- drawing( 0 ),
- sketch( 0 ),
- controls( 0 ),
- tempgroup ( 0 ),
- table( 0 ),
- page( 0 ),
- page_border( 0 ),
- current( 0 ),
+ _dlg_mgr( NULL ),
+ namedview( NULL ),
+ canvas( NULL ),
+ layers( NULL ),
+ selection( NULL ),
+ event_context( NULL ),
+ layer_manager( NULL ),
+ event_log( NULL ),
+ temporary_item_list( NULL ),
+ snapindicator( NULL ),
+ acetate( NULL ),
+ main( NULL ),
+ gridgroup( NULL ),
+ guides( NULL ),
+ drawing( NULL ),
+ sketch( NULL ),
+ controls( NULL ),
+ tempgroup ( NULL ),
+ table( NULL ),
+ page( NULL ),
+ page_border( NULL ),
+ current( NULL ),
_focusMode(false),
dkey( 0 ),
number( 0 ),
@@ -124,16 +123,15 @@ SPDesktop::SPDesktop() :
waiting_cursor( false ),
showing_dialogs ( false ),
guides_active( false ),
- gr_item( 0 ),
+ gr_item( NULL ),
gr_point_type( POINT_LG_BEGIN ),
gr_point_i( 0 ),
gr_fill_or_stroke( Inkscape::FOR_FILL ),
_reconstruction_old_layer_id(), // an id attribute is not allowed to be the empty string
_display_mode(Inkscape::RENDERMODE_NORMAL),
_display_color_mode(Inkscape::COLORMODE_NORMAL),
- _widget( 0 ),
- _inkscape( 0 ),
- _guides_message_context( 0 ),
+ _widget( NULL ),
+ _guides_message_context( NULL ),
_active( false ),
_w2d(),
_d2w(),
@@ -299,7 +297,6 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas, Inkscape::UI::View::EditWid
// ?
// sp_active_desktop_set (desktop);
- _inkscape = INKSCAPE;
_activate_connection = _activate_signal.connect(
sigc::bind(
@@ -385,10 +382,6 @@ void SPDesktop::destroy()
layer_manager = NULL;
}
- if (_inkscape) {
- _inkscape = NULL;
- }
-
if (drawing) {
doc()->getRoot()->invoke_hide(dkey);
g_object_unref(drawing);
@@ -509,7 +502,7 @@ void SPDesktop::_setDisplayMode(Inkscape::RenderMode mode) {
canvas->rendermode = mode;
_display_mode = mode;
redrawDesktop();
- _widget->setTitle( sp_desktop_document(this)->getName() );
+ _widget->setTitle( this->getDocument()->getName() );
}
void SPDesktop::_setDisplayColorMode(Inkscape::ColorMode mode) {
// reload grayscale matrix from prefs
@@ -530,7 +523,7 @@ void SPDesktop::_setDisplayColorMode(Inkscape::ColorMode mode) {
canvas->colorrendermode = mode;
_display_color_mode = mode;
redrawDesktop();
- _widget->setTitle( sp_desktop_document(this)->getName() );
+ _widget->setTitle( this->getDocument()->getName() );
}
void SPDesktop::displayModeToggle() {
@@ -694,7 +687,7 @@ void SPDesktop::set_event_context2(const std::string& toolName)
}
}
- Inkscape::UI::Tools::ToolBase* new_tool = ToolFactory::instance().createObject(toolName);
+ Inkscape::UI::Tools::ToolBase* new_tool = ToolFactory::createObject(toolName);
new_tool->desktop = this;
new_tool->message_context = new Inkscape::MessageContext(this->messageStack());
event_context = new_tool;
@@ -1431,7 +1424,7 @@ void
SPDesktop::emitToolSubselectionChanged(gpointer data)
{
_tool_subselection_changed.emit(data);
- inkscape_subselection_changed (this);
+ INKSCAPE.subselection_changed (this);
}
void SPDesktop::updateNow()
@@ -1453,7 +1446,7 @@ void SPDesktop::disableInteraction()
void SPDesktop::setWaitingCursor()
{
GdkCursor *waiting = gdk_cursor_new(GDK_WATCH);
- gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(sp_desktop_canvas(this))), waiting);
+ gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(getCanvas())), waiting);
#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(waiting);
#else
@@ -1488,7 +1481,7 @@ void SPDesktop::toggleGrids()
}
} else {
//there is no grid present at the moment. add a rectangular grid and make it visible
- namedview->writeNewGrid(sp_desktop_document(this), Inkscape::GRID_RECTANGULAR);
+ namedview->writeNewGrid(this->getDocument(), Inkscape::GRID_RECTANGULAR);
showGrids(true);
}
}