| 1 |
/* champlain-adjustment.h: Adjustment object |
| 2 |
* |
| 3 |
* Copyright (C) 2008 OpenedHand |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the |
| 17 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 18 |
* Boston, MA 02111-1307, USA. |
| 19 |
* |
| 20 |
* Written by: Chris Lord <chris@openedhand.com>, inspired by GtkAdjustment |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef __CHAMPLAIN_ADJUSTMENT_H__ |
| 24 |
#define __CHAMPLAIN_ADJUSTMENT_H__ |
| 25 |
|
| 26 |
#include <glib-object.h> |
| 27 |
#include <clutter/clutter.h> |
| 28 |
|
| 29 |
G_BEGIN_DECLS |
| 30 |
|
| 31 |
#define CHAMPLAIN_TYPE_ADJUSTMENT champlain_adjustment_get_type () |
| 32 |
|
| 33 |
#define CHAMPLAIN_ADJUSTMENT(obj) \ |
| 34 |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_ADJUSTMENT, ChamplainAdjustment)) |
| 35 |
|
| 36 |
#define CHAMPLAIN_IS_ADJUSTMENT(obj) \ |
| 37 |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_ADJUSTMENT)) |
| 38 |
|
| 39 |
#define CHAMPLAIN_ADJUSTMENT_CLASS(klass) \ |
| 40 |
(G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_ADJUSTMENT, ChamplainAdjustmentClass)) |
| 41 |
|
| 42 |
#define CHAMPLAIN_IS_ADJUSTMENT_CLASS(klass) \ |
| 43 |
(G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_ADJUSTMENT)) |
| 44 |
|
| 45 |
#define CHAMPLAIN_ADJUSTMENT_GET_CLASS(obj) \ |
| 46 |
(G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_ADJUSTMENT, ChamplainAdjustmentClass)) |
| 47 |
|
| 48 |
typedef struct _ChamplainAdjustment ChamplainAdjustment; |
| 49 |
typedef struct _ChamplainAdjustmentPrivate ChamplainAdjustmentPrivate; |
| 50 |
typedef struct _ChamplainAdjustmentClass ChamplainAdjustmentClass; |
| 51 |
|
| 52 |
/** |
| 53 |
* ChamplainAdjustment: |
| 54 |
* |
| 55 |
* Class for handling an interval between to values. The contents of |
| 56 |
* the #ChamplainAdjustment are private and should be accessed using the |
| 57 |
* public API. |
| 58 |
*/ |
| 59 |
struct _ChamplainAdjustment |
| 60 |
{ |
| 61 |
/*< private >*/ |
| 62 |
GObject parent_instance; |
| 63 |
|
| 64 |
ChamplainAdjustmentPrivate *priv; |
| 65 |
}; |
| 66 |
|
| 67 |
/** |
| 68 |
* ChamplainAdjustmentClass |
| 69 |
* @changed: Class handler for the ::changed signal. |
| 70 |
* |
| 71 |
* Base class for #ChamplainAdjustment. |
| 72 |
*/ |
| 73 |
struct _ChamplainAdjustmentClass |
| 74 |
{ |
| 75 |
/*< private >*/ |
| 76 |
GObjectClass parent_class; |
| 77 |
|
| 78 |
/*< public >*/ |
| 79 |
void (*changed)(ChamplainAdjustment *adjustment); |
| 80 |
}; |
| 81 |
|
| 82 |
GType champlain_adjustment_get_type (void) G_GNUC_CONST; |
| 83 |
|
| 84 |
ChamplainAdjustment *champlain_adjustment_new (gdouble value, |
| 85 |
gdouble lower, |
| 86 |
gdouble upper, |
| 87 |
gdouble step_increment, |
| 88 |
gdouble page_increment, |
| 89 |
gdouble page_size); |
| 90 |
gdouble champlain_adjustment_get_value (ChamplainAdjustment *adjustment); |
| 91 |
void champlain_adjustment_set_value (ChamplainAdjustment *adjustment, |
| 92 |
gdouble value); |
| 93 |
void champlain_adjustment_set_values (ChamplainAdjustment *adjustment, |
| 94 |
gdouble value, |
| 95 |
gdouble lower, |
| 96 |
gdouble upper, |
| 97 |
gdouble step_increment, |
| 98 |
gdouble page_increment, |
| 99 |
gdouble page_size); |
| 100 |
void champlain_adjustment_get_values (ChamplainAdjustment *adjustment, |
| 101 |
gdouble *value, |
| 102 |
gdouble *lower, |
| 103 |
gdouble *upper, |
| 104 |
gdouble *step_increment, |
| 105 |
gdouble *page_increment, |
| 106 |
gdouble *page_size); |
| 107 |
|
| 108 |
void champlain_adjustment_interpolate (ChamplainAdjustment *adjustment, |
| 109 |
gdouble value, |
| 110 |
guint n_frames, |
| 111 |
guint fps); |
| 112 |
|
| 113 |
gboolean champlain_adjustment_get_elastic (ChamplainAdjustment *adjustment); |
| 114 |
void champlain_adjustment_set_elastic (ChamplainAdjustment *adjustment, |
| 115 |
gboolean elastic); |
| 116 |
|
| 117 |
gboolean champlain_adjustment_clamp (ChamplainAdjustment *adjustment, |
| 118 |
gboolean interpolate, |
| 119 |
guint n_frames, |
| 120 |
guint fps); |
| 121 |
void champlain_adjustment_interpolate_stop (ChamplainAdjustment *adjustment); |
| 122 |
|
| 123 |
G_END_DECLS |
| 124 |
|
| 125 |
#endif /* __CHAMPLAIN_ADJUSTMENT_H__ */ |