- more wrapper functions for EtkButton
- corrected --enable-examples option SVN revision: 38237
This commit is contained in:
parent
29e000ad38
commit
c55c98b2f7
4
TODO
4
TODO
|
@ -1,5 +1,5 @@
|
|||
* memory handling, it leaks like hell
|
||||
* parent/child chaining
|
||||
** more CountedPtr usage
|
||||
* wrap evas_color_* functions (e.g. evas_color_argb_premul)
|
||||
* move all #include <config.h> from *.h to *.cpp
|
||||
* write signal example for evas
|
||||
* split eflpp into seperate libs (e.g. eflpp-edje, eflpp-evas, ...)
|
||||
|
|
|
@ -85,17 +85,13 @@ fi
|
|||
AM_CONDITIONAL(EFLPP_ENABLE_FB, test "x$have_fbcon" = xyes)
|
||||
|
||||
|
||||
|
||||
|
||||
dnl Check for option to enable examples
|
||||
AC_MSG_CHECKING(whether to enable debugging)
|
||||
AC_MSG_CHECKING(whether to enable examples)
|
||||
AC_ARG_ENABLE(examples,
|
||||
[ --enable-examples=[no/yes] enables to build examples (default=yes)],,
|
||||
enable_examples=yes)
|
||||
|
||||
AM_CONDITIONAL(ENABLE_EXAMPLES, test "x$enable_examples" != "xyes")
|
||||
|
||||
|
||||
AM_CONDITIONAL(ENABLE_EXAMPLES, test "x$enable_examples" = "xyes")
|
||||
|
||||
dnl Check for pkg-config stuff
|
||||
pkg_modules="$esmart_modules $emotion_modules evas ecore ecore-config ecore-evas ecore-ipc ecore-txt ecore-con ecore-job sigc++-2.0 etk ewl"
|
||||
|
|
|
@ -16,6 +16,8 @@ int main( int argc, const char **argv )
|
|||
mainWindow->resize( Size( 200, 100 ) );
|
||||
|
||||
EtkButton* button = new EtkButton( "Hello World" );
|
||||
button->setFromStock( ETK_STOCK_BOOKMARK_NEW );
|
||||
button->setStockSize( ETK_STOCK_BIG );
|
||||
mainWindow->appendChild( button );
|
||||
mainWindow->showAll();
|
||||
|
||||
|
|
|
@ -195,10 +195,11 @@ CountedPtr <EvasObject> EdjePart::swallow()
|
|||
const char *t = evas_object_type_get( eo );
|
||||
EvasObject *ret_o = NULL;
|
||||
|
||||
if (t == string ("edje"))
|
||||
if( !strcmp( t,"edje" ) )
|
||||
{
|
||||
ret_o = EvasEdje::wrap (eo);
|
||||
}
|
||||
// TODO: support other types
|
||||
|
||||
return CountedPtr <EvasObject> (ret_o);
|
||||
}
|
||||
|
|
|
@ -59,6 +59,11 @@ void EtkObject::setAlignment( )
|
|||
{
|
||||
}
|
||||
|
||||
void EtkObject::init( )
|
||||
{
|
||||
_managed = true;
|
||||
}
|
||||
|
||||
//==========================================================================//
|
||||
// EtkWidget
|
||||
//==========================================================================//
|
||||
|
@ -66,6 +71,7 @@ void EtkObject::setAlignment( )
|
|||
EtkWidget::EtkWidget( EtkObject* parent, const char* type, const char* name )
|
||||
:EtkObject( parent, type, name )
|
||||
{
|
||||
init( );
|
||||
}
|
||||
|
||||
EtkWidget::~EtkWidget()
|
||||
|
@ -117,6 +123,7 @@ bool EtkWidget::visibilityLock() const
|
|||
EtkContainer::EtkContainer( EtkObject* parent, const char* type, const char* name )
|
||||
:EtkWidget( parent, type, name )
|
||||
{
|
||||
init( );
|
||||
}
|
||||
|
||||
EtkContainer::~EtkContainer()
|
||||
|
@ -140,6 +147,7 @@ void EtkContainer::setBorderWidth( int width )
|
|||
EtkTopLevelWidget::EtkTopLevelWidget( EtkObject* parent, const char* type, const char* name )
|
||||
:EtkContainer( parent, type, name )
|
||||
{
|
||||
init( );
|
||||
}
|
||||
|
||||
EtkTopLevelWidget::~EtkTopLevelWidget()
|
||||
|
@ -153,7 +161,8 @@ EtkTopLevelWidget::~EtkTopLevelWidget()
|
|||
EtkEmbed::EtkEmbed( EvasCanvas* canvas, EtkObject* parent, const char* type, const char* name )
|
||||
:EtkTopLevelWidget( parent, type, name )
|
||||
{
|
||||
_o = ETK_OBJECT( etk_embed_new( canvas->obj()) );
|
||||
init( );
|
||||
_o = ETK_OBJECT( etk_embed_new( canvas->obj()) );
|
||||
}
|
||||
|
||||
EtkEmbed::~EtkEmbed()
|
||||
|
@ -218,6 +227,7 @@ EtkBox::~EtkBox()
|
|||
EtkHBox::EtkHBox( EtkObject* parent, const char* type, const char* name )
|
||||
:EtkBox( parent, type, name )
|
||||
{
|
||||
init( );
|
||||
//ewl_box_orientation_set( EWL_BOX(_o), EWL_ORIENTATION_HORIZONTAL );
|
||||
}
|
||||
|
||||
|
@ -232,6 +242,7 @@ EtkHBox::~EtkHBox()
|
|||
EtkVBox::EtkVBox( EtkObject* parent, const char* type, const char* name )
|
||||
:EtkBox( parent, type, name )
|
||||
{
|
||||
init( );
|
||||
//ewl_box_orientation_set( EWL_BOX(_o), EWL_ORIENTATION_VERTICAL );
|
||||
}
|
||||
|
||||
|
@ -239,6 +250,21 @@ EtkVBox::~EtkVBox()
|
|||
{
|
||||
}
|
||||
|
||||
//==========================================================================//
|
||||
// EtkImage
|
||||
//==========================================================================//
|
||||
|
||||
EtkImage::EtkImage( Etk_Object *o )
|
||||
{
|
||||
_o = o;
|
||||
_managed = false;
|
||||
}
|
||||
|
||||
EtkImage *EtkImage::wrap( Etk_Object* o )
|
||||
{
|
||||
return new EtkImage( o );
|
||||
}
|
||||
|
||||
//==========================================================================//
|
||||
// EtkButton
|
||||
//==========================================================================//
|
||||
|
@ -246,6 +272,7 @@ EtkVBox::~EtkVBox()
|
|||
EtkButton::EtkButton( EtkObject* parent, const char* type, const char* name )
|
||||
:EtkBox( parent, type, name )
|
||||
{
|
||||
init( );
|
||||
setText( name ? name : "unnamed" );
|
||||
}
|
||||
|
||||
|
@ -255,6 +282,12 @@ EtkButton::EtkButton( const char* text, EtkObject* parent, const char* type, con
|
|||
setText( text );
|
||||
}
|
||||
|
||||
EtkButton::EtkButton( Etk_Object *o )
|
||||
{
|
||||
_o = o;
|
||||
_managed = false;
|
||||
}
|
||||
|
||||
EtkButton::~EtkButton()
|
||||
{
|
||||
}
|
||||
|
@ -264,6 +297,62 @@ void EtkButton::setText( const char* text )
|
|||
etk_button_label_set( ETK_BUTTON(_o), const_cast<char*>( text ) );
|
||||
}
|
||||
|
||||
const char *EtkButton::getText( )
|
||||
{
|
||||
return etk_button_label_get (ETK_BUTTON(_o));
|
||||
}
|
||||
|
||||
void EtkButton::setImage( EtkImage *image )
|
||||
{
|
||||
etk_button_image_set( ETK_BUTTON( _o ), ETK_IMAGE( image->obj( ) ));
|
||||
}
|
||||
|
||||
EtkImage *EtkButton::getImage( )
|
||||
{
|
||||
return EtkImage::wrap ( ETK_OBJECT( etk_button_image_get( ETK_BUTTON (_o ) )));
|
||||
}
|
||||
|
||||
EtkButton *EtkButton::wrap( Etk_Object* o )
|
||||
{
|
||||
return new EtkButton( o );
|
||||
}
|
||||
|
||||
void EtkButton::setFromStock( Etk_Stock_Id stock_id )
|
||||
{
|
||||
etk_button_set_from_stock( ETK_BUTTON( _o ), stock_id );
|
||||
}
|
||||
|
||||
void EtkButton::setStyle( Etk_Button_Style style )
|
||||
{
|
||||
etk_button_style_set( ETK_BUTTON( _o ), style );
|
||||
}
|
||||
|
||||
Etk_Button_Style EtkButton::getStyle( )
|
||||
{
|
||||
return etk_button_style_get( ETK_BUTTON( _o ));
|
||||
}
|
||||
|
||||
void EtkButton::setStockSize( Etk_Stock_Size size )
|
||||
{
|
||||
etk_button_stock_size_set( ETK_BUTTON( _o ), size );
|
||||
}
|
||||
|
||||
Etk_Stock_Size EtkButton::getStockSize( )
|
||||
{
|
||||
return etk_button_stock_size_get( ETK_BUTTON( _o ) );
|
||||
}
|
||||
|
||||
void EtkButton::setAlignment( float xalign, float yalign )
|
||||
{
|
||||
etk_button_alignment_set( ETK_BUTTON( _o ), xalign, yalign );
|
||||
}
|
||||
|
||||
void EtkButton::getAlignment( float &xalign, float &yalign )
|
||||
{
|
||||
etk_button_alignment_get( ETK_BUTTON( _o ), &xalign, &yalign);
|
||||
}
|
||||
|
||||
|
||||
//===============================================================================================
|
||||
// EtkApplication
|
||||
//===============================================================================================
|
||||
|
|
|
@ -21,7 +21,7 @@ class EtkWidget;
|
|||
|
||||
class EtkObject
|
||||
{
|
||||
public:
|
||||
public:
|
||||
EtkObject( EtkObject* parent = 0, const char* type = "<unknown>", const char* name = 0 );
|
||||
virtual ~EtkObject();
|
||||
|
||||
|
@ -30,12 +30,15 @@ class EtkObject
|
|||
|
||||
void resize( const Size& size );
|
||||
|
||||
public:
|
||||
public:
|
||||
Etk_Object* obj() const { return _o; };
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void init( );
|
||||
|
||||
Etk_Object* _o;
|
||||
const char* _type;
|
||||
bool _managed;
|
||||
};
|
||||
|
||||
class EtkWidget : public EtkObject
|
||||
|
@ -92,6 +95,16 @@ class EtkVBox : public EtkBox
|
|||
virtual ~EtkVBox();
|
||||
};
|
||||
|
||||
class EtkImage : public EtkWidget
|
||||
{
|
||||
public:
|
||||
static EtkImage *wrap( Etk_Object* o );
|
||||
|
||||
private:
|
||||
EtkImage( Etk_Object *o );
|
||||
};
|
||||
|
||||
/// \todo wrap C enum types to C++
|
||||
class EtkButton : public EtkBox
|
||||
{
|
||||
public:
|
||||
|
@ -99,7 +112,81 @@ class EtkButton : public EtkBox
|
|||
EtkButton( const char* text, EtkObject* parent = 0, const char* type = "Button", const char* name = 0 );
|
||||
virtual ~EtkButton();
|
||||
|
||||
/*
|
||||
TODO:
|
||||
Etk_Widget * etk_button_new (void)
|
||||
Creates a new button.
|
||||
Etk_Widget * etk_button_new_with_label (const char *label)
|
||||
Creates a new button with a label.
|
||||
Etk_Widget * etk_button_new_from_stock (Etk_Stock_Id stock_id)
|
||||
Creates a new button with a label and an icon defined by a stock-id.
|
||||
void etk_button_press (Etk_Button *button)
|
||||
Presses the button if it wasn't already pressed.
|
||||
void etk_button_release (Etk_Button *button)
|
||||
Releases the button if it was pressed.
|
||||
void etk_button_click (Etk_Button *button)
|
||||
Clicks on the button.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Sets the text of the button's label.
|
||||
*/
|
||||
void setText( const char* text );
|
||||
|
||||
/*!
|
||||
* Gets the text of the button's label.
|
||||
*/
|
||||
const char *getText( );
|
||||
|
||||
/*!
|
||||
* Sets the image of the button.
|
||||
*/
|
||||
void setImage( EtkImage *image );
|
||||
|
||||
/*!
|
||||
* Gets the image of the button.
|
||||
*/
|
||||
EtkImage *getImage( );
|
||||
|
||||
/*!
|
||||
* Sets the label and the image of the button from a stock-id.
|
||||
*/
|
||||
void setFromStock( Etk_Stock_Id stock_id );
|
||||
|
||||
/*!
|
||||
* Sets the style of the button (icon, text, both vertically, both horizontally).
|
||||
*/
|
||||
void setStyle( Etk_Button_Style style );
|
||||
|
||||
/*!
|
||||
* Gets the style of the button.
|
||||
*/
|
||||
Etk_Button_Style getStyle( );
|
||||
|
||||
/*!
|
||||
* Sets the stock-size of the button's image.
|
||||
*/
|
||||
void setStockSize( Etk_Stock_Size size );
|
||||
|
||||
/*!
|
||||
* Gets the stock-size of the button's image.
|
||||
*/
|
||||
Etk_Stock_Size getStockSize( );
|
||||
|
||||
/*!
|
||||
* Sets the alignment of the child of the button.
|
||||
*/
|
||||
void setAlignment( float xalign, float yalign );
|
||||
|
||||
/*!
|
||||
* Gets the alignment of the button's child.
|
||||
*/
|
||||
void getAlignment( float &xalign, float &yalign );
|
||||
|
||||
static EtkButton *wrap( Etk_Object* o );
|
||||
|
||||
private:
|
||||
EtkButton( Etk_Object *o );
|
||||
};
|
||||
|
||||
class EtkEmbed : public EtkTopLevelWidget
|
||||
|
|
Loading…
Reference in New Issue