The Gnome Chemistry Utils  0.14.0
spectrumview.h
Go to the documentation of this file.
1 /*
2  * Gnome Chemisty Utils
3  * spectrumview.h
4  *
5  * Copyright (C) 2007-2012 Jean Bréfort <jean.brefort@normalesup.org>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef GCU_SPECTRUM_VIEW_H
24 #define GCU_SPECTRUM_VIEW_H
25 
26 #include <gcu/macros.h>
27 
29 namespace gcugtk
30 {
31 
32 class SpectrumDocument;
33 
39 {
40 friend class SpectrumViewPrivate;
41 public:
43 
49 
51 
54  virtual ~SpectrumView ();
55 
64  void SetAxisBounds (GogAxisType target, double min, double max, bool inverted);
65 
72  void SetAxisLabel (GogAxisType target, char const *unit);
73 
80  void ShowAxis (GogAxisType target, bool show);
81 
88  void InvertAxis (GogAxisType target, bool inverted);
89 
97  void Render (cairo_t *cr, double width, double height);
98 
102  void OnMinChanged ();
103 
107  void OnYMinChanged ();
108 
112  void OnMaxChanged ();
113 
117  void OnYMaxChanged ();
118 
122  void OnXRangeChanged ();
123 
127  void OnYRangeChanged ();
128 
133  GogSeries *NewSeries (bool new_plot);
134 
145  void SaveAsImage (std::string const &filename, char const *mime_type, unsigned width, unsigned height) const;
146 
152  void AddToOptionBox (GtkWidget *w);
153 
158  void DestroyExtraWidget ();
159 
160 private:
161  GtkSpinButton *xminbtn, *xmaxbtn, *yminbtn, *ymaxbtn;
162  GtkRange *xrange, *yrange;
163  gulong minsgn, maxsgn, yminsgn, ymaxsgn, xrangesgn, yrangesgn;
164  double xmin, xmax, xstep, ymin, ymax, ystep;
165  GtkWidget *m_ExtraWidget;
166 
174 GCU_RO_PROP (GtkWidget *, Widget)
178 GCU_RO_PROP (GtkWidget *, OptionBox)
182 GCU_RO_PROP (GogSeries *, Series)
186 GCU_RO_PROP (int, Width)
190 GCU_RO_PROP (int, Height)
191 };
192 
193 }
194 
195 #endif // GCU_SPECTRUM_VIEW_H