Difference between revisions of "Using xverbs"
(initial version) |
(add formating and verbs list info) |
||
Line 1: | Line 1: | ||
== Using == | |||
inkscape --xverbs=xverbs.yaml | inkscape --xverbs=xverbs.yaml | ||
Format of xverbs.yaml | '''Format of xverbs.yaml:''' | ||
<pre> | |||
# only "verbose: yes" enable logging | |||
verbose: yes | |||
run: | run: | ||
# open document to process | # open document to process | ||
- xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg | - xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg | ||
# set label for XUndoToLabel xverb works | |||
# NB: if something wrong with undo labels use verb EditUndo instead of XUndoLabel and XUndoToLabel at all | # set label for XUndoToLabel "xverb" works | ||
- xverb-id: XUndoLabel, fresh_document | # NB: if something wrong with undo labels use "verb" EditUndo instead of XUndoLabel and XUndoToLabel at all | ||
- xverb-id: XUndoLabel, fresh_document | |||
# select element to handle | # select element to handle | ||
- xverb-id: XSelectElement, top_sand | - xverb-id: XSelectElement, top_sand | ||
# verbs | |||
# usual "verbs" | |||
- verb-id: EditInvertInAllLayers | - verb-id: EditInvertInAllLayers | ||
- verb-id: EditDelete | - verb-id: EditDelete | ||
- verb-id: FitCanvasToDrawing | - verb-id: FitCanvasToDrawing | ||
# save element to separated svg document | # save element to separated svg document | ||
- xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg | - xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg | ||
# also save png preview | # also save png preview | ||
- xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png | - xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png | ||
# return to the fresh_state of document | # return to the fresh_state of document | ||
- xverb-id: XUndoToLabel, fresh_document | - xverb-id: XUndoToLabel, fresh_document | ||
# do any other handling | # do any other handling | ||
# Inkscape have a lot of useful verbs | # Inkscape have a lot of useful "verbs" | ||
- verb-id: FileQuit | - verb-id: FileQuit | ||
</pre> | |||
== List of verbs == | |||
"verbs" is developed for Inkscape menu system, so "verbs" does not have any arguments. List of Inkscape "verbs" can be found at source code:<br /> | |||
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp#L2543 | |||
== List of xverbs == | |||
XFileSaveAs - save current document to specified filename | |||
XFileOpen - open specified .svg filename instead of current document | |||
XFileExportPNG - export to specified .png filename | |||
XSelectElement - select svg element by name | |||
XUndoLabel - set undo label | |||
UndoToLabel - undo to specified label | |||
== Additional info == | |||
Some additional info can be found at maillist thread: <br /> | |||
https://sourceforge.net/p/inkscape/mailman/inkscape-devel/thread/33487d06-e3c1-a4e5-1496-7b370d672d2f%40gmail.com/#msg35392523 |
Revision as of 13:28, 16 May 2017
Using
inkscape --xverbs=xverbs.yaml
Format of xverbs.yaml:
# only "verbose: yes" enable logging verbose: yes run: # open document to process - xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg # set label for XUndoToLabel "xverb" works # NB: if something wrong with undo labels use "verb" EditUndo instead of XUndoLabel and XUndoToLabel at all - xverb-id: XUndoLabel, fresh_document # select element to handle - xverb-id: XSelectElement, top_sand # usual "verbs" - verb-id: EditInvertInAllLayers - verb-id: EditDelete - verb-id: FitCanvasToDrawing # save element to separated svg document - xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg # also save png preview - xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png # return to the fresh_state of document - xverb-id: XUndoToLabel, fresh_document # do any other handling # Inkscape have a lot of useful "verbs" - verb-id: FileQuit
List of verbs
"verbs" is developed for Inkscape menu system, so "verbs" does not have any arguments. List of Inkscape "verbs" can be found at source code:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp#L2543
List of xverbs
XFileSaveAs - save current document to specified filename XFileOpen - open specified .svg filename instead of current document XFileExportPNG - export to specified .png filename XSelectElement - select svg element by name XUndoLabel - set undo label UndoToLabel - undo to specified label
Additional info
Some additional info can be found at maillist thread:
https://sourceforge.net/p/inkscape/mailman/inkscape-devel/thread/33487d06-e3c1-a4e5-1496-7b370d672d2f%40gmail.com/#msg35392523