champlain-adjustment.h 3.57 KB
Newer Older
1
/* champlain-adjustment.h: Adjustment object
Jiří Techet's avatar
Jiří Techet committed
2 3
 *
 * Copyright (C) 2008 OpenedHand
4
 * Copyright (C) 2011-2013 Jiri Techet <techet@gmail.com>
Jiří Techet's avatar
Jiří Techet committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Written by: Chris Lord <chris@openedhand.com>, inspired by GtkAdjustment
 */

24 25
#ifndef __CHAMPLAIN_ADJUSTMENT_H__
#define __CHAMPLAIN_ADJUSTMENT_H__
Jiří Techet's avatar
Jiří Techet committed
26 27 28 29 30 31

#include <glib-object.h>
#include <clutter/clutter.h>

G_BEGIN_DECLS

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#define CHAMPLAIN_TYPE_ADJUSTMENT champlain_adjustment_get_type ()

#define CHAMPLAIN_ADJUSTMENT(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_ADJUSTMENT, ChamplainAdjustment))
  
#define CHAMPLAIN_IS_ADJUSTMENT(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_ADJUSTMENT))
  
#define CHAMPLAIN_ADJUSTMENT_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_ADJUSTMENT, ChamplainAdjustmentClass))
  
#define CHAMPLAIN_IS_ADJUSTMENT_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_ADJUSTMENT))
  
#define CHAMPLAIN_ADJUSTMENT_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_ADJUSTMENT, ChamplainAdjustmentClass))
Jiří Techet's avatar
Jiří Techet committed
48

Jiří Techet's avatar
Jiří Techet committed
49 50 51
typedef struct _ChamplainAdjustment ChamplainAdjustment;
typedef struct _ChamplainAdjustmentPrivate ChamplainAdjustmentPrivate;
typedef struct _ChamplainAdjustmentClass ChamplainAdjustmentClass;
Jiří Techet's avatar
Jiří Techet committed
52 53

/**
54
 * ChamplainAdjustment:
Jiří Techet's avatar
Jiří Techet committed
55 56
 *
 * Class for handling an interval between to values. The contents of
57
 * the #ChamplainAdjustment are private and should be accessed using the
Jiří Techet's avatar
Jiří Techet committed
58 59
 * public API.
 */
60
struct _ChamplainAdjustment
Jiří Techet's avatar
Jiří Techet committed
61 62 63 64
{
  /*< private >*/
  GObject parent_instance;

65
  ChamplainAdjustmentPrivate *priv;
Jiří Techet's avatar
Jiří Techet committed
66 67 68
};

/**
69
 * ChamplainAdjustmentClass:
Jiří Techet's avatar
Jiří Techet committed
70 71
 * @changed: Class handler for the ::changed signal.
 *
72
 * Base class for #ChamplainAdjustment.
Jiří Techet's avatar
Jiří Techet committed
73
 */
74
struct _ChamplainAdjustmentClass
Jiří Techet's avatar
Jiří Techet committed
75 76 77 78 79
{
  /*< private >*/
  GObjectClass parent_class;

  /*< public >*/
Jiří Techet's avatar
Jiří Techet committed
80
  void (*changed)(ChamplainAdjustment *adjustment);
Jiří Techet's avatar
Jiří Techet committed
81 82
};

83
GType champlain_adjustment_get_type (void) G_GNUC_CONST;
Jiří Techet's avatar
Jiří Techet committed
84

Jiří Techet's avatar
Jiří Techet committed
85 86 87
ChamplainAdjustment *champlain_adjustment_new (gdouble value,
    gdouble lower,
    gdouble upper,
88
    gdouble step_increment);
Jiří Techet's avatar
Jiří Techet committed
89 90 91 92 93 94 95
gdouble champlain_adjustment_get_value (ChamplainAdjustment *adjustment);
void champlain_adjustment_set_value (ChamplainAdjustment *adjustment,
    gdouble value);
void champlain_adjustment_set_values (ChamplainAdjustment *adjustment,
    gdouble value,
    gdouble lower,
    gdouble upper,
96
    gdouble step_increment);
Jiří Techet's avatar
Jiří Techet committed
97 98 99 100
void champlain_adjustment_get_values (ChamplainAdjustment *adjustment,
    gdouble *value,
    gdouble *lower,
    gdouble *upper,
101
    gdouble *step_increment);
Jiří Techet's avatar
Jiří Techet committed
102 103 104 105 106 107 108 109 110 111 112

void champlain_adjustment_interpolate (ChamplainAdjustment *adjustment,
    gdouble value,
    guint n_frames,
    guint fps);

gboolean champlain_adjustment_clamp (ChamplainAdjustment *adjustment,
    gboolean interpolate,
    guint n_frames,
    guint fps);
void champlain_adjustment_interpolate_stop (ChamplainAdjustment *adjustment);
Jiří Techet's avatar
Jiří Techet committed
113 114 115

G_END_DECLS

116
#endif /* __CHAMPLAIN_ADJUSTMENT_H__ */