#include <OffscreenGecko/browser.h>
Public Member Functions | |
Browser (WrappedType *obj) | |
Browser (Embedding &embedding, int width, int height) | |
Create a new browser object. | |
void | Focus () |
Give focus to this browser object. | |
OSGK_AntiAliasType | GetAntialias () |
Get antialiasing type. | |
bool | GetPreferredDimensions (int &preferredWidth, int &preferredHeight, int maxWidth=-1) |
Get the preferred dimensions of the displayed content. | |
void | Navigate (const char *uri) |
Navigate a given URI. | |
Browser & | operator= (const Browser &other) |
void | Resize (int width, int height) |
Resize browser object to the specified dimensions. | |
void | SetAntialias (OSGK_AntiAliasType aaType) |
Set antialiasing types. | |
Keyboard events | |
bool | EventKey (unsigned int key, OSGK_KeyboardEventType eventType) |
Send keyboard input to the browser object. | |
Mouse events | |
void | EventMouseButton (OSGK_MouseButton button, OSGK_MouseButtonEventType eventType) |
Send a mouse button event to the browser object. | |
void | EventMouseMove (int x, int y) |
Send a mouse move event to the browser object. | |
void | EventMouseWheel (OSGK_WheelAxis axis, OSGK_WheelDirection direction) |
Send a mouse wheel event to the browser object. | |
User data | |
Allows to attach arbitrary user data to the browser object. | |
bool | GetUserData (unsigned int key, void *&data) |
Get a user data value. | |
bool | SetUserData (unsigned int key, void *data, bool overrideData=false) |
Set a user data value. | |
Pixel data acquisition | |
bool | IsDirty () |
Query if the browser object is 'dirty' (if the displayed data has changed since the last time the data was requested). | |
const unsigned char * | LockData (bool &isDirty) |
Lock the pixel data for the browser object. | |
const unsigned char * | LockData () |
Lock the pixel data for the browser object. | |
void | UnlockData (const unsigned char *data) |
Unlock the pixel data for the browser object obtained by an earlier LockData() call. | |
Progress queries | |
float | QueryLoadProgress () |
Poll the loading progress. | |
OSGK_LoadState | QueryLoadState () |
Poll the loading state. |
OSGK::Browser::Browser | ( | Embedding & | embedding, | |
int | width, | |||
int | height | |||
) | [inline] |
Create a new browser object.
Browsers encapsulate the display of content.
embedding | Parent embedding object. | |
width | Width of the display area. | |
height | Height of the display area. |
OSGK::Browser::Browser | ( | WrappedType * | obj | ) | [inline, explicit] |
bool OSGK::Browser::EventKey | ( | unsigned int | key, | |
OSGK_KeyboardEventType | eventType | |||
) | [inline] |
Send keyboard input to the browser object.
key | The code of the affected key. It can be either one of the OSGKKey_ codes are a Unicode character. | |
eventType | The type of event. |
void OSGK::Browser::EventMouseButton | ( | OSGK_MouseButton | button, | |
OSGK_MouseButtonEventType | eventType | |||
) | [inline] |
Send a mouse button event to the browser object.
button | The affected button. | |
eventType | The type of event. |
void OSGK::Browser::EventMouseMove | ( | int | x, | |
int | y | |||
) | [inline] |
Send a mouse move event to the browser object.
x | The X coordinate of the new mouse cursor position. | |
y | The Y coordinate of the new mouse cursor position. |
void OSGK::Browser::EventMouseWheel | ( | OSGK_WheelAxis | axis, | |
OSGK_WheelDirection | direction | |||
) | [inline] |
Send a mouse wheel event to the browser object.
axis | The axis of the scrolled wheel. | |
direction | The scroll direction. |
void OSGK::Browser::Focus | ( | ) | [inline] |
Give focus to this browser object.
Proper focus management is required for some things such as e.g. proper caret display.
OSGK_AntiAliasType OSGK::Browser::GetAntialias | ( | ) | [inline] |
Get antialiasing type.
bool OSGK::Browser::GetPreferredDimensions | ( | int & | preferredWidth, | |
int & | preferredHeight, | |||
int | maxWidth = -1 | |||
) | [inline] |
Get the preferred dimensions of the displayed content.
The preferred dimensions are the dimensions at which no scrollbars have to be displayed and no lines have to be wrapped.
preferredWidth | Returns the preferred width. | |
preferredHeight | Returns the preferred height. | |
maxWidth | Sets the maximum returned width. If -1 the width is unbounded. |
bool OSGK::Browser::GetUserData | ( | unsigned int | key, | |
void *& | data | |||
) | [inline] |
Get a user data value.
key | The key by which the user data is identified. | |
data | Pointer to the variable to receive the user data. |
bool OSGK::Browser::IsDirty | ( | ) | [inline] |
Query if the browser object is 'dirty' (if the displayed data has changed since the last time the data was requested).
false
if data is unchanged, true
if changed. const unsigned char* OSGK::Browser::LockData | ( | bool & | isDirty | ) | [inline] |
Lock the pixel data for the browser object.
isDirty | Returns whether the browser is 'dirty' (ie the displayed data has changed since the last time the data was requested). |
const unsigned char* OSGK::Browser::LockData | ( | ) | [inline] |
Lock the pixel data for the browser object.
void OSGK::Browser::Navigate | ( | const char * | uri | ) | [inline] |
Navigate a given URI.
uri | The URI to navigate to. Encoding is UTF-8. |
float OSGK::Browser::QueryLoadProgress | ( | ) | [inline] |
Poll the loading progress.
OSGK_LoadState OSGK::Browser::QueryLoadState | ( | ) | [inline] |
Poll the loading state.
void OSGK::Browser::Resize | ( | int | width, | |
int | height | |||
) | [inline] |
Resize browser object to the specified dimensions.
width | New width. | |
height | New height. |
void OSGK::Browser::SetAntialias | ( | OSGK_AntiAliasType | aaType | ) | [inline] |
Set antialiasing types.
aaType | The antialiasing type. |
bool OSGK::Browser::SetUserData | ( | unsigned int | key, | |
void * | data, | |||
bool | overrideData = false | |||
) | [inline] |
Set a user data value.
key | The key by which the user data is identified. | |
data | The user data value. | |
overrideData | Whether to replace the user data if some data was already associated with the given key. If non-zero, any existing data will replaced with the given value and success is returned. If zero, any existing data will not be replaced, and failure is returned when some data was already set. |
void OSGK::Browser::UnlockData | ( | const unsigned char * | data | ) | [inline] |
Unlock the pixel data for the browser object obtained by an earlier LockData() call.
data | The data pointer as returned by LockData(). |