Loading...
Searching...
No Matches
CAPI_Defines.h File Reference

Overview

Various defines and utility functions for the C API.

#include <Ultralight/CAPI/CAPI_Defines.h>

This file contains various defines, structures, and utility functions for the C API.

Classes

struct  ULRect
 
struct  ULIntRect
 
struct  ULRenderTarget
 Offscreen render target, used when rendering Views via the GPU renderer. More...
 

Functions

ULExport const char * ulVersionString ()
 Get the version string of the library in MAJOR.MINOR.PATCH format.
 
ULExport unsigned int ulVersionMajor ()
 Get the numeric major version of the library.
 
ULExport unsigned int ulVersionMinor ()
 Get the numeric minor version of the library.
 
ULExport unsigned int ulVersionPatch ()
 Get the numeric patch version of the library.
 
ULExport const char * ulWebKitVersionString ()
 Get the full WebKit version string.
 

Macros

#define ULExport   __attribute__((visibility("default")))
 
#define _thread_local   __thread
 

Typedefs

typedef unsigned short ULChar16
 
typedef struct C_Config * ULConfig
 
typedef struct C_Renderer * ULRenderer
 
typedef struct C_Session * ULSession
 
typedef struct C_ViewConfig * ULViewConfig
 
typedef struct C_View * ULView
 
typedef struct C_Bitmap * ULBitmap
 
typedef struct C_String * ULString
 
typedef struct C_Buffer * ULBuffer
 
typedef struct C_KeyEvent * ULKeyEvent
 
typedef struct C_MouseEvent * ULMouseEvent
 
typedef struct C_ScrollEvent * ULScrollEvent
 
typedef struct C_GamepadEvent * ULGamepadEvent
 
typedef struct C_GamepadAxisEvent * ULGamepadAxisEvent
 
typedef struct C_GamepadButtonEvent * ULGamepadButtonEvent
 
typedef struct C_Surface * ULSurface
 
typedef struct C_Surface * ULBitmapSurface
 
typedef struct C_FontFile * ULFontFile
 
typedef struct C_ImageSource * ULImageSource
 

Enumerations

enum  ULMessageSource {
  kMessageSource_XML = 0 , kMessageSource_JS , kMessageSource_Network , kMessageSource_ConsoleAPI ,
  kMessageSource_Storage , kMessageSource_AppCache , kMessageSource_Rendering , kMessageSource_CSS ,
  kMessageSource_Security , kMessageSource_ContentBlocker , kMessageSource_Media , kMessageSource_MediaSource ,
  kMessageSource_WebRTC , kMessageSource_ITPDebug , kMessageSource_PrivateClickMeasurement , kMessageSource_PaymentRequest ,
  kMessageSource_Other
}
 
enum  ULMessageLevel {
  kMessageLevel_Log = 0 , kMessageLevel_Warning , kMessageLevel_Error , kMessageLevel_Debug ,
  kMessageLevel_Info
}
 
enum  ULCursor {
  kCursor_Pointer = 0 , kCursor_Cross , kCursor_Hand , kCursor_IBeam ,
  kCursor_Wait , kCursor_Help , kCursor_EastResize , kCursor_NorthResize ,
  kCursor_NorthEastResize , kCursor_NorthWestResize , kCursor_SouthResize , kCursor_SouthEastResize ,
  kCursor_SouthWestResize , kCursor_WestResize , kCursor_NorthSouthResize , kCursor_EastWestResize ,
  kCursor_NorthEastSouthWestResize , kCursor_NorthWestSouthEastResize , kCursor_ColumnResize , kCursor_RowResize ,
  kCursor_MiddlePanning , kCursor_EastPanning , kCursor_NorthPanning , kCursor_NorthEastPanning ,
  kCursor_NorthWestPanning , kCursor_SouthPanning , kCursor_SouthEastPanning , kCursor_SouthWestPanning ,
  kCursor_WestPanning , kCursor_Move , kCursor_VerticalText , kCursor_Cell ,
  kCursor_ContextMenu , kCursor_Alias , kCursor_Progress , kCursor_NoDrop ,
  kCursor_Copy , kCursor_None , kCursor_NotAllowed , kCursor_ZoomIn ,
  kCursor_ZoomOut , kCursor_Grab , kCursor_Grabbing , kCursor_Custom
}
 
