diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/inkview-options-group.cpp | 56 | ||||
| -rw-r--r-- | src/inkview-options-group.h | 35 | ||||
| -rw-r--r-- | src/inkview.cpp | 65 | ||||
| -rw-r--r-- | src/libnrtype/FontInstance.cpp | 4 | ||||
| -rw-r--r-- | src/libnrtype/font-style.h | 5 | ||||
| -rw-r--r-- | src/ui/monitor.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/spray-tool.cpp | 2 |
8 files changed, 99 insertions, 76 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e6c49c88..44f64c56c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -294,7 +294,11 @@ set(inkscape_SRC # Setup the executable # ----------------------------------------------------------------------------- set(main_SRC main.cpp) -set(view_SRC inkview.cpp) +set(view_SRC + inkview.cpp + inkview-options-group.cpp + inkview-options-group.h +) if(WIN32) # Sources for the inkscape executable on Windows. diff --git a/src/inkview-options-group.cpp b/src/inkview-options-group.cpp new file mode 100644 index 000000000..7879c55e2 --- /dev/null +++ b/src/inkview-options-group.cpp @@ -0,0 +1,56 @@ +#include "inkview-options-group.h" + +#include <glibmm/i18n.h> + +InkviewOptionsGroup::InkviewOptionsGroup() + : Glib::OptionGroup(N_("Inkscape Options"), + N_("Default program options")) +{ + // Entry for the "fullscreen" option + Glib::OptionEntry entry_fullscreen; + entry_fullscreen.set_short_name('f'); + entry_fullscreen.set_long_name("fullscreen"); + entry_fullscreen.set_description(N_("Launch in fullscreen mode")); + add_entry(entry_fullscreen, fullscreen); + + // Entry for the "recursive" option + Glib::OptionEntry entry_recursive; + entry_recursive.set_short_name('r'); + entry_recursive.set_long_name("recursive"); + entry_recursive.set_description(N_("Search folders recursively")); + add_entry(entry_recursive, recursive); + + // Entry for the "timer" option + Glib::OptionEntry entry_timer; + entry_timer.set_short_name('t'); + entry_timer.set_long_name("timer"); + entry_timer.set_arg_description(N_("NUM")); + entry_timer.set_description(N_("Change image every NUM seconds")); + add_entry(entry_timer, timer); + + // Entry for the "scale" option + Glib::OptionEntry entry_scale; + entry_scale.set_short_name('s'); + entry_scale.set_long_name("scale"); + entry_scale.set_arg_description(N_("NUM")); + entry_scale.set_description(N_("Scale image by factor NUM")); + add_entry(entry_scale, scale); + + // Entry for the remaining non-option arguments + Glib::OptionEntry entry_args; + entry_args.set_long_name(G_OPTION_REMAINING); + entry_args.set_arg_description(N_("FILES/FOLDERS…")); + + add_entry(entry_args, filenames); +} + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/inkview-options-group.h b/src/inkview-options-group.h new file mode 100644 index 000000000..592caf1af --- /dev/null +++ b/src/inkview-options-group.h @@ -0,0 +1,35 @@ +#ifndef INKVIEW_OPTIONS_GROUP_H +#define INKVIEW_OPTIONS_GROUP_H + +#include <glibmm.h> + +/** + * \brief Set of command-line options for Inkview + */ +class InkviewOptionsGroup : public Glib::OptionGroup +{ +public: + // list of all input filenames; + // this list contains all arguments that are not recognized as an option (so needs to be checked) + Glib::OptionGroup::vecustrings filenames; + + bool fullscreen = false; // whether to launch in fullscreen mode + bool recursive = false; // whether to search folders for SVG files recursively + int timer = 0; // time (in seconds) after which the next image of the slideshow is automatically loaded + double scale = 1; // scale factor for images + // (currently only applied to the first image - others are resized to window dimensions) + + InkviewOptionsGroup(); +}; +#endif // INKVIEW_OPTIONS_GROUP_H + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/inkview.cpp b/src/inkview.cpp index 5b27e9168..f3e5ccdfc 100644 --- a/src/inkview.cpp +++ b/src/inkview.cpp @@ -33,7 +33,6 @@ #include <libxml/tree.h> -#include <glibmm.h> #include <glibmm/i18n.h> #include "document.h" @@ -45,69 +44,7 @@ #include "inkgc/gc-core.h" #include "io/sys.h" #include "svg-view-slideshow.h" - - - - - -/** - * \brief Set of command-line options for Inkview - */ -class InkviewOptionsGroup : public Glib::OptionGroup -{ -public: - // list of all input filenames; - // this list contains all arguments that are not recognized as an option (so needs to be checked) - Glib::OptionGroup::vecustrings filenames; - - bool fullscreen = false; // whether to launch in fullscreen mode - bool recursive = false; // whether to search folders for SVG files recursively - int timer = 0; // time (in seconds) after which the next image of the slideshow is automatically loaded - double scale = 1; // scale factor for images - // (currently only applied to the first image - others are resized to window dimensions) - - InkviewOptionsGroup() : Glib::OptionGroup(N_("Inkscape Options"), - N_("Default program options")) - { - // Entry for the "fullscreen" option - Glib::OptionEntry entry_fullscreen; - entry_fullscreen.set_short_name('f'); - entry_fullscreen.set_long_name("fullscreen"); - entry_fullscreen.set_description(N_("Launch in fullscreen mode")); - add_entry(entry_fullscreen, fullscreen); - - // Entry for the "recursive" option - Glib::OptionEntry entry_recursive; - entry_recursive.set_short_name('r'); - entry_recursive.set_long_name("recursive"); - entry_recursive.set_description(N_("Search folders recursively")); - add_entry(entry_recursive, recursive); - - // Entry for the "timer" option - Glib::OptionEntry entry_timer; - entry_timer.set_short_name('t'); - entry_timer.set_long_name("timer"); - entry_timer.set_arg_description(N_("NUM")); - entry_timer.set_description(N_("Change image every NUM seconds")); - add_entry(entry_timer, timer); - - // Entry for the "scale" option - Glib::OptionEntry entry_scale; - entry_scale.set_short_name('s'); - entry_scale.set_long_name("scale"); - entry_scale.set_arg_description(N_("NUM")); - entry_scale.set_description(N_("Scale image by factor NUM")); - add_entry(entry_scale, scale); - - // Entry for the remaining non-option arguments - Glib::OptionEntry entry_args; - entry_args.set_long_name(G_OPTION_REMAINING); - entry_args.set_arg_description(N_("FILES/FOLDERS…")); - - add_entry(entry_args, filenames); - } -}; - +#include "inkview-options-group.h" /** get a list of valid SVG files from a list of strings */ std::vector<Glib::ustring> get_valid_files(std::vector<Glib::ustring> filenames, bool recursive = false, bool first_iteration = false) diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp index 57aa22d48..e93c7481c 100644 --- a/src/libnrtype/FontInstance.cpp +++ b/src/libnrtype/FontInstance.cpp @@ -27,7 +27,6 @@ #include <2geom/path-sink.h> #include "libnrtype/font-glyph.h" #include "libnrtype/font-instance.h" -#include "livarot/Path.h" #include "util/unordered-containers.h" @@ -121,8 +120,7 @@ typedef FT_Vector const FREETYPE_VECTOR; typedef FT_Vector FREETYPE_VECTOR; #endif -// outline as returned by freetype -> livarot Path -// see nr-type-ft2.cpp for the freetype -> artBPath on which this code is based +// outline as returned by freetype static int ft2_move_to(FREETYPE_VECTOR *to, void * i_user) { FT2GeomData *user = (FT2GeomData*)i_user; diff --git a/src/libnrtype/font-style.h b/src/libnrtype/font-style.h index 810fc72cf..1ed82e89c 100644 --- a/src/libnrtype/font-style.h +++ b/src/libnrtype/font-style.h @@ -6,9 +6,6 @@ // structure that holds data describing how to render glyphs of a font -class Path; -class Shape; - // Different raster styles. struct font_style { Geom::Affine transform; // the ctm. contains the font-size @@ -21,8 +18,6 @@ struct font_style { int nbDash; double dash_offset; double* dashes; - - void Apply(Path *src, Shape *dst); // utility: applies the style to the path and stores the result in the shape }; diff --git a/src/ui/monitor.cpp b/src/ui/monitor.cpp index 3e0c983fe..19a304bb0 100644 --- a/src/ui/monitor.cpp +++ b/src/ui/monitor.cpp @@ -45,7 +45,7 @@ Gdk::Rectangle get_monitor_geometry_primary() { Gdk::Rectangle monitor_geometry; #if GTKMM_CHECK_VERSION(3,22,0) auto const display = Gdk::Display::get_default(); - auto const monitor = display->get_primary_monitor(); + auto monitor = display->get_primary_monitor(); // Fallback to monitor number 0 if the user hasn't configured a primary monitor if (!monitor) { diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index beb556dff..603d5e80a 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -52,8 +52,6 @@ #include "helper/action.h" -#include "livarot/Shape.h" - #include "object/box3d.h" #include "object/sp-item-transform.h" |
