From owner-p4-projects@FreeBSD.ORG Thu Jul 23 14:12:05 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 171F51065676; Thu, 23 Jul 2009 14:12:05 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E716106566B for ; Thu, 23 Jul 2009 14:12:04 +0000 (UTC) (envelope-from jona@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 82C438FC26 for ; Thu, 23 Jul 2009 14:12:04 +0000 (UTC) (envelope-from jona@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NEC4fP030526 for ; Thu, 23 Jul 2009 14:12:04 GMT (envelope-from jona@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6NEC43P030524 for perforce@freebsd.org; Thu, 23 Jul 2009 14:12:04 GMT (envelope-from jona@FreeBSD.org) Date: Thu, 23 Jul 2009 14:12:04 GMT Message-Id: <200907231412.n6NEC43P030524@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jona@FreeBSD.org using -f From: Jonathan Anderson To: Perforce Change Reviews Cc: Subject: PERFORCE change 166447 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 14:12:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=166447 Change 166447 by jona@jona-trustedbsd-belle-vmware on 2009/07/23 14:11:52 Removed raw_x_tests() Affected files ... .. //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/sandbox_qt.cpp#4 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_qt/sandbox_qt.cpp#4 (text+ko) ==== @@ -259,9 +259,6 @@ } -void raw_x_tests(); - - extern "C" int cap_main(int argc, char *argv[]) { printf("sandbox:\tIn sandbox: %i\n", ld_insandbox()); @@ -365,8 +362,6 @@ printf("sandbox:\tset DISPLAY to %s\n", getenv("DISPLAY")); fflush(stdout); -// raw_x_tests(); - printf("sandbox:\tCreating QApplication...\n"); fflush(stdout); QApplication app(argc, argv); @@ -416,77 +411,6 @@ -void raw_x_tests() -{ - printf("sandbox:\traw_x_tests()\n"); - fflush(stdout); - - xcb_connection_t *c; - xcb_screen_t *s; - xcb_window_t w; - xcb_gcontext_t g; - xcb_generic_event_t *e; - uint32_t mask; - uint32_t values[2]; - int done = 0; - xcb_rectangle_t r = { 20, 20, 60, 60 }; - - /* open connection with the server */ - int screenp; - printf("sandbox:\tConnecting...\n"); - fflush(stdout); - c = xcb_connect_to_display_with_auth_info(NULL, NULL/*xauth*/, &screenp); - printf("sandbox:\tConnection: %x\n", (unsigned int) c); - fflush(stdout); - if (xcb_connection_has_error(c)) { - printf("Cannot open display\n"); - fflush(stdout); - return; - } - /* get the first screen */ - s = xcb_setup_roots_iterator( xcb_get_setup(c) ).data; - - /* create black graphics context */ - g = xcb_generate_id(c); - w = s->root; - mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; - values[0] = s->black_pixel; - values[1] = 0; - xcb_create_gc(c, g, w, mask, values); - - /* create window */ - w = xcb_generate_id(c); - mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; - values[0] = s->white_pixel; - values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS; - xcb_create_window(c, s->root_depth, w, s->root, - 10, 10, 100, 100, 1, - XCB_WINDOW_CLASS_INPUT_OUTPUT, s->root_visual, - mask, values); - - /* map (show) the window */ - xcb_map_window(c, w); - - xcb_flush(c); - - /* event loop */ - while (!done && (e = xcb_wait_for_event(c))) { - switch (e->response_type & ~0x80) { - case XCB_EXPOSE: /* draw or redraw the window */ - xcb_poly_fill_rectangle(c, w, g, 1, &r); - xcb_flush(c); - break; - case XCB_KEY_PRESS: /* exit on key press */ - done = 1; - break; - } - free(e); - } - /* close connection to server */ - xcb_disconnect(c); -} - - int connect_to_X(int *Xfd, xcb_auth_info_t *auth) { char *host;