28#include <glibmm/i18n.h>
29#include <gdkmm/pixbuf.h>
47static Glib::ustring
const prefs_path =
"/dialogs/gradienteditor/";
72 static gboolean suppress = FALSE;
74 g_return_if_fail(!gr || (doc !=
nullptr));
75 g_return_if_fail(!gr || (gr->
document == doc));
76 g_return_if_fail(!gr || gr->
hasStops());
102 }
else if (gr !=
_gr) {
161 std::vector<SPGradient *> gl;
164 for (
auto gradient : gradients) {
165 auto grad = cast<SPGradient>(gradient);
166 if ( grad->hasStops() && (grad->isSwatch() ==
_swatched) ) {
167 gl.push_back(cast<SPGradient>(gradient));
173 std::map<SPGradient *, gint> usageCount;
177 Gtk::TreeModel::Row row = *(
_store->append());
180 }
else if (gl.empty()) {
181 Gtk::TreeModel::Row row = *(
_store->append());
185 Gtk::TreeModel::Row row = *(
_store->append());
194 Gtk::TreeModel::Row row = *(
_store->append());
229 if (strlen(
id) > 14 && (!strncmp (
id,
"linearGradient", 14) || !strncmp (
id,
"radialGradient", 14)))
240 if (src.length() > maxlen && maxlen > 8) {
241 size_t p1 = (size_t) maxlen / 2;
242 size_t p2 = (size_t) src.length() - (maxlen - p1 - 1);
243 return src.substr(0, p1) +
"…" + src.substr(p2);
259 return ((
int)(hsl[0]*100 * 10000)) + ((int)(hsl[1]*100 * 100)) + ((
int)(hsl[2]*100 * 1));
276 mapUsageCount->count(gr) > 0 ? (*mapUsageCount)[gr] += 1 : (*mapUsageCount)[gr] = 1;
280 mapUsageCount->count(gr) > 0 ? (*mapUsageCount)[gr] += 1 : (*mapUsageCount)[gr] = 1;
struct _GdkPixbuf GdkPixbuf
virtual char const * name() const =0
Get the name of the element node.
bool block(bool should_block=true) noexcept
Sets or unsets the blocking state of this connection.
static void rgb_to_hsl_floatv(float *hsl, float r, float g, float b)
Fill hsl float array from r,g,b float values.
Typed SVG document implementation.
std::vector< SPObject * > const getResourceList(char const *key)
SPDefs * getDefs()
Return the main defs object for the document.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
char const * label() const
Gets the author-visible label property for the object or a default if no label is defined.
char const * getId() const
Returns the objects current ID string.
sigc::connection connectRelease(sigc::slot< void(SPObject *)> slot)
Connects to the release request signal.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
sigc::connection connectModified(sigc::slot< void(SPObject *, unsigned int)> slot)
Connects to the modification notification signal.
guint32 get_rgba32() const
Return stop's color as 32bit value.
std::vector< SPItem * > sp_get_all_document_items(SPDocument *document)
SPGradient * sp_item_get_gradient(SPItem *item, bool fillorstroke)
GdkPixbuf * sp_gradient_to_pixbuf(SPGradient *gr, int width, int height)
Glib::ustring gr_ellipsize_text(Glib::ustring const &src, size_t maxlen)
Glib::ustring gr_prepare_label(SPObject *obj)
static Glib::ustring const prefs_path
void gr_get_usage_counts(SPDocument *doc, std::map< SPGradient *, gint > *mapUsageCount)
unsigned long sp_gradient_to_hhssll(SPGradient *gr)
CMYK to sRGB conversion routines.
@ VERTICAL
The y-dimension (1).
Singleton class to access the preferences file in a convenient way.
Color selected in color selector widget.
TODO: insert short description here.