enum  ULBitmapFormat { kBitmapFormat_A8_UNORM , kBitmapFormat_BGRA8_UNORM_SRGB }
 
enum  ULKeyEventType { kKeyEventType_KeyDown , kKeyEventType_KeyUp , kKeyEventType_RawKeyDown , kKeyEventType_Char }
 
enum  ULMouseEventType { kMouseEventType_MouseMoved , kMouseEventType_MouseDown , kMouseEventType_MouseUp }
 
enum  ULMouseButton { kMouseButton_None = 0 , kMouseButton_Left , kMouseButton_Middle , kMouseButton_Right }
 
enum  ULScrollEventType { kScrollEventType_ScrollByPixel , kScrollEventType_ScrollByPage }
 
enum  ULGamepadEventType { kGamepadEventType_Connected , kGamepadEventType_Disconnected }
 
enum  ULFaceWinding { kFaceWinding_Clockwise , kFaceWinding_CounterClockwise }
 
enum  ULFontHinting { kFontHinting_Smooth , kFontHinting_Normal , kFontHinting_Monochrome }
 

Function Documentation

◆ ulVersionMajor()

ULExport unsigned int ulVersionMajor ( )

Get the numeric major version of the library.

◆ ulVersionMinor()

ULExport unsigned int ulVersionMinor ( )

Get the numeric minor version of the library.

◆ ulVersionPatch()

ULExport unsigned int ulVersionPatch ( )

Get the numeric patch version of the library.

◆ ulVersionString()

ULExport const char * ulVersionString ( )

Get the version string of the library in MAJOR.MINOR.PATCH format.

◆ ulWebKitVersionString()

ULExport const char * ulWebKitVersionString ( )

Get the full WebKit version string.

Macro Definition Documentation

◆ _thread_local

#define _thread_local   __thread

◆ ULExport

#define ULExport   __attribute__((visibility("default")))

Typedef Documentation

◆ ULBitmap

typedef struct C_Bitmap* ULBitmap

◆ ULBitmapSurface

typedef struct C_Surface* ULBitmapSurface

◆ ULBuffer

typedef struct C_Buffer* ULBuffer

◆ ULChar16

typedef unsigned short ULChar16

◆ ULConfig

typedef struct C_Config* ULConfig

◆ ULFontFile

typedef struct C_FontFile* ULFontFile

◆ ULGamepadAxisEvent

typedef struct C_GamepadAxisEvent* ULGamepadAxisEvent

◆ ULGamepadButtonEvent

typedef struct C_GamepadButtonEvent* ULGamepadButtonEvent

◆ ULGamepadEvent

typedef struct C_GamepadEvent* ULGamepadEvent

◆ ULImageSource

typedef struct C_ImageSource* ULImageSource

◆ ULKeyEvent

typedef struct C_KeyEvent* ULKeyEvent

◆ ULMouseEvent

typedef struct C_MouseEvent* ULMouseEvent

◆ ULRenderer

typedef struct C_Renderer* ULRenderer

◆ ULScrollEvent

typedef struct C_ScrollEvent* ULScrollEvent

◆ ULSession

typedef struct C_Session* ULSession

◆ ULString

typedef struct C_String* ULString

◆ ULSurface

typedef struct C_Surface* ULSurface

◆ ULView

typedef struct C_View* ULView

◆ ULViewConfig

typedef struct C_ViewConfig* ULViewConfig

Enumeration Type Documentation

◆ ULBitmapFormat

Enumerator
kBitmapFormat_A8_UNORM 

Alpha channel only, 8-bits per pixel.

Encoding: 8-bits per channel, unsigned normalized.

Color-space: Linear (no gamma), alpha-coverage only.

kBitmapFormat_BGRA8_UNORM_SRGB 

Blue Green Red Alpha channels, 32-bits per pixel.

Encoding: 8-bits per channel, unsigned normalized.

Color-space: sRGB gamma with premultiplied linear alpha channel.

◆ ULCursor

