Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Toplevel


Detailed Description

A toplevel widget is a widget that can't have a parent (such as a window or an embed widget).

A toplevel widget has also to provide the Evas that will be used by all its children.
You can use the toplevel parent of a widget to change the shape of the mouse pointer with etk_toplevel_pointer_push() and etk_toplevel_pointer_pop().
For example, to change the mouse pointer when the mouse is above a button:

 //Called when the button is entered: change the mouse pointer to ETK_POINTER_MOVE
 void _button_entered_cb(Etk_Widget *widget, void *data)
 {
    Etk_Toplevel *toplevel;

    if (!(toplevel = etk_widget_toplevel_parent_get(widget)))
       return;
    etk_toplevel_pointer_push(toplevel, ETK_POINTER_MOVE);
 }

 //Called when the button is left: restore the mouse pointer
 void _button_left_cb(Etk_Widget *widget, void *data)
 {
    Etk_Toplevel *toplevel;

    if (!(toplevel = etk_widget_toplevel_parent_get(widget)))
       return;
    etk_toplevel_pointer_pop(toplevel, ETK_POINTER_MOVE);
 }

 etk_signal_connect("entered", ETK_OBJECT(button), ETK_CALLBACK(_button_entered_cb), NULL);
 etk_signal_connect("left", ETK_OBJECT(button), ETK_CALLBACK(_button_left_cb), NULL);

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Container
        • Etk_Bin
          • Etk_Toplevel
Properties:
  • "evas": The Evas of the toplevel widget
    • Type: Pointer (Evas *)
    • Access: Read Only
    • Default Value: NULL
  • "focused-widget": The focused widget of the toplevel widget
    • Type: Pointer (Etk_Widget *)
    • Access: Read/Write
    • Default Value: NULL


Data Structures

struct  Etk_Toplevel
 [Widget] A widget that can't have a parent More...

Defines

#define ETK_TOPLEVEL_TYPE   (etk_toplevel_type_get())
#define ETK_TOPLEVEL(obj)   (ETK_OBJECT_CAST((obj), ETK_TOPLEVEL_TYPE, Etk_Toplevel))
#define ETK_IS_TOPLEVEL(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_TOPLEVEL_TYPE))

Enumerations

enum  Etk_Pointer_Type
 The different types of mouse pointer. More...

Functions

Evas * etk_toplevel_evas_get (Etk_Toplevel *toplevel)
 Gets the evas of the toplevel widget.
void etk_toplevel_evas_position_get (Etk_Toplevel *toplevel, int *x, int *y)
 Gets the position of the toplevel widget, relative to the top left corner of the evas where it is drawn.
void etk_toplevel_screen_position_get (Etk_Toplevel *toplevel, int *x, int *y)
 Gets the position of the toplevel widget, relative to the top left corner of the screen.
void etk_toplevel_size_get (Etk_Toplevel *toplevel, int *w, int *h)
 Gets the size of the toplevel widget.
void etk_toplevel_focused_widget_set (Etk_Toplevel *toplevel, Etk_Widget *widget)
 Sets the focused widget of the toplevel widget. If you want to focus a widget, use etk_widget_focus() rather.
Etk_Widget * etk_toplevel_focused_widget_get (Etk_Toplevel *toplevel)
 Gets the focused widget of the toplevel widget.
Etk_Widget * etk_toplevel_focused_widget_prev_get (Etk_Toplevel *toplevel)
 Gets the previous widget to focus.
Etk_Widget * etk_toplevel_focused_widget_next_get (Etk_Toplevel *toplevel)
 Gets the next widget to focus.
void etk_toplevel_pointer_push (Etk_Toplevel *toplevel, Etk_Pointer_Type pointer_type)
 Pushs a pointer type on the pointer stack. It will change the pointer shape.
void etk_toplevel_pointer_pop (Etk_Toplevel *toplevel, Etk_Pointer_Type pointer_type)
 Pops out of the pointer stack the first pointer of the stack whose type corresponds to pointer_type. It will change the pointer shape if the pointer to pop out is the one currently on the top of the stack.
Evas_List * etk_toplevel_widgets_get (void)
 Gets a list of all the created toplevel widgets.


Define Documentation

#define ETK_TOPLEVEL_TYPE   (etk_toplevel_type_get())

Gets the type of a toplevel widget

#define ETK_TOPLEVEL ( obj   )     (ETK_OBJECT_CAST((obj), ETK_TOPLEVEL_TYPE, Etk_Toplevel))

Casts the object to an Etk_Toplevel

