diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c new file mode 100644 index 0000000..a64060b --- /dev/null +++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c | |||
@@ -0,0 +1,118 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif /* ifdef HAVE_CONFIG_H */ | ||
4 | |||
5 | #include "ecore_x_private.h" | ||
6 | |||
7 | /** | ||
8 | * @defgroup Ecore_X_Drawable_Group X Drawable Functions | ||
9 | * | ||
10 | * Functions that operate on drawables. | ||
11 | */ | ||
12 | |||
13 | /** | ||
14 | * Retrieves the geometry of the given drawable. | ||
15 | * @param d The given drawable. | ||
16 | * @param x Pointer to an integer into which the X position is to be stored. | ||
17 | * @param y Pointer to an integer into which the Y position is to be stored. | ||
18 | * @param w Pointer to an integer into which the width is to be stored. | ||
19 | * @param h Pointer to an integer into which the height is to be stored. | ||
20 | * @ingroup Ecore_X_Drawable_Group | ||
21 | */ | ||
22 | EAPI void | ||
23 | ecore_x_drawable_geometry_get(Ecore_X_Drawable d, | ||
24 | int *x, | ||
25 | int *y, | ||
26 | int *w, | ||
27 | int *h) | ||
28 | { | ||
29 | Window dummy_win; | ||
30 | int ret_x, ret_y; | ||
31 | unsigned int ret_w, ret_h, dummy_border, dummy_depth; | ||
32 | |||
33 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
34 | if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &ret_x, &ret_y, | ||
35 | &ret_w, &ret_h, &dummy_border, &dummy_depth)) | ||
36 | { | ||
37 | ret_x = 0; | ||
38 | ret_y = 0; | ||
39 | ret_w = 0; | ||
40 | ret_h = 0; | ||
41 | } | ||
42 | |||
43 | if (x) | ||
44 | *x = ret_x; | ||
45 | |||
46 | if (y) | ||
47 | *y = ret_y; | ||
48 | |||
49 | if (w) | ||
50 | *w = (int)ret_w; | ||
51 | |||
52 | if (h) | ||
53 | *h = (int)ret_h; | ||
54 | } /* ecore_x_drawable_geometry_get */ | ||
55 | |||
56 | /** | ||
57 | * Retrieves the width of the border of the given drawable. | ||
58 | * @param d The given drawable. | ||
59 | * @return The border width of the given drawable. | ||
60 | * @ingroup Ecore_X_Drawable_Group | ||
61 | */ | ||
62 | EAPI int | ||
63 | ecore_x_drawable_border_width_get(Ecore_X_Drawable d) | ||
64 | { | ||
65 | Window dummy_win; | ||
66 | int dummy_x, dummy_y; | ||
67 | unsigned int dummy_w, dummy_h, border_ret, dummy_depth; | ||
68 | |||
69 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
70 | if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y, | ||
71 | &dummy_w, &dummy_h, &border_ret, &dummy_depth)) | ||
72 | border_ret = 0; | ||
73 | |||
74 | return (int)border_ret; | ||
75 | } /* ecore_x_drawable_border_width_get */ | ||
76 | |||
77 | /** | ||
78 | * Retrieves the depth of the given drawable. | ||
79 | * @param d The given drawable. | ||
80 | * @return The depth of the given drawable. | ||
81 | * @ingroup Ecore_X_Drawable_Group | ||
82 | */ | ||
83 | EAPI int | ||
84 | ecore_x_drawable_depth_get(Ecore_X_Drawable d) | ||
85 | { | ||
86 | Window dummy_win; | ||
87 | int dummy_x, dummy_y; | ||
88 | unsigned int dummy_w, dummy_h, dummy_border, depth_ret; | ||
89 | |||
90 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
91 | if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y, | ||
92 | &dummy_w, &dummy_h, &dummy_border, &depth_ret)) | ||
93 | depth_ret = 0; | ||
94 | |||
95 | return (int)depth_ret; | ||
96 | } /* ecore_x_drawable_depth_get */ | ||
97 | |||
98 | /** | ||
99 | * Fill the specified rectangle on a drawable. | ||
100 | * @param d The given drawable. | ||
101 | * @param gc The graphic context that controls the fill rules. | ||
102 | * @param x The X coordinate of the top-left corner of the rectangle. | ||
103 | * @param y The Y coordinate of the top-left corner of the rectangle. | ||
104 | * @param width The width of the rectangle. | ||
105 | * @param height The height of the rectangle. | ||
106 | */ | ||
107 | EAPI void | ||
108 | ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d, | ||
109 | Ecore_X_GC gc, | ||
110 | int x, | ||
111 | int y, | ||
112 | int width, | ||
113 | int height) | ||
114 | { | ||
115 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
116 | XFillRectangle(_ecore_x_disp, d, gc, x, y, width, height); | ||
117 | } /* ecore_x_drawable_rectangle_fill */ | ||
118 | |||