File: gtkknob.h

package info (click to toggle)
xsynth-dssi 0.9.4-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 2,152 kB
  • ctags: 776
  • sloc: sh: 10,156; ansic: 10,132; makefile: 77
file content (84 lines) | stat: -rw-r--r-- 2,581 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* Xsynth DSSI software synthesizer GUI
 *
 * Copyright (C) 2008, 2010 Sean Bolton
 *
 * Parts of this code come from GTK+, both the library source and
 * the example programs.  Other bits come from gAlan 0.2.0,
 * copyright (C) 1999 Tony Garnock-Jones.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA.
 */

#ifndef __GTK_KNOB_H__
#define __GTK_KNOB_H__

#include <gdk/gdk.h>
#include <gtk/gtk.h>

#ifdef __cplusplus
extern "C" {
#endif

#define GTK_TYPE_KNOB            (gtk_knob_get_type ())
#define GTK_KNOB(obj)		 GTK_CHECK_CAST(obj, gtk_knob_get_type(), GtkKnob)
#define GTK_KNOB_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_KNOB, GtkKnobClass))
#define GTK_IS_KNOB(obj)	 GTK_CHECK_TYPE(obj, gtk_knob_get_type())
#define GTK_IS_KNOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_KNOB))
#define GTK_KNOB_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_KNOB, GtkKnobClass))

typedef struct _GtkKnob       GtkKnob;
typedef struct _GtkKnobClass  GtkKnobClass;

struct _GtkKnob
{
    GtkWidget widget;

    GtkAdjustment *adjustment;

    guint  policy;   /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */
    guint  state;
    gint   center_x;
    gint   center_y;
    gint   saved_x;
    gint   saved_y;
    gfloat old_value;

    guint32 timer;   /* ID of update timer, or 0 if none */
};

struct _GtkKnobClass
{
    GtkWidgetClass parent_class;
};


guint          gtk_knob_get_type(void);
GtkWidget     *gtk_knob_new (GtkAdjustment *adjustment);

void           gtk_knob_set_fast_rendering(gboolean setting);

GtkAdjustment *gtk_knob_get_adjustment(GtkKnob *knob);
void           gtk_knob_set_adjustment(GtkKnob *knob, GtkAdjustment *adjustment);

void           gtk_knob_set_update_policy(GtkKnob *knob, GtkUpdateType  policy);
GtkUpdateType  gtk_knob_get_update_policy(GtkKnob *knob);

#ifdef __cplusplus
}
#endif

#endif /* __GTK_KNOB_H__ */