; -:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:- ; ; Awesomium - Browser Framework based on Chromium ; ; for PureBasic v4.60+ ; ; -:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:- ; ; from: 20.12.2011 ; Version 0.03.00 ; ; {|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|} ; ; ; © 2011 by PMV ; ; ; {|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|}-{|} ; ; documentation: todo - include still in development ; ; homepage: http://awesomium.com/ ; License: see https://awesomium.com/buy/ (possibly free) ; download: http://awesomium.com/download/ ; related version: Awesomium SDK 1.6.3b for windows ; ; -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- EnableExplicit #WM_MOUSEHWHEEL = $020E Prototype AweP_FileRequesterCallback(ID.i, SelectMultipleFiles.i, Title.s, DefaultPath.s) Prototype AweP_CursorChangeCallback(ID.i, cursor.i) Prototype AweP_TitleCallback(ID.i, Title.s, Framename.s) Prototype AweP_DomReadyCallback(ID.i) Prototype AweP_JSMessageCallback(ID.i, Message.s, LineNumber.i, Source.s) Prototype AweP_JSDialogCallback(ID.i, RequestID.i, DialogFlags.i, Message.s, DefaultPrompt.s, FrameUrl.s) Prototype AweP_DownloadFileCallback(ID.i, DownloadFile.s) Prototype AweP_OpenExtLinkCallback(ID.i, Url.s, Source.s) Prototype AweP_OpenNewLinkCallback(ID.i, Url.s, FrameName.s) Prototype AweP_OpenLinkCallback(ID.i, Url.s) Prototype AweP_TooltipCallback(ID.i, Tooltip.s) Prototype AweP_TargetChangeCallback(ID.i, Url.s) Prototype AweP_BeginLoadingCallback(ID.i, Url.s, FrameName.s, StatusCode.i, MimeType.s) Prototype AweP_FinishLoadingCallback(ID.i) Prototype AweP_CrashedCallback(ID.i) Prototype AweP_PluginCrashedCallback(ID.i, PluginName.s) Prototype AweP_FaviconCallback(ID.i, Favicon.i) Prototype AweP_ResourceCallback(ID.i, Url.s, StatusCode.i, WasCached.i, RequestTimeMS.q, ResponseTimeMS.q, ExpectedContentSize.q, MimeType.s) Enumeration #AWE_MB_LEFT #AWE_MB_MIDDLE #AWE_MB_RIGHT EndEnumeration Enumeration #AWE_CUR_POINTER #AWE_CUR_CROSS #AWE_CUR_HAND #AWE_CUR_IBEAM #AWE_CUR_WAIT #AWE_CUR_HELP #AWE_CUR_EAST_RESIZE #AWE_CUR_NORTH_RESIZE #AWE_CUR_NORTHEAST_RESIZE #AWE_CUR_NORTHWEST_RESIZE #AWE_CUR_SOUTH_RESIZE #AWE_CUR_SOUTHEAST_RESIZE #AWE_CUR_SOUTHWEST_RESIZE #AWE_CUR_WEST_RESIZE #AWE_CUR_NORTHSOUTH_RESIZE #AWE_CUR_EASTWEST_RESIZE #AWE_CUR_NORTHEAST_SOUTHWEST_RESIZE #AWE_CUR_NORTHWEST_SOUTHEAST_RESIZE #AWE_CUR_COLUMN_RESIZE #AWE_CUR_ROW_RESIZE #AWE_CUR_MIDDLE_PANNING #AWE_CUR_EAST_PANNING #AWE_CUR_NORTH_PANNING #AWE_CUR_NORTHEAST_PANNING #AWE_CUR_NORTHWEST_PANNING #AWE_CUR_SOUTH_PANNING #AWE_CUR_SOUTHEAST_PANNING #AWE_CUR_SOUTHWEST_PANNING #AWE_CUR_WEST_PANNING #AWE_CUR_MOVE #AWE_CUR_VERTICAL_TEXT #AWE_CUR_CELL #AWE_CUR_CONTEXT_MENU #AWE_CUR_ALIAS #AWE_CUR_PROGRESS #AWE_CUR_NO_DROP #AWE_CUR_COPY #AWE_CUR_NONE #AWE_CUR_NOT_ALLOWED #AWE_CUR_ZOOM_IN #AWE_CUR_ZOOM_OUT #AWE_CUR_CUSTOM EndEnumeration ; typedef enum _awe_loglevel ; { ; AWE_LL_NONE, ; AWE_LL_NORMAL, ; AWE_LL_VERBOSE ; } awe_loglevel; Enumeration #AWE_LL_NONE #AWE_LL_NORMAL #AWE_LL_VERBOSE EndEnumeration ; typedef enum _awe_webkey_type ; { ; AWE_WKT_KEYDOWN, ; AWE_WKT_KEYUP, ; AWE_WKT_CHAR ; } awe_webkey_type; Enumeration #AWE_WKT_KEYDOWN #AWE_WKT_KEYUP #AWE_WKT_CHAR EndEnumeration ;{ awe keycodes ; AK_BACK (08) BACKSPACE key #AK_BACK = $08 ; AK_TAB (09) TAB key #AK_TAB = $09 ; AK_CLEAR (0C) CLEAR key #AK_CLEAR = $0C ; AK_RETURN (0D) #AK_RETURN = $0D ; AK_SHIFT (10) SHIFT key #AK_SHIFT = $10 ; AK_CONTROL (11) CTRL key #AK_CONTROL = $11 ; AK_MENU (12) ALT key #AK_MENU = $12 ; AK_PAUSE (13) PAUSE key #AK_PAUSE = $13 ; AK_CAPITAL (14) CAPS LOCK key #AK_CAPITAL = $14 ; AK_KANA (15) Input Method Editor (IME) Kana mode #AK_KANA = $15 ; AK_HANGUEL (15) IME Hanguel mode (maintained For compatibility use AK_HANGUL) ; AK_HANGUL (15) IME Hangul mode #AK_HANGUL = $15 ; AK_JUNJA (17) IME Junja mode #AK_JUNJA = $17 ; AK_FINAL (18) IME final mode #AK_FINAL = $18 ; AK_HANJA (19) IME Hanja mode #AK_HANJA = $19 ; AK_KANJI (19) IME Kanji mode #AK_KANJI = $19 ; AK_ESCAPE (1B) ESC key #AK_ESCAPE = $1B ; AK_CONVERT (1C) IME convert #AK_CONVERT = $1C ; AK_NONCONVERT (1D) IME nonconvert #AK_NONCONVERT = $1D ; AK_ACCEPT (1E) IME accept #AK_ACCEPT = $1E ; AK_MODECHANGE (1F) IME mode change request #AK_MODECHANGE = $1F ; AK_SPACE (20) SPACEBAR #AK_SPACE = $20 ; AK_PRIOR (21) PAGE UP key #AK_PRIOR = $21 ; AK_NEXT (22) PAGE DOWN key #AK_NEXT = $22 ; AK_END (23) End key #AK_END = $23 ; AK_HOME (24) HOME key #AK_HOME = $24 ; AK_LEFT (25) LEFT ARROW key #AK_LEFT = $25 ; AK_UP (26) UP ARROW key #AK_UP = $26 ; AK_RIGHT (27) RIGHT ARROW key #AK_RIGHT = $27 ; AK_DOWN (28) DOWN ARROW key #AK_DOWN = $28 ; AK_SELECT (29) Select key #AK_SELECT = $29 ; AK_PRINT (2A) PRINT key #AK_PRINT = $2A ; AK_EXECUTE (2B) EXECUTE key #AK_EXECUTE = $2B ; AK_SNAPSHOT (2C) PRINT SCREEN key #AK_SNAPSHOT = $2C ; AK_INSERT (2D) INS key #AK_INSERT = $2D ; AK_DELETE (2E) DEL key #AK_DELETE = $2E ; AK_HELP (2F) HELP key #AK_HELP = $2F ; (30) 0 key #AK_0 = $30 ; (31) 1 key #AK_1 = $31 ; (32) 2 key #AK_2 = $32 ; (33) 3 key #AK_3 = $33 ; (34) 4 key #AK_4 = $34 ; (35) 5 key #AK_5 = $35 ; (36) 6 key #AK_6 = $36 ; (37) 7 key #AK_7 = $37 ; (38) 8 key #AK_8 = $38 ; (39) 9 key #AK_9 = $39 ; (41) A key #AK_A = $41 ; (42) B key #AK_B = $42 ; (43) C key #AK_C = $43 ; (44) D key #AK_D = $44 ; (45) E key #AK_E = $45 ; (46) F key #AK_F = $46 ; (47) G key #AK_G = $47 ; (48) H key #AK_H = $48 ; (49) I key #AK_I = $49 ; (4A) J key #AK_J = $4A ; (4B) K key #AK_K = $4B ; (4C) L key #AK_L = $4C ; (4D) M key #AK_M = $4D ; (4E) N key #AK_N = $4E ; (4F) O key #AK_O = $4F ; (50) P key #AK_P = $50 ; (51) Q key #AK_Q = $51 ; (52) R key #AK_R = $52 ; (53) S key #AK_S = $53 ; (54) T key #AK_T = $54 ; (55) U key #AK_U = $55 ; (56) V key #AK_V = $56 ; (57) W key #AK_W = $57 ; (58) X key #AK_X = $58 ; (59) Y key #AK_Y = $59 ; (5A) Z key #AK_Z = $5A ; AK_LWIN (5B) Left Windows key (Microsoft Natural keyboard) #AK_LWIN = $5B ; AK_RWIN (5C) Right Windows key (Natural keyboard) #AK_RWIN = $5C ; AK_APPS (5D) Applications key (Natural keyboard) #AK_APPS = $5D ; AK_SLEEP (5F) Computer Sleep key #AK_SLEEP = $5F ; AK_NUMPAD0 (60) Numeric keypad 0 key #AK_NUMPAD0 = $60 ; AK_NUMPAD1 (61) Numeric keypad 1 key #AK_NUMPAD1 = $61 ; AK_NUMPAD2 (62) Numeric keypad 2 key #AK_NUMPAD2 = $62 ; AK_NUMPAD3 (63) Numeric keypad 3 key #AK_NUMPAD3 = $63 ; AK_NUMPAD4 (64) Numeric keypad 4 key #AK_NUMPAD4 = $64 ; AK_NUMPAD5 (65) Numeric keypad 5 key #AK_NUMPAD5 = $65 ; AK_NUMPAD6 (66) Numeric keypad 6 key #AK_NUMPAD6 = $66 ; AK_NUMPAD7 (67) Numeric keypad 7 key #AK_NUMPAD7 = $67 ; AK_NUMPAD8 (68) Numeric keypad 8 key #AK_NUMPAD8 = $68 ; AK_NUMPAD9 (69) Numeric keypad 9 key #AK_NUMPAD9 = $69 ; AK_MULTIPLY (6A) Multiply key #AK_MULTIPLY = $6A ; AK_ADD (6B) Add key #AK_ADD = $6B ; AK_SEPARATOR (6C) Separator key #AK_SEPARATOR = $6C ; AK_SUBTRACT (6D) Subtract key #AK_SUBTRACT = $6D ; AK_DECIMAL (6E) Decimal key #AK_DECIMAL = $6E ; AK_DIVIDE (6F) Divide key #AK_DIVIDE = $6F ; AK_F1 (70) F1 key #AK_F1 = $70 ; AK_F2 (71) F2 key #AK_F2 = $71 ; AK_F3 (72) F3 key #AK_F3 = $72 ; AK_F4 (73) F4 key #AK_F4 = $73 ; AK_F5 (74) F5 key #AK_F5 = $74 ; AK_F6 (75) F6 key #AK_F6 = $75 ; AK_F7 (76) F7 key #AK_F7 = $76 ; AK_F8 (77) F8 key #AK_F8 = $77 ; AK_F9 (78) F9 key #AK_F9 = $78 ; AK_F10 (79) F10 key #AK_F10 = $79 ; AK_F11 (7A) F11 key #AK_F11 = $7A ; AK_F12 (7B) F12 key #AK_F12 = $7B ; AK_F13 (7C) F13 key #AK_F13 = $7C ; AK_F14 (7D) F14 key #AK_F14 = $7D ; AK_F15 (7E) F15 key #AK_F15 = $7E ; AK_F16 (7F) F16 key #AK_F16 = $7F ; AK_F17 (80H) F17 key #AK_F17 = $80 ; AK_F18 (81H) F18 key #AK_F18 = $81 ; AK_F19 (82H) F19 key #AK_F19 = $82 ; AK_F20 (83H) F20 key #AK_F20 = $83 ; AK_F21 (84H) F21 key #AK_F21 = $84 ; AK_F22 (85H) F22 key #AK_F22 = $85 ; AK_F23 (86H) F23 key #AK_F23 = $86 ; AK_F24 (87H) F24 key #AK_F24 = $87 ; AK_NUMLOCK (90) NUM LOCK key #AK_NUMLOCK = $90 ; AK_SCROLL (91) SCROLL LOCK key #AK_SCROLL = $91 ; AK_LSHIFT (A0) Left SHIFT key #AK_LSHIFT = $A0 ; AK_RSHIFT (A1) Right SHIFT key #AK_RSHIFT = $A1 ; AK_LCONTROL (A2) Left CONTROL key #AK_LCONTROL = $A2 ; AK_RCONTROL (A3) Right CONTROL key #AK_RCONTROL = $A3 ; AK_LMENU (A4) Left MENU key #AK_LMENU = $A4 ; AK_RMENU (A5) Right MENU key #AK_RMENU = $A5 ; AK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key #AK_BROWSER_BACK = $A6 ; AK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key #AK_BROWSER_FORWARD = $A7 ; AK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key #AK_BROWSER_REFRESH = $A8 ; AK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key #AK_BROWSER_STOP = $A9 ; AK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key #AK_BROWSER_SEARCH = $AA ; AK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key #AK_BROWSER_FAVORITES = $AB ; AK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start And Home key #AK_BROWSER_HOME = $AC ; AK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key #AK_VOLUME_MUTE = $AD ; AK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key #AK_VOLUME_DOWN = $AE ; AK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key #AK_VOLUME_UP = $AF ; AK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key #AK_MEDIA_NEXT_TRACK = $B0 ; AK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key #AK_MEDIA_PREV_TRACK = $B1 ; AK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key #AK_MEDIA_STOP = $B2 ; AK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key #AK_MEDIA_PLAY_PAUSE = $B3 ; AK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key #AK_MEDIA_LAUNCH_MAIL = $B4 ; AK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key #AK_MEDIA_LAUNCH_MEDIA_SELECT = $B5 ; AK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key #AK_MEDIA_LAUNCH_APP1 = $B6 ; AK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key #AK_MEDIA_LAUNCH_APP2 = $B7 ; AK_OEM_1 (BA) Used For miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key #AK_OEM_1 = $BA ; AK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key #AK_OEM_PLUS = $BB ; AK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key #AK_OEM_COMMA = $BC ; AK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key #AK_OEM_MINUS = $BD ; AK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key #AK_OEM_PERIOD = $BE ; AK_OEM_2 (BF) Used For miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key #AK_OEM_2 = $BF ; AK_OEM_3 (C0) Used For miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key #AK_OEM_3 = $C0 ; AK_OEM_4 (DB) Used For miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key #AK_OEM_4 = $DB ; AK_OEM_5 (DC) Used For miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key #AK_OEM_5 = $DC ; AK_OEM_6 (DD) Used For miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key #AK_OEM_6 = $DD ; AK_OEM_7 (DE) Used For miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key #AK_OEM_7 = $DE ; AK_OEM_8 (DF) Used For miscellaneous characters; it can vary by keyboard. #AK_OEM_8 = $DF ; AK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key Or the backslash key on the RT 102-key keyboard #AK_OEM_102 = $E2 ; AK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key #AK_PROCESSKEY = $E5 ; AK_PACKET (E7) Windows 2000/XP: Used To pass Unicode characters As If they were keystrokes. The AK_PACKET key is the low word of a 32-bit Virtual Key value used For non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, And WM_KEYUP #AK_PACKET = $E7 ; AK_ATTN (F6) Attn key #AK_ATTN = $F6 ; AK_CRSEL (F7) CrSel key #AK_CRSEL = $F7 ; AK_EXSEL (F8) ExSel key #AK_EXSEL = $F8 ; AK_EREOF (F9) Erase EOF key #AK_EREOF = $F9 ; AK_PLAY (FA) Play key #AK_PLAY = $FA ; AK_ZOOM (FB) Zoom key #AK_ZOOM = $FB ; AK_NONAME (FC) Reserved For future use #AK_NONAME = $FC ; AK_PA1 (FD) PA1 key #AK_PA1 = $FD ; AK_OEM_CLEAR (FE) Clear key #AK_OEM_CLEAR = $FE #AK_UNKNOWN = 0 ;} ------ ; /// An Enumeration of the different keyboard modifiers. ; enum Modifiers ; { ; /// Whether Or Not a Shift key is down ; MOD_SHIFT_KEY = 1 << 0, ; ; /// Whether Or Not a Control key is down ; MOD_CONTROL_KEY = 1 << 1, ; ; /// Whether Or Not an ALT key is down ; MOD_ALT_KEY = 1 << 2, ; ; /// Whether Or Not a meta key (Command-key on Mac, Windows-key on Windows) is down ; MOD_META_KEY = 1 << 3, ; ; /// Whether Or Not the key pressed is on the keypad ; MOD_IS_KEYPAD = 1 << 4, ; ; /// Whether Or Not the character input is the result of an auto-Repeat timer. ; MOD_IS_AUTOREPEAT = 1 << 5, ; }; #MOD_SHIFT_KEY = 1 << 0 #MOD_CONTROL_KEY = 1 << 1 #MOD_ALT_KEY = 1 << 2 #MOD_META_KEY = 1 << 3 #MOD_IS_KEYPAD = 1 << 4 #MOD_IS_AUTOREPEAT = 1 << 5 ; typedef enum _awe_webkey_modifiers ; { ; AWE_WKM_SHIFT_KEY = 1 << 0, ; AWE_WKM_CONTROL_KEY = 1 << 1, ; AWE_WKM_ALT_KEY = 1 << 2, ; AWE_WKM_META_KEY = 1 << 3, ; AWE_WKM_IS_KEYPAD = 1 << 4, ; AWE_WKM_IS_AUTOREPEAT = 1 << 5, ; } awe_webkey_modifiers; #AWE_WKM_SHIFT_KEY = 1 << 0 #AWE_WKM_CONTROL_KEY = 1 << 1 #AWE_WKM_ALT_KEY = 1 << 2 #AWE_WKM_META_KEY = 1 << 3 #AWE_WKM_IS_KEYPAD = 1 << 4 Structure BGRA Blue.b Green.b Red.b Alpha.b EndStructure Structure BGR Blue.b Green.b Red.b EndStructure ; typedef struct _awe_rect ; { ; int x, y, width, height; ; } awe_rect; Structure awe_rect x.l y.l width.l height.l EndStructure ; typedef struct _awe_webkeyboardevent ; { ; awe_webkey_type type; ; int modifiers; ; int virtual_key_code; ; int native_key_code; ; wchar16 text[4]; ; wchar16 unmodified_text[4]; ; bool is_system_key; ; } awe_webkeyboardevent; Structure awe_webkeyboardevent type.l modifiers.l virtual_key_code.l native_key_code.l text.u[4] unmodified_Text.u[4] is_system_key.b EndStructure ; ---------------------------------------------- Enumeration #Awe_Type_Gadget #Awe_Type_Sprite #Awe_Type_Texture #Awe_Type_Window EndEnumeration Enumeration #Awe_Callback_DomReady ; called if DOM is ready #Awe_Callback_OpenLink ; called if a new url is called (same as ExtLink and NewLink together) #Awe_Callback_OpenExtLink ; called if a new url is called for a new webview #Awe_Callback_OpenNewLink ; called if a new url is called for the same webview #Awe_Callback_BeginLoading ; called if webview begins to load data #Awe_Callback_FinishLoading ; called if webview as finished loading #Awe_Callback_TargetChange ; called if cursor is over a link to display this link #Awe_Callback_Tooltip ; called if tooltip changed under cursor #Awe_Callback_Title ; called if the webview-title has changed #Awe_Callback_DownloadFile ; called if a webview wants to start a download #Awe_Callback_Favicon ; called if a webview has downloaded a new favicon ; only need for self drawn on screen (optional) #Awe_Callback_FileRequester ; called if a webview needs the user to choose a file from HDD #Awe_Callback_CursorChange ; called if the cursor should be changed (only for sprite and texture) #Awe_Callback_JSDialog ; called if a JS-Dialog needs to be dispayed (only for sprite and texture) ; only need for error-logs #Awe_Callback_JSMessage ; called for a JS messages (error log) #Awe_Callback_Crashed ; called if the webview has crashed #Awe_Callback_PluginCrashed ; called if a plugin has crashed #Awe_Callback_Resource ; called for every requested resource EndEnumeration Structure Awesomium Type.i StructureUnion ID.i Gadget.i Window.i Texture.i Sprite.i EndStructureUnion *WebView Url.s Loading.i TargetUrl.s Title.s hasFocus.i FaviconPath.s Favicon.i ; attributes for window Image.i ;callbacks CB_DomReady.AweP_DomReadyCallback CB_BeginLoading.AweP_BeginLoadingCallback CB_FinishLoading.AweP_FinishLoadingCallback CB_TargetChange.AweP_TargetChangeCallback CB_Favicon.AweP_FaviconCallback CB_DownloadFile.AweP_DownloadFileCallback CB_OpenExtLink.AweP_OpenExtLinkCallback CB_OpenNewLink.AweP_OpenNewLinkCallback CB_OpenLink.AweP_OpenLinkCallback CB_FileRequester.AweP_FileRequesterCallback CB_Title.AweP_TitleCallback CB_Tooltip.AweP_TooltipCallback CB_JSMessage.AweP_JSMessageCallback CB_JSDialog.AweP_JSDialogCallback CB_CursorChange.AweP_CursorChangeCallback CB_Crashed.AweP_CrashedCallback CB_PluginCrashed.AweP_PluginCrashedCallback CB_Resource.AweP_ResourceCallback EndStructure Global NewList Awesomium.Awesomium() Global NewMap Awe_Mapper.i() Global NewMap AweWindow_Mapper.i() ; ----- main ------------------------------------- ; #ifdef _WIN32 ; _OSMExport bool awe_is_child_process(HINSTANCE hInstance); ; ; _OSMExport int awe_child_process_main(HINSTANCE hInstance); ; #else ; _OSMExport bool awe_is_child_process(int argc, char** argv); ; ; _OSMExport int awe_child_process_main(int argc, char** argv); ; #endif CompilerIf #PB_Compiler_OS = #PB_OS_Windows PrototypeC.b awe_is_child_process(hInstance.i) PrototypeC.l awe_child_process_main(hInstance.i) Macro awe_is_child_process(hInstance) (_awe_is_child_process(hInstance) & $FF) EndMacro CompilerElse PrototypeC.b awe_is_child_process(argc.l, *argv) PrototypeC.l awe_child_process_main(argc.l, *argv) Macro awe_is_child_process(argc, argv) (_awe_is_child_process(argc, argv) & $FF) EndMacro CompilerEndIf ; ----- webcore --------------------------------- ; _OSMExport void awe_webcore_initialize_default ( ) PrototypeC awe_webcore_initialize_default() ; _OSMExport void awe_webcore_initialize ( bool enable_plugins, ; bool enable_javascript, ; bool enable_databases, ; const awe_string * package_path, ; const awe_string * locale_path, ; const awe_string * user_data_path, ; const awe_string * plugin_path, ; const awe_string * log_path, ; awe_loglevel log_level, ; bool force_single_process, ; const awe_string * child_process_path, ; bool enable_auto_detect_encoding, ; const awe_string * accept_language_override, ; const awe_string * default_charset_override, ; const awe_string * user_agent_override, ; const awe_string * proxy_server, ; const awe_string * proxy_config_script, ; const awe_string * auth_server_whitelist, ; bool save_cache_and_cookies, ; int max_cache_size, ; bool disable_same_origin_policy, ; bool disable_win_message_pump, ; const awe_string * custom_css ; ) PrototypeC awe_webcore_initialize(enable_plugins.b, enable_javascript.b, enable_databases.b, *package_path, *locale_path, *user_data_path, *plugin_path, *log_path, log_level.l, force_single_process.b, *child_process_path, enable_auto_detect_encoding.b, *accept_language_override, *default_charset_override, *user_agent_override, *proxy_server, *proxy_config_script, *auth_server_whitelist, save_cache_and_cookies.b, max_cache_size.l, disable_same_origin_policy.b, disable_win_message_pump.b, *custom_css) ; _OSMExport void awe_webcore_shutdown ( ) PrototypeC awe_webcore_shutdown() ; _OSMExport awe_webview* awe_webcore_create_webview ( int width, ; int height, ; bool view_source ; ) PrototypeC.i awe_webcore_create_webview(Width.l, Height.l, viewSource.l) ; _OSMExport void awe_webcore_update ( ) PrototypeC awe_webcore_update() ; ----- webview --------------------------------- ; _OSMExport void awe_webview_destroy ( awe_webview * webview ) PrototypeC awe_webview_destroy(*webview) ; _OSMExport void awe_webview_load_url ( awe_webview * webview, ; const awe_string * url, ; const awe_string * frame_name, ; const awe_string * username, ; const awe_string * password ; ) PrototypeC awe_webview_load_url(*webview, *url, *frame_name, *username, *password) ; _OSMExport void awe_webview_load_file ( awe_webview * webview, ; const awe_string * file, ; const awe_string * frame_name ; ) PrototypeC awe_webview_load_file(*webview, *file, *frame_name) ; _OSMExport bool awe_webview_is_loading_page ( awe_webview * webview ) PrototypeC.b awe_webview_is_loading_page(*webview) Macro awe_webview_is_loading_page(webview) (_awe_webview_is_loading_page(webview) & $FF) EndMacro ; _OSMExport const awe_renderbuffer* awe_webview_render ( awe_webview * webview ) PrototypeC.i awe_webview_render(*webview) ; _OSMExport bool awe_webview_resize ( awe_webview * webview, ; int width, ; int height, ; bool wait_for_repaint, ; int repaint_timeout_ms ; ) PrototypeC.b awe_webview_resize(*webview, width.l, height.l, wait_for_repaint.l, repaint_timeout_ms.l) ; _OSMExport bool awe_webview_is_dirty ( awe_webview * webview ) PrototypeC.b awe_webview_is_dirty(*webview) Macro awe_webview_is_dirty(webview) (_awe_webview_is_dirty(webview) & $FF) EndMacro ; _OSMExport awe_rect awe_webview_get_dirty_bounds ( awe_webview * webview ) PrototypeC awe_webview_get_dirty_bounds(*rect, *webview) Macro awe_webview_get_dirty_bounds(webview, rect) _awe_webview_get_dirty_bounds(rect, webview) EndMacro ; _OSMExport void awe_webview_focus ( awe_webview * webview ) PrototypeC awe_webview_focus(*webview) ; _OSMExport void awe_webview_unfocus ( awe_webview * webview ) PrototypeC awe_webview_unfocus(*webview) ; _OSMExport void awe_webview_set_transparent ( awe_webview * webview, ; bool is_transparent ; ) PrototypeC awe_webview_set_transparent(*webview, is_transparent.b) ; _OSMExport void awe_webview_choose_file ( awe_webview * webview, ; const awe_string * file_path ; ) PrototypeC awe_webview_choose_file(*webview, *filepath) ; _OSMExport void awe_webview_reload ( awe_webview * webview ) PrototypeC awe_webview_reload(*webview) ; _OSMExport awe_string * awe_webview_get_url (awe_webview *webview) PrototypeC.i awe_webview_get_url(*webview) ; _OSMExport void awe_webview_set_zoom ( awe_webview * webview, ; int zoom_percent ; ) PrototypeC awe_webview_set_zoom(*webview, zoom_percent.l) ; _OSMExport void awe_webview_reset_zoom ( awe_webview * webview ) PrototypeC awe_webview_reset_zoom(*webview) ; _OSMExport int awe_webview_get_zoom (awe_webview *webview) PrototypeC.l awe_webview_get_zoom(*webview) ; _OSMExport bool awe_webview_is_resizing ( awe_webview * webview ) PrototypeC.b awe_webview_is_resizing(*webview) Macro awe_webview_is_resizing(webview) (_awe_webview_is_resizing(webview) & $FF) EndMacro ; ----- javascript ------------------------------ ;_OSMExport awe_string* awe_jsvalue_to_string ( const awe_jsvalue * jsvalue ) PrototypeC.i awe_jsvalue_to_string(*jsvalue) ;_OSMExport void awe_jsvalue_destroy ( awe_jsvalue * jsvalue ) PrototypeC awe_jsvalue_destroy(*jsvalue) ; _OSMExport void awe_webview_create_object ( awe_webview * webview, ; const awe_string * object_name ; ) PrototypeC awe_webview_create_object(*webview, *object_name) ; _OSMExport void awe_webview_destroy_object ( awe_webview * webview, ; const awe_string * object_name ; ) PrototypeC awe_webview_destroy_object(*webview, *object_name) ; _OSMExport void awe_webview_execute_javascript ( awe_webview * webview, ; const awe_string * javascript, ; const awe_string * frame_name ; ) PrototypeC awe_webview_execute_javascript(*webview, *javascript, *framen_name) ; _OSMExport awe_jsvalue* awe_webview_execute_javascript_with_result ( awe_webview * webview, ; const awe_string * javascript, ; const awe_string * frame_name, ; int timeout_ms ; ) PrototypeC.i awe_webview_execute_javascript_with_result(*webview, *javascript, *framename, timeout_ms.l) ; _OSMExport void awe_webview_set_object_callback ( awe_webview * webview, ; const awe_string * object_name, ; const awe_string * callback_name ; ) PrototypeC awe_webview_set_object_callback(*webview, *object_name, *callback_name) ; _OSMExport void awe_webview_set_object_property ( awe_webview * webview, ; const awe_string * object_name, ; const awe_string * property_name, ; const awe_jsvalue * value ; ) PrototypeC awe_webview_set_object_property(*webview, *object_name, *property_name, *value) ; ----- strings --------------------------------- ; _OSMExport const awe_string* awe_string_empty ( ) PrototypeC.i awe_string_empty() ; _OSMExport awe_string* awe_string_create_from_utf16 ( const wchar16 * str, ; size_t len ; ) PrototypeC.i awe_string_create_from_utf16(str.p-unicode, len.l) ; _OSMExport const wchar16* awe_string_get_utf16 ( const awe_string * str ) PrototypeC.i awe_string_get_utf16(*str) ; _OSMExport void awe_string_destroy ( awe_string * str ) PrototypeC awe_string_destroy(*str) ; _OSMExport size_t awe_string_get_length ( const awe_string * str ) PrototypeC.i awe_string_get_length(*str) ; ----- renderbuffer --------------------------------- ; _OSMExport const unsigned char* awe_renderbuffer_get_buffer ( const awe_renderbuffer * renderbuffer ) PrototypeC.i awe_renderbuffer_get_buffer(*renderbuffer) ; _OSMExport int awe_renderbuffer_get_height ( const awe_renderbuffer * renderbuffer ) PrototypeC.l awe_renderbuffer_get_height(*renderbuffer) ; _OSMExport int awe_renderbuffer_get_width ( const awe_renderbuffer * renderbuffer ) PrototypeC.l awe_renderbuffer_get_width(*renderbuffer) ; _OSMExport bool awe_renderbuffer_save_to_png ( const awe_renderbuffer * renderbuffer, ; const awe_string * file_path, ; bool preserve_transparency ; ) PrototypeC.b awe_renderbuffer_save_to_png(*renderbuffer, *file_path, preserve_transparency.b) ; ----- injection --------------------------------- ; _OSMExport void awe_webview_inject_mouse_move ( awe_webview * webview, ; int x, ; int y ; ) PrototypeC awe_webview_inject_mouse_move(*webview, x.l, y.l) ; _OSMExport void awe_webview_inject_mouse_down ( awe_webview * webview, ; awe_mousebutton button ; ) PrototypeC awe_webview_inject_mouse_down(*webview, button.l) ; _OSMExport void awe_webview_inject_mouse_up ( awe_webview * webview, ; awe_mousebutton button ; ) PrototypeC awe_webview_inject_mouse_up(*webview, button.l) ; _OSMExport void awe_webview_inject_mouse_wheel ( awe_webview * webview, ; int scroll_amount_vert, ; int scroll_amount_horz ; ) PrototypeC awe_webview_inject_mouse_wheel(*webview, scroll_amount_vert.l, scroll_amount_horz.l) ; _OSMExport void awe_webview_inject_keyboard_event ( awe_webview * webview, ; awe_webkeyboardevent key_event ; ) PrototypeC awe_webview_inject_keyboard_event(*webview, type.l, modifiers.l, virtual_key_code.l, native_key_code.l, text.q, unmodified_Text.q, is_system_key.l) Macro awe_webview_inject_keyboard_event(webview, key_event) _awe_webview_inject_keyboard_event(webview, key_event\type, key_event\modifiers, key_event\virtual_key_code, key_event\native_key_code, PeekQ(key_event + OffsetOf(awe_webkeyboardevent\text)), PeekQ(key_event + OffsetOf(awe_webkeyboardevent\unmodified_Text)), key_event\is_system_key) EndMacro ; _OSMExport void awe_webview_inject_keyboard_event_win(awe_webview* webview, ; UINT msg, ; WPARAM wparam, ; LPARAM lparam); PrototypeC awe_webview_inject_keyboard_event_win(*webview, msg.i, wparam.l, lparam.l) ; ----- callback --------------------------------- ; _OSMExport void awe_webview_set_callback_change_cursor ( awe_webview * webview, ; void(*)(awe_webview *caller, awe_cursor_type cursor) callback ; ) PrototypeC awe_webview_set_callback_change_cursor(*webview, *callback) ; _OSMExport void awe_webview_set_callback_open_external_link ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *url, const awe_string *source) callback ; ) PrototypeC awe_webview_set_callback_open_external_link(*webview, *callback) ; _OSMExport void awe_webview_set_callback_change_target_url ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *url) callback ; ) PrototypeC awe_webview_set_callback_change_target_url(*webview, *callback) ; _OSMExport void awe_webview_set_callback_begin_navigation ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *url, const awe_string *frame_name) callback ; ) PrototypeC awe_webview_set_callback_begin_navigation(*webview, *callback) ; _OSMExport void awe_webview_set_callback_request_download ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *download) callback ; ) PrototypeC awe_webview_set_callback_request_download(*webview, *callback) ; _OSMExport void awe_webview_set_callback_dom_ready ( awe_webview * webview, ; void(*)(awe_webview *caller) callback ; ) PrototypeC awe_webview_set_callback_dom_ready(*webview, *callback) ; _OSMExport void awe_webview_set_callback_begin_loading ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *url, const awe_string *frame_name, int status_code, const awe_string *mime_type) callback ; ) PrototypeC awe_webview_set_callback_begin_loading(*webview, *callback) ; _OSMExport void awe_webview_set_callback_finish_loading ( awe_webview * webview, ; void(*)(awe_webview *caller) callback ; ) PrototypeC awe_webview_set_callback_finish_loading(*webview, *callback) ; _OSMExport void awe_webview_set_callback_change_tooltip ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *tooltip) callback ; ) PrototypeC awe_webview_set_callback_change_tooltip(*webview, *callback) ; _OSMExport void awe_webview_set_callback_receive_title ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *title, const awe_string *frame_name) callback ; ) PrototypeC awe_webview_set_callback_receive_title(*webview, *callback) ; _OSMExport void awe_webview_set_callback_request_file_chooser ( awe_webview * webview, ; void(*)(awe_webview *caller, bool select_multiple_files, const awe_string *title, const awe_string *default_path) callback ; ) PrototypeC awe_webview_set_callback_request_file_chooser(*webview, *calback) ; _OSMExport void awe_webview_set_callback_js_callback ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *object_name, const awe_string *callback_name, const awe_jsarray *arguments) callback ; ) PrototypeC awe_webview_set_callback_js_callback(*webview, *callback) ; _OSMExport void awe_webview_set_callback_js_console_message ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *message, int line_number, const awe_string *source) callback ; ) PrototypeC awe_webview_set_callback_js_console_message(*webview, *callback) ; _OSMExport void awe_webview_set_callback_show_javascript_dialog ( awe_webview * webview, ; void(*)(awe_webview *caller, int request_id, int dialog_flags, const awe_string *message, const awe_string *default_prompt, const awe_string *frame_url) callback ; ) PrototypeC awe_webview_set_callback_show_javascript_dialog(*webview, *callback) ; _OSMExport void awe_webview_set_callback_web_view_crashed ( awe_webview * webview, ; void(*)(awe_webview *caller) callback ; ) PrototypeC awe_webview_set_callback_web_view_crashed(*webview, *callback) ; _OSMExport void awe_webview_set_callback_plugin_crashed ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *plugin_name) callback ; ) PrototypeC awe_webview_set_callback_plugin_crashed(*webview, *callback) ; _OSMExport void awe_webview_set_callback_resource_response ( awe_webview * webview, ; void(*)(awe_webview *caller, const awe_string *url, int status_code, bool was_cached, int64 request_time_ms, int64 response_time_ms, int64 expected_content_size, const awe_string *mime_type) callback ; ) PrototypeC awe_webview_set_callback_resource_response(*webview, *callback) ; _OSMExport void awe_webview_set_callback_finish_resize ( awe_webview * webview, ; void(*)(awe_webview *caller, int width, int height) callback ; ) PrototypeC awe_webview_set_callback_finish_resize(*webview, *callback) Declare.i SelectAwesomium(ID.i) Procedure InitAwesomium(Path.s, UserAgent.s, Javascript.i = #True, CustomCSS.s = "") Protected Lib.i = OpenLibrary(#PB_Any, Path) If Lib Global _awe_is_child_process.awe_is_child_process = GetFunction(Lib, "awe_is_child_process") Global awe_child_process_main.awe_child_process_main = GetFunction(Lib, "awe_child_process_main") Global awe_webcore_initialize_default.awe_webcore_initialize_default = GetFunction(Lib, "awe_webcore_initialize_default") Global awe_webcore_initialize.awe_webcore_initialize = GetFunction(Lib, "awe_webcore_initialize") Global awe_webcore_shutdown.awe_webcore_shutdown = GetFunction(Lib, "awe_webcore_shutdown") Global awe_webview_destroy.awe_webview_destroy = GetFunction(Lib, "awe_webview_destroy") Global awe_webcore_create_webview.awe_webcore_create_webview = GetFunction(Lib, "awe_webcore_create_webview") Global awe_webview_load_url.awe_webview_load_url = GetFunction(Lib, "awe_webview_load_url") Global awe_webview_load_file.awe_webview_load_file = GetFunction(Lib, "awe_webview_load_file") Global _awe_webview_is_loading_page.awe_webview_is_loading_page = GetFunction(Lib, "awe_webview_is_loading_page") Global awe_webview_focus.awe_webview_focus = GetFunction(Lib, "awe_webview_focus") Global awe_webview_unfocus.awe_webview_unfocus = GetFunction(Lib, "awe_webview_unfocus") Global awe_webcore_update.awe_webcore_update = GetFunction(Lib, "awe_webcore_update") Global awe_string_empty.awe_string_empty = GetFunction(Lib, "awe_string_empty") Global awe_string_create_from_utf16.awe_string_create_from_utf16 = GetFunction(Lib, "awe_string_create_from_utf16") Global awe_string_get_utf16.awe_string_get_utf16 = GetFunction(Lib, "awe_string_get_utf16") Global awe_string_destroy.awe_string_destroy = GetFunction(Lib, "awe_string_destroy") Global awe_string_get_length.awe_string_get_length = GetFunction(Lib, "awe_string_get_length") Global awe_webview_render.awe_webview_render = GetFunction(Lib, "awe_webview_render") Global awe_renderbuffer_save_to_png.awe_renderbuffer_save_to_png = GetFunction(Lib, "awe_renderbuffer_save_to_png") Global _awe_webview_is_dirty.awe_webview_is_dirty = GetFunction(Lib, "awe_webview_is_dirty") Global _awe_webview_get_dirty_bounds.awe_webview_get_dirty_bounds = GetFunction(Lib, "awe_webview_get_dirty_bounds") Global awe_webview_set_transparent.awe_webview_set_transparent = GetFunction(Lib, "awe_webview_set_transparent") Global awe_webview_get_url.awe_webview_get_url = GetFunction(Lib, "awe_webview_get_url") Global awe_webview_set_zoom.awe_webview_set_zoom = GetFunction(Lib, "awe_webview_set_zoom") Global awe_webview_reset_zoom.awe_webview_reset_zoom = GetFunction(Lib, "awe_webview_reset_zoom") Global awe_webview_get_zoom.awe_webview_get_zoom = GetFunction(Lib, "awe_webview_get_zoom") Global _awe_webview_is_resizing.awe_webview_is_resizing = GetFunction(Lib, "awe_webview_is_resizing") Global awe_webview_create_object.awe_webview_create_object = GetFunction(Lib, "awe_webview_create_object") Global awe_webview_destroy_object.awe_webview_destroy_object = GetFunction(Lib, "awe_webview_destroy_object") Global awe_webview_execute_javascript.awe_webview_execute_javascript = GetFunction(Lib, "awe_webview_execute_javascript") Global awe_webview_execute_javascript_with_result.awe_webview_execute_javascript_with_result = GetFunction(Lib, "awe_webview_execute_javascript_with_result") Global awe_webview_set_object_callback.awe_webview_set_object_callback = GetFunction(Lib, "awe_webview_set_object_callback") Global awe_webview_set_object_property.awe_webview_set_object_property = GetFunction(Lib, "awe_webview_set_object_property") Global awe_renderbuffer_get_buffer.awe_renderbuffer_get_buffer = GetFunction(Lib, "awe_renderbuffer_get_buffer") Global awe_renderbuffer_get_height.awe_renderbuffer_get_height = GetFunction(Lib, "awe_renderbuffer_get_height") Global awe_renderbuffer_get_width.awe_renderbuffer_get_width = GetFunction(Lib, "awe_renderbuffer_get_width") Global awe_webview_inject_mouse_move.awe_webview_inject_mouse_move = GetFunction(Lib, "awe_webview_inject_mouse_move") Global awe_webview_inject_mouse_down.awe_webview_inject_mouse_down = GetFunction(Lib, "awe_webview_inject_mouse_down") Global awe_webview_inject_mouse_up.awe_webview_inject_mouse_up = GetFunction(Lib, "awe_webview_inject_mouse_up") Global awe_webview_inject_mouse_wheel.awe_webview_inject_mouse_wheel = GetFunction(Lib, "awe_webview_inject_mouse_wheel") Global _awe_webview_inject_keyboard_event.awe_webview_inject_keyboard_event = GetFunction(Lib, "awe_webview_inject_keyboard_event") Global awe_webview_set_callback_change_cursor.awe_webview_set_callback_change_cursor = GetFunction(Lib, "awe_webview_set_callback_change_cursor") Global awe_webview_resize.awe_webview_resize = GetFunction(Lib, "awe_webview_resize") Global awe_jsvalue_to_string.awe_jsvalue_to_string = GetFunction(Lib, "awe_jsvalue_to_string") Global awe_jsvalue_destroy.awe_jsvalue_destroy = GetFunction(Lib, "awe_jsvalue_destroy") Global awe_webview_set_callback_open_external_link.awe_webview_set_callback_open_external_link = GetFunction(Lib, "awe_webview_set_callback_open_external_link") Global awe_webview_set_callback_change_target_url.awe_webview_set_callback_change_target_url = GetFunction(Lib, "awe_webview_set_callback_change_target_url") Global awe_webview_set_callback_begin_navigation.awe_webview_set_callback_begin_navigation = GetFunction(Lib, "awe_webview_set_callback_begin_navigation") Global awe_webview_set_callback_request_download.awe_webview_set_callback_request_download = GetFunction(Lib, "awe_webview_set_callback_request_download") Global awe_webview_set_callback_begin_loading.awe_webview_set_callback_begin_loading = GetFunction(Lib, "awe_webview_set_callback_begin_loading") Global awe_webview_set_callback_finish_loading.awe_webview_set_callback_finish_loading = GetFunction(Lib, "awe_webview_set_callback_finish_loading") Global awe_webview_set_callback_change_tooltip.awe_webview_set_callback_change_tooltip = GetFunction(Lib, "awe_webview_set_callback_change_tooltip") Global awe_webview_inject_keyboard_event_win.awe_webview_inject_keyboard_event_win = GetFunction(Lib, "awe_webview_inject_keyboard_event_win") Global awe_webview_set_callback_receive_title.awe_webview_set_callback_receive_title = GetFunction(Lib, "awe_webview_set_callback_receive_title") Global awe_webview_set_callback_request_file_chooser.awe_webview_set_callback_request_file_chooser = GetFunction(Lib, "awe_webview_set_callback_request_file_chooser") Global awe_webview_choose_file.awe_webview_choose_file = GetFunction(Lib, "awe_webview_choose_file") Global awe_webview_reload.awe_webview_reload = GetFunction(Lib, "awe_webview_reload") Global awe_webview_set_callback_dom_ready.awe_webview_set_callback_dom_ready = GetFunction(Lib, "awe_webview_set_callback_dom_ready") Global awe_webview_set_callback_js_callback.awe_webview_set_callback_js_callback = GetFunction(Lib, "awe_webview_set_callback_js_callback") Global awe_webview_set_callback_js_console_message.awe_webview_set_callback_js_console_message = GetFunction(Lib, "awe_webview_set_callback_js_console_message") Global awe_webview_set_callback_show_javascript_dialog.awe_webview_set_callback_show_javascript_dialog = GetFunction(Lib, "awe_webview_set_callback_show_javascript_dialog") Global awe_webview_set_callback_web_view_crashed.awe_webview_set_callback_web_view_crashed = GetFunction(Lib, "awe_webview_set_callback_web_view_crashed") Global awe_webview_set_callback_plugin_crashed.awe_webview_set_callback_plugin_crashed = GetFunction(Lib, "awe_webview_set_callback_plugin_crashed") Global awe_webview_set_callback_resource_response.awe_webview_set_callback_resource_response = GetFunction(Lib, "awe_webview_set_callback_resource_response") Global awe_webview_set_callback_finish_resize.awe_webview_set_callback_finish_resize = GetFunction(Lib, "awe_webview_set_callback_finish_resize") ; ExamineLibraryFunctions(Lib) ; While NextLibraryFunction() ; Debug LibraryFunctionName() ; Wend ; has the effect that all childprocesses are named like ; the mainprocess instead of AwesomiumProcess.exe CompilerIf #PB_Compiler_OS = #PB_OS_Windows If awe_is_child_process(GetModuleHandle_(0)) awe_child_process_main(GetModuleHandle_(0)) End EndIf CompilerElse CompilerError "awe_is_child_process()-call missing" CompilerEndIf ; -------- ; init Protected enable_plugins.b, enable_javascript.b, enable_databases.b, *package_path, *locale_path, *user_data_path, *plugin_path, *log_path, log_level.l, force_single_process.b, *child_process_path, enable_auto_detect_encoding.b, *accept_language_override, *default_charset_override, *user_agent_override, *proxy_server, *proxy_config_script, *auth_server_whitelist, save_cache_and_cookies.b, max_cache_size.l, disable_same_origin_policy.b, disable_win_message_pump.b, *custom_css enable_plugins = #False enable_javascript = Javascript enable_databases = #False *package_path = awe_string_empty() *locale_path = awe_string_empty() *user_data_path = awe_string_empty() *plugin_path = awe_string_empty() *log_path = awe_string_empty() log_level = #AWE_LL_NONE force_single_process = #False *child_process_path = awe_string_create_from_utf16("self", Len("self")) ; to name childprozesses like this exe enable_auto_detect_encoding = #True *accept_language_override = awe_string_empty() *default_charset_override = awe_string_empty() If UserAgent *user_agent_override = awe_string_create_from_utf16(UserAgent, Len(UserAgent)) Else *user_agent_override = awe_string_empty() EndIf *proxy_server = awe_string_empty() *proxy_config_script = awe_string_empty() *auth_server_whitelist = awe_string_empty() save_cache_and_cookies = #False max_cache_size = 0 disable_same_origin_policy = #False disable_win_message_pump = #True ;disabled because PB manages window-events at his own If CustomCSS *custom_css = awe_string_create_from_utf16(CustomCSS, Len(CustomCSS)) Else *custom_css = awe_string_empty() EndIf awe_webcore_initialize(enable_plugins, enable_javascript, enable_databases, *package_path, *locale_path, *user_data_path, *plugin_path, *log_path, log_level, force_single_process, *child_process_path, enable_auto_detect_encoding, *accept_language_override, *default_charset_override, *user_agent_override, *proxy_server, *proxy_config_script, *auth_server_whitelist, save_cache_and_cookies, max_cache_size, disable_same_origin_policy, disable_win_message_pump, *custom_css) awe_string_destroy(*child_process_path) If UserAgent : awe_string_destroy(*user_agent_override) : EndIf If CustomCSS : awe_string_destroy(*custom_css) : EndIf ; ---- ;used for Favicon! InitNetwork() EndIf ProcedureReturn Lib EndProcedure Procedure.s awe_string_get_string(*str) Protected len.i = awe_string_get_length(*str) *str = awe_string_get_utf16(*str) ProcedureReturn PeekS(*str, len, #PB_Unicode) EndProcedure ; -------------------------------------------------------------- ;- ;- > Internal Functions < < ; ; -------------------------------------------------------------- Procedure RedrawAwesomium(*Awesomium.Awesomium) Protected *RenderBuffer, *srcBuffer, *destBuffer Protected rect.awe_rect Protected y.i, Size.i, BufferPitch.i awe_webview_get_dirty_bounds(*Awesomium\WebView, @rect) *RenderBuffer = awe_webview_render(*Awesomium\WebView) Size = rect\width * SizeOf(BGRA) BufferPitch = DrawingBufferPitch() *srcBuffer = awe_renderbuffer_get_buffer(*RenderBuffer) + rect\y * BufferPitch + rect\x * SizeOf(BGRA) *destBuffer = DrawingBuffer() + (awe_renderbuffer_get_height(*RenderBuffer) - rect\y - 1) * BufferPitch + rect\x * SizeOf(BGRA) For y = 1 To rect\height CopyMemory(*srcBuffer, *destBuffer, Size) *srcBuffer + BufferPitch *destBuffer - BufferPitch Next EndProcedure Procedure RedrawAwesomiumGadget(*Awesomium.Awesomium, DrawAll.i = #False) Protected Width.i, Height.i Protected *Buffer, *RenderBuffer, *srcPixel.BGRA, *destPixel.BGR Protected X.i, Y.i Protected rect.awe_rect If Not DrawAll awe_webview_get_dirty_bounds(*Awesomium\WebView, @rect) EndIf *RenderBuffer = awe_webview_render(*Awesomium\WebView) *Buffer = awe_renderbuffer_get_buffer(*RenderBuffer) Width = awe_renderbuffer_get_width(*RenderBuffer) Height = awe_renderbuffer_get_height(*RenderBuffer) If DrawAll rect\width = Width rect\height = Height EndIf StartDrawing(CanvasOutput(*Awesomium\Gadget)) rect\height + rect\y - 1 For y = rect\y To rect\height *srcPixel = *Buffer + (y * Width + rect\x) * SizeOf(BGRA) *destPixel = DrawingBuffer() + ((Height - y - 1) * Width + rect\x) * SizeOf(BGR) For x = 1 To rect\width CopyMemory(*srcPixel, *destPixel, SizeOf(BGR)) *srcPixel + SizeOf(BGRA) *destPixel + SizeOf(BGR) Next Next StopDrawing() EndProcedure Procedure RedrawAwesomiumGadget2(*Awesomium.Awesomium, DrawAll.i = #False) Protected srcWidth.i, destWidth.i Protected srcHeight.i, destHeight.i Protected *Buffer, *RenderBuffer, *srcPixel.BGRA, *destPixel.BGR Protected X.i, Y.i Protected rect.awe_rect If awe_webview_is_resizing(*Awesomium\WebView) : Debug "Resize" : ProcedureReturn : EndIf If Not DrawAll awe_webview_get_dirty_bounds(*Awesomium\WebView, @rect) EndIf *RenderBuffer = awe_webview_render(*Awesomium\WebView) *Buffer = awe_renderbuffer_get_buffer(*RenderBuffer) srcWidth = awe_renderbuffer_get_width(*RenderBuffer) srcHeight = awe_renderbuffer_get_height(*RenderBuffer) destWidth = GadgetWidth(*Awesomium\Gadget) destHeight = GadgetHeight(*Awesomium\Gadget) If Not DrawAll If rect\width > destWidth rect\width = destWidth EndIf If rect\height > destHeight rect\height = destHeight EndIf Else If srcWidth <= destWidth rect\width = srcWidth Else rect\width = destWidth EndIf If srcHeight <= destHeight rect\height = srcHeight Else rect\height = destHeight EndIf EndIf StartDrawing(CanvasOutput(*Awesomium\Gadget)) rect\height + rect\y - 1 For y = rect\y To rect\height *srcPixel = *Buffer + (y * srcWidth + rect\x) * SizeOf(BGRA) *destPixel = DrawingBuffer() + ((destHeight - y - 1) * destWidth + rect\x) * SizeOf(BGR) For x = 1 To rect\width CopyMemory(*srcPixel, *destPixel, SizeOf(BGR)) *srcPixel + SizeOf(BGRA) *destPixel + SizeOf(BGR) Next Next StopDrawing() ; StartDrawing(CanvasOutput(*Awesomium\Gadget)) ; If *Awesomium\Loading Or *Awesomium\TargetUrl ; If *Awesomium\Loading ; text = "Loading ..." ; Else ; text = *Awesomium\TargetUrl ; EndIf ; DrawingMode(#PB_2DDrawing_AlphaBlend) ; RoundBox(2, 2, TextWidth(text)+12, TextHeight(text)+12, 4, 4, RGBA(0, 0, 0, 100)) ; DrawingMode(#PB_2DDrawing_Default) ; DrawingMode(#PB_2DDrawing_Outlined | #PB_2DDrawing_Transparent) ; RoundBox(3, 3, TextWidth(text)+10, TextHeight(text)+10, 4, 4, RGB(255, 255, 255)) ; DrawText(8, 8, text, RGB(255, 255, 255)) ; EndIf ; StopDrawing() EndProcedure Procedure Awe_WindowCallback(WindowID.i, Message.i, wParam.l, lParam.l) Protected *Awesomium.Awesomium = AweWindow_Mapper(Str(WindowID)) Select Message Case #WM_MOUSEMOVE awe_webview_inject_mouse_move(*Awesomium\WebView, lParam & $ffff, lParam >> 16 ) Case #WM_LBUTTONDOWN If GetClassLong_(WindowID, #GCL_HCURSOR) = LoadCursor_(0, #IDC_ARROW) ReleaseCapture_() SendMessage_(WindowID, #WM_NCLBUTTONDOWN, #HTCAPTION, 0) Else awe_webview_inject_mouse_down(*Awesomium\WebView, #AWE_MB_LEFT) EndIf Case #WM_MBUTTONDOWN awe_webview_inject_mouse_down(*Awesomium\WebView, #AWE_MB_MIDDLE) Case #WM_RBUTTONDOWN awe_webview_inject_mouse_down(*Awesomium\WebView, #AWE_MB_Right) Case #WM_LBUTTONUP awe_webview_inject_mouse_up(*Awesomium\WebView, #AWE_MB_LEFT) Case #WM_MBUTTONUP awe_webview_inject_mouse_up(*Awesomium\WebView, #AWE_MB_MIDDLE) Case #WM_RBUTTONUP awe_webview_inject_mouse_up(*Awesomium\WebView, #AWE_MB_RIGHT) Case #WM_MOUSEWHEEL awe_webview_inject_mouse_wheel(*Awesomium\WebView, wParam >> 16, 0) Case #WM_MOUSEHWHEEL awe_webview_inject_mouse_wheel(*Awesomium\WebView, 0, wParam >> 16) Case #WM_SETFOCUS Debug "Focus" awe_webview_focus(*Awesomium\WebView) *Awesomium\hasFocus = #True Case #WM_KILLFOCUS Debug "KILLFOCUS" awe_webview_unfocus(*Awesomium\WebView) *Awesomium\hasFocus = #False Case #WM_KEYUP, #WM_KEYDOWN, #WM_SYSKEYUP, #WM_SYSKEYDOWN, #WM_CHAR, #WM_SYSCHAR If *Awesomium\hasFocus awe_webview_inject_keyboard_event_win(*Awesomium\WebView, Message, wParam, lParam) EndIf EndSelect ProcedureReturn #PB_ProcessPureBasicEvents EndProcedure ProcedureC Awe_FileRequesterCallback(*webview, select_multiple_files.i, *title, *default_path) Protected *Awesomium.Awesomium = Awe_Mapper(Str(*webview)) Protected Flags.i = 0 Protected File.s, *file If *Awesomium Select *Awesomium\Type Case #Awe_Type_Gadget, #Awe_Type_Window If select_multiple_files Flags = #PB_Requester_MultiSelection Debug "multi" EndIf File = OpenFileRequester(awe_string_get_string(*title), awe_string_get_string(*default_path), "*.*", 0, Flags) If File If select_multiple_files ;-todo: multiple file selection Else *file = awe_string_create_from_utf16(File, Len(File)) awe_webview_choose_file(*webview, *file) awe_string_destroy(*file) EndIf EndIf Case #Awe_Type_Texture, #Awe_Type_Sprite If *Awesomium\CB_FileRequester *Awesomium\CB_FileRequester(*Awesomium\ID, select_multiple_files, awe_string_get_string(*title), awe_string_get_string(*default_path)) EndIf EndSelect EndIf EndProcedure ProcedureC Awe_CursorChangeCallback(*webview, cursor.i) Protected *Awesomium.Awesomium = Awe_Mapper(Str(*webview)) If *Awesomium Select *Awesomium\Type Case #Awe_Type_Gadget Protected Gadget.i = *Awesomium\Gadget Select Cursor Case #AWE_CUR_POINTER SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_CROSS SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Cross) Case #AWE_CUR_HAND SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Hand) Case #AWE_CUR_IBEAM SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_IBeam) Case #AWE_CUR_WAIT SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Busy) Case #AWE_CUR_HELP SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_EAST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftRight) Case #AWE_CUR_NORTH_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_UpDown) Case #AWE_CUR_NORTHEAST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftDownUpRight) Case #AWE_CUR_NORTHWEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftUpDownRight) Case #AWE_CUR_SOUTH_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_UpDown) Case #AWE_CUR_SOUTHEAST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftUpDownRight) Case #AWE_CUR_SOUTHWEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftDownUpRight) Case #AWE_CUR_WEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftRight) Case #AWE_CUR_NORTHSOUTH_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_UpDown) Case #AWE_CUR_EASTWEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftRight) Case #AWE_CUR_NORTHEAST_SOUTHWEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftDownUpRight) Case #AWE_CUR_NORTHWEST_SOUTHEAST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftUpDownRight) Case #AWE_CUR_COLUMN_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftRight) Case #AWE_CUR_ROW_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_UpDown) Case #AWE_CUR_MIDDLE_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_EAST_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_NORTH_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_NORTHEAST_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_NORTHWEST_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_SOUTH_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_SOUTHEAST_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_SOUTHWEST_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_WEST_PANNING SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_MOVE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Arrows) Case #AWE_CUR_VERTICAL_TEXT SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_IBeam) Case #AWE_CUR_CELL SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_CONTEXT_MENU SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_ALIAS SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_PROGRESS SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_NO_DROP SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Denied) Case #AWE_CUR_COPY SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_NONE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Invisible) Case #AWE_CUR_NOT_ALLOWED SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Denied) Case #AWE_CUR_ZOOM_IN SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_ZOOM_OUT SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) Case #AWE_CUR_CUSTOM SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Default) EndSelect Case #Awe_Type_Window Protected WindowID.i = WindowID(*Awesomium\Window) Select Cursor Case #AWE_CUR_POINTER SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_CROSS SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_CROSS)) Case #AWE_CUR_HAND SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_HAND)) Case #AWE_CUR_IBEAM SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_IBEAM)) Case #AWE_CUR_WAIT SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_WAIT)) Case #AWE_CUR_HELP SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_HELP)) Case #AWE_CUR_EAST_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZEWE)) Case #AWE_CUR_NORTH_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZENS)) Case #AWE_CUR_NORTHEAST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftDownUpRight) Case #AWE_CUR_NORTHWEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftUpDownRight) Case #AWE_CUR_SOUTH_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZENS)) Case #AWE_CUR_SOUTHEAST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftUpDownRight) Case #AWE_CUR_SOUTHWEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftDownUpRight) Case #AWE_CUR_WEST_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZEWE)) Case #AWE_CUR_NORTHSOUTH_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZENS)) Case #AWE_CUR_EASTWEST_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZEWE)) Case #AWE_CUR_NORTHEAST_SOUTHWEST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftDownUpRight) Case #AWE_CUR_NORTHWEST_SOUTHEAST_RESIZE SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_LeftUpDownRight) Case #AWE_CUR_COLUMN_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZEWE)) Case #AWE_CUR_ROW_RESIZE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZENS)) Case #AWE_CUR_MIDDLE_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_EAST_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_NORTH_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_NORTHEAST_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_NORTHWEST_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_SOUTH_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_SOUTHEAST_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_SOUTHWEST_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_WEST_PANNING SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_MOVE SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_SIZEALL)) Case #AWE_CUR_VERTICAL_TEXT SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_IBEAM)) Case #AWE_CUR_CELL SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_CONTEXT_MENU SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_ALIAS SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_PROGRESS SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_NO_DROP SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_NO)) Case #AWE_CUR_COPY SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_NONE ;SetGadgetAttribute(Gadget, #PB_Canvas_Cursor, #PB_Cursor_Invisible) Case #AWE_CUR_NOT_ALLOWED SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_NO)) Case #AWE_CUR_ZOOM_IN SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_ZOOM_OUT SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) Case #AWE_CUR_CUSTOM SetClassLong_(WindowID, #GCL_HCURSOR, LoadCursor_(0, #IDC_ARROW)) EndSelect Case #Awe_Type_Texture, #Awe_Type_Sprite If *Awesomium\CB_CursorChange *Awesomium\CB_CursorChange(*Awesomium\ID, Cursor) EndIf EndSelect EndIf EndProcedure ProcedureC Awe_TitleCallback(*webview, *title, *framename) Protected *Awesomium.Awesomium = Awe_Mapper(Str(*webview)) Protected Title.s = awe_string_get_string(*title) Protected FrameName.s = awe_string_get_string(*framename) If *Awesomium If FrameName = "" *Awesomium\Title = Title EndIf If *Awesomium\CB_Title *Awesomium\CB_Title(*Awesomium\ID, Title, FrameName) EndIf EndIf EndProcedure Procedure Awe_LoadFavicon(*Awesomium.Awesomium) Protected *javascript, *js_object, *strUrl, Url.s Protected TmpFile.s, tmpImage.i, oldImage.i Protected Javascript.s = "(function(){" Javascript + "headerElement = document.getElementsByTagName('head')[0];" Javascript + "link = headerElement.getElementsByTagName('link');" Javascript + "for (i = 0; i < link.length; i++) {" Javascript + "if (link[i].getAttribute('rel') == 'shortcut icon') {" Javascript + "return link[i].getAttribute('href');" Javascript + "}" Javascript + "}" Javascript + "})();" *javascript = awe_string_create_from_utf16(Javascript, Len(Javascript)) *js_object = awe_webview_execute_javascript_with_result(*Awesomium\WebView, *javascript, awe_string_empty(), 0) *strUrl = awe_jsvalue_to_string(*js_object) Url = awe_string_get_string(*strUrl) awe_string_destroy(*strUrl) awe_string_destroy(*javascript) awe_jsvalue_destroy(*js_object) If Not Url Protected *url = awe_webview_get_url(*Awesomium\WebView) Url = GetURLPart(awe_string_get_string(*url), #PB_URL_Protocol) + "://" + GetURLPart(awe_string_get_string(*url), #PB_URL_Site) + "/favicon.ico" awe_string_destroy(*url) ElseIf LCase(Left(Url, 7)) <> "http://" If Left(Url, 2) = "//" Url = "http:" + Url ElseIf Left(Url, 1) = "/" *url = awe_webview_get_url(*Awesomium\WebView) Url = GetURLPart(awe_string_get_string(*url), #PB_URL_Protocol) + "://" + GetURLPart(awe_string_get_string(*url), #PB_URL_Site) + Url awe_string_destroy(*url) Else Url = "http://" + Url EndIf EndIf If Url <> *Awesomium\FaviconPath *Awesomium\FaviconPath = Url oldImage = *Awesomium\Favicon tmpFile = GetTemporaryDirectory() + "Fav" + Str(*Awesomium)+ ".ico" ; Debug tmpFile ; Debug "Fav: " + Url ; Debug "" If ReceiveHTTPFile(Url, tmpFile) tmpImage = LoadImage(#PB_Any, tmpFile) If tmpImage *Awesomium\Favicon = CreateImage(#PB_Any, ImageWidth(tmpImage), ImageHeight(tmpImage), 32) StartDrawing(ImageOutput(*Awesomium\Favicon)) DrawingMode(#PB_2DDrawing_AllChannels) DrawImage(ImageID(tmpImage), 0, 0) StopDrawing() FreeImage(tmpImage) DeleteFile(tmpFile) Else *Awesomium\Favicon = #Null EndIf Else *Awesomium\Favicon = #Null EndIf If *Awesomium\CB_Favicon If *Awesomium\Favicon *Awesomium\CB_Favicon(*Awesomium\ID, CopyImage(*Awesomium\Favicon, #PB_Any)) Else *Awesomium\CB_Favicon(*Awesomium\ID, #Null) EndIf EndIf EndIf If oldImage : FreeImage(oldImage) : EndIf EndProcedure ProcedureC Awe_DomReadyCallback(*webview) ; If FindMapElement(Awe_Mapper(), Str(*webview)) ; Protected Javascript.s = "documentElement.write('