Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# curve.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *  Copyright (C) 2000 Red Hat, Inc.
    00004  *
    00005  *  This program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2 of the License, or
    00008  *  (at your option) any later version.
    00009  *
    00010  *  This program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00013  *  GNU Library General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU Library General Public License
    00016  *  along with this program; if not, write to the Free Software
    00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018  */
    00019
    00024
    00025 #ifndef INTI_GTK_CURVE_H
    00026 #define INTI_GTK_CURVE_H
    00027
    00028 #ifndef INTI_GTK_DRAWING_AREA_H
    00029 #include <inti/gtk/drawingarea.h>
    00030 #endif
    00031
    00032 #ifndef __GTK_CURVE_H__
    00033 #include <gtk/gtkcurve.h>
    00034 #endif
    00035
    00036 namespace Inti {
    00037
    00038 namespace Gtk {
    00039
    00040 class CurveClass;
    00041
    00045
    00046 enum CurveType
    00047 {
    00048         CURVE_TYPE_LINEAR = GTK_CURVE_TYPE_LINEAR,
    00049         CURVE_TYPE_SPLINE = GTK_CURVE_TYPE_SPLINE,
    00050         CURVE_TYPE_FREE = GTK_CURVE_TYPE_FREE
    00051 };
    00052
    00068
    00069 class Curve : public DrawingArea
    00070 {
    00071         friend class G::Object;
    00072         friend class CurveClass;
    00073
    00074         Curve(const Curve&);
    00075         Curve& operator=(const Curve&);
    00076
    00077 protected:
    00080
    00081         explicit Curve(GtkCurve *curve, bool reference = false);
    00088
    00092
    00093         virtual void on_curve_type_changed();
    00097
    00099 //  Properties
    00100
    00101         typedef G::Property<CurveType, int> CurveTypePropertyType;
    00102         typedef G::PropertyProxy<G::Object, CurveTypePropertyType> CurveTypePropertyProxy;
    00103         static const CurveTypePropertyType curve_type_property;
    00104
    00105         typedef G::Property<float> MinXPropertyType;
    00106         typedef G::PropertyProxy<G::Object, MinXPropertyType> MinXPropertyProxy;
    00107         static const MinXPropertyType min_x_property;
    00108
    00109         typedef G::Property<float> MinYPropertyType;
    00110         typedef G::PropertyProxy<G::Object, MinYPropertyType> MinYPropertyProxy;
    00111         static const MinYPropertyType min_y_property;
    00112
    00113         typedef G::Property<float> MaxXPropertyType;
    00114         typedef G::PropertyProxy<G::Object, MaxXPropertyType> MaxXPropertyProxy;
    00115         static const MaxXPropertyType max_x_property;
    00116
    00117         typedef G::Property<float> MaxYPropertyType;
    00118         typedef G::PropertyProxy<G::Object, MaxYPropertyType> MaxYPropertyProxy;
    00119         static const MaxYPropertyType max_y_property;
    00120
    00121 //  Signals
    00122
    00123         typedef G::Signal0<void> CurveTypeChangedSignalType;
    00124         typedef G::SignalProxy<TypeInstance, CurveTypeChangedSignalType> CurveTypeChangedSignalProxy;
    00125         static const CurveTypeChangedSignalType curve_type_changed_signal;
    00126
    00127 public:
    00130
    00131         Curve();
    00133
    00134         virtual ~Curve();
    00136
    00140
    00141         GtkCurve* gtk_curve() const { return (GtkCurve*)instance; }
    00143
    00144         GtkCurveClass* gtk_curve_class() const;
    00146
    00147         operator GtkCurve* () const;
    00149
    00150         void get_vector(int count, float data[]) const;
    00154
    00158
    00159         void reset();
    00163
    00164         void set_gamma(float gamma);
    00171
    00172         void set_range(float min_x, float max_x, float min_y, float max_y);
    00180
    00181         void set_vector(int count, float data[]);
    00185
    00186         void set_curve_type(CurveType type);
    00192
    00196
    00197         const CurveTypePropertyProxy prop_curve_type()
    00198         {
    00199                 return CurveTypePropertyProxy(this, &curve_type_property);
    00200         }
    00202
    00203         const MinXPropertyProxy prop_min_x()
    00204         {
    00205                 return MinXPropertyProxy(this, &min_x_property);
    00206         }
    00208
    00209         const MinYPropertyProxy prop_min_y()
    00210         {
    00211                 return MinYPropertyProxy(this, &min_y_property);
    00212         }
    00214
    00215         const MaxXPropertyProxy prop_max_x()
    00216         {
    00217                 return MaxXPropertyProxy(this, &max_x_property);
    00218         }
    00220
    00221         const MaxYPropertyProxy prop_max_y()
    00222         {
    00223                 return MaxYPropertyProxy(this, &max_y_property);
    00224         }
    00226
    00230
    00231         const CurveTypeChangedSignalProxy sig_curve_type_changed()
    00232         {
    00233                 return CurveTypeChangedSignalProxy(this, &curve_type_changed_signal);
    00234         }
    00236
    00238 };
    00239
    00240 } // namespace Gtk
    00241
    00242 } // namespace Inti
    00243
    00244 #endif // INTI_GTK_CURVE_H
    00245

Main Page - Footer