claylinelayout.c

Go to the documentation of this file.
00001 
00002 /*  $Id: claylinelayout.c 1311 2006-04-19 08:28:14Z hasseily $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #include "frontier.h"
00029 #include "standard.h"
00030 
00031 #include "font.h"
00032 #include "icon.h"
00033 #include "ops.h"
00034 #include "quickdraw.h"
00035 #include "strings.h"
00036 #include "timedate.h"
00037 #include "op.h"
00038 #include "opdisplay.h"
00039 #include "opicons.h"
00040 #include "opinternal.h"
00041 #include "langinternal.h"
00042 #include "tableformats.h"
00043 #include "tableinternal.h"
00044 #include "tablestructure.h"
00045 #include "claybrowser.h"
00046 //#include "clayicons.h"
00047 #include "byteorder.h"  /* 2006-04-08 aradke: endianness conversion macros */
00048 
00049 
00050 typedef struct tydisklinelayout {
00051     
00052     short recordsize;
00053     
00054     byte claydisplay; //if true, we're actually displaying in clay mode
00055     
00056     byte realicons; /*if true, we go into the desktop db for icons, otherwise use generic ones*/
00057     
00058     byte filenamebold; /*if true, the file name is drawn in bold*/
00059     
00060     byte includeline2; /*if true we include the 2nd line of the display*/
00061     
00062     byte includedate; /*if true, we include the modification date*/
00063     
00064     byte includeframe; /*if true, each line has a frame, if false it's just like an outliner*/
00065     
00066     byte iconsize; /*full-size, small or very small icons*/
00067     
00068     RGBColor fillcolor, framecolor, cursorcolor, filenamecolor, othertextcolor; 
00069     
00070     RGBColor backcolor, statuscolor;
00071     
00072     diskfontstring filenamefont, othertextfont;
00073     
00074     short filenamefontsize, othertextfontsize;
00075     } tydisklinelayout;
00076 
00077 
00078 #define fldisplaydebug false
00079 
00080 #define drawinset 4
00081 
00082 #define spacebetweenlines 1
00083 
00084 #define vertspacebetweenframes 5
00085 
00086 #ifdef claydialoginclude
00087     static hdlappwindow targetwindow = nil;
00088         
00089     static hdlcard layoutcard = nil;
00090 
00091     static void resetfilefontobjects (tylinelayout *); /*forward declaration*/
00092 #endif
00093 
00094 
00095 #define disktomemcolor(rgb) do {disktomemshort (rgb.red); \
00096     disktomemshort (rgb.green); \
00097     disktomemshort (rgb.blue); } while (0)
00098 
00099 #define memtodiskcolor(rgb) do {memtodiskshort (rgb.red); \
00100     memtodiskshort (rgb.green); \
00101     memtodiskshort (rgb.blue); } while (0)
00102 
00103 #if 0
00104 
00105 static boolean midcolorof (Rect r, RGBColor *rgb1, RGBColor *rgb2, RGBColor *rgbmid) {
00106     
00107     #ifdef MACVERSION
00108         GDHandle hgd;
00109         
00110         *rgbmid = *rgb2;
00111         
00112         hgd = GetMaxDevice (&r);
00113         
00114         return (GetGray (hgd, rgb1, rgbmid));
00115     #endif
00116 
00117     #ifdef WIN95VERSION
00118         (*rgbmid).red = ((long) (*rgb1).red + (*rgb2).red) / 2;
00119         (*rgbmid).green = ((long) (*rgb1).green + (*rgb2).green) / 2;
00120         (*rgbmid).blue = ((long) (*rgb1).blue + (*rgb2).blue) / 2;
00121 
00122         return (true);
00123     #endif
00124     } /*midcolorof*/
00125 
00126 
00127 static void lightcolorof (RGBColor *rgb) {
00128     
00129     (*rgb).red += (65535 - (*rgb).red) / 3;
00130     
00131     (*rgb).green += (65535 - (*rgb).green) / 3;
00132     
00133     (*rgb).blue += (65535 - (*rgb).blue) / 3;
00134     } /*lightcolorof*/
00135 
00136 #endif
00137 
00138 
00139 static void darkcolorof (RGBColor *rgb) {
00140     
00141     (*rgb).red -= (*rgb).red / 4;
00142     
00143     (*rgb).green -= (*rgb).green / 4;
00144     
00145     (*rgb).blue -= (*rgb).blue / 4;
00146     } /*darkcolorof*/
00147 
00148 
00149 /*static boolean claypushtextstyle (diskfontstring fontname, short fontsize) {
00150     
00151     bigstring bs;
00152     short fontnum;
00153     
00154     copystring (fontname, bs);
00155     
00156     fontgetnumber (bs, &fontnum);
00157     
00158     return (pushstyle (fontnum, fontsize, 0));
00159     } /%claypushtextstyle%/
00160 */
00161 
00162 
00163 void claysmashoutlinefields (hdlwindowinfo appwindow, hdltableformats hf) {
00164 #pragma unused (appwindow)
00165 
00166     /*
00167     bind the outline's font and size to the font/size from the
00168     layout record.
00169     
00170     10/14/93 DW: set outline backcolor too.
00171     */ 
00172     
00173     hdloutlinerecord ho = (**hf).houtline;  
00174     
00175     if (ho != nil) { /*has an outline linked in*/ 
00176     
00177         //bigstring bs;
00178         //short fontnum;
00179         //copystring ((**hf).linelayout.filenamefont, bs);
00180         //fontgetnumber (bs, &fontnum);
00181         //(**ho).fontnum = fontnum;
00182         
00183         (**ho).fontnum = (**hf).linelayout.filenamefont;
00184         
00185         (**ho).fontsize = (**hf).linelayout.filenamefontsize;
00186         
00187         (**ho).backcolor = (**hf).linelayout.backcolor;
00188         
00189         oppoststylechange ();
00190         
00191         //(**appwindow).backcolor = (**hf).linelayout.backcolor;
00192         }
00193     } /*claysmashoutlinefields*/
00194 
00195     
00196 static void smashlayoutfields (hdltableformats hf) {
00197 
00198     /*
00199     bind the layout's font and size to the font/size from the
00200     outline record.
00201     
00202     10/14/93 DW: set outline backcolor too.
00203     
00204     10/9/5 DW: Yuck! Made a mistake -- instead of "ho" it was
00205     "outlinedata". Skanky hard to trace in debugger. Gotcha!
00206     */ 
00207         
00208     hdloutlinerecord ho = (**hf).houtline;  
00209     
00210     /*
00211     bigstring bs;
00212     
00213     fontgetname ((**ho).fontnum, bs);
00214     
00215     copystring (bs, (**hf).linelayout.filenamefont);
00216     */
00217     
00218     (**hf).linelayout.filenamefont = (**ho).fontnum;
00219     
00220     (**hf).linelayout.filenamefontsize = (**ho).fontsize;
00221     
00222     (**hf).linelayout.backcolor = (**ho).backcolor;
00223     } /*smashlayoutfields*/
00224 
00225     
00226 static void setcomputedfields (hdltableformats hf) {
00227     
00228     hdloutlinerecord ho = (**hf).houtline;
00229     
00230     smashlayoutfields (hf); /*make the layout agree with the outline*/
00231     
00232     #ifdef claydialoginclude
00233         if (layoutcard != nil) { /*the card is open*/
00234             
00235             tylinelayout layout = (**hf).linelayout;
00236             
00237             #ifdef claydialoginclude
00238                 resetfilefontobjects (&layout);
00239             #endif
00240             }
00241     #endif
00242 
00243     switch ((**hf).linelayout.iconsize) {
00244         
00245         case fullsizeicon:
00246             (**ho).iconwidth = 32; 
00247     
00248             (**ho).iconheight = 32; 
00249             
00250             break;
00251         
00252         case smallsizeicon:     
00253             (**ho).iconwidth = 16; 
00254     
00255             (**ho).iconheight = 16; 
00256             
00257             break;
00258             
00259         case verysmallsizeicon:
00260             (**ho).iconwidth = 12;
00261             
00262             (**ho).iconheight = 12;
00263             
00264             break;          
00265         } /*switch*/
00266     
00267     (**ho).lineindent = (**ho).iconwidth + drawinset;
00268     
00269     /*compute display info for file names*/ {
00270         
00271         short style = 0;
00272         
00273         if ((**hf).linelayout.filenamebold)
00274             style = bold;
00275             
00276         pushstyle ((**outlinedata).fontnum, (**outlinedata).fontsize, style);
00277     
00278         (**hf).computedlineinfo.filenamelineheight = globalfontinfo.ascent + globalfontinfo.descent;
00279         
00280         #ifdef MACVERSION
00281             (**hf).computedlineinfo.filenamewidth = (globalfontinfo.widMax * 31) / 2;
00282         #endif
00283         #ifdef WIN95VERSION
00284             (**hf).computedlineinfo.filenamewidth = stringpixels (BIGSTRING ("\x02" "Wi")) * 16;
00285         #endif
00286 
00287         popstyle ();
00288         }
00289     
00290     /*compute display info for other text*/ {
00291     
00292         pushstyle ((**hf).linelayout.othertextfont, (**hf).linelayout.othertextfontsize, normal);
00293     
00294         (**hf).computedlineinfo.othertextlineheight = globalfontinfo.ascent + globalfontinfo.descent;
00295     
00296         (**hf).computedlineinfo.datewidth = stringpixels (BIGSTRING ("\x08" "11:59 AM"));
00297     
00298         (**hf).computedlineinfo.datewidth += (**hf).computedlineinfo.datewidth / 3;
00299     
00300         popstyle ();
00301         }
00302     } /*setcomputedfields*/
00303 
00304 
00305 void claybrowserinitdraw (void) {
00306     
00307     setcomputedfields (tableformatsdata);
00308     } /*claybrowserinitdraw*/
00309 
00310 
00311 static boolean hasframe (void) {
00312     
00313     hdltableformats hf = tableformatsdata;
00314     
00315     return ((**hf).linelayout.includeframe);
00316     } /*hasframe*/
00317 
00318 
00319 static short getframeheight (void) {
00320     
00321     hdltableformats hf = tableformatsdata;
00322     short height, minheight;
00323 
00324     height = (**outlinedata).iconheight;
00325     
00326     if (hasframe ())
00327         height += (2 * drawinset);
00328     else
00329         height += drawinset; /*a little extra space between lines*/
00330     
00331     minheight = (**hf).computedlineinfo.filenamelineheight;
00332     
00333     if ((**hf).linelayout.includeline2) {
00334     
00335         minheight += (**hf).computedlineinfo.othertextlineheight + spacebetweenlines;
00336         
00337         minheight += (2 * drawinset);
00338         }
00339     
00340     if (height < minheight)
00341         height = minheight;
00342         
00343     return (height);
00344     } /*getframeheight*/
00345     
00346 
00347 static short getframewidth (void) {
00348     
00349     hdltableformats hf = tableformatsdata;
00350     short width;
00351     
00352     width = drawinset + (**outlinedata).iconwidth + (2 * drawinset) + 
00353     
00354         (**hf).computedlineinfo.filenamewidth;
00355     
00356     if ((**hf).linelayout.includedate)
00357         width += (**hf).computedlineinfo.datewidth;
00358         
00359     return (width);
00360     } /*getframewidth*/
00361     
00362     
00363 static boolean simpleoutlinerdisplay (void) { /*DW 4/7/95*/
00364 
00365     hdltableformats hf = tableformatsdata;
00366     tylinelayout lo = (**hf).linelayout;
00367         
00368     if ((!lo.includeline2) && (!lo.includedate) && (!lo.includeframe))
00369         return (true);
00370             
00371     return (false);
00372     } /*simpleoutlinerdisplay*/
00373     
00374 
00375 boolean claygettextrect (hdlheadrecord hnode, const Rect *linerect, Rect *textrect) {
00376     
00377     hdltableformats hf = tableformatsdata;
00378     Rect r;
00379     
00380     r.left = (*linerect).left + opnodeindent (hnode) + drawinset + (**outlinedata).iconwidth + drawinset;
00381     
00382     if (simpleoutlinerdisplay ()) 
00383         r.right = (*linerect).right - texthorizinset;
00384     else {
00385         if (hasframe ()) /*it looks better with a little more space separating the icon and the name*/
00386             r.left += drawinset;
00387     
00388         r.right = r.left + (**hf).computedlineinfo.filenamewidth;
00389         }
00390     
00391     r.top = (*linerect).top;
00392     
00393     r.bottom = r.top + (**hf).computedlineinfo.filenamelineheight;
00394     
00395     /*center the text vertically*/ {
00396     
00397         short dv;
00398         
00399         if ((**hf).linelayout.includeline2) {
00400             
00401             short combinedlineheight = (**hf).computedlineinfo.filenamelineheight + (**hf).computedlineinfo.othertextlineheight;
00402             
00403             dv = (getframeheight () - combinedlineheight - spacebetweenlines);
00404             }
00405         else 
00406             dv = (getframeheight () - (**hf).computedlineinfo.filenamelineheight);
00407             
00408         dv /= 2;
00409         
00410         if ((dv % 2) == 1) /*prefer to add extra pixel at top, not bottom*/
00411             dv++;
00412         
00413         if (dv > 0)         
00414             offsetrect (&r, 0, dv);
00415         }
00416         
00417     *textrect = r;
00418     
00419     return (true);
00420     } /*claygettextrect*/
00421     
00422 
00423 boolean claygetedittextrect (hdlheadrecord hnode, const Rect *linerect, Rect *textrect) {
00424     
00425     //claypushnodestyle (hnode);
00426     
00427     claygettextrect (hnode, linerect, textrect);
00428     
00429     //popstyle ();
00430     
00431     return (true);
00432     } /*claygetedittextrect*/
00433 
00434 
00435 boolean claygeticonrect (hdlheadrecord hnode, const Rect *linerect, Rect *iconrect) {
00436     
00437     Rect r;
00438     
00439     r.left = (*linerect).left + opnodeindent (hnode);
00440     
00441     r.right = r.left + (**outlinedata).iconwidth;
00442     
00443     r.top = (*linerect).top;
00444     
00445     r.bottom = r.top + (**outlinedata).iconheight;
00446     
00447     if (hasframe ()) 
00448         offsetrect (&r, drawinset, drawinset);
00449     else {
00450         Rect rcontains = *linerect;
00451         
00452         rcontains.left = r.left;
00453         
00454         rcontains.right = r.right;
00455         
00456         centerrect (&r, rcontains); /*center it vertically*/
00457         }
00458     
00459     *iconrect = r;
00460     
00461     return (true);
00462     } /*claygeticonrect*/
00463     
00464 
00465 boolean claypushnodestyle (hdlheadrecord hnode) {
00466     
00467     hdltableformats hf = tableformatsdata;
00468     tybrowserinfo info;
00469     
00470     short style;
00471     
00472     if ((**hf).linelayout.filenamebold)
00473         style = bold;
00474     else
00475         style = 0;
00476         
00477     browsergetrefcon (hnode, &info);
00478 
00479     #if filebrowser
00480         if (info.flalias)       
00481             style += italic;
00482     #endif
00483     
00484     if ((**hnode).flnodeunderlined) 
00485         style += underline;
00486     
00487     pushstyle ((**outlinedata).fontnum, (**outlinedata).fontsize, style);
00488     
00489     return (true);
00490     } /*claypushnodestyle*/
00491 
00492 
00493 boolean claygetlineheight (hdlheadrecord hnode, short *lh) {
00494 #pragma unused (hnode)
00495 
00496     *lh = getframeheight ();
00497     
00498     if (hasframe ())
00499         *lh += vertspacebetweenframes;
00500     
00501     return (true);
00502     } /*claygetlineheight*/
00503 
00504 
00505 boolean claygetlinewidth (hdlheadrecord hnode, short *lw) {
00506     
00507     //claypushnodestyle (hnode);
00508 
00509     boolean fl = opdefaultgetlinewidth (hnode, lw);
00510 
00511     //popstyle ();
00512     
00513     return (fl);
00514     } /*claygetlinewidth*/
00515     
00516     
00517 boolean claygetnodeframe (hdlheadrecord hnode, Rect *r) {
00518     
00519     (*r).left += opnodeindent (hnode);
00520     
00521     if (simpleoutlinerdisplay ()) {
00522         
00523         short lw;
00524         
00525         claygetlinewidth (hnode, &lw);
00526         
00527         (*r).right = (*r).left + drawinset + (**outlinedata).iconwidth + drawinset + lw;
00528         }
00529     else
00530         (*r).right = (*r).left + getframewidth ();
00531     
00532     (*r).bottom = (*r).top + getframeheight ();
00533     
00534     return (true);
00535     } /*claygetnodeframe*/
00536     
00537     
00538 static void getfatdatestring (long modtime, bigstring bs) {
00539     
00540     /*
00541     actually we get a very slim date string.
00542     */
00543     
00544     timetodatestring (modtime, bs, false); /*9/8/93*/
00545     } /*getfatdatestring*/
00546     
00547     
00548 static void getfattimestring (long modtime, bigstring bs) {
00549     
00550     /*
00551     actually we get a very slim time string.
00552     */
00553     
00554     timetotimestring (modtime, bs, false); /*9/8/93*/
00555     } /*getfattimestring*/
00556     
00557     
00558 #if 0
00559 
00560 static void getfatsizestring (tybrowserinfo *browserinfo, bigstring bs) {
00561     
00562     setemptystring (bs);
00563         
00564     if ((*browserinfo).flfolder) {
00565         
00566         short ctfiles = (*browserinfo).filesize;
00567         
00568         shorttostring (ctfiles, bs);
00569         
00570         pushstring (BIGSTRING ("\x05" " item"), bs);
00571         
00572         if (ctfiles != 1)
00573             pushchar ('s', bs);
00574     
00575         return;
00576         }
00577     
00578     getsizestring ((*browserinfo).filesize, bs);
00579     } /*getfatsizestring*/
00580 
00581 #endif
00582     
00583 
00584 static Rect rfilename, rframe, rdate;
00585 
00586 
00587 boolean claypredrawline (hdlheadrecord hnode, const Rect *linerect, boolean flselected, boolean flinverted) {
00588 #pragma unused(flinverted)
00589 
00590     hdltableformats hf = tableformatsdata;
00591     Rect r;
00592     
00593     rframe = *linerect;
00594     
00595     claygetnodeframe (hnode, &rframe); /*set global*/
00596     
00597     if (hasframe ()) {
00598         
00599         /*erase the rect in the fill color or cursor color*/ {
00600             
00601             if (flselected)     
00602                 pushbackcolor (&(**hf).linelayout.cursorcolor);
00603             else 
00604                 pushbackcolor (&(**hf).linelayout.fillcolor);   
00605             
00606             r = rframe;
00607             
00608             eraserect (r);
00609             
00610             popbackcolor ();
00611             }
00612         
00613         /*
00614         /%an experiment -- try to give the files "depth" or 3D indentation%/ {
00615             
00616             /%top and left edges are framed in dark color%/ {
00617                 
00618                 RGBColor rgb = (**hf).linelayout.backcolor;
00619                 
00620                 darkcolorof (&rgb);
00621                 
00622                 pushforecolor (&rgb);
00623                 
00624                 r = rframe;
00625             
00626                 MoveTo (r.left, r.top);
00627                 
00628                 LineTo (r.right, r.top);
00629                 
00630                 MoveTo (r.left, r.top + 1);
00631                 
00632                 LineTo (r.right - 1, r.top + 1);
00633                 
00634                 MoveTo (r.left, r.top);
00635                 
00636                 LineTo (r.left, r.bottom);
00637                 
00638                 MoveTo (r.left + 1, r.top);
00639                 
00640                 LineTo (r.left + 1, r.bottom - 1);
00641                 
00642                 popforecolor ();
00643                 }
00644                 
00645             /%bottom and right edges are framed in light color%/ {
00646                 
00647                 RGBColor rgb = (**hf).linelayout.backcolor;
00648                 
00649                 lightcolorof (&rgb);
00650                 
00651                 pushforecolor (&rgb);
00652                 
00653                 r = rframe;
00654             
00655                 MoveTo (r.right, r.bottom);
00656                 
00657                 LineTo (r.right, r.top + 1);
00658                 
00659                 MoveTo (r.right - 1, r.bottom);
00660                 
00661                 LineTo (r.right - 1, r.top + 2);
00662                 
00663                 MoveTo (r.right, r.bottom);
00664                 
00665                 LineTo (r.left + 1, r.bottom);
00666                 
00667                 MoveTo (r.right, r.bottom - 1);
00668                 
00669                 LineTo (r.left + 2, r.bottom - 1);
00670                 
00671                 popforecolor ();
00672                 }
00673             }
00674             */
00675             
00676         /*draw the node's frame*/ {
00677         
00678             r = rframe;
00679             
00680             pushforecolor (&(**hf).linelayout.framecolor);
00681     
00682             framerect (r);
00683         
00684             popforecolor ();
00685             }
00686         
00687         /*drop shadow*/ {
00688             
00689             RGBColor rgb = (**hf).linelayout.backcolor;
00690                 
00691             r = rframe;
00692             
00693             darkcolorof (&rgb);
00694             
00695             pushforecolor (&rgb);
00696             
00697             dropshadowrect (r, 2, false);
00698             
00699             popforecolor ();
00700             }
00701         
00702         /*anti-aliasing%/ {
00703         
00704             RGBColor rgb;
00705                 
00706             r = rframe;
00707             
00708             InsetRect (&r, 1, 1);
00709             
00710             midcolorof (r, &(**hf).linelayout.fillcolor, &(**hf).linelayout.framecolor, &rgb);
00711             
00712             pushforecolor (&rgb);
00713             
00714             FrameRect (&r);
00715             
00716             popforecolor ();
00717             }
00718         */
00719         }
00720     
00721     return (true);
00722     } /*claypredrawline*/
00723     
00724 
00725 static boolean claydrawtext (hdlheadrecord hnode, const Rect *rtext, boolean flselected, boolean flinverted) {
00726     
00727     /*
00728     the normal text drawing routine, used for script editor and
00729     menu editor in Frontier. 
00730     */
00731     
00732     bigstring bshead;
00733     
00734     if (opeditingtext (hnode)) {
00735     
00736         opeditupdate ();
00737         
00738         return (true);
00739         }
00740     
00741     getheadstring (hnode, bshead);
00742     
00743     if (!hasframe ())
00744         ellipsize (bshead, (*rtext).right - (*rtext).left);
00745     
00746     movepento ((*rtext).left, (*rtext).top + globalfontinfo.ascent);
00747     
00748     if (!flselected) {
00749 
00750         pendrawstring (bshead);
00751         
00752         return (true);
00753         }
00754     
00755     /*special tweaked-up code for drawing the selected line*/ {
00756     
00757         Rect lrframe = *rtext;  // 2006-04-03 - kw --- renamed rframe
00758         
00759         lrframe.right = lrframe.left + stringpixels (bshead);
00760         
00761         if (lrframe.right > (*rtext).right) 
00762             lrframe.right = (*rtext).right;
00763         
00764         lrframe.bottom = lrframe.top + globalfontinfo.ascent + globalfontinfo.descent;
00765             
00766         if (flinverted) {
00767             
00768             Rect r = lrframe;
00769             
00770             insetrect (&r, -1, -1);
00771             
00772             pushbackcolor (&blackcolor);
00773             
00774             eraserect (r);
00775             
00776             popbackcolor ();
00777             
00778             pushforecolor (&whitecolor);
00779             
00780             pendrawstring (bshead);
00781         
00782             popforecolor ();
00783             }
00784         else
00785             pendrawstring (bshead);
00786             
00787         /*frame the cursor*/ {
00788         
00789             insetrect (&lrframe, -texthorizinset, -textvertinset);
00790     
00791             grayframerect (lrframe);
00792             }
00793         }
00794 
00795     return (true);
00796     } /*claydrawtext*/
00797 
00798 
00799 boolean claydrawline (hdlheadrecord hnode, const Rect *textrect, boolean flselected, boolean flinverted) {
00800     
00801     hdltableformats hf = tableformatsdata;
00802     RGBColor rgb = (**hf).linelayout.filenamecolor;
00803     
00804     claypushnodestyle (hnode);
00805     
00806     pushforecolor (&rgb);
00807     
00808     claydrawtext (hnode, textrect, flselected, flinverted);
00809     
00810     popforecolor ();
00811 
00812     popstyle ();
00813     
00814     return (true);
00815     } /*claydrawline*/
00816     
00817     
00818 boolean claypostdrawline (hdlheadrecord hnode, const Rect *linerect, boolean flselected, boolean flinverted) {
00819 #pragma unused(flselected, flinverted)
00820 
00821     /*
00822     we draw everything but the icon and the filename, if we're in fatview mode.
00823     
00824     9/26/94 DW: hack it up to display messages in the Trade Secrets BBS.
00825     */
00826     
00827     hdltableformats hf = tableformatsdata;
00828     bigstring bsname;
00829     tybrowserinfo browserinfo;
00830     unsigned long nodetime = 0;
00831     hdlhashnode hhashnode;
00832     
00833     pushforecolor (&(**hf).linelayout.othertextcolor);
00834     
00835     pushstyle ((**hf).linelayout.othertextfont, (**hf).linelayout.othertextfontsize, normal);
00836     
00837     browsergetrefcon (hnode, &browserinfo);
00838     
00839     opgetheadstring (hnode, bsname);
00840     
00841     claygettextrect (hnode, linerect, &rfilename);
00842         
00843     if ((**hf).linelayout.includeline2) { /*draw the file kind/size string*/ 
00844         
00845         Rect r = rfilename;
00846         bigstring bs, bstype;
00847         tyvaluerecord val;
00848         
00849         r.top = r.bottom + spacebetweenlines;
00850         
00851         r.bottom = r.top + (**hf).computedlineinfo.othertextlineheight;
00852         
00853         if (hashtablelookup (browserinfo.dirid, bsname, &val, &hhashnode)) {
00854             
00855             tablegetcellstring (hnode, valuecolumn, bs, true);
00856             
00857             if (val.valuetype == externalvaluetype) {
00858                 
00859                 hashgettypestring (val, bstype);
00860                 
00861                 pushstring (BIGSTRING ("\x02" ", "), bstype);
00862                 
00863                 insertstring (bstype, bs);
00864                 }
00865             
00866             ellipsize (bs, r.right - r.left);
00867             
00868             movepento (r.left, r.top + globalfontinfo.ascent);
00869             
00870             pendrawstring (bs);
00871             }
00872         }
00873     
00874     nodetime = browserinfo.timemodified;
00875     
00876     if ((**hf).linelayout.includedate && (nodetime != 0)) { /*draw the modification date string*/
00877     
00878         Rect r = rfilename;
00879         bigstring bs;
00880         
00881         r.right = rframe.right - drawinset;
00882         
00883         r.left = r.right - (**hf).computedlineinfo.datewidth;
00884         
00885         getfatdatestring (nodetime, bs);
00886         
00887         ellipsize (bs, r.right - r.left);
00888         
00889         movepento (r.right - stringpixels (bs), r.top + globalfontinfo.ascent);
00890         
00891         pendrawstring (bs);
00892         
00893         rdate = r;
00894         }
00895                 
00896     if ((**hf).linelayout.includeline2 && (**hf).linelayout.includedate) { /*draw the mod time string*/
00897     
00898         Rect r = rdate;
00899         bigstring bs;
00900         
00901         r.top = r.bottom + spacebetweenlines;
00902         
00903         r.bottom = r.top + (**hf).computedlineinfo.othertextlineheight;
00904         
00905         getfattimestring (nodetime, bs);
00906         
00907         ellipsize (bs, r.right - r.left);
00908         
00909         movepento (r.right - stringpixels (bs), r.top + globalfontinfo.ascent);
00910         
00911         pendrawstring (bs);
00912         }
00913     
00914     popstyle ();
00915     
00916     popforecolor ();
00917     
00918     return (true);
00919     } /*claypostdrawline*/
00920     
00921 
00922 boolean claydrawnodeicon (hdlheadrecord hnode, const Rect *iconrect, boolean flselected, boolean flinverted) {
00923 #pragma unused(flinverted)
00924 
00925     short iconnum;
00926     short transform = 0;
00927     
00928     iconnum = opgetheadicon (hnode);
00929     
00930     if (flselected)
00931         transform = 0x4000; 
00932     
00933 #ifdef MACVERSION
00934     ploticonresource ((Rect *) iconrect, kAlignAbsoluteCenter, transform, iconnum);
00935 #endif
00936 
00937 #ifdef WIN95VERSION
00938     ploticonresource (iconrect, 0, transform, iconnum);
00939 #endif
00940 //  opdrawheadicon (iconnum, iconrect, false);
00941     
00942     /*
00943     if (flselected) {
00944         
00945         Rect r = *iconrect;
00946         
00947         insetrect (&r, 1, 1);
00948         
00949         invertrect (r);
00950         }
00951     */
00952     
00953     return (true);
00954     } /*claydrawnodeicon*/
00955 
00956 
00957 void claysetlinelayout (hdlwindowinfo targetwindow, tylinelayout *newlayout) {
00958                     
00959     hdltableformats hf = (hdltableformats) (**targetwindow).hdata;
00960     
00961     (**hf).linelayout = *newlayout;
00962     
00963     claysmashoutlinefields (targetwindow, hf);
00964     
00965     setcomputedfields (hf); 
00966     
00967     shellwindowinval (targetwindow);
00968     
00969     (**targetwindow).selectioninfo.fldirty = true; /*force update of font/size submenus of the Edit menu*/
00970     
00971     #ifdef claydialoginclude
00972     if ((layoutcard != nil) && ((**hf).houtline != nil)) {
00973     
00974         currentcard = layoutcard;
00975         
00976         copytodialog ();
00977         }
00978     #endif
00979     } /*claysetlinelayout*/
00980 
00981 
00982 #ifdef claydialoginclude
00983 
00984 static void initdialog (void) {
00985     
00986     setcardpopupfrommenu ("\pfilefont", hdlfontmenu, 1);
00987     
00988     setcardpopupfrommenu ("\potherfont", hdlfontmenu, 1);
00989     } /*initdialog*/
00990     
00991 
00992 static void resetfilefontobjects (tylinelayout *layout) {
00993     
00994     currentcard = layoutcard;
00995     
00996     setfontsizepopup ("\pfilesize", (*layout).filenamefontsize);
00997     
00998     setfontpopup ("\pfilefont", (*layout).filenamefont);
00999     } /*resetfilefontobjects*/
01000     
01001     
01002 boolean claywindowuseslayout (hdlappwindow appwindow) {
01003 
01004     hdltableformats hf;
01005     
01006     if (appwindow == nil) 
01007         return (false);
01008     
01009     hf = (hdltableformats) (**appwindow).appdata;
01010     
01011     return ((**hf).fluseslinelayout);
01012     } /*claywindowuseslayout*/
01013 
01014 
01015 static void copytodialog (void) {
01016     
01017     tylinelayout layout;
01018     
01019     if (!claywindowuseslayout (targetwindow)) {
01020 
01021         enableallcardobjects (false);
01022         
01023         return;
01024         }
01025     
01026     layout = (**(hdltableformats) (**targetwindow).appdata).linelayout;
01027         
01028     enableallcardobjects (true); /*also invals all objects*/
01029     
01030     setcardenable ("\preal", false); /*DW 10/19/95 -- wired off*/
01031         
01032     setcardenable ("\pgeneric", false); /*DW 10/19/95 -- wired off*/
01033         
01034     setcardflag ("\preal", layout.realicons);
01035     
01036     setcardflag ("\pgeneric", !layout.realicons);
01037     
01038     setcardflag ("\pfullsize", layout.iconsize == fullsizeicon);
01039     
01040     setcardflag ("\psmall", layout.iconsize == smallsizeicon);
01041     
01042     setcardflag ("\pverysmall", layout.iconsize == verysmallsizeicon);
01043     
01044     setcardflag ("\pline2", layout.includeline2);
01045     
01046     setcardflag ("\pdate", layout.includedate);
01047     
01048     setcardflag ("\pbold", layout.filenamebold);
01049     
01050     setcardflag ("\phasframe", layout.includeframe);
01051     
01052     setcardcolorpopup ("\pfill", &layout.fillcolor);
01053     
01054     setcardcolorpopup ("\pframe", &layout.framecolor);
01055     
01056     setcardcolorpopup ("\pcursor", &layout.cursorcolor);    
01057     
01058     setcardcolorpopup ("\pfilecolor", &layout.filenamecolor);   
01059     
01060     setcardcolorpopup ("\pothercolor", &layout.othertextcolor); 
01061     
01062     setcardcolorpopup ("\pbackcolor", &layout.backcolor);   
01063     
01064     setcardcolorpopup ("\pstatuscolor", &layout.statuscolor);   
01065     
01066     resetfilefontobjects (&layout);
01067     
01068     setfontsizepopup ("\pothersize", layout.othertextfontsize);
01069     
01070     setfontpopup ("\potherfont", layout.othertextfont);
01071     } /*copytodialog*/
01072     
01073     
01074 static void copyfromdialog (tylinelayout *layout) {
01075     
01076     clearbytes (layout, longsizeof (tylinelayout));
01077     
01078     (*layout).realicons = getcardbit ("\preal");
01079     
01080     if (getcardbit ("\pfullsize"))
01081         (*layout).iconsize = fullsizeicon;
01082         
01083     if (getcardbit ("\psmall"))
01084         (*layout).iconsize = smallsizeicon;
01085         
01086     if (getcardbit ("\pverysmall"))
01087         (*layout).iconsize = verysmallsizeicon;
01088         
01089     (*layout).includeline2 = getcardbit ("\pline2");
01090     
01091     (*layout).includedate = getcardbit ("\pdate");
01092     
01093     (*layout).filenamebold = getcardbit ("\pbold");
01094     
01095     (*layout).includeframe = getcardbit ("\phasframe");
01096     
01097     getcardcolorpopup ("\pfill", &(*layout).fillcolor);
01098     
01099     getcardcolorpopup ("\pframe", &(*layout).framecolor);
01100     
01101     getcardcolorpopup ("\pcursor", &(*layout).cursorcolor);
01102     
01103     getcardcolorpopup ("\pfilecolor", &(*layout).filenamecolor);
01104     
01105     getcardcolorpopup ("\pothercolor", &(*layout).othertextcolor);
01106     
01107     getcardcolorpopup ("\pbackcolor", &(*layout).backcolor);
01108     
01109     getcardcolorpopup ("\pstatuscolor", &(*layout).statuscolor);
01110     
01111     (*layout).filenamefontsize = getfontsizepopup ("\pfilesize");
01112     
01113     (*layout).othertextfontsize = getfontsizepopup ("\pothersize");
01114     
01115     getfontpopup ("\pfilefont", (*layout).filenamefont);
01116     
01117     getfontpopup ("\potherfont", (*layout).othertextfont);
01118     } /*copyfromdialog*/
01119     
01120     
01121 static boolean gettargetwindow (void) {
01122     
01123     /*
01124     return true if the target window was changed
01125     */
01126 
01127     hdlappwindow newtarget;
01128     
01129     claygetfrontwindow (&newtarget);
01130     
01131     if (newtarget != targetwindow) {
01132         
01133         targetwindow = newtarget;
01134         
01135         copytodialog ();
01136         
01137         return (true); /*changed*/
01138         }
01139         
01140     return (false); /*didn't change*/
01141     } /*gettargetwindow*/
01142 
01143 
01144 static void linelayoutprefsfilter (EventRecord *ev) {
01145     
01146     switch ((*ev).what) {
01147         
01148         case iowaInitEvent: 
01149             currentcard = (hdlcard) (*ev).message;
01150             
01151             layoutcard = currentcard;
01152             
01153             claygetfrontwindow (&targetwindow);
01154             
01155             initdialog ();
01156             
01157             copytodialog ();
01158             
01159             break;
01160             
01161         case activateEvt: 
01162             if ((*ev).modifiers & activeFlag) {
01163                 
01164                 currentcard = layoutcard; /*DW 4/11/95: added*/
01165                 
01166                 gettargetwindow ();
01167                 }
01168                 
01169             break;
01170             
01171         case iowaCloseEvent:
01172             currentcard = (hdlcard) (*ev).message; 
01173             
01174             appsavedialoginfo (137); /*remember window position*/
01175             
01176             layoutcard = nil; /*we always forget to do this!!! DW 9/13/93*/
01177             
01178             break;
01179                 
01180         case nullEvent: 
01181             currentcard = layoutcard;
01182             
01183             iowavalidate (true); /*DW 4/11/95: added*/
01184 
01185             if (gettargetwindow ()) /*target window changed, card already updated*/         
01186                 break;
01187             
01188             if (!claywindowuseslayout (targetwindow)) /*it's an outline or process window, for e.g.*/
01189                 break;
01190                 
01191             /*check for changes to card objects*/ {
01192             
01193                 if ((**currentcard).runmodechanges) {
01194                     
01195                     tylinelayout newlayout;
01196                     
01197                     copyfromdialog (&newlayout);
01198 
01199                     setappwindowmadechanges (targetwindow); 
01200                 
01201                     claysetlinelayout (targetwindow, &newlayout);
01202                     
01203                     (**currentcard).runmodechanges = false;
01204                     }
01205                 
01206                 /*
01207                 hdltableformats hf = (hdltableformats) (**targetwindow).appdata;
01208                 tylinelayout oldlayout, newlayout;
01209             
01210                 oldlayout = (**hf).linelayout;
01211                 
01212                 copyfromdialog (&newlayout);
01213                 
01214                 if (!equalmemory (&newlayout, &oldlayout, longsizeof (oldlayout))) {
01215                     
01216                     setappwindowmadechanges (targetwindow); 
01217                 
01218                     claysetlinelayout (&newlayout);
01219                     }
01220                 */
01221                 }
01222                 
01223             break;
01224         } /*switch*/
01225     } /*linelayoutprefsfilter*/
01226     
01227     
01228 void linelayoutprefsdialog (void) {
01229     
01230     if (layoutcard == nil)      
01231         appopencardresource (137, &linelayoutprefsfilter);
01232     else 
01233         appcardtofront (layoutcard); 
01234     } /*linelayoutprefsdialog*/
01235 
01236 
01237 void linelayoutbeforeclosewindow (void) {
01238     
01239     if (targetwindow == app.appwindow)  
01240         targetwindow = nil;
01241     } /*linelayoutbeforeclosewindow*/
01242 
01243 #endif
01244 
01245 static boolean hashlookupboolean (bigstring bslookup) {
01246     
01247     /*
01248     look up a boolean value, defaulting to false if any errors occur
01249     */
01250     
01251     tyvaluerecord val;
01252     hdlhashnode hnode;
01253     
01254     if (!hashlookup (bslookup, &val, &hnode))
01255         return (false);
01256     
01257     if (!copyvaluerecord (val, &val) || !coercetoboolean (&val))
01258         return (false);
01259     
01260     return (val.data.flvalue);
01261     } /*hashlookupboolean*/
01262 
01263 
01264 static short hashlookupshort (bigstring bslookup, short defaultval) {
01265     
01266     /*
01267     look up a short value, defaulting to defaultval if any errors occur
01268     */
01269     
01270     tyvaluerecord val;
01271     hdlhashnode hnode;
01272     
01273     if (!hashlookup (bslookup, &val, &hnode))
01274         return (defaultval);
01275     
01276     if (!copyvaluerecord (val, &val) || !coercetoint (&val))
01277         return (defaultval);
01278     
01279     return (val.data.intvalue);
01280     } /*hashlookupshort*/
01281 
01282 
01283 static RGBColor hashlookupcolor (bigstring bslookup, const RGBColor *defaultrgb) {
01284     
01285     /*
01286     look up a rgb color value, defaulting to defaultrgb if any errors occur
01287     */
01288     
01289     tyvaluerecord val;
01290     hdlhashnode hnode;
01291     
01292     if (!hashlookup (bslookup, &val, &hnode))
01293         return (*defaultrgb);
01294     
01295     if (!copyvaluerecord (val, &val) || !coercetorgb (&val))
01296         return (*defaultrgb);
01297     
01298     return (**val.data.rgbvalue);
01299     } /*hashlookupcolor*/
01300 
01301 
01302 static boolean hashlookupstring (bigstring bslookup, bigstring bs) {
01303     
01304     /*
01305     look up a font value, returning false if any errors occur
01306     */
01307     
01308     tyvaluerecord val;
01309     hdlhashnode hnode;
01310     
01311     if (!hashlookup (bslookup, &val, &hnode))
01312         return (false);
01313     
01314     if (!copyvaluerecord (val, &val) || !coercetostring (&val))
01315         return (false);
01316     
01317     pullstringvalue (&val, bs);
01318     
01319     return (true);
01320     } /*hashlookupstring*/
01321 
01322 
01323 static boolean langassigncolorvalue (hdlhashtable ht, const bigstring bs, const RGBColor *color) {
01324     
01325     /*
01326     could be useful...
01327     */
01328     
01329     tyvaluerecord val;
01330     
01331     if (!newheapvalue ((void *) color, sizeof (*color), rgbvaluetype, &val))
01332         return (false);
01333     
01334     if (!hashtableassign (ht, bs, val)) {
01335         
01336         disposevaluerecord (val, false);
01337         
01338         return (false);
01339         }
01340     
01341     exemptfromtmpstack (&val);
01342     
01343     return (true);
01344     } /*langassignbooleanvalue*/
01345 
01346 
01347 boolean claytabletolayout (hdlhashtable ht, tylinelayout *layout) {
01348     
01349     bigstring bsfont;
01350     
01351     clearbytes (layout, sizeof (tylinelayout)); // clears flinitted, everything else
01352     
01353     pushhashtable (ht);
01354     
01355     (*layout).claydisplay = hashlookupboolean (str_claydisplay);
01356     (*layout).realicons  = hashlookupboolean (str_realicons);
01357     (*layout).filenamebold = hashlookupboolean (str_filenamebold);
01358     (*layout).includeline2 = hashlookupboolean (str_includeline2);
01359     (*layout).includedate = hashlookupboolean (str_includedate);
01360     (*layout).includeframe = hashlookupboolean (str_includeframe);
01361     
01362     (*layout).fillcolor = hashlookupcolor (str_fillcolor, &whitecolor);
01363     (*layout).framecolor = hashlookupcolor (str_framecolor, &blackcolor);
01364     (*layout).cursorcolor = hashlookupcolor (str_cursorcolor, &blackcolor);
01365     (*layout).filenamecolor = hashlookupcolor (str_filenamecolor, &blackcolor);
01366     (*layout).othertextcolor = hashlookupcolor (str_othertextcolor, &blackcolor);
01367     (*layout).backcolor = hashlookupcolor (str_backcolor, &whitecolor);
01368     (*layout).statuscolor = hashlookupcolor (str_statuscolor, &blackcolor);
01369     
01370     if (hashlookupstring (str_filenamefont, bsfont))
01371         fontgetnumber (bsfont, &(*layout).filenamefont);
01372     else
01373         (*layout).filenamefont = config.defaultfont;
01374     
01375     if (hashlookupstring (str_othertextfont, bsfont))
01376         fontgetnumber (bsfont, &(*layout).othertextfont);
01377     else
01378         (*layout).othertextfont = config.defaultfont;
01379     
01380     (*layout).iconsize = (tyiconsize) hashlookupshort (str_iconsize, 1);
01381     (*layout).filenamefontsize = hashlookupshort (str_filenamefontsize, 12);
01382     (*layout).othertextfontsize = hashlookupshort (str_othertextfontsize, 9);
01383     
01384     pophashtable ();
01385     
01386     (*layout).flinitted = true;
01387     
01388     return (true);
01389     } /*claytabletolayout*/
01390 
01391 
01392 boolean claylayouttotable (const tylinelayout *layout, hdlhashtable ht) {
01393     
01394     bigstring bs;
01395     
01396     if (!(*layout).flinitted)
01397         return (false);
01398     
01399     langassignbooleanvalue (ht, str_claydisplay, (*layout).claydisplay);
01400     langassignbooleanvalue (ht, str_realicons, (*layout).realicons);
01401     langassignbooleanvalue (ht, str_filenamebold, (*layout).filenamebold);
01402     langassignbooleanvalue (ht, str_includeline2, (*layout).includeline2);
01403     langassignbooleanvalue (ht, str_includedate, (*layout).includedate);
01404     langassignbooleanvalue (ht, str_includeframe, (*layout).includeframe);
01405     
01406     langassigncolorvalue (ht, str_fillcolor, &(*layout).fillcolor);
01407     langassigncolorvalue (ht, str_framecolor, &(*layout).framecolor);
01408     langassigncolorvalue (ht, str_cursorcolor, &(*layout).cursorcolor);
01409     langassigncolorvalue (ht, str_filenamecolor, &(*layout).filenamecolor);
01410     langassigncolorvalue (ht, str_othertextcolor, &(*layout).othertextcolor);
01411     langassigncolorvalue (ht, str_backcolor, &(*layout).backcolor);
01412     langassigncolorvalue (ht, str_statuscolor, &(*layout).statuscolor);
01413     
01414     fontgetname ((*layout).filenamefont, bs);
01415     langassignstringvalue (ht, str_filenamefont, bs);
01416     
01417     fontgetname ((*layout).othertextfont, bs);
01418     langassignstringvalue (ht, str_othertextfont, bs);
01419     
01420     langassignlongvalue (ht, str_iconsize, (*layout).iconsize);
01421     langassignlongvalue (ht, str_filenamefontsize, (*layout).filenamefontsize);
01422     langassignlongvalue (ht, str_othertextfontsize, (*layout).othertextfontsize);
01423     
01424     return (true);
01425     } /*claylayouttotable*/
01426 
01427 
01428 boolean clayinitlinelayout (tylinelayout *layout) {
01429     
01430     hdlhashtable hprefs;
01431     
01432     if (!langfastaddresstotable (roottable, BIGSTRING ("\x17" "user.prefs.tableDisplay"), &hprefs))
01433         return (false);
01434     
01435     return (claytabletolayout (hprefs, layout));
01436     } /*clayinitlinelayout*/
01437 
01438 
01439 boolean claypacklinelayout (Handle hpacked) {
01440 
01441     tylinelayout layout = (**tableformatsdata).linelayout;
01442     tydisklinelayout info;
01443     
01444     info.recordsize = sizeof (info);
01445     
01446     info.claydisplay = (byte) layout.claydisplay;
01447     
01448     info.realicons = (byte) layout.realicons;
01449     
01450     info.filenamebold = (byte) layout.filenamebold;
01451     
01452     info.includeline2 = (byte) layout.includeline2;
01453     
01454     info.includedate = (byte) layout.includedate;
01455     
01456     info.includeframe = (byte) layout.includeframe;
01457     
01458     info.iconsize = (byte) layout.iconsize;
01459     
01460     info.fillcolor = layout.fillcolor;
01461     
01462     info.framecolor = layout.framecolor;
01463     
01464     info.cursorcolor = layout.cursorcolor;
01465     
01466     info.filenamecolor = layout.filenamecolor;
01467     
01468     info.othertextcolor = layout.othertextcolor; 
01469     
01470     info.backcolor = layout.backcolor;
01471     
01472     info.statuscolor = layout.statuscolor;
01473     
01474     fontgetname (layout.filenamefont, BIGSTRING (info.filenamefont));
01475     
01476     fontgetname (layout.othertextfont, BIGSTRING (info.othertextfont));
01477     
01478     info.filenamefontsize = layout.filenamefontsize;
01479     
01480     info.othertextfontsize = layout.othertextfontsize;
01481     
01482     memtodiskshort (info.recordsize);
01483     
01484     memtodiskcolor (info.fillcolor);
01485     memtodiskcolor (info.framecolor);
01486     memtodiskcolor (info.cursorcolor);
01487     memtodiskcolor (info.filenamecolor);
01488     memtodiskcolor (info.othertextcolor);
01489     memtodiskcolor (info.backcolor);
01490     memtodiskcolor (info.statuscolor);
01491     
01492     memtodiskshort (info.filenamefontsize);
01493     memtodiskshort (info.othertextfontsize);
01494     
01495     return (enlargehandle (hpacked, sizeof (info), &info));
01496     } /*claypacklinelayout*/
01497 
01498 
01499 boolean clayunpacklinelayout (Handle hpacked, long *ixhandle, hdltableformats hf) {
01500 
01501     /*
01502     2002-11-11 AR: Added assert to make sure the C compiler chose the
01503     proper byte alignment for the tydisklinelayout struct. If it did not,
01504     we would end up corrupting any database files we saved.
01505     */
01506     
01507     tylinelayout layout;
01508     tydisklinelayout info;
01509     
01510     assert (sizeof(tydisklinelayout) == 124); /* one padding byte each after iconsize, filenamefont, and othertextfont */
01511     
01512     clearbytes (&info, sizeof (info));
01513     
01514     if (!loadfromhandle (hpacked, ixhandle, sizeof (info.recordsize), &info))
01515         return (false);
01516     
01517     disktomemshort (info.recordsize);
01518     
01519     if (!loadfromhandle (hpacked, ixhandle, min (sizeof (info), info.recordsize) - sizeof (info.recordsize), &info.claydisplay))
01520         return (false);
01521     
01522     disktomemcolor (info.fillcolor);
01523     disktomemcolor (info.framecolor);
01524     disktomemcolor (info.cursorcolor);
01525     disktomemcolor (info.filenamecolor);
01526     disktomemcolor (info.othertextcolor);
01527     disktomemcolor (info.backcolor);
01528     disktomemcolor (info.statuscolor);
01529     
01530     disktomemshort (info.filenamefontsize);
01531     disktomemshort (info.othertextfontsize);
01532     
01533     layout.flinitted = true;
01534     
01535     layout.claydisplay = (boolean) info.claydisplay;
01536     
01537     layout.realicons = (boolean) info.realicons;
01538     
01539     layout.filenamebold = (boolean) info.filenamebold;
01540     
01541     layout.includeline2 = (boolean) info.includeline2;
01542     
01543     layout.includedate = (boolean) info.includedate;
01544     
01545     layout.includeframe = (boolean) info.includeframe;
01546     
01547     layout.iconsize = (tyiconsize) info.iconsize;
01548     
01549     layout.fillcolor = info.fillcolor;
01550     
01551     layout.framecolor = info.framecolor;
01552     
01553     layout.cursorcolor = info.cursorcolor;
01554     
01555     layout.filenamecolor = info.filenamecolor;
01556     
01557     layout.othertextcolor = info.othertextcolor; 
01558     
01559     layout.backcolor = info.backcolor;
01560     
01561     layout.statuscolor = info.statuscolor;
01562     
01563     fontgetnumber (BIGSTRING (info.filenamefont), &layout.filenamefont);
01564     
01565     fontgetnumber (BIGSTRING (info.othertextfont), &layout.othertextfont);
01566     
01567     layout.filenamefontsize = info.filenamefontsize;
01568     
01569     layout.othertextfontsize = info.othertextfontsize;
01570     
01571     (**hf).linelayout = layout;
01572     
01573     return (true);
01574     } /*clayunpacklineinfo*/
01575 
01576 
01577 

Generated on Wed May 31 18:19:45 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6