summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2f9a69c)
raw | patch | inline | side by side (parent: 2f9a69c)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sun, 31 May 2009 12:51:33 +0000 (12:51 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sun, 31 May 2009 12:51:33 +0000 (12:51 +0000) |
diff --git a/src/attributes-test.h b/src/attributes-test.h
index 5593deeba6464a0ef480435f8e4b6a401d989217..d6851a42b4a77147dd5a19180f15e20838b7eecf 100644 (file)
--- a/src/attributes-test.h
+++ b/src/attributes-test.h
{"inkscape:window-height", true},
{"inkscape:window-x", true},
{"inkscape:window-y", true},
+ {"inkscape:window-maximized", true},
{"inkscape:current-layer", true},
{"inkscape:connector-type", true},
{"inkscape:connection-start", true},
diff --git a/src/attributes.cpp b/src/attributes.cpp
index f2fb62a1cb09215050d505fe27f23fb66a63f260..a0801920ebfbe4e32ebb2d360322a6d04190a19b 100644 (file)
--- a/src/attributes.cpp
+++ b/src/attributes.cpp
{SP_ATTR_INKSCAPE_WINDOW_HEIGHT, "inkscape:window-height"},
{SP_ATTR_INKSCAPE_WINDOW_X, "inkscape:window-x"},
{SP_ATTR_INKSCAPE_WINDOW_Y, "inkscape:window-y"},
+ {SP_ATTR_INKSCAPE_WINDOW_MAXIMIZED, "inkscape:window-maximized"},
{SP_ATTR_INKSCAPE_SNAP_GLOBAL, "inkscape:snap-global"},
{SP_ATTR_INKSCAPE_SNAP_BBOX, "inkscape:snap-bbox"},
{SP_ATTR_INKSCAPE_SNAP_NODES, "inkscape:snap-nodes"},
{SP_ATTR_INKSCAPE_SNAP_OBJECT_MIDPOINTS, "inkscape:snap-object-midpoints"},
{SP_ATTR_INKSCAPE_SNAP_BBOX_EDGE_MIDPOINTS, "inkscape:snap-bbox-edge-midpoints"},
{SP_ATTR_INKSCAPE_SNAP_BBOX_MIDPOINTS, "inkscape:snap-bbox-midpoints"},
- //{SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE, "inkscape:snap-intersection-grid-guide"},
- {SP_ATTR_INKSCAPE_SNAP_INTERS_PATHS, "inkscape:snap-intersection-paths"},
+ {SP_ATTR_INKSCAPE_SNAP_INTERS_PATHS, "inkscape:snap-intersection-paths"},
{SP_ATTR_INKSCAPE_OBJECT_PATHS, "inkscape:object-paths"},
{SP_ATTR_INKSCAPE_OBJECT_NODES, "inkscape:object-nodes"},
{SP_ATTR_INKSCAPE_BBOX_PATHS, "inkscape:bbox-paths"},
diff --git a/src/attributes.h b/src/attributes.h
index fc9e49f2b36b15796fffe763a6fe5959a4fce983..08ece3483efa2c2beb1048abc162789e772a96a3 100644 (file)
--- a/src/attributes.h
+++ b/src/attributes.h
SP_ATTR_INKSCAPE_WINDOW_HEIGHT,
SP_ATTR_INKSCAPE_WINDOW_X,
SP_ATTR_INKSCAPE_WINDOW_Y,
+ SP_ATTR_INKSCAPE_WINDOW_MAXIMIZED,
SP_ATTR_INKSCAPE_SNAP_GLOBAL,
SP_ATTR_INKSCAPE_SNAP_BBOX,
SP_ATTR_INKSCAPE_SNAP_NODES,
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index c9732eece6e0596a4b6460b6ae487dee0cc27d97..9b4b7b3e754c1a58221a60766b28f1c3d1edef9a 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -241,6 +241,7 @@ static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape:
sp_object_read_attr(object, "inkscape:window-height");
sp_object_read_attr(object, "inkscape:window-x");
sp_object_read_attr(object, "inkscape:window-y");
+ sp_object_read_attr(object, "inkscape:window-maximized");
sp_object_read_attr(object, "inkscape:snap-global");
sp_object_read_attr(object, "inkscape:snap-bbox");
sp_object_read_attr(object, "inkscape:snap-nodes");
@@ -442,7 +443,11 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va
nv->window_y = value ? atoi(value) : 0;
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_INKSCAPE_SNAP_GLOBAL:
+ case SP_ATTR_INKSCAPE_WINDOW_MAXIMIZED:
+ nv->window_maximized = value ? atoi(value) : 0;
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ break;
+ case SP_ATTR_INKSCAPE_SNAP_GLOBAL:
nv->snap_manager.snapprefs.setSnapEnabledGlobally(value ? sp_str_to_bool(value) : TRUE);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
// restore window size and position stored with the document
if (geometry_from_file) {
- gint w = MIN(gdk_screen_width(), nv->window_width);
- gint h = MIN(gdk_screen_height(), nv->window_height);
- gint x = MIN(gdk_screen_width() - MIN_ONSCREEN_DISTANCE, nv->window_x);
- gint y = MIN(gdk_screen_height() - MIN_ONSCREEN_DISTANCE, nv->window_y);
- if (w>0 && h>0) {
- desktop->setWindowSize(w, h);
- x = MIN(gdk_screen_width() - w, x);
- y = MIN(gdk_screen_height() - h, y);
- desktop->setWindowPosition(Geom::Point(x, y));
- }
+ if (nv->window_maximized) {
+ Gtk::Window *win = desktop->getToplevel();
+ if (win){
+ win->maximize();
+ }
+ } else {
+ gint w = MIN(gdk_screen_width(), nv->window_width);
+ gint h = MIN(gdk_screen_height(), nv->window_height);
+ gint x = MIN(gdk_screen_width() - MIN_ONSCREEN_DISTANCE, nv->window_x);
+ gint y = MIN(gdk_screen_height() - MIN_ONSCREEN_DISTANCE, nv->window_y);
+ if (w>0 && h>0) {
+ desktop->setWindowSize(w, h);
+ x = MIN(gdk_screen_width() - w, x);
+ y = MIN(gdk_screen_height() - h, y);
+ desktop->setWindowPosition(Geom::Point(x, y));
+ }
+ }
}
// restore zoom and view
sp_repr_set_svg_double(view, "inkscape:cy", r.midpoint()[Geom::Y]);
if (save_geometry_in_file) {
- gint w, h, x, y;
+ gint w, h, x, y;
desktop->getWindowGeometry(x, y, w, h);
sp_repr_set_int(view, "inkscape:window-width", w);
sp_repr_set_int(view, "inkscape:window-height", h);
sp_repr_set_int(view, "inkscape:window-x", x);
sp_repr_set_int(view, "inkscape:window-y", y);
+ sp_repr_set_int(view, "inkscape:window-maximized", desktop->is_maximized());
}
view->setAttribute("inkscape:current-layer", SP_OBJECT_ID(desktop->currentLayer()));
diff --git a/src/sp-namedview.h b/src/sp-namedview.h
index 7eafd124934c5a8113a4e498745fc01deba62951..048096d8c0096e569761f332afb9f0d51be03425 100644 (file)
--- a/src/sp-namedview.h
+++ b/src/sp-namedview.h
gint window_height;
gint window_x;
gint window_y;
+ gint window_maximized;
SnapManager snap_manager;
GSList * grids;