Remove obsolete includes.
[synfig.git] / synfig-studio / src / gtkmm / dialog_waypoint.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dialog_waypoint.cpp
3 **      \brief Template Header
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === H E A D E R S ======================================================= */
24
25 #ifdef USING_PCH
26 #       include "pch.h"
27 #else
28 #ifdef HAVE_CONFIG_H
29 #       include <config.h>
30 #endif
31
32 #include <gtkmm/label.h>
33 #include "dialog_waypoint.h"
34 #include <gtkmm/spinbutton.h>
35 #include <gtkmm/combo.h>
36 #include <ETL/stringf>
37 #include "widget_value.h"
38 #include "app.h"
39 #include <gtkmm/menu.h>
40 #include <gtkmm/optionmenu.h>
41 #include "widget_time.h"
42 #include "widget_waypoint.h"
43
44 #include "general.h"
45
46 #endif
47
48 using namespace synfig;
49 using namespace std;
50 using namespace etl;
51 using namespace studio;
52
53 /* === M A C R O S ========================================================= */
54
55 /* === G L O B A L S ======================================================= */
56
57 /* === P R O C E D U R E S ================================================= */
58
59 /* === M E T H O D S ======================================================= */
60
61 Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle<synfig::Canvas> canvas):
62         Dialog(_("Waypoint Editor"),parent,false,true),
63         canvas(canvas)
64 {
65         assert(canvas);
66     waypointwidget=manage(new class Widget_Waypoint(canvas));
67         get_vbox()->pack_start(*waypointwidget);
68
69         Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
70         ok_button->show();
71         add_action_widget(*ok_button,2);
72         ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_ok_pressed));
73
74         Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
75         apply_button->show();
76         add_action_widget(*apply_button,1);
77         apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_apply_pressed));
78
79         Gtk::Button *delete_button(manage(new class Gtk::Button(Gtk::StockID("gtk-delete"))));
80         delete_button->show();
81         add_action_widget(*delete_button,3);
82         delete_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_delete_pressed));
83
84         Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
85         cancel_button->show();
86         add_action_widget(*cancel_button,0);
87         cancel_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::hide));
88
89
90         waypointwidget->show_all();
91 }
92
93 Dialog_Waypoint::~Dialog_Waypoint()
94 {
95 }
96
97 void
98 Dialog_Waypoint::on_ok_pressed()
99 {
100         hide();
101     signal_changed_();
102 }
103
104 void
105 Dialog_Waypoint::on_apply_pressed()
106 {
107     signal_changed_();
108 }
109
110 void
111 Dialog_Waypoint::on_delete_pressed()
112 {
113         hide();
114     signal_delete_();
115 }
116
117 void
118 Dialog_Waypoint::set_waypoint(synfig::ValueNode_Animated::Waypoint x)
119 {
120         waypointwidget->set_waypoint(x);
121 }
122
123 const synfig::ValueNode_Animated::Waypoint &
124 Dialog_Waypoint::get_waypoint()const
125 {
126         return waypointwidget->get_waypoint();
127 }
128
129 void
130 Dialog_Waypoint::set_value_desc(synfigapp::ValueDesc value_desc)
131 {
132         value_desc_=value_desc;
133         if(value_desc.get_value_node() && value_desc.get_value_node()->get_parent_canvas())
134                 waypointwidget->set_canvas(value_desc.get_value_node()->get_parent_canvas());
135 }
136
137 void
138 Dialog_Waypoint::reset()
139 {
140 }