📄 aintern.inc
字号:
{* ______ ___ ___
* /\ _ \ /\_ \ /\_ \
* \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
* \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
* \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
* \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
* \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
* /\____/
* \_/__/
*
* Some definitions for internal use by the library code.
*
* By Shawn Hargreaves.
*
* See readme.txt for copyright information.
*}
{$IFDEF ALLEGRO_INTERFACE}
const
// length in bytes of the cpu_vendor string
_AL_CPU_VENDOR_SIZE = 32;
var
// flag for how many times we have been initialised
_allegro_count: p_sint32;
// flag to know whether we are being called by the exit mechanism
_allegro_in_exit: p_sint32;
const
// flag to decide whether to disable the screensaver
NEVER_DISABLED = 0;
FULLSCREEN_DISABLED = 1;
ALWAYS_DISABLED = 2;
var
_screensaver_policy: p_sint32;
// some Allegro functions need a block of scratch memory
_scratch_mem: ^Pointer;
_scratch_mem_size: p_sint32;
procedure _grow_scratch_mem(size: sint32);
var
// malloc wrappers for DLL <-> application shared memory
_al_malloc: function(size: sint32): Pointer; cdecl;
_al_free: procedure(mem: Pointer); cdecl;
_al_realloc: function(mem: Pointer; size: sint32): Pointer; cdecl;
// list of functions to call at program cleanup
_add_exit_func: procedure(func: proc_ptr; const desc: PChar); cdecl;
_remove_exit_func: procedure(func: proc_ptr); cdecl;
type
// helper structure for talking to Unicode strings
P_UTYPE_INFO = ^UTYPE_INFO;
UTYPE_INFO = record
id : sint32;
u_getc : function(const s: PChar): sint32; cdecl;
u_getx : function(s: p_pchar): sint32; cdecl;
u_setc : function(s: PChar; c: sint32): sint32; cdecl;
u_width : function(const s: PChar): sint32; cdecl;
u_cwidth : function(c: sint32): sint32; cdecl;
u_isok : function(c: sint32): sint32; cdecl;
u_width_max: sint32;
end;
var
_find_utype: function(types: sint32): P_UTYPE_INFO;
const
// message stuff
ALLEGRO_MESSAGE_SIZE = 4096;
var
// wrappers for implementing disk I/O on different platforms
_al_file_isok: function(const filename: PChar): sint32; cdecl;
_al_file_size: function(const filename: PChar): sint32; cdecl;
_al_file_time: function(const filename: PChar): sint32; cdecl;
_al_drive_exists: function(drive: sint32): sint32; cdecl;
_al_getdrive: function: sint32; cdecl;
_al_getdcwd: procedure(drive: sint32; buf: PChar; size: sint32); cdecl;
var
// packfile stuff
_packfile_filesize: p_sint32;
_packfile_datasize: p_sint32;
_packfile_type: p_sint32;
_pack_fdopen: function(fd: sint32; const mode: PChar): P_PACKFILE; cdecl;
// various bits of mouse stuff
_handle_mouse_input: procedure; cdecl;
_mouse_x: p_sint32;
_mouse_y: p_sint32;
_mouse_z: p_sint32;
_mouse_b: p_sint32;
_mouse_on: p_sint32;
_mouse_installed: p_sint32;
_mouse_type: p_sint32;
_mouse_screen: ^P_BITMAP;
_mouse_pointer: ^P_BITMAP;
// various bits of timer stuff
_handle_timer_tick: function(interval: sint32): sint32; cdecl;
const
MAX_TIMERS = 16;
// list of active timer handlers
type P_TIMER_QUEUE = ^TIMER_QUEUE;
TIMER_QUEUE = record
proc : procedure; cdecl; // timer handler functions
param_proc : procedure(param: Pointer); cdecl;
param : Pointer; // param for param_proc if used
speed : sint32; // timer speed
counter : sint32; // counts down to zero=blastoff
end;
var
_timer_queue: P_TIMER_QUEUE;
_timer_installed: p_sint32;
_timer_use_retrace: p_sint32;
threadvar
_retrace_hpp_value: p_sint32;
var
_vsync_speed: p_sint32;
// various bits of keyboard stuff
_handle_key_press: procedure(keycode, scancode: sint32); cdecl;
_handle_key_release: procedure(scancode: sint32); cdecl;
_keyboard_installed: p_sint32;
_keyboard_common_names: p_pchar;
threadvar
_key: PChar;
_key_shifts: p_sint32;
var
// various bits of joystick stuff
_joy_type: p_sint32;
_joystick_installed: p_sint32;
// some GUI innards that other people need to use
_gui_shadow_box_proc: function(msg: sint32; d: P_DIALOG; c: sint32): sint32; cdecl;
_gui_ctext_proc: function(msg: sint32; d: P_DIALOG; c: sint32): sint32; cdecl;
_gui_button_proc: function(msg: sint32; d: P_DIALOG; c: sint32): sint32; cdecl;
_gui_edit_proc: function(msg: sint32; d: P_DIALOG; c: sint32): sint32; cdecl;
_gui_list_proc: function(msg: sint32; d: P_DIALOG; c: sint32): sint32; cdecl;
_gui_text_list_proc: function(msg: sint32; d: P_DIALOG; c: sint32): sint32; cdecl;
_handle_scrollable_scroll_click: procedure(d: P_DIALOG; listsize: sint32; offset: p_sint32; height: sint32); cdecl;
_handle_scrollable_scroll: procedure(d: P_DIALOG; listsize: sint32; idx, offset: p_sint32); cdecl;
_handle_listbox_click: procedure(d: P_DIALOG); cdecl;
_draw_scrollable_frame: procedure(d: P_DIALOG; listsize, offset, height, fg_color, bg: sint32); cdecl;
_draw_listbox: procedure(d: P_DIALOG); cdecl;
_draw_textbox: procedure(thetext: PChar; listsize: p_sint32; draw, offset, wword, tabsize, x, y, w, h, disabled, fore, deselect, disable: sint32); cdecl;
_font_vtable_mono: P_FONT_VTABLE;
font_vtable_mono: ^P_FONT_VTABLE;
_font_vtable_color: P_FONT_VTABLE;
font_vtable_color: ^P_FONT_VTABLE;
_mono_find_glyph: function(const f: P_FONT; ch: sint32): P_FONT_GLYPH; cdecl;
_color_find_glyph: function(const f: P_FONT; ch: sint32): P_BITMAP; cdecl;
type
P_FONT_MONO_DATA = ^FONT_MONO_DATA;
FONT_MONO_DATA = record
begins, ends : sint32; // first char and one-past-the-end char
glyphs : ^P_FONT_GLYPH; // FONT_GLYPH **glyphs; // our glyphs
next : P_FONT_MONO_DATA;// linked list structure
end;
P_FONT_COLOR_DATA = ^FONT_COLOR_DATA;
FONT_COLOR_DATA = record
begins, ends : sint32; // first char and one-past-the-end char
bitmaps : ^P_BITMAP; // BITMAP **bitmaps; // our glyphs
next : P_FONT_COLOR_DATA; // linked list structure
end;
var
// caches and tables for svga bank switching
_last_bank_1: p_sint32;
_last_bank_2: p_sint32;
_gfx_bank: ^p_sint32;
// bank switching routines (these use a non-C calling convention on i386!)
_stub_bank_switch: function(bmp: P_BITMAP; line: sint32): p_uint8s; cdecl;
_stub_unbank_switch: procedure(bmp: P_BITMAP); cdecl;
_stub_bank_switch_end: procedure; cdecl;
// stuff for setting up bitmaps
_make_bitmap: function(w, h: sint32; addr: p_uint8s; driver: P_GFX_DRIVER; color_depth, bpl: sint32): P_BITMAP; cdecl;
_sort_out_virtual_width: procedure(width: p_sint32; driver: P_GFX_DRIVER); cdecl;
_get_vtable: function(color_depth: sint32): P_GFX_VTABLE;
_screen_vtable: P_GFX_VTABLE;
_gfx_mode_set_count: p_sint32;
_refresh_rate_request: p_sint32;
_set_current_refresh_rate: procedure(rate: sint32); cdecl;
_wait_for_vsync: p_sint32;
_sub_bitmap_id_count: p_sint32;
_screen_split_position: p_sint32;
_safe_gfx_mode_change: p_sint32;
function BYTES_PER_PIXEL(bpp: sint32): sint32;
var
_color_load_depth: function(depth, hasalpha: sint32): sint32; cdecl;
_color_conv: p_sint32;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -