#include "xputty.h"
Go to the source code of this file.
Data Structures | |
struct | Adjustment_t |
Adjustment_t - struct to hold a controller adjustment. More... | |
Macros | |
#define | XADJUSTMENT_H_ |
Enumerations | |
enum | CL_type { CL_NONE = 0x0001, CL_CONTINUOS = 0x0002, CL_TOGGLE = 0x0004, CL_BUTTON = 0x0008, CL_ENUM = 0x0016, CL_VIEWPORT = 0x0032, CL_METER = 0x0064, CL_LOGARITHMIC = 0x0128, CL_LOGSCALE = 0x0256 } |
CL_type - define the type of the controller adjustment one of this types must be given when set up a Adjustment_t for a Wdiget_t. More... | |
Functions | |
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 More... | |
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 it will be created if it not exsits yet More... | |
void * | delete_adjustment (Adjustment_t *adj) |
delete_adjustment - freeing the memory of the Adjustment_t You usually don't need to call this, as it get handled by main_quit() -> destroy_widget() More... | |
float | adj_get_state (Adjustment_t *adj) |
adj_get_state - get the current state of the Adjustment_t More... | |
void | adj_set_state (Adjustment_t *adj, float state) |
adj_set_state - set the current state of the Adjustment_t More... | |
float | adj_get_value (Adjustment_t *adj) |
adj_get_value - get the current value of the Adjustment_t More... | |
void | adj_set_value (Adjustment_t *adj, float value) |
adj_set_value - set the current value to the Adjustment_t More... | |
void | adj_set_start_value (void *w) |
adj_set_start_value - internal use to store the value when pointer movment starts More... | |
void | adj_set_scale (Adjustment_t *adj, float value) |
adj_set_scale - internal use to scale the pointer movement (0.1 -1.0) More... | |
void | adj_set_log_scale (Adjustment_t *adj, float value) |
adj_set_log_scale - internal use to set the logarithmic scale More... | |
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 movment More... | |
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_CHANGED) and adj_callback (ADJ_INTERN) if so More... | |
#define XADJUSTMENT_H_ |
Definition at line 24 of file xadjustment.h.
enum CL_type |
CL_type - define the type of the controller adjustment one of this types must be given when set up a Adjustment_t for a Wdiget_t.
CL_NONE | - Widget_t didn't request a adjustment |
CL_CONTINUOS | - Widget_t request a continuos adjustment |
CL_TOGGLE | - Widget_t request a toggle adjustment |
CL_BUTTON | - Widget_t request a button adjustment |
CL_ENUM | - Widget_t request a enum adjustment |
CL_LOGARITHMIC | - Widget_t request a logarithmic adjustment |
Enumerator | |
---|---|
CL_NONE | Widget_t didn't request a adjustment |
CL_CONTINUOS | Widget_t request a continuos adjustment |
CL_TOGGLE | Widget_t request a toggle adjustment |
CL_BUTTON | Widget_t request a button adjustment |
CL_ENUM | Widget_t request a enum adjustment |
CL_VIEWPORT | Widget_t request a viewport adjustment |
CL_METER | Widget_t request a viewport adjustment |
CL_LOGARITHMIC | Widget_t request a logarithmic adjustment |
CL_LOGSCALE | Widget_t request a logarithmic scaled adjustment |
Definition at line 45 of file xadjustment.h.
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
*w | - pointer to the Widget_t request a Adjustment_t |
std_value | - standard value of the Adjustment_t |
value | - current value of the Adjustment_t |
min_value | - minimum value of the Adjustment_t |
max_value | - maximal value of the Adjustment_t |
step | - step to increase/decrease the Adjustment_t |
type | - set CL_type of Adjustment_t |
Definition at line 25 of file xadjustment.c.
References CL_LOGARITHMIC, CL_LOGSCALE, debug_print, Adjustment_t::log_scale, and Widget_t::scale.
float adj_get_state | ( | Adjustment_t * | adj | ) |
adj_get_state - get the current state of the Adjustment_t
*adj | - pointer to the Adjustment_t |
Definition at line 148 of file xadjustment.c.
References Adjustment_t::max_value, Adjustment_t::min_value, and Adjustment_t::value.
float adj_get_value | ( | Adjustment_t * | adj | ) |
adj_get_value - get the current value of the Adjustment_t
*adj | - pointer to the Adjustment_t |
Definition at line 154 of file xadjustment.c.
References CL_LOGARITHMIC, CL_LOGSCALE, Adjustment_t::log_scale, Adjustment_t::type, and Adjustment_t::value.
void adj_set_log_scale | ( | Adjustment_t * | adj, |
float | value | ||
) |
adj_set_log_scale - internal use to set the logarithmic scale
*adj | - pointer to the Adjustment_t |
value | - value to set the scaleing factor to |
Definition at line 183 of file xadjustment.c.
References Adjustment_t::log_scale.
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 movment
*w | - pointer to Widget_t containing Adjustment_t |
x | - movment on the x-axis |
y | - movement on the y-axis |
Definition at line 187 of file xadjustment.c.
References Widget_t::adj_x, Widget_t::adj_y, check_value_changed(), CL_CONTINUOS, CL_LOGARITHMIC, CL_LOGSCALE, CL_TOGGLE, max, Adjustment_t::max_value, min, Adjustment_t::min_value, Widget_t::pos_x, Widget_t::pos_y, Adjustment_t::scale, Adjustment_t::start_value, Adjustment_t::step, Adjustment_t::type, and Adjustment_t::value.
void adj_set_scale | ( | Adjustment_t * | adj, |
float | value | ||
) |
adj_set_scale - internal use to scale the pointer movement (0.1 -1.0)
*adj | - pointer to the Adjustment_t |
value | - value to set the scaleing factor to |
Definition at line 179 of file xadjustment.c.
References Adjustment_t::scale.
void adj_set_start_value | ( | void * | w | ) |
adj_set_start_value - internal use to store the value when pointer movment starts
*w | - pointer to Widget_t containing the Adjustment_t |
Definition at line 173 of file xadjustment.c.
References Widget_t::adj_x, Widget_t::adj_y, Adjustment_t::start_value, and Adjustment_t::value.
void adj_set_state | ( | Adjustment_t * | adj, |
float | state | ||
) |
adj_set_state - set the current state of the Adjustment_t
*adj | - pointer to the Adjustment_t |
Definition at line 141 of file xadjustment.c.
References check_value_changed(), max, Adjustment_t::max_value, min, and Adjustment_t::min_value.
void adj_set_value | ( | Adjustment_t * | adj, |
float | value | ||
) |
adj_set_value - set the current value to the Adjustment_t
*adj | - pointer to the Adjustment_t |
value | - value to set the Adjustment_t to |
Definition at line 163 of file xadjustment.c.
References check_value_changed(), CL_LOGARITHMIC, CL_LOGSCALE, Adjustment_t::log_scale, max, Adjustment_t::max_value, min, Adjustment_t::min_value, and Adjustment_t::type.
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_CHANGED) and adj_callback (ADJ_INTERN) if so
*adj | - pointer to the Adjustment_t |
value | - value to check |
Definition at line 241 of file xadjustment.c.
References Func_t::adj_callback, debug_print, Widget_t::func, Adjustment_t::value, Func_t::value_changed_callback, and Adjustment_t::w.
void* delete_adjustment | ( | Adjustment_t * | adj | ) |
delete_adjustment - freeing the memory of the Adjustment_t You usually don't need to call this, as it get handled by main_quit() -> destroy_widget()
*adj | - pointer to the Adjustment to free |
Definition at line 133 of file xadjustment.c.
References debug_print.
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 it will be created if it not exsits yet
*w | - pointer to the Widget_t request a Adjustment_t |
std_value | - standard value of the Adjustment_t |
value | - current value of the Adjustment_t |
min_value | - minimum value of the Adjustment_t |
max_value | - maximal value of the Adjustment_t |
step | - step to increase/decrease the Adjustment_t |
type | - set CL_type of Adjustment_t |
Definition at line 80 of file xadjustment.c.
References CL_LOGARITHMIC, CL_LOGSCALE, debug_print, Adjustment_t::log_scale, Widget_t::scale, and Adjustment_t::w.