- follow EFL C API

- removed Notepad in elementaryxx
  - removed various wrappers not longer existing functions
  - removed Evas Transform
  - removed Evas Gradient
- added #define for compiling Edje_Edit wrapper


SVN revision: 54656
This commit is contained in:
Andreas Volz 2010-11-17 22:11:02 +00:00
parent dfd5b32987
commit 01e49e85dd
22 changed files with 16 additions and 514 deletions

View File

@ -6,6 +6,7 @@
/* EFL */
#include <Edje.h>
#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT
#include <Edje_Edit.h>
/* EFL++ */

View File

@ -6,6 +6,7 @@
/* EFL */
#include <Edje.h>
#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT
#include <Edje_Edit.h>
/* EFL++ */

View File

@ -29,7 +29,6 @@
#include "Table.h"
#include "Layout.h"
#include "Hover.h"
#include "Notepad.h"
#include "Check.h"
#include "Anchorview.h"
#include "Anchorblock.h"

View File

@ -32,10 +32,10 @@ public:
virtual bool getState (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) = 0;
private:
static char *gl_label_get (const void *data, Evas_Object *obj, const char *part);
static Evas_Object *gl_icon_get (const void *data, Evas_Object *obj, const char *part);
static Eina_Bool gl_state_get (const void *data, Evas_Object *obj, const char *part);
static void gl_del (const void *data, Evas_Object *obj);
static char *gl_label_get (void *data, Evas_Object *obj, const char *part);
static Evas_Object *gl_icon_get (void *data, Evas_Object *obj, const char *part);
static Eina_Bool gl_state_get (void *data, Evas_Object *obj, const char *part);
static void gl_del (void *data, Evas_Object *obj);
Elm_Genlist_Item_Class mGLIC;
std::string mStyle;

View File

@ -29,7 +29,7 @@ public:
void setMultiSelect (bool multi);
void setHorizontalMode (Elm_List_Mode mode);
void setHorizontal (bool horizontal);
void setAlwaysSelectMode (bool alwaysSelect);

View File

@ -24,7 +24,6 @@ libelementaryxx_HEADERS = \
Object.h \
Layout.h \
Hover.h \
Notepad.h \
Anchorblock.h \
Anchorview.h \
Spinner.h \

View File

@ -1,28 +0,0 @@
#ifndef ELMXX_NOTEPAD_H
#define ELMXX_NOTEPAD_H
/* STL */
#include <string>
/* ELFxx */
#include "Object.h"
namespace Elmxx {
class Notepad : public Object
{
public:
static Notepad *factory (Evasxx::Object &parent);
void setFile (const std::string &file, Elm_Text_Format format);
private:
Notepad (); // forbid standard constructor
Notepad (const Notepad&); // forbid copy constructor
Notepad (Evasxx::Object &parent); // private construction -> use factory ()
~Notepad (); // forbid direct delete -> use Object::destroy()
};
} // end namespace Elmxx
#endif // ELMXX_NOTEPAD_H

View File

