Enlightenment CVS committal
Author : doursse
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/bin
Modified Files:
evas_software_xcb_main.c evas_software_xcb_perf_test.c
evas_software_xcb_perf_load.c
Log Message:
fix memory leaks and update to new XCB API
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/bin/evas_software_xcb_main.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- evas_software_xcb_main.c 29 Nov 2005 12:58:49 -0000 1.5
+++ evas_software_xcb_main.c 18 Dec 2005 11:25:09 -0000 1.6
@@ -8,6 +8,20 @@
+XCBSCREEN *
+get_screen (XCBConnection *c,
+ int screen)
+{
+ XCBSCREENIter i;
+
+ i = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c));
+ for (; i.rem; --screen, XCBSCREENNext(&i))
+ if (screen == 0)
+ return i.data;
+
+ return NULL;
+}
+
XCBVISUALTYPE *
get_visual(XCBConnection *conn,
XCBSCREEN *root)
@@ -62,15 +76,16 @@
CARD32 value[6];
/* XClassHint chint; */
SizeHints *szhints;
+ int screen_nbr;
- conn = XCBConnectBasic ();
+ conn = XCBConnect (NULL, &screen_nbr);
if (!conn)
{
printf("Error: cannot open a connection.\n");
exit(-1);
}
- screen = XCBConnSetupSuccessRepRootsIter (XCBGetSetup(conn)).data;
+ screen = get_screen (conn, screen_nbr);
mask =
XCBCWBackingStore | XCBCWColormap |
@@ -244,10 +259,11 @@
case XCBButtonPress: {
XCBButtonPressEvent *ev = (XCBButtonPressEvent *)e;
- if (ev->button.id == 3)
+ if (ev->detail.id == 3)
{
setdown();
evas_free(evas);
+ free(e);
XCBDisconnect(conn);
evas_shutdown();
exit(0);
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/bin/evas_software_xcb_perf_test.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_software_xcb_perf_test.c 22 May 2005 02:49:35 -0000 1.2
+++ evas_software_xcb_perf_test.c 18 Dec 2005 11:25:09 -0000 1.3
@@ -19,6 +19,20 @@
int win_w = 240;
int win_h = 240;
+XCBSCREEN *
+get_screen (XCBConnection *c,
+ int screen)
+{
+ XCBSCREENIter i;
+
+ i = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c));
+ for (; i.rem; --screen, XCBSCREENNext(&i))
+ if (screen == 0)
+ return i.data;
+
+ return NULL;
+}
+
XCBVISUALTYPE *
get_visual(XCBConnection *conn,
XCBSCREEN *root)
@@ -72,15 +86,16 @@
CARD32 value[6];
/* XClassHint chint; */
SizeHints *szhints;
+ int screen_nbr;
- c = XCBConnectBasic ();
+ c = XCBConnect (NULL, &screen_nbr);
if (!c)
{
printf("Error: cannot open a connection.\n");
exit(-1);
}
- screen = XCBConnSetupSuccessRepRootsIter (XCBGetSetup(c)).data;
+ screen = get_screen (c, screen_nbr);
mask = CWBackingStore | CWColormap |
CWBackPixmap | CWBorderPixel |
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/bin/evas_software_xcb_perf_load.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_software_xcb_perf_load.c 22 May 2005 02:49:35 -0000 1.2
+++ evas_software_xcb_perf_load.c 18 Dec 2005 11:25:09 -0000 1.3
@@ -19,6 +19,20 @@
int win_w = 240;
int win_h = 240;
+XCBSCREEN *
+get_screen (XCBConnection *c,
+ int screen)
+{
+ XCBSCREENIter i;
+
+ i = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c));
+ for (; i.rem; --screen, XCBSCREENNext(&i))
+ if (screen == 0)
+ return i.data;
+
+ return NULL;
+}
+
XCBVISUALTYPE *
get_visual(XCBConnection *conn,
XCBSCREEN *root)
@@ -72,15 +86,16 @@
CARD32 value[6];
/* XClassHint chint; */
SizeHints *szhints;
+ int screen_nbr;
- c = XCBConnectBasic ();
+ c = XCBConnect (NULL, &screen_nbr);
if (!c)
{
printf("Error: cannot open a connection.\n");
exit(-1);
}
- screen = XCBConnSetupSuccessRepRootsIter (XCBGetSetup(c)).data;
+ screen = get_screen (c, screen_nbr);
mask = CWBackingStore | CWColormap |
CWBackPixmap | CWBorderPixel |
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs