aboutsummaryrefslogtreecommitdiff
path: root/xgui
diff options
context:
space:
mode:
authorDamien HENRY <dh7@users.sourceforge.net>2002-11-20 06:22:16 +0000
committerDamien HENRY <dh7@users.sourceforge.net>2002-11-20 06:22:16 +0000
commit98b615e077661e36dc213c94d0da5b7405c8ab7d (patch)
treeb554d14f401a143b49d504b3e930fa027d40ecba /xgui
parent6dfb7d4424b3517b326f9e01a8fa94a802662305 (diff)
to try...
svn path=/trunk/; revision=222
Diffstat (limited to 'xgui')
-rw-r--r--xgui/README.txt2
-rw-r--r--xgui/netserver/help-netserver.pd48
-rw-r--r--xgui/xgui-lib/seg.c186
3 files changed, 97 insertions, 139 deletions
diff --git a/xgui/README.txt b/xgui/README.txt
index 8dc77575..95398b53 100644
--- a/xgui/README.txt
+++ b/xgui/README.txt
@@ -1,4 +1,4 @@
-This is the README file for Xgui_0.10, an experimental GUI (Graphical User Interface) server for pure data.
+This is the README file for Xgui_0.10b, an experimental GUI (Graphical User Interface) server for pure data.
The goal of Xgui is not to replace the existing GUI, but to add some graphicals functionality to pd.
diff --git a/xgui/netserver/help-netserver.pd b/xgui/netserver/help-netserver.pd
deleted file mode 100644
index 10688163..00000000
--- a/xgui/netserver/help-netserver.pd
+++ /dev/null
@@ -1,48 +0,0 @@
-#N canvas 106 97 754 476 12;
-#X floatatom 49 333 5 0 0;
-#X floatatom 87 298 5 0 0;
-#X symbolatom 164 251 10 0 0;
-#X text 102 332 received data;
-#X text 140 298 number of connections;
-#X msg 49 54 print;
-#X floatatom 125 272 5 0 0;
-#X text 183 276 socket number;
-#X msg 103 179 broadcast hallo world!;
-#X text 288 179 send to all clients;
-#X text 144 33 written by Olaf Matthes <olaf.matthes@gmx.de>;
-#X obj 49 223 netserver 3000;
-#X text 137 120 send message to client no. 1;
-#X text 256 251 client's IP address;
-#X msg 498 116 connect localhost 3000;
-#X msg 511 143 disconnect;
-#X msg 477 84 send 23;
-#X floatatom 544 218 5 0 0;
-#X msg 83 91 send 380 17.3;
-#X floatatom 477 296 5 0 0;
-#X obj 600 281 print anything;
-#X obj 538 309 print list;
-#X obj 477 245 route float list;
-#X msg 98 142 client 1 23;
-#X text 204 91 "send <socketnumber> <data>";
-#X text 110 70 send message on specified socket;
-#X text 200 143 "client <clientnumber> <data>";
-#X text 48 379 This example demonstrates how to set up a client/server
-connection. Data sent by the client get's received and displayed by
-the server imediately. Or just try it the other way round...;
-#X text 38 15 netclient :: simple client that connects to netserver
-;
-#X obj 480 189 netsend;
-#X connect 5 0 11 0;
-#X connect 8 0 11 0;
-#X connect 11 0 0 0;
-#X connect 11 1 1 0;
-#X connect 11 2 6 0;
-#X connect 11 3 2 0;
-#X connect 14 0 29 0;
-#X connect 16 0 29 0;
-#X connect 18 0 11 0;
-#X connect 22 0 19 0;
-#X connect 22 1 21 0;
-#X connect 22 2 20 0;
-#X connect 23 0 11 0;
-#X connect 29 0 22 0;
diff --git a/xgui/xgui-lib/seg.c b/xgui/xgui-lib/seg.c
index a7a0566e..2f1a9bed 100644
--- a/xgui/xgui-lib/seg.c
+++ b/xgui/xgui-lib/seg.c
@@ -1,90 +1,96 @@
-/* Copyright (c) 2002 Damien HENRY.
-* For information on usage and redistribution, and for a DISCLAIMER OF ALL
-* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
-
-/* code for seg pd class NOT WORKING YET*/
-
-#include "m_pd.h"
-#include "g_canvas.h"
-#include "t_tk.h"
-
-typedef struct s_pd_obj_seg
-{
- t_object t_ob;
- t_symbol *seg_name;
- t_float *posx;
- t_float *posy;
- t_float *x1;
- t_float *y1;
- t_float *x2;
- t_float *y2;
- t_float *width;
- t_symbol *color;
-} t_seg;
-
-typedef struct s_seg
-{
- t_object t_ob;
- t_symbol* seg_name;
- t_float posx;
- t_float posy;
- t_float x1;
- t_float y1;
- t_float x2;
- t_float y2;
- t_float width;
- t_symbol color;
-} t_seg;
-
-void seg_help(t_seg *x)
-{
- post(" ");
- post("seg v001");
- post("+ symbol list :");
- post("++ help : this help !!!");
- post(" ");
-}
-
-void seg_width(t_seg *x, t_floatarg f)
-{
- post("seg: width %f",f);
- t_atom my_atom ;
- t_atom *my_pointer = &my_atom;
- SETFLOAT(my_pointer, *f);
- outlet_anything(x->x_obj.ob_outlet, gensym("!width"), 1,my_pointer);
-}
-
-
-void seg_pos(t_seg *x, t_floatarg f1, t_floatarg f2)
-{
- outlet_float(x->x_outlet1, (t_float)f1+(t_float)f2);
-}
-
-void seg_free(void)
-{
- post("seg_free");
-}
-
-t_class *seg_class;
-
-void *seg_new(void)
-{
- t_seg *x = (t_seg *)pd_new(seg_class);
- post("seg created");
- x->posx = 0; x->posy = 0;
- x->x1 = 10; x->y1 = 10;
- x->x1 = 20; x->y1 = 20;
- x->x_outlet1 = outlet_new(&x->t_ob, &s_float);
- return (void *)x;
-}
-
-void seg_setup(void)
-{
- post("seg_setup");
- seg_class = class_new(gensym("seg"), (t_newmethod)seg_new,(t_method)seg_free, sizeof(t_seg), 0, A_GIMME, 0);
- class_addmethod(seg_class, (t_method)seg_width, gensym("width"),A_FLOAT, 0);
- class_addmethod(seg_class, (t_method)seg_pos, gensym("pos"),A_FLOAT,A_FLOAT, 0);
- class_addmethod(seg_class, (t_method)seg_help, gensym("help"), 0);
- class_sethelpsymbol(seg_class, gensym("xgui/help_seg"));
-}
-
+/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* code for seg pd class NOT WORKING YET*/
+
+#include "m_pd.h"
+#include "g_canvas.h"
+#include "t_tk.h"
+
+typedef struct s_pd_obj_seg
+{
+ t_object t_ob;
+ t_symbol *seg_name;
+ t_float *posx;
+ t_float *posy;
+ t_float *x1;
+ t_float *y1;
+ t_float *x2;
+ t_float *y2;
+ t_float *width;
+ t_symbol *color;
+} t_seg;
+
+typedef struct s_seg
+{
+ t_object t_ob;
+ t_symbol* seg_name;
+ t_float posx;
+ t_float posy;
+ t_float x1;
+ t_float y1;
+ t_float x2;
+ t_float y2;
+ t_float width;
+ t_symbol color;
+} t_seg;
+
+void seg_help(t_seg *x)
+{
+ post(" ");
+ post("seg v001");
+ post("+ symbol list :");
+ post("++ help : this help !!!");
+ post(" ");
+}
+
+void seg_width(t_seg *x, t_floatarg f)
+{
+ post("seg: width %f",f);
+ t_atom my_atom ;
+ t_atom *my_pointer = &my_atom;
+ SETFLOAT(my_pointer, *f);
+ outlet_anything(x->x_obj.ob_outlet, gensym("!width"), 1,my_pointer);
+}
+
+
+void seg_pos(t_seg *x, t_floatarg f1, t_floatarg f2)
+{
+ outlet_float(x->x_outlet1, (t_float)f1+(t_float)f2);
+}
+
+void seg_free(void)
+{
+ post("seg_free");
+}
+
+t_class *seg_class;
+
+void *seg_new(void)
+{
+ t_seg *x = (t_seg *)pd_new(seg_class);
+ post("seg created");
+
+ sys_vgui(".x%x.c create oval 10 10 20 20\n",glist_getcanvas(glist),
+ x->x_obj.te_xpos+1,x->x_obj.te_ypos+1,
+ x->x_obj.te_xpos + x->x_width -1,
+ x->x_obj.te_ypos + x->x_height -1,x->x_color->s_name,x);
+ x->posx = 0; x->posy = 0;
+ x->x1 = 10; x->y1 = 10;
+ x->x1 = 20; x->y1 = 20;
+ x->x_outlet1 = outlet_new(&x->t_ob, &s_float);
+
+ return (void *)x;
+}
+
+void seg_setup(void)
+{
+ post("seg_setup");
+ seg_class = class_new(gensym("seg"), (t_newmethod)seg_new,(t_method)seg_free, sizeof(t_seg), 0, A_GIMME, 0);
+ class_addmethod(seg_class, (t_method)seg_width, gensym("width"),A_FLOAT, 0);
+ class_addmethod(seg_class, (t_method)seg_pos, gensym("pos"),A_FLOAT,A_FLOAT, 0);
+ class_addmethod(seg_class, (t_method)seg_help, gensym("help"), 0);
+ class_sethelpsymbol(seg_class, gensym("xgui/help_seg"));
+}
+