Lines Matching defs:action

51 #include "helper/action.h"
52 #include "helper/action-context.h"
101 gchar *sp_action_get_title(SPAction const *action)
103 char const *src = action->name;
127 static void perform(SPAction *action, void *mydata);
146 static void perform(SPAction *action, void *mydata);
165 static void perform(SPAction *action, void *mydata);
184 static void perform(SPAction *action, void *mydata);
203 static void perform(SPAction *action, void *mydata);
222 static void perform(SPAction *action, void *mydata);
241 static void perform(SPAction *action, void *mydata);
260 static void perform(SPAction *action, void *mydata);
280 static void perform(SPAction *action, void *mydata);
299 static void perform(SPAction *action, void *mydata);
318 static void perform(SPAction *action, void *mydata);
337 static void perform(SPAction *action, void *mydata);
406 * @param context Which context the action should be created for.
416 * Create an action for a \c FileVerb.
419 * @param context Which context the action should be created for.
420 * @return The built action.
429 * Create an action for a \c EditVerb.
433 * @param context Which context the action should be created for.
434 * @return The built action.
443 * Create an action for a \c SelectionVerb.
447 * @param context Which context the action should be created for.
448 * @return The built action.
456 * Create an action for a \c LayerVerb.
460 * @param context Which context the action should be created for.
461 * @return The built action.
469 * Create an action for a \c ObjectVerb.
473 * @param context Which context the action should be created for.
474 * @return The built action.
482 * Create an action for a \c TagVerb.
486 * @param view Which view the action should be created for.
487 * @return The built action.
495 * Create an action for a \c ContextVerb.
499 * @param context Which context the action should be created for.
500 * @return The built action.
508 * Create an action for a \c ZoomVerb.
512 * @param context Which context the action should be created for.
513 * @return The built action.
521 * Create an action for a \c DialogVerb.
525 * @param context Which context the action should be created for.
526 * @return The built action.
534 * Create an action for a \c HelpVerb.
538 * @param context Which context the action should be created for.
539 * @return The built action.
547 * Create an action for a \c TutorialVerb.
551 * @param context Which context the action should be created for.
552 * @return The built action.
560 * Create an action for a \c TextVerb.
564 * @param context Which context the action should be created for.
565 * @return The built action.
577 * it allocates and creates the action. When it does this it
580 * if the action gets crated, a listener is added to the action with
583 * @param context Which context the action should be created for.
585 * @return The created action.
589 SPAction *action;
591 //std::cout << "Adding action: " << _code << std::endl;
592 action = sp_action_new(context, _id, _(_name),
595 if (action == NULL) return NULL;
597 action->signal_perform.connect(
602 action));
604 return action;
608 * A function to get an action if it exists, or otherwise to build it.
610 * This function will get the action for a given view for this verb. It
615 * If the action is created, it's sensitivity must be determined. The
616 * default for a new action is that it is sensitive. If the value in
624 * @param context The action context which this action relates to.
625 * @return The action, or NULL if there is an error.
629 SPAction *action = NULL;
637 action = action_found->second;
639 action = this->make_action(context);
641 // if (action == NULL) printf("Hmm, NULL in %s\n", _name);
642 if (action == NULL) printf("Hmm, NULL in %s\n", _name);
644 sp_action_set_sensitive(action, 0);
650 sp_action_set_sensitive(action, cur_action->second->sensitive);
656 _actions->insert(ActionTable::value_type(context.getView(), action));
659 return action;
663 bool Verb::ensure_desktop_valid(SPAction *action)
665 if (sp_action_get_desktop(action) != NULL) {
668 g_printerr("WARNING: ignoring verb %s - GUI required for this verb.\n", action->id);
736 * A function to remove the action associated with a view.
738 * This function looks for the action in \c _actions. If it is
739 * found then it is unreferenced and the entry in the action
758 SPAction *action = action_found->second;
760 g_object_unref(action);
849 * Decode the verb code and take appropriate action.
851 void FileVerb::perform(SPAction *action, void *data)
855 SPDocument *doc = sp_action_get_document(action);
874 g_return_if_fail(ensure_desktop_valid(action));
875 SPDesktop *desktop = sp_action_get_desktop(action);
934 * Decode the verb code and take appropriate action.
936 void EditVerb::perform(SPAction *action, void *data)
942 sp_edit_clear_all(sp_action_get_selection(action));
952 g_return_if_fail(ensure_desktop_valid(action));
953 SPDesktop *dt = sp_action_get_desktop(action);
1102 * Decode the verb code and take appropriate action.
1104 void SelectionVerb::perform(SPAction *action, void *data)
1106 Inkscape::Selection *selection = sp_action_get_selection(action);
1107 SPDesktop *dt = sp_action_get_desktop(action);
1166 g_return_if_fail(ensure_desktop_valid(action));
1249 * Decode the verb code and take appropriate action.
1251 void LayerVerb::perform(SPAction *action, void *data)
1253 g_return_if_fail(ensure_desktop_valid(action));
1254 SPDesktop *dt = sp_action_get_desktop(action);
1475 * Decode the verb code and take appropriate action.
1477 void ObjectVerb::perform( SPAction *action, void *data)
1479 SPDesktop *dt = sp_action_get_desktop(action);
1480 Inkscape::Selection *sel = sp_action_get_selection(action);
1496 g_return_if_fail(ensure_desktop_valid(action));
1572 * Decode the verb code and take appropriate action.
1574 void TagVerb::perform( SPAction *action, void *data)
1576 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1609 * Decode the verb code and take appropriate action.
1611 void ContextVerb::perform(SPAction *action, void *data)
1617 g_return_if_fail(ensure_desktop_valid(action));
1618 dt = sp_action_get_desktop(action);
1627 SPAction *tool_action= get((sp_verb_t)vidx)->get_action(action->context);
1820 * Decode the verb code and take appropriate action.
1822 void TextVerb::perform(SPAction *action, void */*data*/)
1824 g_return_if_fail(ensure_desktop_valid(action));
1825 SPDesktop *dt = sp_action_get_desktop(action);
1834 * Decode the verb code and take appropriate action.
1836 void ZoomVerb::perform(SPAction *action, void *data)
1838 g_return_if_fail(ensure_desktop_valid(action));
1839 SPDesktop *dt = sp_action_get_desktop(action);
2009 * Decode the verb code and take appropriate action.
2011 void DialogVerb::perform(SPAction *action, void *data)
2018 g_return_if_fail(ensure_desktop_valid(action));
2019 SPDesktop *dt = sp_action_get_desktop(action);
2129 * Decode the verb code and take appropriate action.
2131 void HelpVerb::perform(SPAction *action, void *data)
2133 g_return_if_fail(ensure_desktop_valid(action));
2134 SPDesktop *dt = sp_action_get_desktop(action);
2165 * Decode the verb code and take appropriate action.
2167 void TutorialVerb::perform(SPAction *action, void *data)
2169 g_return_if_fail(ensure_desktop_valid(action));
2224 static void perform(SPAction *action, void *mydata);
2241 * Create an action for a \c EffectLastVerb.
2245 * @param context Which context the action should be created for.
2246 * @return The built action.
2254 * Decode the verb code and take appropriate action.
2256 void EffectLastVerb::perform(SPAction *action, void *data)
2258 g_return_if_fail(ensure_desktop_valid(action));
2259 Inkscape::UI::View::View *current_view = sp_action_get_view(action);
2287 static void perform(SPAction *action, void *mydata);
2304 * Create an action for a \c FitCanvasVerb.
2308 * @param context Which context the action should be created for.
2309 * @return The built action.
2313 SPAction *action = make_action_helper(context, &perform);
2314 return action;
2318 * Decode the verb code and take appropriate action.
2320 void FitCanvasVerb::perform(SPAction *action, void *data)
2322 g_return_if_fail(ensure_desktop_valid(action));
2323 SPDesktop *dt = sp_action_get_desktop(action);
2353 static void perform(SPAction *action, void *mydata);
2370 * Create an action for a \c LockAndHideVerb.
2374 * @param context Which context the action should be created for.
2375 * @return The built action.
2379 SPAction *action = make_action_helper(context, &perform);
2380 return action;
2384 * Decode the verb code and take appropriate action.
2386 void LockAndHideVerb::perform(SPAction *action, void *data)
2388 g_return_if_fail(ensure_desktop_valid(action));
2389 SPDesktop *dt = sp_action_get_desktop(action);
2460 new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"),
2463 N_("Do again the last undone action"), INKSCAPE_ICON("edit-redo")),