Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2982
Modified Files:
Tag: desiredata
builtins.c desire.tk
Log Message:
[display] now takes 1 arg for display height
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.406
retrieving revision 1.1.2.600.2.407
diff -C2 -d -r1.1.2.600.2.406 -r1.1.2.600.2.407
*** desire.tk 4 Sep 2007 11:23:58 -0000 1.1.2.600.2.406
--- desire.tk 4 Sep 2007 12:09:42 -0000 1.1.2.600.2.407
***************
*** 5630,5633 ****
--- 5630,5635 ----
class_new Display {Box}
+ def Display height= {val} {set @height $val}
+
def Display init {{mess {}}} {
set font [$self look font]
***************
*** 5636,5643 ****
set @wrap [expr $fw*$@max_width]; #in pixels
set @content {display}
! set @height 5
set @xs [expr [font measure [$self look font] 0]+3]
set @ys [font metrics [$self look font] -linespace]
set @textoffset [list 2 2]
super $mess
}
--- 5638,5646 ----
set @wrap [expr $fw*$@max_width]; #in pixels
set @content {display}
! set @height 1
set @xs [expr [font measure [$self look font] 0]+3]
set @ys [font metrics [$self look font] -linespace]
set @textoffset [list 2 2]
+ netsend [list .$self height]
super $mess
}
Index: builtins.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v
retrieving revision 1.1.2.63
retrieving revision 1.1.2.64
diff -C2 -d -r1.1.2.63 -r1.1.2.64
*** builtins.c 19 Aug 2007 07:28:19 -0000 1.1.2.63
--- builtins.c 4 Sep 2007 12:09:42 -0000 1.1.2.64
***************
*** 1044,1054 ****
static t_class *display_class;
struct t_display : t_object {
};
! static void *display_new(t_symbol *s) {
t_display *x = (t_display *)pd_new(display_class);
return x;
}
static void display_send(t_display *x, t_symbol *s, int argc, t_atom *argv) {
std::ostringstream t;
--- 1044,1059 ----
static t_class *display_class;
struct t_display : t_object {
+ t_float height;
};
! static void *display_new(t_floatarg f) {
t_display *x = (t_display *)pd_new(display_class);
+ x->height = f;
+ if (!x->height) x->height = 1;
return x;
}
+ static void display_height (t_display *x) {sys_mgui(x, "height=", "i", (int)x->height);}
+
static void display_send(t_display *x, t_symbol *s, int argc, t_atom *argv) {
std::ostringstream t;
***************
*** 1057,1066 ****
sys_mgui(x, "dis", "S", t.str().data());
}
static void display_setup() {
! t_class *c = display_class = class_new2("display",display_new,0,sizeof(t_display),0,"S");
class_addanything(c, display_send);
}
-
/* MSW and OSX don't appear to have single-precision ANSI math */
#if defined(MSW) || defined(__APPLE__)
--- 1062,1072 ----
sys_mgui(x, "dis", "S", t.str().data());
}
+
static void display_setup() {
! t_class *c = display_class = class_new2("display",display_new,0,sizeof(t_display),0,"F");
class_addanything(c, display_send);
+ class_addmethod2(c, display_height, "height","");
}
/* MSW and OSX don't appear to have single-precision ANSI math */
#if defined(MSW) || defined(__APPLE__)
***************
*** 2948,2951 ****
--- 2954,2958 ----
macro_setup();
display_setup();
+ any2_setup();
clipboard_setup();
delay_setup();