summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: debac3a)
raw | patch | inline | side by side (parent: debac3a)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Tue, 12 Oct 2010 20:06:35 +0000 (22:06 +0200) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Tue, 12 Oct 2010 20:06:35 +0000 (22:06 +0200) |
27 files changed:
diff --git a/configure.ac b/configure.ac
index 0bae8cae71299aee4a2fb940873c2197b8280aa2..6bcb1d636c4da05144b6e93b9b7fc87e54a08a92 100644 (file)
--- a/configure.ac
+++ b/configure.ac
Makefile
src/Makefile
src/check-header-compile
-src/application/makefile
src/bind/makefile
src/debug/makefile
src/dialogs/makefile
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a956f6ad82d847629bbea539f911d48983b18676..f03f22c803e237af7efb463905adfdc684ad7874 100644 (file)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
SET(internalfolders\r
#algorithms\r
#api\r
-application\r
bind\r
debug\r
dialogs\r
diff --git a/src/Makefile.am b/src/Makefile.am
index 8cbbbf21b0c36b08f0e788fab602e00fde15edd9..0c585d6a9de38a2f9d5815be5755a2cec4319eb4 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
# 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
+++ /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
+++ /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
+++ /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
+++ /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
+++ /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
+++ /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
+++ /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
--- 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
+++ /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)
index 45d50b7a226d1f6beae99caaa2f0ca254a43eb32..097278995dc48078bc967127171c28f255b39244 100644 (file)
#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"
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;
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 3c9f7e5edc2a06272324aa8b422cae78914bbad3..17aa642b1681152f06f03e13737c8815b71b9bf7 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
#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"
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 c6a6bb3ab6fb01cf9a13b898f2fd98c8c1f9ca22..58c2f3f9a2af2d8c1b32d10adbaa6b19811ebf4a 100644 (file)
--- a/src/doxygen-main.cpp
+++ b/src/doxygen-main.cpp
/** \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]
*
index 9a461ab2dc8340f68ed1dabcbb84c3b9f5947bd8..4fe0b58492f6a452f8cf39543a03e642f7941450 100644 (file)
#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"
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 7958e23b5e47dcfe60720cf230d4ff7db617bab0..8dd4698b5f28c15014d68304f68458df40282e05 100644 (file)
#include "pdf-parser.h"
#include "document-private.h"
-#include "application/application.h"
+#include "inkscape.h"
#include "dialogs/dialog-events.h"
#include <gtk/gtkdialog.h>
}
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 50fcd3642a0eab67a58da51893cbf6a797f8cba6..f7cd6a09afb06e30f1811cd91eb8e23422171eb2 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
#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"
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);
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 c10581a9161e683a7cf052b0b68b43df7fe41965..8b31ba2670a95a78b86350fa20f3498e481b5b23 100644 (file)
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
#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"
# 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);
}
*(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);
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;
}
/**
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())) {
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())) {
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)) {
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())) {
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));
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));
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));
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)) {
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))
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;
}
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;
}
{
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 ++;
+ }
+ }
}
}
{
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;
}
SPDesktop *
inkscape_active_desktop (void)
{
- if (Inkscape::NSApplication::Application::getNewGui())
- return Inkscape::NSApplication::Editor::getActiveDesktop();
-
if (inkscape->desktops == NULL) {
return NULL;
}
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 d820927542f8dbaf072a366dadec3c20235d0adc..b0ae505390ebfdf7d283755e765f861d184d2911 100644 (file)
--- a/src/inkscape.h
+++ b/src/inkscape.h
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);
index a04ab05f00e39fa1f424141140e37e0e72260670..d8453c13781114a3bf2cd819d24f59142dd31d62 100644 (file)
#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"
{
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 78b66d8478766b185c65473e63c70a39e01e919c..605b0f677ee1523d40699816e9971353c3374a51 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
#define bind_textdomain_codeset(p,c)
#endif
-#include "application/application.h"
#include "main-cmdlineact.h"
#include "widgets/icon.h"
#include "ui/widget/panel.h"
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;
* 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
}
#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;
}
index 2483dc50e6b20388ad600baf92086bf2d89e8e96..72da46e29646cab6e08731a55521ff33baf7e6bb 100644 (file)
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
#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;
index 9cfb9c0b5c3defcd5e3b46e17ec01068bcae178c..c3ba9da9f0ee58530aa4645aea520f6a12a6e4c1 100644 (file)
#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"
index 85f078439735f52dd670912c4205688a1ffb17b3..884037c259f00303f53a71ee22239e4615d3cbdb 100644 (file)
#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"
index 0607871fd9bff5f7f96df53197d8a50515952c3f..86c8a92295333cb9f2a8af4802901663650a0966 100644 (file)
#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"
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);
index 812ce21ca8eba209cf366ab477460782d8ed6eb9..b3ab598d4e2f88dc20598122ed12a3e4047bb1cd 100644 (file)
## 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 \