Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::Curve Class Reference

A GtkCurve C++ wrapper class. More...

`#include <xfc/gtk/curve.hh>`

Inheritance diagram for Xfc::Gtk::Curve:

List of all members.

## Signal Prototypes

- const CurveTypeChangedSignalType curve_type_changed_signal
    Curve type changed signal (see signal_curve_type_changed()).

## Public Member Functions

Constructors

- Curve ()
    Construct a new Curve.
- virtual ~Curve ()
    Destructor.

Accessors

- GtkCurve * gtk_curve () const
    Get a pointer to the GtkCurve structure.
- operator GtkCurve * () const
    Conversion operator; safely converts a Curve to a GtkCurve pointer.
- void get_vector (int count, float data[]) const
    Returns a vector of points representing the curve.

Methods

- void reset ()
    Resets the curve to a straight line from the minimum x and y values to the maximum x and y values (from the bottom-left to the top-right corners); the curve type is not changed.
- void set_gamma (float gamma)
    Recomputes the entire curve using the given gamma value.
- void set_range (float min_x, float max_x, float min_y, float max_y)
    Sets the minimum and maximum x and y values of the curve.
- void set_vector (int count, float data[])
    Sets the vector of points on the curve; the curve type is set to CURVE_TYPE_FREE.
- void set_curve_type (CurveType type)
    Sets the type of the curve.

Signal Proxies

- const CurveTypeChangedSignalProxy signal_curve_type_changed ()
    Connect to the curve_type_changed_signal; emitted when the curve type changes.

## Protected Member Functions

Constructors

- Curve (GtkCurve *curve, bool owns_reference=false)
    Construct a new Curve from an existing GtkCurve.

## Detailed Description

A GtkCurve C++ wrapper class.

Curve is a widget that allows the user to edit a curve covering a range of values. It is typically used to fine-tune color balances in graphics applications like the Gimp. Curve has 3 modes of operation - spline, linear and free. In spline mode the user places points on the curve which are automatically connected together into a smooth curve. In linear mode the user places points on the curve which are connected by straight lines. In free mode the user can draw the points of the curve freely, and they are not connected at all.

NOTE this widget is considered too specialized/little-used for GTK+, and will in the future be moved to some other package. If your application needs this widget, feel free to use it, as the widget does work and is useful in some applications; it's just not of general interest.

## Constructor & Destructor Documentation

Xfc::Gtk::Curve::Curve | ( | GtkCurve * | curve,
|  | bool | owns_reference = `false`
| ) | `[explicit, protected]`

Construct a new Curve from an existing GtkCurve.

Parameters:

  | curve | A pointer to a GtkCurve.
  | owns_reference | Set false if the initial reference count is floating, set true if it's not.

The curve can be a newly created GtkCurve or an existing GtkCurve. (see G::Object::Object).

## Member Function Documentation

void Xfc::Gtk::Curve::get_vector | ( | int | count,
|  | float | data[]
| ) | const

Returns a vector of points representing the curve.

Parameters:

  | count | The number of points to calculate.
  | data | The points.

void Xfc::Gtk::Curve::set_curve_type | ( | CurveType | type | ) |

Sets the type of the curve.

Parameters:

  | type | The type of the curve.

The curve will remain unchanged except when changing from a free curve to a linear or spline curve, in which case the curve will be changed as little as possible.

void Xfc::Gtk::Curve::set_gamma | ( | float | gamma | ) |

Recomputes the entire curve using the given gamma value.

Parameters:

  | gamma | The gamma value.

A gamma value of 1 results in a straight line. Values greater than 1 result in a curve above the straight line. Values less than 1 result in a curve below the straight line. The curve type is changed to CURVE_TYPE_FREE.

void Xfc::Gtk::Curve::set_range | ( | float | min_x,
|  | float | max_x,
|  | float | min_y,
|  | float | max_y
| ) |

Sets the minimum and maximum x and y values of the curve.

Parameters:

  | min_x | The minimum x value.
  | max_x | The maximum x value.
  | min_y | The minimum y value.
  | max_y | The maximum y value.

The curve is also reset with a call to reset().

void Xfc::Gtk::Curve::set_vector | ( | int | count,
|  | float | data[]
| ) |

Sets the vector of points on the curve; the curve type is set to CURVE_TYPE_FREE.

Parameters:

  | count | The number of points.
  | data | The points on the curve.

## Member Data Documentation

const CurveTypeChangedSignalType Xfc::Gtk::Curve::curve_type_changed_signal `[static, protected]`

Curve type changed signal (see signal_curve_type_changed()).

Calls a slot with the signature:

                 void function();

The documentation for this class was generated from the following file:

- curve.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3