aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/tests/evas_tests_helpers.h
blob: 2ed07894f42341493bdd8b34c52c519a686c68f4 (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
#ifndef EVAS_TEST_HELPERS_H
#define EVAS_TEST_HELPERS_H

/* FIXME: Currently depends on the buffer engine, should we do anything
 * fancier? */

#define EVAS_TEST_INIT_EVAS() _setup_evas()

#define EVAS_TEST_FREE_EVAS() \
do \
{ \
   evas_textblock_cursor_free(cur); \
   evas_object_del(tb); \
   evas_textblock_style_free(st); \
   evas_free(evas); \
   evas_shutdown(); \
} \
while (0)

static Evas *
_setup_evas()
{
   Evas *evas;
   Evas_Engine_Info *einfo;

   evas_init();
   evas = evas_new();

   evas_output_method_set(evas, evas_render_method_lookup("buffer"));
   einfo = evas_engine_info_get(evas);
   evas_engine_info_set(evas, einfo);

   evas_output_size_set(evas, 500, 500);
   evas_output_viewport_set(evas, 0, 0, 500, 500);

   return evas;
}

#endif