28 #ifndef ROCKETCORECONTEXT_H
29 #define ROCKETCORECONTEXT_H
51 class ContextInstancer;
52 class ElementDocument;
54 class RenderInterface;
74 const String& GetName()
const;
78 void SetDimensions(
const Vector2i& dimensions);
81 const Vector2i& GetDimensions()
const;
108 void UnloadAllDocuments();
120 void UnloadMouseCursor(
const String& cursor_name);
122 void UnloadAllMouseCursors();
126 bool SetMouseCursor(
const String& cursor_name);
129 void ShowMouseCursor(
bool show);
141 int GetNumDocuments()
const;
166 void AddEventListener(
const String& event,
EventListener* listener,
bool in_capture_phase =
false);
171 void RemoveEventListener(
const String& event,
EventListener* listener,
bool in_capture_phase =
false);
187 bool ProcessTextInput(
word character);
191 bool ProcessTextInput(
const String&
string);
197 void ProcessMouseMove(
int x,
int y,
int key_modifier_state);
201 void ProcessMouseButtonDown(
int button_index,
int key_modifier_state);
205 void ProcessMouseButtonUp(
int button_index,
int key_modifier_state);
210 bool ProcessMouseWheel(
int wheel_delta,
int key_modifier_state);
222 void SetActiveClipRegion(
const Vector2i& origin,
const Vector2i& dimensions);
229 virtual void OnReferenceDeactivate();
237 typedef std::set< ElementReference > ElementSet;
238 typedef std::vector< ElementReference >
ElementList;
240 ElementSet hover_chain;
242 ElementList active_chain;
244 ElementList document_focus_history;
247 ElementList unloaded_documents;
261 float last_click_time;
263 typedef std::map< String, ElementDocument* > CursorMap;
285 ElementSet drag_hover_chain;
296 void OnElementRemove(
Element* element);
298 bool OnFocusChange(
Element* element);
301 void GenerateClickEvent(
Element* element);
315 void CreateDragClone(
Element* element);
317 void ReleaseDragClone();
322 void GenerateMouseEventParameters(
Dictionary& parameters,
int button_index = -1);
324 void GenerateKeyModifierEventParameters(
Dictionary& parameters,
int key_modifier_state);
326 void GenerateDragEventParameters(
Dictionary& parameters);
329 void ReleaseUnloadedDocuments();
332 static void SendEvents(
const ElementSet& old_items,
const ElementSet& new_items,
const String& event,
const Dictionary& parameters,
bool interruptible);
#define NULL
Definition: Types.h:33
Definition: ElementDocument.h:55
ROCKETCORE_API RenderInterface * GetRenderInterface()
Definition: ScriptInterface.h:43
Definition: Clipboard.h:33
Definition: EventListener.h:46
Definition: Dictionary.h:44
unsigned short word
Definition: Types.h:51
ROCKETCORE_API Context * CreateContext(const String &name, const Vector2i &dimensions, RenderInterface *render_interface=NULL)
Definition: ElementReference.h:44
Definition: RenderInterface.h:48
std::vector< Element * > ElementList
Definition: Types.h:90
Definition: ContextInstancer.h:46