summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2019-01-09 08:23:13 +0000
committerTavmjong Bah <tavmjong@free.fr>2019-01-09 08:23:13 +0000
commitf2c80f158a4ddd444cc585323623f91900b0ec1c (patch)
tree95c66f5d69183bd4cdc34b355b63b25cbf42f418
parentAdd default croatian file (diff)
downloadinkscape-f2c80f158a4ddd444cc585323623f91900b0ec1c.tar.gz
inkscape-f2c80f158a4ddd444cc585323623f91900b0ec1c.zip
Remove helper/window.h helper/window.cpp
-rw-r--r--src/helper/CMakeLists.txt2
-rw-r--r--src/helper/window.cpp62
-rw-r--r--src/helper/window.h47
-rw-r--r--src/ui/interface.cpp13
4 files changed, 11 insertions, 113 deletions
diff --git a/src/helper/CMakeLists.txt b/src/helper/CMakeLists.txt
index 992fd9763..f0af43167 100644
--- a/src/helper/CMakeLists.txt
+++ b/src/helper/CMakeLists.txt
@@ -22,7 +22,6 @@ set(helper_SRC
png-write.cpp
stock-items.cpp
#units-test.cpp
- window.cpp
# we generate this file and it's .h counter-part
${sp_marshal_SRC}
@@ -43,7 +42,6 @@ set(helper_SRC
pixbuf-ops.h
png-write.h
stock-items.h
- window.h
)
set_source_files_properties(sp_marshal_SRC PROPERTIES GENERATED true)
diff --git a/src/helper/window.cpp b/src/helper/window.cpp
deleted file mode 100644
index d51e92358..000000000
--- a/src/helper/window.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/** @file
- * Generic window implementation
- *//*
- * Authors:
- * see git history
- * Lauris Kaplinski <lauris@kaplinski.com>
- *
- * Copyright (C) 2017 Authors
- * Released under GNU GPL v2+, read the file 'COPYING' for more information.
- */
-
-#include <glibmm.h>
-#include <gtkmm/window.h>
-
-#include "desktop.h"
-#include "inkscape.h"
-#include "shortcuts.h"
-#include "window.h"
-
-static bool on_window_key_press(GdkEventKey* event)
-{
- unsigned shortcut = 0;
- shortcut = sp_shortcut_get_for_event(event);
- return sp_shortcut_invoke (shortcut, SP_ACTIVE_DESKTOP);
-}
-
-Gtk::Window * Inkscape::UI::window_new (const gchar *title, unsigned int resizeable)
-{
- Gtk::Window *window = new Gtk::Window(Gtk::WINDOW_TOPLEVEL);
- window->set_title (title);
- window->set_resizable (resizeable);
- window->signal_key_press_event().connect(sigc::ptr_fun(&on_window_key_press));
-
- return window;
-}
-
-static gboolean sp_window_key_press(GtkWidget *, GdkEventKey *event)
-{
- return on_window_key_press(event);
-}
-
-GtkWidget * sp_window_new (const gchar *title, unsigned int resizeable)
-{
- GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title ((GtkWindow *) window, title);
- gtk_window_set_resizable ((GtkWindow *) window, resizeable);
- g_signal_connect_after ((GObject *) window, "key_press_event", (GCallback) sp_window_key_press, NULL);
-
- return window;
-}
-
-/*
- 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:fileencoding=utf-8 :
diff --git a/src/helper/window.h b/src/helper/window.h
deleted file mode 100644
index cd303d0b9..000000000
--- a/src/helper/window.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/** @file
- * TODO: insert short description here
- *//*
- * Authors:
- * see git history
- * Lauris Kaplinski <lauris@kaplinski.com>
- *
- * Copyright (C) 2014 Authors
- * Released under GNU GPL v2+, read the file 'COPYING' for more information.
- */
-#ifndef SEEN_SP_WINDOW_H
-#define SEEN_SP_WINDOW_H
-
-struct _GtkWidget;
-typedef _GtkWidget GtkWidget;
-
-namespace Gtk {
-class Window;
-}
-
-// Can we just get rid of this altogether?
-#if defined(GCC_VERSION) || defined(__clang__)
-__attribute__((deprecated))
-#endif
-GtkWidget * sp_window_new (const gchar *title, unsigned int resizeable);
-
-namespace Inkscape {
-namespace UI {
-
-Gtk::Window *window_new (const gchar *title, unsigned int resizeable);
-
-}
-}
-
-#endif // !SEEN_SP_WINDOW_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:fileencoding=utf-8 :
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 61398a788..b02186152 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -46,7 +46,7 @@
#include "extension/input.h"
#include "helper/action.h"
-#include "helper/window.h"
+
#include "ui/icon-loader.h"
#include "io/sys.h"
@@ -140,13 +140,22 @@ static void sp_ui_menu_item_set_name(GtkWidget *data,
Glib::ustring const &name);
static void sp_recent_open(GtkRecentChooser *, gpointer);
+static bool sp_on_window_key_press(GdkEventKey* event)
+{
+ unsigned shortcut = 0;
+ shortcut = sp_shortcut_get_for_event(event);
+ return sp_shortcut_invoke (shortcut, SP_ACTIVE_DESKTOP);
+}
+
void
sp_create_window(SPViewWidget *vw, bool editable)
{
g_return_if_fail(vw != nullptr);
g_return_if_fail(SP_IS_VIEW_WIDGET(vw));
- Gtk::Window *win = Inkscape::UI::window_new("", TRUE);
+ Gtk::Window *win = new Gtk::Window(Gtk::WINDOW_TOPLEVEL);
+ win->set_resizable(true);
+ win->signal_key_press_event().connect(sigc::ptr_fun(&sp_on_window_key_press));
gtk_container_add(GTK_CONTAINER(win->gobj()), GTK_WIDGET(vw));
gtk_widget_show(GTK_WIDGET(vw));