diff options
| author | hellozee <hellozee@disroot.org> | 2018-03-06 12:22:22 +0000 |
|---|---|---|
| committer | hellozee <hellozee@disroot.org> | 2018-03-06 12:22:22 +0000 |
| commit | a65c02c515528168aec0c5a092078117de02b0a9 (patch) | |
| tree | c80b1ead2a302de453ab901af79b4740947122f1 | |
| parent | Fix for Bug #1643260, Step size changed to 0.1% for Blur and Opacity Spin But... (diff) | |
| parent | Remove unused includes, etc. (diff) | |
| download | inkscape-a65c02c515528168aec0c5a092078117de02b0a9.tar.gz inkscape-a65c02c515528168aec0c5a092078117de02b0a9.zip | |
Merge remote-tracking branch 'remote/master'
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 9 | ||||
| -rw-r--r-- | config.h.cmake | 13 | ||||
| -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 |
10 files changed, 117 insertions, 80 deletions
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index ffaf833f0..a1ce9c16a 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -256,6 +256,15 @@ set(TRY_GTKSPELL ON) ) list(APPEND INKSCAPE_CXX_FLAGS ${GTK3_CFLAGS_OTHER}) + # Use some obtuse string parsing to get the version + # number components for GTKMM. + # These variables are also substituted in config.h, and used within the + # GTKMM_CHECK_VERSION macro + string(REPLACE "." ";" GTKMM_VERSION_COMPONENTS ${GTK3_gtkmm-3.0_VERSION}) + list(GET GTKMM_VERSION_COMPONENTS 0 INKSCAPE_GTKMM_MAJOR_VERSION) + list(GET GTKMM_VERSION_COMPONENTS 1 INKSCAPE_GTKMM_MINOR_VERSION) + list(GET GTKMM_VERSION_COMPONENTS 2 INKSCAPE_GTKMM_MICRO_VERSION) + pkg_check_modules(GDL_3_6 gdl-3.0>=3.6) if("${GDL_3_6_FOUND}") diff --git a/config.h.cmake b/config.h.cmake index 70422fafb..61ba6cff3 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -225,6 +225,11 @@ /* Do we want experimental, unsupported, unguaranteed, etc., LivePathEffects enabled? */ #cmakedefine LPE_ENABLE_TEST_EFFECTS 1 +/* Local variables to store GTKMM version */ +#cmakedefine INKSCAPE_GTKMM_MAJOR_VERSION @INKSCAPE_GTKMM_MAJOR_VERSION@ +#cmakedefine INKSCAPE_GTKMM_MINOR_VERSION @INKSCAPE_GTKMM_MINOR_VERSION@ +#cmakedefine INKSCAPE_GTKMM_MICRO_VERSION @INKSCAPE_GTKMM_MICRO_VERSION@ + /** * Check GtkMM version * @@ -245,10 +250,10 @@ * Returns: %TRUE if GTK+ headers are new enough */ #define GTKMM_CHECK_VERSION(major,minor,micro) \ - (GTKMM_MAJOR_VERSION > (major) || \ - (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION > (minor)) || \ - (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION == (minor) && \ - GTKMM_MICRO_VERSION >= (micro))) + (INKSCAPE_GTKMM_MAJOR_VERSION > (major) || \ + (INKSCAPE_GTKMM_MAJOR_VERSION == (major) && INKSCAPE_GTKMM_MINOR_VERSION > (minor)) || \ + (INKSCAPE_GTKMM_MAJOR_VERSION == (major) && INKSCAPE_GTKMM_MINOR_VERSION == (minor) && \ + INKSCAPE_GTKMM_MICRO_VERSION >= (micro))) #endif /* _CONFIG_H_ */ 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" |
