|
From: David B. <dav...@us...> - 2004-12-20 00:00:40
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24573 Modified Files: Tag: sidewinder-branch lang.c menueditor.c menuverbs.c opops.c Log Message: added code to default scripting language to the language corresponding to the signature in user.scripts.prefs.outlinesignature Andre has suggested a different way to do it, and I'll look into it, but for right now, this works. In the future, it should not be necessary for users to know what signatures correspond to what languages, perhaps some menu code will be needed. But until we have a good way to use version control with root code, this will have to wait. Index: opops.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/opops.c,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** opops.c 1 Nov 2004 11:50:16 -0000 1.4 --- opops.c 20 Dec 2004 00:00:29 -0000 1.4.4.1 *************** *** 1403,1408 **** (**ho).outlinescraptype = opscraptype; ! (**ho).outlinesignature = 'LAND'; #if !fljustpacking --- 1403,1410 ---- (**ho).outlinescraptype = opscraptype; + + langdefaultoutlinesignature (&((**ho).outlinesignature)); ! //(**ho).outlinesignature = 'LAND'; #if !fljustpacking Index: menuverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/menuverbs.c,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** menuverbs.c 1 Nov 2004 11:50:16 -0000 1.3 --- menuverbs.c 20 Dec 2004 00:00:29 -0000 1.3.4.1 *************** *** 1633,1637 **** } ! (**ho).outlinesignature = 'LAND'; (**ho).fontnum = (**hm).defaultscriptfontnum; --- 1633,1639 ---- } ! langdefaultoutlinesignature (&((**ho).outlinesignature)); ! ! //(**ho).outlinesignature = 'LAND'; (**ho).fontnum = (**hm).defaultscriptfontnum; Index: menueditor.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/menueditor.c,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** menueditor.c 1 Nov 2004 11:50:17 -0000 1.3 --- menueditor.c 20 Dec 2004 00:00:29 -0000 1.3.4.1 *************** *** 625,630 **** ho = *houtline; ! (**ho).outlinesignature = typeLAND; } --- 625,632 ---- ho = *houtline; + + langdefaultoutlinesignature (&((**ho).outlinesignature)); ! //(**ho).outlinesignature = typeLAND; } Index: lang.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/lang.c,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** lang.c 4 Nov 2004 21:56:39 -0000 1.4 --- lang.c 20 Dec 2004 00:00:20 -0000 1.4.4.1 *************** *** 83,86 **** --- 83,117 ---- static boolean flevaluateglobalwith = false; /*dmb 4.1b12 - new flag for langcard support*/ + #define LANGSCRIPTPREF "\x12" "user.scripts.prefs" + #define LANGDEFAULTSIGNATURE "\x10" "outlinesignature" + + boolean langdefaultoutlinesignature(unsigned long *sig) { + hdlhashtable hprefstable; + tyvaluerecord val; + boolean fl; + hdlhashnode hnode; + + disablelangerror (); + + fl = langfastaddresstotable (roottable, LANGSCRIPTPREF, &hprefstable) + && langhashtablelookup (hprefstable, LANGDEFAULTSIGNATURE, &val, &hnode); + + enablelangerror (); + + if (!fl) { + *sig = 'LAND'; + return true; + } + + if (val.valuetype != longvaluetype && val.valuetype != ostypevaluetype) { + *sig = 'LAND'; + return true; + } + + *sig = val.data.longvalue; + + return (true); + } + |