summaryrefslogtreecommitdiff
path: root/src/background.h
blob: 3b38e1d3bd64c44d0bde6cd0246f7b61b5b14db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef E_BACKGROUND_H
#define E_BACKGROUND_H

#include "object.h"

typedef struct _E_Background E_Background;
typedef struct _E_Background_Layer E_Background_Layer;

typedef enum
{
   E_BACKGROUND_TYPE_IMAGE = 0,
   E_BACKGROUND_TYPE_GRADIENT = 1,
   E_BACKGROUND_TYPE_SOLID = 2
}
E_Background_Type;

struct _E_Background
{
   E_Object            o;

   Evas                evas;
   char               *file;

   struct
   {
      int                 sx, sy;
      int                 w, h;
   }
   geom;

   Evas_List           layers;

   Evas_Object         base_obj;
};

struct _E_Background_Layer
{
   E_Background_Type   type;
   int                 inlined;
   struct
   {
      float               x, y;
   }
   scroll;
   struct
   {
      float               x, y;
   }
   pos;
   struct
   {
      float               w, h;
      struct
      {
	 int                 w, h;
      }
      orig;
   }
   size               , fill;
   char               *color_class;
   char               *file;
   double              angle;
   struct
   {
      int                 r, g, b, a;
   }
   fg                 , bg;

   double              x, y, w, h, fw, fh;

   Evas_Object         obj;
};

E_Background       *e_background_new(void);
E_Background       *e_background_load(char *file);

void                e_background_realize(E_Background * bg, Evas evas);
void                e_background_set_scroll(E_Background * bg, int sx, int sy);
void                e_background_set_size(E_Background * bg, int w, int h);
void                e_background_set_color_class(E_Background * bg, char *cc,
						 int r, int g, int b, int a);

#endif