Lines Matching +refs:val +refs:mode
113 , mode(0)
136 static bool is_transform_mode (gint mode)
138 return (mode == TWEAK_MODE_MOVE ||
139 mode == TWEAK_MODE_MOVE_IN_OUT ||
140 mode == TWEAK_MODE_MOVE_JITTER ||
141 mode == TWEAK_MODE_SCALE ||
142 mode == TWEAK_MODE_ROTATE ||
143 mode == TWEAK_MODE_MORELESS);
146 static bool is_color_mode (gint mode)
148 return (mode == TWEAK_MODE_COLORPAINT || mode == TWEAK_MODE_COLORJITTER || mode == TWEAK_MODE_BLUR);
162 switch (this->mode) {
246 if (this->mode == TWEAK_MODE_COLORPAINT) { // intercept color setting only in this mode
276 sp_event_context_read(this, "mode");
299 void TweakTool::set(const Inkscape::Preferences::Entry& val) {
300 Glib::ustring path = val.getEntryName();
303 this->width = CLAMP(val.getDouble(0.1), -1000.0, 1000.0);
304 } else if (path == "mode") {
305 this->mode = val.getInt();
308 this->fidelity = CLAMP(val.getDouble(), 0.0, 1.0);
310 this->force = CLAMP(val.getDouble(1.0), 0, 1.0);
312 this->usepressure = val.getBool();
314 this->do_h = val.getBool();
316 this->do_s = val.getBool();
318 this->do_l = val.getBool();
320 this->do_o = val.getBool();
360 sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::Point p, Geom::Point vector, gint mode, double radius, double force, double fidelity, bool reverse)
366 if (box && !is_transform_mode(mode) && !is_color_mode(mode)) {
397 if (sp_tweak_dilate_recursive (selection, child, p, vector, mode, radius, force, fidelity, reverse)) {
405 if (mode == TWEAK_MODE_MOVE) {
418 } else if (mode == TWEAK_MODE_MOVE_IN_OUT) {
432 } else if (mode == TWEAK_MODE_MOVE_JITTER) {
447 } else if (mode == TWEAK_MODE_SCALE) {
460 } else if (mode == TWEAK_MODE_ROTATE) {
473 } else if (mode == TWEAK_MODE_MORELESS) {
551 gchar const *val = sp_repr_css_property(css, "fill-rule", NULL);
552 if (val && strcmp(val, "nonzero") == 0) {
554 } else if (val && strcmp(val, "evenodd") == 0) {
565 if (mode == TWEAK_MODE_SHRINK_GROW) {
571 } else if (mode == TWEAK_MODE_ATTRACT_REPEL) {
577 } else if (mode == TWEAK_MODE_PUSH) {
583 } else if (mode == TWEAK_MODE_ROUGHEN) {
719 tweak_color (guint mode, float *color, guint32 goal, double force, bool do_h, bool do_s, bool do_l)
721 if (mode == TWEAK_MODE_COLORPAINT) {
723 } else if (mode == TWEAK_MODE_COLORJITTER) {
729 tweak_opacity (guint mode, SPIScale24 *style_opacity, double opacity_goal, double force)
733 if (mode == TWEAK_MODE_COLORPAINT) {
736 } else if (mode == TWEAK_MODE_COLORJITTER) {
762 guint32 const rgb_goal, Geom::Point p_w, double radius, double force, guint mode,
852 tweak_color (mode, stop->specified_color.v.c, rgb_goal,
855 tweak_color(mode, prevStop->specified_color.v.c, rgb_goal,
865 tweak_color(mode, prevStop->specified_color.v.c, rgb_goal,
872 tweak_color (mode, stop->specified_color.v.c, rgb_goal,
886 sp_tweak_color_recursive (guint mode, SPItem *item, SPItem *item_at_point,
900 if (sp_tweak_color_recursive (mode, childItem, item_at_point,
987 return true; // do not do colors, blur is a separate mode
992 tweak_colors_in_gradient(item, Inkscape::FOR_FILL, fill_goal, p, radius, this_force, mode, do_h, do_s, do_l, do_o);
995 tweak_color (mode, style->fill.value.color.v.c, fill_goal, this_force, do_h, do_s, do_l);
1002 tweak_colors_in_gradient(item, Inkscape::FOR_STROKE, stroke_goal, p, radius, this_force, mode, do_h, do_s, do_l, do_o);
1005 tweak_color (mode, style->stroke.value.color.v.c, stroke_goal, this_force, do_h, do_s, do_l);
1011 tweak_opacity (mode, &style->opacity, opacity_goal, this_force);
1083 if (is_color_mode (tc->mode)) {
1085 if (sp_tweak_color_recursive (tc->mode, item, item_at_point,
1089 tc->mode == TWEAK_MODE_BLUR, reverse,
1094 } else if (is_transform_mode(tc->mode)) {
1095 if (sp_tweak_dilate_recursive (selection, item, p, vector, tc->mode, radius, move_force, tc->fidelity, reverse)) {
1099 if (sp_tweak_dilate_recursive (selection, item, p, vector, tc->mode, radius, path_force, tc->fidelity, reverse)) {
1118 sp_tweak_switch_mode (TweakTool *tc, gint mode, bool with_shift)
1120 SP_EVENT_CONTEXT(tc)->desktop->setToolboxSelectOneValue ("tweak_tool_mode", mode);
1122 tc->mode = mode;
1127 sp_tweak_switch_mode_temporarily (TweakTool *tc, gint mode, bool with_shift)
1130 // Juggling about so that prefs have the old value but tc->mode and the button show new mode:
1131 gint now_mode = prefs->getInt("/tools/tweak/mode", 0);
1132 SP_EVENT_CONTEXT(tc)->desktop->setToolboxSelectOneValue ("tweak_tool_mode", mode);
1134 prefs->setInt("/tools/tweak/mode", now_mode);
1135 // changing prefs changed tc->mode, restore back :)
1136 tc->mode = mode;
1222 switch (this->mode) {
1483 sp_tweak_switch_mode (this, prefs->getInt("/tools/tweak/mode"), MOD__SHIFT(event));
1487 sp_tweak_switch_mode (this, prefs->getInt("/tools/tweak/mode"), MOD__SHIFT(event));
1508 mode:c++
1511 indent-tabs-mode:nil