@ -25,7 +25,7 @@ GenListDataModel::GenListDataModel (const std::string &style) :
/* wrappers */
char *GenListDataModel::gl_label_get (const void *data, Evas_Object *obj, const char *part)
char *GenListDataModel::gl_label_get (void *data, Evas_Object *obj, const char *part)
{
cout << "gl_label_get" << endl;
@ -43,7 +43,7 @@ char *GenListDataModel::gl_label_get (const void *data, Evas_Object *obj, const
return (!label.empty ()) ? strdup (label.c_str ()) : NULL;
}
Evas_Object *GenListDataModel::gl_icon_get (const void *data, Evas_Object *obj, const char *part)
Evas_Object *GenListDataModel::gl_icon_get (void *data, Evas_Object *obj, const char *part)
{
GenListColumnConstructor *construction = static_cast <GenListColumnConstructor*> (
const_cast <void*> (data));
@ -55,7 +55,7 @@ Evas_Object *GenListDataModel::gl_icon_get (const void *data, Evas_Object *obj,
return objxx ? objxx->obj () : NULL;
}
Eina_Bool GenListDataModel::gl_state_get (const void *data, Evas_Object *obj, const char *part)
Eina_Bool GenListDataModel::gl_state_get (void *data, Evas_Object *obj, const char *part)
{
GenListColumnConstructor *construction = static_cast <GenListColumnConstructor*> (
const_cast <void*> (data));
@ -65,7 +65,7 @@ Eina_Bool GenListDataModel::gl_state_get (const void *data, Evas_Object *obj, co
return model->getState (construction, *objWrap, part);
}
void GenListDataModel::gl_del(const void *data, Evas_Object *obj)
void GenListDataModel::gl_del(void *data, Evas_Object *obj)
{
GenListColumnConstructor *construction = static_cast <GenListColumnConstructor*> (
const_cast <void*> (data));

View File

@ -37,9 +37,9 @@ void List::setMultiSelect (bool multi)
elm_list_multi_select_set (o, multi);
}
void List::setHorizontalMode (Elm_List_Mode mode)
void List::setHorizontal (bool horizontal)
{
elm_list_horizontal_mode_set (o, mode);
elm_list_horizontal_set (o, horizontal);
}
void List::setAlwaysSelectMode (bool alwaysSelect)

View File

@ -40,7 +40,6 @@ libelementaryxx_la_SOURCES = \
Object.cpp \
Layout.cpp \
Hover.cpp \
Notepad.cpp \
Anchorblock.cpp \
Anchorview.cpp \
Spinner.cpp \

View File

@ -1,30 +0,0 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../include/elementaryxx/Notepad.h"
using namespace std;
namespace Elmxx {
Notepad::Notepad (Evasxx::Object &parent)
{
o = elm_notepad_add (parent.obj ());
elmInit ();
}
Notepad::~Notepad () {}
Notepad *Notepad::factory (Evasxx::Object &parent)
{
return new Notepad (parent);
}
void Notepad::setFile (const std::string &file, Elm_Text_Format format)
{
elm_notepad_file_set (o, file.c_str (), format);
}
} // end namespace Elmxx

View File

@ -4,7 +4,6 @@
#include "Canvas.h"
#include "Event.h"
#include "Exceptions.h"
#include "Gradient.h"
#include "Image.h"
#include "Line.h"
#include "Object.h"
@ -14,7 +13,6 @@
#include "Textblock.h"
#include "TextblockStyle.h"
#include "Text.h"
#include "Transform.h"
#include "Utils.h"
#endif // EVASXX_H

View File

@ -1,191 +0,0 @@
#ifndef EVASGRADIENT_H
#define EVASGRADIENT_H
#include "Object.h"
namespace Evasxx {
/* Forward declarations */
class Canvas;
/*
* Wraps an Evas Gradient Object
*/
class Gradient : public Object
{
public:
Gradient( Canvas &canvas );
Gradient( Canvas &canvas, const Eflxx::Rect &rect );
virtual ~Gradient();
/*!
* Adds a color stop to the given evas gradient object.
*
* The @p delta parameter determines the proportion of the gradient
* object that is to be set to the color. For instance, if red is
* added with @p delta set to 2, and green is added with @p
* delta set to 1, two-thirds will be red or reddish and one-third
* will be green or greenish.
*
* Colors are added from the top downwards.
*
* @param color The color.
* @param delta Proportion of the gradient object that is this color.
*/
void addColorStop( const Eflxx::Color &c, int delta );
/*!
* Adds an alpha stop to the given evas gradient object.
*
* The @p delta parameter determines the proportion of the gradient
* object that is to be set to the alpha value.
*
* Alphas are added from the top downwards.
*
* @param alpha Alpha value.
* @param delta Proportion of the gradient object that is this alpha.
*/
void addAlphaStop (int alpha, int delta);
/*!
* Sets color data for the given evas gradient object.
*
* If data is so set, any existing gradient stops will be deleted,
* The data is not copied, so if it was allocated, do not free it while it's set.
*
* @param color_data The color data to be set. Should be in argb32 pixel format.
* @param len The length of the data pointer - multiple of the pixel size.
* @param has_alpha A flag indicating if the data has alpha or not.
*/
void setColorData (void *color_data, int len, bool has_alpha);
/*!
* Sets alpha data for the given evas gradient object.
*
* If alpha data is so set, any existing gradient stops will be cleared,
* The data is not copied, so if it was allocated, do not free it while it's set.
*
* @param alpha_data The alpha data to be set, in a8 format.
* @param len The length of the data pointer - multiple of the pixel size.
*/
void setAlphaData (void *alpha_data, int len);
/*!
* Deletes all stops set for the given evas gradient object or any set data.
*/
void clear();
// TODO
//EAPI void evas_object_gradient_type_set (Evas_Object *obj, const char *type, const char *instance_params) EINA_ARG_NONNULL(1, 2);
//EAPI void evas_object_gradient_type_get (const Evas_Object *obj, char **type, char **instance_params) EINA_ARG_NONNULL(1, 2);
/*!
* Sets the rectangle on the gradient object that the gradient will be
* drawn to.
*
* Note that the gradient may be tiled around this one rectangle,
* according to its spread value - restrict, repeat, or reflect. To have
* only one 'cycle' of the gradient drawn, the spread value must be set
* to restrict, or x and y must be 0 and width and height need to be
* the width and height of the gradient object respectively.
*
* The default values for the fill parameters is x = 0, y = 0,
* width = 32 and height = 32.
*
* @param rect The coordinate Rect.
*/
void setFill (const Eflxx::Rect &rect);
/*!
* Retrieves the dimensions of the rectangle on the gradient object that
* the gradient will use as its fill rect.
*
* See @ref setFill for more details.
*
* @return The coordinate Rect.
*/
const Eflxx::Rect getFill ();
/*!
* Sets the angle at which the given evas gradient object's fill sits clockwise
* from vertical.
*
* @param angle Angle in degrees. Can be negative.
*/
void setFillAngle (Evas_Angle angle);
/*!
* Retrieves the angle at which the given evas gradient object's fill sits
* clockwise from the vertical.
*
* @return The current angle if successful. @c 0.0 otherwise.
*/
Evas_Angle getFillAngle ();
/*!
* Sets the tiling mode for the given evas gradient object's fill.
*
* @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
* EVAS_TEXTURE_RESTRICT, EVAS_TEXTURE_RESTRICT_REFLECT, EVAS_TEXTURE_RESTRICT_REPEAT,
* or EVAS_TEXTURE_PAD.
*/
void setFillSpread (int tile_mode);
/*!
* Retrieves the spread (tiling mode) for the given gradient object's fill.
*
* @return The current spread mode of the gradient object.
*/
int getFillSpread ();
/*!
* Sets the angle at which the given evas gradient sits,
* relative to whatever intrinsic orientation of the grad type.
* Used mostly by 'linear' kinds of gradients.
*
* @param angle Angle in degrees. Can be negative.
*/
void setAngle (Evas_Angle angle);
/*!
* Retrieves the angle at which the given evas gradient object sits
* rel to its intrinsic orientation.
*
* @return The current angle if successful. @c 0.0 otherwise.
*/
Evas_Angle getAngle ();
/*!
* Sets the direction of the given evas gradient object's spectrum.
*
* @param direction Values are either 1 (the default) or -1.
*/
void setDirection (int direction);
/*!
* Retrieves the evas gradient object's spectrum direction
*
* @return The current gradient direction if successful. @c 1 otherwise.
*/
int getDirection ();
/*!
* Sets the offset of the given evas gradient object's spectrum.
*
* @param offset Values can be negative.
*/
void setOffset (float offset);
/*!
* Retrieves the spectrum's offset
*
* @return The current gradient offset if successful. @c 0.0 otherwise.
*/
float getOffset ();
};
} // end namespace Evasxx
#endif // EVAS_GRADIENT_H

View File

@ -7,7 +7,6 @@
/* EFL++ */
#include <eflxx/Common.h>
#include "Object.h"
#include "Transform.h"
/* EFL */
#include <Evas.h>
@ -345,7 +344,7 @@ public:
* @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
* EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
*/
void setSpread (int tile_mode);
void setFillSpread (Evas_Fill_Spread spread);
/*!
* Retrieves the spread (tiling mode) for the given image object's fill.
@ -353,22 +352,6 @@ public:
*/
int getSpread () const;
/*!
* To be documented.
*
* FIXME: To be fixed.
*
*/
void setTransform (Transform &t);
/*!
* To be documented.
*
* FIXME: To be fixed.
*
*/
const Transform getTransform () const;
/*!
* Converts the raw image data of the given image object to the
* specified colorspace.

View File

@ -15,8 +15,6 @@ evasxx_HEADERS = \
Rectangle.h \
Polygon.h \
Textblock.h \
Gradient.h \
Transform.h \
Smart.h \
Exceptions.h \
Evasxx.h

View File

@ -132,8 +132,6 @@ public:
/* Color */
virtual Eflxx::Color getColor() const;
virtual void setColor( const Eflxx::Color& color );
virtual int getColorInterpolation() const;
virtual void setColorInterpolation( int );
/* Antialias */
virtual void setAntiAliased( bool );

View File

@ -1,39 +0,0 @@
#ifndef EVAS_TRANSFORM_H
#define EVAS_TRANSFORM_H
/* EFL */
#include <Evas.h>
namespace Evasxx {
class Transform
{
friend class Image;
public:
/* Set t to the identity */
void setIdentity();
/* Left-multiply t by an xy rotation defined by the given angle (in degrees) */
void rotate (double angle);
/* Left-multiply t by an xy translation defined by the given dx, dy values */
void translate (float dx, float dy);
/* Left-multiply t by an xy scaling defined by the given sx, sy factors */
void scale (float sx, float sy);
/* Left-multiply t by an xy shearing defined by the given sh, sv values */
void shear (float sh, float sv);
/* Left-multiply t by the given transform l */
// TODO: const? why not?
void compose (Transform &l, Transform &t);
private:
Evas_Transform t;
};
} // end namespace Evasxx
#endif // EVAS_TRANSFORM_H

View File

@ -1,121 +0,0 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../include/evasxx/Canvas.h"
#include "../include/evasxx/Gradient.h"
using namespace Eflxx;
namespace Evasxx {
Gradient::Gradient( Canvas &canvas )
{
o = evas_object_gradient_add( canvas.obj() );
init();
}
Gradient::Gradient( Canvas &canvas, const Rect &rect )
{
o = evas_object_gradient_add( canvas.obj() );
init();
setGeometry( rect );
}
Gradient::~Gradient()
{
evas_object_del( o );
}
void Gradient::addColorStop( const Color &c, int delta )
{
evas_object_gradient_color_stop_add( o, c.red (), c.green (), c.blue (), c.alpha (), delta );
}
void Gradient::addAlphaStop (int alpha, int delta)
{
evas_object_gradient_alpha_stop_add (o, alpha, delta);
}
void Gradient::setColorData (void *color_data, int len, bool has_alpha)
{
evas_object_gradient_color_data_set (o, color_data, len, has_alpha);
}
void Gradient::setAlphaData (void *alpha_data, int len)
{
evas_object_gradient_alpha_data_set (o, alpha_data, len);
}
void Gradient::clear()
{
evas_object_gradient_clear( o );
}
void Gradient::setFill (const Rect &rect)
{
evas_object_gradient_fill_set (o, rect.x (), rect.y (), rect.width (), rect.height ());
}
const Rect Gradient::getFill ()
{
Evas_Coord x, y, w, h;
evas_object_gradient_fill_get (o, &x, &y, &w, &h);
Rect rect (x, y, w, h);
return rect;
}
void Gradient::setFillAngle (Evas_Angle angle)
{
evas_object_gradient_fill_angle_set (o, angle);
}
Evas_Angle Gradient::getFillAngle ()
{
return evas_object_gradient_fill_angle_get (o);
}
void Gradient::setFillSpread (int tile_mode)
{
evas_object_gradient_fill_spread_set (o, tile_mode);
}
int Gradient::getFillSpread ()
{
return evas_object_gradient_fill_spread_get (o);
}
void Gradient::setAngle( Evas_Angle angle )
{
evas_object_gradient_angle_set( o, angle );
}
Evas_Angle Gradient::getAngle()
{
return evas_object_gradient_angle_get( o );
}
void Gradient::setDirection (int direction)
{
evas_object_gradient_direction_set (o, direction);
}
int Gradient::getDirection ()
{
return evas_object_gradient_direction_get (o);
}
void Gradient::setOffset (float offset)
{
evas_object_gradient_offset_set (o, offset);
}
float Gradient::getOffset ()
{
return evas_object_gradient_offset_get (o);
}
} // end namespace Evasxx

View File

@ -208,9 +208,9 @@ bool Image::save( const std::string &file, const std::string &key, const std::st
evas_object_image_save( o, file.c_str(), key.empty() ? NULL : key.c_str(), flags.c_str() );
}
void Image::setSpread (int tile_mode)
void Image::setFillSpread (Evas_Fill_Spread spread)
{
evas_object_image_fill_spread_set( o, tile_mode);
evas_object_image_fill_spread_set( o, spread);
}
int Image::getSpread () const
@ -218,21 +218,6 @@ int Image::getSpread () const
return evas_object_image_fill_spread_get( o );
}
void Image::setTransform (Transform &t)
{
evas_object_image_fill_transform_set (o, &t.t);
}
const Transform Image::getTransform () const
{
Evas_Transform t;
evas_object_image_fill_transform_get (o, &t);
Transform et;
et.t = t;
return et;
}
void *Image::convertData (Evas_Colorspace to_cspace)
{
return evas_object_image_data_convert (o, to_cspace);

View File

@ -26,8 +26,6 @@ libevasxx_la_SOURCES = \
Rectangle.cpp \
Polygon.cpp \
Textblock.cpp \
Gradient.cpp \
Transform.cpp \
Smart.cpp \
Exceptions.cpp

View File

@ -221,16 +221,6 @@ void Object::setColor( const Color& c )
evas_object_color_set( o, c.red(), c.green(), c.blue(), c.alpha() );
}
int Object::getColorInterpolation() const
{
return evas_object_color_interpolation_get( o );
}
void Object::setColorInterpolation( int colorspace )
{
evas_object_color_interpolation_set( o, colorspace );
}
bool Object::isAntiAliased() const
{
return evas_object_anti_alias_get( o );

View File

@ -1,38 +0,0 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../include/evasxx/Transform.h"
namespace Evasxx {
void Transform::setIdentity()
{
evas_transform_identity_set (&t);
}
void Transform::rotate (double angle)
{
evas_transform_rotate (angle, &t);
}
void Transform::translate (float dx, float dy)
{
evas_transform_translate (dx, dy, &t);
}
void Transform::scale (float sx, float sy)
{
evas_transform_scale (sx, sy, &t);
}
void Transform::shear (float sh, float sv)
{
evas_transform_shear (sh, sv, &t);
}
void Transform::compose (Transform &l, Transform &t)
{
evas_transform_compose (&l.t, &t.t);
}
} // end namespoace efl