1 (*******************************************************************
3 * gdriver : Graphics utility driver generic interface 1.1
5 * Generic interface for all drivers of the graphics utility used
6 * by the FreeType test programs.
8 * Copyright 1996 David Turner, Robert Wilhelm and Werner Lemberg.
10 * This file is part of the FreeType project, and may only be used
11 * modified and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
16 ******************************************************************)
24 (* Note that we now support an event based model, even with */
25 /* full-screen modes. It is the responsability of the driver */
26 /* to map its events to the TEvent structure when called */
27 /* through Get_Event *)
31 what
: GEvent
; (* event class *)
32 info
: Int
; (* event parameter *)
35 (* the event classes are defined in the file 'gevents.h' included *)
36 (* by the test programs, not by the graphics utility *)
38 procedure Get_Event( var ev
: Event
);
39 (* get last event. In full-screen modes, a key-stroke must be */
40 /* translated to an event class with a parameter. *)
42 function Driver_Set_Graphics( mode
: Int
) : boolean;
43 (* A call to this function must set the graphics mode, the Vio *)
44 (* variable, as well as the values vio_ScanLineWidth, vio_Width *)
47 function Driver_Restore_Mode
: boolean;
48 (* Restore previous mode or release display buffer/window *)
50 procedure Driver_Display_Bitmap( var buff
; line
, col
: Int
);
51 (* Display bitmap on screen *)
77 Translators
: array[1..Num_Translators
] of Translator
79 (key
:#27; ev_class
:event_Quit
; ev_info
:0),
81 (key
:'x'; ev_class
: event_Rotate_Glyph
; ev_info
: -1),
82 (key
:'c'; ev_class
: event_Rotate_Glyph
; ev_info
: 1),
83 (key
:'v'; ev_class
: event_Rotate_Glyph
; ev_info
: -16),
84 (key
:'b'; ev_class
: event_Rotate_Glyph
; ev_info
: 16),
86 (key
:'9'; ev_class
: event_Change_Glyph
; ev_info
:-100),
87 (key
:'0'; ev_class
: event_Change_Glyph
; ev_info
: 100),
88 (key
:'i'; ev_class
: event_Change_Glyph
; ev_info
: -10),
89 (key
:'o'; ev_class
: event_Change_Glyph
; ev_info
: 10),
90 (key
:'k'; ev_class
: event_Change_Glyph
; ev_info
: -1),
91 (key
:'l'; ev_class
: event_Change_Glyph
; ev_info
: 1),
93 (key
:'+'; ev_class
: event_Scale_Glyph
; ev_info
: 10),
94 (key
:'-'; ev_class
: event_Scale_Glyph
; ev_info
: -10),
95 (key
:'u'; ev_class
: event_Scale_Glyph
; ev_info
: 1),
96 (key
:'j'; ev_class
: event_Scale_Glyph
; ev_info
: -1)
99 procedure Get_Event( var ev
: Event
);
106 for i
:= 1 to Num_Translators
do
108 if c
= translators
[i
].key
then
110 ev
.what
:= translators
[i
].ev_class
;
111 ev
.info
:= translators
[i
].ev_info
;
116 (* unrecognized keystroke *)
118 ev
.what
:= event_Keyboard
;