summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c980cfb)
raw | patch | inline | side by side (parent: c980cfb)
author | JazzyNico <nicoduf@yahoo.fr> | |
Fri, 21 Jan 2011 13:38:26 +0000 (14:38 +0100) | ||
committer | JazzyNico <nicoduf@yahoo.fr> | |
Fri, 21 Jan 2011 13:38:26 +0000 (14:38 +0100) |
src/extension/dbus/dbus-init.cpp | patch | blob | history | |
src/extension/dbus/document-interface.cpp | patch | blob | history | |
src/extension/dbus/document-interface.h | patch | blob | history |
index 253d6b9383c4e7808fa2d4de49390c706c7d8410..2ae606940d6736c4a3c9d9416f698a17ab4cd449 100644 (file)
DBusGProxy *proxy;
SPDocument *doc;
- doc = sp_document_new(NULL, 1, TRUE);
+ doc = SPDocument::createNewDoc(NULL, 1, TRUE);
std::string name("/org/inkscape/");
- name.append(doc->name);
+ name.append(doc->getName());
std::replace(name.begin(), name.end(), ' ', '_');
connection = dbus_get_connection();
index 836ad33976cb284358636fa65a722587a175ac3f..485e92aa68c7c042486811c817a57608f5fef5f3 100644 (file)
#include "live_effects/parameter/text.h" //text
#include "display/canvas-text.h" //text
+#include "display/sp-canvas.h" //text
+
//#include "2geom/svg-path-parser.h" //get_node_coordinates
/****************************************************************************
/* ALTERNATIVE (is this faster if only repr is needed?)
Inkscape::XML::Node *node = sp_repr_lookup_name((doc->root)->repr, name);
*/
- Inkscape::XML::Node * node = sp_desktop_document(desk)->getObjectById(name)->repr;
+ Inkscape::XML::Node * node = sp_desktop_document(desk)->getObjectById(name)->getRepr();
if (!node)
{
g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OBJECT, "Object '%s' not found in document.", name);
const gchar *
get_name_from_object (SPObject * obj)
{
- return obj->repr->attribute("id");
+ return obj->getRepr()->attribute("id");
}
/*
@@ -218,7 +220,8 @@ finish_create_shape (DocumentInterface *object, GError **error, Inkscape::XML::N
object->desk->currentLayer()->updateRepr();
if (object->updates)
- sp_document_done(sp_desktop_document(object->desk), 0, (gchar *)desc);
+
+ Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), 0, (gchar *)desc);
//else
//document_interface_pause_updates(object, error);
//document_interface_pause_updates (object, error);
sp_action_perform( action, NULL );
if (object->updates)
- sp_document_done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip()));
+ Inkscape::DocumentUndo::done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip()));
//if (!object->updates)
//document_interface_pause_updates (object, error);
return TRUE;
@@ -356,7 +359,7 @@ document_interface_call_verb (DocumentInterface *object, gchar *verbid, GError *
if ( action ) {
sp_action_perform( action, NULL );
if (object->updates) {
- sp_document_done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip()));
+ Inkscape::DocumentUndo::done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip()));
}
}
}
@@ -511,7 +514,7 @@ document_interface_image (DocumentInterface *object, int x, int y, gchar *filena
object->desk->currentLayer()->updateRepr();
if (object->updates)
- sp_document_done(sp_desktop_document(object->desk), 0, "Imported bitmap.");
+ Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), 0, "Imported bitmap.");
//g_free(uri);
return strdup(newNode->attribute("id"));
@@ -528,7 +531,7 @@ gchar *document_interface_node (DocumentInterface *object, gchar *type, GError *
object->desk->currentLayer()->updateRepr();
if (object->updates)
- sp_document_done(sp_desktop_document(object->desk), 0, (gchar *)"created empty node");
+ Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), 0, (gchar *)"created empty node");
//else
//document_interface_pause_updates(object, error);
@@ -541,13 +544,13 @@ gchar *document_interface_node (DocumentInterface *object, gchar *type, GError *
gdouble
document_interface_document_get_width (DocumentInterface *object)
{
- return sp_document_width(sp_desktop_document(object->desk));
+ return sp_desktop_document(object->desk)->getWidth();
}
gdouble
document_interface_document_get_height (DocumentInterface *object)
{
- return sp_document_height(sp_desktop_document(object->desk));
+ return sp_desktop_document(object->desk)->getHeight();
}
gchar *
document_interface_save (DocumentInterface *object, GError **error)
{
SPDocument * doc = sp_desktop_document(object->desk);
- printf("1: %s\n2: %s\n3: %s\n", doc->uri, doc->base, doc->name);
- if (doc->uri)
- return document_interface_save_as (object, doc->uri, error);
+ printf("1: %s\n2: %s\n3: %s\n", doc->getURI(), doc->getBase(), doc->getName());
+ if (doc->getURI())
+ return document_interface_save_as (object, doc->getURI(), error);
return FALSE;
}
const Glib::ustring file(filename);
sp_file_open(file, NULL, TRUE, TRUE);
if (object->updates)
- sp_document_done(sp_desktop_document(object->desk), SP_VERB_FILE_OPEN, "Opened File");
+ Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), SP_VERB_FILE_OPEN, "Opened File");
return TRUE;
}
gboolean
document_interface_save_as (DocumentInterface *object,
- gchar *filename, GError **error)
+ const gchar *filename, GError **error)
{
SPDocument * doc = sp_desktop_document(object->desk);
#ifdef WITH_GNOME_VFS
//sp_desktop_document(object->desk)->root->mflags = TRUE;
//sp_desktop_document(object->desk)->_updateDocument();
//FIXME: use better verb than rect.
- sp_document_done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions");
+ Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions");
}
void
object->desk->disableInteraction();
sp_desktop_document(object->desk)->root->uflags = FALSE;
sp_desktop_document(object->desk)->root->mflags = FALSE;
- //sp_document_done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions");
+ //Inkscape::DocumentUndo::done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions");
}
/****************************************************************************
@@ -982,7 +985,7 @@ document_interface_selection_get (DocumentInterface *object, char ***out, GError
int i = 0;
for (GSList const *iter = oldsel; iter != NULL; iter = iter->next) {
- (*out)[i] = g_strdup(SP_OBJECT(iter->data)->repr->attribute("id"));
+ (*out)[i] = g_strdup(SP_OBJECT(iter->data)->getRepr()->attribute("id"));
i++;
}
(*out)[i] = NULL;
if (!next)
return FALSE;
- if (strcmp("layer", (next->repr)->attribute("inkscape:groupmode")) == 0) {
+ if (strcmp("layer", (next->getRepr())->attribute("inkscape:groupmode")) == 0) {
sp_selection_cut(dt);
index 8cf9b7ec1b555bea77e11f07a6e3fcaeca4c9491..ac9fd11c1390a3e3dbfec66c323b06b0faad39da 100644 (file)
gboolean
document_interface_save_as (DocumentInterface *object,
- gchar *filename, GError **error);
+ const gchar *filename, GError **error);
gboolean
document_interface_mark_as_unmodified (DocumentInterface *object, GError **error);