From 4e01c64b6094fa1f4bf63ec8a8f77cf21696b711 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 19 Mar 2011 23:42:59 -0700 Subject: Cleaned up memory patch. Fixes bug #737298. Fixed bugs: - https://launchpad.net/bugs/737298 (bzr r10118) --- src/inkscape.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 430977567..1007c315a 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -875,23 +875,31 @@ gboolean inkscape_use_gui() * Menus management * */ -bool inkscape_load_menus (Inkscape::Application */*inkscape*/) +bool inkscape_load_menus( Inkscape::Application * inkscape ) { - // TODO fix that fn is being leaked gchar *fn = profile_path(MENUS_FILE); - gchar *menus_xml = NULL; + gchar *menus_xml = 0; gsize len = 0; - if (g_file_get_contents(fn, &menus_xml, &len, NULL)) { + if ( inkscape != inkscape_get_instance() ) { + g_warning("BAD BAD BAD THINGS"); + } + + if ( g_file_get_contents(fn, &menus_xml, &len, NULL) ) { // load the menus_xml file - INKSCAPE->menus = sp_repr_read_mem(menus_xml, len, NULL); + inkscape->menus = sp_repr_read_mem(menus_xml, len, NULL); + g_free(menus_xml); - if (INKSCAPE->menus) { - return true; - } + menus_xml = 0; } - INKSCAPE->menus = sp_repr_read_mem(menus_skeleton, MENUS_SKELETON_SIZE, NULL); - return (INKSCAPE->menus != 0); + g_free(fn); + fn = 0; + + if ( !inkscape->menus ) { + inkscape->menus = sp_repr_read_mem(menus_skeleton, MENUS_SKELETON_SIZE, NULL); + } + + return (inkscape->menus != 0); } -- cgit v1.2.3 From c260fcd615791615b33f55459dabe38e64ee3471 Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Fri, 15 Apr 2011 09:17:08 +0200 Subject: No more PrintWin32, including no special cases for non-Unicode Windows anymore. (bzr r9508.1.82) --- src/inkscape.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 1007c315a..b063b909d 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -25,10 +25,6 @@ # define HAS_PROC_SELF_EXE //to get path of executable #else -// For now to get at is_os_wide(). -# include "extension/internal/win32.h" -using Inkscape::Extension::Internal::PrintWin32; - #define _WIN32_IE 0x0400 //#define HAS_SHGetSpecialFolderPath #define HAS_SHGetSpecialFolderLocation @@ -1354,24 +1350,18 @@ profile_path(const char *filename) if ( SHGetSpecialFolderLocation( NULL, CSIDL_APPDATA, &pidl ) == NOERROR ) { gchar * utf8Path = NULL; - if ( PrintWin32::is_os_wide() ) { + { wchar_t pathBuf[MAX_PATH+1]; g_assert(sizeof(wchar_t) == sizeof(gunichar2)); if ( SHGetPathFromIDListW( pidl, pathBuf ) ) { utf8Path = g_utf16_to_utf8( (gunichar2*)(&pathBuf[0]), -1, NULL, NULL, NULL ); } - } else { - char pathBuf[MAX_PATH+1]; - - if ( SHGetPathFromIDListA( pidl, pathBuf ) ) { - utf8Path = g_filename_to_utf8( pathBuf, -1, NULL, NULL, NULL ); - } } if ( utf8Path ) { if (!g_utf8_validate(utf8Path, -1, NULL)) { - g_warning( "SHGetPathFromIDList%c() resulted in invalid UTF-8", (PrintWin32::is_os_wide() ? 'W' : 'A') ); + g_warning( "SHGetPathFromIDListW() resulted in invalid UTF-8"); g_free( utf8Path ); utf8Path = 0; } else { -- cgit v1.2.3 From a4d0a358424440128cd4c4fb2915ccc4b86f4587 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 5 May 2011 23:21:51 -0700 Subject: Adding initial cut of resource manager. (bzr r10198) --- src/inkscape.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 1007c315a..91e3b0c5f 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -59,6 +59,7 @@ using Inkscape::Extension::Internal::PrintWin32; #include "io/sys.h" #include "message-stack.h" #include "preferences.h" +#include "resource-manager.h" #include "selection.h" #include "ui/dialog/debug.h" #include "xml/repr.h" @@ -820,6 +821,7 @@ inkscape_application_init (const gchar *argv0, gboolean use_gui) inkscape_load_menus(inkscape); Inkscape::DeviceManager::getManager().loadConfig(); } + Inkscape::ResourceManager::getManager(); /* set language for user interface according setting in preferences */ Glib::ustring ui_language = prefs->getString("/ui/language"); -- cgit v1.2.3 From 08eedb1441005f836d223b6143dc15c8009a3535 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 17 May 2011 23:25:49 -0700 Subject: Made dependencies explicit and bumped versions. (bzr r10208) --- src/inkscape.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 91e3b0c5f..1b0893c0b 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -442,11 +442,7 @@ void inkscape_autosave_init() // Turn on autosave guint32 timeout = prefs->getInt("/options/autosave/interval", 10) * 60; // g_debug("options.autosave.interval = %d", prefs->getInt("/options/autosave/interval", 10)); -#if GLIB_CHECK_VERSION(2,14,0) autosave_timeout_id = g_timeout_add_seconds(timeout, inkscape_autosave, NULL); -#else - autosave_timeout_id = g_timeout_add(timeout * 1000, inkscape_autosave, NULL); -#endif } } -- cgit v1.2.3 From a622000f4859173bb7ac484b86cefe9fa4f169e4 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 18 May 2011 21:43:01 -0700 Subject: Revert version bump so win devlibs can catch up. (bzr r10210) --- src/inkscape.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 1b0893c0b..91e3b0c5f 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -442,7 +442,11 @@ void inkscape_autosave_init() // Turn on autosave guint32 timeout = prefs->getInt("/options/autosave/interval", 10) * 60; // g_debug("options.autosave.interval = %d", prefs->getInt("/options/autosave/interval", 10)); +#if GLIB_CHECK_VERSION(2,14,0) autosave_timeout_id = g_timeout_add_seconds(timeout, inkscape_autosave, NULL); +#else + autosave_timeout_id = g_timeout_add(timeout * 1000, inkscape_autosave, NULL); +#endif } } -- cgit v1.2.3 From 9865291b790f185d7ec2271c58e8653c9d4bb295 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 19 May 2011 22:01:27 -0700 Subject: Reinstating version bump. (bzr r10215) --- src/inkscape.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 91e3b0c5f..1b0893c0b 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -442,11 +442,7 @@ void inkscape_autosave_init() // Turn on autosave guint32 timeout = prefs->getInt("/options/autosave/interval", 10) * 60; // g_debug("options.autosave.interval = %d", prefs->getInt("/options/autosave/interval", 10)); -#if GLIB_CHECK_VERSION(2,14,0) autosave_timeout_id = g_timeout_add_seconds(timeout, inkscape_autosave, NULL); -#else - autosave_timeout_id = g_timeout_add(timeout * 1000, inkscape_autosave, NULL); -#endif } } -- cgit v1.2.3 From 8dffb2e7a2725a77d3af74bc984e48ac940f2679 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 26 May 2011 20:28:44 -0700 Subject: Applying patch from Gellule Xg to fix crash on 64-bit. Fixed bugs: - https://launchpad.net/bugs/629363 (bzr r10237) --- src/inkscape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 1b0893c0b..b794138ca 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -190,7 +190,7 @@ inkscape_class_init (Inkscape::ApplicationClass * klass) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (Inkscape::ApplicationClass, modify_selection), NULL, NULL, - g_cclosure_marshal_VOID__UINT_POINTER, + gtk_marshal_VOID__POINTER_UINT, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT); inkscape_signals[CHANGE_SELECTION] = g_signal_new ("change_selection", -- cgit v1.2.3 From f3756ff85a32f4b2a0771d0ac3bd78a69535395f Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Fri, 3 Jun 2011 11:44:52 +0100 Subject: Use generic headers in preparation for GTK+ 3 transition Fixed bugs: - https://launchpad.net/bugs/792263 (bzr r10252.1.1) --- src/inkscape.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index b794138ca..e90c44c82 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -40,8 +40,7 @@ using Inkscape::Extension::Internal::PrintWin32; #include #include #include -#include -#include +#include #include #include #include -- cgit v1.2.3 From 20097d47e6945bceb57d2335d23fe764f493ab59 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 2 Oct 2011 20:44:17 -0700 Subject: Another minor pass of Doxygen cleanup. (bzr r10659) --- src/inkscape.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 20084da54..fe59732a5 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -1,5 +1,6 @@ -/** @file - * @brief Legacy interface to main application +/** + * @file + * Legacy interface to main application. */ /* Authors: * Lauris Kaplinski -- cgit v1.2.3 From cd5e6c8856a1ac7b94e0fa799c471eaa8c8ecae4 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 5 Oct 2011 00:06:08 -0700 Subject: Cleanup for src/forward.h. (About 19 of the affected files did not require the contents forward.h at all). (bzr r10667) --- src/inkscape.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index fe59732a5..f07d0cac4 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -88,6 +88,10 @@ enum { # FORWARD DECLARATIONS ################################*/ +namespace Inkscape { +class ApplicationClass; +} + static void inkscape_class_init (Inkscape::ApplicationClass *klass); static void inkscape_init (SPObject *object); static void inkscape_dispose (GObject *object); -- cgit v1.2.3