diff options
Diffstat (limited to 'ganv/port.h')
-rw-r--r-- | ganv/port.h | 64 |
1 files changed, 16 insertions, 48 deletions
diff --git a/ganv/port.h b/ganv/port.h index 454c4a8..1ae7673 100644 --- a/ganv/port.h +++ b/ganv/port.h @@ -22,28 +22,21 @@ struct _GanvModule; G_BEGIN_DECLS -#define GANV_TYPE_PORT (ganv_port_get_type()) -#define GANV_PORT(obj) (GTK_CHECK_CAST((obj), GANV_TYPE_PORT, GanvPort)) -#define GANV_PORT_CLASS(klass) (GTK_CHECK_CLASS_CAST((klass), GANV_TYPE_PORT, GanvPortClass)) -#define GANV_IS_PORT(obj) (GTK_CHECK_TYPE((obj), GANV_TYPE_PORT)) -#define GANV_IS_PORT_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_PORT)) -#define GANV_PORT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_PORT, GanvPortClass)) +#define GANV_TYPE_PORT (ganv_port_get_type()) +#define GANV_PORT(obj) (GTK_CHECK_CAST((obj), GANV_TYPE_PORT, GanvPort)) +#define GANV_PORT_CLASS(klass) (GTK_CHECK_CLASS_CAST((klass), GANV_TYPE_PORT, GanvPortClass)) +#define GANV_IS_PORT(obj) (GTK_CHECK_TYPE((obj), GANV_TYPE_PORT)) +#define GANV_IS_PORT_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_PORT)) +#define GANV_PORT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_PORT, GanvPortClass)) +#define GANV_PORT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GANV_TYPE_PORT, GanvPortImpl)) typedef struct _GanvPortClass GanvPortClass; - -typedef struct { - GanvBox* rect; - float value; - float min; - float max; - gboolean is_toggle; -} GanvPortControl; +typedef struct _GanvPortImpl GanvPortImpl; struct _GanvPort { - GanvBox box; - GanvPortControl* control; - gboolean is_input; + GanvBox box; + GanvPortImpl* impl; }; struct _GanvPortClass { @@ -86,39 +79,14 @@ ganv_port_get_natural_width(const GanvPort* port); * ganv_port_get_module: * Return value: (transfer none): The module @a port is on. */ -GanvModule* -ganv_port_get_module(const GanvPort* port); +GanvModule* ganv_port_get_module(const GanvPort* port); -static inline float -ganv_port_get_control_value(const GanvPort* port) -{ - return port->control ? port->control->value : 0.0f; -} +float ganv_port_get_control_value(const GanvPort* port); +float ganv_port_get_control_min(const GanvPort* port); +float ganv_port_get_control_max(const GanvPort* port); +gboolean ganv_port_is_input(const GanvPort* port); +gboolean ganv_port_is_output(const GanvPort* port); -static inline float -ganv_port_get_control_min(const GanvPort* port) -{ - return port->control ? port->control->min : 0.0f; -} - -static inline float -ganv_port_get_control_max(const GanvPort* port) -{ - return port->control ? port->control->max : 0.0f; -} - -static inline gboolean -ganv_port_is_input(const GanvPort* port) -{ - return port->is_input; -} - -static inline gboolean -ganv_port_is_output(const GanvPort* port) -{ - return !port->is_input; -} - G_END_DECLS #endif /* GANV_PORT_H */ |