Skip to content

Rewrite of main.cpp using InkscapeApplication (Gtk::Application)

Tavmjong Bah requested to merge main into master
  1. Use Gio::File for accessing files.
  2. Use Gio options to handle command line arguments.
  3. Use Gio::Actions for some command line arguments.
  4. Move file export code to src/io/file-export-cmd.h/.cpp. Make into class.

Reimplementation of main.cpp using latest Gtk3 technology, reducing line count by 50%.

Internally:

  • Replace main.cpp by Inkscape::Application (Gio::Application). This allows us to use application wide Gio::Actions.
  • Use Gio::File to access files.
  • Use Gio options for command line arguments.
  • Moved file export code to src/io/file-export-cmd.h/cpp

User changes:

  • --verbs: Verbs must be listed together: --verb="ObjectFlipVertically,FileSave,FileClose" This is a limit from using Gio options.

  • In export mode, to overwrite a file, one must use --export-overwrite, otherwise a new filename will be generated: file.svg -> file_out.svg

  • --export-id takes a semi-colon separated list of object id's. Each object will be exported separately.

  • --export-png, --export-ps, --export-eps, --export-pdf, --export-emf, --export-wmf, --export-xaml: Replaced by either:

  1. --output-file=MyOutput.xxx to export a single file of type xxx.
  2. --output-type="xxx" to batch export a list of input files to type xxx.
  • If multiple files are listed in command line, they will be batch processed.

  • --query-id: can have a comma separated list of id's which will produce a comma separated list of values.

  • --actions: A list of semi-colon separated actions with optional arguments (separated by a colon). At the moment only a few actions are supported. Eventually all verbs will be replaced by actions.

Missing:

  • --print Not implemented (broken in 0.92 and trunk)
  • Xaml Not tested
  • DBus Not tested (note Gio::Actions have an automatic DBus binding).
  • Console mode not implemented.
Edited by Tavmjong Bah

Merge request reports