38#ifndef ULTRALIGHT_CAPI_VIEW_H
39#define ULTRALIGHT_CAPI_VIEW_H
419 unsigned int line_number,
unsigned int column_number,
479 ULString error_domain,
int error_code);
488 unsigned long long frame_id,
bool is_main_frame,
Various defines and utility functions for the C API.
ULMessageSource
Definition CAPI_Defines.h:78
struct C_View * ULView
Definition CAPI_Defines.h:63
struct C_String * ULString
Definition CAPI_Defines.h:65
struct C_Session * ULSession
Definition CAPI_Defines.h:61
#define ULExport
Definition CAPI_Defines.h:38
struct C_Surface * ULSurface
Definition CAPI_Defines.h:73
ULMessageLevel
Definition CAPI_Defines.h:98
ULCursor
Definition CAPI_Defines.h:106
struct C_MouseEvent * ULMouseEvent
Definition CAPI_Defines.h:68
struct C_ViewConfig * ULViewConfig
Definition CAPI_Defines.h:62
struct C_ScrollEvent * ULScrollEvent
Definition CAPI_Defines.h:69
struct C_Renderer * ULRenderer
Definition CAPI_Defines.h:60
struct C_KeyEvent * ULKeyEvent
Definition CAPI_Defines.h:67
void(*) ULChangeTooltipCallback(void *user_data, ULView caller, ULString tooltip)
Definition CAPI_View.h:401
void ulViewFireMouseEvent(ULView view, ULMouseEvent mouse_event)
Fire a mouse event.
void ulViewConfigSetInitialFocus(ULViewConfig config, bool is_focused)
Set whether or not the View should initially have input focus.
ULView ulCreateView(ULRenderer renderer, unsigned int width, unsigned int height, ULViewConfig view_config, ULSession session)
Create a View with certain size (in pixels).
void ulViewConfigSetIsTransparent(ULViewConfig config, bool is_transparent)
Set whether images should be enabled (Default = True).
void ulViewCreateLocalInspectorView(ULView view)
Create an Inspector View to inspect / debug this View locally.
JSContextRef ulViewLockJSContext(ULView view)
Acquire the page's JSContext for use with JavaScriptCore API.
void ulViewReload(ULView view)
Reload current page.
void ulViewSetUpdateHistoryCallback(ULView view, ULUpdateHistoryCallback callback, void *user_data)
Set callback for when the history (back/forward state) is modified.
void(*) ULChangeCursorCallback(void *user_data, ULView caller, ULCursor cursor)
Definition CAPI_View.h:409
ULString ulViewGetTitle(ULView view)
Get current title.
void ulViewConfigSetFontFamilyFixed(ULViewConfig config, ULString font_name)
Set default font-family to use for fixed fonts, eg.
void ulViewSetFailLoadingCallback(ULView view, ULFailLoadingCallback callback, void *user_data)
Set callback for when an error occurs while loading a URL into a frame.
ULString ulViewGetURL(ULView view)
Get current URL.
void ulViewSetDOMReadyCallback(ULView view, ULDOMReadyCallback callback, void *user_data)
Set callback for when all JavaScript has been parsed and the document is ready.
bool ulViewHasFocus(ULView view)
Whether or not the View has focus.
ULRenderTarget ulViewGetRenderTarget(ULView view)
Get the RenderTarget for the View.
void ulViewSetChangeCursorCallback(ULView view, ULChangeCursorCallback callback, void *user_data)
Set callback for when the mouse cursor changes.
void(*) ULChangeTitleCallback(void *user_data, ULView caller, ULString title)
Definition CAPI_View.h:385
double ulViewGetDeviceScale(ULView view)
Get the device scale, ie.
bool ulViewGetNeedsPaint(ULView view)
Whether or not a view should be painted during the next call to ulRender.
void(*) ULDOMReadyCallback(void *user_data, ULView caller, unsigned long long frame_id, bool is_main_frame, ULString url)
Definition CAPI_View.h:506
void ulViewGoForward(ULView view)
Navigate forwards in history.
void ulDestroyViewConfig(ULViewConfig config)
Destroy view configuration.
void ulViewSetBeginLoadingCallback(ULView view, ULBeginLoadingCallback callback, void *user_data)
Set callback for when the page begins loading a new URL into a frame.
void ulViewSetCreateChildViewCallback(ULView view, ULCreateChildViewCallback callback, void *user_data)
Set callback for when the page wants to create a new View.
ULSurface ulViewGetSurface(ULView view)
Get the Surface for the View (native pixel buffer that the CPU renderer draws into).
void(*) ULUpdateHistoryCallback(void *user_data, ULView caller)
Definition CAPI_View.h:517
void ulViewGoToHistoryOffset(ULView view, int offset)
Navigate to arbitrary offset in history.
void ulViewConfigSetUserAgent(ULViewConfig config, ULString agent_string)
Set user agent string (See <Ultralight/platform/Config.h> for the default).
unsigned int ulViewGetHeight(ULView view)
Get the height, in pixels.
void ulViewSetDeviceScale(ULView view, double scale)
Set the device scale.
void ulViewFireScrollEvent(ULView view, ULScrollEvent scroll_event)
Fire a scroll event.
void ulViewFocus(ULView view)
Give focus to the View.
void ulViewLoadURL(ULView view, ULString url_string)
Load a URL into main frame.
void(*) ULChangeURLCallback(void *user_data, ULView caller, ULString url)
Definition CAPI_View.h:393
void ulViewSetAddConsoleMessageCallback(ULView view, ULAddConsoleMessageCallback callback, void *user_data)
Set callback for when a message is added to the console (useful for JavaScript / network errors and d...
void ulViewLoadHTML(ULView view, ULString html_string)
Load a raw string of HTML.
bool ulViewIsLoading(ULView view)
Check if the main frame of the page is currrently loading.
void ulViewSetNeedsPaint(ULView view, bool needs_paint)
Set whether or not a view should be repainted during the next call to ulRender.
void ulViewConfigSetFontFamilySerif(ULViewConfig config, ULString font_name)
Set default font-family to use for serif fonts (Default = Times New Roman).
ULView(*) ULCreateChildViewCallback(void *user_data, ULView caller, ULString opener_url, ULString target_url, bool is_popup, ULIntRect popup_rect)
Definition CAPI_View.h:429
ULString ulViewEvaluateScript(ULView view, ULString js_string, ULString *exception)
Evaluate a string of JavaScript and return result.
void ulViewUnfocus(ULView view)
Remove focus from the View and unfocus any focused input elements.
void ulViewSetFinishLoadingCallback(ULView view, ULFinishLoadingCallback callback, void *user_data)
Set callback for when the page finishes loading a URL into a frame.
bool ulViewIsTransparent(ULView view)
Whether or not the View supports transparent backgrounds.
void ulViewConfigSetIsAccelerated(ULViewConfig config, bool is_accelerated)
Set whether to render using the GPU renderer (accelerated) or the CPU renderer (unaccelerated).
void ulViewSetWindowObjectReadyCallback(ULView view, ULWindowObjectReadyCallback callback, void *user_data)
Set callback for when the JavaScript window object is reset for a new page load.
void ulViewStop(ULView view)
Stop all page loads.
bool ulViewCanGoForward(ULView view)
Check if can navigate forwards in history.
unsigned int ulViewGetWidth(ULView view)
Get the width, in pixels.
void(*) ULWindowObjectReadyCallback(void *user_data, ULView caller, unsigned long long frame_id, bool is_main_frame, ULString url)
Definition CAPI_View.h:487
void ulViewConfigSetInitialDeviceScale(ULViewConfig config, double initial_device_scale)
Set the initial device scale, ie.
void ulViewSetDisplayId(ULView view, unsigned int display_id)
Set the display id of the View.
void ulViewConfigSetEnableImages(ULViewConfig config, bool enabled)
Set whether images should be enabled (Default = True).
void ulViewConfigSetFontFamilySansSerif(ULViewConfig config, ULString font_name)
Set default font-family to use for sans-serif fonts (Default = Arial).
void ulViewSetChangeTooltipCallback(ULView view, ULChangeTooltipCallback callback, void *user_data)
Set callback for when the tooltip changes (usually result of a mouse hover).
bool ulViewCanGoBack(ULView view)
Check if can navigate backwards in history.
void ulViewGoBack(ULView view)
Navigate backwards in history.
void ulViewFireKeyEvent(ULView view, ULKeyEvent key_event)
Fire a keyboard event.
void ulViewConfigSetDisplayId(ULViewConfig config, unsigned int display_id)
Set a user-generated id of the display (monitor, TV, or screen) that the View will be shown on.
void ulViewUnlockJSContext(ULView view)
Unlock the page's JSContext after a previous call to ulViewLockJSContext().
unsigned int ulViewGetDisplayId(ULView view)
bool ulViewIsAccelerated(ULView view)
Whether or not the View is GPU-accelerated.
ULViewConfig ulCreateViewConfig()
Create view configuration with default values (see <Ultralight/platform/View.h>).
void ulDestroyView(ULView view)
Destroy a View.
void(*) ULAddConsoleMessageCallback(void *user_data, ULView caller, ULMessageSource source, ULMessageLevel level, ULString message, unsigned int line_number, unsigned int column_number, ULString source_id)
Definition CAPI_View.h:417
void(*) ULFinishLoadingCallback(void *user_data, ULView caller, unsigned long long frame_id, bool is_main_frame, ULString url)
Definition CAPI_View.h:468
void ulViewConfigSetFontFamilyStandard(ULViewConfig config, ULString font_name)
Set default font-family to use (Default = Times New Roman).
void ulViewSetCreateInspectorViewCallback(ULView view, ULCreateInspectorViewCallback callback, void *user_data)
Set callback for when the page wants to create a new View to display the local inspector in.
void ulViewConfigSetEnableJavaScript(ULViewConfig config, bool enabled)
Set whether JavaScript should be enabled (Default = True).
void(*) ULBeginLoadingCallback(void *user_data, ULView caller, unsigned long long frame_id, bool is_main_frame, ULString url)
Definition CAPI_View.h:459
bool ulViewHasInputFocus(ULView view)
Whether or not the View has an input element with visible keyboard focus (indicated by a blinking car...
void ulViewResize(ULView view, unsigned int width, unsigned int height)
Resize view to a certain width and height (in pixels).
void ulViewSetChangeTitleCallback(ULView view, ULChangeTitleCallback callback, void *user_data)
Set callback for when the page title changes.
void ulViewSetChangeURLCallback(ULView view, ULChangeURLCallback callback, void *user_data)
Set callback for when the page URL changes.
void(*) ULFailLoadingCallback(void *user_data, ULView caller, unsigned long long frame_id, bool is_main_frame, ULString url, ULString description, ULString error_domain, int error_code)
Definition CAPI_View.h:477
ULView(*) ULCreateInspectorViewCallback(void *user_data, ULView caller, bool is_local, ULString inspected_url)
Definition CAPI_View.h:447
const struct OpaqueJSContext * JSContextRef
Definition JSBase.h:43
Definition CAPI_Defines.h:257
Offscreen render target, used when rendering Views via the GPU renderer.
Definition CAPI_Defines.h:273