libxputty 0.1
Loading...
Searching...
No Matches
xadjustment.h
Go to the documentation of this file.
1/*
2 * 0BSD
3 *
4 * BSD Zero Clause License
5 *
6 * Copyright (c) 2019 Hermann Meyer
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted.
10
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
21#pragma once
22
23#ifndef XADJUSTMENT_H_
24#define XADJUSTMENT_H_
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include "xputty.h"
31
32
45typedef enum {
47 CL_NONE = 0x0001,
49 CL_CONTINUOS = 0x0002,
51 CL_TOGGLE = 0x0004,
53 CL_BUTTON = 0x0008,
55 CL_ENUM = 0x0016,
57 CL_VIEWPORT = 0x0032,
59 CL_METER = 0x0064,
63 CL_LOGSCALE = 0x0256,
66}CL_type;
67
86 float std_value;
88 float value;
90 float min_value;
92 float max_value;
94 float step;
98 float scale;
104 char pad[4];
105};
106
119Adjustment_t *add_adjustment(Widget_t *w, float std_value, float value,
120 float min_value,float max_value, float step, CL_type type);
121
122
135void set_adjustment(Adjustment_t *adj, float std_value, float value,
136 float min_value,float max_value, float step, CL_type type);
137
145
152float adj_get_state(Adjustment_t *adj);
153
160void adj_set_state(Adjustment_t *adj, float state);
161
168float adj_get_value(Adjustment_t *adj);
169
177
185
193
200void adj_set_value(Adjustment_t *adj, float value);
201
208void adj_set_min_value(Adjustment_t *adj, float value);
209
216void adj_set_max_value(Adjustment_t *adj, float value);
217
224void adj_set_std_value(Adjustment_t *adj, float value);
225
231void adj_set_start_value(void *w);
232
239void adj_set_scale(Adjustment_t *adj, float value);
240
247void adj_set_log_scale(Adjustment_t *adj, float value);
248
257void adj_set_motion_state(void *w, float x, float y);
258
266void check_value_changed(Adjustment_t *adj, float *value);
267
268#ifdef __cplusplus
269}
270#endif
271
272#endif //XADJUSTMENT_H_
Adjustment_t - struct to hold a controller adjustment.
Definition xadjustment.h:82
float std_value
Definition xadjustment.h:86
Widget_t * w
Definition xadjustment.h:84
float min_value
Definition xadjustment.h:90
float max_value
Definition xadjustment.h:92
float start_value
Definition xadjustment.h:96
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
void * delete_adjustment(Adjustment_t *adj)
delete_adjustment - freeing the memory of the Adjustment_t You usually don't need to call this,...
void adj_set_log_scale(Adjustment_t *adj, float value)
adj_set_log_scale - internal use to set the logarithmic scale
void check_value_changed(Adjustment_t *adj, float *value)
check_value_changed - check if Adjustment_t value have changed and send value_changed_callback (VALUE...
void adj_set_motion_state(void *w, float x, float y)
adj_set_motion_state - internal use to set value and state of the Adjustment_t on mouse pointer movme...
float adj_get_max_value(Adjustment_t *adj)
adj_get_max_value - get the maximal value of the Adjustment_t
void adj_set_state(Adjustment_t *adj, float state)
adj_set_state - set the current state of the Adjustment_t
float adj_get_std_value(Adjustment_t *adj)
adj_get_std_value - get the standart value of the Adjustment_t
void adj_set_value(Adjustment_t *adj, float value)
adj_set_value - set the current value to the Adjustment_t
void adj_set_std_value(Adjustment_t *adj, float value)
adj_set_std_value - set the standart value to the Adjustment_t
float adj_get_value(Adjustment_t *adj)
adj_get_value - get the current value of the Adjustment_t
void adj_set_start_value(void *w)
adj_set_start_value - internal use to store the value when pointer movment starts
void adj_set_max_value(Adjustment_t *adj, float value)
adj_set_max_value - set the maximal value to the Adjustment_t
Adjustment_t * add_adjustment(Widget_t *w, float std_value, float value, float min_value, float max_value, float step, CL_type type)
*add_adjustment - adding a adjustment to a Widget_t
Definition xadjustment.c:25
void set_adjustment(Adjustment_t *adj, float std_value, float value, float min_value, float max_value, float step, CL_type type)
*set_adjustment - set a new range to a existing Adjustment_t or create if it not exists yet
Definition xadjustment.c:80
float adj_get_min_value(Adjustment_t *adj)
adj_get_min_value - get the minimal value of the Adjustment_t
void adj_set_min_value(Adjustment_t *adj, float value)
adj_set_min_value - set the minimal value to the Adjustment_t
CL_type
CL_type - define the type of the controller adjustment one of this types must be given when set up a ...
Definition xadjustment.h:45
@ CL_TOGGLE
Definition xadjustment.h:51
@ CL_METER
Definition xadjustment.h:59
@ CL_CONTINUOS
Definition xadjustment.h:49
@ CL_VIEWPORT
Definition xadjustment.h:57
@ CL_NONE
Definition xadjustment.h:47
@ CL_LOGARITHMIC
Definition xadjustment.h:61
@ CL_ENUM
Definition xadjustment.h:55
@ CL_BUTTON
Definition xadjustment.h:53
@ CL_LOGSCALE
Definition xadjustment.h:63
@ CL_VIEWPORTSLIDER
Definition xadjustment.h:65
float adj_get_state(Adjustment_t *adj)
adj_get_state - get the current state of the Adjustment_t
void adj_set_scale(Adjustment_t *adj, float value)
adj_set_scale - internal use to scale the pointer movement (0.1 -1.0)
This file contains definitions and structs used on all platforms. Platform specific definitions are l...