summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2013-02-13 18:36:57 +0000
committer~suv <suv-sf@users.sourceforge.net>2013-02-13 18:36:57 +0000
commit77b788bb1c5fa861a3f12c76ad3f17bc8edc35b8 (patch)
tree441f798cf2c8cb3a760c1ecf259f5faff356124c /src/ui
parentchanges_2013_02_01b.patch (diff)
parentBuild. Adding unistd header (fixes compilation on Win32 with OpenSuse cross-c... (diff)
downloadinkscape-77b788bb1c5fa861a3f12c76ad3f17bc8edc35b8.tar.gz
inkscape-77b788bb1c5fa861a3f12c76ad3f17bc8edc35b8.zip
merge from trunk (r12122)
(bzr r11668.1.51)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/export.cpp5
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp22
-rw-r--r--src/ui/dialog/filedialogimpl-win32.h4
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp29
-rw-r--r--src/ui/dialog/font-substitution.cpp2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp18
-rw-r--r--src/ui/dialog/inkscape-preferences.h2
-rw-r--r--src/ui/tool/node-tool.cpp78
-rw-r--r--src/ui/view/edit-widget-interface.h3
-rw-r--r--src/ui/view/view.cpp17
-rw-r--r--src/ui/view/view.h5
-rw-r--r--src/ui/widget/style-swatch.cpp1
12 files changed, 88 insertions, 98 deletions
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index f267c5ae9..ecdfd3346 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -63,7 +63,12 @@
#include "helper/png-write.h"
+#if WITH_EXT_GDL
+#include <gdl/gdl-dock-item.h>
+#else
#include "libgdl/gdl-dock-item.h"
+#endif
+
// required to set status message after export
#include "desktop.h"
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index 6425d9fee..496836c4d 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -26,6 +26,9 @@
#include <gdk/gdkwin32.h>
#include <glib/gstdio.h>
#include <glibmm/i18n.h>
+#if GLIB_CHECK_VERSION(2,32,0)
+#include <glibmm/thread.h>
+#endif
#include <gtkmm/window.h>
//Inkscape includes
@@ -133,7 +136,11 @@ FileDialogBaseWin32::FileDialogBaseWin32(Gtk::Window &parent,
Glib::RefPtr<const Gdk::Window> parentWindow = parent.get_window();
g_assert(parentWindow->gobj() != NULL);
+#if WITH_GTKMM_3_0
+ _ownerHwnd = (HWND)gdk_win32_window_get_handle((GdkWindow*)parentWindow->gobj());
+#else
_ownerHwnd = (HWND)gdk_win32_drawable_get_handle((GdkDrawable*)parentWindow->gobj());
+#endif
}
FileDialogBaseWin32::~FileDialogBaseWin32()
@@ -1576,16 +1583,23 @@ FileOpenDialogImplWin32::show()
// We can only run one worker thread at a time
if(_mutex != NULL) return false;
+#if !GLIB_CHECK_VERSION(2,32,0)
if(!Glib::thread_supported())
Glib::thread_init();
+#endif
_result = false;
_finished = false;
_file_selected = false;
- _mutex = new Glib::Mutex();
_main_loop = g_main_loop_new(g_main_context_default(), FALSE);
+#if GLIB_CHECK_VERSION(2,32,0)
+ _mutex = new Glib::Threads::Mutex();
+ if(Glib::Threads::Thread::create(sigc::mem_fun(*this, &FileOpenDialogImplWin32::GetOpenFileName_thread)))
+#else
+ _mutex = new Glib::Mutex();
if(Glib::Thread::create(sigc::mem_fun(*this, &FileOpenDialogImplWin32::GetOpenFileName_thread), true))
+#endif
{
while(1)
{
@@ -1870,15 +1884,21 @@ void FileSaveDialogImplWin32::GetSaveFileName_thread()
bool
FileSaveDialogImplWin32::show()
{
+#if !GLIB_CHECK_VERSION(2,32,0)
if(!Glib::thread_supported())
Glib::thread_init();
+#endif
_result = false;
_main_loop = g_main_loop_new(g_main_context_default(), FALSE);
if(_main_loop != NULL)
{
+#if GLIB_CHECK_VERSION(2,32,0)
+ if(Glib::Threads::Thread::create(sigc::mem_fun(*this, &FileSaveDialogImplWin32::GetSaveFileName_thread)))
+#else
if(Glib::Thread::create(sigc::mem_fun(*this, &FileSaveDialogImplWin32::GetSaveFileName_thread), true))
+#endif
g_main_loop_run(_main_loop);
if(_result && _extension)
diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h
index 15953f9d8..e9d8829f7 100644
--- a/src/ui/dialog/filedialogimpl-win32.h
+++ b/src/ui/dialog/filedialogimpl-win32.h
@@ -226,7 +226,11 @@ private:
/// This mutex is used to ensure that the worker thread
/// that calls GetOpenFileName cannot collide with the
/// main Inkscape thread
+#if GLIB_CHECK_VERSION(2,32,0)
+ Glib::Threads::Mutex *_mutex;
+#else
Glib::Mutex *_mutex;
+#endif
/// The controller function for the thread which calls
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 418132abb..50f30e8f4 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1730,8 +1730,6 @@ bool FilterEffectsDialog::PrimitiveList::on_draw_signal(const Cairo::RefPtr<Cair
(bg_color_active.green + fg_color_active.green)/2.0,
(bg_color_active.blue + fg_color_active.blue)/2.0,
(bg_color_active.alpha + fg_color_active.alpha)/2.0};
-
- GdkRGBA black = {0,0,0,1};
#else
GtkStyle *style = gtk_widget_get_style(GTK_WIDGET(gobj()));
#endif
@@ -1902,11 +1900,7 @@ bool FilterEffectsDialog::PrimitiveList::on_draw_signal(const Cairo::RefPtr<Cair
// Draw drag connection
if(row_prim == prim && _in_drag) {
cr->save();
-#if GTK_CHECK_VERSION(3,0,0)
- gdk_cairo_set_source_rgba(cr->cobj(), &black);
-#else
- gdk_cairo_set_source_color(cr->cobj(), &(style->black));
-#endif
+ cr->set_source_rgb(0.0, 0.0, 0.0);
cr->move_to(outline_x, con_drag_y);
cr->line_to(mx, con_drag_y);
cr->line_to(mx, my);
@@ -1936,8 +1930,6 @@ void FilterEffectsDialog::PrimitiveList::draw_connection(const Cairo::RefPtr<Cai
(bg_color.green + fg_color.green)/2.0,
(bg_color.blue + fg_color.blue)/2.0,
(bg_color.alpha + fg_color.alpha)/2.0};
-
- GdkRGBA black = {0,0,0,1};
#else
GtkStyle *style = gtk_widget_get_style(GTK_WIDGET(gobj()));
#endif
@@ -1955,17 +1947,14 @@ void FilterEffectsDialog::PrimitiveList::draw_connection(const Cairo::RefPtr<Cai
const int tw = get_input_type_width();
gint end_x = text_start_x + tw * src_id + (int)(tw * 0.5f) + 1;
-#if GTK_CHECK_VERSION(3,0,0)
if(use_default && is_first)
- gdk_cairo_set_source_rgba(cr->cobj(), &mid_color);
- else
- gdk_cairo_set_source_rgba(cr->cobj(), &black);
+#if GTK_CHECK_VERSION(3,0,0)
+ gdk_cairo_set_source_rgba(cr->cobj(), &mid_color);
#else
- if(use_default && is_first)
- gdk_cairo_set_source_color(cr->cobj(), &(style->dark[GTK_STATE_NORMAL]));
- else
- gdk_cairo_set_source_color(cr->cobj(), &(style->black));
+ gdk_cairo_set_source_color(cr->cobj(), &(style->dark[GTK_STATE_NORMAL]));
#endif
+ else
+ cr->set_source_rgb(0.0, 0.0, 0.0);
cr->rectangle(end_x-2, y1-2, 5, 5);
cr->fill_preserve();
@@ -1993,11 +1982,7 @@ void FilterEffectsDialog::PrimitiveList::draw_connection(const Cairo::RefPtr<Cai
const int y2 = rct.get_y() + rct.get_height();
// Draw a bevelled 'L'-shaped connection
-#if GTK_CHECK_VERSION(3,0,0)
- gdk_cairo_set_source_rgba(cr->cobj(), &black);
-#else
- gdk_cairo_set_source_color(cr->cobj(), &(style->black));
-#endif
+ cr->set_source_rgb(0.0, 0.0, 0.0);
cr->move_to(x1, y1);
cr->line_to(x2-fheight/4, y1);
cr->line_to(x2, y1-fheight/4);
diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp
index 24588946e..07e73cec8 100644
--- a/src/ui/dialog/font-substitution.cpp
+++ b/src/ui/dialog/font-substitution.cpp
@@ -260,7 +260,7 @@ Glib::ustring FontSubstitution::getSubstituteFontName (Glib::ustring font)
font_instance *res = (font_factory::Default())->Face(descr);
if (res->pFont) {
PangoFontDescription *nFaceDesc = pango_font_describe(res->pFont);
- out = pango_font_description_get_family(nFaceDesc);
+ out = sp_font_description_get_family(nFaceDesc);
}
pango_font_description_free(descr);
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index d963e0c7f..57f815730 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -601,6 +601,24 @@ void InkscapePreferences::initPageUI()
_page_ui.add_line(false, "", _show_filters_info_box, "",
_("Show icons and descriptions for the filter primitives available at the filter effects dialog"));
+ {
+ Glib::ustring dockbarstyleLabels[] = {_("Icons only"), _("Text only"), _("Icons and text")};
+ int dockbarstyleValues[] = {0, 1, 2};
+
+ /* dockbar style */
+ _dockbar_style.init( "/options/dock/dockbarstyle", dockbarstyleLabels, dockbarstyleValues, G_N_ELEMENTS(dockbarstyleLabels), 0);
+ _page_ui.add_line(false, _("Dockbar style (requires restart):"), _dockbar_style, "",
+ _("Selects whether the vertical bars on the dockbar will show text labels, icons, or both"), false);
+
+ Glib::ustring switcherstyleLabels[] = {_("Text only"), _("Icons only"), _("Icons and text")}; /* see bug #1098437 */
+ int switcherstyleValues[] = {0, 1, 2};
+
+ /* switcher style */
+ _switcher_style.init( "/options/dock/switcherstyle", switcherstyleLabels, switcherstyleValues, G_N_ELEMENTS(switcherstyleLabels), 0);
+ _page_ui.add_line(false, _("Switcher style (requires restart):"), _switcher_style, "",
+ _("Selects whether the dockbar switcher will show text labels, icons, or both"), false);
+ }
+
// Windows
_win_save_geom.init ( _("Save and restore window geometry for each document"), "/options/savewindowgeometry/value", 1, true, 0);
_win_save_geom_prefs.init ( _("Remember and use last window's geometry"), "/options/savewindowgeometry/value", 2, false, &_win_save_geom);
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 690016556..b21ab0128 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -274,6 +274,8 @@ protected:
UI::Widget::PrefRadioButton _filter_quality_worse;
UI::Widget::PrefRadioButton _filter_quality_worst;
UI::Widget::PrefCheckButton _show_filters_info_box;
+ UI::Widget::PrefCombo _dockbar_style;
+ UI::Widget::PrefCombo _switcher_style;
UI::Widget::PrefSpinButton _rendering_cache_size;
UI::Widget::PrefSpinButton _filter_multi_threaded;
diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp
index 7b6502ec3..e743e0efc 100644
--- a/src/ui/tool/node-tool.cpp
+++ b/src/ui/tool/node-tool.cpp
@@ -107,8 +107,6 @@ using Inkscape::ControlManager;
namespace {
SPCanvasGroup *create_control_group(SPDesktop *d);
-void ink_node_tool_class_init(InkNodeToolClass *klass);
-void ink_node_tool_init(InkNodeTool *node_context);
void ink_node_tool_dispose(GObject *object);
void ink_node_tool_setup(SPEventContext *ec);
@@ -126,39 +124,10 @@ void handleControlUiStyleChange(InkNodeTool *nt);
} // anonymous namespace
-GType ink_node_tool_get_type()
-{
- static GType type = 0;
- if (!type) {
- GTypeInfo info = {
- sizeof(InkNodeToolClass),
- NULL, NULL,
- (GClassInitFunc) ink_node_tool_class_init,
- NULL, NULL,
- sizeof(InkNodeTool),
- 4,
- (GInstanceInitFunc) ink_node_tool_init,
- NULL, /* value_table */
- };
- type = g_type_register_static(SP_TYPE_EVENT_CONTEXT, "InkNodeTool", &info, (GTypeFlags)0);
- }
- return type;
-}
-
-namespace {
-
-SPCanvasGroup *create_control_group(SPDesktop *d)
-{
- return reinterpret_cast<SPCanvasGroup*>(sp_canvas_item_new(
- sp_desktop_controls(d), SP_TYPE_CANVAS_GROUP, NULL));
-}
-
-void destroy_group(SPCanvasGroup *g)
-{
- sp_canvas_item_destroy(SP_CANVAS_ITEM(g));
-}
+G_DEFINE_TYPE(InkNodeTool, ink_node_tool, SP_TYPE_EVENT_CONTEXT);
-void ink_node_tool_class_init(InkNodeToolClass *klass)
+static void
+ink_node_tool_class_init(InkNodeToolClass *klass)
{
GObjectClass *object_class = (GObjectClass *) klass;
SPEventContextClass *event_context_class = (SPEventContextClass *) klass;
@@ -171,7 +140,8 @@ void ink_node_tool_class_init(InkNodeToolClass *klass)
event_context_class->item_handler = ink_node_tool_item_handler;
}
-void ink_node_tool_init(InkNodeTool *nt)
+static void
+ink_node_tool_init(InkNodeTool *nt)
{
SPEventContext *event_context = SP_EVENT_CONTEXT(nt);
@@ -191,6 +161,19 @@ void ink_node_tool_init(InkNodeTool *nt)
new (&nt->_shape_editors) ShapeEditors();
}
+namespace {
+
+SPCanvasGroup *create_control_group(SPDesktop *d)
+{
+ return reinterpret_cast<SPCanvasGroup*>(sp_canvas_item_new(
+ sp_desktop_controls(d), SP_TYPE_CANVAS_GROUP, NULL));
+}
+
+void destroy_group(SPCanvasGroup *g)
+{
+ sp_canvas_item_destroy(SP_CANVAS_ITEM(g));
+}
+
void ink_node_tool_dispose(GObject *object)
{
InkNodeTool *nt = INK_NODE_TOOL(object);
@@ -228,15 +211,15 @@ void ink_node_tool_dispose(GObject *object)
delete nt->_node_message_context;
}
- G_OBJECT_CLASS(g_type_class_peek(g_type_parent(INK_TYPE_NODE_TOOL)))->dispose(object);
+ G_OBJECT_CLASS(ink_node_tool_parent_class)->dispose(object);
}
void ink_node_tool_setup(SPEventContext *ec)
{
InkNodeTool *nt = INK_NODE_TOOL(ec);
- SPEventContextClass *parent = (SPEventContextClass *) g_type_class_peek(g_type_parent(INK_TYPE_NODE_TOOL));
- if (parent->setup) parent->setup(ec);
+ if (SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->setup)
+ SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->setup(ec);
nt->_node_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack());
@@ -372,10 +355,8 @@ void ink_node_tool_set(SPEventContext *ec, Inkscape::Preferences::Entry *value)
nt->edit_masks = value->getBool();
ink_node_tool_selection_changed(nt, nt->desktop->selection);
} else {
- SPEventContextClass *parent_class =
- (SPEventContextClass *) g_type_class_peek(g_type_parent(INK_TYPE_NODE_TOOL));
- if (parent_class->set)
- parent_class->set(ec, value);
+ if (SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->set)
+ SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->set(ec, value);
}
}
@@ -556,9 +537,9 @@ gint ink_node_tool_root_handler(SPEventContext *event_context, GdkEvent *event)
default: break;
}
- SPEventContextClass *parent_class = (SPEventContextClass *) g_type_class_peek(g_type_parent(INK_TYPE_NODE_TOOL));
- if (parent_class->root_handler)
- return parent_class->root_handler(event_context, event);
+ if (SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->root_handler)
+ return SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->root_handler(event_context, event);
+
return FALSE;
}
@@ -622,10 +603,9 @@ void ink_node_tool_update_tip(InkNodeTool *nt, GdkEvent *event)
gint ink_node_tool_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event)
{
- SPEventContextClass *parent_class =
- (SPEventContextClass *) g_type_class_peek(g_type_parent(INK_TYPE_NODE_TOOL));
- if (parent_class->item_handler)
- return parent_class->item_handler(event_context, item, event);
+ if (SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->item_handler)
+ return SP_EVENT_CONTEXT_CLASS(ink_node_tool_parent_class)->item_handler(event_context, item, event);
+
return FALSE;
}
diff --git a/src/ui/view/edit-widget-interface.h b/src/ui/view/edit-widget-interface.h
index 412c7ff8c..26e47abbb 100644
--- a/src/ui/view/edit-widget-interface.h
+++ b/src/ui/view/edit-widget-interface.h
@@ -101,9 +101,6 @@ struct EditWidgetInterface
/// Update the "inactive desktop" indicator
virtual void deactivateDesktop() = 0;
- /// Set rulers to position
- virtual void viewSetPosition (Geom::Point p) = 0;
-
/// Update rulers from current values
virtual void updateRulers() = 0;
diff --git a/src/ui/view/view.cpp b/src/ui/view/view.cpp
index e13976cc4..72548e213 100644
--- a/src/ui/view/view.cpp
+++ b/src/ui/view/view.cpp
@@ -27,12 +27,6 @@ namespace UI {
namespace View {
static void
-_onPositionSet (double x, double y, View* v)
-{
- v->onPositionSet (x,y);
-}
-
-static void
_onResized (double x, double y, View* v)
{
v->onResized (x,y);
@@ -69,7 +63,6 @@ View::View()
_message_stack = GC::release(new Inkscape::MessageStack());
_tips_message_context = new Inkscape::MessageContext(_message_stack);
- _position_set_connection = _position_set_signal.connect (sigc::bind (sigc::ptr_fun (&_onPositionSet), this));
_resized_connection = _resized_signal.connect (sigc::bind (sigc::ptr_fun (&_onResized), this));
_redraw_requested_connection = _redraw_requested_signal.connect (sigc::bind (sigc::ptr_fun (&_onRedrawRequested), this));
@@ -102,16 +95,6 @@ void View::_close() {
Inkscape::Verb::delete_all_view (this);
}
-void View::setPosition (double x, double y)
-{
- _position_set_signal.emit (x,y);
-}
-
-void View::setPosition(Geom::Point const &p)
-{
- setPosition (double(p[Geom::X]), double(p[Geom::Y]));
-}
-
void View::emitResized (double width, double height)
{
_resized_signal.emit (width, height);
diff --git a/src/ui/view/view.h b/src/ui/view/view.h
index 6ed9f476c..48f4d2549 100644
--- a/src/ui/view/view.h
+++ b/src/ui/view/view.h
@@ -90,8 +90,6 @@ public:
Inkscape::MessageContext *tipsMessageContext() const
{ return _tips_message_context; }
- void setPosition(gdouble x, gdouble y);
- void setPosition(Geom::Point const &p);
void emitResized(gdouble width, gdouble height);
void requestRedraw();
@@ -101,7 +99,6 @@ public:
virtual void mouseover() = 0;
virtual void mouseout() = 0;
- virtual void onPositionSet (double, double) = 0;
virtual void onResized (double, double) = 0;
virtual void onRedrawRequested() = 0;
virtual void onStatusMessage (Inkscape::MessageType type, gchar const *message) = 0;
@@ -126,13 +123,11 @@ protected:
*/
virtual void setDocument(SPDocument *doc);
- sigc::signal<void,double,double> _position_set_signal;
sigc::signal<void,double,double> _resized_signal;
sigc::signal<void,gchar const*> _document_uri_set_signal;
sigc::signal<void> _redraw_requested_signal;
private:
- sigc::connection _position_set_connection;
sigc::connection _resized_connection;
sigc::connection _redraw_requested_connection;
sigc::connection _message_changed_connection; // foreign
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index 60d5f6ecc..44bceb826 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -28,6 +28,7 @@
#include "sp-radial-gradient-fns.h"
#include "sp-pattern.h"
#include "xml/repr.h"
+#include "xml/sp-css-attr.h"
#include "widgets/widget-sizes.h"
#include "helper/units.h"
#include "helper/action.h"