tableformats.h

Go to the documentation of this file.
00001 
00002 /*  $Id: tableformats.h 355 2005-01-11 22:48:55Z andreradke $    */
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 #ifndef tableformatsinclude
00029 #define tableformatsinclude
00030 
00031 
00032 #ifndef shellinclude
00033 
00034     #include "shell.h"
00035 
00036 #endif
00037 
00038 
00039 #ifndef langinclude
00040 
00041     #include "lang.h"
00042 
00043 #endif
00044 
00045 #ifndef opinclude
00046 
00047     #include "op.h"
00048 
00049 #endif
00050 
00051 #ifndef claylinelayoutinclude
00052 
00053     #include "claylinelayout.h"
00054 
00055 #endif
00056 
00057 #include "tabledisplay.h"
00058 
00059 
00060 
00061 #define maxtablecols 3
00062 
00063 typedef struct tytableformats { /*one of these for every window that's open*/
00064     
00065     hdlhashtable htable; // the parent table we are displaying
00066     
00067     hdloutlinerecord houtline; // the outline viewing the table
00068     
00069     short fontnum, fontsize, fontstyle; // only meaningful when outline was not saved and hasn't been recreated
00070     
00071     long lnumcursor; // ditto
00072     
00073     long vertcurrent; // ditto
00074     
00075     short ctcols;
00076     
00077     short defaultcolwidth;
00078     
00079     short colwidths [maxtablecols];
00080     
00081     short maxwidths [maxtablecols];
00082     
00083     Rect windowrect; /*the position & size of window last time table was packed*/
00084     
00085     Rect wholerect; /*the union of all rects that make up the table display*/
00086     
00087     Rect tablerect; /*the rectangle that the table is displayed in*/
00088     
00089     Rect titlerect; /*where the column titles are stored*/
00090     
00091     Rect iconrect;
00092     
00093     Rect kindpopuprect;
00094     
00095     Rect sortpopuprect;
00096     
00097     short sorttitlecol; /*the column that is underlined as the current sort*/
00098     
00099     short focuscol;
00100     
00101     short editcol; /*zero-based col when in text mode*/
00102     
00103     short undocol; /*column that last had it's undoglobals set*/
00104     
00105     Handle editval; /*when editing a value, the original text*/
00106     
00107     hdlheadrecord editnode; /*the node being edited*/
00108     
00109     hdlheadrecord lastbarcursor; /*so we can detect motion*/
00110     
00111     tylinelayout linelayout;
00112     
00113     tycomputedlineinfo computedlineinfo;
00114     
00115     boolean fliconenabled: 1; /*show the icon dimmed or not dimmed*/
00116     
00117     boolean fldirty; /*any changes made that aren't saved?*/
00118     
00119     boolean flactive;
00120     
00121     boolean flwindowsicons; /*the icons look like those used in Microsoft Windows apps*/
00122     
00123     boolean flneedresort; /*table needs to be resorted (after unpacking)*/
00124     
00125     boolean flprinting;
00126     
00127     long refcon;
00128     } tytableformats, *ptrtableformats, **hdltableformats;
00129 
00130 
00131 /* This is an old version structure used only for conversion purposes*/
00132 
00133 typedef struct tyversion1tablediskrecord { /*packed version of tableformats, suitable for disk storage*/
00134 
00135     short versionnumber; /*this record is stored on disk*/
00136     
00137     short rowcursor, colcursor; /*locates the cursor*/
00138     
00139     short ctrows, ctcols; /*dimensions of the list record*/
00140     
00141     /*in v1 fontgarbage used to store the font number -- this was a mistake!*/
00142     
00143     short fontgarbage, fontsize, fontstyle; /*the display fontsizestyle*/
00144     
00145 #ifdef MACVERSION
00146     tylinespacing linespacing;
00147 #endif
00148 #ifdef WIN95VERSION
00149     short linespacing;
00150 #endif
00151     
00152     short vertmin, vertmax, vertcurrent; /*values for the scrollbars*/
00153     
00154     short horizmin, horizmax, horizcurrent; /*values for the scrollbars*/
00155     
00156     long timecreated, timelastsave; /*maybe we'll use these at some later date?*/
00157     
00158     long ctsaves; /*the number of times this structure has been saved*/
00159     
00160     long sizerowarray, sizecolarray; /*sizes of two arrays stored at end of disk record*/
00161     
00162 #ifdef version42orgreater
00163     short flags;
00164 #else
00165     unsigned short fleditingcell: 1;
00166     
00167     unsigned short flgridlines: 1;
00168     
00169     unsigned short flrowsizingenabled: 1; /*if true, user is allowed to resize row heights*/
00170     
00171     unsigned short flcolsizingenabled: 1; /*if true, user is allowed to resize column widths*/
00172     
00173     unsigned short flbarcursor: 1; /*if true, cursor is the current row, not just current cell*/
00174     
00175     unsigned short flgrayoffbottom: 1; /*ditto, off the bottom of real cells*/
00176     
00177     unsigned short flautorowheight: 1; /*recalc all row heights after font/size change*/
00178     
00179     unsigned short flcoltitles: 1; /*if turned on, leave room for column titles*/
00180 #endif
00181 
00182     diskfontstring fontname; /*a bit of Mac culture, font specified by a string, not a number*/
00183 
00184 #ifdef version42orgreater
00185     unsigned short flags2;
00186 #else   
00187     unsigned short flcenterifpossible: 1; /*center the table, otherwise flush with top & left*/
00188     
00189     unsigned short flsavedsorted: 1; /*if true, version is recent enough to retain sort*/
00190 #endif
00191 
00192     diskrect windowrect; /*the position & size of window last time table was packed*/
00193     
00194     short sortorder; /*up to the application to understand what this means*/
00195     
00196     char growtharea [20];
00197     
00198     /*the variable-length intarrays are tacked on at the end of this record*/
00199     } tyversion1tablediskrecord, *ptrversion1tablediskrecord, **hdlversion1tablediskrecord;
00200     
00201 
00202 typedef struct tyversion2tablediskrecord { /*packed version of tableformats, suitable for disk storage*/
00203     
00204     short versionnumber; /*this record is stored on disk*/
00205     
00206     short recordsize;
00207     
00208     diskfontstring fontname; // only meaningful when outline was not saved and hasn't been recreated
00209     
00210     short fontsize, fontstyle; // ditto
00211     
00212     short lnumcursor; // ditto
00213     
00214     short vertcurrent; // ditto
00215     
00216     short ctcols; /*dimensions of the list record*/
00217     
00218     short colcursor; /*locates the cursor*/
00219     
00220     short colwidths [maxtablecols];
00221     
00222     diskrect windowrect; /*the position & size of window last time table was packed*/
00223     
00224     boolean savedoutline; /*is an outline packed along with this record? (only if expanded)*/
00225     
00226     boolean savedlinelayout; //is a clay linelayout packed along with this record?
00227     
00228     short lnumcursor_hiword; //5.1.3
00229     
00230     short vertcurrent_hiword; //5.1.3
00231     
00232     short growtharea [8];
00233     } tyversion2tablediskrecord, *ptrversion2tablediskrecord, **hdlversion2tablediskrecord;
00234     
00235 
00236 /*globals*/
00237     
00238 extern WindowPtr tableformatswindow; 
00239 
00240 extern hdltableformats tableformatsdata; 
00241 
00242 extern hdlwindowinfo tableformatswindowinfo; 
00243 
00244 
00245 /*prototypes*/
00246 
00247 extern boolean tablepushformats (hdltableformats);
00248 
00249 extern boolean tablepopformats (void);
00250 
00251 extern void tabledirty (void);
00252 
00253 extern short tablegetcolwidth (short);
00254 
00255 extern boolean tablesetcolwidth (short, short, boolean);
00256 
00257 extern short tablesumcolwidths (short, short);
00258 
00259 extern short tabletotalcolwidths (void);
00260 
00261 extern short tableavailwidth (void);
00262 
00263 extern boolean tablerecalccolwidths (boolean);
00264 
00265 extern boolean newtableformats (hdltableformats *);
00266 
00267 extern void disposetableformats (hdltableformats);
00268 
00269 extern boolean tablenewformatsrecord (hdlhashtable, Rect, hdltableformats *);
00270 
00271 extern boolean tableprepareoutline (hdltableformats);
00272 
00273 extern boolean tablepackformats (Handle *);
00274 
00275 extern boolean tableunpackformats (Handle, hdltableformats);
00276 
00277 extern void tabledisposeoutline (hdltableformats);
00278 
00279 extern boolean tableoutlineneedssaving (void);
00280 
00281 #endif
00282 
00283 

Generated on Wed May 31 18:20:02 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6