summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiam P. White <inkscapebronyat-signgmaildotcom>2014-03-02 21:29:52 +0000
committerLiam P. White <inkscapebronyat-signgmaildotcom>2014-03-02 21:29:52 +0000
commit8830d1ad5ab0693313d760cc99e2df0f35c9f6d9 (patch)
treefa4a009d301ce0558041dd2e019e86c23981aa52 /src
parentAttempt at merging certaing features of Ponyscape to trunk (will not link) (diff)
downloadinkscape-8830d1ad5ab0693313d760cc99e2df0f35c9f6d9.tar.gz
inkscape-8830d1ad5ab0693313d760cc99e2df0f35c9f6d9.zip
Updated to include (non-functional) Objects dialogue
(bzr r13090.1.6)
Diffstat (limited to 'src')
-rw-r--r--src/menus-skeleton.h1
-rw-r--r--src/ui/dialog/objects.cpp41
-rw-r--r--src/ui/widget/Makefile_insert4
-rw-r--r--src/ui/widget/highlight-picker.cpp32
4 files changed, 76 insertions, 2 deletions
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index 3fcb77207..855b7774b 100644
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
@@ -179,6 +179,7 @@ static char const menus_skeleton[] =
" <verb verb-id=\"DialogLayers\" />\n"
" </submenu>\n"
" <submenu name=\"" N_("_Object") "\">\n"
+" <verb verb-id=\"DialogObjects\" />\n"
" <verb verb-id=\"DialogFillStroke\" />\n"
" <verb verb-id=\"DialogObjectProperties\" />\n"
" <verb verb-id=\"DialogSymbols\" />\n"
diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp
index 5023a8813..ebfa16f02 100644
--- a/src/ui/dialog/objects.cpp
+++ b/src/ui/dialog/objects.cpp
@@ -37,6 +37,7 @@
#include "ui/widget/insertordericon.h"
#include "ui/widget/clipmaskicon.h"
#include "ui/widget/highlight-picker.h"
+#include "ui/tools/node-tool.h"
#include "verbs.h"
#include "widgets/icon.h"
#include "xml/node.h"
@@ -54,6 +55,7 @@
#include "sp-clippath.h"
#include "sp-mask.h"
#include "layer-manager.h"
+#include "tools-switch.h"
//#define DUMP_LAYERS 1
@@ -2037,6 +2039,9 @@ void ObjectsPanel::setDesktop( SPDesktop* desktop )
} //namespace UI
} //namespace Inkscape
+//should be okay to put these here because they are never referenced anywhere else
+using namespace Inkscape::UI::Tools;
+
guint get_group0_keyval(GdkEventKey *event) {
guint keyval = 0;
gdk_keymap_translate_keyboard_state(gdk_keymap_get_for_display(
@@ -2046,6 +2051,42 @@ guint get_group0_keyval(GdkEventKey *event) {
return keyval;
}
+void SPItem::setHighlightColor(guint32 const color)
+{
+ g_free(_highlightColor);
+ if (color & 0x000000ff)
+ {
+ _highlightColor = g_strdup_printf("%u", color);
+ }
+ else
+ {
+ _highlightColor = NULL;
+ }
+
+ NodeTool *tool = 0;
+ if (SP_ACTIVE_DESKTOP ) {
+ ToolBase *ec = SP_ACTIVE_DESKTOP->event_context;
+ if (INK_IS_NODE_TOOL(ec)) {
+ tool = static_cast<NodeTool*>(ec);
+ tools_switch(tool->desktop, TOOLS_NODES);
+ }
+ }
+}
+
+void SPItem::unsetHighlightColor()
+{
+ g_free(_highlightColor);
+ _highlightColor = NULL;
+ NodeTool *tool = 0;
+ if (SP_ACTIVE_DESKTOP ) {
+ ToolBase *ec = SP_ACTIVE_DESKTOP->event_context;
+ if (INK_IS_NODE_TOOL(ec)) {
+ tool = static_cast<NodeTool*>(ec);
+ tools_switch(tool->desktop, TOOLS_NODES);
+ }
+ }
+}
+
/*
Local Variables:
mode:c++
diff --git a/src/ui/widget/Makefile_insert b/src/ui/widget/Makefile_insert
index e388b27f5..2c543c5cc 100644
--- a/src/ui/widget/Makefile_insert
+++ b/src/ui/widget/Makefile_insert
@@ -87,4 +87,6 @@ ink_common_sources += \
ui/widget/highlight-picker.cpp \
ui/widget/highlight-picker.h \
ui/widget/layertypeicon.cpp \
- ui/widget/layertypeicon.h
+ ui/widget/layertypeicon.h \
+ ui/widget/insertordericon.cpp \
+ ui/widget/insertordericon.h
diff --git a/src/ui/widget/highlight-picker.cpp b/src/ui/widget/highlight-picker.cpp
index b799b5e29..bf93fa960 100644
--- a/src/ui/widget/highlight-picker.cpp
+++ b/src/ui/widget/highlight-picker.cpp
@@ -157,11 +157,41 @@ HighlightPicker::activate_vfunc(GdkEvent* event,
return false;
}
-
} // namespace Widget
} // namespace UI
} // namespace Inkscape
+//should be okay to put this here
+/**
+ * Converts GdkPixbuf's data to premultiplied ARGB.
+ * This function will convert a GdkPixbuf in place into Cairo's native pixel format.
+ * Note that this is a hack intended to save memory. When the pixbuf is in Cairo's format,
+ * using it with GTK will result in corrupted drawings.
+ */
+void
+convert_pixbuf_normal_to_argb32(GdkPixbuf *pb)
+{
+ convert_pixels_pixbuf_to_argb32(
+ gdk_pixbuf_get_pixels(pb),
+ gdk_pixbuf_get_width(pb),
+ gdk_pixbuf_get_height(pb),
+ gdk_pixbuf_get_rowstride(pb));
+}
+
+/**
+ * Converts GdkPixbuf's data back to its native format.
+ * Once this is done, the pixbuf can be used with GTK again.
+ */
+void
+convert_pixbuf_argb32_to_normal(GdkPixbuf *pb)
+{
+ convert_pixels_argb32_to_pixbuf(
+ gdk_pixbuf_get_pixels(pb),
+ gdk_pixbuf_get_width(pb),
+ gdk_pixbuf_get_height(pb),
+ gdk_pixbuf_get_rowstride(pb));
+}
+
/*
Local Variables:
mode:c++