diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2012-06-17 07:08:03 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2012-06-17 07:08:03 +0000 |
| commit | aa042e930bc5cce596829086ce84f2c3c7c885ad (patch) | |
| tree | c04b14ad87ac3df0fe0b4f83146a0b1019922c76 /src/ui/widget/svg-canvas.cpp | |
| parent | Set GDL-3 as a fixed dependency for GTK+ 3 build. (diff) | |
| download | inkscape-aa042e930bc5cce596829086ce84f2c3c7c885ad.tar.gz inkscape-aa042e930bc5cce596829086ce84f2c3c7c885ad.zip | |
Removed outdated classes.
Pruned header to not introduce extraneous includes.
(bzr r11502)
Diffstat (limited to 'src/ui/widget/svg-canvas.cpp')
| -rw-r--r-- | src/ui/widget/svg-canvas.cpp | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/src/ui/widget/svg-canvas.cpp b/src/ui/widget/svg-canvas.cpp deleted file mode 100644 index 34724ece7..000000000 --- a/src/ui/widget/svg-canvas.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Authors: - * Ralf Stephan <ralf@ark.in-berlin.de> - * Jon A. Cruz <jon@joncruz.org> - * - * Copyright (C) 2005 The Authors - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include <gtkmm/widget.h> -#include "desktop.h" -#include "desktop-events.h" -#include "display/sp-canvas.h" -#include "display/canvas-arena.h" -#include "ui/widget/svg-canvas.h" - -namespace Inkscape { -namespace UI { -namespace Widget { - -SVGCanvas::SVGCanvas() -{ - void *canvas = g_object_new(SPCanvas::getType(), NULL); - _spcanvas = static_cast<SPCanvas*>(canvas); - _widget = Glib::wrap (static_cast<GtkWidget*> (canvas)); - _dt = 0; -} - -SVGCanvas::~SVGCanvas() -{ -} - -void -SVGCanvas::init (SPDesktop *dt) -{ - _dt = dt; - _widget->set_can_focus(); - - // Set background to white -#if WITH_GTKMM_3_0 - // TODO: Use Gtk::StyleContext instead - GtkWidget *c_widget = _widget->gobj(); - GtkStyle *style = gtk_widget_get_style(c_widget); - style->bg[GTK_STATE_NORMAL] = style->white; - gtk_widget_set_style(c_widget, style); -#else - Glib::RefPtr<Gtk::Style> style = _widget->get_style(); - style->set_bg(Gtk::STATE_NORMAL, style->get_white()); - _widget->set_style(style); - - // extension_events stuff is handled internally in GTK+ 3 - // TODO: Needs testing - _widget->set_extension_events(Gdk::EXTENSION_EVENTS_ALL); -#endif - - _widget->signal_event().connect(sigc::mem_fun(*this, &SVGCanvas::onEvent)); -} - -bool -SVGCanvas::onEvent (GdkEvent * ev) const -{ - g_assert (_dt); - - // Gdk::Event doesn't appear to be fully usable for this atm - if (ev->type == GDK_BUTTON_PRESS) { - // defocus any spinbuttons - _widget->grab_focus(); - } - - if ((ev->type == GDK_BUTTON_PRESS) && (ev->button.button == 3)) { - if (ev->button.state & GDK_SHIFT_MASK) { - sp_canvas_arena_set_sticky(SP_CANVAS_ARENA(_dt->drawing), true); - } else { - sp_canvas_arena_set_sticky(SP_CANVAS_ARENA(_dt->drawing), false); - } - } - - // The keypress events need to be passed to desktop handler explicitly, - // because otherwise the event contexts only receive keypresses when the mouse cursor - // is over the canvas. This redirection is only done for keypresses and only if there's no - // current item on the canvas, because item events and all mouse events are caught - // and passed on by the canvas acetate (I think). --bb - - if (ev->type == GDK_KEY_PRESS && !_spcanvas->current_item) { - return sp_desktop_root_handler(0, ev, _dt); - } - - return false; -} - -}}} - -/* - 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:textwidth=99 : |
