Back to index

nux  3.0.0
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
nux::TestTextEntry Class Reference

#include <TestTextEntry.h>

Inheritance diagram for nux::TestTextEntry:
Inheritance graph
[legend]
Collaboration diagram for nux::TestTextEntry:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TestTextEntry (NUX_FILE_LINE_PROTO)
 ~TestTextEntry ()
void ResetEvents ()
void ResetKeyFocusEvents ()
 NUX_DECLARE_OBJECT_TYPE (InputArea, Area)
 NUX_DECLARE_OBJECT_TYPE (InitiallyUnownedObject, Object)
 NUX_DECLARE_OBJECT_TYPE (BaseObject, Trackable)
AreaFindAreaUnderMouse (const Point &mouse_position, NuxEventType event_type)
 Return the area under the mouse pointer.
virtual void Draw (GraphicsEngine &graphics_engine, bool force_draw)
virtual void DrawContent (GraphicsEngine &graphics_engine, bool force_draw)
virtual void PostDraw (GraphicsEngine &graphics_engine, bool force_draw)
void PreLayoutManagement ()
long PostLayoutManagement (long layoutResult)
void RecvMouseDoubleClick (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
void RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvKeyEvent (unsigned long eventType, unsigned long keysym, unsigned long state, const char *character, unsigned short keyCount)
void RecvStartKeyFocus ()
void RecvEndKeyFocus ()
void MainDraw ()
void ProcessMouseEvent (int event_type, int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
void ProcessKeyEvent (unsigned long eventType, unsigned long keysym, unsigned long state, const char *character, unsigned short keyCount)
void FocusInx ()
void FocusOutx ()
void SetText (const char *text)
std::string const & GetText () const
std::string GetTextSelection () const
void SetCompletion (const char *text)
std::string const & GetCompletion () const
void SetCompletionColor (const Color &color)
Color const & GetCompletionColor () const
void SetTextColor (const Color &color)
Color const & GetTextColor () const
virtual Color GetTextColor ()
void SetFontFamily (const char *font)
void SetFontSize (double font_size)
void SetFontOptions (const cairo_font_options_t *options)
void Select (int start, int end)
 Select text between start and end.
void SelectAll ()
 Select all text.
CairoGraphics::Alignment GetAlign () const
void SetAlign (CairoGraphics::Alignment align)
bool im_active ()
bool im_running ()
void MoveCursorToLineStart ()
 Public API.
void MoveCursorToLineEnd ()
void SetLoseKeyFocusOnKeyNavDirectionUp (bool b)
 When the text entry is in single line mode, the keyboard arrow up/down may be used to navigate to another view.
bool GetLoseKeyFocusOnKeyNavDirectionUp () const
void SetLoseKeyFocusOnKeyNavDirectionDown (bool b)
 When the text entry is in single line mode, the keyboard arrow up/down may be used to navigate to another view.
bool GetLoseKeyFocusOnKeyNavDirectionDown () const
bool IsInTextInputMode () const
 Return True if the text has been modified after the text entry has received the keyboard focus.
void EnterText (const char *str)
 Insert text at current caret position.
void DeleteText (int start, int end)
 Delete text in a specified range, in number of characters.
virtual long ComputeContentSize ()
virtual void ComputeContentPosition (float offsetX, float offsetY)
virtual void EnableView ()
 Enable a View.
virtual void DisableView ()
 Disable a View.
virtual void SetEnableView (bool enable)
 Set the enable state of the view.
bool IsViewEnabled () const
 Gets the enable state of the View.
virtual void ProcessDraw (GraphicsEngine &graphics_engine, bool force_draw)
virtual void QueueDraw ()
 Causes a redraw. The widget parameter draw_cmd_queued_ is set to true. The widget Draw(), DrawContent() and PostDraw() are called.
virtual void NeedSoftRedraw ()
 Causes a soft redraw. The widget parameter draw_cmd_queued_ is set to false. The widget DrawContent() and PostDraw() are called.
virtual bool IsRedrawNeeded ()
virtual void DoneRedraw ()
virtual void OverlayDrawing (GraphicsEngine &graphics_engine)
bool SearchInAllSubNodes (Area *bo)
bool SearchInFirstSubNodes (Area *bo)
virtual void SetGeometry (const Geometry &geo)
 Set Geometry.
void SetGeometry (int x, int y, int w, int h)
 Set the geometry of the object.
virtual bool CanBreakLayout ()
 Return true if this object can break the layout.
virtual LayoutGetLayout ()
 Get the default layout of this view.
virtual bool SetLayout (Layout *layout)
 Set the default layout for this view.
void SetFont (ObjectPtr< FontTexture > font)
ObjectPtr< FontTextureGetFont ()
virtual AreaKeyNavIteration (KeyNavDirection direction)
virtual bool AcceptKeyNavFocus ()
virtual bool AcceptKeyNavFocus () const
void IsHitDetectionSkipingChildren (bool skip_children)
virtual void OnDraw (GraphicsEngine &graphics_engine, bool force_draw)
 Draw InputArea.
bool HasKeyboardFocus ()
bool MouseFocusOnOtherArea ()
void CaptureMouseDownAnyWhereElse (bool b)
bool IsCaptureMouseDownAnyWhereElse () const
virtual void SetBaseString (const char *Caption)
void SetKeyboardReceiverIgnoreMouseDownOutside (bool ignore_mouse_down_outside)
void SetAcceptKeyNavFocusOnMouseDown (bool accept)
void SetAcceptKeyNavFocusOnMouseEnter (bool accept)
bool KeyboardReceiverIgnoreMouseDownOutside ()
virtual bool IsArea () const
void GrabPointer ()
void GrabKeyboard ()
void UnGrabPointer ()
void UnGrabKeyboard ()
bool OwnsPointerGrab ()
bool OwnsKeyboardGrab ()
bool IsMouseOwner ()
 Return true if this Area is the owner of the mouse pointer.
bool IsMouseInside ()
 Returns true if the mouse pointer has been determined as inside the this area, following event processing.
void EnableDoubleClick (bool double_click)
 Enable the double click event signal on this InputArea.
bool DoubleClickEnabled () const
 Returns true if the double click signal is enable for this InputArea.
int GetBaseX () const
int GetBaseY () const
int GetBaseWidth () const
int GetBaseHeight () const
void SetBaseX (int x)
void SetBaseY (int y)
void SetBaseXY (int x, int y)
void SetBaseWidth (int w)
void SetBaseHeight (int h)
virtual void SetBaseSize (int w, int h)
 Set the size of the object.
virtual void SetMinimumSize (int w, int h)
virtual void SetMaximumSize (int w, int h)
virtual void SetMinMaxSize (int w, int h)
virtual void SetMinimumWidth (int w)
virtual void SetMaximumWidth (int w)
virtual void SetMinimumHeight (int h)
virtual void SetMaximumHeight (int h)
virtual int GetMinimumWidth () const
virtual int GetMaximumWidth () const
virtual int GetMinimumHeight () const
virtual int GetMaximumHeight () const
virtual void ApplyMinWidth ()
virtual void ApplyMinHeight ()
virtual void ApplyMaxWidth ()
virtual void ApplyMaxHeight ()
virtual Size GetMinimumSize () const
virtual Size GetMaximumSize () const
Geometry const & GetGeometry () const
 Get the geometry of the object.
void IncreaseSize (int x, int y)
const NStringGetBaseString () const
AreaGetToplevel ()
 Deprecated. Use GetToplevel.
AreaGetRootParent ()
 Return the root parent of the rendering tree for this area.
AreaGetTopLevelViewWindow ()
 Return the Top level BaseWindow of this area.
bool HasTopLevelParent ()
 Return true is this area has a top level parent.
bool IsChildOf (Area *parent)
 Return true is area is a child of the given parent in the widget tree.
bool TestMousePointerInclusion (const Point &mouse_position, NuxEventType event_type)
 Test if a point is inside the area.
bool TestMousePointerInclusionFilterMouseWheel (const Point &mouse_position, NuxEventType event)
 Test if a point is inside the area and if the area accepts mouse wheel events.
bool IsMousePointerInside () const
 Test if the mouse pointer is inside the area.
virtual bool IsInputArea () const
virtual bool IsView () const
virtual bool IsLayout () const
virtual bool IsSpaceLayout () const
virtual bool IsViewWindow () const
AreaGetParentObject () const
void SetVisible (bool visible)
 Set visibility of the area.
bool IsVisible ()
 Get the visibility of the area.
void SetSensitive (bool)
 Deprecated. Use SetInputEventSensitivity.
void SetInputEventSensitivity (bool sensitive)
 Set input event sensitivity of the area.
bool IsSensitive () const
 Deprecated. Use GetInputEventSensitivity.
bool GetInputEventSensitivity () const
 Get input event sensitivity of the area is sensitive.
void QueueRelayout ()
 Queue a relayout.
virtual unsigned int GetScaleFactor ()
 Get the area scale factor.
virtual void SetScaleFactor (unsigned int sf)
 Set the area scale factor.
virtual MinorDimensionPosition GetPositioning ()
virtual void SetPositioning (MinorDimensionPosition p)
virtual MinorDimensionSize GetExtend ()
virtual void SetExtend (MinorDimensionSize ext)
virtual float GetPercentage ()
virtual void SetPercentage (float f)
virtual bool IsLayoutDone ()
virtual void SetLayoutDone (bool b)
void Set2DMatrix (const Matrix4 &mat)
void Set2DTranslation (float tx, float ty, float tz)
Matrix4 Get2DMatrix () const
Matrix4 Get3DMatrix () const
bool Is3DArea () const
virtual Geometry GetAbsoluteGeometry () const
 Return the position of this object with regard to the top left corner of the physical window.
int GetAbsoluteX () const
 Return the area absolute x coordinate.
int GetAbsoluteY () const
 Return the area absolute y coordinate.
int GetAbsoluteWidth () const
 Return the area absolute width.
int GetAbsoluteHeight () const
 Return the area absolute height.
virtual Geometry GetRootGeometry () const
 Return the position of this object with regard to its top level parent(the main layout or a BaseWindow).
int GetRootX () const
 Return the area root x coordinate.
int GetRootY () const
 Return the area root y coordinate.
int GetRootWidth () const
 Return the area root width.
int GetRootHeight () const
 Return the area root height.
virtual bool SetParentObject (Area *parent)
 SetParentObject/UnParentObject are protected API.
virtual void UnParentObject ()
 Un-parent and area.
void SetPathToKeyFocusArea ()
 Mark the path from this area to its top level parent as the one to follow
to get to the area that has the keyboard.
void ResetDownwardPathToKeyFocusArea ()
 Erase the path from this area to the child area that has the keyboard.
void ResetUpwardPathToKeyFocusArea ()
 Erase the path that marks this object as part of the keyboard focus chain,
from this area to its top level parent.
bool HasKeyFocus () const
void SetReconfigureParentLayoutOnGeometryChange (bool reconfigure_parent_layout)
 Set to True to initiate a layout reconfiguration when the geometry of this widget changes.
bool ReconfigureParentLayoutOnGeometryChange ()
 Return True if the the parent layouts of this area should be reconfigured on geometry changed.
void SetAcceptKeyboardEvent (bool accept_key_event)
 Enable keyboard event processing.
bool AcceptKeyboardEvent () const
 Return true if the Area is interested in keyboard events.
void SetAcceptMouseWheelEvent (bool accept_mouse_wheel_event)
 Enable mouse wheel event processing.
bool AcceptMouseWheelEvent () const
 Return true if the area is accepts mouse wheel events.
bool Reference ()
 Increase reference count.
bool UnReference ()
 Decrease reference count.
virtual bool SinkReference ()
 Mark the object as owned.
virtual bool Dispose ()
 Destroy and object that has a floating reference.
int GetReferenceCount () const
 Get the reference count of this object.
std::string GetAllocationLoation () const
 NUX_DECLARE_ROOT_OBJECT_TYPE (Trackable)
bool OwnsTheReference ()
 Test if object reference is owned.
bool IsHeapAllocated ()
 Test if object was allocated dynamically.
bool IsDynamic () const
 Test if object was allocated dynamically.
virtual int GetObjectSize ()
 Return the size of allocated for this object.
bool SetProperty (std::string const &name, const char *value)
 If the property was not able to be set with the value, the method returns false.
template<typename T >
bool SetProperty (std::string const &name, T const &value)
template<typename T >
GetProperty (std::string const &name, T *foo=0)
void AddProperty (std::string const &name, PropertyBase *property)

Static Public Member Functions

static std::new_handler set_new_handler (std::new_handler handler)
static void * operator new (size_t size)
static void * operator new (size_t size, void *ptr)
static void operator delete (void *ptr)

Public Attributes

bool has_focus_
bool registered_mouse_down_
bool registered_mouse_up_
bool registered_mouse_drag_
bool registered_mouse_click_
bool registered_mouse_double_click_
bool registered_mouse_move_
bool registered_mouse_enter_
bool registered_mouse_leave_
bool registered_object_destroyed_
bool registered_begin_keynav_focus_
bool registered_end_keynav_focus_
bool registered_text_changed_
nux::KeyNavDirection key_nav_direction_
 The key nav direction received when the view obtained the focus.
bool _size_match_text
BaseTexture_texture2D
sigc::signal< void, TextEntry * > text_changed
 Text changed signal.
sigc::signal< void > activated
sigc::signal< void, int > cursor_moved
sigc::signal< void, View
*, Layout * > 
LayoutAdded
sigc::signal< void, View
*, Layout * > 
LayoutRemoved
sigc::signal< void, View * > OnQueueDraw
 Signal emitted when a view is scheduled for a draw.
sigc::signal< void, int, int,
int, int, unsigned long,
unsigned long > 
mouse_move
 Signal emitted when the Mouse moves over the InputArea surface.
sigc::signal< void, int, int,
unsigned long, unsigned long > 
mouse_down
 Signal emitted when the InputArea receives a mouse down event.
sigc::signal< void, int, int,
unsigned long, unsigned long > 
mouse_up
 Signal emitted when the InputArea receives a mouse up event.
sigc::signal< void, int, int,
unsigned long, unsigned long > 
mouse_enter
 Signal emitted when the InputArea receives a mouse enter event.
sigc::signal< void, int, int,
unsigned long, unsigned long > 
mouse_leave
 Signal emitted when the InputArea receives a mouse leave event.
sigc::signal< void, int, int,
unsigned long, unsigned long > 
mouse_click
 Signal emitted when the InputArea receives a mouse down followed later by a mouse release over its surface.
sigc::signal< void, int, int,
unsigned long, unsigned long > 
mouse_double_click
 Signal emitted when the InputArea receives a double click event.
sigc::signal< void, int, int,
int, int, unsigned long,
unsigned long > 
mouse_drag
 Signal emitted when the InputArea receives a mouse down event, followed later by a mouse move event(while the mouse is still pressed).
sigc::signal< void, int, int,
int, unsigned long, unsigned
long > 
mouse_wheel
 Signal emitted when the InputArea receives a mouse wheel event.
sigc::signal< void, unsigned
int, unsigned long, unsigned
long > 
key_up
 Signal emitted when the InputArea receives a key release event.
sigc::signal< void > begin_key_focus
 Signal emitted when the area gets the keyboard focus. The is a result of a mouse down event or a call to ForceStartFocus.
sigc::signal< void > end_key_focus
 Signal emitted when the area looses the keyboard focus.
sigc::signal< void, unsigned
long, unsigned long, unsigned
long, const char *, unsigned
short > 
key_down
sigc::signal< void, int, int,
unsigned long, unsigned long > 
mouse_down_outside_pointer_grab_area
 Signal emitted when a mouse down event occurs outside of this area.
sigc::signal< void, InputArea * > start_keyboard_grab
sigc::signal< void, InputArea * > end_keyboard_grab
sigc::signal< void, Area * > ChildFocusChanged
sigc::signal< void, Area
*, bool, KeyNavDirection
key_nav_focus_change
 This signal is received whether the area receiving or loosing the keyboard focus.
sigc::signal< void, Area * > key_nav_focus_activate
 This signal is received when the area has the key focus and the ENTER key has been pressed.
sigc::signal< void, int, int,
int, int > 
OnResize
 Signal emitted when an area is resized.
sigc::signal< void, Area *, bool > OnVisibleChanged
sigc::signal< void, Area *, bool > OnSensitiveChanged
sigc::signal< void, Area
*, Geometry & > 
OnGeometryChanged
 This signal is only meant to inform of a change of size.
sigc::signal< void, Object * > object_destroyed
 Signal emitted immediately before the object is destroyed.

Protected Types

enum  MovementStep {
  VISUALLY, WORDS, DISPLAY_LINES, DISPLAY_LINE_ENDS,
  PAGES, BUFFER
}
 Enum used to specify different motion types. More...
enum  SearchState { NO_MATCH, PARTIAL, MATCH }
 Enum used for the search state of the compose list. More...

Protected Member Functions

void OnMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
void OnMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnMouseDoubleClick (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnMouseMove (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
void OnMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnKeyNavFocusChange (nux::Area *area, bool has_focus, nux::KeyNavDirection direction)
void OnBeginKeyFocus ()
void OnEndKeyFocus ()
void OnObjectDestroyed (Object *object)
void OnTextChanged (TextEntry *text_entry)
virtual void GeometryChanged ()
 This signal is only meant to inform that the size has changed.
bool HandledDeadKeys (int keysym, int state, const char *character)
 Checks for possible dead key sequences.
bool HandledComposition (int keysym, const char *character)
 Checks for possible composition sequences.
void QueueTextDraw ()
void ResetLayout ()
 Remove the cached layout.
PangoLayout * EnsureLayout ()
 Create pango layout on-demand.
PangoLayout * CreateLayout ()
 Create a new layout containning current edit content.
CairoGraphicsEnsureCanvas ()
 Create cairo canvas on-demand.
void AdjustScroll ()
 Adjust the scroll information.
void QueueRefresh (bool relayout, bool adjust_scroll)
 Send out a request to refresh all informations of the edit control and queue a draw request.
void ResetImContext ()
 Reset the input method context.
void ResetPreedit ()
 Reset preedit text.
void QueueCursorBlink ()
 Send out a request to blink the cursor if necessary.
void ShowCursor ()
void HideCursor ()
void DrawCursor (CairoGraphics *canvas)
 Draw the Cursor to the canvas.
void DrawText (CairoGraphics *canvas)
 Draw the text to the canvas.
void GetCursorRects (Rect *strong, Rect *weak)
void UpdateCursorRegion ()
void UpdateSelectionRegion ()
void MoveCursor (MovementStep step, int count, bool extend_selection)
 Move cursor.
int MoveVisually (int current_pos, int count)
 Move cursor visually, meaning left or right.
int MoveWords (int current_pos, int count)
 Move cursor in words.
int MoveDisplayLines (int current_pos, int count)
 Move cursor in display lines.
int MovePages (int current_pos, int count)
 Move cursor in pages.
int MoveLineEnds (int current_pos, int count)
 Move cursor to the beginning or end of a display line.
void SetCursor (int cursor)
 Set the current cursor offset, in number of characters.
int XYToTextIndex (int x, int y)
 Get the most reasonable character offset according to the pixel coordinate in the layout.
bool GetSelectionBounds (int *start, int *end) const
 Get the offset range that is currently selected,in number of characters.
void SetSelectionBounds (int selection_bound, int cursor)
 Set the offest range that should be selected, in number of characters.
int TextIndexToLayoutIndex (int text_index, bool consider_preedit_cursor)
 Convert index in text_ into index in layout text.
int LayoutIndexToTextIndex (int layout_index)
 Convert index in layout text into index in text_.
int GetCharLength (int index)
 Get char length at index, in number of bytes.
int GetPrevCharLength (int index)
 Get previous char length before index, in number of bytes.
void SelectWord ()
 Select the current word under cursor.
void SelectLine ()
 Select the current display line under cursor.
void DeleteSelection ()
 Delete the text that is currently selected.
virtual void CutClipboard ()
 Cut the current selected text to the clipboard.
virtual void CopyClipboard ()
 Copy the current selected text to the clipboard.
virtual void PasteClipboard ()
 Paste the text in the clipboard to current offset.
void BackSpace (MovementStep step)
 Delete a character before the offset of the cursor.
void Delete (MovementStep step)
 Delete a character at the offset of the cursor.
void ToggleOverwrite ()
 Switch between the overwrite mode and the insert mode.
Color GetSelectionBackgroundColor ()
 Gets the color of selection background.
Color GetSelectionTextColor ()
 Gets the color of selection text.
void GetCursorLocationInLayout (int *strong_x, int *strong_y, int *strong_height, int *weak_x, int *weak_y, int *weak_height)
 Gets the cursor location in pango layout.
int LookForMatch (std::string &str)
virtual bool InspectKeyEvent (Event const &event)
virtual bool InspectKeyEvent (unsigned int eventType, unsigned int keysym, const char *character)
 Return True if the the area knows what to do with the key event.
void OnChildFocusChanged (Area *child)
virtual void PreResizeGeometry ()
virtual void PostResizeGeometry ()
void InitializeWidgets ()
void InitializeLayout ()
virtual LayoutGetCompositionLayout ()
 Deprecated. Use GetLayout();.
virtual bool SetCompositionLayout (Layout *layout)
 Deprecated. Use SetLayout();.
void RemoveLayout ()
void RemoveCompositionLayout ()
bool IsFullRedraw () const
 Accessed inside ContentDraw() to help determine if some parts needs to be rendered.
virtual void GeometryChangePending ()
 This signal is only meant to inform that the size is about to change.
virtual AreaFindKeyFocusArea (unsigned int key_symbol, unsigned long x11_key_code, unsigned long special_keys_state)
virtual bool AcceptKeyNavFocusOnMouseDown () const
virtual bool AcceptKeyNavFocusOnMouseEnter () const
virtual void EmitMouseDownSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseUpSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseMoveSignal (int x, int y, int dx, int dy, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseWheelSignal (int x, int y, int wheel_delta, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitKeyDownSignal (unsigned int key_symbol, unsigned long x11_key_code, unsigned long special_keys_state)
virtual void EmitKeyUpSignal (unsigned int key_symbol, unsigned long x11_key_code, unsigned long special_keys_state)
virtual void EmitKeyEventSignal (unsigned long event_type, unsigned int key_symbol, unsigned long special_keys_state, const char *text, int key_repeat_count)
virtual void EmitMouseDragSignal (int x, int y, int dx, int dy, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseEnterSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseLeaveSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseClickSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseDoubleClickSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void EmitMouseDownOutsideArea (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
virtual void RequestBottomUpLayoutComputation (Area *bo_initiator)
 Request a Layout recompute after a change of size.
void InnerGetAbsoluteGeometry (Geometry &geometry)
 Return the absolute geometry starting with a relative geometry passed as argument.
void InnerGetRootGeometry (Geometry &geometry)
 Return the absolute geometry starting with a relative geometry passed as argument.
void SetNextObjectToKeyFocusArea (Area *)
AreaGetNextObjectToKeyFocusArea ()
 Gets the next object in the chain that ends with the area that has the keyboard focus.
void SetOwnedReference (bool b)

Static Protected Member Functions

static bool CursorBlinkCallback (TextEntry *data)

Protected Attributes

bool mouse_in_
bool mouse_mouse_drag_
bool mouse_mouse_down_
bool _block_focus
CairoGraphicscanvas_
 The CairoCanvas which hold cairo_t inside.
PangoLayout * cached_layout_
 The cached Pango Layout.
std::string text_
 The text content of the edit control.
std::string preedit_
 The preedit text of the edit control.
PangoAttrList * preedit_attrs_
 Attribute list of the preedit text.
std::string password_char_
 The character that should be displayed in invisible mode.
std::string completion_
 The completion string.
Color completion_color_
 The completion colour.
unsigned long long last_dblclick_time_
 Last time of mouse double click event.
int cursor_
 The current cursor position in number of bytes.
int preedit_cursor_
 The preedit cursor position within the preedit string, in number of bytes.
int selection_bound_
 The current selection bound in number of bytes, range between cursor_ and selection_bound_ are selected.
int scroll_offset_x_
 X offset of current scroll, in pixels.
int scroll_offset_y_
 Y offset of current scroll, in pixels.
int cursor_blink_timer_
 Timer id of cursor blink callback.
int cursor_blink_status_
 Indicates the status of cursor blinking, 0 means hide cursor otherwise means show cursor.
bool visible_
 Whether the text is visible, decided by password_char_.
bool focused_
 Whether the edit control is focused.
bool need_im_reset_
 Whether the input method should be reset.
bool overwrite_
 Whether the keyboard in overwrite mode.
bool select_words_
 Whether the button click should select words.
bool select_lines_
 Whether the button click should select lines.
bool button_
 Whether the left button is pressed.
bool bold_
 Whether the text should be bold.
bool underline_
 Whether the text should be underlined.
bool strikeout_
 Whether the text should be struck-out.
bool italic_
 Whether the text should be italic.
bool multiline_
 Whether the text could be shown in multilines.
bool wrap_
 Whether the text should be wrapped.
bool cursor_visible_
 whether the cursor should be displayed
bool readonly_
 whether the edit control is readonly
bool content_modified_
 Indicates if the content of the edit control has been modified since last draw.
bool selection_changed_
 Indicates if the selection region has been changed since last draw.
bool cursor_moved_
 Indicates if the cursor position has been moved since last draw.
bool update_canvas_
 Indicates if the canvas cache needs updating.
std::string font_family_
 The font family of the text.
double font_size_
 The font size of the text.
cairo_font_options_t * font_options_
double font_dpi_
Color _text_color
 The text color of the edit control.
CairoGraphics::Alignment align_
std::list< Rectlast_selection_region_
std::list< Rectselection_region_
std::list< Rectlast_cursor_region_
std::list< Rectcursor_region_
bool ime_active_
bool text_input_mode_
 Transient state of the TextEntry.
bool key_nav_mode_
bool lose_key_focus_on_key_nav_direction_up_
bool lose_key_focus_on_key_nav_direction_down_
bool dead_key_mode_
std::string dead_key_string_
bool composition_mode_
std::string composition_string_
sigc::connection _on_focus_changed_handler
Color m_TextColor
Layoutview_layout_
bool draw_cmd_queued_
bool full_view_draw_cmd_
bool _capture_mouse_down_any_where_else
bool _double_click
 If True, this InputArea can emit the signal mouse_double_click.
bool _keyboard_receiver_ignore_mouse_down_outside
bool accept_key_nav_focus_on_mouse_down_
bool accept_key_nav_focus_on_mouse_enter_
bool on_geometry_change_reconfigure_parent_layout_
bool has_key_focus_
 If this variable is true, then this area has the keyboard focus.
Areanext_object_to_key_focus_area_
 If this variable is not NULL, then this area is part of the keyboard focus chain.
int _heap_allocated

Private Member Functions

 NUX_DECLARE_OBJECT_TYPE (TestTextEntry, TextEntry)

Detailed Description

Definition at line 27 of file TestTextEntry.h.


Member Enumeration Documentation

enum nux::TextEntry::MovementStep [protected, inherited]

Enum used to specify different motion types.

Enumerator:
VISUALLY 
WORDS 
DISPLAY_LINES 
DISPLAY_LINE_ENDS 
PAGES 
BUFFER 

Definition at line 219 of file TextEntry.h.

enum nux::TextEntry::SearchState [protected, inherited]

Enum used for the search state of the compose list.

Enumerator:
NO_MATCH 
PARTIAL 
MATCH 

Definition at line 231 of file TextEntry.h.


Constructor & Destructor Documentation

Definition at line 63 of file TestTextEntry.cpp.

{

}

Member Function Documentation

bool nux::Area::AcceptKeyboardEvent ( ) const [inherited]

Return true if the Area is interested in keyboard events.

Returns:
True if the area accepts in keyboard events.

Definition at line 858 of file Area.cpp.

Here is the caller graph for this function:

bool nux::InputArea::AcceptKeyNavFocus ( ) const [virtual, inherited]

Definition at line 407 of file InputArea.cpp.

  {
    if (GetInputEventSensitivity() == false)
      return false;

    return true;
  }  

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::View::AcceptKeyNavFocus ( ) [virtual, inherited]

Reimplemented from nux::InputArea.

Reimplemented in nux::ScrollView, nux::BaseWindow, nux::ColorEditor, nux::RGBValuator, nux::StaticTextBox, nux::ClientArea, nux::TabView, nux::Coverflow, nux::HSplitter, nux::VSplitter, nux::Panel, nux::ScrollBar, nux::GroupBox, nux::GroupBox2, and nux::TestView.

Definition at line 483 of file View.cpp.

  {
    return true;
  }

Here is the caller graph for this function:

bool nux::InputArea::AcceptKeyNavFocusOnMouseDown ( ) const [protected, virtual, inherited]

Definition at line 387 of file InputArea.cpp.

Here is the caller graph for this function:

bool nux::InputArea::AcceptKeyNavFocusOnMouseEnter ( ) const [protected, virtual, inherited]

Definition at line 392 of file InputArea.cpp.

Here is the caller graph for this function:

bool nux::Area::AcceptMouseWheelEvent ( ) const [inherited]

Return true if the area is accepts mouse wheel events.

Returns:
True if the area accepts mouse wheel events.

Definition at line 868 of file Area.cpp.

Here is the caller graph for this function:

void nux::Introspectable::AddProperty ( std::string const &  name,
PropertyBase property 
) [inline, inherited]

Definition at line 254 of file Property-inl.h.

{
  // check to see if it exists and if it does barf horribly as we can't
  // have two properties with the same name;
  properties_[name] = property;
}

Here is the caller graph for this function:

void nux::TextEntry::AdjustScroll ( ) [protected, inherited]

Adjust the scroll information.

Definition at line 912 of file TextEntry.cpp.

  {
    int old_offset_x = scroll_offset_x_;
    int old_offset_y = scroll_offset_y_;
    int display_width = GetBaseWidth() - kInnerBorderX * 2;
    int display_height = GetBaseHeight() - kInnerBorderY * 2;

    PangoLayout* layout = EnsureLayout();
    int text_width, text_height;
    pango_layout_get_pixel_size(layout, &text_width, &text_height);

    int strong_x, strong_y, strong_height;
    int weak_x, weak_y, weak_height;
    GetCursorLocationInLayout(&strong_x, &strong_y, &strong_height,
      &weak_x, &weak_y, &weak_height);

    if (!wrap_ && display_width > text_width)
    {
      PangoAlignment align = pango_layout_get_alignment(layout);
      if (align == PANGO_ALIGN_RIGHT)
        scroll_offset_x_ = display_width - text_width;
      else if (align == PANGO_ALIGN_CENTER)
        scroll_offset_x_ = (display_width - text_width) / 2;
      else
        scroll_offset_x_ = 0;
    }
    else
    {
      if (scroll_offset_x_ + strong_x < 0)
        scroll_offset_x_ = -strong_x;
      else if (scroll_offset_x_ + strong_x > display_width)
        scroll_offset_x_ = display_width - strong_x;

      if (std::abs(weak_x - strong_x) < display_width)
      {
        if (scroll_offset_x_ + weak_x < 0)
          scroll_offset_x_ = - weak_x;
        else if (scroll_offset_x_ + weak_x > display_width)
          scroll_offset_x_ = display_width - weak_x;
      }
    }

    if (display_height > text_height)
    {
      scroll_offset_y_ = 0;
    }
    else
    {
      if (scroll_offset_y_ + strong_y + strong_height > display_height)
        scroll_offset_y_ = display_height - strong_y - strong_height;
      if (scroll_offset_y_ + strong_y < 0)
        scroll_offset_y_ = -strong_y;
    }

    if (old_offset_x != scroll_offset_x_ || old_offset_y != scroll_offset_y_)
      content_modified_ = true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::ApplyMaxHeight ( ) [virtual, inherited]

Definition at line 192 of file Area.cpp.

Here is the call graph for this function:

void nux::Area::ApplyMaxWidth ( ) [virtual, inherited]

Definition at line 185 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::ApplyMinHeight ( ) [virtual, inherited]

Definition at line 178 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::ApplyMinWidth ( ) [virtual, inherited]

Reimplemented in nux::StaticText.

Definition at line 171 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::BackSpace ( MovementStep  step) [protected, inherited]

Delete a character before the offset of the cursor.

Definition at line 1822 of file TextEntry.cpp.

  {
    if (GetSelectionBounds(NULL, NULL))
    {
      DeleteSelection();
    }
    else
    {
      if (cursor_ == 0)
        return;
      if (step == VISUALLY)
      {
        DeleteText(cursor_ - GetPrevCharLength(cursor_), cursor_);
      }
      else if (step == WORDS)
      {
        int new_cursor;
        new_cursor = MoveWords(cursor_, -1);
        DeleteText(new_cursor, cursor_);
      }
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool nux::View::CanBreakLayout ( ) [inline, virtual, inherited]

Return true if this object can break the layout.

Reimplemented in nux::FloatingWindow, nux::HSplitter, nux::VSplitter, and nux::TabView.

Definition at line 114 of file View.h.

    {
      return false;
    }

Here is the caller graph for this function:

void nux::InputArea::CaptureMouseDownAnyWhereElse ( bool  b) [inherited]

Definition at line 94 of file InputArea.cpp.

Here is the caller graph for this function:

void nux::View::ComputeContentPosition ( float  offsetX,
float  offsetY 
) [virtual, inherited]

Reimplemented from nux::Area.

Reimplemented in nux::ScrollView, nux::BaseWindow, nux::TabView, nux::FloatingWindow, nux::GroupBox, nux::GroupBox2, and nux::Panel.

Definition at line 115 of file View.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

long nux::View::ComputeContentSize ( ) [virtual, inherited]

Reimplemented from nux::Area.

Reimplemented in nux::MenuPage, nux::Button, nux::StaticText, nux::AbstractCheckedButton, nux::HSplitter, and nux::VSplitter.

Definition at line 57 of file View.cpp.

  {
    if (view_layout_)
    {
      PreLayoutManagement();

      int PreWidth = GetBaseWidth();
      int PreHeight = GetBaseHeight();

      long ret = view_layout_->ComputeContentSize();

      PostLayoutManagement(ret);

      int PostWidth = GetBaseWidth();
      int PostHeight = GetBaseHeight();

      long size_compliance = 0;

      // The layout has been resized to tightly pack its content
      if (PostWidth > PreWidth)
      {
        size_compliance |= eLargerWidth; // need scrollbar
      }
      else if (PostWidth < PreWidth)
      {
        size_compliance |= eSmallerWidth;
      }
      else
      {
        size_compliance |= eCompliantWidth;
      }

      // The layout has been resized to tightly pack its content
      if (PostHeight > PreHeight)
      {
        size_compliance |= eLargerHeight; // need scrollbar
      }
      else if (PostHeight < PreHeight)
      {
        size_compliance |= eSmallerHeight;
      }
      else
      {
        size_compliance |= eCompliantHeight;
      }

      return size_compliance;
    }
    else
    {
      PreLayoutManagement();
      int ret = PostLayoutManagement(eCompliantHeight | eCompliantWidth);
      return ret;
    }

    return 0;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::CopyClipboard ( ) [protected, virtual, inherited]

Copy the current selected text to the clipboard.

Definition at line 1767 of file TextEntry.cpp.

  {
//     int start, end;
//     if (GetSelectionBounds(&start, &end))
//     {
//       GtkWidget *widget = GetWidgetAndCursorLocation(NULL);
//       if (widget)
//       {
//         if (visible_)
//         {
//           gtk_clipboard_set_text(
//             gtk_widget_get_clipboard(widget, GDK_SELECTION_CLIPBOARD),
//             text_.c_str() + start, end - start);
//         }
//         else
//         {
//           // Don't copy real content if it's in invisible.
//           std::string content;
//           int nchars = static_cast<int>(
//             g_utf8_strlen(text_.c_str() + start, end - start));
//           for (int i = 0; i < nchars; ++i)
//             content.append(password_char_);
//           gtk_clipboard_set_text(
//             gtk_widget_get_clipboard(widget, GDK_SELECTION_CLIPBOARD),
//             content.c_str(), static_cast<int>(content.length()));
//         }
//       }
//     }
  }

Here is the caller graph for this function:

PangoLayout * nux::TextEntry::CreateLayout ( ) [protected, inherited]

Create a new layout containning current edit content.

Definition at line 1338 of file TextEntry.cpp.

  {
    // Creates the pango layout with a temporary canvas that is not zoomed.
    CairoGraphics *canvas = new CairoGraphics(CAIRO_FORMAT_ARGB32, 1, 1);
    PangoLayout *layout = pango_cairo_create_layout(canvas->GetInternalContext());
    delete canvas;
    PangoAttrList *tmp_attrs = pango_attr_list_new();
    std::string tmp_string;

    /* Set necessary parameters */
    pango_cairo_context_set_font_options(pango_layout_get_context(layout),
                                          font_options_);
    pango_cairo_context_set_resolution(pango_layout_get_context(layout),
                                        font_dpi_);

    if (wrap_)
    {
      pango_layout_set_width(layout, (GetBaseWidth() - kInnerBorderX * 2) * PANGO_SCALE);
      pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
    }
    else
    {
      pango_layout_set_width(layout, -1);
    }

    pango_layout_set_single_paragraph_mode(layout, !multiline_);

    if (preedit_.length())
    {
      size_t cursor_index = static_cast<size_t>(cursor_);
      size_t text_length = text_.length();
      size_t preedit_length = preedit_.length();
      if (visible_)
      {
        tmp_string = text_;
        tmp_string.insert(cursor_index, preedit_);
      }
      else
      {
        size_t nchars = g_utf8_strlen(text_.c_str(), text_length);
        size_t preedit_nchars = g_utf8_strlen(preedit_.c_str(), preedit_length);
        nchars += preedit_nchars;
        tmp_string.reserve(password_char_.length() * nchars);
        for (size_t i = 0; i < nchars; ++i)
          tmp_string.append(password_char_);
        size_t cursor_offset =
            g_utf8_pointer_to_offset(text_.c_str(), text_.c_str() + cursor_index);
        /* Fix cursor index and preedit_length */
        cursor_index = cursor_offset * password_char_.length();
        preedit_length = preedit_nchars * password_char_.length();
      }
      if (preedit_attrs_)
        pango_attr_list_splice(tmp_attrs, preedit_attrs_,
                               static_cast<int>(cursor_index),
                               static_cast<int>(preedit_length));
    }
    else
    {
      if (visible_)
      {
        tmp_string = text_;
      }
      else
      {
        size_t nchars = g_utf8_strlen(text_.c_str(), text_.length());
        tmp_string.reserve(password_char_.length() * nchars);
        for (size_t i = 0; i < nchars; ++i)
          tmp_string.append(password_char_);
      }
    }

    int pre_completion_length = tmp_string.length();

    if (!completion_.empty() && !wrap_ && preedit_.empty())
    {
      tmp_string = text_ + completion_;
    }

    pango_layout_set_text(layout, tmp_string.c_str(),
                          static_cast<int>(tmp_string.length()));

    /* Set necessary attributes */
    PangoAttribute *attr;
    if (underline_)
    {
      attr = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
      attr->start_index = 0;
      attr->end_index = static_cast<guint>(pre_completion_length);
      pango_attr_list_insert(tmp_attrs, attr);
    }
    if (strikeout_)
    {
      attr = pango_attr_strikethrough_new(TRUE);
      attr->start_index = 0;
      attr->end_index = static_cast<guint>(pre_completion_length);
      pango_attr_list_insert(tmp_attrs, attr);
    }
    if (!completion_.empty() && !wrap_)
    {
      attr = pango_attr_foreground_new(65535 * completion_color_.red,
                                       65535 * completion_color_.green,
                                       65535 * completion_color_.blue);
      attr->start_index = static_cast<guint>(pre_completion_length);
      attr->end_index = static_cast<guint>(tmp_string.length());
      pango_attr_list_insert(tmp_attrs, attr);
    }
    /* Set font desc */
    {
      /* safe to down_cast here, because we know the actual implementation. */
      CairoFont *font = new CairoFont(
              font_family_.empty() ? kDefaultFontName : font_family_.c_str(),
              font_size_,
              italic_ ? CairoFont::STYLE_ITALIC : CairoFont::STYLE_NORMAL,
              bold_ ? CairoFont::WEIGHT_BOLD : CairoFont::WEIGHT_NORMAL);
      nuxAssert(font);
      attr = pango_attr_font_desc_new(font->GetFontDescription());
      attr->start_index = 0;
      attr->end_index = static_cast<unsigned int>(tmp_string.length());
      pango_attr_list_insert(tmp_attrs, attr);
      pango_layout_set_font_description(layout, font->GetFontDescription());
      font->Destroy();
    }
    pango_layout_set_attributes(layout, tmp_attrs);
    pango_attr_list_unref(tmp_attrs);

    /* Set alignment according to text direction. Only set layout's alignment
     * when it's not wrapped and in single line mode.
     */
    if (!wrap_ && pango_layout_get_line_count(layout) <= 1 &&
        align_ != CairoGraphics::ALIGN_CENTER)
    {
      PangoDirection dir;
      if (visible_)
        dir = pango_find_base_dir(tmp_string.c_str(),
                                  static_cast<int>(tmp_string.length()));
      else
        dir = PANGO_DIRECTION_NEUTRAL;

      if (dir == PANGO_DIRECTION_NEUTRAL)
      {
//         GtkWidget *widget = GetWidgetAndCursorLocation(NULL);
//         if (widget && gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL)
//           dir = PANGO_DIRECTION_RTL;
//         else
//           dir = PANGO_DIRECTION_LTR;

        dir = PANGO_DIRECTION_LTR;
      }

      // If wordWrap is false then "justify" alignment has no effect.
      PangoAlignment pango_align = (align_ == CairoGraphics::ALIGN_RIGHT ?
                                    PANGO_ALIGN_RIGHT : PANGO_ALIGN_LEFT);

      // Invert the alignment if text direction is right to left.
      if (dir == PANGO_DIRECTION_RTL)
      {
        pango_align = (align_ == CairoGraphics::ALIGN_RIGHT ?
                       PANGO_ALIGN_LEFT : PANGO_ALIGN_RIGHT);
      }

      pango_layout_set_alignment(layout, pango_align);
      pango_layout_set_justify(layout, FALSE);
    }
    else if (align_ == CairoGraphics::ALIGN_JUSTIFY)
    {
      pango_layout_set_justify(layout, TRUE);
      pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT);
    }
    else if (align_ == CairoGraphics::ALIGN_RIGHT)
    {
      pango_layout_set_justify(layout, FALSE);
      pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT);
    }
    else if (align_ == CairoGraphics::ALIGN_CENTER)
    {
      pango_layout_set_justify(layout, FALSE);
      pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER);
    }
    else
    {
      pango_layout_set_justify(layout, FALSE);
      pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT);
    }

    {
      PangoContext *context;
      PangoFontMetrics *metrics;
      int ascent, descent;

      context = pango_layout_get_context(layout);
      metrics = pango_context_get_metrics(context,
                                           pango_layout_get_font_description(layout),
                                           pango_context_get_language(context));

      ascent = pango_font_metrics_get_ascent(metrics);
      descent = pango_font_metrics_get_descent(metrics);

      int full_height = PANGO_PIXELS(ascent + descent) + (kInnerBorderY * 2);
      SetMinimumHeight(full_height);

      pango_font_metrics_unref(metrics);
    }

    return layout;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::TextEntry::CursorBlinkCallback ( TextEntry data) [static, protected, inherited]

Definition at line 1073 of file TextEntry.cpp.

  {
    if (self->cursor_blink_status_)
      self->ShowCursor();
    else
      self->HideCursor();

    if (--self->cursor_blink_status_ < 0)
      self->cursor_blink_status_ = 2;

    return true;
  }

Here is the caller graph for this function:

void nux::TextEntry::CutClipboard ( ) [protected, virtual, inherited]

Cut the current selected text to the clipboard.

Definition at line 1797 of file TextEntry.cpp.

  {
    CopyClipboard();
    DeleteSelection();
    QueueRefresh(true, true);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::Delete ( MovementStep  step) [protected, inherited]

Delete a character at the offset of the cursor.

Definition at line 1845 of file TextEntry.cpp.

  {
    if (GetSelectionBounds(NULL, NULL))
    {
      DeleteSelection();
    }
    else
    {
      if (cursor_ == static_cast<int>(text_.length()))
        return;
      if (step == VISUALLY)
      {
        DeleteText(cursor_, cursor_ + GetCharLength(cursor_));
      }
      else if (step == WORDS)
      {
        int new_cursor;
        new_cursor = MoveWords(cursor_, 1);
        DeleteText(cursor_, new_cursor);
      }
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::DeleteSelection ( ) [protected, inherited]

Delete the text that is currently selected.

Definition at line 1760 of file TextEntry.cpp.

  {
    int start, end;
    if (GetSelectionBounds(&start, &end))
      DeleteText(start, end);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::DeleteText ( int  start,
int  end 
) [inherited]

Delete text in a specified range, in number of characters.

Definition at line 1671 of file TextEntry.cpp.

  {
    if (readonly_) return;

    int text_length = static_cast<int>(text_.length());
    if (start < 0)
      start = 0;
    else if (start > text_length)
      start = text_length;

    if (end < 0)
      end = 0;
    else if (end > text_length)
      end = text_length;

    if (start > end)
      std::swap(start, end);
    else if (start == end)
      return;

    text_.erase(start, end - start);

    if (cursor_ >= end)
      cursor_ -= (end - start);
    if (selection_bound_ >= end)
      selection_bound_ -= (end - start);

    ResetLayout();
    text_input_mode_ = true;
    text_changed.emit(this);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::View::DisableView ( ) [virtual, inherited]

Disable a View.

Disable the view. The view cannot receive input events(keyboard, mouse, touch). As for the rendering, each view handle its own rendering while is disabled state.

Definition at line 391 of file View.cpp.

  {
    view_enabled_ = false;
  }

Here is the caller graph for this function:

bool nux::Object::Dispose ( ) [virtual, inherited]

Destroy and object that has a floating reference.

Returns:
True is the object has been destroyed

Reimplemented from nux::Trackable.

Definition at line 311 of file Object.cpp.

  {
    // The intent of the Dispose call is to destroy objects with a float
    // reference (reference count is equal to 1 and the '_owns_the_reference'
    // flag is set to false). In Nux, only widgets object can have a floating
    // reference.  And widgets are only visible if added to the widget tree.
    // When an object with a floating reference is added to the widget tree,
    // it becomes "owned'. It looses it floating reference status but it still
    // has a reference count number of 1.  In practice, since widgets must be
    // added to the widget tree, there should never be a need to call Dispose
    // (except in a few cases).

    // Dispose() was designed to only destroy objects with floating
    // references, while UnReference() destroys objects that are "owned".
    // That is now relaxed. Dispose() calls UnReference().
    return UnReference();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::View::DoneRedraw ( ) [virtual, inherited]

Reimplemented in nux::HSplitter, and nux::VSplitter.

Definition at line 259 of file View.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::InputArea::DoubleClickEnabled ( ) const [inherited]

Returns true if the double click signal is enable for this InputArea.

Definition at line 109 of file InputArea.cpp.

  {
    return _double_click;
  }

Here is the caller graph for this function:

void nux::TextEntry::Draw ( GraphicsEngine graphics_engine,
bool  force_draw 
) [virtual, inherited]

Implements nux::View.

Definition at line 584 of file TextEntry.cpp.

  {
    MainDraw();
    Geometry base = GetGeometry();

    gfxContext.PushClippingRectangle(base);

    nux::GetPainter().PaintBackground(gfxContext, base);

    Color col = color::Black;
    col.alpha = 0;
    gfxContext.QRP_Color(base.x,
      base.y,
      base.width,
      base.height,
      col);

    TexCoordXForm texxform;
    texxform.SetWrap(TEXWRAP_REPEAT, TEXWRAP_REPEAT);
    texxform.SetTexCoordType(TexCoordXForm::OFFSET_COORD);
    gfxContext.QRP_1Tex(base.x,
      base.y,
      base.width,
      base.height,
      _texture2D->GetDeviceTexture(),
      texxform,
      _text_color);

    gfxContext.PopClippingRectangle();
  }

Here is the call graph for this function:

void nux::TextEntry::DrawContent ( GraphicsEngine graphics_engine,
bool  force_draw 
) [virtual, inherited]

Reimplemented from nux::View.

Definition at line 615 of file TextEntry.cpp.

  {
    //MainDraw();
  }
void nux::TextEntry::DrawCursor ( CairoGraphics canvas) [protected, inherited]

Draw the Cursor to the canvas.

Definition at line 1158 of file TextEntry.cpp.

  {
    if (!cursor_visible_)
      return;

    int strong_x, strong_y, strong_height;
    int weak_x, weak_y, weak_height;
    GetCursorLocationInLayout(&strong_x, &strong_y, &strong_height,
      &weak_x, &weak_y, &weak_height);

    // Draw strong cursor.
    // 0.5 is for cairo drawing between the grid
    canvas->DrawLine(strong_x + kInnerBorderX + scroll_offset_x_ + 0.5,
                     strong_y + kInnerBorderY + scroll_offset_y_,
                     strong_x + kInnerBorderX + scroll_offset_x_ + 0.5,
                     strong_y + strong_height + kInnerBorderY + scroll_offset_y_,
                     kStrongCursorLineWidth, kStrongCursorColor);
    // Draw a small arror towards weak cursor
    if (strong_x > weak_x)
    {
      canvas->DrawLine(
        strong_x + kInnerBorderX + scroll_offset_x_ - kStrongCursorBarWidth,
        strong_y + kInnerBorderY + scroll_offset_y_ + kStrongCursorLineWidth,
        strong_x + kInnerBorderX + scroll_offset_x_,
        strong_y + kInnerBorderY + scroll_offset_y_ + kStrongCursorLineWidth,
        kStrongCursorLineWidth, kStrongCursorColor);
    }
    else if (strong_x < weak_x)
    {
      canvas->DrawLine(
        strong_x + kInnerBorderX + scroll_offset_x_,
        strong_y + kInnerBorderY + scroll_offset_y_ + kStrongCursorLineWidth,
        strong_x + kInnerBorderX + scroll_offset_x_ + kStrongCursorBarWidth,
        strong_y + kInnerBorderY + scroll_offset_y_ + kStrongCursorLineWidth,
        kStrongCursorLineWidth, kStrongCursorColor);
    }

    if (strong_x != weak_x )
    {
      // Draw weak cursor.
      canvas->DrawLine(weak_x + kInnerBorderX + scroll_offset_x_,
        weak_y + kInnerBorderY + scroll_offset_y_,
        weak_x + kInnerBorderX + scroll_offset_x_,
        weak_y + weak_height + kInnerBorderY + scroll_offset_y_,
        kWeakCursorLineWidth, kWeakCursorColor);
      // Draw a small arror towards strong cursor
      if (weak_x > strong_x)
      {
        canvas->DrawLine(
          weak_x + kInnerBorderX + scroll_offset_x_ - kWeakCursorBarWidth,
          weak_y + kInnerBorderY + scroll_offset_y_ + kWeakCursorLineWidth,
          weak_x + kInnerBorderX + scroll_offset_x_,
          weak_y + kInnerBorderY + scroll_offset_y_ + kWeakCursorLineWidth,
          kWeakCursorLineWidth, kWeakCursorColor);
      }
      else
      {
        canvas->DrawLine(
          weak_x + kInnerBorderX + scroll_offset_x_,
          weak_y + kInnerBorderY + scroll_offset_y_ + kWeakCursorLineWidth,
          weak_x + kInnerBorderX + scroll_offset_x_ + kWeakCursorBarWidth,
          weak_y + kInnerBorderY + scroll_offset_y_ + kWeakCursorLineWidth,
          kWeakCursorLineWidth, kWeakCursorColor);
      }
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::DrawText ( CairoGraphics canvas) [protected, inherited]

Draw the text to the canvas.

Definition at line 1006 of file TextEntry.cpp.

  {
    PangoLayout *layout = EnsureLayout();

    bool redraw_text = false;
    if (update_canvas_)
    {
      canvas->ClearCanvas();
      canvas->PushState();
      redraw_text = true;
    }
    else if (!last_selection_region_.empty())
    {
      //last_selection_region_.Integerize();
      canvas->PushState();
      canvas->IntersectGeneralClipRegion(last_selection_region_);
      canvas->ClearRect(0, 0, GetBaseWidth(), GetBaseHeight());
      redraw_text = true;
    }

    if (redraw_text)
    {
      cairo_set_source_rgb(canvas->GetInternalContext(),
        _text_color.red,
        _text_color.green,
        _text_color.blue);

      cairo_move_to(canvas->GetInternalContext(),
        scroll_offset_x_ + kInnerBorderX,
        scroll_offset_y_ + kInnerBorderY);

      pango_cairo_show_layout(canvas->GetInternalContext(), layout);

      canvas->PopState();
    }

    // Draw selection background.
    // Selection in a single line may be not continual, so we use pango to
    // get the x-ranges of each selection range in one line, and draw them
    // separately.
    if (!selection_region_.empty())
    {
      canvas->PushState();
      //selection_region_.Integerize();
      canvas->IntersectGeneralClipRegion(selection_region_);

      Color selection_color = GetSelectionBackgroundColor();
      Color text_color = GetSelectionTextColor();

      cairo_set_source_rgb(canvas->GetInternalContext(),
        selection_color.red,
        selection_color.green,
        selection_color.blue);
      cairo_paint(canvas->GetInternalContext());

      cairo_move_to(canvas->GetInternalContext(),
        scroll_offset_x_ + kInnerBorderX,
        scroll_offset_y_ + kInnerBorderY);
      cairo_set_source_rgb(canvas->GetInternalContext(),
        text_color.red,
        text_color.green,
        text_color.blue);
      pango_cairo_show_layout(canvas->GetInternalContext(), layout);
      canvas->PopState();
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::InputArea::EmitKeyDownSignal ( unsigned int  key_symbol,
unsigned long  x11_key_code,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 302 of file InputArea.cpp.

  {
    //OnKeyPressed.emit(key_symbol, x11_key_code, special_keys_state);
  }
void nux::InputArea::EmitKeyEventSignal ( unsigned long  event_type,
unsigned int  key_symbol,
unsigned long  special_keys_state,
const char *  text,
int  key_repeat_count 
) [protected, virtual, inherited]

Definition at line 312 of file InputArea.cpp.

  {
    key_down.emit(
      event_type,
      key_sym,
      special_keys_state,
      text,
      key_repeat_count);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitKeyUpSignal ( unsigned int  key_symbol,
unsigned long  x11_key_code,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 307 of file InputArea.cpp.

  {
    key_up.emit(key_symbol, x11_key_code, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseClickSignal ( int  x,
int  y,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 343 of file InputArea.cpp.

  {
    mouse_click.emit(x, y, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseDoubleClickSignal ( int  x,
int  y,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 348 of file InputArea.cpp.

  {
    mouse_double_click.emit(x, y, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseDownOutsideArea ( int  x,
int  y,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 353 of file InputArea.cpp.

  {
    mouse_down_outside_pointer_grab_area.emit(x, y, mouse_button_state, special_keys_state);
  }
void nux::InputArea::EmitMouseDownSignal ( int  x,
int  y,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 282 of file InputArea.cpp.

  {
    mouse_down.emit(x, y, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseDragSignal ( int  x,
int  y,
int  dx,
int  dy,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 326 of file InputArea.cpp.

  {
    mouse_drag.emit(x, y, dx, dy, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseEnterSignal ( int  x,
int  y,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 331 of file InputArea.cpp.

  {
    mouse_in_ = true;
    mouse_enter.emit(x, y, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseLeaveSignal ( int  x,
int  y,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 337 of file InputArea.cpp.

  {
    mouse_in_ = false;
    mouse_leave.emit(x, y, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseMoveSignal ( int  x,
int  y,
int  dx,
int  dy,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 292 of file InputArea.cpp.

  {
    mouse_move.emit(x, y, dx, dy, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseUpSignal ( int  x,
int  y,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 287 of file InputArea.cpp.

  {
    mouse_up.emit(x, y, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EmitMouseWheelSignal ( int  x,
int  y,
int  wheel_delta,
unsigned long  mouse_button_state,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Definition at line 297 of file InputArea.cpp.

  {
    mouse_wheel.emit(x, y, wheel_delta, mouse_button_state, special_keys_state);
  }

Here is the caller graph for this function:

void nux::InputArea::EnableDoubleClick ( bool  double_click) [inherited]

Enable the double click event signal on this InputArea.

Definition at line 104 of file InputArea.cpp.

  {
    _double_click = double_click;
  }

Here is the caller graph for this function:

void nux::View::EnableView ( ) [virtual, inherited]

Enable a View.

Enable the view. The view cannot receive events. As for the rendering, each view handle its own rendering while is enabled state.

Definition at line 386 of file View.cpp.

  {
    view_enabled_ = true;
  }

Here is the caller graph for this function:

CairoGraphics * nux::TextEntry::EnsureCanvas ( ) [protected, inherited]

Create cairo canvas on-demand.

Definition at line 892 of file TextEntry.cpp.

  {
    if (canvas_)
    {
      if ((GetBaseWidth() == canvas_->GetWidth()) && (GetBaseHeight() == canvas_->GetHeight()))
      {
        return canvas_;
      }
      else
      {
        nuxDebugMsg("[TextEntry::EnsureCanvas] Recreate canvas");
        delete canvas_;
        canvas_ = NULL;
      }
    }
    canvas_ = new CairoGraphics(CAIRO_FORMAT_ARGB32, GetBaseWidth(), GetBaseHeight());
    nuxAssert(canvas_);
    return canvas_;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

PangoLayout * nux::TextEntry::EnsureLayout ( ) [protected, inherited]

Create pango layout on-demand.

If the layout is not changed, return the cached one.

Definition at line 1260 of file TextEntry.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::EnterText ( const char *  str) [inherited]

Insert text at current caret position.

Definition at line 1635 of file TextEntry.cpp.

  {
    if (readonly_ || !str || !*str) return;

    if (GetSelectionBounds(NULL, NULL))
    {
      DeleteSelection();
    }
    else if (overwrite_ && cursor_ != static_cast<int>(text_.length()))
    {
      DeleteText(cursor_, cursor_ + GetCharLength(cursor_));
    }

    std::string tmp_text;
    if (!multiline_)
    {
      tmp_text = CleanupLineBreaks(str);
      str = tmp_text.c_str();
    }

    const char *end = NULL;
    g_utf8_validate(str, -1, &end);
    if (end > str)
    {
      size_t len = end - str;

      text_.insert(cursor_, str, len);
      cursor_ += static_cast<int>(len);
      selection_bound_ += static_cast<int>(len);
    }

    ResetLayout();
    text_input_mode_ = true;
    text_changed.emit(this);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Area * nux::TextEntry::FindAreaUnderMouse ( const Point mouse_position,
NuxEventType  event_type 
) [virtual, inherited]

Return the area under the mouse pointer.

Returns:
The Area under the mouse pointer.

Reimplemented from nux::View.

Definition at line 231 of file TextEntry.cpp.

  {
    Area* area = View::FindAreaUnderMouse(mouse_position, event_type);

    return area;
  }
Area * nux::View::FindKeyFocusArea ( unsigned int  key_symbol,
unsigned long  x11_key_code,
unsigned long  special_keys_state 
) [protected, virtual, inherited]

Reimplemented from nux::InputArea.

Definition at line 445 of file View.cpp.

  {
    if (has_key_focus_)
    {
      return this;
    }
    else if (next_object_to_key_focus_area_)
    {
      return next_object_to_key_focus_area_->FindKeyFocusArea(key_symbol, x11_key_code, special_keys_state);
    }
    return NULL;
  }

Here is the call graph for this function:

void nux::TextEntry::FocusInx ( ) [inherited]

Definition at line 849 of file TextEntry.cpp.

  {
    if (!focused_)
    {
      focused_ = true;
      if (!readonly_ /*&& im_context_*/)
      {
        need_im_reset_ = true;
#if defined(NUX_OS_LINUX)
        ime_->Focus();
#endif
        //gtk_im_context_focus_in(im_context_);
        //UpdateIMCursorLocation();
      }
      cursor_visible_ = true; // show cursor when getting focus
      selection_changed_ = true;
      cursor_moved_ = true;
      // Don't adjust scroll.
      QueueRefresh(true, false);
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::FocusOutx ( ) [inherited]

Definition at line 871 of file TextEntry.cpp.

  {
    if (focused_)
    {
      focused_ = false;
      if (!readonly_ /*&& im_context_*/)
      {
        need_im_reset_ = true;
#if defined(NUX_OS_LINUX)
        ime_->Blur();
#endif
        //gtk_im_context_focus_out(im_context_);
      }
      cursor_visible_ = false; // hide cursor when losing focus
      selection_changed_ = true;
      cursor_moved_ = true;
      // Don't adjust scroll.
      QueueRefresh(true, false);
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::GeometryChanged ( ) [protected, virtual, inherited]

This signal is only meant to inform that the size has changed.

When overriding this function, don't do anything that could change the size of this object. Or you risk creating an infinite loop.

Reimplemented from nux::View.

Definition at line 223 of file TextEntry.cpp.

void nux::View::GeometryChangePending ( ) [protected, virtual, inherited]

This signal is only meant to inform that the size is about to change.

When overriding this function, don't do anything that could change the size of this object. Or you risk creating an infinite loop.

Reimplemented from nux::Area.

Definition at line 413 of file View.cpp.

  {
    if (IsLayoutDone())
      QueueDraw();
  }

Here is the call graph for this function:

Matrix4 nux::Area::Get2DMatrix ( ) const [inherited]

Definition at line 666 of file Area.cpp.

  {
    return _2d_xform;
  }

Here is the caller graph for this function:

Matrix4 nux::Area::Get3DMatrix ( ) const [inherited]

Definition at line 671 of file Area.cpp.

  {
    return _3d_xform;
  }
Geometry nux::Area::GetAbsoluteGeometry ( ) const [virtual, inherited]

Return the position of this object with regard to the top left corner of the physical window.

Return the position of the Area inside the physical window. For the main layout set in WindowThread, The following functions are equivalent:

Reimplemented in nux::MenuPage.

Definition at line 705 of file Area.cpp.

  {
    if (Type().IsDerivedFromType(BaseWindow::StaticObjectType) ||
      Type().IsDerivedFromType(MenuPage::StaticObjectType) ||
      (this == window_thread_->GetLayout()))
    {
      // Do not apply the _2D_xform matrix  to a BaseWindow or the main layout
      return geometry_;
    }
    else
    {
      nux::Geometry geo = geometry_;
      MatrixXFormGeometry(_2d_xform, geo);

      Area *parent = GetParentObject();
      if (parent)
        parent->InnerGetAbsoluteGeometry(geo);

      return geo;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::Area::GetAbsoluteHeight ( ) const [inherited]

Return the area absolute height.

As long as _2d_xform contains only translations, the absolute height is the same as value returned by GetBaseHeight();

Definition at line 742 of file Area.cpp.

  {
    return GetAbsoluteGeometry().height;
  }

Here is the call graph for this function:

int nux::Area::GetAbsoluteWidth ( ) const [inherited]

Return the area absolute width.

As long as _2d_xform contains only translations, the absolute width is the same as value returned by GetBaseWidth();

Definition at line 737 of file Area.cpp.

  {
    return GetAbsoluteGeometry().width;
  }

Here is the call graph for this function:

int nux::Area::GetAbsoluteX ( ) const [inherited]

Return the area absolute x coordinate.

Definition at line 727 of file Area.cpp.

  {
    return GetAbsoluteGeometry().x;
  }

Here is the call graph for this function:

int nux::Area::GetAbsoluteY ( ) const [inherited]

Return the area absolute y coordinate.

Definition at line 732 of file Area.cpp.

  {
    return GetAbsoluteGeometry().y;
  }

Here is the call graph for this function:

Definition at line 1735 of file TextEntry.cpp.

  {
    return align_;
  }
std::string nux::Object::GetAllocationLoation ( ) const [inherited]

Definition at line 348 of file Object.cpp.

{
  std::ostringstream sout;
  sout << allocation_file_name_ << ":" << allocation_line_number_;
  return sout.str();
}

Here is the caller graph for this function:

int nux::Area::GetBaseHeight ( ) const [inherited]

Definition at line 333 of file Area.cpp.

  {
    return geometry_.height;
  }
const NString & nux::Area::GetBaseString ( ) const [inherited]

Definition at line 69 of file Area.cpp.

  {
    return _base_string;
  }

Here is the caller graph for this function:

int nux::Area::GetBaseWidth ( ) const [inherited]

Definition at line 328 of file Area.cpp.

  {
    return geometry_.width;
  }
int nux::Area::GetBaseX ( ) const [inherited]

Definition at line 318 of file Area.cpp.

  {
    return geometry_.x;
  }
int nux::Area::GetBaseY ( ) const [inherited]

Definition at line 323 of file Area.cpp.

  {
    return geometry_.y;
  }
int nux::TextEntry::GetCharLength ( int  index) [protected, inherited]

Get char length at index, in number of bytes.

Definition at line 1618 of file TextEntry.cpp.

  {
    const char *text = text_.c_str();
    const char *ptr = text + index;
    const char *end = text + text_.length();
    const char *next = g_utf8_find_next_char(ptr, end);
    return static_cast<int>(next ? static_cast<int>(next - ptr) : end - ptr);
  }

Here is the caller graph for this function:

std::string const & nux::TextEntry::GetCompletion ( ) const [inherited]

Definition at line 774 of file TextEntry.cpp.

  {
    return completion_;
  }
Color const & nux::TextEntry::GetCompletionColor ( ) const [inherited]

Definition at line 785 of file TextEntry.cpp.

  {
    return completion_color_;
  }
Layout * nux::View::GetCompositionLayout ( ) [protected, virtual, inherited]

Deprecated. Use GetLayout();.

Definition at line 274 of file View.cpp.

  {
    return GetLayout();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::GetCursorLocationInLayout ( int *  strong_x,
int *  strong_y,
int *  strong_height,
int *  weak_x,
int *  weak_y,
int *  weak_height 
) [protected, inherited]

Gets the cursor location in pango layout.

The unit is pixel.

Definition at line 1235 of file TextEntry.cpp.

  {
    PangoLayout *layout = EnsureLayout();
    int cursor_index = TextIndexToLayoutIndex(cursor_, true);

    PangoRectangle strong, weak;
    pango_layout_get_cursor_pos(layout, cursor_index, &strong, &weak);

    if (strong_x)
      *strong_x = PANGO_PIXELS(strong.x);
    if (strong_y)
      *strong_y = PANGO_PIXELS(strong.y);
    if (strong_height)
      *strong_height = PANGO_PIXELS(strong.height);
    if (weak_x)
      *weak_x = PANGO_PIXELS(weak.x);
    if (weak_y)
      *weak_y = PANGO_PIXELS(weak.y);
    if (weak_height)
      *weak_height = PANGO_PIXELS(weak.height);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::GetCursorRects ( Rect strong,
Rect weak 
) [protected, inherited]

Definition at line 1120 of file TextEntry.cpp.

  {
    int strong_x, strong_y, strong_height;
    int weak_x, weak_y, weak_height;
    GetCursorLocationInLayout(&strong_x, &strong_y, &strong_height,
      &weak_x, &weak_y, &weak_height);

    strong->x =
      strong_x + kInnerBorderX + scroll_offset_x_ - kStrongCursorBarWidth;
    strong->width = kStrongCursorBarWidth * 2;
    strong->y = strong_y + kInnerBorderY + scroll_offset_y_;
    strong->height = strong_height;

    if (weak_x != strong_x)
    {
      weak->x = weak_x+ kInnerBorderX + scroll_offset_x_ - kWeakCursorBarWidth;
      weak->width = kWeakCursorBarWidth * 2;
      weak->y = weak_y+ kInnerBorderY + scroll_offset_y_;
      weak->height = weak_height;
    }
    else
    {
      *weak = *strong;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

MinorDimensionSize nux::Area::GetExtend ( ) [virtual, inherited]

Definition at line 596 of file Area.cpp.

  {
    return minor_axis_size_;
  }

Definition at line 369 of file View.cpp.

  {
    if (!_font.IsValid())
      _font = GetSysFont();
    return _font;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Geometry const & nux::Area::GetGeometry ( ) const [inherited]

Get the geometry of the object.

Returns:
The Geometry of the object.
See also:
GetBaseWidth(), GetBaseHeight(), GetBaseX(), GetBaseY().

Definition at line 360 of file Area.cpp.

  {
    return geometry_;
  }
bool nux::Area::GetInputEventSensitivity ( ) const [inherited]

Get input event sensitivity of the area is sensitive.

Gets whether the area is sensitive to input events

Returns:
whether the area is visible

Definition at line 581 of file Area.cpp.

  {
    return sensitive_;
  }

Here is the caller graph for this function:

Layout * nux::View::GetLayout ( ) [virtual, inherited]

Get the default layout of this view.

Get the default layout of this view.

Returns:
The default layout of this view.

Reimplemented in nux::BaseWindow.

Definition at line 269 of file View.cpp.

  {
    return view_layout_;
  }

Here is the caller graph for this function:

Definition at line 2482 of file TextEntry.cpp.

Definition at line 2472 of file TextEntry.cpp.

int nux::Area::GetMaximumHeight ( ) const [virtual, inherited]

Definition at line 256 of file Area.cpp.

  {
    return max_size_.height;
  }

Here is the caller graph for this function:

Size nux::Area::GetMaximumSize ( ) const [virtual, inherited]

Definition at line 204 of file Area.cpp.

  {
    return max_size_;
  }
int nux::Area::GetMaximumWidth ( ) const [virtual, inherited]

Definition at line 246 of file Area.cpp.

  {
    return max_size_.width;
  }

Here is the caller graph for this function:

int nux::Area::GetMinimumHeight ( ) const [virtual, inherited]

Definition at line 251 of file Area.cpp.

  {
    return min_size_.height;
  }

Here is the caller graph for this function:

Size nux::Area::GetMinimumSize ( ) const [virtual, inherited]

Definition at line 199 of file Area.cpp.

  {
    return min_size_;
  }

Here is the caller graph for this function:

int nux::Area::GetMinimumWidth ( ) const [virtual, inherited]

Definition at line 241 of file Area.cpp.

  {
    return min_size_.width;
  }

Here is the caller graph for this function:

Area * nux::Area::GetNextObjectToKeyFocusArea ( ) [protected, inherited]

Gets the next object in the chain that ends with the area that has the keyboard focus.

Gets the next object in the chain that ends with the area that has the keyboard focus. The next object is a child of this area.

Returns:
An area that is the next object in the chain that leads to the area that has the keyboard focus.

Definition at line 963 of file Area.cpp.

int nux::Trackable::GetObjectSize ( ) [virtual, inherited]

Return the size of allocated for this object.

Returns:
The size allocated for this object.

Definition at line 217 of file Object.cpp.

  {
    return _size_of_this_object;
  }
Area * nux::Area::GetParentObject ( ) const [inherited]

Definition at line 313 of file Area.cpp.

  {
    return parent_area_;
  }

Here is the caller graph for this function:

float nux::Area::GetPercentage ( ) [virtual, inherited]

Definition at line 606 of file Area.cpp.

Definition at line 586 of file Area.cpp.

  {
    return minor_axis_position_;
  }
int nux::TextEntry::GetPrevCharLength ( int  index) [protected, inherited]

Get previous char length before index, in number of bytes.

Definition at line 1627 of file TextEntry.cpp.

  {
    const char *text = text_.c_str();
    const char *ptr = text + index;
    const char *prev = g_utf8_find_prev_char(text, ptr);
    return static_cast<int>(prev ? static_cast<int>(ptr - prev) : ptr - text);
  }

Here is the caller graph for this function:

template<typename T >
T nux::Introspectable::GetProperty ( std::string const &  name,
T *  foo = 0 
) [inherited]

Definition at line 285 of file Property-inl.h.

{
  PropertyContainer::iterator i = properties_.find(name);
  if (i == properties_.end())
    return T();

  std::string s = i->second->GetSerializedValue();
  std::pair<T, bool> result = type::PropertyTrait<T>::from_string(s);
  // If this is called with a template type that the property does not
  // support nice conversion to, you'll get no error, but will get
  // a default constructed T.  We could use an exception here.
  return result.first;
}
int nux::Object::GetReferenceCount ( ) const [inherited]

Get the reference count of this object.

Returns:
The reference count of this object.

Definition at line 343 of file Object.cpp.

  {
    return reference_count_->GetValue();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Geometry nux::Area::GetRootGeometry ( ) const [virtual, inherited]

Return the position of this object with regard to its top level parent(the main layout or a BaseWindow).

Return the position of the Area inside the physical window. For the main layout set in WindowThread or for a BaseWindow, GetRootGeometry() is equivalent to GetGeometry().

Reimplemented in nux::MenuPage.

Definition at line 759 of file Area.cpp.

  {
    nux::Geometry geo = geometry_;
    MatrixXFormGeometry(_2d_xform, geo);

    if (Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
    {
      return geo;
    }
    else
    {
      Area *parent = GetParentObject();
      if (parent)
        parent->InnerGetRootGeometry(geo);

      return geo;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::Area::GetRootHeight ( ) const [inherited]

Return the area root height.

As long as _2d_xform contains only translations, the root width is the same as value returned by GetBaseWidth();

Definition at line 793 of file Area.cpp.

  {
    return GetRootGeometry().height;
  }

Here is the call graph for this function:

Area * nux::Area::GetRootParent ( ) [inherited]

Return the root parent of the rendering tree for this area.

The root parent of the rendering tree is either a BaseWindow or the main layout. If the object isn't hooked to the rendering tree the function returns NULL.

Returns:
The root parent of the rendering tree or NULL.

Definition at line 803 of file Area.cpp.

  {
    if (Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
    {
      return this;
    }

    Area* parent = GetParentObject();
    if (!parent) //we didn't find a way to salvation!
    {
      return 0;
    }
    return parent->GetRootParent();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::Area::GetRootWidth ( ) const [inherited]

Return the area root width.

As long as _2d_xform contains only translations, the root width is the same as value returned by GetBaseWidth();

Definition at line 788 of file Area.cpp.

  {
    return GetRootGeometry().width;
  }

Here is the call graph for this function:

int nux::Area::GetRootX ( ) const [inherited]

Return the area root x coordinate.

Definition at line 778 of file Area.cpp.

  {
    return GetRootGeometry().x;
  }

Here is the call graph for this function:

int nux::Area::GetRootY ( ) const [inherited]

Return the area root y coordinate.

Definition at line 783 of file Area.cpp.

  {
    return GetRootGeometry().y;
  }

Here is the call graph for this function:

unsigned int nux::Area::GetScaleFactor ( ) [virtual, inherited]

Get the area scale factor.

The scale factor is used to control the layout of area objects inside HLayout and VLayout.

See also:
HLayout, VLayout.
Returns:
the Area scale factor.

Definition at line 261 of file Area.cpp.

  {
    return scale_factor_;
  }

Here is the caller graph for this function:

Color nux::TextEntry::GetSelectionBackgroundColor ( ) [protected, inherited]

Gets the color of selection background.

Definition at line 1225 of file TextEntry.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::TextEntry::GetSelectionBounds ( int *  start,
int *  end 
) const [protected, inherited]

Get the offset range that is currently selected,in number of characters.

Definition at line 2291 of file TextEntry.cpp.

  {
    if (start)
    {
      *start = std::min<int>(selection_bound_, cursor_);
    }

    if (end)
    {
      *end = std::max<int>(selection_bound_, cursor_);
    }

    return (selection_bound_ != cursor_);
  }

Here is the caller graph for this function:

Color nux::TextEntry::GetSelectionTextColor ( ) [protected, inherited]

Gets the color of selection text.

Definition at line 1230 of file TextEntry.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string const & nux::TextEntry::GetText ( ) const [inherited]

Definition at line 738 of file TextEntry.cpp.

  {
    return text_;
  }

Here is the caller graph for this function:

Color nux::View::GetTextColor ( ) [virtual, inherited]

Definition at line 381 of file View.cpp.

  {
    return m_TextColor;
  }

Here is the caller graph for this function:

Color const & nux::TextEntry::GetTextColor ( ) const [inherited]

Definition at line 799 of file TextEntry.cpp.

  {
    return _text_color;
  }
std::string nux::TextEntry::GetTextSelection ( ) const [inherited]

Definition at line 743 of file TextEntry.cpp.

  {
    if (text_.size() == 0)
    {
      return std::string("");
    }

    int selection_start = 0;
    int selection_end = 0;
    if (GetSelectionBounds(&selection_start, &selection_end))
    {
      return text_.substr(selection_start, selection_end);
    }
    else
    {
      return std::string("");
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Area * nux::Area::GetToplevel ( ) [inherited]

Deprecated. Use GetToplevel.

Definition at line 798 of file Area.cpp.

  {
    return GetRootParent();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Return the Top level BaseWindow of this area.

Returns:
The top level BaseWindow or NULL.

Definition at line 818 of file Area.cpp.

  {
    Area* area = GetRootParent();

    if (area && area->IsViewWindow())
      return area;

    return NULL;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::InputArea::GrabKeyboard ( ) [inherited]

Definition at line 256 of file InputArea.cpp.

Here is the call graph for this function:

void nux::InputArea::GrabPointer ( ) [inherited]

Definition at line 246 of file InputArea.cpp.

Here is the call graph for this function:

bool nux::TextEntry::HandledComposition ( int  keysym,
const char *  character 
) [protected, inherited]

Checks for possible composition sequences.

Definition at line 658 of file TextEntry.cpp.

  {
#if defined(NUX_OS_LINUX)
    if (keysym == XK_Multi_key)
    {
      if (composition_mode_)
      {
        composition_mode_ = false;
      }
      else
      {
        composition_mode_ = true;
      }
      composition_string_.clear();
      return true;
    }

    if (composition_mode_ && character)
    {
      if (strncmp(character, "", 1) == 0 && keysym != NUX_VK_SHIFT)
      {
        composition_mode_ = false;
        composition_string_.clear();
        return true;
      }

      composition_string_ += character;

      std::string composition_match;

      int match = LookForMatch(composition_match);

      if (match == PARTIAL)
      {
        return true;
      }
      else if (match == NO_MATCH)
      {
        composition_mode_ = false;
        composition_string_.clear();
      }
      else if (match == MATCH)
      {
        EnterText(composition_match.c_str());
        composition_mode_ = false;
        composition_string_.clear();
        QueueRefresh(false, true);

        if (dead_key_mode_)
          dead_key_mode_ = false;

        return true;
      }
    }
    return false;
#else
    return false;
#endif
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::TextEntry::HandledDeadKeys ( int  keysym,
int  state,
const char *  character 
) [protected, inherited]

Checks for possible dead key sequences.

Definition at line 625 of file TextEntry.cpp.

  {
#if defined(NUX_OS_LINUX)
    /* Checks if the keysym between the first and last dead key */
    if (character && (keysym >= XK_dead_grave) && (keysym <= XK_dead_stroke) && !dead_key_mode_)
    {
      int key = keysym - XK_dead_grave;
      dead_key_mode_ = true;

      if (dead_keys_map[key])
      {
        composition_mode_ = true;
        composition_string_.clear();

        dead_key_string_ = character;

        std::string dead_key;
        dead_key = dead_keys_map[key];
        HandledComposition(keysym, dead_key.c_str());

        return true;
      }
    }
    else if (dead_key_mode_ && (state & IBUS_IGNORED_MASK))
    {
      dead_key_mode_ = false;
    }
    return false;
#else
    return false;
#endif
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::InputArea::HasKeyboardFocus ( ) [inherited]

Definition at line 78 of file InputArea.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::HasKeyFocus ( ) const [inherited]

Definition at line 1024 of file Area.cpp.

  {
    return has_key_focus_;
  }

Here is the caller graph for this function:

bool nux::Area::HasTopLevelParent ( ) [inherited]

Return true is this area has a top level parent.

Returns:
True if this area has a top level parent.

Definition at line 828 of file Area.cpp.

  {
    if (GetRootParent())
    {
      return true;
    }
    return false;
  }

Here is the call graph for this function:

void nux::TextEntry::HideCursor ( ) [protected, inherited]

Definition at line 1107 of file TextEntry.cpp.

  {
    if (cursor_visible_)
    {
      cursor_visible_ = false;
      if (focused_ && !readonly_)
      {
        cursor_moved_ = true;
        QueueRefresh(false, false);
      }
    }
  }

Here is the call graph for this function:

bool nux::TextEntry::im_active ( ) [inherited]

Definition at line 1746 of file TextEntry.cpp.

  {
    return ime_active_;
  }
bool nux::TextEntry::im_running ( ) [inherited]

Definition at line 1751 of file TextEntry.cpp.

  {
#if defined(NUX_OS_LINUX)
    return ime_->IsConnected();
#else
    return false;
#endif
  }

Here is the caller graph for this function:

void nux::Area::IncreaseSize ( int  x,
int  y 
) [inherited]

Definition at line 395 of file Area.cpp.

Here is the call graph for this function:

void nux::View::InitializeLayout ( ) [protected, inherited]
void nux::View::InitializeWidgets ( ) [protected, inherited]
void nux::Area::InnerGetAbsoluteGeometry ( Geometry geometry) [protected, inherited]

Return the absolute geometry starting with a relative geometry passed as argument.

Definition at line 690 of file Area.cpp.

  {
    if (this->Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
    {
      geometry.OffsetPosition(geometry_.x, geometry_.y);
      return;
    }

    MatrixXFormGeometry(_2d_xform, geometry);

    Area *parent = GetParentObject();
    if (parent)
      parent->InnerGetAbsoluteGeometry(geometry);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::InnerGetRootGeometry ( Geometry geometry) [protected, inherited]

Return the absolute geometry starting with a relative geometry passed as argument.

Definition at line 747 of file Area.cpp.

  {
    if (this->Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
      return;

    MatrixXFormGeometry(_2d_xform, geometry);

    Area *parent = GetParentObject();
    if (parent)
      parent->InnerGetRootGeometry(geometry);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::TextEntry::InspectKeyEvent ( nux::Event const &  event) [protected, virtual, inherited]

Definition at line 2352 of file TextEntry.cpp.

  {
    unsigned int eventType = event.type;
    unsigned int key_sym = event.GetKeySym();

#if defined(NUX_OS_LINUX)
    if (im_running())
    {
      // Always allow IBus hotkey events
      if (ime_->IsHotkeyEvent(static_cast<EventType>(eventType), key_sym, event.key_modifiers))
        return true;
    }
#endif

    // Ignore events when Alt or Super are pressed
    if (event.GetKeyModifierState(KEY_MODIFIER_SUPER) || event.GetKeyModifierState(KEY_MODIFIER_ALT))
      return false;

    if ((eventType == NUX_KEYDOWN) && (key_nav_mode_ == true) && (text_input_mode_ == false) && (ime_active_ == false))
    {
      if (key_sym == NUX_VK_ENTER ||
        key_sym == NUX_KP_ENTER ||
        key_sym == NUX_VK_UP ||
        key_sym == NUX_VK_DOWN ||
        key_sym == NUX_VK_LEFT ||
        key_sym == NUX_VK_RIGHT ||
        key_sym == NUX_VK_LEFT_TAB ||
        key_sym == NUX_VK_TAB ||
        key_sym == NUX_VK_ESCAPE)
      {
        if (key_sym == NUX_VK_LEFT ||
            key_sym == NUX_VK_RIGHT ||
            key_sym == NUX_VK_ENTER ||
            key_sym == NUX_KP_ENTER)
        {
          return true;
        }

        if (multiline_ && (key_sym == NUX_VK_UP))
        {
          // Navigate between the lines of the text entry.
          // This will move the cursor one line up.
          return true;
        }

        if (multiline_ && (key_sym == NUX_VK_DOWN))
        {
          // Navigate between the lines of the text entry.
          // This will move the cursor one line down.
          return true;
        }

        if ((!multiline_) && (!lose_key_focus_on_key_nav_direction_up_) && (key_sym == NUX_VK_UP))
        {
          // By returning true, the text entry signals that it want to receive the signal for this event.
          // Otherwise, the parent view of the text entry would be looking for another view to receive keynav focus to.
          return true;
        }

        if ((!multiline_) && (!lose_key_focus_on_key_nav_direction_down_) && (key_sym == NUX_VK_DOWN))
        {
          // By returning true, the text entry signals that it want to receive the signal for this event.
          // Otherwise, the parent view of the text entry would be looking for another view to receive keynav focus to.
          return true;
        }

        return false;
      }
    }

    if ((eventType == NUX_KEYDOWN) && (key_nav_mode_ == true) && (text_input_mode_ == true) && (ime_active_ == false))
    {
      // Enable to exit the TextEntry when in write mode(hack for unity dash)
      if (key_sym == NUX_VK_UP ||
      key_sym == NUX_VK_DOWN ||
      key_sym == NUX_VK_ESCAPE)
      {
        if ((!multiline_) && (!lose_key_focus_on_key_nav_direction_up_) && NUX_VK_UP)
        {
          // By returning true, the text entry signals that it want to receive the signal for this event.
          // Otherwise, the parent view of the text entry would be looking for another view to receive keynav focus to.
          return true;
        }

        if ((!multiline_) && (!lose_key_focus_on_key_nav_direction_down_) && NUX_VK_DOWN)
        {
          // By returning true, the text entry signals that it want to receive the signal for this event.
          // Otherwise, the parent view of the text entry would be looking for another view to receive keynav focus to.
          return true;
        }

        return false;
      }
    }

    if ((eventType == NUX_KEYDOWN) && (key_nav_mode_ == false) && (text_input_mode_ == false))
    {
      return false;
    }

    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::TextEntry::InspectKeyEvent ( unsigned int  event_type,
unsigned int  keysym,
const char *  character 
) [protected, virtual, inherited]

Return True if the the area knows what to do with the key event.

For a View to receive the key_up and key_down signal, it must override this function and return true.

Parameters:
even_typeEvent type is either EVENT_KEY_DOWN or EVENT_KEY_UP.
keysymThe key symbol.
charactersThe character string of the key.
Returns:
bool True if the View wants to received the key events signals.

Reimplemented from nux::Area.

Definition at line 2345 of file TextEntry.cpp.

  {
    nux::Event const& cur_event = GetGraphicsDisplay()->GetCurrentEvent();

    return InspectKeyEvent(cur_event);
  }

Here is the call graph for this function:

bool nux::Area::Is3DArea ( ) const [inherited]

Definition at line 676 of file Area.cpp.

  {
    return _3d_area;
  }
virtual bool nux::InputArea::IsArea ( ) const [inline, virtual, inherited]

Reimplemented from nux::Area.

Definition at line 91 of file InputArea.h.

    {
      return true;
    }

Definition at line 99 of file InputArea.cpp.

bool nux::Area::IsChildOf ( Area parent) [inherited]

Return true is area is a child of the given parent in the widget tree.

Parameters:
parentArea to test if it is a parent of this area.
Returns:
True if this area is area is a child of parent in the widget tree.

Definition at line 837 of file Area.cpp.

  {
    if (this == parent)
      return true;

    if (!parent || !parent_area_)
      return false;

    return parent_area_->IsChildOf(parent);    
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Trackable::IsDynamic ( ) const [inherited]

Test if object was allocated dynamically.

Definition at line 201 of file Object.cpp.

  {
    // Get pointer to beginning of the memory occupied by this.
    const void *ptr = dynamic_cast<const void *> (this);

    // Search for ptr in allocation_list
#if defined(NUX_OS_WINDOWS) && !defined(NUX_VISUAL_STUDIO_2010)
    std::list<void*>::iterator i = std::find(GObjectStats._allocation_list.begin(),
      GObjectStats._allocation_list.end(), ptr);
#else
    auto i = std::find(GObjectStats._allocation_list.begin(),
                       GObjectStats._allocation_list.end(), ptr);
#endif
    return i != GObjectStats._allocation_list.end();
  }

Here is the caller graph for this function:

bool nux::View::IsFullRedraw ( ) const [protected, inherited]

Accessed inside ContentDraw() to help determine if some parts needs to be rendered.

Do not use it elsewhere.

Returns:
True if Draw() was called before ContentDraw().

Definition at line 254 of file View.cpp.

  {
    return full_view_draw_cmd_;
  }

Here is the caller graph for this function:

bool nux::Trackable::IsHeapAllocated ( ) [inherited]

Test if object was allocated dynamically.

Definition at line 191 of file Object.cpp.

  {
    if (_heap_allocated == -1)
    {
      _heap_allocated = (IsDynamic () ? 1 : 0);
    }

    return (_heap_allocated == 1 ? true : false);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::View::IsHitDetectionSkipingChildren ( bool  skip_children) [inherited]
bool nux::Area::IsInputArea ( ) const [virtual, inherited]

Definition at line 631 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(InputArea::StaticObjectType);;
  }
bool nux::TextEntry::IsInTextInputMode ( ) const [inherited]

Return True if the text has been modified after the text entry has received the keyboard focus.


If the text entry already has characters typed in and it gets the keyboard focus, this function return false while the text has not been modified. The text can be modified either by typing new characters or addind text through TextEntry::SetText, TextEntry::EnterText, TextEntry::DeleteText. If this text entry does not have the keyboard focus, this function returns false.

Returns:
True after the text entry has received the keyboard focus and text has been typed in.

Definition at line 2487 of file TextEntry.cpp.

  {
    return text_input_mode_;
  }
bool nux::Area::IsLayout ( ) const [virtual, inherited]

Definition at line 641 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(Layout::StaticObjectType);
  }

Here is the caller graph for this function:

bool nux::Area::IsLayoutDone ( ) [virtual, inherited]

Definition at line 616 of file Area.cpp.

  {
    return layout_done_;
  }

Here is the caller graph for this function:

bool nux::InputArea::IsMouseInside ( ) [inherited]

Returns true if the mouse pointer has been determined as inside the this area, following event processing.

Returns true if during a call to FindAreaUnderMouse, this area has been determined to be directly under the mouse pointer. Note that this is true only for the first area that is found. There might be other areas that which have the mouse pointer inside of them.
Call Area::IsMousePointerInside to find out if the mouse pointer is inside an area.

Returns:
Return true if the mouse pointer is inside the Area.

Definition at line 83 of file InputArea.cpp.

  {
    return mouse_in_;
  }

Here is the caller graph for this function:

bool nux::InputArea::IsMouseOwner ( ) [inherited]

Return true if this Area is the owner of the mouse pointer.

The owner of the mouse pointer is the Area that has received a Mouse down event and the mouse button responsible for the event is still pressed.

Returns:
True if this Area is the owner of the mouse pointer.

Definition at line 276 of file InputArea.cpp.

  {
    return (GetWindowThread()->GetWindowCompositor().GetMouseOwnerArea() == this);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::IsMousePointerInside ( ) const [inherited]

Test if the mouse pointer is inside the area.

Return true if the mouse pointer is inside the area.

Returns:
True if the mouse pointer is inside the area.

Definition at line 1029 of file Area.cpp.

  {
    Geometry geo = GetAbsoluteGeometry();
    Point position = GetWindowThread()->GetWindowCompositor().GetMousePosition();
    
    if (geo.IsInside(position))
      return true;

    return false;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::View::IsRedrawNeeded ( ) [virtual, inherited]

Definition at line 249 of file View.cpp.

  {
    return draw_cmd_queued_;
  }

Here is the caller graph for this function:

bool nux::Area::IsSensitive ( ) const [inherited]

Deprecated. Use GetInputEventSensitivity.

Definition at line 576 of file Area.cpp.

  {
    return GetInputEventSensitivity();
  }

Here is the call graph for this function:

bool nux::Area::IsSpaceLayout ( ) const [virtual, inherited]

Definition at line 651 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(SpaceLayout::StaticObjectType);;
  }
bool nux::Area::IsView ( ) const [virtual, inherited]

Definition at line 636 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(View::StaticObjectType);;
  }

Here is the caller graph for this function:

bool nux::View::IsViewEnabled ( ) const [inherited]

Gets the enable state of the View.

Returns:
True if the view is active.

Definition at line 408 of file View.cpp.

  {
    return view_enabled_;
  }
bool nux::Area::IsViewWindow ( ) const [virtual, inherited]

Definition at line 646 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(BaseWindow::StaticObjectType);
  }

Here is the caller graph for this function:

bool nux::Area::IsVisible ( ) [inherited]

Get the visibility of the area.

Gets whether the area is visible to the user and will be visible to the user. Default is true.

Returns:
whether the area is visible

Definition at line 553 of file Area.cpp.

  {
    return visible_;
  }

Here is the caller graph for this function:

Definition at line 119 of file InputArea.cpp.

Area * nux::View::KeyNavIteration ( KeyNavDirection  direction) [virtual, inherited]

Reimplemented from nux::Area.

Reimplemented in nux::HSplitter, and nux::VSplitter.

Definition at line 460 of file View.cpp.

  {
    if (next_object_to_key_focus_area_)
    {
      return NULL;
    }

    if (IsVisible() == false)
      return NULL;

    if (AcceptKeyNavFocus())
    {
      QueueDraw();
      return this;
    }
    else if (view_layout_)
    {
      return view_layout_->KeyNavIteration(direction);
    }

    return NULL;
  }

Here is the call graph for this function:

int nux::TextEntry::LayoutIndexToTextIndex ( int  layout_index) [protected, inherited]

Convert index in layout text into index in text_.

Definition at line 1583 of file TextEntry.cpp.

  {
    if (visible_)
    {
      if (layout_index < cursor_)
        return layout_index;

      int preedit_length = static_cast<int>(preedit_.length());
      if (layout_index >= cursor_ + preedit_length)
        return layout_index - preedit_length;

      return cursor_;
    }

    int password_char_length = static_cast<int>(password_char_.length());
    nuxAssert(layout_index % password_char_length == 0);

    int offset = layout_index / password_char_length;

    const char *text = text_.c_str();
    int cursor_offset = static_cast<int>(
      g_utf8_pointer_to_offset(text, text + cursor_));
    int preedit_chars = static_cast<int>(
      g_utf8_strlen(preedit_.c_str(), preedit_.length()));

    if (offset < cursor_offset)
      return static_cast<int>(g_utf8_offset_to_pointer(text, offset) - text);

    if (offset >= cursor_offset + preedit_chars)
      return static_cast<int>(
      g_utf8_offset_to_pointer(text, offset - preedit_chars) - text);

    return cursor_;
  }

Here is the caller graph for this function:

int nux::TextEntry::LookForMatch ( std::string &  str) [protected, inherited]

Definition at line 1269 of file TextEntry.cpp.

  {
    str.clear();
    int search_state = NO_MATCH;

    // Check if the string we have is a match,partial match or doesnt match
    for (int i = 0; nux_compose_seqs_compact[i] != "\0"; i++)
    {
      if (nux_compose_seqs_compact[i].compare(composition_string_) == 0)
      {
        // advance to the next sequence after ::
        while (nux_compose_seqs_compact[++i].compare("::") != 0)
        {
        }

        str = nux_compose_seqs_compact[++i];
        return MATCH;
      }
      else if (nux_compose_seqs_compact[i].find(composition_string_) != std::string::npos)
      {
        search_state = PARTIAL;
      }
    }
    return search_state;
  }

Here is the caller graph for this function:

void nux::TextEntry::MainDraw ( ) [inherited]

Definition at line 805 of file TextEntry.cpp.

  {

    CairoGraphics* edit_canvas = EnsureCanvas();

    if (update_canvas_ || !last_selection_region_.empty() || !selection_region_.empty())
    {
      edit_canvas->PushState();
      DrawText(edit_canvas);
      edit_canvas->PopState();
    }

//     if (background_)
//       background_->Draw(canvas, 0, 0, GetBaseWidth, GetBaseHeight);

    CairoGraphics* final_canvas = new CairoGraphics(CAIRO_FORMAT_ARGB32, edit_canvas->GetWidth(), edit_canvas->GetHeight());

    final_canvas->PushState();
    final_canvas->IntersectRectClipRegion(kInnerBorderX,
      kInnerBorderY,
      GetBaseWidth() - kInnerBorderX,
      GetBaseHeight() - kInnerBorderY);
    final_canvas->DrawCanvas(0, 0, edit_canvas);
    final_canvas->PopState();
    DrawCursor(final_canvas);

    update_canvas_ = false;
    last_selection_region_ = selection_region_;
    last_cursor_region_ = cursor_region_;

    NBitmapData* bitmap = final_canvas->GetBitmap();
    delete final_canvas;

    if (!_texture2D || _texture2D->GetWidth() != bitmap->GetWidth() || _texture2D->GetHeight() != bitmap->GetHeight())
    {
      if (_texture2D)
        _texture2D->UnReference();
      _texture2D = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture();
    }

    _texture2D->Update(bitmap);
    delete bitmap;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 89 of file InputArea.cpp.

  {
    return false;
  }
void nux::TextEntry::MoveCursor ( MovementStep  step,
int  count,
bool  extend_selection 
) [protected, inherited]

Move cursor.

Definition at line 1923 of file TextEntry.cpp.

  {
    ResetImContext();
    int new_cursor = 0;
    // Clear selection first if not extend it.
    if (!extend_selection)
    {
      selection_changed_ = true;
      cursor_moved_ = true;
      selection_bound_ = cursor_;
      cursor_moved.emit(cursor_);
    }

    // Calculate the new offset after motion.
    switch(step)
    {
    case VISUALLY:
      new_cursor = MoveVisually(cursor_, count);
      break;
    case WORDS:
      new_cursor = MoveWords(cursor_, count);
      break;
    case DISPLAY_LINES:
      new_cursor = MoveDisplayLines(cursor_, count);
      break;
    case DISPLAY_LINE_ENDS:
      new_cursor = MoveLineEnds(cursor_, count);
      break;
    case PAGES:
      new_cursor = MovePages(cursor_, count);
      break;
    case BUFFER:
      nuxAssert(count == -1 || count == 1);
      new_cursor = static_cast<int>(count == -1 ? 0 : text_.length());
      break;
    }

    if (extend_selection)
      SetSelectionBounds(selection_bound_, new_cursor);
    else
      SetCursor(new_cursor);

    QueueRefresh(true, true);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2462 of file TextEntry.cpp.

Here is the call graph for this function:

Public API.

Definition at line 2457 of file TextEntry.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::TextEntry::MoveDisplayLines ( int  current_pos,
int  count 
) [protected, inherited]

Move cursor in display lines.

Definition at line 2113 of file TextEntry.cpp.

  {
    nuxAssert(current_index >= 0 &&
      current_index <= static_cast<int>(text_.length()));
    nuxAssert(count);
    nuxAssert(preedit_.length() == 0);

    PangoLayout *layout = EnsureLayout();
    const char *text = pango_layout_get_text(layout);
    int index = TextIndexToLayoutIndex(current_index, false);
    int n_lines = pango_layout_get_line_count(layout);
    int line_index = 0;
    int x_off = 0;
    PangoRectangle rect;

    // Find the current cursor X position in layout
    pango_layout_index_to_line_x(layout, index, FALSE, &line_index, &x_off);

    // Weird bug: line_index here may be >= than line count?
    if (line_index >= n_lines)
    {
      line_index = n_lines - 1;
    }

    pango_layout_get_cursor_pos(layout, index, &rect, NULL);
    x_off = rect.x;

    line_index += count;

    if (line_index < 0)
    {
      return 0;
    }
    else if (line_index >= n_lines)
    {
      return static_cast<int>(text_.length());
    }

    int trailing;
#if PANGO_VERSION_CHECK(1,16,0)
    PangoLayoutLine *line = pango_layout_get_line_readonly(layout, line_index);
#else
    PangoLayoutLine *line = pango_layout_get_line(layout, line_index);
#endif
    // Find out the cursor x offset related to the new line position.
    if (line->resolved_dir == PANGO_DIRECTION_RTL)
    {
      pango_layout_get_cursor_pos(layout, line->start_index + line->length,
        &rect, NULL);
    }
    else
    {
      pango_layout_get_cursor_pos(layout, line->start_index, &rect, NULL);
    }

    // rect.x is the left edge position of the line in the layout
    x_off -= rect.x;
    if (x_off < 0) x_off = 0;
    pango_layout_line_x_to_index(line, x_off, &index, &trailing);

    index = static_cast<int>(g_utf8_offset_to_pointer(text + index, trailing) - text);
    return LayoutIndexToTextIndex(index);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::TextEntry::MoveLineEnds ( int  current_pos,
int  count 
) [protected, inherited]

Move cursor to the beginning or end of a display line.

Definition at line 2194 of file TextEntry.cpp.

  {
    nuxAssert(current_index >= 0 &&
      current_index <= static_cast<int>(text_.length()));
    nuxAssert(count);
    nuxAssert(preedit_.length() == 0);

    PangoLayout *layout = EnsureLayout();
    int index = TextIndexToLayoutIndex(current_index, false);
    int line_index = 0;

    // Find current line
    pango_layout_index_to_line_x(layout, index, FALSE, &line_index, NULL);

    // Weird bug: line_index here may be >= than line count?
    int line_count = pango_layout_get_line_count(layout);
    if (line_index >= line_count)
    {
      line_index = line_count - 1;
    }

// #if PANGO_VERSION_CHECK(1,16,0)
//     PangoLayoutLine *line = pango_layout_get_line_readonly(layout, line_index);
// #else
    PangoLayoutLine *line = pango_layout_get_line(layout, line_index);
// #endif

    if (line->length == 0)
      return current_index;

    if ((line->resolved_dir == PANGO_DIRECTION_RTL && count < 0) ||
      (line->resolved_dir != PANGO_DIRECTION_RTL && count > 0))
    {
        index = line->start_index + line->length;
    }
    else
    {
      index = line->start_index;
    }
    return LayoutIndexToTextIndex(index);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::TextEntry::MovePages ( int  current_pos,
int  count 
) [protected, inherited]

Move cursor in pages.

Definition at line 2177 of file TextEntry.cpp.

  {
    nuxAssert(current_index >= 0 &&
      current_index <= static_cast<int>(text_.length()));
    nuxAssert(count);
    nuxAssert(preedit_.length() == 0);

    // Transfer pages to display lines.
    PangoLayout *layout = EnsureLayout();
    int layout_height;
    pango_layout_get_pixel_size(layout, NULL, &layout_height);
    int n_lines = pango_layout_get_line_count(layout);
    int line_height = layout_height / n_lines;
    int page_lines = (GetBaseHeight() - kInnerBorderY * 2) / line_height;
    return MoveDisplayLines(current_index, count * page_lines);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::TextEntry::MoveVisually ( int  current_pos,
int  count 
) [protected, inherited]

Move cursor visually, meaning left or right.

Definition at line 1968 of file TextEntry.cpp.

  {
    nuxAssert(current_index >= 0 &&
      current_index <= static_cast<int>(text_.length()));
    nuxAssert(count);
    nuxAssert(preedit_.length() == 0);

    PangoLayout* layout = EnsureLayout();
    const char* text = pango_layout_get_text(layout);
    int index = TextIndexToLayoutIndex(current_index, false);
    int new_index = 0;
    int new_trailing = 0;
    while (count != 0)
    {
      if (count > 0)
      {
        --count;
        pango_layout_move_cursor_visually(layout, true, index, 0, 1,
          &new_index, &new_trailing);
      }
      else if (count < 0)
      {
        ++count;
        pango_layout_move_cursor_visually(layout, true, index, 0, -1,
          &new_index, &new_trailing);
      }
      index = new_index;
      if (index < 0 || index == G_MAXINT)
        return current_index;
      index = static_cast<int>(g_utf8_offset_to_pointer(text + index, new_trailing) - text);
    }
    return LayoutIndexToTextIndex(index);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::TextEntry::MoveWords ( int  current_pos,
int  count 
) [protected, inherited]

Move cursor in words.

Definition at line 2002 of file TextEntry.cpp.

  {
    nuxAssert(current_index >= 0 &&
      current_index <= static_cast<int>(text_.length()));
    nuxAssert(count);
    nuxAssert(preedit_.length() == 0);

    if (!visible_)
    {
      return static_cast<int>(count > 0 ? text_.length() : 0);
    }

    // The cursor movement direction shall be determined by the direction of
    // current text line.
    PangoLayout* layout = EnsureLayout();
    int n_log_attrs;
    PangoLogAttr* log_attrs;
    pango_layout_get_log_attrs(layout, &log_attrs, &n_log_attrs);
    const char* text = pango_layout_get_text(layout);
    int index = TextIndexToLayoutIndex(current_index, false);
    int line_index;
    pango_layout_index_to_line_x(layout, index, FALSE, &line_index, NULL);

    // Weird bug: line_index here may be >= than line count?
    int line_count = pango_layout_get_line_count(layout);
    if (line_index >= line_count)
    {
      line_index = line_count - 1;
    }

#if PANGO_VERSION_CHECK(1,16,0)
    PangoLayoutLine* line = pango_layout_get_line_readonly(layout, line_index);
#else
    PangoLayoutLine* line = pango_layout_get_line(layout, line_index);
#endif
    bool rtl = (line->resolved_dir == PANGO_DIRECTION_RTL);
    const char* ptr = text + index;
    int offset = static_cast<int>(g_utf8_pointer_to_offset(text, ptr));
    while (count != 0)
    {
      if (((rtl && count < 0) || (!rtl && count > 0)) && *ptr)
      {
        if (log_attrs[offset].is_white)
        {
          while (ptr && *ptr && log_attrs[offset].is_white)
          {
            ptr = g_utf8_find_next_char(ptr, NULL);
            ++offset;
          }
        }
        else
        {
          if (ptr && *ptr)
          {
            ptr = g_utf8_find_next_char(ptr, NULL);
            ++offset;
          }
        }
        while (ptr && *ptr)
        {
          ptr = g_utf8_find_next_char(ptr, NULL);
          ++offset;
          if (log_attrs[offset].is_word_start || log_attrs[offset].is_word_end)
            break;
        }
        if (!ptr)
        {
          ptr = text;
          while (*ptr) ++ptr;
        }
      }
      else if (((rtl && count > 0) || (!rtl && count < 0)) && (ptr > text))
      {
        if (offset > 0 && log_attrs[offset - 1].is_white)
        {
          while (ptr && offset > 0 && log_attrs[offset - 1].is_white)
          {
            ptr = g_utf8_find_prev_char(text, ptr);
            --offset;
          }
        }
        else
        {
          if (ptr)
          {
            ptr = g_utf8_find_prev_char(text, ptr);
            --offset;
          }
        }
        while (ptr /*&& *ptr*/) //fix: when at the end of the string, allow ctrl+left arrow to move backward to the start/end of the previous word.
        {
          ptr = g_utf8_find_prev_char(text, ptr);
          --offset;
          if (log_attrs[offset].is_word_start || log_attrs[offset].is_word_end)
            break;
        }
        if (!ptr)
          ptr = text;
      }
      else
      {
        break;
      }
      if (count > 0)
        --count;
      else
        ++count;
    }
    return LayoutIndexToTextIndex(static_cast<int>(ptr - text));
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::View::NeedSoftRedraw ( ) [virtual, inherited]

Causes a soft redraw. The widget parameter draw_cmd_queued_ is set to false. The widget DrawContent() and PostDraw() are called.

Definition at line 237 of file View.cpp.

  {
    //GetWindowCompositor()..AddToDrawList(this);
    WindowThread* application = GetWindowThread();
    if (application)
    {
        application->AddToDrawList(this);
        application->RequestRedraw();
    }
    //draw_cmd_queued_ = false;
  }

Here is the call graph for this function:

nux::Object::NUX_DECLARE_OBJECT_TYPE ( BaseObject  ,
Trackable   
) [inherited]
void TestTextEntry::OnBeginKeyFocus ( ) [protected]

Definition at line 155 of file TestTextEntry.cpp.

void nux::View::OnChildFocusChanged ( Area child) [protected, inherited]

Reimplemented in nux::ScrollView.

Definition at line 316 of file View.cpp.

  {
    ChildFocusChanged.emit(/*parent,*/ child);
  }
void nux::InputArea::OnDraw ( GraphicsEngine graphics_engine,
bool  force_draw 
) [virtual, inherited]

Draw InputArea.

Draw a colored quad using m_AreaColor. Override this function to define a custom drawing function. If force_draw is true then the system requests that all objects redraw themselves completely.

Parameters:
force_draw.

Definition at line 68 of file InputArea.cpp.

  {
    graphics_engine.QRP_Color(GetBaseX(), GetBaseY(), GetBaseWidth(), GetBaseHeight(), area_color_);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void TestTextEntry::OnEndKeyFocus ( ) [protected]

Definition at line 160 of file TestTextEntry.cpp.

void TestTextEntry::OnKeyNavFocusChange ( nux::Area area,
bool  has_focus,
nux::KeyNavDirection  direction 
) [protected]

Definition at line 146 of file TestTextEntry.cpp.

{
  has_focus_ = HasKeyFocus();
  
  has_focus_ = has_focus;
  key_nav_direction_ = direction;
  QueueDraw();
}
void TestTextEntry::OnMouseClick ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 113 of file TestTextEntry.cpp.

void TestTextEntry::OnMouseDoubleClick ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 119 of file TestTextEntry.cpp.

void TestTextEntry::OnMouseDown ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 90 of file TestTextEntry.cpp.

void TestTextEntry::OnMouseDrag ( int  x,
int  y,
int  dx,
int  dy,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 106 of file TestTextEntry.cpp.

void TestTextEntry::OnMouseEnter ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 132 of file TestTextEntry.cpp.

void TestTextEntry::OnMouseLeave ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 139 of file TestTextEntry.cpp.

void TestTextEntry::OnMouseMove ( int  x,
int  y,
int  dx,
int  dy,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 126 of file TestTextEntry.cpp.

void TestTextEntry::OnMouseUp ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected]

Definition at line 97 of file TestTextEntry.cpp.

void TestTextEntry::OnObjectDestroyed ( nux::Object object) [protected]

Definition at line 165 of file TestTextEntry.cpp.

void TestTextEntry::OnTextChanged ( TextEntry text_entry) [protected]

Definition at line 170 of file TestTextEntry.cpp.

void nux::Trackable::operator delete ( void *  ptr) [static, inherited]

Definition at line 178 of file Object.cpp.

  {
    ObjectStats::AllocationList::iterator i = std::find (GObjectStats._allocation_list.begin(), GObjectStats._allocation_list.end(), ptr);

    if (i != GObjectStats._allocation_list.end() )
    {
      GObjectStats._total_allocated_size -= NUX_STATIC_CAST (Trackable *, ptr)->_size_of_this_object;
      --GObjectStats._number_of_objects;
      GObjectStats._allocation_list.erase (i);
      ::operator delete (ptr);
    }
  }
void * nux::Trackable::operator new ( size_t  size) [static, inherited]

Definition at line 140 of file Object.cpp.

  {
    // Set the new_handler for this call
    std::new_handler global_handler  = std::set_new_handler (_new_current_handler);

    // If allocation fails _new_current_handler is called, if specified,
    // otherwise the global new_handler is called.
    void *ptr;

    try
    {
      ptr = ::operator new (size);

      GObjectStats._allocation_list.push_front (ptr);
      NUX_STATIC_CAST (Trackable *, ptr)->_size_of_this_object = size;
      GObjectStats._total_allocated_size += size;
      ++GObjectStats._number_of_objects;
    }
    catch (std::bad_alloc &)
    {
      std::set_new_handler (global_handler);
      throw;
    }

    //  Reset gloabal new_handler
    std::set_new_handler (global_handler);
    return ptr;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void * nux::Trackable::operator new ( size_t  size,
void *  ptr 
) [static, inherited]

Definition at line 171 of file Object.cpp.

  {
    return ::operator new (size, ptr);
  }

Here is the call graph for this function:

virtual void nux::View::OverlayDrawing ( GraphicsEngine graphics_engine) [inline, virtual, inherited]

Reimplemented from nux::InputArea.

Reimplemented in nux::HSplitter, and nux::VSplitter.

Definition at line 93 of file View.h.

{}
bool nux::InputArea::OwnsKeyboardGrab ( ) [inherited]

Definition at line 271 of file InputArea.cpp.

Here is the call graph for this function:

bool nux::InputArea::OwnsPointerGrab ( ) [inherited]

Definition at line 266 of file InputArea.cpp.

Here is the call graph for this function:

bool nux::Trackable::OwnsTheReference ( ) [inherited]

Test if object reference is owned.

Definition at line 117 of file Object.cpp.

  {
    return _owns_the_reference;
  }

Here is the caller graph for this function:

void nux::TextEntry::PasteClipboard ( ) [protected, virtual, inherited]

Paste the text in the clipboard to current offset.

Definition at line 1804 of file TextEntry.cpp.

  {
//     GtkWidget *widget = GetWidgetAndCursorLocation(NULL);
//     if (widget)
//     {
//       gtk_clipboard_request_text(
//         gtk_widget_get_clipboard(widget, GDK_SELECTION_CLIPBOARD),
//         PasteCallback, this);
//     }
  }

Here is the caller graph for this function:

void nux::TextEntry::PostDraw ( GraphicsEngine graphics_engine,
bool  force_draw 
) [virtual, inherited]

Reimplemented from nux::View.

Definition at line 620 of file TextEntry.cpp.

  {
    // intentionally left empty
  }
long nux::TextEntry::PostLayoutManagement ( long  layoutResult) [virtual, inherited]

Reimplemented from nux::View.

Definition at line 216 of file TextEntry.cpp.

  {
    long result = View::PostLayoutManagement(layoutResult);
    MainDraw();
    return result;
  }

Here is the call graph for this function:

void nux::View::PostResizeGeometry ( ) [protected, virtual, inherited]

Definition at line 152 of file View.cpp.

  {
  }

Here is the caller graph for this function:

void nux::TextEntry::PreLayoutManagement ( ) [virtual, inherited]

Reimplemented from nux::View.

Definition at line 211 of file TextEntry.cpp.

void nux::View::PreResizeGeometry ( ) [protected, virtual, inherited]

Definition at line 147 of file View.cpp.

  {

  }
void nux::View::ProcessDraw ( GraphicsEngine graphics_engine,
bool  force_draw 
) [virtual, inherited]

Definition at line 156 of file View.cpp.

  {
    full_view_draw_cmd_ = false;

    graphics_engine.PushModelViewMatrix(Get2DMatrix());

    if (force_draw)
    {
      GetPainter().PaintBackground(graphics_engine, GetGeometry());
      GetPainter().PushPaintLayerStack();

      draw_cmd_queued_ = true;
      full_view_draw_cmd_ = true;
      Draw(graphics_engine, force_draw);
      DrawContent(graphics_engine, force_draw);
      PostDraw(graphics_engine, force_draw);

      GetPainter().PopPaintLayerStack();
    }
    else
    {
      if (draw_cmd_queued_)
      {
        GetPainter().PaintBackground(graphics_engine, GetGeometry());
        GetPainter().PushPaintLayerStack();

        full_view_draw_cmd_ = true;
        Draw(graphics_engine, false);
        DrawContent(graphics_engine, false);
        PostDraw(graphics_engine, false);

        GetPainter().PopPaintLayerStack();
      }
      else
      {
        DrawContent(graphics_engine, false);
        PostDraw(graphics_engine, false);
      }
    }

    graphics_engine.PopModelViewMatrix();

    draw_cmd_queued_ = false;
    full_view_draw_cmd_ = false;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::TextEntry::ProcessKeyEvent ( unsigned long  eventType,
unsigned long  keysym,
unsigned long  state,
const char *  character,
unsigned short  keyCount 
) [inherited]

Definition at line 301 of file TextEntry.cpp.

  {
#if defined(NUX_OS_LINUX)
    if (im_running())
    {
      // FIXME Have to get the current event for the x11_keycode for ibus-hangul/korean input
      nux::Event const& cur_event = GetGraphicsDisplay()->GetCurrentEvent();
      KeyEvent event(static_cast<EventType>(event_type), keysym, cur_event.x11_keycode, state, character);

      if (ime_->FilterKeyEvent(event))
        return;
    }
#endif

    /* Ignore all the keyup events to make Composition and Dead keys to work,
     * as no one (IBus a part) needs them */
    if (event_type == NUX_KEYUP)
      return;

#if defined(NUX_OS_LINUX)
    if (dead_key_mode_ && keysym == XK_space)
    {
      dead_key_mode_ = false;
      EnterText(dead_key_string_.c_str());
      QueueRefresh(false, true);
      return;
    }

    if (HandledDeadKeys(keysym, state, character))
    {
      return;
    }
    else if (HandledComposition(keysym, character))
    {
      return;
    }
#endif

    if (event_type == NUX_KEYDOWN)
      text_input_mode_ = true;

    cursor_blink_status_ = 4;

    if ((!multiline_) && (!lose_key_focus_on_key_nav_direction_up_) && (keysym == NUX_VK_UP))
    {