Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1366
Modified Files:
Tag: devel_0_39
desire.c m_glob.c
Log Message:
moved DesireData code from m_glob.c to desire.c
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.180
retrieving revision 1.1.2.181
diff -C2 -d -r1.1.2.180 -r1.1.2.181
*** desire.c 15 Sep 2006 15:21:44 -0000 1.1.2.180
--- desire.c 16 Sep 2006 04:20:28 -0000 1.1.2.181
***************
*** 666,673 ****
static void guiconnect_notarget(t_guiconnect *x, double timedelay);
! /* canvas_vis(,1) makes a canvas client-existing, client-updated, visible, mapped, raised.
! canvas_vis(,0) removes the canvas from the client. contrast with canvas_map.
for GOPs this is *not* the same as in Miller's */
static void canvas_vis(t_canvas *x, t_floatarg f) {
if (f && x->havewindow) sys_mgui(x,"raise","");
if (f && !x->havewindow) canvas_map(x,1);
--- 666,674 ----
static void guiconnect_notarget(t_guiconnect *x, double timedelay);
! /* canvas_vis(,1) makes a canvas client-existing, client-updated, visible, mapped, raised. gops get open.
! canvas_vis(,0) removes the canvas from the client if it's non-gop. contrast with canvas_map.
for GOPs this is *not* the same as in Miller's */
static void canvas_vis(t_canvas *x, t_floatarg f) {
+ /* this is WRONG */
if (f && x->havewindow) sys_mgui(x,"raise","");
if (f && !x->havewindow) canvas_map(x,1);
***************
*** 7843,7846 ****
--- 7844,7874 ----
}
+ EXTERN void glob_update_class_info (t_pd *bogus, t_symbol *s, t_symbol *cb_recv, t_symbol *cb_sel);
+ EXTERN void glob_update_path (void);
+ EXTERN void glob_redraw (void);
+ char *class_gethelpdir(t_class *c);
+
+ void glob_help(t_pd *bogus, t_symbol *s) {
+ char namebuf[MAXPDSTRING], *dir;
+ t_class *c = class_find(s);
+ if (!c) {post("help: no such class '%s'",s->s_name); return;}
+ strcpy(namebuf, class_gethelpname(c));
+ dir = class_gethelpdir(c);
+ if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
+ open_via_helppath(namebuf, dir);
+ }
+
+ EXTERN t_hash *class_table;
+ void glob_update_class_list (t_pd *self, t_symbol *cb_recv, t_symbol *cb_sel) {
+ int n = pd_objectmaker->c_nmethod;
+ hashkey k; hashvalue v;
+ sys_gui("global class_list; set class_list {");
+ hash_foreach(k,v,class_table) sys_vgui("%s ", ((t_symbol *)k)->s_name);
+ sys_gui("}\n");
+ sys_vgui("%s %s\n",cb_recv->s_name, cb_sel->s_name);
+ }
+
+ EXTERN t_class *glob_pdobject;
+
void desire_setup(void) {
s_empty = gensym("empty");
***************
*** 7864,7867 ****
--- 7892,7908 ----
}
+ void desire_glob_init(void) {
+ class_addmethod(glob_pdobject, (t_method)glob_update_class_list,
+ gensym("update-class-list"), A_SYMBOL, A_SYMBOL, 0);
+ class_addmethod(glob_pdobject, (t_method)glob_update_class_info,
+ gensym("update-class-info"), A_SYMBOL, A_SYMBOL, A_SYMBOL, 0);
+ class_addmethod(glob_pdobject, (t_method)glob_update_path,
+ gensym("update-path"), 0);
+ class_addmethod(glob_pdobject, (t_method)glob_help,
+ gensym("help"), A_SYMBOL, 0);
+ class_addmethod(glob_pdobject, (t_method)glob_redraw,
+ gensym("redraw"), 0);
+ }
+
/* ---------------------------------------------------------------- */
/* formerly s_print.c */
Index: m_glob.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_glob.c,v
retrieving revision 1.4.4.2.2.18
retrieving revision 1.4.4.2.2.19
diff -C2 -d -r1.4.4.2.2.18 -r1.4.4.2.2.19
*** m_glob.c 20 Aug 2006 21:11:45 -0000 1.4.4.2.2.18
--- m_glob.c 16 Sep 2006 04:20:29 -0000 1.4.4.2.2.19
***************
*** 119,150 ****
#ifdef DESIRE
! char *class_gethelpdir(t_class *c);
! #include <string.h>
! /* see also canvas_done_popup */
! void glob_help(t_pd *bogus, t_symbol *s) {
! char namebuf[MAXPDSTRING], *dir;
! t_class *c = class_find(s);
! if (!c) { post("HUH? no help because no class. (!)"); return; }
! strcpy(namebuf, class_gethelpname(c));
! dir = class_gethelpdir(c);
! if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
! open_via_helppath(namebuf, dir);
! }
!
! EXTERN t_hash *class_table;
! void glob_update_class_list (t_pd *self, t_symbol *cb_recv, t_symbol *cb_sel) {
! int n = pd_objectmaker->c_nmethod;
! hashkey k; hashvalue v;
! sys_gui("global class_list; set class_list {");
! hash_foreach(k,v,class_table) sys_vgui("%s ", ((t_symbol *)k)->s_name);
! sys_gui("}\n");
! sys_vgui("%s %s\n",cb_recv->s_name, cb_sel->s_name);
! }
#endif
- EXTERN void glob_update_class_info (t_pd *bogus, t_symbol *s, t_symbol *cb_recv, t_symbol *cb_sel);
- EXTERN void glob_update_path (void);
- EXTERN void glob_redraw (void);
-
void glob_init(void)
{
--- 119,125 ----
#ifdef DESIRE
! void desire_glob_init(void);
#endif
void glob_init(void)
{
***************
*** 236,253 ****
class_addmethod(glob_pdobject, (t_method)glob_midi_getcurrentoutdevs, gensym("getmidicurrentoutdev"), 0);
class_addmethod(glob_pdobject, (t_method)glob_midi_getcurrentindevs, gensym("getmidicurrentindev"), 0);
-
/* tb } */
! #ifdef DESIRE
! class_addmethod(glob_pdobject, (t_method)glob_update_class_list,
! gensym("update-class-list"), A_SYMBOL, A_SYMBOL, 0);
! class_addmethod(glob_pdobject, (t_method)glob_update_class_info,
! gensym("update-class-info"), A_SYMBOL, A_SYMBOL, A_SYMBOL, 0);
! class_addmethod(glob_pdobject, (t_method)glob_update_path,
! gensym("update-path"), 0);
! class_addmethod(glob_pdobject, (t_method)glob_help,
! gensym("help"), A_SYMBOL, 0);
! class_addmethod(glob_pdobject, (t_method)glob_redraw,
! gensym("redraw"), 0);
! #endif
#ifdef UNIX
class_addmethod(glob_pdobject, (t_method)glob_watchdog,
--- 211,216 ----
class_addmethod(glob_pdobject, (t_method)glob_midi_getcurrentoutdevs, gensym("getmidicurrentoutdev"), 0);
class_addmethod(glob_pdobject, (t_method)glob_midi_getcurrentindevs, gensym("getmidicurrentindev"), 0);
/* tb } */
!
#ifdef UNIX
class_addmethod(glob_pdobject, (t_method)glob_watchdog,
***************
*** 256,258 ****
--- 219,225 ----
class_addanything(glob_pdobject, max_default);
pd_bind(&glob_pdobject, gensym("pd"));
+
+ #ifdef DESIRE
+ desire_glob_init();
+ #endif
}