Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Shadow


Detailed Description

The Etk_Shadow widget is a container that can contain one child, and that can cast a shadow or have a border.

TODOC: Description

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Container
        • Etk_Bin
          • Etk_Shadow
Properties:
  • "propname": Description
    • Type: Float
    • Access: Read/Write
    • Default Value: 0.5


Data Structures

struct  Etk_Shadow
 [Widget] A container that can contain one child, and that can cast a shadow or have a border More...

Defines

#define ETK_SHADOW_TYPE   (etk_shadow_type_get())
#define ETK_SHADOW(obj)   (ETK_OBJECT_CAST((obj), ETK_SHADOW_TYPE, Etk_Shadow))
#define ETK_IS_SHADOW(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_SHADOW_TYPE))

Enumerations

enum  Etk_Shadow_Type
 The different types of shadows. More...
enum  Etk_Shadow_Edges
 The different edges where a shadow can be. More...

Functions

Etk_Widget * etk_shadow_new (void)
 Creates a new shadow container.
void etk_shadow_shadow_set (Etk_Shadow *shadow, Etk_Shadow_Type type, Etk_Shadow_Edges edges, int radius, int offset_x, int offset_y, int opacity)
 Sets the different settings of the shadow cast by the shadow container.
void etk_shadow_shadow_get (Etk_Shadow *shadow, Etk_Shadow_Type *type, Etk_Shadow_Edges *edges, int *radius, int *offset_x, int *offset_y, int *opacity)
 Gets the different settings of the shadow cast by the shadow container.
void etk_shadow_shadow_color_set (Etk_Shadow *shadow, int r, int g, int b)
 Sets the color of the shadow.
void etk_shadow_shadow_color_get (Etk_Shadow *shadow, int *r, int *g, int *b)
 Gets the color of the shadow.
void etk_shadow_border_set (Etk_Shadow *shadow, int border_width)
 Sets the width of the border of the shadow container.
int etk_shadow_border_get (Etk_Shadow *shadow)
 Gets the width of the border of the shadow container.
void etk_shadow_border_color_set (Etk_Shadow *shadow, int r, int g, int b, int a)
 Sets the color of the border of the shadow container. The color has to be pre-multiplied (i.e. the r, g, b components have to be multiplied by a and divided by 255).
void etk_shadow_border_color_get (Etk_Shadow *shadow, int *r, int *g, int *b, int *a)
 Gets the color of the border of the shadow container.


Define Documentation

#define ETK_SHADOW_TYPE   (etk_shadow_type_get())

Gets the type of a shadow

#define ETK_SHADOW ( obj   )     (ETK_OBJECT_CAST((obj), ETK_SHADOW_TYPE, Etk_Shadow))

Casts the object to an Etk_Shadow

#define ETK_IS_SHADOW ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_SHADOW_TYPE))

Checks if the object is an Etk_Shadow


Enumeration Type Documentation

enum Etk_Shadow_Type

The different types of shadows.

enum Etk_Shadow_Edges

The different edges where a shadow can be.


Function Documentation

Etk_Widget * etk_shadow_new ( void   ) 

Creates a new shadow container.

Returns:
Returns the new shadow container

void etk_shadow_shadow_set ( Etk_Shadow *  shadow,
Etk_Shadow_Type  type,
Etk_Shadow_Edges  edges,
int  radius,
int  offset_x,
int  offset_y,
int  opacity 
)

Sets the different settings of the shadow cast by the shadow container.

Parameters:
shadow a shadow container
type the type of shadow to cast: ETK_SHADOW_NONE to cast no shadow, ETK_SHADOW_OUTSIDE to cast the shadow outside of the container, ETK_SHADOW_INSIDE to cast the shadow inside the container on the child.
edges the edges of the container where the shadow should be cast (ETK_SHADOW_ALL most of the time)
radius the blur radius of the shadow to cast, from 0 to 255
offset_x the horizontal offset of the shadow
offset_y the vertical offset of the shadow
opacity the opacity of the shadow to cast, from 0 (totally transparent) to 255 (totally opaque)

void etk_shadow_shadow_get ( Etk_Shadow *  shadow,
Etk_Shadow_Type *  type,
Etk_Shadow_Edges *  edges,
int *  radius,
int *  offset_x,
int *  offset_y,
int *  opacity 
)

Gets the different settings of the shadow cast by the shadow container.

Parameters:
shadow a shadow container
type the location where to store the type of the cast shadow
edges the location where to store the edges where the shadow is cast
radius the location where to store the blur radius of the cast shadow
offset_x the location where to store the horizontal offset of the shadow
offset_y the location where to store the vertical offset of the shadow
opacity the location where to store the opacity of the shadow

void etk_shadow_shadow_color_set ( Etk_Shadow *  shadow,
int  r,
int  g,
int  b 
)

Sets the color of the shadow.

Parameters:
shadow a shadow container
r the red component of the color to set, from 0 to 255
g the green component of the color to set, from 0 to 255
b the blue component of the color to set, from 0 to 255

void etk_shadow_shadow_color_get ( Etk_Shadow *  shadow,
int *  r,
int *  g,
int *  b 
)

Gets the color of the shadow.

Parameters:
shadow a shadow container
r the location where to store the red component of the color
g the location where to store the green component of the color
b the location where to store the blue component of the color

void etk_shadow_border_set ( Etk_Shadow *  shadow,
int  border_width 
)

Sets the width of the border of the shadow container.

Parameters:
shadow a shadow container
border_width the width of the border. If it is <= 0, the border is disabled

int etk_shadow_border_get ( Etk_Shadow *  shadow  ) 

Gets the width of the border of the shadow container.

Parameters:
shadow a shadow container
Returns:
Returns the width of the border of the shadow container, 0 meaning it has no border

void etk_shadow_border_color_set ( Etk_Shadow *  shadow,
int  r,
int  g,
int  b,
int  a 
)

Sets the color of the border of the shadow container. The color has to be pre-multiplied (i.e. the r, g, b components have to be multiplied by a and divided by 255).

Parameters:
shadow a shadow container
r the red component of the border, from 0 to 255
g the green component of the border, from 0 to 255
b the blue component of the border, from 0 to 255
a the alpha component of the border, from 0 to 255

void etk_shadow_border_color_get ( Etk_Shadow *  shadow,
int *  r,
int *  g,
int *  b,
int *  a 
)

Gets the color of the border of the shadow container.

Parameters:
shadow a shadow container
r the location where to store the red component of the border
g the location where to store the green component of the border
b the location where to store the blue component of the border
a the location where to store the alpha component of the border