Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20272
Modified Files: Tag: desiredata s_main.c Log Message: fixed new commandline parsing system; removed server-side font stuff.
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.17.2.22.2.2 retrieving revision 1.7.4.17.2.22.2.3 diff -C2 -d -r1.7.4.17.2.22.2.2 -r1.7.4.17.2.22.2.3 *** s_main.c 30 Nov 2006 17:54:21 -0000 1.7.4.17.2.22.2.2 --- s_main.c 30 Nov 2006 18:11:40 -0000 1.7.4.17.2.22.2.3 *************** *** 68,72 **** static t_namelist *sys_messagelist; static int sys_version; - int sys_oldtclversion; /* hack to warn g_rtext.c about old text sel */
int sys_nmidiout = 1; --- 68,71 ---- *************** *** 79,84 **** int sys_midioutdevlist[MAXMIDIOUTDEV] = {1};
- char sys_font[100] = "courier"; /* tb: font name */ - static int sys_main_srate; static int sys_main_dacblocksize = DEFDACBLKSIZE; --- 78,81 ---- *************** *** 121,188 **** /* } jsarlo */
- - - typedef struct _fontinfo - { - int fi_fontsize; - int fi_maxwidth; - int fi_maxheight; - int fi_hostfontsize; - int fi_width; - int fi_height; - } t_fontinfo; - - /* these give the nominal point size and maximum height of the characters - in the six fonts. */ - - static t_fontinfo sys_fontlist[] = { - {8, 5, 9, 0, 0, 0}, {10, 7, 13, 0, 0, 0}, {12, 9, 16, 0, 0, 0}, - {16, 10, 20, 0, 0, 0}, {24, 15, 25, 0, 0, 0}, {36, 25, 45, 0, 0, 0}}; - #define NFONT (sizeof(sys_fontlist)/sizeof(*sys_fontlist)) - - /* here are the actual font size structs on msp's systems: - MSW: - font 8 5 9 8 5 11 - font 10 7 13 10 6 13 - font 12 9 16 14 8 16 - font 16 10 20 16 10 18 - font 24 15 25 16 10 18 - font 36 25 42 36 22 41 - - linux: - font 8 5 9 8 5 9 - font 10 7 13 12 7 13 - font 12 9 16 14 9 15 - font 16 10 20 16 10 19 - font 24 15 25 24 15 24 - font 36 25 42 36 22 41 - */ - - static t_fontinfo *sys_findfont(int fontsize) - { - unsigned int i; - t_fontinfo *fi; - for (i = 0, fi = sys_fontlist; i < (NFONT-1); i++, fi++) - if (fontsize < fi[1].fi_fontsize) return (fi); - return (sys_fontlist + (NFONT-1)); - } - - int sys_nearestfontsize(int fontsize) - { - return (sys_findfont(fontsize)->fi_fontsize); - } - - int sys_hostfontsize(int fontsize) - { - return (sys_findfont(fontsize)->fi_hostfontsize); - } - - int sys_defaultfont; - #ifdef MSW - #define DEFAULTFONT 12 - #else - #define DEFAULTFONT 10 - #endif - static void openit(const char *dirname, const char *filename) { --- 118,121 ---- *************** *** 199,214 **** }
- #define NHOSTFONT 7 - - /* this is called from the gui process. The first argument is the cwd, and - succeeding args give the widths and heights of known fonts. We wait until - these are known to open files and send messages specified on the command line. - We ask the GUI to specify the "cwd" in case we don't have a local OS to get it - from; for instance we could be some kind of RT embedded system. However, to - really make this make sense we would have to implement - open(), read(), etc, calls to be served somehow from the GUI too. */ - /* for DesireData this should be eventually nuked */ ! void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv) { char cwd[666]; --- 132,137 ---- }
/* for DesireData this should be eventually nuked */ ! void glob_initfromgui(void *dummy, t_symbol *s) { char cwd[666]; *************** *** 233,237 **** namelist_free(sys_messagelist); sys_messagelist = 0; - sys_oldtclversion = atom_getfloatarg(1 + 3 * NHOSTFONT, argc, argv); }
--- 156,159 ---- *************** *** 601,605 **** } if (ARG("-blocksize",2)) {sys_setblocksize(atoi(argv[1])); NEXT(2);} ! if (ARG("-dacblocksize",2) && sscanf(argv[1], "%d", &sys_main_dacblocksize) >= 1) NEXT(2); if (ARG("-sleepgrain",2)) {sys_sleepgrain = 1000 * atof(argv[1]); NEXT(2);}
--- 523,527 ---- } if (ARG("-blocksize",2)) {sys_setblocksize(atoi(argv[1])); NEXT(2);} ! if (ARG("-dacblocksize",2) && sscanf(argv[1], "%d", &sys_main_dacblocksize) >= 1) {NEXT(2);} if (ARG("-sleepgrain",2)) {sys_sleepgrain = 1000 * atof(argv[1]); NEXT(2);}
*************** *** 723,727 **** if (ARG("-helppath",1)) {sys_helppath = namelist_append_files(sys_helppath, argv[1]); NEXT(2);} if (ARG("-open",2)) {sys_openlist = namelist_append_files(sys_openlist, argv[1]); NEXT(2);} ! if (ARG("-lib",2)) {sys_externlist = namelist_append_files(sys_externlist, argv[1]); NEXT(2);} if (ARG("-font",2)) { fprintf(stderr,"Warning: -font ignored by DesireData; use .ddrc instead\n"); --- 645,651 ---- if (ARG("-helppath",1)) {sys_helppath = namelist_append_files(sys_helppath, argv[1]); NEXT(2);} if (ARG("-open",2)) {sys_openlist = namelist_append_files(sys_openlist, argv[1]); NEXT(2);} ! if (ARG("-lib",2)) { ! fprintf(stderr,"found -lib\n"); ! sys_externlist = namelist_append_files(sys_externlist, argv[1]); NEXT(2);} if (ARG("-font",2)) { fprintf(stderr,"Warning: -font ignored by DesireData; use .ddrc instead\n"); *************** *** 733,737 **** NEXT(2); } ! if (ARG("-no-prefs",1)) NEXT(1); /* tim: skip flag, we already parsed it */ /* jmz: read an alternative rcfile { */ if (ARG("-rcfile",2)) {sys_parsercfile(argv[1]); NEXT(2);} /* recursively */ --- 657,661 ---- NEXT(2); } ! if (ARG("-no-prefs",1)) {NEXT(1);} /* tim: skip flag, we already parsed it */ /* jmz: read an alternative rcfile { */ if (ARG("-rcfile",2)) {sys_parsercfile(argv[1]); NEXT(2);} /* recursively */ *************** *** 739,746 **** if (ARG("-verbose",1)) {sys_verbose++; NEXT(1);} if (ARG("-version",1)) {sys_version = 1; NEXT(1);} ! if (ARG("-d",2) && sscanf(argv[1], "%d", &sys_debuglevel) >= 1) NEXT(2); if (ARG("-noloadbang",1)) {sys_noloadbang = 1; NEXT(1);} if (ARG("-nogui",1)) {sys_printtostderr = sys_nogui = 1; NEXT(1);} ! if (ARG("-guiport",2) && sscanf(argv[1], "%d", &sys_guisetportnumber) >= 1) NEXT(2); if (ARG("-stderr",1)) {sys_printtostderr = 1; NEXT(1);} if (ARG("-guicmd",2)) {sys_guicmd = argv[1]; NEXT(2);} --- 663,670 ---- if (ARG("-verbose",1)) {sys_verbose++; NEXT(1);} if (ARG("-version",1)) {sys_version = 1; NEXT(1);} ! if (ARG("-d",2) && sscanf(argv[1], "%d", &sys_debuglevel) >= 1) {NEXT(2);} if (ARG("-noloadbang",1)) {sys_noloadbang = 1; NEXT(1);} if (ARG("-nogui",1)) {sys_printtostderr = sys_nogui = 1; NEXT(1);} ! if (ARG("-guiport",2) && sscanf(argv[1], "%d", &sys_guisetportnumber) >= 1) {NEXT(2);} if (ARG("-stderr",1)) {sys_printtostderr = 1; NEXT(1);} if (ARG("-guicmd",2)) {sys_guicmd = argv[1]; NEXT(2);} *************** *** 787,791 **** return 1; } - if (!sys_defaultfont) sys_defaultfont = DEFAULTFONT; for (; argc > 0; argc--, argv++) sys_openlist = namelist_append_files(sys_openlist, *argv); --- 711,714 ----