From 8cc78f28c64c4aee0621de6e727e39b64530dd1f Mon Sep 17 00:00:00 2001 From: rodolforg Date: Fri, 28 May 2021 00:06:55 -0300 Subject: [PATCH 1/7] Create how_to_create_a_synfigapp_action.rst --- .../how_to_create_a_synfigapp_action.rst | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 docs/tutorials/how_to_create_a_synfigapp_action.rst diff --git a/docs/tutorials/how_to_create_a_synfigapp_action.rst b/docs/tutorials/how_to_create_a_synfigapp_action.rst new file mode 100644 index 0000000..08bf69a --- /dev/null +++ b/docs/tutorials/how_to_create_a_synfigapp_action.rst @@ -0,0 +1,104 @@ +How to add new synfigapp Action +=============================== + +This is a tutorial based on what I did to solve issue `#2005 `_. + +About synfigapp +--------------- + +First things first: what is ``synfigapp``? It is an intermediate API to 'interactively' handle a synfig animation/document. +It deals with stuff like layer creation, layer up/down movement (z-depth), layer parameter setting, action history, layer selection, etc. +In summary, 'everything' that should be done/changed in a Synfig animation document. This kind of stuff is called Action. And there are so many of them, more than 100! +``synfigapp`` is also responsible to emit some signals at each action. Therefore, it is a 'perfect' glue between the synfig document and an interactive application that uses or creates it. + +Synfig Studio is a GUI built on top of synfigapp and should not change a synfig file directly. +For example, when a user renames a layer in Layers Panel, the GUI calls an synfigapp action to rename it instead of using the synfig library directly. +One important reason to do it via synfigapp is the handling of action history (made by synfigapp), that allows user undo the last action(s). + +How does Synfig Studio work? +---------------------------- + +The issue I mentioned above I want to solve is about move the origin point of a region/outline/advanced outline layer to its geometric center. +As it is a modification of a synfig layer parameter value, it should be done via a ``synfigapp::Action``, and I will show here how to create it and +how Synfig Studio will be able to provide it and call it. + +When user right-clicks on a layer visual handle (like tangent, origin, vertex, etc.), the Workarea class detects the mouse button pressing event, +realizes that it was over a handle (Synfig Studio internally calls it 'duck') and dispatches the event to the duck object. +The event detection is done in ``bool studio::WorkArea::on_drawing_area_event(GdkEvent *event)`` and the dispatch is via ``void studio::Duck::signal_user_click(int button_num)``. + +Each handle (duck) type may react to this signal calling differently, but it is pretty common to they call ``studio::CanvasView::popup_param_menu()`` passing +as argument what layer parameter they affect. In its turn, it calls ``studio::CanvasView::make_param_menu()`` that, in short, scans all synfigapp actions and +ask each one if they are a action candidate to deal with that layer parameter/value node. + +At his point, Studio pops up a context menu with all related actions (and some other special stuff). +When user selects a menu item, ``void Instance::process_action(synfig::String action_name, synfigapp::Action::ParamList param_list)`` is called, +where it may ask user for some confirmation or for extra info and then check if the action tells it is ready. Finally, the action is performed. + +synfigapp Actions +----------------- + +There are 4 types of Action: +* Base +* Undoable (< Base) +* CanvasSpecific +* Super (< Base, CanvasSpecific) +* Group (< Super) + + +One of the first things to do is to decide what is the base class for our new Action: + + +Now let's create the new files ``origintocenter.h`` and ``origintocenter.cpp``: they will be placed under ``synfig-studio/src/synfigapp/actions`` folder. + +Next I registered in the building system files. As we support Autotools and CMake, we have to edit: + +* ``synfig-studio/src/synfigapp/Makefile.am`` +* ``synfig-studio/src/synfigapp/actions/CMakeLists.txt`` + +And register the action in ``synfigapp::Action`` book. For now, the only way is directly in ``syfigapp::Action::Main()`` method (in file ``synfig-studio/src/synfigapp/action.cpp``). + +Next I'll start to implement the new action class. The essencial methods are shown below: + +* virtual synfig::String get_name() const; + The internal action name. Must be unique. Used for creating action instances by name (``synfigapp::Action::create(const synfig::String& name)``). + The recommended way to declare and implement it is via ACTION_ macros listed below. +* static Action::Base* create(); + Factory for creating this action later configured via ``set_param()`` if needed. + The recommended way to declare and implement it is via ACTION_ macros listed below. +* static bool is_candidate(const ParamList &x); + Checks the ParamList to see if this action could be performed with given parameters. +* static ParamVocab get_param_vocab(); + Yields the ParamVocab object which describes what parameters this action needs before it can perform the act. +* bool set_param(const synfig::String& name, const Param &); + The action implementation receives the parameter values by this method. +* virtual bool is_ready() const; + Check if the current parameter list set for action is enough and it would be ok to call ``perform()`` +* virtual void perform(); + As name says, this method does what action is supposed to do. + It must throw an ``Action::Error`` on failure +* virtual void undo(); + If this action class is derived from synfigapp::Action::Undoable, it must implement here how to undo it. + + + + + ACTION_MODULE_EXT + + ACTION_INIT(class) + ACTION_SET_NAME(Action::ActivepointSet,"ActivepointSet"); +ACTION_SET_LOCAL_NAME(Action::ActivepointSet,N_("Set Activepoint")); +ACTION_SET_TASK(Action::ActivepointSet,"set"); +ACTION_SET_CATEGORY(Action::ActivepointSet,Action::CATEGORY_ACTIVEPOINT); +ACTION_SET_PRIORITY(Action::ActivepointSet,0); +ACTION_SET_VERSION(Action::ActivepointSet,"0.0"); +.. code-block:: cpp + + static ParamVocab get_param_vocab(); + static bool is_candidate(const ParamList &x); + + virtual bool is_ready()const; + + virtual void perform(); + virtual void undo(); + + ACTION_MODULE_EXT From afd022aed35824d2245135950d1d394162ffb817 Mon Sep 17 00:00:00 2001 From: rodolforg Date: Fri, 28 May 2021 00:10:50 -0300 Subject: [PATCH 2/7] Update how_to_create_a_synfigapp_action.rst --- docs/tutorials/how_to_create_a_synfigapp_action.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/how_to_create_a_synfigapp_action.rst b/docs/tutorials/how_to_create_a_synfigapp_action.rst index 08bf69a..348fb2b 100644 --- a/docs/tutorials/how_to_create_a_synfigapp_action.rst +++ b/docs/tutorials/how_to_create_a_synfigapp_action.rst @@ -22,15 +22,15 @@ The issue I mentioned above I want to solve is about move the origin point of a As it is a modification of a synfig layer parameter value, it should be done via a ``synfigapp::Action``, and I will show here how to create it and how Synfig Studio will be able to provide it and call it. -When user right-clicks on a layer visual handle (like tangent, origin, vertex, etc.), the Workarea class detects the mouse button pressing event, +When user right-clicks on a layer visual handle (like tangent, origin, vertex, etc.), the ``Workarea`` class detects the mouse button pressing event, realizes that it was over a handle (Synfig Studio internally calls it 'duck') and dispatches the event to the duck object. The event detection is done in ``bool studio::WorkArea::on_drawing_area_event(GdkEvent *event)`` and the dispatch is via ``void studio::Duck::signal_user_click(int button_num)``. -Each handle (duck) type may react to this signal calling differently, but it is pretty common to they call ``studio::CanvasView::popup_param_menu()`` passing -as argument what layer parameter they affect. In its turn, it calls ``studio::CanvasView::make_param_menu()`` that, in short, scans all synfigapp actions and -ask each one if they are a action candidate to deal with that layer parameter/value node. +Each handle (duck) type may react to this signal calling differently, but it is pretty common to they call ``studio::CanvasView::popup_param_menu()`` and pass, +as method argument, what layer parameter they affect. +In its turn, it calls ``studio::CanvasView::make_param_menu()`` that, in short, scans all synfigapp actions and ask each one if it is a candidate to deal with that layer parameter/value node. -At his point, Studio pops up a context menu with all related actions (and some other special stuff). +At this point, Studio pops up a context menu with all related actions (and some other special stuff). When user selects a menu item, ``void Instance::process_action(synfig::String action_name, synfigapp::Action::ParamList param_list)`` is called, where it may ask user for some confirmation or for extra info and then check if the action tells it is ready. Finally, the action is performed. @@ -38,6 +38,7 @@ synfigapp Actions ----------------- There are 4 types of Action: + * Base * Undoable (< Base) * CanvasSpecific From 769f0d7af5c20bff72594f58f168ef33be3f1fcd Mon Sep 17 00:00:00 2001 From: rodolforg Date: Fri, 28 May 2021 02:30:33 -0300 Subject: [PATCH 3/7] Update how_to_create_a_synfigapp_action.rst --- .../how_to_create_a_synfigapp_action.rst | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/tutorials/how_to_create_a_synfigapp_action.rst b/docs/tutorials/how_to_create_a_synfigapp_action.rst index 348fb2b..2d341d1 100644 --- a/docs/tutorials/how_to_create_a_synfigapp_action.rst +++ b/docs/tutorials/how_to_create_a_synfigapp_action.rst @@ -2,25 +2,25 @@ How to add new synfigapp Action =============================== This is a tutorial based on what I did to solve issue `#2005 `_. +This feature request is about the possibility of moving the origin point of a region/outline/advanced outline layer to its geometric center. +This document will describe how to create this feature and how to make Synfig Studio able to show it to user. + +As the key point on the feature request is a modification of a synfig layer parameter value, it should be done via a (new) ``synfigapp::Action``. About synfigapp --------------- First things first: what is ``synfigapp``? It is an intermediate API to 'interactively' handle a synfig animation/document. -It deals with stuff like layer creation, layer up/down movement (z-depth), layer parameter setting, action history, layer selection, etc. -In summary, 'everything' that should be done/changed in a Synfig animation document. This kind of stuff is called Action. And there are so many of them, more than 100! +It deals with stuff like layer creation, layer up/down movement (z-depth), layer parameter setting, action history, layer selection, canvas resizing, etc. +In other words, 'everything' that should be done/changed in a Synfig animation document. This kind of stuff is called Action. And there are so many of them, more than 100! ``synfigapp`` is also responsible to emit some signals at each action. Therefore, it is a 'perfect' glue between the synfig document and an interactive application that uses or creates it. Synfig Studio is a GUI built on top of synfigapp and should not change a synfig file directly. For example, when a user renames a layer in Layers Panel, the GUI calls an synfigapp action to rename it instead of using the synfig library directly. One important reason to do it via synfigapp is the handling of action history (made by synfigapp), that allows user undo the last action(s). -How does Synfig Studio work? ----------------------------- - -The issue I mentioned above I want to solve is about move the origin point of a region/outline/advanced outline layer to its geometric center. -As it is a modification of a synfig layer parameter value, it should be done via a ``synfigapp::Action``, and I will show here how to create it and -how Synfig Studio will be able to provide it and call it. +How does Synfig Studio work in this regard? +------------------------------------------- When user right-clicks on a layer visual handle (like tangent, origin, vertex, etc.), the ``Workarea`` class detects the mouse button pressing event, realizes that it was over a handle (Synfig Studio internally calls it 'duck') and dispatches the event to the duck object. @@ -34,17 +34,21 @@ At this point, Studio pops up a context menu with all related actions (and some When user selects a menu item, ``void Instance::process_action(synfig::String action_name, synfigapp::Action::ParamList param_list)`` is called, where it may ask user for some confirmation or for extra info and then check if the action tells it is ready. Finally, the action is performed. +In conclusion, the new ``synfigapp::Action`` must be able to provide what data (layers, parameters/valuenodes, etc.) it expects, to provide a name/label to be used in GUI, to check if it is a candidate for current user context, and to do (and hopefully undo) the action itself. + synfigapp Actions ----------------- +As we now know what any synfigapp action should do, let us explore how they are structured in synfigapp. + There are 4 types of Action: -* Base -* Undoable (< Base) -* CanvasSpecific -* Super (< Base, CanvasSpecific) -* Group (< Super) +* synfigapp::Action::Base – obviously the base for any action +* synfigapp::Action::Undoable (derived from synfigapp::Action::Base) – adds the ``undo()`` method +* synfigapp::Action::Super (derived from synfigapp::Action::Base and synfigapp::Action::CanvasSpecific) – it is, actually, a sequence of other actions +* synfigapp::Action::Group (derived from synfigapp::Action::Super) – ? +synfigapp::Action::CanvasSpecific is a 'interface' to provide basic and standard support to those actions that must be used on a specific Canvas. Any action that modifies layers, valuenodes, etc. would inherit this class. And it is very important to inherit synfigapp::Action::Undoable, because it is the way synfigapp knows the action is… undoable. Thus, many actions explicitly inherit both classes, if they aren't already based on synfigapp::Action::Super. One of the first things to do is to decide what is the base class for our new Action: From cb17d9fa0d782f29cfeb7a1a35194a846661d4af Mon Sep 17 00:00:00 2001 From: rodolforg Date: Fri, 28 May 2021 05:42:25 -0300 Subject: [PATCH 4/7] Update how_to_create_a_synfigapp_action.rst --- .../how_to_create_a_synfigapp_action.rst | 93 +++++++++++-------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/docs/tutorials/how_to_create_a_synfigapp_action.rst b/docs/tutorials/how_to_create_a_synfigapp_action.rst index 2d341d1..170d34b 100644 --- a/docs/tutorials/how_to_create_a_synfigapp_action.rst +++ b/docs/tutorials/how_to_create_a_synfigapp_action.rst @@ -50,60 +50,73 @@ There are 4 types of Action: synfigapp::Action::CanvasSpecific is a 'interface' to provide basic and standard support to those actions that must be used on a specific Canvas. Any action that modifies layers, valuenodes, etc. would inherit this class. And it is very important to inherit synfigapp::Action::Undoable, because it is the way synfigapp knows the action is… undoable. Thus, many actions explicitly inherit both classes, if they aren't already based on synfigapp::Action::Super. -One of the first things to do is to decide what is the base class for our new Action: +Here is the mandatory methods to be implemented for 'any' Action (defined in ``synfigapp/action.h``): +========== =========================================================== ========================= +Base Class Method Description +========== =========================================================== ========================= +Base virtual synfig::String get_name() const; The internal action name. Must be unique. + Used for creating action instances by name (``synfigapp::Action::create(const synfig::String& name)``). -Now let's create the new files ``origintocenter.h`` and ``origintocenter.cpp``: they will be placed under ``synfig-studio/src/synfigapp/actions`` folder. + The recommended way to declare and implement it is via ACTION_ macros listed below. -Next I registered in the building system files. As we support Autotools and CMake, we have to edit: +Base static Action::Base* create(); Factory for creating this action later configured via ``set_param()`` if needed. -* ``synfig-studio/src/synfigapp/Makefile.am`` -* ``synfig-studio/src/synfigapp/actions/CMakeLists.txt`` + The recommended way to declare and implement it is via ACTION_ macros listed below. -And register the action in ``synfigapp::Action`` book. For now, the only way is directly in ``syfigapp::Action::Main()`` method (in file ``synfig-studio/src/synfigapp/action.cpp``). +Base static bool is_candidate(const ParamList &x); Checks the ParamList to see if this action could be performed with given parameters. -Next I'll start to implement the new action class. The essencial methods are shown below: +Base static ParamVocab get_param_vocab(); Yields the ParamVocab object which describes what parameters this action needs before + it can perform the act. -* virtual synfig::String get_name() const; - The internal action name. Must be unique. Used for creating action instances by name (``synfigapp::Action::create(const synfig::String& name)``). - The recommended way to declare and implement it is via ACTION_ macros listed below. -* static Action::Base* create(); - Factory for creating this action later configured via ``set_param()`` if needed. - The recommended way to declare and implement it is via ACTION_ macros listed below. -* static bool is_candidate(const ParamList &x); - Checks the ParamList to see if this action could be performed with given parameters. -* static ParamVocab get_param_vocab(); - Yields the ParamVocab object which describes what parameters this action needs before it can perform the act. -* bool set_param(const synfig::String& name, const Param &); - The action implementation receives the parameter values by this method. -* virtual bool is_ready() const; - Check if the current parameter list set for action is enough and it would be ok to call ``perform()`` -* virtual void perform(); - As name says, this method does what action is supposed to do. - It must throw an ``Action::Error`` on failure -* virtual void undo(); - If this action class is derived from synfigapp::Action::Undoable, it must implement here how to undo it. +Base bool set_param(const synfig::String& name, const Param& v); The action implementation receives the value ``v`` for parameter ``name`` by this method. +Base virtual bool is_ready() const; Check if the current parameter list set for action is enough and + it would be ok to call ``perform()`` +Base virtual void perform(); As name says, this method does what action is supposed to do. - + It must throw an ``Action::Error`` on failure + +Undoable virtual void undo(); If this action class is derived from synfigapp::Action::Undoable, + it must implement here how to undo it. + +Super virtual void prepare(); This method is responsible to make the sequence of actions to be performed. + + From the parameters set by e.g. ``set_param()``, it will create the needed actions + that will compound the action sequence. +========== =========================================================== ========================= + +Helper macros (provided by ``synfigapp/action.h``): + +.. code-block:: cpp + + // Inside class declaration ACTION_MODULE_EXT - ACTION_INIT(class) + // In class implementation file (example: class Action::ActivepointSet) + ACTION_INIT(Action::ActivepointSet) ACTION_SET_NAME(Action::ActivepointSet,"ActivepointSet"); -ACTION_SET_LOCAL_NAME(Action::ActivepointSet,N_("Set Activepoint")); -ACTION_SET_TASK(Action::ActivepointSet,"set"); -ACTION_SET_CATEGORY(Action::ActivepointSet,Action::CATEGORY_ACTIVEPOINT); -ACTION_SET_PRIORITY(Action::ActivepointSet,0); -ACTION_SET_VERSION(Action::ActivepointSet,"0.0"); -.. code-block:: cpp + ACTION_SET_LOCAL_NAME(Action::ActivepointSet,N_("Set Activepoint")); + ACTION_SET_TASK(Action::ActivepointSet,"set"); + ACTION_SET_CATEGORY(Action::ActivepointSet,Action::CATEGORY_ACTIVEPOINT); + ACTION_SET_PRIORITY(Action::ActivepointSet,0); + ACTION_SET_VERSION(Action::ActivepointSet,"0.0"); + +Solving the issue +----------------- + +One of the first things to do is to decide what is the base class for our new Action: + + +Now let's create the new files ``origintocenter.h`` and ``origintocenter.cpp``: they will be placed under ``synfig-studio/src/synfigapp/actions`` folder. - static ParamVocab get_param_vocab(); - static bool is_candidate(const ParamList &x); +Next I registered in the building system files. As we support Autotools and CMake, we have to edit: - virtual bool is_ready()const; +* ``synfig-studio/src/synfigapp/Makefile.am`` +* ``synfig-studio/src/synfigapp/actions/CMakeLists.txt`` - virtual void perform(); - virtual void undo(); +And register the action in ``synfigapp::Action`` book. For now, the only way is directly in ``syfigapp::Action::Main()`` method (in file ``synfig-studio/src/synfigapp/action.cpp``). + +Next I'll start to implement the new action class. The essencial methods are shown below: - ACTION_MODULE_EXT From 07f09889a0f66cd3f22b3d1835f49ded60e47c76 Mon Sep 17 00:00:00 2001 From: rodolforg Date: Fri, 28 May 2021 05:50:21 -0300 Subject: [PATCH 5/7] Update how_to_create_a_synfigapp_action.rst --- docs/tutorials/how_to_create_a_synfigapp_action.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/how_to_create_a_synfigapp_action.rst b/docs/tutorials/how_to_create_a_synfigapp_action.rst index 170d34b..b279cf0 100644 --- a/docs/tutorials/how_to_create_a_synfigapp_action.rst +++ b/docs/tutorials/how_to_create_a_synfigapp_action.rst @@ -1,5 +1,5 @@ -How to add new synfigapp Action -=============================== +How to create a new synfigapp Action +==================================== This is a tutorial based on what I did to solve issue `#2005 `_. This feature request is about the possibility of moving the origin point of a region/outline/advanced outline layer to its geometric center. From f3513bdbe1c7a48502dafaeeb21f7e378692b82e Mon Sep 17 00:00:00 2001 From: rodolforg Date: Sat, 29 May 2021 07:47:08 -0300 Subject: [PATCH 6/7] Update how_to_create_a_synfigapp_action.rst --- .../how_to_create_a_synfigapp_action.rst | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/how_to_create_a_synfigapp_action.rst b/docs/tutorials/how_to_create_a_synfigapp_action.rst index b279cf0..4590ad2 100644 --- a/docs/tutorials/how_to_create_a_synfigapp_action.rst +++ b/docs/tutorials/how_to_create_a_synfigapp_action.rst @@ -106,17 +106,53 @@ Helper macros (provided by ``synfigapp/action.h``): Solving the issue ----------------- -One of the first things to do is to decide what is the base class for our new Action: +The logic for the new action +............................ +The new action purpose is to move the origin point of a region/outline/advanced outline layer to its geometric center. +Let us assume the layer geometric center is the center of its (AABB) bounding rectangle (that one shown on Synfig Studio when you select the layer). +It may be a problem for convex or concave shapes. However, for simplicity sake of this documentation, I will adopt this concept. -Now let's create the new files ``origintocenter.h`` and ``origintocenter.cpp``: they will be placed under ``synfig-studio/src/synfigapp/actions`` folder. +Synfig Studio let user create geometric shapes by its tools Circle, Rectangle, Star, Polygon and Spline. Internally they use Layer_Circle, Layer_Polygon, Rectangle, Star, Region, Outline and Advanced_Outline layers. All of them are (directly or indirectly) derived from Layer_Shape class. +From this list, Layer_Circle and Star always have their origin point set at their geometric center. Layer_Ractangle does not have an origin parameter. So the focus is the layers Layer_Polygon, Region, Outline and Advanced_Outline. -Next I registered in the building system files. As we support Autotools and CMake, we have to edit: +Layer_Shape has the convenient method ``Rect Layer_Shape::get_bounding_rect()``. So deriving the geometric center of those layers is pretty easy. + +The new action parameters +......................... + +The action shall receive the origin parameter that should be displaced. From this information, it can retrieve the layer it belongs to and access the mentioned method. Once computed the new origin position, it should set the origin parameter value. + +However, if the origin has a new value set, all vertices will rendered in a new place, as their coordinates are relative to origin point. Therefore it is necessary to change (by a constant offset) the coordinates of all vertices. Layer_Poligon stores them in 'vector_list' parameter; the others in 'bline' parameter. + +The new action base class +......................... + +The action is specific to a canvas (the one the layer is on), so it must be derived from auxiliar class ``synfigapp::Action::CanvasSpecific``. + +It is obvious the action can be undoable, so ``synfigapp::Action::Undoable`` must be a base class too for it. + +Obviously, synfigapp already has an action for setting a layer parameter. It is called ValueDescSet. We could reuse it, as we have to change a lot of parameters, instead of repeting code. That would also avoid we having to handle the undo method, as ValueDescSet already know to undo. + +If we are reusing an existent action (and several times: origin + vertices), we should use as our base class for action the ``synfig::Action::Super`` class only, as it is derived from ``synfigapp::Action::Undoable`` and ``synfigapp::Action::CanvasSpecific`` and the main reason: it handles sequence of existent actions. + +Creating the new action class and its files +........................................... + +The new class will be named as OriginToShapeCenter, following the action naming convention: `camel case `_. I chose OriginToShapeCenter because OriginToCenter is too much generic: it could mean canvas center, for example. + +The filenames will be ``origintoshapecenter.h`` and ``origintoshapecenter.cpp``, as the convention used for synfigapp action files are the action name in snake_case, but (ugh) without the underscore ``_``. They will be placed under ``synfig-studio/src/synfigapp/actions`` folder. + +The new files must be registered in the building systems. As we support Autotools and CMake, we have to edit the following files: * ``synfig-studio/src/synfigapp/Makefile.am`` * ``synfig-studio/src/synfigapp/actions/CMakeLists.txt`` -And register the action in ``synfigapp::Action`` book. For now, the only way is directly in ``syfigapp::Action::Main()`` method (in file ``synfig-studio/src/synfigapp/action.cpp``). +We have to edit an extra file too, related to i18n: ``synfig-studio/po/POTFILES.in``. + +Note: Don't forget to regenerate the Makefiles due to this change. If you are using the building scripts provided by synfig project, run ``./2-build-production.sh studio build`` once. It is only required because we changed a Makefile.am and/or CMakeLists.txt. + -Next I'll start to implement the new action class. The essencial methods are shown below: +DRAFT +..... From 85bf1bc4bc1d9271c373aa926d448a856e28bcaf Mon Sep 17 00:00:00 2001 From: rodolforg Date: Fri, 7 Jan 2022 00:11:40 -0300 Subject: [PATCH 7/7] Update how_to_create_a_synfigapp_action.rst --- docs/tutorials/how_to_create_a_synfigapp_action.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/how_to_create_a_synfigapp_action.rst b/docs/tutorials/how_to_create_a_synfigapp_action.rst index 4590ad2..a8c9505 100644 --- a/docs/tutorials/how_to_create_a_synfigapp_action.rst +++ b/docs/tutorials/how_to_create_a_synfigapp_action.rst @@ -45,10 +45,10 @@ There are 4 types of Action: * synfigapp::Action::Base – obviously the base for any action * synfigapp::Action::Undoable (derived from synfigapp::Action::Base) – adds the ``undo()`` method -* synfigapp::Action::Super (derived from synfigapp::Action::Base and synfigapp::Action::CanvasSpecific) – it is, actually, a sequence of other actions +* synfigapp::Action::Super (derived from synfigapp::Action::Undoable and synfigapp::Action::CanvasSpecific) – it is, actually, a sequence of other actions * synfigapp::Action::Group (derived from synfigapp::Action::Super) – ? -synfigapp::Action::CanvasSpecific is a 'interface' to provide basic and standard support to those actions that must be used on a specific Canvas. Any action that modifies layers, valuenodes, etc. would inherit this class. And it is very important to inherit synfigapp::Action::Undoable, because it is the way synfigapp knows the action is… undoable. Thus, many actions explicitly inherit both classes, if they aren't already based on synfigapp::Action::Super. +synfigapp::Action::CanvasSpecific is an 'interface' to provide basic and standard support to those actions that must be used on a specific Canvas. Any action that modifies layers, valuenodes, etc. would inherit this class. And it is very important to inherit synfigapp::Action::Undoable, because it is the way synfigapp knows the action is… undoable. Thus, many actions explicitly inherit both classes, if they aren't already based on synfigapp::Action::Super. Here is the mandatory methods to be implemented for 'any' Action (defined in ``synfigapp/action.h``):