Commit 483f4ea1 authored by Mathieu L Bouchard's avatar Mathieu L Bouchard
Browse files

big refactoring #8 : fusion of [hsl] and [vsl] together, and fusion of...

big refactoring #8 : fusion of [hsl] and [vsl] together, and fusion of [hradio] and [vradio] together
parent ad921fce
......@@ -957,6 +957,16 @@ void scalehandle_drag_scale(t_scalehandle *h) {
}
}
void iemgui__clickhook3(t_scalehandle *sh, int newstate) {
if (!sh->h_dragon && newstate && sh->h_scale)
scalehandle_click_scale(sh);
else if (sh->h_dragon && newstate == 0 && !sh->h_scale)
scalehandle_unclick_label(sh);
else if (!sh->h_dragon && newstate && !sh->h_scale)
scalehandle_click_label(sh);
sh->h_dragon = newstate;
}
//----------------------------------------------------------------
// IEMGUI refactor (by Mathieu)
......
......@@ -120,8 +120,6 @@ typedef struct _scalehandle
int h_vis;
} t_scalehandle;
static t_class *scalehandle_class;
typedef struct _iemgui
{
t_object x_obj;
......@@ -176,7 +174,7 @@ typedef struct _bng
t_clock *x_clock_lck;
} t_bng;
typedef struct _hslider
typedef struct _slider
{
t_iemgui x_gui;
int x_pos;
......@@ -190,18 +188,20 @@ typedef struct _hslider
double x_k;
double x_last;
int x_is_last_float;
} t_hslider;
int x_orient; // 0=horiz, 1=vert
} t_slider;
typedef struct _hdial
typedef struct _radio
{
t_iemgui x_gui;
int x_on;
int x_on_old; /* LATER delete this; it's used for old version */
int x_on_old; /* for use by [hdl] [vdl] */
int x_change;
int x_number;
int x_drawn;
t_atom x_at[2];
} t_hdial;
int x_orient; // 0=horiz, 1=vert
} t_radio;
typedef struct _toggle
{
......@@ -218,22 +218,6 @@ typedef struct _my_canvas
int x_vis_h;
} t_my_canvas;
typedef struct _vslider
{
t_iemgui x_gui;
int x_pos;
int x_val;
int x_center;
int x_thick;
int x_lin0_log1;
int x_steady;
double x_min;
double x_max;
double x_k;
double x_last;
int x_is_last_float;
} t_vslider;
typedef struct _vu
{
t_iemgui x_gui;
......@@ -268,20 +252,6 @@ typedef struct _my_numbox
int x_hide_frame; /* 0 default, 1 just arrow, 2, just frame, 3 both */
} t_my_numbox;
typedef struct _vdial
{
t_iemgui x_gui;
int x_on;
int x_on_old;
int x_change;
int x_number;
int x_drawn;
t_atom x_at[2];
} t_vdial;
#define t_vradio t_vdial
#define t_hradio t_hdial
extern int sys_noloadbang;
extern int iemgui_color_hex[];
......@@ -335,6 +305,7 @@ EXTERN void scalehandle_click_label(t_scalehandle *h);
EXTERN void scalehandle_click_scale(t_scalehandle *h);
EXTERN void scalehandle_unclick_scale(t_scalehandle *h);
EXTERN void scalehandle_drag_scale(t_scalehandle *h);
EXTERN void iemgui__clickhook3(t_scalehandle *sh, int newstate);
EXTERN int mini(int a, int b);
EXTERN int maxi(int a, int b);
......@@ -367,4 +338,5 @@ EXTERN void iemgui_class_addmethods(t_class *c);
EXTERN void scrollbar_update(t_glist *glist);
EXTERN void radio_draw_update(t_gobj *client, t_glist *glist);
......@@ -5,36 +5,22 @@
/* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */
/* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "m_pd.h"
#include "g_canvas.h"
#include "t_tk.h"
#include "g_all_guis.h"
#include <math.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
static t_class *scalehandle_class;
extern int gfxstub_haveproperties(void *key);
void bng_draw_select(t_bng* x, t_glist* glist);
/* --------------- bng gui-bang ------------------------- */
t_widgetbehavior bng_widgetbehavior;
static t_class *bng_class;
/* widget helper functions */
void bng_draw_update(t_gobj *xgobj, t_glist *glist)
{
t_bng *x = (t_bng *)xgobj;
......@@ -152,19 +138,7 @@ static void bng__clickhook(t_scalehandle *sh, t_floatarg f,
scalehandle_unclick_scale(sh);
}
}
else if (!sh->h_dragon && newstate && sh->h_scale)
{
scalehandle_click_scale(sh);
}
else if (sh->h_dragon && newstate == 0 && !sh->h_scale)
{
scalehandle_unclick_label(sh);
}
else if (!sh->h_dragon && newstate && !sh->h_scale)
{
scalehandle_click_label(sh);
}
sh->h_dragon = newstate;
else iemgui__clickhook3(sh,newstate);
}
static void bng__motionhook(t_scalehandle *sh,
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,26 +5,15 @@
/* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */
/* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "m_pd.h"
#include "g_canvas.h"
#include "t_tk.h"
#include "g_all_guis.h"
#include <math.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
static t_class *scalehandle_class;
extern int gfxstub_haveproperties(void *key);
void my_canvas_draw_select(t_my_canvas* x, t_glist* glist);
......
......@@ -4,26 +4,15 @@
/* my_numbox.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "m_pd.h"
#include "g_canvas.h"
#include "t_tk.h"
#include "g_all_guis.h"
#include <math.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
static t_class *scalehandle_class;
extern int gfxstub_haveproperties(void *key);
static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist);
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,26 +5,15 @@
/* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */
/* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "m_pd.h"
#include "g_canvas.h"
#include "t_tk.h"
#include "g_all_guis.h"
#include <math.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
static t_class *scalehandle_class;
extern int gfxstub_haveproperties(void *key);
void toggle_draw_select(t_toggle* x, t_glist* glist);
......@@ -152,19 +141,7 @@ static void toggle__clickhook(t_scalehandle *sh, t_floatarg f,
scalehandle_unclick_scale(sh);
}
}
else if (!sh->h_dragon && newstate && sh->h_scale)
{
scalehandle_click_scale(sh);
}
else if (sh->h_dragon && !newstate && !sh->h_scale)
{
scalehandle_unclick_label(sh);
}
else if(!sh->h_dragon && newstate && !sh->h_scale)
{
scalehandle_click_label(sh);
}
sh->h_dragon = newstate;
else iemgui__clickhook3(sh,newstate);
}
static void toggle__motionhook(t_scalehandle *sh, t_floatarg f1, t_floatarg f2)
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,15 +5,11 @@
/* g_7_guis.c written by Thomas Musil (c) IEM KUG Graz Austria 2000-2001 */
/* thanks to Miller Puckette, Guenther Geiger and Krzystof Czaja */
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "m_pd.h"
#include "g_canvas.h"
#include "t_tk.h"
#include "g_all_guis.h"
#include <math.h>
......@@ -74,6 +70,7 @@ int iemgui_vu_col[]=
15,15,15,15,15,15,15,15,15,15,14,14,13,13,13,13,13,13,13,13,13,13,13,19,19,19
};
static t_class *scalehandle_class;
extern int gfxstub_haveproperties(void *key);
static void vu_draw_select(t_vu* x, t_glist* glist);
void vu_check_height(t_vu *x, int h);
......@@ -267,7 +264,6 @@ static void vu_draw_config(t_vu* x, t_glist* glist)
static void vu_draw_select(t_vu* x,t_glist* glist)
{
int i;
t_canvas *canvas=glist_getcanvas(glist);
iemgui_base_draw_config(&x->x_gui,canvas);
char lcol[8]; sprintf(lcol,"#%6.6x", x->x_gui.x_lcol);
......@@ -309,18 +305,7 @@ static void vu__clickhook(t_scalehandle *sh, t_floatarg f, t_floatarg xxx,
scalehandle_unclick_scale(sh);
}
}
else if (!sh->h_dragon && newstate && sh->h_scale)
{
scalehandle_click_scale(sh);
}
else if (sh->h_dragon && newstate == 0 && !sh->h_scale)
{
scalehandle_unclick_label(sh);
}
else if (!sh->h_dragon && newstate && !sh->h_scale)
{
scalehandle_click_label(sh);
}
else iemgui__clickhook3(sh,newstate);
sh->h_dragon = newstate;
}
......
......@@ -64,8 +64,8 @@ TYPE_PUNNING_SRC = d_ctl.c d_array.c d_delay.c d_filter.c d_math.c d_osc.c d_sou
# these are safe for full gcc 4.x optimization
OPT_SAFE_SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
g_scalar.c g_traversal.c g_guiconnect.c g_readwrite.c g_editor.c \
g_undo.c g_all_guis.c g_bang.c g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c \
g_toggle.c g_vdial.c g_vslider.c g_vumeter.c g_magicglass.c \
g_undo.c g_all_guis.c g_bang.c g_mycanvas.c g_numbox.c \
g_toggle.c g_vumeter.c g_magicglass.c g_radio.c g_slider.c \
m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbuf.c \
m_conf.c m_glob.c m_sched.c \
s_main.c s_inter.c s_file.c s_print.c \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment