summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx/colourablesquare.c
blob: 0804d361dc622db546ad73e226e8b40c1a0eea48 (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
#include <stdio.h>

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "Eo.h"

#include "colourable.eo.h"
#include "colourablesquare.eo.h"

#define MY_CLASS COLOURABLESQUARE_CLASS

static int _colourablesquare_impl_logdomain;

#ifdef DBG
#undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_colourablesquare_impl_logdomain, __VA_ARGS__)

struct _ColourableSquare_Data
{
   int size;
};
typedef struct _ColourableSquare_Data  ColourableSquare_Data;

static void
_colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int size)
{
   if(!_colourablesquare_impl_logdomain)
     {
        _colourablesquare_impl_logdomain
          = eina_log_domain_register
          ("colourablesquare", EINA_COLOR_LIGHTBLUE);
     }
   self->size = size;
   DBG("_colourablesquare_constructor(%d)\n", size);
   eo_constructor(eo_super(obj, MY_CLASS));
}

static int
_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
{
   DBG("_colourablesquare_size_get() => %d\n", self->size);
   return self->size;
}

static void
_colourablesquare_size_print(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
{
   DBG("_colourablesquare_size_print() ==> %d\n", self->size);
}

static void
_colourablesquare_size_set(Eo *obj EINA_UNUSED, ColourableSquare_Data *self EINA_UNUSED, int size)
{
   DBG("_colourablesquare_size_set(%d)\n", size);
}

#include "colourablesquare.eo.c"