summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/main.c
blob: 823acfd88ad0b4468f6c91282e3eebf750ba7b2a (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
#include "evas_common.h"
#include "evas_private.h"
#include "Evas.h"

void
evas_debug_error(void)
{
   fprintf(stderr, 
	   "*** EVAS ERROR: Evas Magic Check Failed!!!\n");
}

void
evas_debug_input_null(void)
{
   fprintf(stderr, 
	   "  Input object pointer is NULL!\n");
}

void
evas_debug_magic_null(void)
{
   fprintf(stderr, 
	   "  Input object is zero'ed out (maybe a freed object or zero-filled RAM)!\n");
}

void
evas_debug_magic_wrong(DATA32 expected, DATA32 supplied)
{
   fprintf(stderr, 
	   "  Input object is wrong type\n"
	   "    Expected: %08x - %s\n"
	   "    Supplied: %08s - %s\n",
	   expected, evas_debug_magic_string_get(expected),
	   supplied, evas_debug_magic_string_get(supplied));
}

char *
evas_debug_magic_string_get(DATA32 magic)
{
   switch (magic)
     {
      case MAGIC_EVAS:
	return "Evas";
	break;
      case MAGIC_OBJ:
	return "Evas_Object";
	break;
      case MAGIC_OBJ_RECTANGLE:
	return "Evas_Object (Rectangle)";
	break;
      case MAGIC_OBJ_LINE:
	return "Evas_Object (Line)";
	break;
      case MAGIC_OBJ_GRADIENT:
	return "Evas_Object (Gradient)";
	break;
      case MAGIC_OBJ_POLYGON:
	return "Evas_Object (Polygon)";
	break;
      case MAGIC_OBJ_IMAGE:
	return "Evas_Object (Image)";
	break;
      case MAGIC_OBJ_TEXT:
	return "Evas_Object (Text)";
	break;
      default:
	return "<UNKNOWN>";
     };
   return "<UNKNOWN>";
}