summaryrefslogtreecommitdiffstats
path: root/src/gradient-chemistry.h
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2006-01-16 02:36:01 +0000
committermental <mental@users.sourceforge.net>2006-01-16 02:36:01 +0000
commit179fa413b047bede6e32109e2ce82437c5fb8d34 (patch)
treea5a6ac2c1708bd02288fbd8edb2ff500ff2e0916 /src/gradient-chemistry.h
downloadinkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.tar.gz
inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.zip
moving trunk for module inkscape
(bzr r1)
Diffstat (limited to 'src/gradient-chemistry.h')
-rw-r--r--src/gradient-chemistry.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/gradient-chemistry.h b/src/gradient-chemistry.h
new file mode 100644
index 000000000..b649a22ec
--- /dev/null
+++ b/src/gradient-chemistry.h
@@ -0,0 +1,82 @@
+#ifndef __SP_GRADIENT_CHEMISTRY_H__
+#define __SP_GRADIENT_CHEMISTRY_H__
+
+/*
+ * Various utility methods for gradients
+ *
+ * Author:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ * bulia byak <buliabyak@users.sf.net>
+ *
+ * Copyright (C) 2001-2002 Lauris Kaplinski
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include "forward.h"
+#include "sp-gradient.h"
+
+/*
+ * Either normalizes given gradient to vector, or returns fresh normalized
+ * vector - in latter case, original gradient is flattened and stops cleared
+ * No transrefing - i.e. caller shouldn't hold reference to original and
+ * does not get one to new automatically (doc holds ref of every object anyways)
+ */
+
+SPGradient *sp_gradient_ensure_vector_normalized (SPGradient *gradient);
+
+
+/*
+ * Sets item fill/stroke to lineargradient with given vector, creating
+ * new private gradient, if needed
+ * gr has to be normalized vector
+ */
+
+SPGradient *sp_item_set_gradient (SPItem *item, SPGradient *gr, SPGradientType type, bool is_fill);
+
+/*
+ * Get default normalized gradient vector of document, create if there is none
+ */
+
+SPGradient *sp_document_default_gradient_vector (SPDocument *document, guint32 color = 0);
+SPGradient *sp_gradient_vector_for_object (SPDocument *doc, SPDesktop *desktop, SPObject *o, bool is_fill);
+
+void sp_object_ensure_fill_gradient_normalized (SPObject *object);
+void sp_object_ensure_stroke_gradient_normalized (SPObject *object);
+
+SPGradient *sp_gradient_convert_to_userspace (SPGradient *gr, SPItem *item, const gchar *property);
+SPGradient *sp_gradient_reset_to_userspace (SPGradient *gr, SPItem *item);
+
+SPGradient *sp_gradient_fork_vector_if_necessary (SPGradient *gr);
+
+SPStop* sp_first_stop(SPGradient *gradient);
+SPStop* sp_last_stop(SPGradient *gradient);
+SPStop* sp_prev_stop(SPStop *stop, SPGradient *gradient);
+SPStop* sp_next_stop(SPStop *stop);
+
+void sp_gradient_transform_multiply (SPGradient *gradient, NR::Matrix postmul, bool set);
+
+void sp_item_gradient_set_coords (SPItem *item, guint point_num, NR::Point p_desk, bool fill_or_stroke, bool write_repr, bool scale);
+NR::Point sp_item_gradient_get_coords (SPItem *item, guint point_num, bool fill_or_stroke);
+SPGradient *sp_item_gradient_get_vector (SPItem *item, bool fill_or_stroke);
+SPGradientSpread sp_item_gradient_get_spread (SPItem *item, bool fill_or_stroke);
+
+struct SPCSSAttr;
+void sp_item_gradient_stop_set_style (SPItem *item, guint point_num, bool fill_or_stroke, SPCSSAttr *stop);
+guint32 sp_item_gradient_stop_query_style (SPItem *item, guint point_num, bool fill_or_stroke);
+void sp_item_gradient_edit_stop (SPItem *item, guint point_num, bool fill_or_stroke);
+void sp_item_gradient_reverse_vector (SPItem *item, bool fill_or_stroke);
+
+#endif
+
+/*
+ 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 :