enum ULCursor
Enumerator
kCursor_Pointer 
kCursor_Cross 
kCursor_Hand 
kCursor_IBeam 
kCursor_Wait 
kCursor_Help 
kCursor_EastResize 
kCursor_NorthResize 
kCursor_NorthEastResize 
kCursor_NorthWestResize 
kCursor_SouthResize 
kCursor_SouthEastResize 
kCursor_SouthWestResize 
kCursor_WestResize 
kCursor_NorthSouthResize 
kCursor_EastWestResize 
kCursor_NorthEastSouthWestResize 
kCursor_NorthWestSouthEastResize 
kCursor_ColumnResize 
kCursor_RowResize 
kCursor_MiddlePanning 
kCursor_EastPanning 
kCursor_NorthPanning 
kCursor_NorthEastPanning 
kCursor_NorthWestPanning 
kCursor_SouthPanning 
kCursor_SouthEastPanning 
kCursor_SouthWestPanning 
kCursor_WestPanning 
kCursor_Move 
kCursor_VerticalText 
kCursor_Cell 
kCursor_ContextMenu 
kCursor_Alias 
kCursor_Progress 
kCursor_NoDrop 
kCursor_Copy 
kCursor_None 
kCursor_NotAllowed 
kCursor_ZoomIn 
kCursor_ZoomOut 
kCursor_Grab 
kCursor_Grabbing 
kCursor_Custom 

◆ ULFaceWinding

Enumerator
kFaceWinding_Clockwise 
kFaceWinding_CounterClockwise 

◆ ULFontHinting

Enumerator
kFontHinting_Smooth 

Lighter hinting algorithm– glyphs are slightly fuzzier but better resemble their original shape.

This is achieved by snapping glyphs to the pixel grid only vertically which better preserves inter-glyph spacing.

kFontHinting_Normal 

Default hinting algorithm– offers a good balance between sharpness and shape at smaller font sizes.

kFontHinting_Monochrome 

Strongest hinting algorithm– outputs only black/white glyphs.

The result is usually unpleasant if the underlying TTF does not contain hints for this type of rendering.

◆ ULGamepadEventType

Enumerator
kGamepadEventType_Connected 
kGamepadEventType_Disconnected 

◆ ULKeyEventType

Enumerator
kKeyEventType_KeyDown 

Key-Down event type.

This type does not trigger accelerator commands in WebCore (eg, Ctrl+C for copy is an accelerator command).

Warning
You should probably use kKeyEventType_RawKeyDown instead. This type is only here for historic compatibility with WebCore's key event types.
kKeyEventType_KeyUp 

Key-Up event type.

Use this when a physical key is released.

kKeyEventType_RawKeyDown 

Raw Key-Down type.

Use this when a physical key is pressed.

kKeyEventType_Char 

Character input event type.

Use this when the OS generates text from a physical key being pressed (eg, WM_CHAR on Windows).

◆ ULMessageLevel

Enumerator
kMessageLevel_Log 
kMessageLevel_Warning 
kMessageLevel_Error 
kMessageLevel_Debug 
kMessageLevel_Info 

◆ ULMessageSource

Enumerator
kMessageSource_XML 
kMessageSource_JS 
kMessageSource_Network 
kMessageSource_ConsoleAPI 
kMessageSource_Storage 
kMessageSource_AppCache 
kMessageSource_Rendering 
kMessageSource_CSS 
kMessageSource_Security 
kMessageSource_ContentBlocker 
kMessageSource_Media 
kMessageSource_MediaSource 
kMessageSource_WebRTC 
kMessageSource_ITPDebug 
kMessageSource_PrivateClickMeasurement 
kMessageSource_PaymentRequest 
kMessageSource_Other 

◆ ULMouseButton

Enumerator
kMouseButton_None 
kMouseButton_Left 
kMouseButton_Middle 
kMouseButton_Right 

◆ ULMouseEventType

Enumerator
kMouseEventType_MouseMoved 
kMouseEventType_MouseDown 
kMouseEventType_MouseUp 

◆ ULScrollEventType

Enumerator
kScrollEventType_ScrollByPixel 
kScrollEventType_ScrollByPage 

Go to the source code of this file.