HOOPS/3dGS I.M. Interface

     << Back      Full Index      Forward >>


please.h

00001 /*
00002  * Copyright (c) 1998 by Tech Soft 3D, LLC.
00003  * The information contained herein is confidential and proprietary to
00004  * Tech Soft 3D, LLC., and considered a trade secret as defined under
00005  * civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006  * and criminal remedies in the event of unauthorized use or misappropriation
00007  * of its trade secrets.  Use of this information by anyone other than
00008  * authorized employees of Tech Soft 3D, LLC. is granted only under a
00009  * written non-disclosure agreement, expressly prescribing the scope and
00010  * manner of such use.
00011  *
00012  * $Id: please_8h-source.html,v 1.29 2008-03-10 07:09:28 stage Exp $
00013  */
00014 
00015 #ifndef PLEASE_DEFINED
00016 
00017 /* HT_Driver Flags */
00018 #define  D_ALIVE                        (HT_Driver_Flags)0x0001
00019 #define  D_DEAD                         (HT_Driver_Flags)0x0002
00020 #define  D_EVENTS_ARE_ENABLED           (HT_Driver_Flags)0x0004
00021 #define  D_UPDATE_EVENTS_NEEDED         (HT_Driver_Flags)0x0008
00022 #define  D_CAN_AWAIT_EVENTS             (HT_Driver_Flags)0x0010
00023 #define  D_HAS_DISPLAY_LIST             (HT_Driver_Flags)0x0020
00024 #define  D_HAS_CURSOR                   (HT_Driver_Flags)0x0040
00025 #define  D_HAS_AUTO_CURSOR              (HT_Driver_Flags)0x0080
00026 #define  D_HAS_LOCATER                  (HT_Driver_Flags)0x0100
00027 #define  D_HAS_KEYBOARD                 (HT_Driver_Flags)0x0200
00028 #define  D_HAS_WAKEUP                   (HT_Driver_Flags)0x0400
00029 #define  D_HAS_DISPLAY                  (HT_Driver_Flags)0x0800
00030 #define  D_HAS_DEVICES                  (HT_Driver_Flags)0x0F00
00031 #define  D_OMNIPOTENT                   (HT_Driver_Flags)0x0FF0
00032 #define  D_BUTTONS_WERE_CHANGED         (HT_Driver_Flags)0x1000
00033 #define  D_VALUATORS_WERE_CHANGED       (HT_Driver_Flags)0x2000
00034 #define  D_MIGHT_GET_EXPOSURES          (HT_Driver_Flags)0x4000
00035 #define  D_ACTIVE                       (HT_Driver_Flags)0x8000
00036 
00037 /* Locater Actions */
00038 #define  LA_UP          (HT_Locater_Actions)0x01
00039 #define  LA_DOWN        (HT_Locater_Actions)0x02
00040 #define  LA_STILL_UP    (HT_Locater_Actions)0x04
00041 #define  LA_STILL_DOWN  (HT_Locater_Actions)0x08
00042 #define  LA_ALL_KINDS   (HT_Locater_Actions)0x0F
00043 
00044 
00045 /* pleezes (requests of the driver) */
00046 #define  PLEASE_INITIALIZE             0
00047 #define  PLEASE_FINISH                 1
00048 #define  PLEASE_UPDATE_DISPLAY_LIST    2
00049 #define  PLEASE_UPDATE_DISPLAY         3
00050 #define  PLEASE_DECLARE                4
00051 #define  PLEASE_FREE                   5
00052 #define  PLEASE_POLL_KEYBOARD          6
00053 #define  PLEASE_POLL_LOCATER           7
00054 #define  PLEASE_AWAIT_EVENTS           8
00055 #define  PLEASE_SELECT                 9
00056 
00057 #define  PLEASE_ENABLE_UP              10
00058 #define  PLEASE_DISABLE_UP             11
00059 #define  PLEASE_ENABLE_DOWN            12
00060 #define  PLEASE_DISABLE_DOWN           13
00061 #define  PLEASE_ENABLE_STILL_UP        14
00062 #define  PLEASE_DISABLE_STILL_UP       15
00063 #define  PLEASE_ENABLE_STILL_DOWN      16
00064 #define  PLEASE_DISABLE_STILL_DOWN     17
00065 #define  PLEASE_ENABLE_KEYBOARD        18
00066 #define  PLEASE_DISABLE_KEYBOARD       19
00067 #define  PLEASE_ENABLE_WAKEUP          20
00068 #define  PLEASE_DISABLE_WAKEUP         21
00069 #define  PLEASE_ENABLE_CURSOR          22
00070 #define  PLEASE_DISABLE_CURSOR         23
00071 #define  PLEASE_MOVE_CURSOR            24
00072 #define  PLEASE_ENABLE_AUTO_CURSOR     25
00073 #define  PLEASE_DISABLE_AUTO_CURSOR    26
00074 
00075 #define  PLEASE_CAN_YOU_AWAIT          27
00076 #define  PLEASE_REENABLE_KEYBOARD      28
00077 #define  PLEASE_GATHER_DEVICE_INFO     29
00078 #define  PLEASE_FLUSH_EVENTS           30
00079 
00080 #define  PLEASE_CHECK_FOR_EXPOSURES     31
00081 #define  PLEASE_GATHER_FONT_NAMES       32
00082 #define  PLEASE_GATHER_FONT_INFO        33
00083 #define  PLEASE_GATHER_WINDOW_EXTENT    34
00084 
00085 #define  PLEASE_VALIDATE_SELECTABILITY  35
00086 #define  PLEASE_DESTROY_DISPLAY_LIST    36
00087 
00088 #define  PLEASE_GATHER_SCREEN_EXTENT    37
00089 #define  PLEASE_DESTROY_OCCLUSION_QUERY 38
00090 
00091 #define  PLEASE_SHOW_IMAGE_DATA         39
00092 
00093 /*
00094     PLEASE_DECLARE
00095     Called at Set_Driver time; the driver should do things that
00096     need to be done extremely early, like defining new HT_Driver Options.
00097     The driver should NOT do anything to a device yet.
00098 
00099     The return status is ignored.
00100 
00101     PLEASE_INITIALIZE
00102     Called at the first Update for the driver. The driver should
00103     allocate memory and initialize the device.
00104 
00105     If the return status is False then the driver will be marked
00106     dead and will not be called again (except for PLEASE_FREE).
00107 
00108     PLEASE_UPDATE_DISPLAY_LIST
00109     If the driver needs to do anything in response to a structural
00110     change in the database, it should do it here. This is independent
00111     of whether the database change implies a display change.
00112 
00113     If the return is False, this request will not be made of the
00114     driver again.
00115 
00116     PLEASE_UPDATE_DISPLAY
00117     The driver will do whatever it takes to bring the screen display
00118     up to date.
00119 
00120     If the return is False, this request will not be made again nor
00121     will any cursor request be made.
00122 
00123     PLEASE_FINISH
00124     The driver should shut down the display. May be called from
00125     Reset_System, and so freeing memory may not be a good idea.
00126 
00127     The return status is ignored.
00128 
00129     PLEASE_FREE
00130     Occurs when the last traces of the particular driver are removed
00131     from the database, if driver_data is not null. The driver should
00132     free all its memory and return.
00133 
00134     The return status is ignored.
00135 
00136     PLEASE_AWAIT_EVENTS
00137     The driver, if it able, should wait for at least one of the enabled
00138     input or wakeup events to occur, and should queue it appropriately.
00139     If more than one occurs simultaneously, the rest should be queued
00140     too.
00141 
00142 
00143     The driver should return False to indicate that it can't wait on
00144     the particular set of events currently enabled.
00145 
00146     PLEASE_POLL
00147     The driver should check the enabled input for devices, and ask for
00148     events to be queued appropriately.
00149 
00150         For PLEASE_AWAIT_EVENTS and PLEASE_POLL, the driver can get away
00151         with queueing "STILL_DOWN" events even if they really should be
00152         "DOWN" events: the Queue_Location_Event routine will observe
00153         what's going on. Likewise for STILL_UP and UP.
00154 
00155     This function will only be called if input devices have previously
00156     been successfully enabled. It must return True.
00157 
00158     PLEASE_SELECT
00159     The driver should find a partially filled-in "Selection_Event"
00160     structure pointed to by the "please_parameter", and should do
00161     a Hit-Test.
00162 
00163     If something is successfully selected, the HT_Selection_Event
00164     structure should be completed and the return status should
00165     be True. (The caller will actually queue the event.)
00166 
00167     PLEASE_ENABLE_UP - PLEASE_DISABLE_UP
00168     PLEASE_ENABLE_DOWN - PLEASE_DISABLE_DOWN
00169     PLEASE_ENABLE_STILL_UP - PLEASE_DISABLE_STILL_UP
00170     PLEASE_ENABLE_STILL_DOWN - PLEASE_DISABLE_STILL_DOWN
00171     PLEASE_ENABLE_KEYBOARD - PLEASE_DISABLE_KEYBOARD
00172          The driver should start/stop thinking about generating events of
00173          the specified types. (Attempting to queue non-enabled events does
00174          not actually hurt anything though.) The actual event checking and
00175          queueing will occur on subsequent PLEASE_AWAIT_EVENTS or
00176          PLEASE_POLL requests.
00177 
00178     If the return status should be False if the driver does not have
00179     any device of the appropriate type.
00180 
00181     PLEASE_ENABLE_WAKEUP - PLEASE_DISABLE_WAKEUP
00182     Besides checking on regular input devices, the driver can check
00183     on wakeups. The next wakeup expiration is indicated by the wakeup
00184     on the front of OUR (wakeup_list). If a driver does NOT do wakeups
00185     and the user requests a wakeup, then the driver will end up being
00186     polled.   (The driver will also end up being polled if input is
00187     enabled from two or more drivers, no matter what the wakeup
00188     abilities.)
00189 
00190     A False return indicates no ability to do wakeups.
00191 
00192     PLEASE_ENABLE_AUTO_CURSOR - PLEASE_DISABLE_AUTO_CURSOR
00193     The driver should start/stop tracking a cursor automatically on its
00194     screen in synch with its own locater device.
00195 
00196     If the return is False, the driver cannot track its cursor itself.
00197 
00198     PLEASE_ENABLE_CURSOR - PLEASE_DISABLE_CURSOR
00199     The driver should get ready to receive cursor coordinates coming
00200     from somewhere else.
00201 
00202     If the driver return False, then no cursor is possible (the user
00203     is warned) and no selection requests will occur.
00204 
00205     PLEASE_MOVE_CURSOR
00206     The driver should actually update the previously-enabled soft
00207     cursor. The relevant numbers are in a HT_Location_Event structure
00208     pointed to by please_parameter.
00209 
00210     The return must be True.
00211 
00212     PLEASE_CHECK_FOR_EXPOSURES
00213     The window-system driver should check for window-system exposure,
00214     move, resize, etc events, and call the appropriate HD_ routines.
00215 
00216     The False is returned, the system is not a window system or there
00217     is no need to check for exposures.
00218 
00219     PLEASE_VALIDATE_SELECTABILITY
00220     There has been some change which has not been processed through
00221     a normal update.  In case this is a change in selectability, we
00222     may need to make sure correct selectability is known before
00223     processing a selection.
00224 
00225     The return should always be True.
00226 
00227     PLEASE_DESTROY_DISPLAY_LIST
00228     Requests that the driver destroy the specified display list.
00229 
00230     The return should always be True.
00231 
00232     PLEASE_SHOW_IMAGE_DATA
00233     Requests that the driver write its GPU copy of image data into
00234     the data pointer of an HT_Image (for example, so that it can be 
00235     shown and/or written to a file.
00236 
00237     The return should always be True.
00238 */
00239 
00240 /* return value from driver indicates whether it was able to accommodate
00241    the request. */
00242 
00243 /* note: various Ascii-machine drivers assume that the definitions
00244      up to and including 'RUBOUT_KEY' are in the usual Ascii order.
00245  */
00246 
00247 
00248 /* NOTE: enables for function-type keys are referenced as
00249          256+(CODE&0xFF).  There is currently no enable mechanism
00250          for keys other than function & ASCII
00251 */
00252 
00253 #define ENABLEINDEX(code)   (((code)&0xFF00)==0x8000?0x0100|((code)&0x00FF)\
00254                                  :(code)&0xFF00?0:(code))
00255 
00256 #   define    FIRST_KEY           0
00257 #   define    FIRST_CONTROL_KEY   (HT_Button)0
00258 #   define    LAST_CONTROL_KEY    (HT_Button)31
00259 #   define    FIRST_PRINTING_KEY  (HT_Button)32 /* include space */
00260 #   define    LAST_PRINTING_KEY   (HT_Button)126
00261 #   define    RUBOUT_KEY          (HT_Button)127
00262 #   define    FIRST_PRINTING_KEY2 (HT_Button)161
00263 #   define    LAST_PRINTING_KEY2  (HT_Button)255
00264 
00265 #   define    FIRST_ARROW_KEY     LEFT_ARROW_KEY
00266 #   define    LEFT_ARROW_KEY      (HT_Button)0x8001
00267 #   define    UP_ARROW_KEY        (HT_Button)0x8002
00268 #   define    RIGHT_ARROW_KEY     (HT_Button)0x8003
00269 #   define    DOWN_ARROW_KEY      (HT_Button)0x8004
00270 #   define    LAST_ARROW_KEY      DOWN_ARROW_KEY
00271 
00272 #   define    FIRST_MISC_KEY      INSERT_KEY
00273 #   define    INSERT_KEY          (HT_Button)0x8005
00274 #   define    HOME_KEY        (HT_Button)0x8006
00275 #   define    PAGE_UP_KEY         (HT_Button)0x8007
00276 #   define    PAGE_DOWN_KEY       (HT_Button)0x8008
00277 #   define    END_KEY         (HT_Button)0x8009
00278 #   define    MAC_HELP_KEY        (HT_Button)0x8010
00279 #   define    LAST_MISC_KEY       MAC_HELP_KEY
00280 
00281 #   define    FIRST_KEYPAD_KEY    (HT_Button)0x8020
00282 #   define    LAST_KEYPAD_KEY     (HT_Button)0x805F
00283 
00284 #   define    FIRST_FUNCTION_KEY  (HT_Button)0x8060
00285 #   define    LAST_FUNCTION_KEY   (HT_Button)0x809F
00286 
00287 #   define    LAST_KEY            511
00288 
00289 #   define    CONTROL(x)          (HT_Button)(x - '@' + FIRST_CONTROL_KEY)
00290 
00291 
00292 #define  LAST_VALUATOR            20   /* ?? enough ?? */
00293 
00294 struct HT_Gather_Device_Info {
00295     HT_Name             item;           /* what's wanted */
00296     HT_Name             data;           /* result */
00297 };
00298 
00299 struct HT_Gather_Font_Names {
00300     bool                want_generic,
00301                         want_specific,
00302                         want_families,
00303                         want_defined;
00304 
00305     int                 count;          /* how many found */
00306     HT_Name             *names;         /* array of names */
00307 };
00308 
00309 #define GFI_EXISTS              0
00310 #define GFI_SIZES               1
00311 #define GFI_POINTS_TO_SRU       2
00312 #define GFI_PROPORTIONAL        3
00313 #define GFI_SCALEABLE           4
00314 #define GFI_MAX_CHARACTER       5
00315 #define GFI_GENERIC_NAME        6
00316 #define GFI_CHARACTER_WIDTHS    7
00317 #define GFI_TEXT_EXTENT         8
00318 #define GFI_ROTATABLE           9
00319 #define GFI_WIDTH_SCALEABLE     10
00320 #define GFI_SLANTABLE           11
00321 #define GFI_DEFINED             12
00322 #define GFI_ENCODING            13
00323 #define GFI_TEXT_OUTLINE        14
00324 #define GFI_OUTLINEABLE         15
00325 
00326 struct HT_Gather_Font_Info {
00327     int                 item;           /* what's wanted */
00328 
00329     /* for most things... */
00330     HT_Generic_Font_Name        generic;        /* avoid database.h - don't */
00331     HT_Name             specified;      /* use "Font_Name" struct */
00332 
00333     float               height;         /* for GFI_CHARACTER_WIDTHS */
00334     char                *returnbuf;
00335     int                 returnlen;
00336     HT_Text_Encoding    encoding;
00337 
00338     /* for TEXT_OUTLINE */
00339     int                 count;
00340     HT_Point            *points;
00341     int                 face_list_length;
00342     int                 *face_list;
00343 
00344     /* for TEXT_EXTENT */
00345     HT_KName            text;
00346     HT_Text const       *dbtext;
00347     float               xfrac,
00348                         yfrac;
00349     float               x_width,
00350                         x_height;
00351     float               left, right,
00352                         bottom, top;
00353 
00354     HT_Segment          *context;
00355     int                 segcount;
00356     HT_Segment          **path;
00357 };
00358 
00359 
00360 struct HT_Gather_Window_Extent {
00361     struct {int         left,
00362                         right,
00363                         bottom,
00364                         top;}   window_pixels;
00365     struct {int         x, y;}  screen_pixels;
00366     struct {float       x, y;}  resolution;
00367 
00368     HT_Segment          *context;
00369     int                 segcount;
00370     HT_Segment          **path;
00371 };
00372 
00373 struct HT_Gather_Screen_Extent {
00374     float               left, right, bottom, top;
00375     HT_Type_Flags       visibility;
00376     bool                visibility_specified;
00377     HT_HFSB_Flags       detailed;
00378 
00379     HT_Segment          *context;
00380     int                 segcount;
00381     HT_Segment          **path;
00382 };
00383 
00384 #define PLEASE_DEFINED
00385 #endif
Main Index
HOOPS/3dGS I.M. Interface

     << Back      Full Index      Forward >>