summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c4e405b)
raw | patch | inline | side by side (parent: c4e405b)
| author | joncruz <joncruz@users.sourceforge.net> | |
| Sun, 24 Feb 2008 00:55:22 +0000 (00:55 +0000) | ||
| committer | joncruz <joncruz@users.sourceforge.net> | |
| Sun, 24 Feb 2008 00:55:22 +0000 (00:55 +0000) |
20 files changed:
index d96583f8522000347371fd92ee2d5d9cbedca2d3..4ba31b4130d7e0f4df6abae620df4681ff20510b 100644 (file)
/* font */
font_instance *font = sp_font_selector_get_font (SP_FONT_SELECTOR (fontsel));
- if ( font ) {
- Glib::ustring fontName = font_factory::Default()->ConstructFontSpecification(font);
- sp_repr_css_set_property (css, "-inkscape-font-specification", fontName.c_str());
-
- gchar c[256];
-
- font->Family(c, 256);
- sp_repr_css_set_property (css, "font-family", c);
+ if ( font ) {
+ Glib::ustring fontName = font_factory::Default()->ConstructFontSpecification(font);
+ sp_repr_css_set_property (css, "-inkscape-font-specification", fontName.c_str());
- font->Attribute( "weight", c, 256);
- sp_repr_css_set_property (css, "font-weight", c);
+ gchar c[256];
- font->Attribute("style", c, 256);
- sp_repr_css_set_property (css, "font-style", c);
+ font->Family(c, 256);
+ sp_repr_css_set_property (css, "font-family", c);
- font->Attribute("stretch", c, 256);
- sp_repr_css_set_property (css, "font-stretch", c);
+ font->Attribute( "weight", c, 256);
+ sp_repr_css_set_property (css, "font-weight", c);
- font->Attribute("variant", c, 256);
- sp_repr_css_set_property (css, "font-variant", c);
+ font->Attribute("style", c, 256);
+ sp_repr_css_set_property (css, "font-style", c);
- Inkscape::CSSOStringStream os;
- os << sp_font_selector_get_size (SP_FONT_SELECTOR (fontsel)) << "px"; // must specify px, see inkscape bug 1221626 and 1610103
- sp_repr_css_set_property (css, "font-size", os.str().c_str());
+ font->Attribute("stretch", c, 256);
+ sp_repr_css_set_property (css, "font-stretch", c);
- font->Unref();
- font=NULL;
- }
+ font->Attribute("variant", c, 256);
+ sp_repr_css_set_property (css, "font-variant", c);
+
+ Inkscape::CSSOStringStream os;
+ os << sp_font_selector_get_size (SP_FONT_SELECTOR (fontsel)) << "px"; // must specify px, see inkscape bug 1221626 and 1610103
+ sp_repr_css_set_property (css, "font-size", os.str().c_str());
+
+ font->Unref();
+ font=NULL;
+ }
/* Layout */
GtkWidget *b = (GtkWidget*)g_object_get_data (G_OBJECT (dlg), "text_anchor_start");
sp_repr_css_set_property (css, "text-align", "center");
} else {
// Align Right
- b = (GtkWidget*)g_object_get_data ( G_OBJECT (dlg),
+ b = (GtkWidget*)g_object_get_data ( G_OBJECT (dlg),
"text_anchor_end");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (b))) {
sp_repr_css_set_property (css, "text-anchor", "end");
SPStyle *query = sp_style_new (SP_ACTIVE_DOCUMENT);
// query style from desktop into it. This returns a result flag and fills query with the style of subselection, if any, or selection
int result_fontspec = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_FONT_SPECIFICATION);
- int result_family = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_FONTFAMILY);
- int result_style = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_FONTSTYLE);
+ int result_family = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_FONTFAMILY);
+ int result_style = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_FONTSTYLE);
int result_numbers = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_FONTNUMBERS);
// If querying returned nothing, read the style from the text tool prefs (default style for new texts)
}
// FIXME: process result_family/style == QUERY_STYLE_MULTIPLE_DIFFERENT by showing "Many" in the lists
-
+
// Get a font_instance using the font-specification attribute stored in SPStyle if available
font_instance *font = font_factory::Default()->FaceFromStyle(query);
-
+
if (font) {
// the font is oversized, so we need to pass the true size separately
sp_font_selector_set_font (SP_FONT_SELECTOR (fontsel), font, query->font_size.computed);
sp_font_preview_set_font (SP_FONT_PREVIEW (preview), font, SP_FONT_SELECTOR(fontsel));
- font->Unref();
- font=NULL;
+ font->Unref();
+ font=NULL;
}
GtkWidget *b;
diff --git a/src/document.cpp b/src/document.cpp
index fb160fd9ef5de74432c883de046928ebe386832c..cdebaabba09fa3e6bf9e8f1a319f16aecc727941 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
}
-void SPDocument::add_persp3d (Persp3D * const persp)
+void SPDocument::add_persp3d (Persp3D * const /*persp*/)
{
SPDefs *defs = SP_ROOT(this->root)->defs;
for (SPObject *i = sp_object_first_child(SP_OBJECT(defs)); i != NULL; i = SP_OBJECT_NEXT(i) ) {
persp3d_create_xml_element (this);
}
-void SPDocument::remove_persp3d (Persp3D * const persp)
+void SPDocument::remove_persp3d (Persp3D * const /*persp*/)
{
// TODO: Delete the repr, maybe perform a check if any boxes are still linked to the perspective.
// Anything else?
void
SPDocument::addUndoObserver(Inkscape::UndoStackObserver& observer)
{
- this->priv->undoStackObservers.add(observer);
+ this->priv->undoStackObservers.add(observer);
}
void
SPDocument::removeUndoObserver(Inkscape::UndoStackObserver& observer)
{
- this->priv->undoStackObservers.remove(observer);
+ this->priv->undoStackObservers.remove(observer);
}
SPObject *SPDocument::getObjectById(gchar const *id) {
if ( NULL == document_language || *document_language == 0 ) {
document_language = getenv ("LANG");
}
-
+
if ( NULL != document_language ) {
gchar *pos = strchr(document_language, '_');
if ( NULL != pos ) {
}
/**
- * Tries to update the document state based on the modified and
+ * Tries to update the document state based on the modified and
* "update required" flags, and return true if the document has
* been brought fully up to date.
*/
@@ -959,7 +959,7 @@ find_item_at_point(unsigned int dkey, SPGroup *group, NR::Point const p, gboolea
if (upto && SP_ITEM(o) == upto)
break;
- if (SP_IS_GROUP(o) && (SP_GROUP(o)->effectiveLayerMode(dkey) == SPGroup::LAYER || into_groups)) {
+ if (SP_IS_GROUP(o) && (SP_GROUP(o)->effectiveLayerMode(dkey) == SPGroup::LAYER || into_groups)) {
// if nothing found yet, recurse into the group
newseen = find_item_at_point(dkey, SP_GROUP(o), p, into_groups, take_insensitive, upto);
if (newseen) {
@@ -1051,8 +1051,8 @@ sp_document_items_at_points(SPDocument *document, unsigned const key, std::vecto
{
GSList *items = NULL;
- // When picking along the path, we don't want small objects close together
- // (such as hatching strokes) to obscure each other by their deltas,
+ // When picking along the path, we don't want small objects close together
+ // (such as hatching strokes) to obscure each other by their deltas,
// so we temporarily set delta to a small value
gdouble saved_delta = prefs_get_double_attribute ("options.cursortolerance", "value", 1.0);
prefs_set_double_attribute ("options.cursortolerance", "value", 0.25);
index 58d19be325fa79740dee78654349ec22e983febf..f94084e4f2d118a2e01a91cf6925630e9a670efd 100644 (file)
for (unsigned int i=0 ; i<rows ; i++)
{
for (unsigned int j=0 ; j<other.cols ; j++)
- {
- double sum = 0.0;
+ {
+ double sum = 0.0;
for (unsigned int k=0 ; k<cols ; k++)
{
//sum += a[i][k] * b[k][j];
SVDMatrix result(cols, rows);
for (unsigned int i=0 ; i<rows ; i++)
for (unsigned int j=0 ; j<cols ; j++)
- result(j, i) = d[i*cols + j];
+ result(j, i) = d[i*cols + j];
return result;
}
* Get some fun facts from the transform
*/
static void analyzeTransform(NR::Matrix &tf,
- double &rotate, double &xskew, double &yskew,
- double &xscale, double &yscale)
+ double &rotate, double &/*xskew*/, double &/*yskew*/,
+ double &xscale, double &yscale)
{
SVDMatrix mat(2, 2);
mat(0, 0) = tf[0];
if (s)
buf.append(s);
}
-
+
for (Inkscape::XML::Node *child = node->firstChild() ;
child != NULL; child = child->next())
{
Glib::ustring value = iter->second;
if (name.size() > 0 && value.size()>0)
{
- outs.printf(" <%#s>%#s</%#s>\n",
+ outs.printf(" <%#s>%#s</%#s>\n",
name.c_str(), value.c_str(), name.c_str());
}
}
code = bp->code;
NR::Point const p1(bp->c(1) * tf);
- NR::Point const p2(bp->c(2) * tf);
- NR::Point const p3(bp->c(3) * tf);
- double x1 = (p1[NR::X] - xoff) * 1000.0;
+ NR::Point const p2(bp->c(2) * tf);
+ NR::Point const p3(bp->c(3) * tf);
+ double x1 = (p1[NR::X] - xoff) * 1000.0;
if (fabs(x1)<1.0) x1=0.0;
- double y1 = (p1[NR::Y] - yoff) * 1000.0;
+ double y1 = (p1[NR::Y] - yoff) * 1000.0;
if (fabs(y1)<1.0) y1=0.0;
- double x2 = (p2[NR::X] - xoff) * 1000.0;
+ double x2 = (p2[NR::X] - xoff) * 1000.0;
if (fabs(x2)<1.0) x2=0.0;
- double y2 = (p2[NR::Y] - yoff) * 1000.0;
+ double y2 = (p2[NR::Y] - yoff) * 1000.0;
if (fabs(y2)<1.0) y2=0.0;
- double x3 = (p3[NR::X] - xoff) * 1000.0;
+ double x3 = (p3[NR::X] - xoff) * 1000.0;
if (fabs(x3)<1.0) x3=0.0;
- double y3 = (p3[NR::Y] - yoff) * 1000.0;
+ double y3 = (p3[NR::Y] - yoff) * 1000.0;
if (fabs(y3)<1.0) y3=0.0;
destx = x3;
desty = y3;
bool OdfOutput::processGradient(Writer &outs, SPItem *item,
- const Glib::ustring &id, NR::Matrix &tf)
+ const Glib::ustring &id, NR::Matrix &/*tf*/)
{
if (!item)
return false;
outs.printf(" draw:textarea-horizontal-align=\"center\" ");
outs.printf("draw:textarea-vertical-align=\"middle\"/>\n");
outs.printf("</style:style>\n\n");
-
+
return true;
}
couts.printf("draw:layer=\"layout\" svg:x=\"%.3fcm\" svg:y=\"%.3fcm\" ",
bbox_x, bbox_y);
- couts.printf("svg:width=\"%.3fcm\" svg:height=\"%.3fcm\" ",
- bbox_width, bbox_height);
- couts.printf("svg:viewBox=\"0.0 0.0 %.3f %.3f\"\n",
- bbox_width * 1000.0, bbox_height * 1000.0);
+ couts.printf("svg:width=\"%.3fcm\" svg:height=\"%.3fcm\" ",
+ bbox_width, bbox_height);
+ couts.printf("svg:viewBox=\"0.0 0.0 %.3f %.3f\"\n",
+ bbox_width * 1000.0, bbox_height * 1000.0);
- couts.printf(" svg:d=\"");
- int nrPoints = writePath(couts, SP_CURVE_BPATH(curve),
+ couts.printf(" svg:d=\"");
+ int nrPoints = writePath(couts, SP_CURVE_BPATH(curve),
tf, bbox_x, bbox_y);
- couts.printf("\"");
+ couts.printf("\"");
- couts.printf(">\n");
+ couts.printf(">\n");
couts.printf(" <!-- %d nodes -->\n", nrPoints);
couts.printf("</draw:path>\n\n");
* Descends into the SVG tree, mapping things to ODF when appropriate
*/
void
-OdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *uri)
+OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gchar const *uri)
{
reset();
* Make sure that we are in the database
*/
bool
-OdfOutput::check (Inkscape::Extension::Extension *module)
+OdfOutput::check (Inkscape::Extension::Extension */*module*/)
{
/* We don't need a Key
if (NULL == Inkscape::Extension::db.get(SP_MODULE_KEY_OUTPUT_POV))
index acfb6ed303b1bbaf6ddbfaa4fddccf901933296a..f44a514a1e4b69ffe89a88f1be04d468c3e92364 100644 (file)
-#define __SP_PIXBUF_OPS_C__\r
-\r
-/*\r
- * Helpers for SPItem -> gdk_pixbuf related stuff\r
- *\r
- * Authors:\r
- * John Cliff <simarilius@yahoo.com>\r
- *\r
- * Copyright (C) 2008 John Cliff\r
- *\r
- * Released under GNU GPL, read the file 'COPYING' for more information\r
- */\r
-\r
-#ifdef HAVE_CONFIG_H\r
-# include "config.h"\r
-#endif\r
-\r
-#include <interface.h>\r
-#include <libnr/nr-pixops.h>\r
-#include <glib.h>\r
-#include <glib/gmessages.h>\r
-#include <png.h>\r
-#include "png-write.h"\r
-#include <display/nr-arena-item.h>\r
-#include <display/nr-arena.h>\r
-#include <document.h>\r
-#include <sp-item.h>\r
-#include <sp-root.h>\r
-#include <sp-defs.h>\r
-\r
-#include "libnr/nr-matrix-translate-ops.h"\r
-#include "libnr/nr-scale-ops.h"\r
-#include "libnr/nr-scale-translate-ops.h"\r
-#include "libnr/nr-translate-matrix-ops.h"\r
-#include "libnr/nr-translate-scale-ops.h"\r
-\r
-#include "pixbuf-ops.h"\r
-\r
-/**\r
- * Hide all items that are not listed in list, recursively, skipping groups and defs.\r
- */\r
-static void\r
-hide_other_items_recursively(SPObject *o, GSList *list, unsigned dkey)\r
-{\r
- if ( SP_IS_ITEM(o)\r
- && !SP_IS_DEFS(o)\r
- && !SP_IS_ROOT(o)\r
- && !SP_IS_GROUP(o)\r
- && !g_slist_find(list, o) )\r
- {\r
- sp_item_invoke_hide(SP_ITEM(o), dkey);\r
- }\r
-\r
- // recurse\r
- if (!g_slist_find(list, o)) {\r
- for (SPObject *child = sp_object_first_child(o) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {\r
- hide_other_items_recursively(child, list, dkey);\r
- }\r
- }\r
-}\r
-\r
-\r
-// The following is a mutation of the flood fill code, the marker preview, and random other samplings.\r
-// The dpi settings dont do anything yet, but I want them to, and was wanting to keep reasonably close\r
-// to the call for the interface to the png writing.\r
-\r
-bool\r
-sp_export_jpg_file(SPDocument *doc, gchar const *filename,\r
- double x0, double y0, double x1, double y1,\r
- unsigned width, unsigned height, double xdpi, double ydpi,\r
- unsigned long bgcolor, double quality,GSList *items)\r
-\r
-{\r
-\r
-\r
- GdkPixbuf* pixbuf;\r
- pixbuf = sp_generate_internal_bitmap(doc, filename, x0, y0, x1, y1,\r
- width, height, xdpi, ydpi,\r
- bgcolor, items );\r
-\r
-\r
- gchar c[32];\r
- g_snprintf(c, 32, "%f", quality);\r
- gboolean saved = gdk_pixbuf_save (pixbuf, filename, "jpeg", NULL, "quality", c, NULL);\r
- g_free(c);\r
- if (saved) return true;\r
- else return false;\r
-}\r
-
-GdkPixbuf*\r
-sp_generate_internal_bitmap(SPDocument *doc, gchar const *filename,\r
- double x0, double y0, double x1, double y1,\r
- unsigned width, unsigned height, double xdpi, double ydpi,\r
- unsigned long bgcolor,\r
- GSList *items_only)\r
-\r
-{\r
-\r
-\r
- /* Create new arena */\r
- NRArena *arena = NRArena::create();\r
- unsigned dkey = sp_item_display_key_new(1);\r
-\r
- sp_document_ensure_up_to_date (doc);\r
-\r
- NR::Rect screen=NR::Rect(NR::Point(x0,y0), NR::Point(x1, y1));\r
-\r
- double zoom_scale = 1.0;\r
- double padding = 1.0;\r
-\r
- width = (int)ceil(screen.extent(NR::X) * zoom_scale * padding);\r
- height = (int)ceil(screen.extent(NR::Y) * zoom_scale * padding);\r
-\r
- NR::Point origin(screen.min()[NR::X],\r
- sp_document_height(doc) - screen.extent(NR::Y) - screen.min()[NR::Y]);\r
-\r
- origin[NR::X] = origin[NR::X] + (screen.extent(NR::X) * ((1 - padding) / 2));\r
- origin[NR::Y] = origin[NR::Y] + (screen.extent(NR::Y) * ((1 - padding) / 2));\r
-\r
- NR::scale scale(zoom_scale, zoom_scale);\r
- NR::Matrix affine = scale * NR::translate(-origin * scale);\r
-\r
- /* Create ArenaItems and set transform */\r
- NRArenaItem *root = sp_item_invoke_show(SP_ITEM(sp_document_root(doc)), arena, dkey, SP_ITEM_SHOW_DISPLAY);\r
- nr_arena_item_set_transform(NR_ARENA_ITEM(root), affine);\r
-\r
- NRGC gc(NULL);\r
- nr_matrix_set_identity(&gc.transform);\r
-\r
- // We show all and then hide all items we don't want, instead of showing only requested items,\r
- // because that would not work if the shown item references something in defs\r
- if (items_only) {\r
- hide_other_items_recursively(sp_document_root(doc), items_only, dkey);\r
- }\r
-\r
- NRRectL final_bbox;\r
- final_bbox.x0 = 0;\r
- final_bbox.y0 = 0;//row;\r
- final_bbox.x1 = width;\r
- final_bbox.y1 = height;//row + num_rows;\r
-\r
- nr_arena_item_invoke_update(root, &final_bbox, &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_NONE);\r
-\r
- guchar *px = g_new(guchar, 4 * width * height);\r
-\r
- NRPixBlock B;\r
- nr_pixblock_setup_extern( &B, NR_PIXBLOCK_MODE_R8G8B8A8N,\r
- final_bbox.x0, final_bbox.y0, final_bbox.x1, final_bbox.y1,\r
- px, 4 * width, FALSE, FALSE );\r
-\r
- unsigned char dtc[4];\r
- dtc[0] = NR_RGBA32_R(bgcolor);\r
- dtc[1] = NR_RGBA32_G(bgcolor);\r
- dtc[2] = NR_RGBA32_B(bgcolor);\r
- dtc[3] = NR_RGBA32_A(bgcolor);\r
-\r
- for (unsigned int fy = 0; fy < height; fy++) {\r
- guchar *p = NR_PIXBLOCK_PX(&B) + fy * B.rs;\r
- for (unsigned int fx = 0; fx < width; fx++) {\r
- for (int i = 0; i < 4; i++) {\r
- *p++ = dtc[i];\r
- }\r
- }\r
- }\r
-\r
- nr_arena_item_invoke_render(NULL, root, &final_bbox, &B, NR_ARENA_ITEM_RENDER_NO_CACHE );\r
-\r
- GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(px, GDK_COLORSPACE_RGB,\r
- TRUE,\r
- 8, width, height, width * 4,\r
- (GdkPixbufDestroyNotify)g_free,\r
- NULL);\r
-\r
-// gdk_pixbuf_save (pixbuf, "C:\\temp\\internal.jpg", "jpeg", NULL, "quality","100", NULL);\r
-\r
- return pixbuf;\r
-}\r
-\r
-/*\r
- Local Variables:\r
- mode:c++\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :\r
+#define __SP_PIXBUF_OPS_C__
+
+/*
+ * Helpers for SPItem -> gdk_pixbuf related stuff
+ *
+ * Authors:
+ * John Cliff <simarilius@yahoo.com>
+ *
+ * Copyright (C) 2008 John Cliff
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <interface.h>
+#include <libnr/nr-pixops.h>
+#include <glib.h>
+#include <glib/gmessages.h>
+#include <png.h>
+#include "png-write.h"
+#include <display/nr-arena-item.h>
+#include <display/nr-arena.h>
+#include <document.h>
+#include <sp-item.h>
+#include <sp-root.h>
+#include <sp-defs.h>
+
+#include "libnr/nr-matrix-translate-ops.h"
+#include "libnr/nr-scale-ops.h"
+#include "libnr/nr-scale-translate-ops.h"
+#include "libnr/nr-translate-matrix-ops.h"
+#include "libnr/nr-translate-scale-ops.h"
+
+#include "pixbuf-ops.h"
+
+/**
+ * Hide all items that are not listed in list, recursively, skipping groups and defs.
+ */
+static void
+hide_other_items_recursively(SPObject *o, GSList *list, unsigned dkey)
+{
+ if ( SP_IS_ITEM(o)
+ && !SP_IS_DEFS(o)
+ && !SP_IS_ROOT(o)
+ && !SP_IS_GROUP(o)
+ && !g_slist_find(list, o) )
+ {
+ sp_item_invoke_hide(SP_ITEM(o), dkey);
+ }
+
+ // recurse
+ if (!g_slist_find(list, o)) {
+ for (SPObject *child = sp_object_first_child(o) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ hide_other_items_recursively(child, list, dkey);
+ }
+ }
+}
+
+
+// The following is a mutation of the flood fill code, the marker preview, and random other samplings.
+// The dpi settings dont do anything yet, but I want them to, and was wanting to keep reasonably close
+// to the call for the interface to the png writing.
+
+bool
+sp_export_jpg_file(SPDocument *doc, gchar const *filename,
+ double x0, double y0, double x1, double y1,
+ unsigned width, unsigned height, double xdpi, double ydpi,
+ unsigned long bgcolor, double quality,GSList *items)
+
+{
+
+
+ GdkPixbuf* pixbuf;
+ pixbuf = sp_generate_internal_bitmap(doc, filename, x0, y0, x1, y1,
+ width, height, xdpi, ydpi,
+ bgcolor, items );
+
+
+ gchar c[32];
+ g_snprintf(c, 32, "%f", quality);
+ gboolean saved = gdk_pixbuf_save (pixbuf, filename, "jpeg", NULL, "quality", c, NULL);
+ g_free(c);
+ if (saved) return true;
+ else return false;
+}
+
+GdkPixbuf*
+sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/,
+ double x0, double y0, double x1, double y1,
+ unsigned width, unsigned height, double /*xdpi*/, double /*ydpi*/,
+ unsigned long bgcolor,
+ GSList *items_only)
+
+{
+
+
+ /* Create new arena */
+ NRArena *arena = NRArena::create();
+ unsigned dkey = sp_item_display_key_new(1);
+
+ sp_document_ensure_up_to_date (doc);
+
+ NR::Rect screen=NR::Rect(NR::Point(x0,y0), NR::Point(x1, y1));
+
+ double zoom_scale = 1.0;
+ double padding = 1.0;
+
+ width = (int)ceil(screen.extent(NR::X) * zoom_scale * padding);
+ height = (int)ceil(screen.extent(NR::Y) * zoom_scale * padding);
+
+ NR::Point origin(screen.min()[NR::X],
+ sp_document_height(doc) - screen.extent(NR::Y) - screen.min()[NR::Y]);
+
+ origin[NR::X] = origin[NR::X] + (screen.extent(NR::X) * ((1 - padding) / 2));
+ origin[NR::Y] = origin[NR::Y] + (screen.extent(NR::Y) * ((1 - padding) / 2));
+
+ NR::scale scale(zoom_scale, zoom_scale);
+ NR::Matrix affine = scale * NR::translate(-origin * scale);
+
+ /* Create ArenaItems and set transform */
+ NRArenaItem *root = sp_item_invoke_show(SP_ITEM(sp_document_root(doc)), arena, dkey, SP_ITEM_SHOW_DISPLAY);
+ nr_arena_item_set_transform(NR_ARENA_ITEM(root), affine);
+
+ NRGC gc(NULL);
+ nr_matrix_set_identity(&gc.transform);
+
+ // We show all and then hide all items we don't want, instead of showing only requested items,
+ // because that would not work if the shown item references something in defs
+ if (items_only) {
+ hide_other_items_recursively(sp_document_root(doc), items_only, dkey);
+ }
+
+ NRRectL final_bbox;
+ final_bbox.x0 = 0;
+ final_bbox.y0 = 0;//row;
+ final_bbox.x1 = width;
+ final_bbox.y1 = height;//row + num_rows;
+
+ nr_arena_item_invoke_update(root, &final_bbox, &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_NONE);
+
+ guchar *px = g_new(guchar, 4 * width * height);
+
+ NRPixBlock B;
+ nr_pixblock_setup_extern( &B, NR_PIXBLOCK_MODE_R8G8B8A8N,
+ final_bbox.x0, final_bbox.y0, final_bbox.x1, final_bbox.y1,
+ px, 4 * width, FALSE, FALSE );
+
+ unsigned char dtc[4];
+ dtc[0] = NR_RGBA32_R(bgcolor);
+ dtc[1] = NR_RGBA32_G(bgcolor);
+ dtc[2] = NR_RGBA32_B(bgcolor);
+ dtc[3] = NR_RGBA32_A(bgcolor);
+
+ for (unsigned int fy = 0; fy < height; fy++) {
+ guchar *p = NR_PIXBLOCK_PX(&B) + fy * B.rs;
+ for (unsigned int fx = 0; fx < width; fx++) {
+ for (int i = 0; i < 4; i++) {
+ *p++ = dtc[i];
+ }
+ }
+ }
+
+ nr_arena_item_invoke_render(NULL, root, &final_bbox, &B, NR_ARENA_ITEM_RENDER_NO_CACHE );
+
+ GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(px, GDK_COLORSPACE_RGB,
+ TRUE,
+ 8, width, height, width * 4,
+ (GdkPixbufDestroyNotify)g_free,
+ NULL);
+
+// gdk_pixbuf_save (pixbuf, "C:\\temp\\internal.jpg", "jpeg", NULL, "quality","100", NULL);
+
+ return pixbuf;
+}
+
+/*
+ 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:encoding=utf-8:textwidth=99 :
index f0eb84e5f1e0fcaddd12d02963be7dc0ebccd11e..336f42425b020b43869fd4852221cecfdebe0d5c 100644 (file)
}
Gtk::Widget *
-BoolParam::param_newWidget(Gtk::Tooltips * tooltips)
+BoolParam::param_newWidget(Gtk::Tooltips * /*tooltips*/)
{
- Inkscape::UI::Widget::RegisteredCheckButton * checkwdg = Gtk::manage(
+ Inkscape::UI::Widget::RegisteredCheckButton * checkwdg = Gtk::manage(
new Inkscape::UI::Widget::RegisteredCheckButton( param_label,
param_tooltip,
param_key,
index a0ce04487494c14d449824b64a27cd2a1f5fdffc..f800017b8dbecf003b10662f84c390eb89941742 100644 (file)
}
Gtk::Widget *
-ScalarParam::param_newWidget(Gtk::Tooltips * tooltips)
+ScalarParam::param_newWidget(Gtk::Tooltips * /*tooltips*/)
{
Inkscape::UI::Widget::RegisteredScalar *rsu = Gtk::manage( new Inkscape::UI::Widget::RegisteredScalar(
param_label, param_tooltip, param_key, *param_wr, param_effect->getRepr(), param_effect->getSPDoc() ) );
index 26f1868a94a6a400f5596eafd85c12f46d2e471e..d5efc7ce3852c31da10d134305e68304b7760335 100644 (file)
}
void
-RandomParam::param_set_default()
+RandomParam::param_set_default()
{
param_set_value(defvalue, defseed);
}
void
-RandomParam::param_set_value(gdouble val, long newseed)
+RandomParam::param_set_value(gdouble val, long newseed)
{
value = val;
if (integer)
}
void
-RandomParam::param_set_range(gdouble min, gdouble max)
+RandomParam::param_set_range(gdouble min, gdouble max)
{
this->min = min;
this->max = max;
Gtk::Widget *
-RandomParam::param_newWidget(Gtk::Tooltips * tooltips)
+RandomParam::param_newWidget(Gtk::Tooltips * /*tooltips*/)
{
- Inkscape::UI::Widget::RegisteredRandom* regrandom = Gtk::manage(
+ Inkscape::UI::Widget::RegisteredRandom* regrandom = Gtk::manage(
new Inkscape::UI::Widget::RegisteredRandom( param_label,
param_tooltip,
param_key,
index 84f71970cf12745cb97fe20e1684060734bd8d28..8b506a45e002e3d2ace79b6c7f73786fb0373145 100644 (file)
* Hugo Rodrigues <haa.rodrigues@gmail.com>
* Niko Kiirala <niko@kiirala.com>
* Felipe Corrêa da Silva Sanches <felipe.sanches@gmail.com>
- *
+ *
* Copyright (C) 2006, 2007, 2008 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
sp_object_read_attr(object, "amplitude");
sp_object_read_attr(object, "exponent");
sp_object_read_attr(object, "offset");
-
+
//is this necessary?
sp_document_add_resource(document, "fefuncnode", object); //maybe feFuncR, fefuncG, feFuncB and fefuncA ?
repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
}
+ (void)fefuncnode;
/*
TODO: I'm not sure what to do here...
index 0b00546391dc3268abf3b0b135dca059723f3a27..d8ee639e44e3677008d9bbe2be534211e05b7bd2 100644 (file)
}
static void
-sp_feComponentTransfer_init(SPFeComponentTransfer *feComponentTransfer)
+sp_feComponentTransfer_init(SPFeComponentTransfer */*feComponentTransfer*/)
{}
/**
@@ -140,18 +140,18 @@ sp_feComponentTransfer_child_added(SPObject *object, Inkscape::XML::Node *child,
sp_feComponentTransfer_children_modified(f);
object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
-
+
/**
* Callback for remove_child event.
*/
static void
sp_feComponentTransfer_remove_child(SPObject *object, Inkscape::XML::Node *child)
-{
+{
SPFeComponentTransfer *f = SP_FECOMPONENTTRANSFER(object);
if (((SPObjectClass *) feComponentTransfer_parent_class)->remove_child)
- (* ((SPObjectClass *) feComponentTransfer_parent_class)->remove_child)(object, child);
+ (* ((SPObjectClass *) feComponentTransfer_parent_class)->remove_child)(object, child);
sp_feComponentTransfer_children_modified(f);
object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -177,7 +177,7 @@ sp_feComponentTransfer_set(SPObject *object, unsigned int key, gchar const *valu
(void)feComponentTransfer;
switch(key) {
- /*DEAL WITH SETTING ATTRIBUTES HERE*/
+ /*DEAL WITH SETTING ATTRIBUTES HERE*/
default:
if (((SPObjectClass *) feComponentTransfer_parent_class)->set)
((SPObjectClass *) feComponentTransfer_parent_class)->set(object, key, value);
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 6b61e3246ebb1d6af7a800b443171a1ac7eca3c2..65d8b997c729130a31a37a8b2130f05e51052a29 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
item->_clip_ref_connection.disconnect();
item->_mask_ref_connection.disconnect();
- // Note: do this here before the clip_ref is deleted, since calling
- // sp_document_ensure_up_to_date for triggered routing may reference
+ // Note: do this here before the clip_ref is deleted, since calling
+ // sp_document_ensure_up_to_date for triggered routing may reference
// the deleted clip_ref.
if (item->avoidRef) {
delete item->avoidRef;
@@ -744,27 +744,27 @@ sp_item_invoke_bbox_full(SPItem const *item, NR::Maybe<NR::Rect> *bbox, NR::Matr
sp_clippath_get_bbox(SP_CLIPPATH(item->clip_ref->getObject()), &b, transform, flags);
nr_rect_d_intersect (&temp_bbox, &temp_bbox, &b);
}
-
+
if (temp_bbox.x0 > temp_bbox.x1 || temp_bbox.y0 > temp_bbox.y1) {
// We'll assume here that when x0 > x1 or y0 > y1, the bbox is "nothing"
// However it has never been explicitely defined this way for NRRects
// (as opposed to NR::Maybe<NR::Rect>)
*bbox = NR::Nothing();
return;
- }
-
+ }
+
if (temp_bbox.x0 == temp_bbox.y0 == NR_HUGE && temp_bbox.x1 == temp_bbox.y1 == -NR_HUGE) {
// The bbox hasn't been touched by the SPItemClass' bbox method
// or it has explicitely been set to be like this (e.g. in sp_shape_bbox)
*bbox = NR::Nothing();
return;
}
-
+
// Do not use temp_bbox.upgrade() here, because it uses a test that returns NR::Nothing
// for any rectangle with zero area. The geometrical bbox of for example a vertical line
- // would therefore be translated into NR::Nothing (see bug https://bugs.launchpad.net/inkscape/+bug/168684)
+ // would therefore be translated into NR::Nothing (see bug https://bugs.launchpad.net/inkscape/+bug/168684)
NR::Maybe<NR::Rect> temp_bbox_new = NR::Rect(NR::Point(temp_bbox.x0, temp_bbox.y0), NR::Point(temp_bbox.x1, temp_bbox.y1));
-
+
*bbox = NR::union_bounds(*bbox, temp_bbox_new);
}
sp_item_convert_to_guides(SPItem *item) {
SPDesktop *dt = inkscape_active_desktop();
SPNamedView *nv = sp_desktop_namedview(dt);
+ (void)nv;
gchar const *prefs_bbox = prefs_get_string_attribute("tools", "bounding_box");
SPItem::BBoxType bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::RENDERING_BBOX;
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index cc7adeaa8250ed8ab1a2f089aa44dca94033bdf7..268150a16002816c7f8d95657251cf44c3d49659 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
if (!namedview_type) {
GTypeInfo namedview_info = {
sizeof(SPNamedViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
+ NULL, /* base_init */
+ NULL, /* base_finalize */
(GClassInitFunc) sp_namedview_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
sizeof(SPNamedView),
- 16, /* n_preallocs */
+ 16, /* n_preallocs */
(GInstanceInitFunc) sp_namedview_init,
- NULL, /* value_table */
+ NULL, /* value_table */
};
namedview_type = g_type_register_static(SP_TYPE_OBJECTGROUP, "SPNamedView", &namedview_info, (GTypeFlags)0);
}
new (&nv->snap_manager) SnapManager(nv);
}
-static void sp_namedview_generate_old_grid(SPNamedView * nv, SPDocument *document, Inkscape::XML::Node *repr) {
+static void sp_namedview_generate_old_grid(SPNamedView * /*nv*/, SPDocument *document, Inkscape::XML::Node *repr) {
bool old_grid_settings_present = false;
// set old settings
@@ -246,7 +246,7 @@ static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape:
sp_object_read_attr(object, "inkscape:window-x");
sp_object_read_attr(object, "inkscape:window-y");
sp_object_read_attr(object, "inkscape:snap-global");
- sp_object_read_attr(object, "inkscape:snap-bbox");
+ sp_object_read_attr(object, "inkscape:snap-bbox");
sp_object_read_attr(object, "inkscape:snap-nodes");
sp_object_read_attr(object, "inkscape:snap-guide");
sp_object_read_attr(object, "inkscape:snap-center");
@@ -255,7 +255,7 @@ static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape:
sp_object_read_attr(object, "inkscape:object-paths");
sp_object_read_attr(object, "inkscape:object-nodes");
sp_object_read_attr(object, "inkscape:bbox-paths");
- sp_object_read_attr(object, "inkscape:bbox-nodes");
+ sp_object_read_attr(object, "inkscape:bbox-nodes");
sp_object_read_attr(object, "inkscape:current-layer");
sp_object_read_attr(object, "inkscape:connector-spacing");
@@ -398,12 +398,12 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va
}
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_BORDEROPACITY:
+ case SP_ATTR_BORDEROPACITY:
nv->bordercolor = (nv->bordercolor & 0xffffff00) | (DEFAULTBORDERCOLOR & 0xff);
sp_nv_read_opacity(value, &nv->bordercolor);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
- case SP_ATTR_PAGECOLOR:
+ case SP_ATTR_PAGECOLOR:
nv->pagecolor = (nv->pagecolor & 0xff) | (DEFAULTPAGECOLOR & 0xffffff00);
if (value) {
nv->pagecolor = (nv->pagecolor & 0xff) | sp_svg_read_color(value, nv->pagecolor);
@@ -456,7 +456,7 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
case SP_ATTR_INKSCAPE_SNAP_BBOX:
- nv->snap_manager.setSnapModeBBox(value ? sp_str_to_bool(value) : FALSE);
+ nv->snap_manager.setSnapModeBBox(value ? sp_str_to_bool(value) : FALSE);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
case SP_ATTR_INKSCAPE_SNAP_NODES:
@@ -492,7 +492,7 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
case SP_ATTR_INKSCAPE_BBOX_NODES:
- nv->snap_manager.object.setSnapToBBoxNode(value ? sp_str_to_bool(value) : FALSE);
+ nv->snap_manager.object.setSnapToBBoxNode(value ? sp_str_to_bool(value) : FALSE);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
case SP_ATTR_INKSCAPE_CURRENT_LAYER:
diff --git a/src/trace/siox.h b/src/trace/siox.h
index 5d6059d3ce84c3dabb5eccb437b491ef97130e24..42fd304219237be2f1772d9a30efeb9eec6bc0ff 100644 (file)
--- a/src/trace/siox.h
+++ b/src/trace/siox.h
* If the coordinates are out of range, do nothing.
*/
virtual void setPixel(unsigned int x, unsigned int y,
- unsigned int a,
- unsigned int r,
+ unsigned int a,
+ unsigned int r,
unsigned int g,
unsigned int b);
* Confidence matrix data
*/
float *cmdata;
-
+
private:
/**
* Informs the observer how much has been completed.
* Return false if the processing should be aborted.
*/
- virtual bool progress(float percentCompleted)
+ virtual bool progress(float /*percentCompleted*/)
{
return true;
}
* Send an error string to the Observer. Processing will
* be halted.
*/
- virtual void error(const std::string &msg)
+ virtual void error(const std::string &/*msg*/)
{
}
*/
static const float FOREGROUND_CONFIDENCE; //=0.8f;
- /**
+ /**
* Confidence for foreground or background type being equally likely.
*/
static const float UNKNOWN_REGION_CONFIDENCE; //=0.5f;
diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp
index 925e4e195de41aa2068d7f20fc56645ab0197563..5833db4fd7b1a55db98152d9cab183ef285c97af 100644 (file)
--- a/src/trace/trace.cpp
+++ b/src/trace/trace.cpp
* Informs the observer how much has been completed.
* Return false if the processing should be aborted.
*/
- virtual bool progress(float percentCompleted)
+ virtual bool progress(float /*percentCompleted*/)
{
//Tracer *tracer = (Tracer *)context;
//## Allow the GUI to update
* Send an error string to the Observer. Processing will
* be halted.
*/
- virtual void error(const std::string &msg)
+ virtual void error(const std::string &/*msg*/)
{
//Tracer *tracer = (Tracer *)context;
}
{
//g_message("hit!\n");
//dumpMap->setPixelLong(dumpMap, col, row, 0L);
- simage.setConfidence(col, row,
+ simage.setConfidence(col, row,
Siox::UNKNOWN_REGION_CONFIDENCE);
}
else
msgStack->flash(Inkscape::NORMAL_MESSAGE, _("Trace: Starting trace..."));
desktop->updateCanvasNow();
-
+
std::vector<TracingEngineResult> results =
engine->trace(pixbuf);
//printf("nrPaths:%d\n", results.size());
index 4846158a712fa7faea9706d9e20214060971ab9d..2767a32d198c30d765ca41b16bce655edbf99036 100644 (file)
public :
struct Coeffs {
double mx0, mx1, my0, my1;
- double sx0, sx1, sy0, sy1;
+ double sx0, sx1, sy0, sy1;
};
ActionAlign(const Glib::ustring &id,
const Glib::ustring &tiptext,
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
if (changed) {
- sp_document_done ( sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done ( sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Distribute"));
}
}
{
if (!_dialog.getDesktop()) return;
- SPEventContext *event_context = sp_desktop_event_context(_dialog.getDesktop());
- if (!SP_IS_NODE_CONTEXT (event_context)) return ;
+ SPEventContext *event_context = sp_desktop_event_context(_dialog.getDesktop());
+ if (!SP_IS_NODE_CONTEXT (event_context)) return ;
if (_distribute)
SP_NODE_CONTEXT (event_context)->shape_editor->distribute(_orientation);
dialog.removeOverlap_table(), dialog.tooltips(), dialog)
{
dialog.removeOverlap_table().set_col_spacings(3);
-
+
removeOverlapXGap.set_digits(1);
removeOverlapXGap.set_size_request(60, -1);
removeOverlapXGap.set_increments(1.0, 5.0);
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Remove overlaps"));
}
};
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Arrange connector network"));
}
};
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done (sp_desktop_document (_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Unclump"));
}
};
sp_document_ensure_up_to_date(sp_desktop_document (desktop));
NR::Maybe<NR::Rect> item_box = sp_item_bbox_desktop (*it);
if (item_box) {
- // find new center, staying within bbox
+ // find new center, staying within bbox
double x = _dialog.randomize_bbox->min()[NR::X] + item_box->extent(NR::X)/2 +
g_random_double_range (0, _dialog.randomize_bbox->extent(NR::X) - item_box->extent(NR::X));
double y = _dialog.randomize_bbox->min()[NR::Y] + item_box->extent(NR::Y)/2 +
// restore compensation setting
prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation);
- sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Randomize positions"));
}
};
}
if (changed) {
- sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Distribute text baselines"));
}
}
if (changed) {
- sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+ sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
_("Align text baselines"));
}
}
-void on_tool_changed(Inkscape::Application *inkscape, SPEventContext *context, AlignAndDistribute *daad)
+void on_tool_changed(Inkscape::Application */*inkscape*/, SPEventContext */*context*/, AlignAndDistribute *daad)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (desktop && sp_desktop_event_context(desktop))
daad->setMode(tools_active(desktop) == TOOLS_NODES);
}
-void on_selection_changed(Inkscape::Application *inkscape, Inkscape::Selection *selection, AlignAndDistribute *daad)
+void on_selection_changed(Inkscape::Application */*inkscape*/, Inkscape::Selection */*selection*/, AlignAndDistribute *daad)
{
daad->randomize_bbox = NR::Nothing();
}
@@ -774,7 +774,7 @@ void on_selection_changed(Inkscape::Application *inkscape, Inkscape::Selection *
-AlignAndDistribute::AlignAndDistribute()
+AlignAndDistribute::AlignAndDistribute()
: UI::Widget::Panel ("", "dialogs.align", SP_VERB_DIALOG_ALIGN_DISTRIBUTE),
randomize_bbox(NR::Nothing()),
_alignFrame(_("Align")),
on_tool_changed (NULL, NULL, this); // set current mode
}
-AlignAndDistribute::~AlignAndDistribute()
+AlignAndDistribute::~AlignAndDistribute()
{
sp_signal_disconnect_by_data (G_OBJECT (INKSCAPE), this);
@@ -1055,7 +1055,7 @@ void AlignAndDistribute::addBaselineButton(const Glib::ustring &id, const Glib::
{
_actionList.push_back(
new ActionBaseline(
- id, tiptext, row, col,
+ id, tiptext, row, col,
*this, table, orientation, distribute));
}
index 7d2242802ed4f07d955f8c7be03288a1c66a4a90..1361b49772f66a076f1ec3372f9a7d747a3bb27c 100644 (file)
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
*
* Authors:
* Bryce W. Harrington <bryce@bryceharrington.org>
- * buliabyak@gmail.com
+ * buliabyak@gmail.com
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
* Gustav Broberg <broberg@kth.se>
*
namespace Dialog {
void
-sp_retransientize(Inkscape::Application *inkscape, SPDesktop *desktop, gpointer dlgPtr)
+sp_retransientize(Inkscape::Application */*inkscape*/, SPDesktop *desktop, gpointer dlgPtr)
{
Dialog *dlg = (Dialog *)dlgPtr;
dlg->onDesktopActivated (desktop);
}
void
-sp_dialog_shutdown(GtkObject *object, gpointer dlgPtr)
+sp_dialog_shutdown(GtkObject */*object*/, gpointer dlgPtr)
{
Dialog *dlg = (Dialog *)dlgPtr;
dlg->onShutdown();
}
-void hideCallback(GtkObject *object, gpointer dlgPtr)
+void hideCallback(GtkObject */*object*/, gpointer dlgPtr)
{
g_return_if_fail( dlgPtr != NULL );
dlg->onHideF12();
}
-void unhideCallback(GtkObject *object, gpointer dlgPtr)
+void unhideCallback(GtkObject */*object*/, gpointer dlgPtr)
{
g_return_if_fail( dlgPtr != NULL );
*/
Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_path, int verb_num,
- Glib::ustring const &apply_label)
+ Glib::ustring const &apply_label)
: _hiddenF12 (false),
_prefs_path (prefs_path),
_verb_num(verb_num),
@@ -109,7 +109,7 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat
_title = title;
_behavior = behavior_factory(*this);
-
+
if (Inkscape::NSApplication::Application::getNewGui()) {
_desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::mem_fun (*this, &Dialog::onDesktopActivated));
_dialogs_hidden_connection = Inkscape::NSApplication::Editor::connectDialogsHidden (sigc::mem_fun (*this, &Dialog::onHideF12));
_dialogs_unhidden_connection.disconnect();
_shutdown_connection.disconnect();
}
-
+
save_geometry();
delete _behavior;
}
_behavior->onDesktopActivated(desktop);
}
-void
+void
Dialog::onShutdown()
{
save_geometry();
if (w != 0 && h != 0) {
resize(w, h);
}
-
+
// If there are stored values for where the dialog should be
// located, then restore the dialog to that position.
// also check if (x,y) is actually onscreen with the current screen dimensions
}
bool
-Dialog::_onDeleteEvent(GdkEventAny *event)
+Dialog::_onDeleteEvent(GdkEventAny */*event*/)
{
save_geometry();
_user_hidden = true;
event.window = dlg->window;
event.send_event = TRUE;
- if (event.window)
+ if (event.window)
g_object_ref(G_OBJECT(event.window));
gtk_main_do_event ((GdkEvent*)&event);
- if (event.window)
+ if (event.window)
g_object_unref(G_OBJECT(event.window));
}
index 13ce20abe8fcd453e330ac08327b9445b1251474..4f6fe64bc06a58a4960ce9763d4fc996db5343ff 100644 (file)
Behavior(dialog),
_dock_item(*SP_ACTIVE_DESKTOP->getDock(),
Inkscape::Verb::get(dialog._verb_num)->get_id(), dialog._title.c_str(),
- (Inkscape::Verb::get(dialog._verb_num)->get_image() ?
+ (Inkscape::Verb::get(dialog._verb_num)->get_image() ?
Inkscape::Verb::get(dialog._verb_num)->get_image() : ""),
static_cast<Widget::DockItem::State>(
- prefs_get_int_attribute (_dialog._prefs_path, "state",
+ prefs_get_int_attribute (_dialog._prefs_path, "state",
UI::Widget::DockItem::DOCKED_STATE)))
{
// Connect signals
}
void
-DockBehavior::present()
+DockBehavior::present()
{
bool was_attached = _dock_item.isAttached();
}
void
-DockBehavior::show()
-{
+DockBehavior::show()
+{
_dock_item.show();
}
-void
+void
DockBehavior::show_all_children()
{
get_vbox()->show_all_children();
}
-void
+void
DockBehavior::get_position(int &x, int &y)
-{
+{
_dock_item.get_position(x, y);
}
-void
+void
DockBehavior::get_size(int &width, int &height)
-{
+{
_dock_item.get_size(width, height);
}
void
-DockBehavior::resize(int width, int height)
+DockBehavior::resize(int width, int height)
{
_dock_item.resize(width, height);
}
_dock_item.set_size_request(width, height);
}
-void
+void
DockBehavior::size_request(Gtk::Requisition &requisition)
-{
+{
_dock_item.size_request(requisition);
}
void
DockBehavior::set_sensitive(bool sensitive)
{
+ // TODO check this. Seems to be bad that we ignore the parameter
get_vbox()->set_sensitive();
}
}
void
-DockBehavior::_onStateChanged(Widget::DockItem::State prev_state,
+DockBehavior::_onStateChanged(Widget::DockItem::State /*prev_state*/,
Widget::DockItem::State new_state)
{
+// TODO probably need to avoid window calls unless the state is different. Check.
prefs_set_int_attribute (_dialog._prefs_path, "state", new_state);
if (new_state == Widget::DockItem::FLOATING_STATE) {
#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
if (prefs_get_int_attribute ( "options.dialogsontopwin32", "value", 0))
transient_policy = 2;
- else
+ else
return;
-#endif
+#endif
- if (!transient_policy)
+ if (!transient_policy)
return;
Gtk::Window *floating_win = _dock_item.getWindow();
if (GtkWindow *dialog_win = floating_win->gobj()) {
_dialog.retransientize_suppress = true; // disallow other attempts to retranzientize this dialog
-
+
desktop->setWindowTransient (dialog_win);
/*
/* Signal wrappers */
-Glib::SignalProxy0<void>
+Glib::SignalProxy0<void>
DockBehavior::signal_show() { return _dock_item.signal_show(); }
-Glib::SignalProxy0<void>
+Glib::SignalProxy0<void>
DockBehavior::signal_hide() { return _dock_item.signal_hide(); }
-Glib::SignalProxy1<bool, GdkEventAny *>
+Glib::SignalProxy1<bool, GdkEventAny *>
DockBehavior::signal_delete_event() { return _dock_item.signal_delete_event(); }
Glib::SignalProxy0<void>
index b4199c6784e205c9960efc802f5e802c7fc393b2..66b1ddf564b9414826272817728a91b22721b30c 100644 (file)
_("If set, objects only snap to a grid line when it's within the range specified below"),
"gridtolerance", _wr);
- //Options for snapping to guides
+ //Options for snapping to guides
_rsu_gusn.init (_("Snap dist_ance"), _("Snap only when close_r than:"),
_("Snapping distance, in screen pixels, for snapping to guides"),
_("If set, objects only snap to a guide when it's within the range specified below"),
slaves.push_back(&_rcbsnbbp);
slaves.push_back(&_rcbsnbbn);
_rcbsnbb.setSlaveWidgets(slaves);
-
+
slaves.clear();
slaves.push_back(&_rcbsnn);
slaves.push_back(&_rcbsnbb);
-
+
_rcbsg.setSlaveWidgets(slaves);
Gtk::Label *label_g = manage (new Gtk::Label);
label_g->set_markup (_("<b>Snapping</b>"));
Gtk::Label *label_w = manage (new Gtk::Label);
- label_w->set_markup (_("<b>What snaps</b>"));
+ label_w->set_markup (_("<b>What snaps</b>"));
Gtk::Label *label_o = manage (new Gtk::Label);
label_o->set_markup (_("<b>Snap to objects</b>"));
Gtk::Label *label_gr = manage (new Gtk::Label);
label_gr->set_markup (_("<b>Snap to grids</b>"));
Gtk::Label *label_gu = manage (new Gtk::Label);
label_gu->set_markup (_("<b>Snap to guides</b>"));
-
+
Gtk::Widget *const array[] =
{
label_g, 0,
label_w, 0,
0, &_rcbsnn,
0, &_rcbsnbb,
- 0, 0,
+ 0, 0,
label_o, 0,
0, &_rcbsnop,
0, &_rcbsnon,
0, &_rcbsnbbp,
0, &_rcbsnbbn,
0, _rsu_sno._vbox,
- 0, 0,
+ 0, 0,
label_gr, 0,
0, _rsu_sn._vbox,
- 0, 0,
- label_gu, 0,
- 0, _rsu_gusn._vbox
+ 0, 0,
+ label_gu, 0,
+ 0, _rsu_gusn._vbox
};
attach_all(_page_snap.table(), array, G_N_ELEMENTS(array));
SPDesktop *dt = getDesktop();
SPNamedView *nv = sp_desktop_namedview(dt);
+ (void)nv;
_grids_label_crea.set_markup(_("<b>Creation</b>"));
_grids_label_def.set_markup(_("<b>Defined grids</b>"));
_rcbsng.setActive (nv->snap_manager.getSnapModeGuide());
_rcbic.setActive (nv->snap_manager.getIncludeItemCenter());
_rcbsigg.setActive (nv->snap_manager.getSnapIntersectionGG());
- _rcbsils.setActive (nv->snap_manager.getSnapIntersectionLS());
+ _rcbsils.setActive (nv->snap_manager.getSnapIntersectionLS());
_rcbsnop.setActive(nv->snap_manager.object.getSnapToItemPath());
_rcbsnon.setActive(nv->snap_manager.object.getSnapToItemNode());
_rcbsnbbp.setActive(nv->snap_manager.object.getSnapToBBoxPath());
_rsu_sn.setValue (nv->gridtolerance);
_rsu_gusn.setValue (nv->guidetolerance);
-
- _rcbsg.setActive (nv->snap_manager.getSnapEnabledGlobally());
+
+ _rcbsg.setActive (nv->snap_manager.getSnapEnabledGlobally());
//-----------------------------------------------------------grids page
hide();
}
-void
+void
DocumentProperties::_handleDocumentReplaced(SPDesktop* desktop, SPDocument *document)
{
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(desktop));
@@ -551,7 +552,7 @@ DocumentProperties::_handleDocumentReplaced(SPDesktop* desktop, SPDocument *docu
update();
}
-void
+void
DocumentProperties::_handleActivateDesktop(Inkscape::Application *, SPDesktop *desktop)
{
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(desktop));
on_child_added(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node */*child*/, Inkscape::XML::Node */*ref*/, void *data)
{
if (DocumentProperties *dialog = static_cast<DocumentProperties *>(data))
- dialog->update_gridspage();
+ dialog->update_gridspage();
}
static void
on_child_removed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node */*child*/, Inkscape::XML::Node */*ref*/, void *data)
{
if (DocumentProperties *dialog = static_cast<DocumentProperties *>(data))
- dialog->update_gridspage();
+ dialog->update_gridspage();
}
on_repr_attr_changed (Inkscape::XML::Node *, gchar const *, gchar const *, gchar const *, bool, gpointer data)
{
if (DocumentProperties *dialog = static_cast<DocumentProperties *>(data))
- dialog->update();
+ dialog->update();
}
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0))
- indent-tabs-mode:nilu
+ indent-tabs-mode:nil
fill-column:99
End:
*/
index 4528fe65636c72385e86d95b7f0c9d332a61a791..3deb4204ad470a9aa3c8a29659b92ae69fb6cd74 100644 (file)
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
static void
-draw_page (GtkPrintOperation *operation,
+draw_page (GtkPrintOperation */*operation*/,
GtkPrintContext *context,
- gint page_nr,
+ gint /*page_nr*/,
gpointer user_data)
{
struct workaround_gtkmm *junk = (struct workaround_gtkmm*)user_data;
}
static GObject*
-create_custom_widget (GtkPrintOperation *operation,
- gpointer user_data)
+create_custom_widget (GtkPrintOperation */*operation*/,
+ gpointer user_data)
{
//printf("%s\n",__FUNCTION__);
return G_OBJECT(user_data);
static void
begin_print (GtkPrintOperation *operation,
- GtkPrintContext *context,
- gpointer user_data)
+ GtkPrintContext */*context*/,
+ gpointer /*user_data*/)
{
//printf("%s\n",__FUNCTION__);
gtk_print_operation_set_n_pages (operation, 1);
index cf40b2c73d441ebb7b02158e8d1c6595008c9969..40f1514cd9a32c221fd4ee1cd852d54a9c4e1c61 100644 (file)
if (spw->inkscape) {
/* Disconnect signals */
- // the checks are necessary because when destroy is caused by the the program shutting down,
+ // the checks are necessary because when destroy is caused by the the program shutting down,
// the inkscape object may already be (partly?) invalid --bb
if (G_IS_OBJECT(spw->inkscape) && G_OBJECT_GET_CLASS(G_OBJECT(spw->inkscape)))
sp_signal_disconnect_by_data (spw->inkscape, spw);
}
static void
-sp_widget_modify_selection (Inkscape::Application *inkscape, Inkscape::Selection *selection, guint flags, SPWidget *spw)
+sp_widget_modify_selection (Inkscape::Application */*inkscape*/, Inkscape::Selection *selection, guint flags, SPWidget *spw)
{
g_signal_emit (G_OBJECT (spw), signals[MODIFY_SELECTION], 0, selection, flags);
}
static void
-sp_widget_change_selection (Inkscape::Application *inkscape, Inkscape::Selection *selection, SPWidget *spw)
+sp_widget_change_selection (Inkscape::Application */*inkscape*/, Inkscape::Selection *selection, SPWidget *spw)
{
g_signal_emit (G_OBJECT (spw), signals[CHANGE_SELECTION], 0, selection);
}
static void
-sp_widget_set_selection (Inkscape::Application *inkscape, Inkscape::Selection *selection, SPWidget *spw)
+sp_widget_set_selection (Inkscape::Application */*inkscape*/, Inkscape::Selection *selection, SPWidget *spw)
{
/* Emit "set_selection" signal */
g_signal_emit (G_OBJECT (spw), signals[SET_SELECTION], 0, selection);
/* Inkscape will force "change_selection" anyways */
}
+/*
+ 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 :
index 6f0b0dff1a86d3cb5838c6dc76aaa81ba25e4481..393c136c7022260a14f946b41b0166b8551f489e 100644 (file)
@@ -31,138 +31,138 @@ static void event_content_changed (Inkscape::XML::Node * repr, const gchar * old
static GtkTextViewClass * parent_class = NULL;
static Inkscape::XML::NodeEventVector repr_events = {
- NULL, /* child_added */
- NULL, /* child_removed */
- NULL, /* attr_changed */
- event_content_changed,
- NULL /* order_changed */
+ NULL, /* child_added */
+ NULL, /* child_removed */
+ NULL, /* attr_changed */
+ event_content_changed,
+ NULL /* order_changed */
};
GtkWidget *
sp_xmlview_content_new (Inkscape::XML::Node * repr)
{
- GtkTextBuffer *tb;
- SPXMLViewContent *text;
+ GtkTextBuffer *tb;
+ SPXMLViewContent *text;
- tb = gtk_text_buffer_new (NULL);
- text = (SPXMLViewContent*)gtk_type_new (SP_TYPE_XMLVIEW_CONTENT);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (text), tb);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text), GTK_WRAP_CHAR);
+ tb = gtk_text_buffer_new (NULL);
+ text = (SPXMLViewContent*)gtk_type_new (SP_TYPE_XMLVIEW_CONTENT);
+ gtk_text_view_set_buffer (GTK_TEXT_VIEW (text), tb);
+ gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text), GTK_WRAP_CHAR);
- g_signal_connect (G_OBJECT (tb), "changed", G_CALLBACK (sp_xmlview_content_changed), text);
+ g_signal_connect (G_OBJECT (tb), "changed", G_CALLBACK (sp_xmlview_content_changed), text);
- /* should we alter the scrolling adjustments here? */
+ /* should we alter the scrolling adjustments here? */
- sp_xmlview_content_set_repr (text, repr);
+ sp_xmlview_content_set_repr (text, repr);
- return (GtkWidget *) text;
+ return (GtkWidget *) text;
}
void
sp_xmlview_content_set_repr (SPXMLViewContent * text, Inkscape::XML::Node * repr)
{
- if ( repr == text->repr ) return;
- if (text->repr) {
- sp_repr_remove_listener_by_data (text->repr, text);
- Inkscape::GC::release(text->repr);
- }
- text->repr = repr;
- if (repr) {
- Inkscape::GC::anchor(repr);
- sp_repr_add_listener (repr, &repr_events, text);
- sp_repr_synthesize_events (repr, &repr_events, text);
- } else {
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (text), FALSE);
- }
+ if ( repr == text->repr ) return;
+ if (text->repr) {
+ sp_repr_remove_listener_by_data (text->repr, text);
+ Inkscape::GC::release(text->repr);
+ }
+ text->repr = repr;
+ if (repr) {
+ Inkscape::GC::anchor(repr);
+ sp_repr_add_listener (repr, &repr_events, text);
+ sp_repr_synthesize_events (repr, &repr_events, text);
+ } else {
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (text), FALSE);
+ }
}
GtkType
sp_xmlview_content_get_type (void)
{
- static GtkType type = 0;
-
- if (!type) {
- static const GtkTypeInfo info = {
- "SPXMLViewContent",
- sizeof (SPXMLViewContent),
- sizeof (SPXMLViewContentClass),
- (GtkClassInitFunc) sp_xmlview_content_class_init,
- (GtkObjectInitFunc) sp_xmlview_content_init,
- NULL, NULL, NULL
- };
- type = gtk_type_unique (GTK_TYPE_TEXT_VIEW, &info);
- }
-
- return type;
+ static GtkType type = 0;
+
+ if (!type) {
+ static const GtkTypeInfo info = {
+ "SPXMLViewContent",
+ sizeof (SPXMLViewContent),
+ sizeof (SPXMLViewContentClass),
+ (GtkClassInitFunc) sp_xmlview_content_class_init,
+ (GtkObjectInitFunc) sp_xmlview_content_init,
+ NULL, NULL, NULL
+ };
+ type = gtk_type_unique (GTK_TYPE_TEXT_VIEW, &info);
+ }
+
+ return type;
}
void
sp_xmlview_content_class_init (SPXMLViewContentClass * klass)
{
- GtkObjectClass * object_class;
+ GtkObjectClass * object_class;
- object_class = (GtkObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
- parent_class = (GtkTextViewClass*)gtk_type_class (GTK_TYPE_TEXT_VIEW);
+ parent_class = (GtkTextViewClass*)gtk_type_class (GTK_TYPE_TEXT_VIEW);
- object_class->destroy = sp_xmlview_content_destroy;
+ object_class->destroy = sp_xmlview_content_destroy;
}
void
sp_xmlview_content_init (SPXMLViewContent *text)
{
- text->repr = NULL;
- text->blocked = FALSE;
+ text->repr = NULL;
+ text->blocked = FALSE;
}
void
sp_xmlview_content_destroy (GtkObject * object)
{
- SPXMLViewContent * text;
+ SPXMLViewContent * text;
- text = SP_XMLVIEW_CONTENT (object);
+ text = SP_XMLVIEW_CONTENT (object);
- sp_xmlview_content_set_repr (text, NULL);
+ sp_xmlview_content_set_repr (text, NULL);
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
void
-event_content_changed (Inkscape::XML::Node * repr, const gchar * old_content, const gchar * new_content, gpointer data)
+event_content_changed (Inkscape::XML::Node * /*repr*/, const gchar * /*old_content*/, const gchar * new_content, gpointer data)
{
- SPXMLViewContent * text;
- text = SP_XMLVIEW_CONTENT (data);
+ SPXMLViewContent * text;
+ text = SP_XMLVIEW_CONTENT (data);
- if (text->blocked) return;
+ if (text->blocked) return;
- text->blocked = TRUE;
+ text->blocked = TRUE;
- if (new_content) {
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), new_content, strlen (new_content));
- } else {
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
- }
- gtk_text_view_set_editable (GTK_TEXT_VIEW (text), new_content != NULL);
+ if (new_content) {
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), new_content, strlen (new_content));
+ } else {
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
+ }
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (text), new_content != NULL);
- text->blocked = FALSE;
+ text->blocked = FALSE;
}
void
sp_xmlview_content_changed (GtkTextBuffer *tb, SPXMLViewContent *text)
{
- if (text->blocked) return;
-
- if (text->repr) {
- GtkTextIter start, end;
- gchar *data;
- text->blocked = TRUE;
- gtk_text_buffer_get_bounds (tb, &start, &end);
- data = gtk_text_buffer_get_text (tb, &start, &end, TRUE);
- text->repr->setContent(data);
- g_free (data);
- text->blocked = FALSE;
- sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
- _("Type text in a text node"));
- }
+ if (text->blocked) return;
+
+ if (text->repr) {
+ GtkTextIter start, end;
+ gchar *data;
+ text->blocked = TRUE;
+ gtk_text_buffer_get_bounds (tb, &start, &end);
+ data = gtk_text_buffer_get_text (tb, &start, &end, TRUE);
+ text->repr->setContent(data);
+ g_free (data);
+ text->blocked = FALSE;
+ sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
+ _("Type text in a text node"));
+ }
}