Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30848
Modified Files: Tag: impd_0_37 g_all_guis.c g_all_guis.h g_bang.c g_hdial.c Log Message: cleanup
Index: g_all_guis.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.h,v retrieving revision 1.1.1.4.2.2.2.16 retrieving revision 1.1.1.4.2.2.2.17 diff -C2 -d -r1.1.1.4.2.2.2.16 -r1.1.1.4.2.2.2.17 *** g_all_guis.h 1 May 2004 02:25:12 -0000 1.1.1.4.2.2.2.16 --- g_all_guis.h 1 May 2004 15:29:58 -0000 1.1.1.4.2.2.2.17 *************** *** 8,12 **** #define IEM_GUI_COLOR_NORMAL 0 #define IEM_GUI_MAX_COLOR 30 - #define IEM_GUI_DEFAULTSIZE 15 #define IEM_GUI_MINSIZE 8 --- 8,11 ---- *************** *** 14,28 **** #define IEM_SL_DEFAULTSIZE 128 #define IEM_SL_MINSIZE 2 - #define IEM_FONT_MINSIZE 4 - - #define IEM_BNG_DEFAULTHOLDFLASHTIME 250 - #define IEM_BNG_DEFAULTBREAKFLASHTIME 50 - #define IEM_BNG_MINHOLDFLASHTIME 50 - #define IEM_BNG_MINBREAKFLASHTIME 10 - - #define IEM_RADIO_MAX 128 - #define IEM_FONT_STYLE_ALL 255 - #define IEM_MAX_SYM_LEN 127 - #define IEM_GUI_DRAW_MODE_SELECT 3 #define IEM_GUI_DRAW_MODE_ERASE 4 --- 13,16 ---- *************** *** 41,48 **** #define IEMGUI_MAX_NUM_LEN 32
- typedef struct _iem_fstyle_flags - { - } t_iem_fstyle_flags; - typedef struct _iem_init_symargs { --- 29,32 ---- *************** *** 207,208 **** --- 191,193 ---- #define MAX(a,b) ((a)>(b)?(a):(b)) EXTERN t_iemgui *iemgui_new(t_class *qlass); + EXTERN void iemgui_draw(t_iemgui *x, t_glist *glist, int mode, const char *s);
Index: g_hdial.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v retrieving revision 1.1.1.4.2.2.2.12 retrieving revision 1.1.1.4.2.2.2.13 diff -C2 -d -r1.1.1.4.2.2.2.12 -r1.1.1.4.2.2.2.13 *** g_hdial.c 27 Apr 2004 18:09:34 -0000 1.1.1.4.2.2.2.12 --- g_hdial.c 1 May 2004 15:29:58 -0000 1.1.1.4.2.2.2.13 *************** *** 21,24 **** --- 21,26 ---- #define CLAMP(_var,_min,_max) { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; }
+ #define IEM_RADIO_MAX 128 + static t_class *hradio_class, *hradio_old_class; static t_class *vradio_class, *vradio_old_class;
Index: g_bang.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v retrieving revision 1.1.1.3.2.2.2.15 retrieving revision 1.1.1.3.2.2.2.16 diff -C2 -d -r1.1.1.3.2.2.2.15 -r1.1.1.3.2.2.2.16 *** g_bang.c 27 Apr 2004 18:09:34 -0000 1.1.1.3.2.2.2.15 --- g_bang.c 1 May 2004 15:29:58 -0000 1.1.1.3.2.2.2.16 *************** *** 24,38 **** #endif
static t_class *bng_class;
void bng_draw(t_bng *x, t_glist *glist, int mode) { ! /*if (!glist_isvisible(glist_getcanvas(glist))) return; <-- doesn't work */ ! if (mode==IEM_GUI_DRAW_MODE_ERASE) ! sys_mgui((t_iemgui *)x,"bang","erase",""); ! else if (mode==IEM_GUI_DRAW_MODE_SELECT) ! sys_mgui((t_iemgui *)x,"bang","select","i",x->x_gui.x_selected); ! else { ! pd_upload((t_gobj *)x,glist); ! sys_mgui((t_iemgui *)x,"bang","draw","");} }
--- 24,36 ---- #endif
+ #define IEM_BNG_DEFAULTHOLDFLASHTIME 250 + #define IEM_BNG_DEFAULTBREAKFLASHTIME 50 + #define IEM_BNG_MINHOLDFLASHTIME 50 + #define IEM_BNG_MINBREAKFLASHTIME 10 + static t_class *bng_class;
void bng_draw(t_bng *x, t_glist *glist, int mode) { ! iemgui_draw((t_iemgui *)x,glist,mode,"bang"); }
Index: g_all_guis.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v retrieving revision 1.1.1.4.2.4.2.19 retrieving revision 1.1.1.4.2.4.2.20 diff -C2 -d -r1.1.1.4.2.4.2.19 -r1.1.1.4.2.4.2.20 *** g_all_guis.c 27 Apr 2004 18:09:34 -0000 1.1.1.4.2.4.2.19 --- g_all_guis.c 1 May 2004 15:29:57 -0000 1.1.1.4.2.4.2.20 *************** *** 26,29 **** --- 26,31 ---- #endif
+ #define IEM_FONT_MINSIZE 4 + /* #define GGEE_HSLIDER_COMPATIBLE */
*************** *** 66,76 **** }
- int iemgui_modulo_color(int col) - { - if (col<0) col+=(1+col/IEM_GUI_MAX_COLOR)*IEM_GUI_MAX_COLOR; - col %= IEM_GUI_MAX_COLOR; - return col; - } - t_symbol *iemgui_raute2dollar(t_symbol *s) { --- 68,71 ---- *************** *** 139,146 **** }
! /* convert symbols in "$" form to the expanded symbols */ ! void iemgui_all_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) { ! /* save unexpanded ones for later */ iemgui->x_snd_unexpanded = srlsym[0]; iemgui->x_rcv_unexpanded = srlsym[1]; --- 134,141 ---- }
! /* convert symbols in "$" form to the expanded symbols */ ! static void iemgui_all_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) { ! /* save unexpanded ones for later */ iemgui->x_snd_unexpanded = srlsym[0]; iemgui->x_rcv_unexpanded = srlsym[1]; *************** *** 172,178 **** }
! /* get the unexpanded versions of the symbols; initialize them if ! necessary. */ ! void iemgui_all_sym2dollararg(t_iemgui *iemgui, t_symbol **srlsym) { iemgui_init_sym2dollararg(iemgui, &iemgui->x_snd_unexpanded, iemgui->x_binbufindex+1, iemgui->x_snd); --- 167,172 ---- }
! /* get the unexpanded versions of the symbols; initialize them if necessary. */ ! static void iemgui_all_sym2dollararg(t_iemgui *iemgui, t_symbol **srlsym) { iemgui_init_sym2dollararg(iemgui, &iemgui->x_snd_unexpanded, iemgui->x_binbufindex+1, iemgui->x_snd); *************** *** 196,200 ****
static int convert_color(int x) { ! if (x>=0) return iemgui_color_hex[iemgui_modulo_color(x)]; x=~x; return ((x&0x3f000)<<6) | ((x&0xfc0)<<4) | ((x&0x3f)<<2); --- 190,194 ----
static int convert_color(int x) { ! if (x>=0) return iemgui_color_hex[x%IEM_GUI_MAX_COLOR]; x=~x; return ((x&0x3f000)<<6) | ((x&0xfc0)<<4) | ((x&0x3f)<<2); *************** *** 208,217 **** }
! int iemgui_compatible_col(int i) ! { ! return i>=0 ? iemgui_color_hex[iemgui_modulo_color(i)] : (~i)&0xffffff; ! } ! ! void iemgui_all_dollar2raute(t_symbol **srlsym) { srlsym[0] = iemgui_dollar2raute(srlsym[0]); --- 202,206 ---- }
! static void iemgui_all_dollar2raute(t_symbol **srlsym) { srlsym[0] = iemgui_dollar2raute(srlsym[0]); *************** *** 220,224 **** }
! void iemgui_all_raute2dollar(t_symbol **srlsym) { srlsym[0] = iemgui_raute2dollar(srlsym[0]); --- 209,213 ---- }
! static void iemgui_all_raute2dollar(t_symbol **srlsym) { srlsym[0] = iemgui_raute2dollar(srlsym[0]); *************** *** 328,331 **** --- 317,323 ---- }
+ static int iemgui_compatible_col(int i) + {return i>=0 ? iemgui_color_hex[i%IEM_GUI_MAX_COLOR] : (~i)&0xffffff;} + void iemgui_color(t_iemgui *iemgui, t_symbol *s, int ac, t_atom *av) { *************** *** 600,601 **** --- 592,605 ---- return self; } + + EXTERN void iemgui_draw(t_iemgui *x, t_glist *glist, int mode, const char *s) { + /*if (!glist_isvisible(glist_getcanvas(glist))) return; <-- doesn't work */ + if (mode==IEM_GUI_DRAW_MODE_ERASE) + sys_mgui(x,s,"erase",""); + else if (mode==IEM_GUI_DRAW_MODE_SELECT) + sys_mgui(x,s,"select","i",x->x_selected); + else { + pd_upload((t_gobj *)x,glist); + sys_mgui(x,s,"draw","");} + } +