|
Nikita Kitaev |
254e11 |
/* === S Y N F I G ========================================================= */
|
|
Nikita Kitaev |
3c2324 |
/*! \file widgets/widget_curves.h
|
|
Nikita Kitaev |
254e11 |
** \brief Template Header
|
|
Nikita Kitaev |
254e11 |
**
|
|
Nikita Kitaev |
254e11 |
** $Id$
|
|
Nikita Kitaev |
254e11 |
**
|
|
Nikita Kitaev |
254e11 |
** \legal
|
|
Nikita Kitaev |
254e11 |
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
** ......... ... 2018 Ivan Mahonin
|
|
Nikita Kitaev |
254e11 |
**
|
|
Nikita Kitaev |
254e11 |
** This package is free software; you can redistribute it and/or
|
|
Nikita Kitaev |
254e11 |
** modify it under the terms of the GNU General Public License as
|
|
Nikita Kitaev |
254e11 |
** published by the Free Software Foundation; either version 2 of
|
|
Nikita Kitaev |
254e11 |
** the License, or (at your option) any later version.
|
|
Nikita Kitaev |
254e11 |
**
|
|
Nikita Kitaev |
254e11 |
** This package is distributed in the hope that it will be useful,
|
|
Nikita Kitaev |
254e11 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Nikita Kitaev |
254e11 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Nikita Kitaev |
254e11 |
** General Public License for more details.
|
|
Nikita Kitaev |
254e11 |
** \endlegal
|
|
Nikita Kitaev |
254e11 |
*/
|
|
Nikita Kitaev |
254e11 |
/* ========================================================================= */
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
/* === S T A R T =========================================================== */
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
#ifndef __SYNFIG_STUDIO_WIDGET_CURVES_H
|
|
Nikita Kitaev |
254e11 |
#define __SYNFIG_STUDIO_WIDGET_CURVES_H
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
/* === H E A D E R S ======================================================= */
|
|
Nikita Kitaev |
254e11 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
#include <list></list>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
|
|
Nikita Kitaev |
254e11 |
#include <gtkmm drawingarea.h=""></gtkmm>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
#include <gtkmm adjustment.h=""></gtkmm>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
|
|
Nikita Kitaev |
254e11 |
#include <synfigapp value_desc.h=""></synfigapp>
|
|
Rodolfo Ribeiro Gomes |
65af46 |
#include <synfigapp canvasinterface.h=""></synfigapp>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
#include <gui timemodel.h=""></gui>
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
/* === M A C R O S ========================================================= */
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
/* === T Y P E D E F S ===================================================== */
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
/* === C L A S S E S & S T R U C T S ======================================= */
|
|
Nikita Kitaev |
254e11 |
|
|
Rodolfo Ribeiro Gomes |
157a75 |
namespace synfigapp {
|
|
Rodolfo Ribeiro Gomes |
157a75 |
namespace Action {
|
|
Rodolfo Ribeiro Gomes |
157a75 |
class PassiveGrouper;
|
|
Rodolfo Ribeiro Gomes |
157a75 |
}
|
|
Rodolfo Ribeiro Gomes |
157a75 |
}
|
|
Rodolfo Ribeiro Gomes |
157a75 |
|
|
Nikita Kitaev |
254e11 |
namespace studio {
|
|
Nikita Kitaev |
254e11 |
|
|
Rodolfo Ribeiro Gomes |
87f490 |
struct TimePlotData;
|
|
Rodolfo Ribeiro Gomes |
87f490 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
class Widget_Curves: public Gtk::DrawingArea
|
|
Nikita Kitaev |
254e11 |
{
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
private:
|
|
Nikita Kitaev |
254e11 |
struct Channel;
|
|
Nikita Kitaev |
254e11 |
struct CurveStruct;
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
struct ChannelPoint {
|
|
Rodolfo Ribeiro Gomes |
fa8dd3 |
std::list<curvestruct>::iterator curve_it;</curvestruct>
|
|
Rodolfo Ribeiro Gomes |
ce93bd |
synfig::TimePoint time_point;
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
int channel_idx;
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
ChannelPoint();
|
|
Rodolfo Ribeiro Gomes |
ce93bd |
ChannelPoint(std::list<curvestruct>::iterator &curve_it, const synfig::TimePoint time_point, int channel_idx);</curvestruct>
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
void invalidate();
|
|
Rodolfo Ribeiro Gomes |
7d417f |
bool is_valid() const;
|
|
Rodolfo Ribeiro Gomes |
38d414 |
bool is_draggable() const;
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
bool operator ==(const ChannelPoint &b) const;
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
bool operator !=(const ChannelPoint &b) const {return !operator==(b);}
|
|
Rodolfo Ribeiro Gomes |
65af46 |
|
|
Rodolfo Ribeiro Gomes |
65af46 |
synfig::Real get_value(synfig::Real time_tolerance) const;
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
};
|
|
Nikita Kitaev |
254e11 |
|
|
Rodolfo Ribeiro Gomes |
65af46 |
etl::handle<synfigapp::canvasinterface> canvas_interface;</synfigapp::canvasinterface>
|
|
Rodolfo Ribeiro Gomes |
65af46 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
Glib::RefPtr<gtk::adjustment> range_adjustment;</gtk::adjustment>
|
|
Nikita Kitaev |
254e11 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
std::list<curvestruct> curve_list;</curvestruct>
|
|
Nikita Kitaev |
254e11 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
std::list<sigc::connection> value_desc_changed;</sigc::connection>
|
|
Nikita Kitaev |
254e11 |
|
|
Rodolfo Ribeiro Gomes |
87f490 |
TimePlotData * time_plot_data;
|
|
Rodolfo Ribeiro Gomes |
87f490 |
|
|
Rodolfo Ribeiro Gomes |
c89a4c |
int waypoint_edge_length;
|
|
Rodolfo Ribeiro Gomes |
c89a4c |
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
ChannelPoint hovered_point;
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
|
|
Rodolfo Ribeiro Gomes |
68b3ed |
std::vector<channelpoint> selected_points;</channelpoint>
|
|
Rodolfo Ribeiro Gomes |
68b3ed |
|
|
Rodolfo Ribeiro Gomes |
4a94a0 |
bool find_channelpoint_at_position(int pos_x, int pos_y, ChannelPoint & cp);
|
|
Rodolfo Ribeiro Gomes |
68b3ed |
bool find_channelpoints_in_rect(Gdk::Rectangle rect, std::vector<channelpoint> & list);</channelpoint>
|
|
Rodolfo Ribeiro Gomes |
68b3ed |
|
|
Rodolfo Ribeiro Gomes |
68b3ed |
enum {POINTER_NONE, POINTER_DRAGGING, POINTER_SELECTING} pointer_state;
|
|
Rodolfo Ribeiro Gomes |
68b3ed |
int pointer_tracking_start_x, pointer_tracking_start_y;
|
|
Rodolfo Ribeiro Gomes |
65af46 |
ChannelPoint active_point;
|
|
Rodolfo Ribeiro Gomes |
65af46 |
int active_point_initial_y;
|
|
Rodolfo Ribeiro Gomes |
a79ec5 |
void start_dragging(const ChannelPoint &pointed_item);
|
|
Rodolfo Ribeiro Gomes |
6ed16f |
void drag_to(int pointer_x, int pointer_y);
|
|
Rodolfo Ribeiro Gomes |
6ed16f |
void delta_drag(int dx, int dy);
|
|
Rodolfo Ribeiro Gomes |
864aa6 |
void finish_dragging();
|
|
Rodolfo Ribeiro Gomes |
65af46 |
void cancel_dragging();
|
|
Rodolfo Ribeiro Gomes |
b2c280 |
bool made_dragging_move;
|
|
Rodolfo Ribeiro Gomes |
6ed16f |
bool dragging_started_by_key;
|
|
Rodolfo Ribeiro Gomes |
4be66a |
synfigapp::Action::PassiveGrouper *action_group_drag;
|
|
Rodolfo Ribeiro Gomes |
65af46 |
|
|
Rodolfo Ribeiro Gomes |
4b5437 |
std::vector<std::pair<synfig::waypoint, std::list<curvestruct="">::iterator> > saved_waypoints;</std::pair<synfig::waypoint,>
|
|
Rodolfo Ribeiro Gomes |
4b5437 |
|
|
Rodolfo Ribeiro Gomes |
27a1ed |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
public:
|
|
Nikita Kitaev |
254e11 |
Widget_Curves();
|
|
Nikita Kitaev |
254e11 |
~Widget_Curves();
|
|
Nikita Kitaev |
254e11 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
const Glib::RefPtr<gtk::adjustment>& get_range_adjustment() const { return range_adjustment; }</gtk::adjustment>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
|
|
Rodolfo Ribeiro Gomes |
82e219 |
const etl::handle<timemodel>& get_time_model() const;</timemodel>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
void set_time_model(const etl::handle<timemodel> &x);</timemodel>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
|
|
Rodolfo Ribeiro Gomes |
65af46 |
void set_value_descs(etl::handle<synfigapp::canvasinterface> canvas_interface_, const std::list<synfigapp::valuedesc> &value_descs);</synfigapp::valuedesc></synfigapp::canvasinterface>
|
|
Nikita Kitaev |
254e11 |
void clear();
|
|
Nikita Kitaev |
254e11 |
void refresh();
|
|
Nikita Kitaev |
254e11 |
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
void zoom_in();
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
void zoom_out();
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
void zoom_100();
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
void set_zoom(double new_zoom_factor);
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
double get_zoom() const;
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
void scroll_up();
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
void scroll_down();
|
|
Rodolfo Ribeiro Gomes |
b279e0 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
f9957c |
protected:
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
14735a |
bool on_draw(const Cairo::RefPtr<cairo::context> &cr);</cairo::context>
|
|
Nikita Kitaev |
254e11 |
bool on_event(GdkEvent *event);
|
|
Nikita Kitaev |
254e11 |
}; // END of class Widget_Curves
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
}; // END of namespace studio
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
/* === E N D =============================================================== */
|
|
Nikita Kitaev |
254e11 |
|
|
Nikita Kitaev |
254e11 |
#endif
|