OSGK::Browser Struct Reference

Browser - encapsulates the display of content. More...

#include <OffscreenGecko/browser.h>

Inheritance diagram for OSGK::Browser:

OSGK::CXXAPI::Wrap< OSGK_Browser >

List of all members.

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.
Browseroperator= (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.


Detailed Description

Browser - encapsulates the display of content.

See also:
Dealing with OffscreenGecko objects (C++)

Constructor & Destructor Documentation

OSGK::Browser::Browser ( Embedding embedding,
int  width,
int  height 
) [inline]

Create a new browser object.

Browsers encapsulate the display of content.

Parameters:
embedding Parent embedding object.
width Width of the display area.
height Height of the display area.

OSGK::Browser::Browser ( WrappedType obj  )  [inline, explicit]


Member Function Documentation

bool OSGK::Browser::EventKey ( unsigned int  key,
OSGK_KeyboardEventType  eventType 
) [inline]

Send keyboard input to the browser object.

Parameters:
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.
Returns:
Whether the key was handled (non-zero) or not (zero).
See also:
KeyboardInputNotes, OSGKKey_Backspace

void OSGK::Browser::EventMouseButton ( OSGK_MouseButton  button,
OSGK_MouseButtonEventType  eventType 
) [inline]

Send a mouse button event to the browser object.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Remarks:
Focus can be taken away by giving it to another browser object or clearing it with Embedding::ClearFocus().

OSGK_AntiAliasType OSGK::Browser::GetAntialias (  )  [inline]

Get antialiasing type.

Returns:
The 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.

Parameters:
preferredWidth Returns the preferred width.
preferredHeight Returns the preferred height.
maxWidth Sets the maximum returned width. If -1 the width is unbounded.
Returns:
Whether obtaining the preferred width was successful. If not, the values referenced by preferredWidth and preferredHeight are unchanged.
Remarks:
The returned preferred width may be larger than maxWidth if scrollbars would be displayed. Thus, if providing a maximum width of 0, the returned preferred width is the minimal width at which no scrollbars are displayed.

bool OSGK::Browser::GetUserData ( unsigned int  key,
void *&  data 
) [inline]

Get a user data value.

Parameters:
key The key by which the user data is identified.
data Pointer to the variable to receive the user data.
Returns:
Whether getting the user data value was successful (non-zero) or not (zero).

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).

Returns:
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.

Parameters:
isDirty Returns whether the browser is 'dirty' (ie the displayed data has changed since the last time the data was requested).
Returns:
A pointer to the pixel data, in BGRA byte order. Alpha is premultiplied.
Remarks:
  • You need to call UnlockData() after finishing processing the returned data.
  • Multiple calls to LockData() for the same browser object are allowed; however, as long as the data is at least locked once it may not be updated and reflect changes to the displayed content.
  • The returned buffer has the dimensions of the browser object at the time of locking.

const unsigned char* OSGK::Browser::LockData (  )  [inline]

Lock the pixel data for the browser object.

Returns:
A pointer to the pixel data, in BGRA byte order. Alpha is premultiplied.
Remarks:
You need to call UnlockData() after finishing processing the returned data.

void OSGK::Browser::Navigate ( const char *  uri  )  [inline]

Navigate a given URI.

Parameters:
uri The URI to navigate to. Encoding is UTF-8.

Browser& OSGK::Browser::operator= ( const Browser other  )  [inline]

float OSGK::Browser::QueryLoadProgress (  )  [inline]

Poll the loading progress.

Returns:
A float value between 0 and 1 where 0 means loading did not progress and 1 means loading is completed.
Remarks:
This function is intended for feedback display. To programmatically check whether a URI was loaded completely use QueryLoadState().

OSGK_LoadState OSGK::Browser::QueryLoadState (  )  [inline]

Poll the loading state.

Returns:
The loading state (loading or completed).

void OSGK::Browser::Resize ( int  width,
int  height 
) [inline]

Resize browser object to the specified dimensions.

Parameters:
width New width.
height New height.

void OSGK::Browser::SetAntialias ( OSGK_AntiAliasType  aaType  )  [inline]

Set antialiasing types.

Parameters:
aaType The antialiasing type.

bool OSGK::Browser::SetUserData ( unsigned int  key,
void *  data,
bool  overrideData = false 
) [inline]

Set a user data value.

Parameters:
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.
Returns:
Whether setting the user data value was successful (non-zero) or not (zero).

void OSGK::Browser::UnlockData ( const unsigned char *  data  )  [inline]

Unlock the pixel data for the browser object obtained by an earlier LockData() call.

Parameters:
data The data pointer as returned by LockData().
Warning:
Do not use the data after this function!


The documentation for this struct was generated from the following file:
Generated on Sun Nov 2 18:15:18 2008 for OffscreenGecko by  doxygen 1.5.4