Inkscape
Vector Graphics Editor
|
#include <gradient-with-stops.h>
Classes | |
struct | layout_t |
struct | limits_t |
struct | stop_pos_t |
struct | stop_t |
Public Member Functions | |
GradientWithStops () | |
~GradientWithStops () override | |
void | set_gradient (SPGradient *gradient) |
void | set_focused_stop (int index) |
sigc::signal< void(size_t)> & | signal_stop_selected () |
sigc::signal< void(size_t, double)> & | signal_stop_offset_changed () |
sigc::signal< void(double)> & | signal_add_stop_at () |
sigc::signal< void(size_t)> & | signal_delete_stop () |
Private Member Functions | |
void | draw_func (Cairo::RefPtr< Cairo::Context > const &cr, int width, int height) |
void | css_changed (GtkCssStyleChange *change) final |
Called after gtk_widget_css_changed(): when a CSS widget node is validated & style changed. | |
void | on_click_pressed (int n_press, double x, double y) |
void | on_click_released (int n_press, double x, double y) |
void | on_motion (double x, double y) |
bool | on_key_pressed (unsigned keyval, unsigned keycode, Gdk::ModifierType state) |
std::optional< bool > | focus (Gtk::DirectionType direction) final |
Called before gtk_widget_focus(): return true if moving in direction keeps focus w/in self, false if moving left focus outside widget, or nullopt for no decision & to call base vfunc. | |
void | modified () |
void | update () |
int | find_stop_at (double x, double y) const |
void | move_stop (int stop_index, double offset_shift) |
layout_t | get_layout () const |
stop_pos_t | get_stop_position (size_t index, const layout_t &layout) const |
limits_t | get_stop_limits (int index) const |
Glib::RefPtr< Gdk::Cursor > const * | get_cursor (double x, double y) const |
void | set_stop_cursor (Glib::RefPtr< Gdk::Cursor > const *cursor) |
Private Attributes | |
SPGradient * | _gradient = nullptr |
std::vector< stop_t > | _stops |
svg_renderer | _template |
svg_renderer | _tip_template |
sigc::scoped_connection | _release |
sigc::scoped_connection | _modified |
Gdk::RGBA | _background_color |
sigc::signal< void(size_t)> | _signal_stop_selected |
sigc::signal< void(size_t, double)> | _signal_stop_offset_changed |
sigc::signal< void(double)> | _signal_add_stop_at |
sigc::signal< void(size_t)> | _signal_delete_stop |
bool | _dragging = false |
int | _focused_stop = -1 |
double | _pointer_x = 0 |
double | _stop_offset = 0 |
Glib::RefPtr< Gdk::Cursor > | _cursor_mouseover |
Glib::RefPtr< Gdk::Cursor > | _cursor_dragging |
Glib::RefPtr< Gdk::Cursor > | _cursor_insert |
Glib::RefPtr< Gdk::Cursor > const * | _cursor_current = nullptr |
double | _stop_move_increment = 0.01 |
Additional Inherited Members | |
![]() | |
WidgetVfuncsClassInit () | |
~WidgetVfuncsClassInit () override | |
Definition at line 41 of file gradient-with-stops.h.
Inkscape::UI::Widget::GradientWithStops::GradientWithStops | ( | ) |
Definition at line 51 of file gradient-with-stops.cpp.
References _background_color, draw_func(), key, on_click_pressed(), on_click_released(), on_key_pressed(), and on_motion().
|
overridedefault |
|
finalprivatevirtual |
Called after gtk_widget_css_changed(): when a CSS widget node is validated & style changed.
Reimplemented from Inkscape::UI::Widget::WidgetVfuncsClassInit.
Definition at line 123 of file gradient-with-stops.cpp.
References _background_color, _cursor_dragging, _cursor_insert, _cursor_mouseover, get_color_with_class(), and set_stop_cursor().
|
private |
Definition at line 436 of file gradient-with-stops.cpp.
References _background_color, _focused_stop, _gradient, _stops, _template, _tip_template, Inkscape::draw_gradient(), Inkscape::Util::format_number(), gdk_to_css_color(), get_layout(), get_stop_position(), GRADIENT_IMAGE_HEIGHT, Inkscape::svg_renderer::render(), scale, and Inkscape::svg_renderer::set_style().
Referenced by GradientWithStops().
|
private |
Definition at line 197 of file gradient-with-stops.cpp.
References _gradient, _stops, get_layout(), and get_stop_position().
Referenced by get_cursor(), and on_click_pressed().
|
finalprivatevirtual |
Called before gtk_widget_focus(): return true if moving in direction keeps focus w/in self, false if moving left focus outside widget, or nullopt for no decision & to call base vfunc.
Reimplemented from Inkscape::UI::Widget::WidgetVfuncsClassInit.
Definition at line 255 of file gradient-with-stops.cpp.
References _focused_stop, _stops, Inkscape::UI::direction(), and set_focused_stop().
|
private |
Definition at line 405 of file gradient-with-stops.cpp.
References _cursor_insert, _cursor_mouseover, _gradient, find_stop_at(), get_stop_limits(), and index.
Referenced by on_click_released(), and on_motion().
|
private |
Definition at line 181 of file gradient-with-stops.cpp.
References _template, Inkscape::svg_renderer::get_width_px(), Inkscape::UI::Widget::height, width, and Inkscape::UI::Widget::GradientWithStops::layout_t::x.
Referenced by draw_func(), find_stop_at(), move_stop(), on_click_pressed(), and on_motion().
|
private |
Definition at line 215 of file gradient-with-stops.cpp.
References _gradient, _stops, index, and Inkscape::UI::Widget::GradientWithStops::limits_t::min_offset.
Referenced by get_cursor(), move_stop(), on_click_pressed(), and on_motion().
|
private |
Definition at line 139 of file gradient-with-stops.cpp.
References _gradient, _stops, _template, Inkscape::UI::Widget::dx, Inkscape::svg_renderer::get_height_px(), Inkscape::svg_renderer::get_width_px(), Inkscape::UI::Widget::GradientWithStops::layout_t::height, index, Inkscape::UI::Widget::GradientWithStops::stop_pos_t::left, offset, Inkscape::UI::Widget::GradientWithStops::layout_t::width, and Inkscape::UI::Widget::GradientWithStops::layout_t::x.
Referenced by draw_func(), and find_stop_at().
|
private |
Definition at line 99 of file gradient-with-stops.cpp.
References _gradient, _stops, SPStop::getColor(), SPGradient::getFirstStop(), SPStop::getNextStop(), SPStop::offset, Inkscape::UI::Widget::GradientWithStops::stop_t::offset, and update().
Referenced by set_gradient().
|
private |
Definition at line 370 of file gradient-with-stops.cpp.
References _signal_stop_offset_changed, get_layout(), and get_stop_limits().
Referenced by on_key_pressed().
|
private |
Definition at line 314 of file gradient-with-stops.cpp.
References _cursor_dragging, _dragging, _gradient, _pointer_x, _signal_add_stop_at, _stop_offset, _stops, find_stop_at(), get_layout(), get_stop_limits(), index, set_focused_stop(), and set_stop_cursor().
Referenced by GradientWithStops().
|
private |
Definition at line 363 of file gradient-with-stops.cpp.
References _dragging, get_cursor(), and set_stop_cursor().
Referenced by GradientWithStops().
|
private |
Definition at line 284 of file gradient-with-stops.cpp.
References _focused_stop, _signal_delete_stop, _stop_move_increment, delta, Inkscape::UI::Controller::has_flag(), and move_stop().
Referenced by GradientWithStops().
|
private |
Definition at line 383 of file gradient-with-stops.cpp.
References _dragging, _focused_stop, _gradient, _pointer_x, _signal_stop_offset_changed, _stop_offset, delta, Inkscape::UI::Widget::dx, get_cursor(), get_layout(), get_stop_limits(), and set_stop_cursor().
Referenced by GradientWithStops().
void Inkscape::UI::Widget::GradientWithStops::set_focused_stop | ( | int | index | ) |
Definition at line 513 of file gradient-with-stops.cpp.
References _focused_stop, _signal_stop_selected, index, and update().
Referenced by focus(), on_click_pressed(), and Inkscape::UI::Widget::GradientEditor::stop_selected().
void Inkscape::UI::Widget::GradientWithStops::set_gradient | ( | SPGradient * | gradient | ) |
Definition at line 85 of file gradient-with-stops.cpp.
References _gradient, _modified, _release, SPObject::connectModified(), SPObject::connectRelease(), modified(), and set_gradient().
Referenced by Inkscape::UI::Widget::GradientEditor::set_gradient(), and set_gradient().
|
private |
Definition at line 423 of file gradient-with-stops.cpp.
References _cursor_current.
Referenced by css_changed(), on_click_pressed(), on_click_released(), and on_motion().
|
inline |
Definition at line 65 of file gradient-with-stops.h.
References _signal_add_stop_at.
Referenced by Inkscape::UI::Widget::GradientEditor::GradientEditor().
|
inline |
Definition at line 69 of file gradient-with-stops.h.
References _signal_delete_stop.
Referenced by Inkscape::UI::Widget::GradientEditor::GradientEditor().
|
inline |
Definition at line 61 of file gradient-with-stops.h.
References _signal_stop_offset_changed.
Referenced by Inkscape::UI::Widget::GradientEditor::GradientEditor().
|
inline |
Definition at line 56 of file gradient-with-stops.h.
References _signal_stop_selected.
Referenced by Inkscape::UI::Widget::GradientEditor::GradientEditor().
|
private |
Definition at line 118 of file gradient-with-stops.cpp.
Referenced by modified(), and set_focused_stop().
|
private |
Definition at line 130 of file gradient-with-stops.h.
Referenced by css_changed(), draw_func(), and GradientWithStops().
|
private |
Definition at line 145 of file gradient-with-stops.h.
Referenced by set_stop_cursor().
|
private |
Definition at line 143 of file gradient-with-stops.h.
Referenced by css_changed(), and on_click_pressed().
|
private |
Definition at line 144 of file gradient-with-stops.h.
Referenced by css_changed(), and get_cursor().
|
private |
Definition at line 142 of file gradient-with-stops.h.
Referenced by css_changed(), and get_cursor().
|
private |
Definition at line 135 of file gradient-with-stops.h.
Referenced by on_click_pressed(), on_click_released(), and on_motion().
|
private |
Definition at line 138 of file gradient-with-stops.h.
Referenced by draw_func(), focus(), on_key_pressed(), on_motion(), and set_focused_stop().
|
private |
Definition at line 113 of file gradient-with-stops.h.
Referenced by draw_func(), find_stop_at(), get_cursor(), get_stop_limits(), get_stop_position(), modified(), on_click_pressed(), on_motion(), and set_gradient().
|
private |
Definition at line 129 of file gradient-with-stops.h.
Referenced by set_gradient().
|
private |
Definition at line 140 of file gradient-with-stops.h.
Referenced by on_click_pressed(), and on_motion().
|
private |
Definition at line 128 of file gradient-with-stops.h.
Referenced by set_gradient().
|
private |
Definition at line 133 of file gradient-with-stops.h.
Referenced by on_click_pressed(), and signal_add_stop_at().
|
private |
Definition at line 134 of file gradient-with-stops.h.
Referenced by on_key_pressed(), and signal_delete_stop().
|
private |
Definition at line 132 of file gradient-with-stops.h.
Referenced by move_stop(), on_motion(), and signal_stop_offset_changed().
|
private |
Definition at line 131 of file gradient-with-stops.h.
Referenced by set_focused_stop(), and signal_stop_selected().
|
private |
Definition at line 148 of file gradient-with-stops.h.
Referenced by on_key_pressed().
|
private |
Definition at line 141 of file gradient-with-stops.h.
Referenced by on_click_pressed(), and on_motion().
|
private |
Definition at line 120 of file gradient-with-stops.h.
Referenced by draw_func(), find_stop_at(), focus(), get_stop_limits(), get_stop_position(), modified(), and on_click_pressed().
|
private |
Definition at line 123 of file gradient-with-stops.h.
Referenced by draw_func(), get_layout(), and get_stop_position().
|
private |
Definition at line 126 of file gradient-with-stops.h.
Referenced by draw_func().