wpengine.h

Go to the documentation of this file.
00001 
00002 /*  $Id: wpengine.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 wpengineinclude /*so other includes can tell if we've been loaded*/
00029 
00030 
00031 
00032 
00033 #ifndef shellinclude
00034 
00035     #include "shell.h"
00036 
00037 #endif
00038 
00039 
00040 #ifndef dbinclude
00041 
00042     #include "db.h"
00043 
00044 #endif
00045 
00046 typedef struct tywprecord *ptrwprecord, **hdlwprecord; /* forward declaration */
00047 
00048 #if !TARGET_CARBON
00049 #if GENERATINGCFM
00050         typedef UniversalProcPtr TrackClickUPP;
00051         
00052         enum {
00053             uppTrackClickProcInfo = kPascalStackBased
00054                     | RESULT_SIZE(kNoByteCode)
00055                     | STACK_ROUTINE_PARAMETER(1, kFourByteCode)
00056                     | STACK_ROUTINE_PARAMETER(2, kFourByteCode)
00057         };
00058         
00059         #define NewTrackClickProc(userRoutine)      \
00060                 (TrackClickUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTrackClickProcInfo, GetCurrentArchitecture())
00061         
00062         #define CallTrackClickProc(userRoutine, wp, pt)     \
00063                 CallUniversalProc((UniversalProcPtr)(userRoutine), uppTrackClickProcInfo, wp, pt)
00064     #else
00065         typedef pascal void (*TrackClickProcPtr) (hdlwprecord, Point);
00066         
00067         typedef TrackClickProcPtr TrackClickUPP;
00068         
00069         #define NewTrackClickProc(userRoutine)      \
00070                 ((TrackClickUPP) (userRoutine))
00071         
00072         #define CallTrackClickProc(userRoutine, wp, pt)     \
00073                 (*(userRoutine))(wp, pt)
00074 #endif
00075 #else //TARGET CARBON Timothy Paustian
00076         typedef pascal void (*TrackClickProcPtr) (hdlwprecord, Point);
00077         
00078         typedef TrackClickProcPtr TrackClickUPP;
00079         /*this ain't used.
00080         #define NewTrackClickProc(userRoutine)      \
00081             ((TrackClickUPP) (userRoutine))
00082         */
00083         
00084         #define CallTrackClickProc(userRoutine, wp, pt)     \
00085                 ((userRoutine))(wp, pt)
00086 #endif
00087 
00088 typedef void (*wpvoidcallback) (void);
00089 
00090 
00091 #define wpnoflags       0
00092 #define wponeline       0x0001
00093 #define wpneverscroll   0x0002
00094 #define wpalwaysmeasure 0x0004
00095 #define wpprinting      0x0008
00096 
00097 
00098 typedef unsigned long tywpflags;
00099 
00100 
00101 typedef struct tywprecord {
00102     
00103     void * wpbuffer; /*really as WSHandle; untyped here to avoid includes*/
00104     
00105     long startsel, endsel; /*beginning and end of selection*/
00106     
00107     tyscrollinfo vertscrollinfo; /*vertical scrollbar info*/
00108     
00109     tyscrollinfo horizscrollinfo; /*horiz scrollbar info*/
00110     
00111     long ctsaves; /*the number of times this structure has been saved to disk*/
00112     
00113     long timelastsave, timecreated; 
00114     
00115     dbaddress adr; /*where this edit record came from in the database*/
00116     
00117     hdlstring hname; /*the name of this edit record*/
00118     
00119     Rect wprect; /*area of window that wp is displayed in*/
00120     
00121     Rect windowrect; /*the size and position of window that last displayed wp doc*/
00122     
00123     long printpos; /*current character position during printing*/
00124     
00125     void * hlastundodata; /*for tricky typing undo*/
00126     
00127     short hpixels, vpixels; //in outlines, we keep track of wp dimensions
00128     
00129     TrackClickUPP trackclickroutine; /*must be declared pascal void*/
00130     
00131     wpvoidcallback dirtyroutine; /*text has changed*/
00132     
00133     callback preeditroutine; /*called before every edit*/
00134     
00135     wpvoidcallback posteditroutine; /*called after every edit*/
00136     
00137     wpvoidcallback setscrollbarsroutine; /*usually links scrollbars to windowinfo*/
00138     
00139     long wprefcon; /*for use by application*/
00140     
00141     boolean fldirty; /*has the structure been changed since last save?*/
00142     
00143     boolean fldirtyview; /*did user change view: scroll, cursor, or window position?*/
00144     
00145     boolean fllocked; /*are changes allowed to be made?*/
00146     
00147     boolean floneline; /*true if this is a single-line, false otherwise*/
00148     
00149     boolean fltextchanged; /*on last edit operation, did text change?*/
00150     
00151     boolean flwindowopen; /*is it being displayed in a window?*/
00152     
00153     boolean flstartedtyping; /*has user started typing at this position?*/
00154     
00155     boolean flshowruler; /*visible ruler?*/
00156     
00157     boolean flinhibitdisplay; /*inhibit display? -- not saved to disk*/
00158     
00159     boolean flexpandvariables; /*expand variables into text?*/
00160     
00161     boolean flhilitevariables; /*show visual indication of variable text?*/
00162     
00163     boolean flprinting; /*printing currently in progress?*/
00164     
00165     boolean flneverscroll; /*defaults to false; set true if client does all scrolling*/
00166     
00167     boolean flcheckvisi; /*so we can defer visiing*/
00168     
00169     boolean flalwaysmeasuretext; //keep track of text's width or height?
00170     
00171     boolean fleditingnow; //between pre- and postedit?
00172     } tywprecord;
00173 
00174 
00175 extern WindowPtr wpwindow;
00176 
00177 extern hdlwprecord wpdata;
00178 
00179 extern hdlwindowinfo wpwindowinfo;
00180 
00181 extern boolean flwperror; /*true if there was an error reported by wp-engine*/
00182 
00183 
00184 /*function prototypes*/
00185 
00186 extern boolean wppushdata (hdlwprecord);
00187 
00188 extern boolean wppopdata (void);
00189 
00190 extern boolean wpinit (void);
00191 
00192 extern void wpshutdown (void);
00193 
00194 extern boolean wpgetruler (void);
00195 
00196 extern boolean wpsetruler (boolean);
00197 
00198 extern hdlwprecord wpnewbuffer (Handle, const Rect *, const Rect *, tywpflags, boolean);
00199 
00200 extern boolean wpnewrecord (Rect, hdlwprecord *);
00201 
00202 extern void wpsetupwindow (void);
00203 
00204 extern boolean wpsetbufferrect (Rect, Rect);
00205 
00206 extern boolean wphidecursor (void);
00207 
00208 extern boolean wppack (Handle *);
00209 
00210 extern boolean wpunpack (Handle, hdlwprecord *);
00211 
00212 extern boolean wpscroll (tydirection, boolean, long);
00213 
00214 extern void wpresetscrollbars (void);
00215 
00216 extern void wpdisposerecord (hdlwprecord);
00217 
00218 extern void wpdispose (void);
00219 
00220 extern boolean wpsetname (bigstring);
00221 
00222 extern boolean wptotalrecalc (void);
00223 
00224 extern boolean wpgetdisplay (void);
00225 
00226 extern boolean wpsetdisplay (boolean);
00227 
00228 extern void wpresize (void);
00229 
00230 extern boolean wpkeystroke (void);
00231 
00232 extern boolean wpgo (tydirection, long);
00233 
00234 extern void wpclick (Point, tyclickflags);
00235 
00236 extern void wpactivate (boolean);
00237 
00238 extern void wpupdate (void);
00239 
00240 extern void wpidle (void);
00241 
00242 extern boolean wpadjustcursor (Point);
00243 
00244 extern boolean wpundo (void);
00245 
00246 extern boolean wpscraphook (Handle);
00247 
00248 extern boolean wpcut (void);
00249 
00250 extern boolean wpcopy (void);
00251 
00252 extern boolean wppaste (boolean);
00253 
00254 extern boolean wpclear (void);
00255 
00256 extern boolean wpinserthandle (Handle);
00257 
00258 extern boolean wpinsert (bigstring);
00259 
00260 extern boolean wpsetselection (long, long);
00261 
00262 extern boolean wpgetselection (long *, long *);
00263 
00264 extern boolean wpgetselrect (Rect *);
00265 
00266 extern boolean wpgetselpoint (Point *);
00267 
00268 extern boolean wpsetselpoint (Point);
00269 
00270 extern boolean wpselectword (void);
00271 
00272 extern boolean wpselectline (void);
00273 
00274 extern boolean wpselectpara (void);
00275 
00276 extern boolean wpselectall (void);
00277 
00278 extern boolean wpsetfont (void);
00279 
00280 extern boolean wpsetsize (void);
00281 
00282 extern boolean wpsetstyle (void);
00283 
00284 extern boolean wpsetleading (void);
00285 
00286 extern boolean wpsetjustify (void);
00287 
00288 extern boolean wpgetmaxpos (long *);
00289 
00290 extern boolean wpsetselectioninfo (void);
00291 
00292 extern boolean wpgettexthandle (Handle *);
00293 
00294 extern boolean wpgettext (bigstring, long *);
00295 
00296 extern boolean wpgetseltexthandle (Handle *);
00297 
00298 extern boolean wpgetseltext (bigstring);
00299 
00300 extern boolean wpsettexthandle (Handle);
00301 
00302 extern boolean wpsettext (bigstring);
00303 
00304 extern short wpavailwidth (void);
00305 
00306 extern boolean wppagesetup (void);
00307 
00308 extern boolean wpsetprintinfo (void);
00309 
00310 extern boolean wpbeginprint (void);
00311 
00312 extern boolean wpendprint (void);
00313 
00314 extern boolean wpprint (short);
00315 
00316 
00317 /*these verbs are for setting formats that aren't supported by tywindowinfo*/
00318 
00319 extern boolean wpgetindent (short *);
00320 
00321 extern boolean wpsetindent (short);
00322 
00323 extern boolean wpgetleftmargin (short *);
00324 
00325 extern boolean wpsetleftmargin (short);
00326 
00327 extern boolean wpgetrightmargin (short *);
00328 
00329 extern boolean wpsetrightmargin (short);
00330 
00331 extern boolean wpsettab (short, short, byte);
00332 
00333 extern boolean wpcleartabs (void);
00334 
00335 /*end non-windowinfo format settings*/
00336 
00337 
00338 extern boolean wpgetcontentsize (long *, long *);
00339 
00340 extern boolean wpmeasuretext (Handle, Rect *, tywpflags);
00341 
00342 extern boolean wpdrawtext (Handle, const Rect *, const Rect *, tywpflags);
00343 
00344 extern boolean wpsearch (boolean, boolean, boolean, boolean);
00345 
00346 extern boolean wpreadfromtextfile (bigstring);
00347 
00348 extern boolean wpwritetotextfile (bigstring);
00349 
00350 
00351 /*HTML wizzy functions.*/
00352 
00353 extern boolean wptraversehiddentext (tydirection dir, long *);
00354 
00355 extern boolean wptrimhiddentext (void);

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