remove xcb support in ecore_x and evas engines as per mailing list
[platform/upstream/efl.git] / src / lib / ecore_x / ecore_x_pixmap.c
1 #ifdef HAVE_CONFIG_H
2 # include <config.h>
3 #endif /* ifdef HAVE_CONFIG_H */
4
5 #include "Ecore.h"
6 #include "ecore_x_private.h"
7 #include "Ecore_X.h"
8
9 /**
10  * @defgroup Ecore_X_Pixmap_Group X Pixmap Functions
11  * @ingroup Ecore_X_Group
12  *
13  * Functions that operate on pixmaps.
14  */
15
16 /**
17  * Creates a new pixmap.
18  * @param   win Window used to determine which screen of the display the
19  *              pixmap should be created on.  If 0, the default root window
20  *              is used.
21  * @param   w   Width of the new pixmap.
22  * @param   h   Height of the new pixmap.
23  * @param   dep Depth of the pixmap.  If 0, the default depth of the default
24  *              screen is used.
25  * @return  New pixmap.
26  * @ingroup Ecore_X_Pixmap_Group
27  */
28 EAPI Ecore_X_Pixmap
29 ecore_x_pixmap_new(Ecore_X_Window win,
30                    int w,
31                    int h,
32                    int dep)
33 {
34    Ecore_X_Pixmap pm;
35    LOGFN(__FILE__, __LINE__, __FUNCTION__);
36    if (win == 0)
37      win = DefaultRootWindow(_ecore_x_disp);
38
39    if (dep == 0)
40      dep = DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp));
41
42    pm = XCreatePixmap(_ecore_x_disp, win, w, h, dep);
43    if (_ecore_xlib_sync) ecore_x_sync();
44    return pm;
45 }
46
47 /**
48  * Deletes the reference to the given pixmap.
49  *
50  * If no other clients have a reference to the given pixmap, the server
51  * will destroy it.
52  *
53  * @param   pmap The given pixmap.
54  * @ingroup Ecore_X_Pixmap_Group
55  */
56 EAPI void
57 ecore_x_pixmap_free(Ecore_X_Pixmap pmap)
58 {
59    LOGFN(__FILE__, __LINE__, __FUNCTION__);
60    if (!pmap) return;
61    XFreePixmap(_ecore_x_disp, pmap);
62    if (_ecore_xlib_sync) ecore_x_sync();
63 }
64
65 /**
66  * Pastes a rectangular area of the given pixmap onto the given drawable.
67  * @param   pmap The given pixmap.
68  * @param   dest The given drawable.
69  * @param   gc   The graphics context which governs which operation will
70  *               be used to paste the area onto the drawable.
71  * @param   sx   The X position of the area on the pixmap.
72  * @param   sy   The Y position of the area on the pixmap.
73  * @param   w    The width of the area.
74  * @param   h    The height of the area.
75  * @param   dx   The X position at which to paste the area on @p dest.
76  * @param   dy   The Y position at which to paste the area on @p dest.
77  * @ingroup Ecore_X_Pixmap_Group
78  */
79 EAPI void
80 ecore_x_pixmap_paste(Ecore_X_Pixmap pmap,
81                      Ecore_X_Drawable dest,
82                      Ecore_X_GC gc,
83                      int sx,
84                      int sy,
85                      int w,
86                      int h,
87                      int dx,
88                      int dy)
89 {
90    LOGFN(__FILE__, __LINE__, __FUNCTION__);
91    XCopyArea(_ecore_x_disp, pmap, dest, gc, sx, sy, w, h, dx, dy);
92    if (_ecore_xlib_sync) ecore_x_sync();
93 }
94
95 /**
96  * Retrieves the size of the given pixmap.
97  * @param   pmap The given pixmap.
98  * @param   x    Pointer to an integer in which to store the X position.
99  * @param   y    Pointer to an integer in which to store the Y position.
100  * @param   w    Pointer to an integer in which to store the width.
101  * @param   h    Pointer to an integer in which to store the height.
102  * @ingroup Ecore_X_Pixmap_Group
103  */
104 EAPI void
105 ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap,
106                             int *x,
107                             int *y,
108                             int *w,
109                             int *h)
110 {
111    LOGFN(__FILE__, __LINE__, __FUNCTION__);
112    if (!pmap) return;
113    ecore_x_drawable_geometry_get(pmap, x, y, w, h);
114    if (_ecore_xlib_sync) ecore_x_sync();
115 }
116
117 /**
118  * Retrieves the depth of the given pixmap.
119  * @param   pmap The given pixmap.
120  * @return  The depth of the pixmap.
121  * @ingroup Ecore_X_Pixmap_Group
122  */
123 EAPI int
124 ecore_x_pixmap_depth_get(Ecore_X_Pixmap pmap)
125 {
126    int ret;
127    LOGFN(__FILE__, __LINE__, __FUNCTION__);
128    ret = ecore_x_drawable_depth_get(pmap);
129    if (_ecore_xlib_sync) ecore_x_sync();
130    return ret;
131 }
132