Code

Filter effects dialog:
[inkscape.git] / src / desktop.cpp
index bd403139ec824bf61dc996dff10c8d6039050586..859e15bd830280b45628042f99930dc393721f63 100644 (file)
@@ -129,7 +129,7 @@ SPDesktop::SPDesktop() :
     zooms_future( 0 ),
     dkey( 0 ),
     number( 0 ),
-    is_fullscreen( false ),
+    window_state(0),
     interaction_disabled_counter( 0 ),
     waiting_cursor( false ),
     guides_active( false ),
@@ -970,6 +970,36 @@ SPDesktop::scroll_to_point (NR::Point const *p, gdouble autoscrollspeed)
     return false;
 }
 
+bool
+SPDesktop::is_iconified()
+{
+    return 0!=(window_state & GDK_WINDOW_STATE_ICONIFIED);
+}
+
+void
+SPDesktop::iconify()
+{
+    _widget->setIconified();
+}
+
+bool
+SPDesktop::is_maximized()
+{
+    return 0!=(window_state & GDK_WINDOW_STATE_MAXIMIZED);
+}
+
+void
+SPDesktop::maximize()
+{
+    _widget->setMaximized();
+}
+
+bool
+SPDesktop::is_fullscreen()
+{
+    return 0!=(window_state & GDK_WINDOW_STATE_FULLSCREEN);
+}
+
 void
 SPDesktop::fullscreen()
 {
@@ -1124,7 +1154,7 @@ void SPDesktop::toggleGrid()
     } else {
         //there is no grid present at the moment. add a rectangular grid and make it visible
         Inkscape::XML::Node *repr = SP_OBJECT_REPR(namedview);
-        Inkscape::CanvasGrid::writeNewGridToRepr(repr, "xygrid");
+        Inkscape::CanvasGrid::writeNewGridToRepr(repr, sp_desktop_document(this), Inkscape::GRID_RECTANGULAR);
         grids_visible = true;
         sp_canvas_item_show(SP_CANVAS_ITEM(gridgroup));
     }