summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/application/CMakeLists.txt8
-rw-r--r--src/application/Makefile_insert9
-rw-r--r--src/application/app-prototype.cpp43
-rw-r--r--src/application/app-prototype.h53
-rw-r--r--src/application/application.cpp160
-rw-r--r--src/application/application.h65
-rw-r--r--src/application/editor.cpp420
-rw-r--r--src/application/editor.h140
-rw-r--r--src/application/makefile.in17
-rw-r--r--src/dialogs/clonetiler.cpp28
-rw-r--r--src/document.cpp18
-rw-r--r--src/doxygen-main.cpp1
-rw-r--r--src/extension/implementation/script.cpp4
-rw-r--r--src/extension/internal/pdfinput/pdf-input.cpp4
-rw-r--r--src/file.cpp33
-rw-r--r--src/inkscape.cpp135
-rw-r--r--src/inkscape.h1
-rw-r--r--src/jabber_whiteboard/session-manager.cpp23
-rw-r--r--src/main.cpp15
-rw-r--r--src/ui/dialog/dialog.cpp25
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp2
-rw-r--r--src/ui/dialog/floating-behavior.cpp2
-rw-r--r--src/ui/dialog/transformation.h7
-rw-r--r--src/ui/view/Makefile_insert4
26 files changed, 76 insertions, 1143 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a956f6ad8..f03f22c80 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -206,7 +206,6 @@ ${ONLY_WIN}
SET(internalfolders
#algorithms
#api
-application
bind
debug
dialogs
diff --git a/src/Makefile.am b/src/Makefile.am
index 8cbbbf21b..0c585d6a9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -106,7 +106,6 @@ endif
# Include all partial makefiles from subdirectories
include Makefile_insert
-include application/Makefile_insert
include bind/Makefile_insert
include dialogs/Makefile_insert
include display/Makefile_insert
diff --git a/src/application/CMakeLists.txt b/src/application/CMakeLists.txt
deleted file mode 100644
index c09279395..000000000
--- a/src/application/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-SET(application_SRC
-editor.cpp
-application.cpp
-app-prototype.cpp
-)
-ADD_LIBRARY(application STATIC ${application_SRC})
-TARGET_LINK_LIBRARIES(application
-2geom ${INKSCAPE_LIBS}) \ No newline at end of file
diff --git a/src/application/Makefile_insert b/src/application/Makefile_insert
deleted file mode 100644
index d3afa2307..000000000
--- a/src/application/Makefile_insert
+++ /dev/null
@@ -1,9 +0,0 @@
-## Makefile.am fragment sourced by src/Makefile.am.
-
-ink_common_sources += \
- application/editor.cpp \
- application/editor.h \
- application/application.cpp \
- application/application.h \
- application/app-prototype.cpp \
- application/app-prototype.h
diff --git a/src/application/app-prototype.cpp b/src/application/app-prototype.cpp
deleted file mode 100644
index 27f58d92a..000000000
--- a/src/application/app-prototype.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/** @file
- * @brief Base class for different application modes
- */
-/* Author:
- * Bryce W. Harrington <bryce@bryceharrington.org>
- *
- * Copyright (C) 2005 Bryce Harrington
- *
- * Released under GNU GPL. Read the file 'COPYING' for more information.
- */
-
-#include "app-prototype.h"
-
-namespace Inkscape {
-namespace NSApplication {
-
-AppPrototype::AppPrototype()
-{
-}
-
-AppPrototype::AppPrototype(int /*argc*/, const char **/*argv*/)
-{
-}
-
-AppPrototype::~AppPrototype()
-{
-}
-
-
-} // namespace NSApplication
-} // namespace Inkscape
-
-
-/*
- 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:encoding=utf-8:textwidth=99 :
diff --git a/src/application/app-prototype.h b/src/application/app-prototype.h
deleted file mode 100644
index ce1cd3c8e..000000000
--- a/src/application/app-prototype.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @file
- * @brief Base class for different application modes
- */
-/* Author:
- * Bryce W. Harrington <bryce@bryceharrington.org>
- *
- * Copyright (C) 2005 Bryce Harrington
- *
- * Released under GNU GPL. Read the file 'COPYING' for more information.
- */
-
-#ifndef INKSCAPE_APPLICATION_APP_PROTOTYPE_H
-#define INKSCAPE_APPLICATION_APP_PROTOTYPE_H
-
-namespace Gtk {
-class Window;
-}
-
-
-namespace Inkscape {
-namespace NSApplication {
-
-class AppPrototype
-{
-public:
- AppPrototype();
- AppPrototype(int argc, const char **argv);
- virtual ~AppPrototype();
-
- virtual void* getWindow() = 0;
-
-protected:
- AppPrototype(AppPrototype const &);
- AppPrototype& operator=(AppPrototype const &);
-
-};
-
-} // namespace NSApplication
-} // namespace Inkscape
-
-
-#endif /* !INKSCAPE_APPLICATION_APP_PROTOTYPE_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:encoding=utf-8:textwidth=99 :
diff --git a/src/application/application.cpp b/src/application/application.cpp
deleted file mode 100644
index ab516b9d4..000000000
--- a/src/application/application.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/** @file
- * @brief The top level class for managing the application
- */
-/* Authors:
- * Bryce W. Harrington <bryce@bryceharrington.org>
- * Ralf Stephan <ralf@ark.in-berlin.de>
- *
- * Copyright (C) 2005 Authors
- *
- * Released under GNU GPL. Read the file 'COPYING' for more information.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <gtkmm/main.h>
-
-#include "preferences.h"
-#include "application.h"
-#include "editor.h"
-
-int sp_main_gui(int argc, char const **argv);
-int sp_main_console(int argc, char const **argv);
-
-static Gtk::Main *_gtk_main;
-static bool _use_gui, _new_gui;
-
-namespace Inkscape {
-namespace NSApplication {
-
-Application::Application(int argc, char **argv, bool use_gui, bool new_gui)
- : _argc(argc),
- _argv(NULL),
- _app_impl(NULL),
- _path_home(NULL)
-{
- _use_gui = use_gui;
- _new_gui = new_gui;
-
- if (argv != NULL) {
- _argv = argv; // TODO: Is this correct?
- }
-
- if (new_gui) {
- _gtk_main = new Gtk::Main(argc, argv, true);
-
- // TODO: Determine class by arguments
- g_warning("Creating new Editor");
- _app_impl = (AppPrototype*) Editor::create(_argc, _argv);
-
- } else if (use_gui) {
- // No op - we'll use the old interface
- } else {
- _app_impl = NULL; // = Cmdline(_argc, _argv);
- }
-
- /// \todo Install segv handler here?
-
-// Inkscape::Extension::init();
-}
-
-Application::~Application()
-{
- g_free(_path_home);
-}
-
-
-/** Returns the current home directory location */
-gchar const*
-Application::homedir() const
-{
- if ( !_path_home ) {
- _path_home = g_strdup(g_get_home_dir());
- gchar* utf8Path = g_filename_to_utf8( _path_home, -1, NULL, NULL, NULL );
- if ( utf8Path ) {
- _path_home = utf8Path;
- if ( !g_utf8_validate(_path_home, -1, NULL) ) {
- g_warning( "Home directory is non-UTF-8" );
- }
- }
- }
- if ( !_path_home && _argv != NULL) {
- gchar * path = g_path_get_dirname(_argv[0]);
- gchar * utf8Path = g_filename_to_utf8( path, -1, NULL, NULL, NULL );
- g_free(path);
- if (utf8Path) {
- _path_home = utf8Path;
- if ( !g_utf8_validate(_path_home, -1, NULL) ) {
- g_warning( "Application run directory is non-UTF-8" );
- }
- }
- }
- return _path_home;
-}
-
-gint
-Application::run()
-{
- gint result = 0;
-
- /* Note: This if loop should be replaced by calls to the
- * various subclasses of I::A::AppPrototype.
- */
- if (_gtk_main != NULL) {
- g_assert(_app_impl != NULL);
- g_warning("Running main window");
- Gtk::Window *win = static_cast<Gtk::Window*>(_app_impl->getWindow());
- g_assert(win != NULL);
- _gtk_main->run(*win);
- result = 0;
-
- } else if (_use_gui) {
- result = sp_main_gui(_argc, (const char**)_argv);
-
- } else {
- result = sp_main_console(_argc, (const char**)_argv);
- }
-
- return result;
-}
-
-void
-Application::exit()
-{
- Inkscape::Preferences::unload();
-
- if (_gtk_main != NULL) {
- _gtk_main->quit();
- }
-
-}
-
-bool
-Application::getUseGui()
-{
- return _use_gui;
-}
-
-bool
-Application::getNewGui()
-{
- return _new_gui;
-}
-
-
-} // namespace NSApplication
-} // namespace Inkscape
-
-
-/*
- 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:encoding=utf-8:textwidth=99 :
diff --git a/src/application/application.h b/src/application/application.h
deleted file mode 100644
index fce6bd47f..000000000
--- a/src/application/application.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/** @file
- * @brief The top level class for managing the application.
- */
-/* Authors:
- * Bryce W. Harrington <bryce@bryceharrington.org>
- * Ralf Stephan <ralf@ark.in-berlin.de>
- *
- * Copyright (C) 2005 Authors
- *
- * Released under GNU GPL. Read the file 'COPYING' for more information.
- */
-
-#ifndef INKSCAPE_APPLICATION_APPLICATION_H
-#define INKSCAPE_APPLICATION_APPLICATION_H
-
-#include <glib/gtypes.h>
-
-namespace Gtk {
-class Main;
-}
-
-namespace Inkscape {
-namespace NSApplication {
-class AppPrototype;
-
-class Application
-{
-public:
- Application(int argc, char **argv, bool use_gui=true, bool new_gui=false);
- virtual ~Application();
-
- gchar const *homedir() const;
-
- gint run();
-
- static bool getUseGui();
- static bool getNewGui();
- static void exit();
-
-protected:
- Application(Application const &);
- Application& operator=(Application const &);
-
- gint _argc;
- char **_argv;
- AppPrototype *_app_impl;
-
- mutable gchar *_path_home;
-};
-
-} // namespace NSApplication
-} // namespace Inkscape
-
-#endif /* !INKSCAPE_APPLICATION_APPLICATION_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:encoding=utf-8:textwidth=99 :
diff --git a/src/application/editor.cpp b/src/application/editor.cpp
deleted file mode 100644
index 49010efdc..000000000
--- a/src/application/editor.cpp
+++ /dev/null
@@ -1,420 +0,0 @@
-/** @file
- * @brief Editor class declaration. This
- * singleton class implements much of the functionality of the former
- * 'inkscape' object and its services and signals.
- */
-/* Authors:
- * Bryce W. Harrington <bryce@bryceharrington.org>
- * Derek P. Moore <derekm@hackunix.org>
- * Ralf Stephan <ralf@ark.in-berlin.de>
- *
- * Copyright (C) 2004-2005 Authors
- *
- * Released under GNU GPL. Read the file 'COPYING' for more information.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- TODO: Replace SPDocument with the new Inkscape::Document
- TODO: Change 'desktop's to 'view*'s
- TODO: Add derivation from Inkscape::Application::RunMode
-*/
-
-
-#include "path-prefix.h"
-#include "io/sys.h"
-#include "sp-object-repr.h"
-#include <desktop-handles.h>
-#include "document.h"
-#include "sp-namedview.h"
-#include "event-context.h"
-#include "sp-guide.h"
-#include "selection.h"
-#include "editor.h"
-#include "application/application.h"
-#include "preferences.h"
-#include "ui/view/edit-widget.h"
-
-namespace Inkscape {
-namespace NSApplication {
-
-static Editor *_instance = 0;
-static void *_window;
-
-Editor*
-Editor::create (gint argc, char **argv)
-{
- if (_instance == 0)
- {
- _instance = new Editor (argc, argv);
- _instance->init();
- }
- return _instance;
-}
-
-Editor::Editor (gint /*argc*/, char **argv)
-: _documents (0),
- _desktops (0),
- _argv0 (argv[0]),
- _dialogs_toggle (true)
-
-{
- sp_object_type_register ("sodipodi:namedview", SP_TYPE_NAMEDVIEW);
- sp_object_type_register ("sodipodi:guide", SP_TYPE_GUIDE);
-
- Inkscape::Preferences::get(); // Ensure preferences are loaded
-}
-
-bool
-Editor::init()
-{
- // Load non-local template until we have everything right
- // This code formerly lived in file.cpp
- //
- gchar const *tmpl = g_build_filename ((INKSCAPE_TEMPLATESDIR), "default.svg", NULL);
- bool have_default = Inkscape::IO::file_test (tmpl, G_FILE_TEST_IS_REGULAR);
- SPDocument *doc = sp_document_new (have_default? tmpl:0, true, true);
- g_return_val_if_fail (doc != 0, false);
- Inkscape::UI::View::EditWidget *ew = new Inkscape::UI::View::EditWidget (doc);
- sp_document_unref (doc);
- _window = ew->getWindow();
- return ew != 0;
-}
-
-Editor::~Editor()
-{
-}
-
-/// Returns the Window representation of this application object
-void*
-Editor::getWindow()
-{
- return _window;
-}
-
-/// Returns the active document
-SPDocument*
-Editor::getActiveDocument()
-{
- if (getActiveDesktop()) {
- return sp_desktop_document (getActiveDesktop());
- }
-
- return NULL;
-}
-
-void
-Editor::addDocument (SPDocument *doc)
-{
- if ( _instance->_document_set.find(doc) == _instance->_document_set.end() ) {
- _instance->_documents = g_slist_append (_instance->_documents, doc);
- }
- _instance->_document_set.insert(doc);
-}
-
-void
-Editor::removeDocument (SPDocument *doc)
-{
- _instance->_document_set.erase(doc);
- if ( _instance->_document_set.find(doc) == _instance->_document_set.end() ) {
- _instance->_documents = g_slist_remove (_instance->_documents, doc);
- }
-}
-
-SPDesktop*
-Editor::createDesktop (SPDocument* doc)
-{
- g_assert (doc != 0);
- (new Inkscape::UI::View::EditWidget (doc))->present();
- sp_document_unref (doc);
- SPDesktop *dt = getActiveDesktop();
- reactivateDesktop (dt);
- return dt;
-}
-
-/// Returns the currently active desktop
-SPDesktop*
-Editor::getActiveDesktop()
-{
- if (_instance->_desktops == NULL) {
- return NULL;
- }
-
- return (SPDesktop *) _instance->_desktops->data;
-}
-
-/// Add desktop to list of desktops
-void
-Editor::addDesktop (SPDesktop *dt)
-{
- g_return_if_fail (dt != 0);
- g_assert (!g_slist_find (_instance->_desktops, dt));
-
- _instance->_desktops = g_slist_append (_instance->_desktops, dt);
-
- if (isDesktopActive (dt)) {
- _instance->_desktop_activated_signal.emit (dt);
- _instance->_event_context_set_signal.emit (sp_desktop_event_context (dt));
- _instance->_selection_set_signal.emit (sp_desktop_selection (dt));
- _instance->_selection_changed_signal.emit (sp_desktop_selection (dt));
- }
-}
-
-/// Remove desktop from list of desktops
-void
-Editor::removeDesktop (SPDesktop *dt)
-{
- g_return_if_fail (dt != 0);
- g_assert (g_slist_find (_instance->_desktops, dt));
-
- if (dt == _instance->_desktops->data) { // is it the active desktop?
- _instance->_desktop_deactivated_signal.emit (dt);
- if (_instance->_desktops->next != 0) {
- SPDesktop * new_desktop = (SPDesktop *) _instance->_desktops->next->data;
- _instance->_desktops = g_slist_remove (_instance->_desktops, new_desktop);
- _instance->_desktops = g_slist_prepend (_instance->_desktops, new_desktop);
- _instance->_desktop_activated_signal.emit (new_desktop);
- _instance->_event_context_set_signal.emit (sp_desktop_event_context (new_desktop));
- _instance->_selection_set_signal.emit (sp_desktop_selection (new_desktop));
- _instance->_selection_changed_signal.emit (sp_desktop_selection (new_desktop));
- } else {
- _instance->_event_context_set_signal.emit (0);
- if (sp_desktop_selection(dt))
- sp_desktop_selection(dt)->clear();
- }
- }
-
- _instance->_desktops = g_slist_remove (_instance->_desktops, dt);
-
- // if this was the last desktop, shut down the program
- if (_instance->_desktops == NULL) {
- _instance->_shutdown_signal.emit();
- Inkscape::NSApplication::Application::exit();
- }
-}
-
-void
-Editor::activateDesktop (SPDesktop* dt)
-{
- g_assert (dt != 0);
- if (isDesktopActive (dt))
- return;
-
- g_assert (g_slist_find (_instance->_desktops, dt));
- SPDesktop *curr = (SPDesktop*)_instance->_desktops->data;
- _instance->_desktop_deactivated_signal.emit (curr);
-
- _instance->_desktops = g_slist_remove (_instance->_desktops, dt);
- _instance->_desktops = g_slist_prepend (_instance->_desktops, dt);
-
- _instance->_desktop_activated_signal.emit (dt);
- _instance->_event_context_set_signal.emit (sp_desktop_event_context(dt));
- _instance->_selection_set_signal.emit (sp_desktop_selection(dt));
- _instance->_selection_changed_signal.emit (sp_desktop_selection(dt));
-}
-
-void
-Editor::reactivateDesktop (SPDesktop* dt)
-{
- g_assert (dt != 0);
- if (isDesktopActive(dt))
- _instance->_desktop_activated_signal.emit (dt);
-}
-
-bool
-Editor::isDuplicatedView (SPDesktop* dt)
-{
- SPDocument const* document = dt->doc();
- if (!document) {
- return false;
- }
- for ( GSList *iter = _instance->_desktops ; iter ; iter = iter->next ) {
- SPDesktop *other_desktop=(SPDesktop *)iter->data;
- SPDocument *other_document=other_desktop->doc();
- if ( other_document == document && other_desktop != dt ) {
- return true;
- }
- }
- return false;
-}
-
- /// Returns the event context
-//SPEventContext*
-//Editor::getEventContext()
-//{
-// if (getActiveDesktop()) {
-// return sp_desktop_event_context (getActiveDesktop());
-// }
-//
-// return NULL;
-//}
-
-
-void
-Editor::selectionModified (Inkscape::Selection* sel, guint flags)
-{
- g_return_if_fail (sel != NULL);
- if (isDesktopActive (sel->desktop()))
- _instance->_selection_modified_signal.emit (sel, flags);
-}
-
-void
-Editor::selectionChanged (Inkscape::Selection* sel)
-{
- g_return_if_fail (sel != NULL);
- if (isDesktopActive (sel->desktop()))
- _instance->_selection_changed_signal.emit (sel);
-}
-
-void
-Editor::subSelectionChanged (SPDesktop* dt)
-{
- g_return_if_fail (dt != NULL);
- if (isDesktopActive (dt))
- _instance->_subselection_changed_signal.emit (dt);
-}
-
-void
-Editor::selectionSet (Inkscape::Selection* sel)
-{
- g_return_if_fail (sel != NULL);
- if (isDesktopActive (sel->desktop())) {
- _instance->_selection_set_signal.emit (sel);
- _instance->_selection_changed_signal.emit (sel);
- }
-}
-
-void
-Editor::eventContextSet (SPEventContext* ec)
-{
- g_return_if_fail (ec != NULL);
- g_return_if_fail (SP_IS_EVENT_CONTEXT (ec));
- if (isDesktopActive (ec->desktop))
- _instance->_event_context_set_signal.emit (ec);
-}
-
-void
-Editor::hideDialogs()
-{
- _instance->_dialogs_hidden_signal.emit();
- _instance->_dialogs_toggle = false;
-}
-
-void
-Editor::unhideDialogs()
-{
- _instance->_dialogs_unhidden_signal.emit();
- _instance->_dialogs_toggle = true;
-}
-
-void
-Editor::toggleDialogs()
-{
- if (_dialogs_toggle) {
- hideDialogs();
- } else {
- unhideDialogs();
- }
-}
-
-void
-Editor::refreshDisplay()
-{
- // TODO
-}
-
-void
-Editor::exit()
-{
- //emit shutdown signal so that dialogs could remember layout
- _shutdown_signal.emit();
- Inkscape::Preferences::unload();
-}
-
-//==================================================================
-
-sigc::connection
-Editor::connectSelectionModified
-(const sigc::slot<void, Inkscape::Selection*, guint> &slot)
-{
- return _instance->_selection_modified_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectSelectionChanged
-(const sigc::slot<void, Inkscape::Selection*> &slot)
-{
- return _instance->_selection_changed_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectSubselectionChanged (const sigc::slot<void, SPDesktop*> &slot)
-{
- return _instance->_subselection_changed_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectSelectionSet (const sigc::slot<void, Inkscape::Selection*> &slot)
-{
- return _instance->_selection_set_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectEventContextSet (const sigc::slot<void, SPEventContext*> &slot)
-{
- return _instance->_event_context_set_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectDesktopActivated (const sigc::slot<void, SPDesktop*> &slot)
-{
- return _instance->_desktop_activated_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectDesktopDeactivated (const sigc::slot<void, SPDesktop*> &slot)
-{
- return _instance->_desktop_deactivated_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectShutdown (const sigc::slot<void> &slot)
-{
- return _instance->_shutdown_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectDialogsHidden (const sigc::slot<void> &slot)
-{
- return _instance->_dialogs_hidden_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectDialogsUnhidden (const sigc::slot<void> &slot)
-{
- return _instance->_dialogs_unhidden_signal.connect (slot);
-}
-
-sigc::connection
-Editor::connectExternalChange (const sigc::slot<void> &slot)
-{
- return _instance->_external_change_signal.connect (slot);
-}
-
-
-} // namespace NSApplication
-} // namespace Inkscape
-
-/*
- 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:encoding=utf-8:textwidth=99 :
diff --git a/src/application/editor.h b/src/application/editor.h
deleted file mode 100644
index 4545022b8..000000000
--- a/src/application/editor.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/** @file
- * @brief Singleton class to manage an application used for editing SVG
- * documents using GUI views
- */
-/*
- * Authors:
- * Bryce W. Harrington <bryce@bryceharrington.org>
- * Ralf Stephan <ralf@ark.in-berlin.de>
- *
- * Copyright (C) 2004 Bryce Harrington
- *
- * Released under GNU GPL. Read the file 'COPYING' for more information.
- */
-
-#ifndef INKSCAPE_APPLICATION_EDITOR_H
-#define INKSCAPE_APPLICATION_EDITOR_H
-
-#include <sigc++/sigc++.h>
-#include <glib/gslist.h>
-#include <glibmm/ustring.h>
-#include <set>
-#include "app-prototype.h"
-
-class SPDesktop;
-class SPDocument;
-class SPEventContext;
-
-namespace Inkscape {
- class Selection;
- namespace XML {
- class Document;
- }
- namespace UI {
- namespace View {
- class Edit;
- }
- }
- namespace NSApplication {
-
-class Editor : public AppPrototype
-{
-public:
- static Editor *create (int argc, char **argv);
- virtual ~Editor();
-
- void* getWindow();
-
- void toggleDialogs();
- void nextDesktop();
- void prevDesktop();
-
- void refreshDisplay();
- void exit();
-
- bool lastViewOfDocument(SPDocument* doc, SPDesktop* view) const;
-
- bool addView(SPDesktop* view);
- bool deleteView(SPDesktop* view);
-
- static Inkscape::XML::Document *getPreferences();
- static SPDesktop* getActiveDesktop();
- static bool isDesktopActive (SPDesktop* dt) { return getActiveDesktop()==dt; }
- static SPDesktop* createDesktop (SPDocument* doc);
- static void addDesktop (SPDesktop* dt);
- static void removeDesktop (SPDesktop* dt);
- static void activateDesktop (SPDesktop* dt);
- static void reactivateDesktop (SPDesktop* dt);
- static bool isDuplicatedView (SPDesktop* dt);
-
- static SPDocument* getActiveDocument();
- static void addDocument (SPDocument* doc);
- static void removeDocument (SPDocument* doc);
-
- static void selectionModified (Inkscape::Selection*, guint);
- static void selectionChanged (Inkscape::Selection*);
- static void subSelectionChanged (SPDesktop*);
- static void selectionSet (Inkscape::Selection*);
- static void eventContextSet (SPEventContext*);
- static void hideDialogs();
- static void unhideDialogs();
-
- static sigc::connection connectSelectionModified (const sigc::slot<void, Inkscape::Selection*, guint> &slot);
- static sigc::connection connectSelectionChanged (const sigc::slot<void, Inkscape::Selection*> &slot);
- static sigc::connection connectSubselectionChanged (const sigc::slot<void, SPDesktop*> &slot);
- static sigc::connection connectSelectionSet (const sigc::slot<void, Inkscape::Selection*> &slot);
- static sigc::connection connectEventContextSet (const sigc::slot<void, SPEventContext*> &slot);
- static sigc::connection connectDesktopActivated (const sigc::slot<void, SPDesktop*> &slot);
- static sigc::connection connectDesktopDeactivated (const sigc::slot<void, SPDesktop*> &slot);
- static sigc::connection connectShutdown (const sigc::slot<void> &slot);
- static sigc::connection connectDialogsHidden (const sigc::slot<void> &slot);
- static sigc::connection connectDialogsUnhidden (const sigc::slot<void> &slot);
- static sigc::connection connectExternalChange (const sigc::slot<void> &slot);
-
-
-protected:
- Editor(Editor const &);
- Editor& operator=(Editor const &);
-
- std::multiset<SPDocument *> _document_set;
- GSList *_documents;
- GSList *_desktops;
- gchar *_argv0;
-
- bool _dialogs_toggle;
-
- sigc::signal <void, Inkscape::Selection*, guint> _selection_modified_signal;
- sigc::signal <void, Inkscape::Selection*> _selection_changed_signal;
- sigc::signal <void, SPDesktop*> _subselection_changed_signal;
- sigc::signal <void, Inkscape::Selection*> _selection_set_signal;
- sigc::signal <void, SPEventContext*> _event_context_set_signal;
- sigc::signal <void, SPDesktop*> _desktop_activated_signal;
- sigc::signal <void, SPDesktop*> _desktop_deactivated_signal;
- sigc::signal <void> _shutdown_signal;
- sigc::signal <void> _dialogs_hidden_signal;
- sigc::signal <void> _dialogs_unhidden_signal;
- sigc::signal <void> _external_change_signal;
-
-private:
- Editor(int argc, char **argv);
- bool init();
-};
-
-#define ACTIVE_DESKTOP Inkscape::NSApplication::Editor::getActiveDesktop()
-
-} // namespace NSApplication
-} // namespace Inkscape
-
-
-#endif /* !INKSCAPE_APPLICATION_EDITOR_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:encoding=utf-8:textwidth=99 :
diff --git a/src/application/makefile.in b/src/application/makefile.in
deleted file mode 100644
index 7a879dba2..000000000
--- a/src/application/makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Convenience stub makefile to call the real Makefile.
-
-@SET_MAKE@
-
-OBJEXT = @OBJEXT@
-
-# Explicit so that it's the default rule.
-all:
- cd .. && $(MAKE) application/all
-
-clean %.a %.$(OBJEXT):
- cd .. && $(MAKE) application/$@
-
-.PHONY: all clean
-
-.SUFFIXES:
-.SUFFIXES: .a .$(OBJEXT)
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp
index 45d50b7a2..097278995 100644
--- a/src/dialogs/clonetiler.cpp
+++ b/src/dialogs/clonetiler.cpp
@@ -16,8 +16,6 @@
#include <gtk/gtk.h>
#include <glibmm/i18n.h>
-#include "application/application.h"
-#include "application/editor.h"
#include "../desktop.h"
#include "../desktop-handles.h"
#include "dialog-events.h"
@@ -83,15 +81,7 @@ static Inkscape::UI::Widget::ColorPicker *color_picker;
static void
clonetiler_dialog_destroy( GtkObject */*object*/, gpointer /*data*/ )
{
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- _shutdown_connection.disconnect();
- _dialogs_hidden_connection.disconnect();
- _dialogs_unhidden_connection.disconnect();
- _desktop_activated_connection.disconnect();
- } else {
- sp_signal_disconnect_by_data (INKSCAPE, dlg);
- }
+ sp_signal_disconnect_by_data (INKSCAPE, dlg);
_color_changed_connection.disconnect();
delete color_picker;
@@ -1860,18 +1850,10 @@ clonetiler_dialog (void)
gtk_signal_connect ( GTK_OBJECT (dlg), "destroy", G_CALLBACK (clonetiler_dialog_destroy), dlg);
gtk_signal_connect ( GTK_OBJECT (dlg), "delete_event", G_CALLBACK (clonetiler_dialog_delete), dlg);
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- _shutdown_connection = Inkscape::NSApplication::Editor::connectShutdown (&on_delete);
- _dialogs_hidden_connection = Inkscape::NSApplication::Editor::connectDialogsHidden (sigc::bind (&on_dialog_hide, dlg));
- _dialogs_unhidden_connection = Inkscape::NSApplication::Editor::connectDialogsUnhidden (sigc::bind (&on_dialog_unhide, dlg));
- _desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::bind (&on_transientize, &wd));
- } else {
- g_signal_connect ( G_OBJECT (INKSCAPE), "shut_down", G_CALLBACK (clonetiler_dialog_delete), dlg);
- g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_hide", G_CALLBACK (sp_dialog_hide), dlg);
- g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_unhide", G_CALLBACK (sp_dialog_unhide), dlg);
- g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd);
- }
+ g_signal_connect ( G_OBJECT (INKSCAPE), "shut_down", G_CALLBACK (clonetiler_dialog_delete), dlg);
+ g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_hide", G_CALLBACK (sp_dialog_hide), dlg);
+ g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_unhide", G_CALLBACK (sp_dialog_unhide), dlg);
+ g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd);
GtkTooltips *tt = gtk_tooltips_new();
diff --git a/src/document.cpp b/src/document.cpp
index 3c9f7e5ed..17aa642b1 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -41,8 +41,6 @@
#include <string>
#include <cstring>
-#include "application/application.h"
-#include "application/editor.h"
#include "desktop.h"
#include "dir-util.h"
#include "display/nr-arena-item.h"
@@ -418,17 +416,11 @@ sp_document_create(Inkscape::XML::Document *rdoc,
sp_document_set_undo_sensitive(document, true);
// reset undo key when selection changes, so that same-key actions on different objects are not coalesced
- if (!Inkscape::NSApplication::Application::getNewGui()) {
- g_signal_connect(G_OBJECT(INKSCAPE), "change_selection",
- G_CALLBACK(sp_document_reset_key), document);
- g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop",
- G_CALLBACK(sp_document_reset_key), document);
- document->oldSignalsConnected = true;
- } else {
- document->_selection_changed_connection = Inkscape::NSApplication::Editor::connectSelectionChanged (sigc::mem_fun (*document, &SPDocument::reset_key));
- document->_desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::mem_fun (*document, &SPDocument::reset_key));
- document->oldSignalsConnected = false;
- }
+ g_signal_connect(G_OBJECT(INKSCAPE), "change_selection",
+ G_CALLBACK(sp_document_reset_key), document);
+ g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop",
+ G_CALLBACK(sp_document_reset_key), document);
+ document->oldSignalsConnected = true;
return document;
}
diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp
index c6a6bb3ab..58c2f3f9a 100644
--- a/src/doxygen-main.cpp
+++ b/src/doxygen-main.cpp
@@ -283,7 +283,6 @@ namespace XML {}
/** \page UI User Interface Classes and Files
*
* - Inkscape::UI::View::View [\ref ui/view/view.cpp, \ref ui/view/view.h]
- * - Inkscape::UI::View::Edit [\ref ui/view/edit.cpp, \ref ui/view/edit.h]
* - SPDesktop [\ref desktop.cpp, \ref desktop-events.cpp, \ref desktop-handles.cpp, \ref desktop-style.cpp, \ref desktop.h, \ref desktop-events.h, \ref desktop-handles.h, \ref desktop-style.h]
* - SPSVGView [\ref svg-view.cpp, \ref svg-view.h]
*
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index 9a461ab2d..4fe0b5849 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -39,7 +39,7 @@
#include "extension/db.h"
#include "script.h"
#include "dialogs/dialog-events.h"
-#include "application/application.h"
+#include "inkscape.h"
#include "xml/node.h"
#include "xml/attribute-record.h"
@@ -983,7 +983,7 @@ int Script::execute (const std::list<std::string> &in_command,
Glib::ustring stderr_data = fileerr.string();
if (stderr_data.length() != 0 &&
- Inkscape::NSApplication::Application::getUseGui()
+ inkscape_use_gui()
) {
checkStderr(stderr_data, Gtk::MESSAGE_INFO,
_("Inkscape has received additional data from the script executed. "
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index 7958e23b5..8dd4698b5 100644
--- a/src/extension/internal/pdfinput/pdf-input.cpp
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
@@ -36,7 +36,7 @@
#include "pdf-parser.h"
#include "document-private.h"
-#include "application/application.h"
+#include "inkscape.h"
#include "dialogs/dialog-events.h"
#include <gtk/gtkdialog.h>
@@ -641,7 +641,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
}
PdfImportDialog *dlg = NULL;
- if (Inkscape::NSApplication::Application::getUseGui()) {
+ if (inkscape_use_gui()) {
dlg = new PdfImportDialog(pdf_doc, uri);
if (!dlg->showDialog()) {
delete dlg;
diff --git a/src/file.cpp b/src/file.cpp
index 50fcd3642..f7cd6a09a 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -31,8 +31,6 @@
#include <glibmm/i18n.h>
#include <libnr/nr-pixops.h>
-#include "application/application.h"
-#include "application/editor.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "dialogs/export.h"
@@ -126,19 +124,14 @@ sp_file_new(const Glib::ustring &templ)
g_return_val_if_fail(doc != NULL, NULL);
SPDesktop *dt;
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- dt = Inkscape::NSApplication::Editor::createDesktop (doc);
- } else {
- SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL));
- g_return_val_if_fail(dtw != NULL, NULL);
- sp_document_unref(doc);
+ SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL));
+ g_return_val_if_fail(dtw != NULL, NULL);
+ sp_document_unref(doc);
- sp_create_window(dtw, TRUE);
- dt = static_cast<SPDesktop*>(dtw->view);
- sp_namedview_window_from_document(dt);
- sp_namedview_update_layers_from_document(dt);
- }
+ sp_create_window(dtw, TRUE);
+ dt = static_cast<SPDesktop*>(dtw->view);
+ sp_namedview_window_from_document(dt);
+ sp_namedview_update_layers_from_document(dt);
#ifdef WITH_DBUS
Inkscape::Extension::Dbus::dbus_init_desktop_interface(dt);
@@ -247,14 +240,10 @@ sp_file_open(const Glib::ustring &uri,
desktop->change_document(doc);
sp_document_resized_signal_emit (doc, sp_document_width(doc), sp_document_height(doc));
} else {
- if (!Inkscape::NSApplication::Application::getNewGui()) {
- // create a whole new desktop and window
- SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL));
- sp_create_window(dtw, TRUE);
- desktop = static_cast<SPDesktop*>(dtw->view);
- } else {
- desktop = Inkscape::NSApplication::Editor::createDesktop (doc);
- }
+ // create a whole new desktop and window
+ SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL));
+ sp_create_window(dtw, TRUE);
+ desktop = static_cast<SPDesktop*>(dtw->view);
}
doc->virgin = FALSE;
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index c10581a91..8b31ba267 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -45,8 +45,6 @@ using Inkscape::Extension::Internal::PrintWin32;
#include <gtkmm/messagedialog.h>
#include <signal.h>
#include <string>
-#include "application/application.h"
-#include "application/editor.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "device-manager.h"
@@ -93,8 +91,6 @@ enum {
# FORWARD DECLARATIONS
################################*/
-gboolean inkscape_app_use_gui( Inkscape::Application const * app );
-
static void inkscape_class_init (Inkscape::ApplicationClass *klass);
static void inkscape_init (SPObject *object);
static void inkscape_dispose (GObject *object);
@@ -741,7 +737,7 @@ inkscape_crash_handler (int /*signum*/)
}
*(b + pos) = '\0';
- if ( inkscape_get_instance() && inkscape_app_use_gui( inkscape_get_instance() ) ) {
+ if ( inkscape_get_instance() && inkscape_use_gui() ) {
GtkWidget *msgbox = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", b);
gtk_dialog_run (GTK_DIALOG (msgbox));
gtk_widget_destroy (msgbox);
@@ -861,9 +857,9 @@ inkscape_get_instance()
return inkscape;
}
-gboolean inkscape_app_use_gui( Inkscape::Application const * app )
+gboolean inkscape_use_gui()
{
- return app->use_gui;
+ return inkscape_get_instance()->use_gui;
}
/**
@@ -893,10 +889,6 @@ bool inkscape_load_menus (Inkscape::Application */*inkscape*/)
void
inkscape_selection_modified (Inkscape::Selection *selection, guint flags)
{
- if (Inkscape::NSApplication::Application::getNewGui()) {
- Inkscape::NSApplication::Editor::selectionModified (selection, flags);
- return;
- }
g_return_if_fail (selection != NULL);
if (DESKTOP_IS_ACTIVE (selection->desktop())) {
@@ -908,10 +900,6 @@ inkscape_selection_modified (Inkscape::Selection *selection, guint flags)
void
inkscape_selection_changed (Inkscape::Selection * selection)
{
- if (Inkscape::NSApplication::Application::getNewGui()) {
- Inkscape::NSApplication::Editor::selectionChanged (selection);
- return;
- }
g_return_if_fail (selection != NULL);
if (DESKTOP_IS_ACTIVE (selection->desktop())) {
@@ -922,10 +910,6 @@ inkscape_selection_changed (Inkscape::Selection * selection)
void
inkscape_subselection_changed (SPDesktop *desktop)
{
- if (Inkscape::NSApplication::Application::getNewGui()) {
- Inkscape::NSApplication::Editor::subSelectionChanged (desktop);
- return;
- }
g_return_if_fail (desktop != NULL);
if (DESKTOP_IS_ACTIVE (desktop)) {
@@ -937,10 +921,6 @@ inkscape_subselection_changed (SPDesktop *desktop)
void
inkscape_selection_set (Inkscape::Selection * selection)
{
- if (Inkscape::NSApplication::Application::getNewGui()) {
- Inkscape::NSApplication::Editor::selectionSet (selection);
- return;
- }
g_return_if_fail (selection != NULL);
if (DESKTOP_IS_ACTIVE (selection->desktop())) {
@@ -953,10 +933,6 @@ inkscape_selection_set (Inkscape::Selection * selection)
void
inkscape_eventcontext_set (SPEventContext * eventcontext)
{
- if (Inkscape::NSApplication::Application::getNewGui()) {
- Inkscape::NSApplication::Editor::eventContextSet (eventcontext);
- return;
- }
g_return_if_fail (eventcontext != NULL);
g_return_if_fail (SP_IS_EVENT_CONTEXT (eventcontext));
@@ -970,12 +946,6 @@ void
inkscape_add_desktop (SPDesktop * desktop)
{
g_return_if_fail (desktop != NULL);
-
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- Inkscape::NSApplication::Editor::addDesktop (desktop);
- return;
- }
g_return_if_fail (inkscape != NULL);
g_assert (!g_slist_find (inkscape->desktops, desktop));
@@ -994,11 +964,6 @@ void
inkscape_remove_desktop (SPDesktop * desktop)
{
g_return_if_fail (desktop != NULL);
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- Inkscape::NSApplication::Editor::removeDesktop (desktop);
- return;
- }
g_return_if_fail (inkscape != NULL);
g_assert (g_slist_find (inkscape->desktops, desktop));
@@ -1034,11 +999,6 @@ void
inkscape_activate_desktop (SPDesktop * desktop)
{
g_return_if_fail (desktop != NULL);
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- Inkscape::NSApplication::Editor::activateDesktop (desktop);
- return;
- }
g_return_if_fail (inkscape != NULL);
if (DESKTOP_IS_ACTIVE (desktop)) {
@@ -1068,11 +1028,6 @@ void
inkscape_reactivate_desktop (SPDesktop * desktop)
{
g_return_if_fail (desktop != NULL);
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- Inkscape::NSApplication::Editor::reactivateDesktop (desktop);
- return;
- }
g_return_if_fail (inkscape != NULL);
if (DESKTOP_IS_ACTIVE (desktop))
@@ -1186,13 +1141,8 @@ inkscape_switch_desktops_prev ()
void
inkscape_dialogs_hide ()
{
- if (Inkscape::NSApplication::Application::getNewGui())
- Inkscape::NSApplication::Editor::hideDialogs();
- else
- {
- g_signal_emit (G_OBJECT (inkscape), inkscape_signals[DIALOGS_HIDE], 0);
- inkscape->dialogs_toggle = FALSE;
- }
+ g_signal_emit (G_OBJECT (inkscape), inkscape_signals[DIALOGS_HIDE], 0);
+ inkscape->dialogs_toggle = FALSE;
}
@@ -1200,13 +1150,8 @@ inkscape_dialogs_hide ()
void
inkscape_dialogs_unhide ()
{
- if (Inkscape::NSApplication::Application::getNewGui())
- Inkscape::NSApplication::Editor::unhideDialogs();
- else
- {
- g_signal_emit (G_OBJECT (inkscape), inkscape_signals[DIALOGS_UNHIDE], 0);
- inkscape->dialogs_toggle = TRUE;
- }
+ g_signal_emit (G_OBJECT (inkscape), inkscape_signals[DIALOGS_UNHIDE], 0);
+ inkscape->dialogs_toggle = TRUE;
}
@@ -1237,24 +1182,17 @@ inkscape_add_document (SPDocument *document)
{
g_return_if_fail (document != NULL);
- if (!Inkscape::NSApplication::Application::getNewGui())
- {
- // try to insert the pair into the list
- if (!(inkscape->document_set.insert(std::make_pair(document, 1)).second)) {
- //insert failed, this key (document) is already in the list
- for (std::map<SPDocument*,int>::iterator iter = inkscape->document_set.begin();
- iter != inkscape->document_set.end();
- ++iter) {
- if (iter->first == document) {
- // found this document in list, increase its count
- iter->second ++;
- }
- }
- }
- }
- else
- {
- Inkscape::NSApplication::Editor::addDocument (document);
+ // try to insert the pair into the list
+ if (!(inkscape->document_set.insert(std::make_pair(document, 1)).second)) {
+ //insert failed, this key (document) is already in the list
+ for (std::map<SPDocument*,int>::iterator iter = inkscape->document_set.begin();
+ iter != inkscape->document_set.end();
+ ++iter) {
+ if (iter->first == document) {
+ // found this document in list, increase its count
+ iter->second ++;
+ }
+ }
}
}
@@ -1265,28 +1203,21 @@ inkscape_remove_document (SPDocument *document)
{
g_return_val_if_fail (document != NULL, false);
- if (!Inkscape::NSApplication::Application::getNewGui())
- {
- for (std::map<SPDocument*,int>::iterator iter = inkscape->document_set.begin();
- iter != inkscape->document_set.end();
- ++iter) {
- if (iter->first == document) {
- // found this document in list, decrease its count
- iter->second --;
- if (iter->second < 1) {
- // this was the last one, remove the pair from list
- inkscape->document_set.erase (iter);
- return true;
- } else {
- return false;
- }
+ for (std::map<SPDocument*,int>::iterator iter = inkscape->document_set.begin();
+ iter != inkscape->document_set.end();
+ ++iter) {
+ if (iter->first == document) {
+ // found this document in list, decrease its count
+ iter->second --;
+ if (iter->second < 1) {
+ // this was the last one, remove the pair from list
+ inkscape->document_set.erase (iter);
+ return true;
+ } else {
+ return false;
}
}
}
- else
- {
- Inkscape::NSApplication::Editor::removeDocument (document);
- }
return false;
}
@@ -1294,9 +1225,6 @@ inkscape_remove_document (SPDocument *document)
SPDesktop *
inkscape_active_desktop (void)
{
- if (Inkscape::NSApplication::Application::getNewGui())
- return Inkscape::NSApplication::Editor::getActiveDesktop();
-
if (inkscape->desktops == NULL) {
return NULL;
}
@@ -1307,9 +1235,6 @@ inkscape_active_desktop (void)
SPDocument *
inkscape_active_document (void)
{
- if (Inkscape::NSApplication::Application::getNewGui())
- return Inkscape::NSApplication::Editor::getActiveDocument();
-
if (SP_ACTIVE_DESKTOP) {
return sp_desktop_document (SP_ACTIVE_DESKTOP);
}
diff --git a/src/inkscape.h b/src/inkscape.h
index d82092754..b0ae50539 100644
--- a/src/inkscape.h
+++ b/src/inkscape.h
@@ -41,6 +41,7 @@ bool inkscape_save_menus (Inkscape::Application * inkscape);
Inkscape::XML::Node *inkscape_get_menus (Inkscape::Application * inkscape);
Inkscape::Application *inkscape_get_instance();
+gboolean inkscape_use_gui();
SPDesktop * inkscape_find_desktop_by_dkey (unsigned int dkey);
diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp
index a04ab05f0..d8453c137 100644
--- a/src/jabber_whiteboard/session-manager.cpp
+++ b/src/jabber_whiteboard/session-manager.cpp
@@ -29,9 +29,6 @@
#include "ui/view/view-widget.h"
-#include "application/application.h"
-#include "application/editor.h"
-
#include "document-private.h"
#include "interface.h"
#include "sp-namedview.h"
@@ -386,20 +383,14 @@ makeInkboardDesktop(SPDocument* doc)
{
SPDesktop* dt;
- if (NSApplication::Application::getNewGui())
- dt = NSApplication::Editor::createDesktop(doc);
+ SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL));
+ g_return_val_if_fail(dtw != NULL, NULL);
+ sp_document_unref(doc);
- else
- {
- SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL));
- g_return_val_if_fail(dtw != NULL, NULL);
- sp_document_unref(doc);
-
- sp_create_window(dtw, TRUE);
- dt = static_cast<SPDesktop*>(dtw->view);
- sp_namedview_window_from_document(dt);
- sp_namedview_update_layers_from_document(dt);
- }
+ sp_create_window(dtw, TRUE);
+ dt = static_cast<SPDesktop*>(dtw->view);
+ sp_namedview_window_from_document(dt);
+ sp_namedview_update_layers_from_document(dt);
return dt;
}
diff --git a/src/main.cpp b/src/main.cpp
index 78b66d847..605b0f677 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -114,7 +114,6 @@ using Inkscape::Extension::Internal::PrintWin32;
#define bind_textdomain_codeset(p,c)
#endif
-#include "application/application.h"
#include "main-cmdlineact.h"
#include "widgets/icon.h"
#include "ui/widget/panel.h"
@@ -208,7 +207,6 @@ static gboolean sp_query_width = FALSE;
static gboolean sp_query_height = FALSE;
static gboolean sp_query_all = FALSE;
static gchar *sp_query_id = NULL;
-static int sp_new_gui = FALSE;
static gboolean sp_shell = FALSE;
static gboolean sp_vacuum_defs = FALSE;
@@ -583,7 +581,7 @@ static void set_extensions_env()
* architectures it might be called by something else.
*/
int
-main(int argc, char **argv)
+main(int argc, const char **argv)
{
#ifdef HAVE_FPSETMASK
/* This is inherited from Sodipodi code, where it was in #ifdef __FreeBSD__. It's probably
@@ -713,10 +711,15 @@ main(int argc, char **argv)
}
#endif // WIN32
- /// \todo Should this be a static object (see inkscape.cpp)?
- Inkscape::NSApplication::Application app(argc, argv, use_gui, sp_new_gui);
+ int retcode;
- return app.run();
+ if (use_gui) {
+ retcode = sp_main_gui(argc, argv);
+ } else {
+ retcode = sp_main_console(argc, argv);
+ }
+
+ return retcode;
}
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp
index 2483dc50e..72da46e29 100644
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
@@ -20,8 +20,6 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#include "application/application.h"
-#include "application/editor.h"
#include "inkscape.h"
#include "event-context.h"
#include "desktop.h"
@@ -109,17 +107,10 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat
_behavior = behavior_factory(*this);
- if (Inkscape::NSApplication::Application::getNewGui()) {
- _desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::mem_fun (*this, &Dialog::onDesktopActivated));
- _dialogs_hidden_connection = Inkscape::NSApplication::Editor::connectDialogsHidden (sigc::mem_fun (*this, &Dialog::onHideF12));
- _dialogs_unhidden_connection = Inkscape::NSApplication::Editor::connectDialogsUnhidden (sigc::mem_fun (*this, &Dialog::onShowF12));
- _shutdown_connection = Inkscape::NSApplication::Editor::connectShutdown (sigc::mem_fun (*this, &Dialog::onShutdown));
- } else {
- g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(sp_retransientize), (void *)this);
- g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_hide", G_CALLBACK(hideCallback), (void *)this);
- g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_unhide", G_CALLBACK(unhideCallback), (void *)this);
- g_signal_connect(G_OBJECT(INKSCAPE), "shut_down", G_CALLBACK(sp_dialog_shutdown), (void *)this);
- }
+ g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(sp_retransientize), (void *)this);
+ g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_hide", G_CALLBACK(hideCallback), (void *)this);
+ g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_unhide", G_CALLBACK(unhideCallback), (void *)this);
+ g_signal_connect(G_OBJECT(INKSCAPE), "shut_down", G_CALLBACK(sp_dialog_shutdown), (void *)this);
Glib::wrap(gobj())->signal_event().connect(sigc::mem_fun(*this, &Dialog::_onEvent));
Glib::wrap(gobj())->signal_key_press_event().connect(sigc::mem_fun(*this, &Dialog::_onKeyPress));
@@ -129,14 +120,6 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat
Dialog::~Dialog()
{
- if (Inkscape::NSApplication::Application::getNewGui())
- {
- _desktop_activated_connection.disconnect();
- _dialogs_hidden_connection.disconnect();
- _dialogs_unhidden_connection.disconnect();
- _shutdown_connection.disconnect();
- }
-
save_geometry();
delete _behavior;
_behavior = 0;
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 9cfb9c0b5..c3ba9da9f 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -27,8 +27,6 @@
#include <gtkmm/tooltips.h>
#include <glibmm/i18n.h>
-#include "application/application.h"
-#include "application/editor.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "dialog-manager.h"
diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp
index 85f078439..884037c25 100644
--- a/src/ui/dialog/floating-behavior.cpp
+++ b/src/ui/dialog/floating-behavior.cpp
@@ -15,8 +15,6 @@
#include "floating-behavior.h"
#include "dialog.h"
-#include "application/application.h"
-#include "application/editor.h"
#include "inkscape.h"
#include "desktop.h"
#include "dialogs/dialog-events.h"
diff --git a/src/ui/dialog/transformation.h b/src/ui/dialog/transformation.h
index 0607871fd..86c8a9229 100644
--- a/src/ui/dialog/transformation.h
+++ b/src/ui/dialog/transformation.h
@@ -19,7 +19,6 @@
#include "ui/widget/panel.h"
-#include "application/application.h"
#include "ui/widget/notebook-page.h"
#include "ui/widget/scalar-unit.h"
#include "ui/widget/imageicon.h"
@@ -145,12 +144,6 @@ protected:
virtual void _apply();
void presentPage(PageType page);
-
- void onSelectionChanged(Inkscape::NSApplication::Application *inkscape,
- Inkscape::Selection *selection);
- void onSelectionModified(Inkscape::NSApplication::Application *inkscape,
- Inkscape::Selection *selection,
- int unsigned flags);
void onSwitchPage(GtkNotebookPage *page,
guint pagenum);
diff --git a/src/ui/view/Makefile_insert b/src/ui/view/Makefile_insert
index 812ce21ca..b3ab598d4 100644
--- a/src/ui/view/Makefile_insert
+++ b/src/ui/view/Makefile_insert
@@ -1,10 +1,6 @@
## Makefile.am fragment sourced by src/Makefile.am.
ink_common_sources += \
- ui/view/edit.h \
- ui/view/edit.cpp \
- ui/view/edit-widget.h \
- ui/view/edit-widget.cpp \
ui/view/edit-widget-interface.h \
ui/view/view.h \
ui/view/view.cpp \