summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2a4dc2)
raw | patch | inline | side by side (parent: c2a4dc2)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Thu, 1 Mar 2007 07:14:33 +0000 (07:14 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Thu, 1 Mar 2007 07:14:33 +0000 (07:14 +0000) |
Selection is working too!
src/main.cpp | patch | blob | history |
diff --git a/src/main.cpp b/src/main.cpp
index 9a6dc0b769394094d51199566c4528657f8eccd9..d9e3138f956ece14f226c6e4e5d410d650388c0e 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
#include <ui/view/view.h>
#include <desktop.h>
+#include <desktop-handles.h>
#include <helper/action.h>
+#include <selection.h>
class CmdLineAction {
gint _type;
}
void doIt (Inkscape::UI::View::View * view) {
- printf("Doing: %s\n", _arg);
+ //printf("Doing: %s\n", _arg);
switch (_type) {
case SP_ARG_VERB: {
Inkscape::Verb * verb = Inkscape::Verb::getbyid(_arg);
if (verb == NULL) {
printf(_("Unable to find verb ID '%s' specified on the command line.\n"), _arg);
+ break;
}
SPAction * action = verb->get_action(view);
sp_action_perform(action, NULL);
break;
}
case SP_ARG_SELECT: {
+ SPDesktop * desktop = dynamic_cast<SPDesktop *>(view);
+ if (desktop == NULL) { break; }
+
+ SPDocument * doc = view->doc();
+ SPObject * obj = doc->getObjectById(_arg);
+ if (obj == NULL) {
+ printf("Unable to find node ID: '%s'\n", _arg);
+ break;
+ }
+ Inkscape::Selection * selection = sp_desktop_selection(desktop);
+ selection->add(obj, false);
break;
}
}