Referenced by etk_embed_new(), etk_main_iterate(), etk_popup_window_popup_at_xy(), and etk_window_geometry_get().

#define ETK_IS_TOPLEVEL ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_TOPLEVEL_TYPE))

Checks if the object is an Etk_Toplevel

Referenced by etk_widget_parent_set().


Enumeration Type Documentation

enum Etk_Pointer_Type

The different types of mouse pointer.


Function Documentation

Evas * etk_toplevel_evas_get ( Etk_Toplevel *  toplevel  ) 

Gets the evas of the toplevel widget.

Parameters:
toplevel a toplevel widget
Returns:
Returns the evas of the toplevel widget

References evas.

Referenced by etk_widget_toplevel_evas_get().

void etk_toplevel_evas_position_get ( Etk_Toplevel *  toplevel,
int *  x,
int *  y 
)

Gets the position of the toplevel widget, relative to the top left corner of the evas where it is drawn.

Parameters:
toplevel a toplevel widget
x the location where to store the x evas position of the toplevel widget
y the location where to store the y evas position of the toplevel widget

References evas_position_get.

void etk_toplevel_screen_position_get ( Etk_Toplevel *  toplevel,
int *  x,
int *  y 
)

Gets the position of the toplevel widget, relative to the top left corner of the screen.

Parameters:
toplevel a toplevel widget
x the location where to store the x screen position of the toplevel widget
y the location where to store the y screen position of the toplevel widget

References screen_position_get.

Referenced by etk_window_geometry_get().

void etk_toplevel_size_get ( Etk_Toplevel *  toplevel,
int *  w,
int *  h 
)

Gets the size of the toplevel widget.

Parameters:
toplevel a toplevel widget
w the location where to store the width of the toplevel widget
h the location where to store the height of the toplevel widget

References size_get.

Referenced by etk_window_geometry_get().

void etk_toplevel_focused_widget_set ( Etk_Toplevel *  toplevel,
Etk_Widget *  widget 
)

Sets the focused widget of the toplevel widget. If you want to focus a widget, use etk_widget_focus() rather.

Parameters:
toplevel a toplevel widget
widget the widget to set as focused
Note:
This function is mainly used in widget implementations, you usually don't have to call it yourself

References ETK_OBJECT, etk_object_notify(), and focused_widget.

Referenced by etk_widget_focus(), and etk_widget_unfocus().

Etk_Widget * etk_toplevel_focused_widget_get ( Etk_Toplevel *  toplevel  ) 

Gets the focused widget of the toplevel widget.

Parameters:
toplevel a toplevel widget
Returns:
Returns the focused widget of the toplevel widget

References focused_widget.

Referenced by etk_widget_focus(), and etk_widget_is_focused().

Etk_Widget * etk_toplevel_focused_widget_prev_get ( Etk_Toplevel *  toplevel  ) 

Gets the previous widget to focus.

Parameters:
toplevel a toplevel widget
Returns:
Returns the previous widget to focus
Note:
This function is mainly used in widget implementations, you usually don't have to call it yourself

References etk_widget_disabled_get(), Etk_Widget::focusable, and focused_widget.

Etk_Widget * etk_toplevel_focused_widget_next_get ( Etk_Toplevel *  toplevel  ) 

Gets the next widget to focus.

Parameters:
toplevel a toplevel widget
Returns:
Returns the next widget to focus
Note:
This function is mainly used in widget implementations, you usually don't have to call it yourself

References etk_widget_disabled_get(), Etk_Widget::focusable, and focused_widget.

void etk_toplevel_pointer_push ( Etk_Toplevel *  toplevel,
Etk_Pointer_Type  pointer_type 
)

Pushs a pointer type on the pointer stack. It will change the pointer shape.

Parameters:
toplevel a toplevel widget
pointer_type the type of pointer to push on the stack

References pointer_set, and pointer_stack.

void etk_toplevel_pointer_pop ( Etk_Toplevel *  toplevel,
Etk_Pointer_Type  pointer_type 
)

Pops out of the pointer stack the first pointer of the stack whose type corresponds to pointer_type. It will change the pointer shape if the pointer to pop out is the one currently on the top of the stack.

Parameters:
toplevel a toplevel widget
pointer_type the type of pointer to pop out of the stack. -1 to pop the top pointer of the stack

References pointer_set, and pointer_stack.

Evas_List * etk_toplevel_widgets_get ( void   ) 

Gets a list of all the created toplevel widgets.

Returns:
Returns a list of all the created toplevel widgets
Note:
This list should not be modified or freed

Referenced by etk_main_iterate().