libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xtuner.h File Reference
#include "xputty.h"
Include dependency graph for xtuner.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  XTuner
 

Macros

#define XTUNER_H_
 

Functions

void tuner_set_temperament (Widget_t *w, float temp)
 
void tuner_set_ref_freq (Widget_t *w, float ref)
 
Widget_tadd_tuner (Widget_t *parent, const char *label, int x, int y, int width, int height)
 add_tuner - add a tuner widget to a Widget_t More...
 

Macro Definition Documentation

◆ XTUNER_H_

#define XTUNER_H_

Definition at line 24 of file xtuner.h.

Function Documentation

◆ add_tuner()

Widget_t* add_tuner ( Widget_t parent,
const char *  label,
int  x,
int  y,
int  width,
int  height 
)

add_tuner - add a tuner widget to a Widget_t

Parameters
*parent- pointer to the Widget_t request the tuner
*label- Label to show on the tuner
x,y,width,height- the position/geometry to create the tuner
Returns
Widget_t* - pointer to the Widget_t tuner struct

Definition at line 47 of file xtuner.c.

48  {
49 
50  XTuner *xt = (XTuner*)malloc(sizeof(XTuner));
51  Widget_t *wid = create_widget(parent->app, parent, x, y, width, height);
52  wid->parent_struct = xt;
53  wid->label = label;
54  wid->adj_y = add_adjustment(wid,20.0, 20.0, 20.0, 20000.0,0.01, CL_CONTINUOS);
55  wid->adj = wid->adj_y;
56  wid->scale.gravity = CENTER;
57  wid->flags &= ~USE_TRANSPARENCY;
58  wid->flags |= HAS_MEM;
59  cairo_select_font_face (wid->crb, "Sans", CAIRO_FONT_SLANT_NORMAL,
60  CAIRO_FONT_WEIGHT_NORMAL);
61  wid->func.mem_free_callback = xtuner_mem_free;
63  return wid;
64 }

References add_adjustment(), Widget_t::adj, Widget_t::adj_y, Widget_t::app, CENTER, CL_CONTINUOS, Widget_t::crb, create_widget(), Widget_t::flags, Widget_t::func, Resize_t::gravity, HAS_MEM, Widget_t::label, Func_t::mem_free_callback, Widget_t::parent_struct, Widget_t::scale, and USE_TRANSPARENCY.

◆ tuner_set_ref_freq()

void tuner_set_ref_freq ( Widget_t w,
float  ref 
)

Definition at line 36 of file xtuner.c.

36  {
37  XTuner *xt = (XTuner *)w->parent_struct;
38  xt->ref_freq = ref;
39 }

References Widget_t::parent_struct, and XTuner::ref_freq.

◆ tuner_set_temperament()

void tuner_set_temperament ( Widget_t w,
float  temp 
)

Definition at line 25 of file xtuner.c.

25  {
26  XTuner *xt = (XTuner *)w->parent_struct;
27  xt->temperament = temp;
28  if((int)temp == 0) xt->temp_adjust = 3;
29  else if((int)temp == 1) xt->temp_adjust = 6;
30  else if((int)temp == 2) xt->temp_adjust = 7;
31  else if((int)temp == 3) xt->temp_adjust = 9;
32  else if((int)temp == 4) xt->temp_adjust = 15;
33  else xt->temp_adjust = 3;
34 }

References Widget_t::parent_struct, XTuner::temp_adjust, and XTuner::temperament.

XTuner
Definition: xtuner.h:33
Resize_t::gravity
Gravity gravity
Definition: xwidget.h:192
Widget_t::parent_struct
void * parent_struct
Definition: xwidget.h:306
create_widget
Widget_t * create_widget(Xputty *app, Widget_t *win, int x, int y, int width, int height)
*create_widget - create a widget A Widget_t could only be created as child of a other Widget_t To...
Definition: xwidget.c:268
Func_t::expose_callback
xevfunc expose_callback
Definition: xwidget.h:80
CENTER
@ CENTER
Definition: xwidget.h:165
Widget_t::crb
cairo_t * crb
Definition: xwidget.h:318
Widget_t::flags
long long flags
Definition: xwidget.h:324
Widget_t::adj
Adjustment_t * adj
Definition: xwidget.h:334
XTuner::temperament
float temperament
Definition: xtuner.h:35
Widget_t::scale
Resize_t scale
Definition: xwidget.h:356
HAS_MEM
@ HAS_MEM
Definition: xwidget.h:251
Widget_t::app
Xputty * app
Definition: xwidget.h:300
USE_TRANSPARENCY
@ USE_TRANSPARENCY
Definition: xwidget.h:243
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
XTuner::temp_adjust
int temp_adjust
Definition: xtuner.h:36
Func_t::mem_free_callback
xevfunc mem_free_callback
Definition: xwidget.h:87
_draw_tuner
void _draw_tuner(void *w_, void *user_data)
_draw_tuner - draw the tuner on expose call
Definition: xtuner_private.c:69
Widget_t::adj_y
Adjustment_t * adj_y
Definition: xwidget.h:332
Widget_t::func
Func_t func
Definition: xwidget.h:310
XTuner::ref_freq
float ref_freq
Definition: xtuner.h:34
add_adjustment
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
Widget_t::label
const char * label
Definition: xwidget.h:326
CL_CONTINUOS
@ CL_CONTINUOS
Definition: xadjustment.h:49