summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-02-06 08:19:53 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.marker.es>2013-02-06 08:19:53 +0000
commit549a79b5367ffd259a23fbd18e93199d1c0149b7 (patch)
tree9c4ce4a0217afa63b59f32d02a60b848f43a9520 /src/ui
parentMerge from branch (diff)
parentSupress Pango error message. (diff)
downloadinkscape-549a79b5367ffd259a23fbd18e93199d1c0149b7.tar.gz
inkscape-549a79b5367ffd259a23fbd18e93199d1c0149b7.zip
Merge from branch
(bzr r11950.1.19)
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/input.cpp2
-rw-r--r--src/ui/dialog/object-properties.cpp30
-rw-r--r--src/ui/dialog/object-properties.h1
-rw-r--r--src/ui/dialog/symbols.cpp3
-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
13 files changed, 92 insertions, 109 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/input.cpp b/src/ui/dialog/input.cpp
index 6aff67f69..1df0d606e 100644
--- a/src/ui/dialog/input.cpp
+++ b/src/ui/dialog/input.cpp
@@ -999,7 +999,7 @@ InputDialogImpl::ConfPanel::ConfPanel() :
titleLabel(""),
axisFrame(_("Axes")),
keysFrame(_("Keys")),
- modeLabel(_("Mode")),
+ modeLabel(_("Mode:")),
modeBox(false, 4)
{
diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp
index f0801734a..0800346f7 100644
--- a/src/ui/dialog/object-properties.cpp
+++ b/src/ui/dialog/object-properties.cpp
@@ -69,15 +69,25 @@ ObjectProperties::ObjectProperties (void) :
subselChangedConn()
{
//initialize labels for the table at the bottom of the dialog
- int_labels.push_back("onclick");
- int_labels.push_back("onmouseover");
- int_labels.push_back("onmouseout");
- int_labels.push_back("onmousedown");
- int_labels.push_back("onmouseup");
- int_labels.push_back("onmousemove");
- int_labels.push_back("onfocusin");
- int_labels.push_back("onfocusout");
- int_labels.push_back("onload");
+ int_attrs.push_back("onclick");
+ int_attrs.push_back("onmouseover");
+ int_attrs.push_back("onmouseout");
+ int_attrs.push_back("onmousedown");
+ int_attrs.push_back("onmouseup");
+ int_attrs.push_back("onmousemove");
+ int_attrs.push_back("onfocusin");
+ int_attrs.push_back("onfocusout");
+ int_attrs.push_back("onload");
+
+ int_labels.push_back("onclick:");
+ int_labels.push_back("onmouseover:");
+ int_labels.push_back("onmouseout:");
+ int_labels.push_back("onmousedown:");
+ int_labels.push_back("onmouseup:");
+ int_labels.push_back("onmousemove:");
+ int_labels.push_back("onfocusin:");
+ int_labels.push_back("onfocusout:");
+ int_labels.push_back("onload:");
desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectProperties::setTargetDesktop) );
deskTrack.connect(GTK_WIDGET(gobj()));
@@ -291,7 +301,7 @@ void ObjectProperties::widget_setup(void)
if (CurrentItem == NULL)
{
- attrTable.set_object(obj, int_labels, int_labels, (GtkWidget*)EInteractivity.gobj());
+ attrTable.set_object(obj, int_labels, int_attrs, (GtkWidget*)EInteractivity.gobj());
}
else
{
diff --git a/src/ui/dialog/object-properties.h b/src/ui/dialog/object-properties.h
index 0bf622ce4..a04c62bec 100644
--- a/src/ui/dialog/object-properties.h
+++ b/src/ui/dialog/object-properties.h
@@ -67,6 +67,7 @@ public:
private:
bool blocked;
SPItem *CurrentItem; //to store the current item, for not wasting resources
+ std::vector<Glib::ustring> int_attrs;
std::vector<Glib::ustring> int_labels;
Gtk::Table TopTable; //the table with the object properties
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index 71674368b..97d8b0523 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -432,6 +432,9 @@ void SymbolsDialog::get_symbols() {
GSList* SymbolsDialog::symbols_in_doc_recursive (SPObject *r, GSList *l)
{
+ if (!r) {
+ return l;
+ }
// Stop multiple counting of same symbol
if( SP_IS_USE(r) ) {
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