clay.h

Go to the documentation of this file.
00001 
00002 /*  $Id: clay.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 #define clayinclude
00029 
00030 
00031 #include <standard.h>
00032 typedef bigstring tyfoldername;
00033 #define fastunicaseequalstrings equalidentifiers
00034 
00035 #include "op.h"
00036 #include "tableeditor.h"
00037 #include "claylinelayout.h"
00038 
00039 
00040 #define maxtablecols 3
00041 
00042 #define outlinetopinset 3
00043 #define outlinebottominset 0
00044 #define outlineleftinset 3
00045 #define outlinerightinset 0
00046 
00047 
00048 #define browserfiletype 'FSYS'
00049 #define outlinerfiletype 'OUTL'
00050 #define processlistfiletype 'PROC'
00051 #define scriptfiletype '2CLK'
00052 #define textfiletype 'TEXT'
00053 #define styledtextfiletype 'WPTX'
00054 #define msgviewerfiletype 'MSGV'
00055 #define msgeditorfiletype 'MSGE'
00056 #define bbsoutlinefiletype 'MSGO'
00057 #define messagereffiletype 'MREF'
00058 #define bookmarkfiletype 'BOOK'
00059 #define websitefiletype 'WBST'
00060 
00061 
00062 
00063 #define ctwindowtypes 7
00064     
00065 
00066 /*these macros map our names onto the app0 - app4 bits in each hdlheadrecord*/
00067     
00068     #define flnodeisfolder appbit2
00069     #define flnodeunderlined appbit3
00070     #define flnodeonscrap appbit4
00071     #define tmpbit2 appbit5
00072     #define flnodeneedsbuild appbit6
00073     #define flnewlyinsertednode appbit7
00074 
00075 
00076 #define maxicons 15 /*10/28/93 DW: used to be 5*/
00077 
00078 typedef boolean (*tygetmenucallback) (short);
00079 
00080 typedef boolean (*tyidlecallback) (short);
00081 
00082 typedef boolean (*tymenuselectcallback) (short, short);
00083 
00084 typedef boolean (*tybuttonhitcallback) (short);
00085 
00086 typedef struct tyclaystatusicon {
00087     
00088     hdlstring foldername; /*name of the icon's special folder, empty string if it's computed*/
00089     
00090     hdlstring helpstring; /*displayed in message area when icon is activated*/
00091     
00092     hdlstring buttontext; /*if it's a text button, this is the text inside the button*/
00093     
00094     Rect iconrect; /*the rectangle that the icon occupies*/
00095     
00096     short iconresnum; /*the resource id of the icon family*/
00097     
00098     MenuHandle hmenu; /*nil if icon has no popup*/
00099     
00100     boolean flpopup; /*if true, mouse click pops up a menu*/
00101     
00102     boolean flsingleclickpopup; /*if true, user must hold down mouse to get popup*/
00103     
00104     boolean fldisposemenu; /*if true, we dispose of the menu handle after running it*/
00105     
00106     boolean flbreakafter; /*start a new subgroup after this icon*/
00107     
00108     boolean fltextbutton; /*if true it's a text button, otherwise it's an icon*/
00109     
00110     boolean flnofolder; /*if true, the icon doesn't have a related sub-folder in the Prefs folder*/
00111     
00112     boolean fltoggles; /*if true, the icon toggles pressed and not pressed. effects interaction, a little*/
00113     
00114     boolean flpressed; /*if true, we display the button in its pressed state*/
00115     
00116     boolean fldisabled; /*if true, the button is disabled*/
00117     
00118     boolean flcustomrect; /*if true, we don't compute the icon's rect*/
00119     
00120     short idpopupmenu; /*the resource id of the popup menu*/
00121     
00122     tygetmenucallback getmenucallback;
00123     
00124     tymenuselectcallback menuselectcallback;
00125     
00126     tybuttonhitcallback buttonhitcallback;
00127     
00128     tyidlecallback idlecallback;
00129     
00130     long refcon; /*some icons want to keep their own data around*/
00131     } tyclaystatusicon;
00132     
00133 
00134 typedef boolean (*tyclaycallback) (void);
00135 
00136 typedef boolean (*tyoutlinecallback) (hdloutlinerecord);
00137 
00138 typedef boolean (*tyshortstarcallback) (short *);
00139 
00140 typedef boolean (*tymenuhitcallback) (short, short);
00141 
00142 
00143 typedef struct tyclaydata { /*one of these for every window that's open*/
00144     
00145     hdlhashtable htable; // the parent table we are displaying
00146     
00147     hdloutlinerecord houtline; // the outline viewing the table
00148     
00149     hdltableformats hformats;
00150     
00151     tylinelayout linelayout; 
00152     
00153     tycomputedlineinfo computedlineinfo;
00154     
00155     short ctcols;
00156     
00157     short colwidths [maxtablecols];
00158     
00159     short maxwidths [maxtablecols];
00160     
00161     short cticons; /*the number of icons in the status bar of this window*/
00162     
00163     /*start tyextrainfo*/
00164     
00165     Rect wholerect; /*the union of all rects that make up the table display*/
00166     
00167     Rect tablerect; /*the rectangle that the table is displayed in*/
00168     
00169     Rect titlerect; /*where the column titles are stored*/
00170     
00171     Rect seprect; /*the area separating the table display from the titles*/
00172     
00173     Rect iconrect;
00174     
00175     Rect kindpopuprect;
00176     
00177     Rect sortpopuprect;
00178     
00179     short focuscol;
00180     
00181     short editcol; /*zero-based col when in text mode*/
00182     
00183     Handle editval; /*when editing a value, the original text*/
00184     
00185     hdlheadrecord editnode; /*the node being edited*/
00186     
00187     short ixicontitle; /*stringlist index of icon title*/
00188     
00189     /*end tyextrainfo*/
00190     
00191     boolean fliconenabled: 1; /*show the icon dimmed or not dimmed*/
00192     
00193     boolean flautocreated: 1; /*we're editing a auto-created value*/
00194     
00195     boolean fltexticons; /*we do different button alignment for these windows*/
00196     
00197     boolean flwindowsicons; /*the icons look like those used in Microsoft Windows apps*/
00198     
00199     boolean fluseslinelayout; /*uses claylinelayout.c routines to draw the outline*/
00200     
00201     boolean flfilebrowser; /*it's an outliner used to browse nodes which are files*/
00202     
00203     tyclaystatusicon iconarray [maxicons];
00204     
00205     hdlheadrecord lastbarcursor; /*so we can detect motion*/
00206     
00207     boolean flresetinfowindows; /*if true, force a reload of the info windows*/
00208     
00209     boolean iconhighlighted; /*draw the icon as if it were selected*/
00210     
00211     boolean flbitmap; /*true if an offscreen bitmap is open*/
00212     
00213     boolean forkedwindow; /*if true it's a fork off another window*/
00214     
00215     boolean immediatesystemidle; /*set true as the window is activated*/
00216     
00217     boolean processingscriptevent; /*don't allow user events to break the idle handler*/
00218     
00219     boolean eraseonupdate; /*true until the next update event is handled*/
00220     
00221     boolean fljumponidle;
00222     
00223     tyclaycallback keystrokecallback;
00224     
00225     tyclaycallback idlecallback;
00226     
00227     tyoutlinecallback exportscrapcallback;
00228     
00229     tyclaycallback initstatusbarcallback;
00230     
00231     tyshortstarcallback getstatusbarwidthcallback;
00232     
00233     tyclaycallback drawstatusbarcallback;
00234     
00235     tyclaycallback setcustomrectscallback;
00236     
00237     tyclaycallback statusclickcallback;
00238     
00239     tyclaycallback cursorinstatusbarcallback;
00240     
00241     tymenuhitcallback menuhitcallback;
00242     
00243     tyclaycallback beforeclosewindowcallback;
00244     
00245     tyclaycallback handleverbcallback, handlefastverbcallback;
00246     
00247     Handle hmoredata; /*non-outline data handle*/
00248     } tyclaydata, **hdlclaydata;
00249     
00250     
00251     
00252 
00253 boolean claybrowserkeystroke (void); /*used by browser & process windows*/
00254 
00255 //boolean claypushwindowglobals (tywindowtype, boolean);
00256 
00257 void claypopwindowglobals (void);
00258 
00259 //boolean clayfindwindow (tywindowtype, boolean, hdlwindowinfo *);
00260 
00261 short claymsgclick (short, short);
00262 
00263 void clayidleanalysis (boolean *, boolean *, boolean *);
00264 
00265 void clayidleforall (void);
00266 
00267 boolean claygetfrontwindow (hdlwindowinfo *);
00268 
00269 boolean claygetfrontoutline (hdloutlinerecord *);
00270 
00271 boolean claywindowcontainsoutline (hdlclaydata);
00272 
00273 boolean clayfrontwindowcontainsoutline (void);
00274 
00275 boolean clayopendoc (FSSpec *);
00276 
00277 boolean claypushpopupitem (short, bigstring, boolean);
00278 
00279 boolean claynewappwindow (OSType);

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