diff --git a/src/desktop.cpp b/src/desktop.cpp
index df13bed37361adcf4ad94adb223ac9494ff82da2..5590633b8bf9cecbbf920df0245f977ec88739d0 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
* bulia byak <buliabyak@users.sf.net>
* Ralf Stephan <ralf@ark.in-berlin.de>
* John Bintz <jcoswell@coswellproductions.org>
+ * Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
- * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
+ * Copyright (C) 2006-2007 Johan Engelen
* Copyright (C) 2006 John Bintz
* Copyright (C) 2004 MenTaLguY
* Copyright (C) 1999-2002 Lauris Kaplinski
is_fullscreen = false;
gr_item = NULL;
- gr_point_num = 0;
+ gr_point_type = 0;
+ gr_point_i = 0;
gr_fill_or_stroke = true;
_layer_hierarchy = NULL;
if (prefs_get_int_attribute("options.startmode", "outline", 0)) {
// Start in outline mode
- SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_OUTLINE;
- canvas->rendermode = RENDERMODE_OUTLINE; // canvas needs that for choosing the best buffer size
+ setDisplayModeOutline();
} else {
// Start in normal mode, default
- SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_NORMAL;
- canvas->rendermode = RENDERMODE_NORMAL; // canvas needs that for choosing the best buffer size
+ setDisplayModeNormal();
}
grid = (SPCanvasGroup *) sp_canvas_item_new (main, SP_TYPE_CANVAS_GROUP, NULL);
void SPDesktop::setDisplayModeNormal()
{
+ prefs_set_int_attribute("options.outlinemode", "value", 0);
SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_NORMAL;
canvas->rendermode = RENDERMODE_NORMAL; // canvas needs that for choosing the best buffer size
+ displayMode = RENDERMODE_NORMAL;
sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw
+ _widget->setTitle(SP_DOCUMENT_NAME(sp_desktop_document(this)));
}
void SPDesktop::setDisplayModeOutline()
{
+ prefs_set_int_attribute("options.outlinemode", "value", 1);
SP_CANVAS_ARENA (drawing)->arena->rendermode = RENDERMODE_OUTLINE;
canvas->rendermode = RENDERMODE_OUTLINE; // canvas needs that for choosing the best buffer size
+ displayMode = RENDERMODE_OUTLINE;
sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw
+ _widget->setTitle(SP_DOCUMENT_NAME(sp_desktop_document(this)));
+}
+
+void SPDesktop::displayModeToggle()
+{
+ if (prefs_get_int_attribute("options.outlinemode", "value", prefs_get_int_attribute("options.startmode", "outline", 0)))
+ setDisplayModeNormal();
+ else
+ setDisplayModeOutline();
}
/**