From 8b721bf867895e743f555e507a6ff9ac81b773e6 Mon Sep 17 00:00:00 2001 From: Jess VanDerwalker Date: Thu, 5 Apr 2012 22:19:23 -0700 Subject: *.h and *.c files for input, window, context, and image. Also prefixed public input.c, image.c and window.c functions with xcwm_input_*, xcwm_window_* and xcwm_image_*. Fixed some remaining issues with functions that were requiring both a context and window. Renamed data.h to context.h and xcwm.c to context.c - placed code in context, window, and image. Added image.c and context.c to Makefile.am. Removed data.h from project and references to it. The struct definitions previously in data.h have been moved into other files. Renamed xcwm_image_get_* to xcwm_image_copy_*. Changed calls in xtoq code to new function names. Definition of xcwm_window_t moved to window.h Signed-off-by: Jess VanDerwalker Reviewed by: Jeremy Huddleston --- src/xtoq/XtoqController.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/xtoq/XtoqController.m') diff --git a/src/xtoq/XtoqController.m b/src/xtoq/XtoqController.m index d40ccc1..c53194a 100644 --- a/src/xtoq/XtoqController.m +++ b/src/xtoq/XtoqController.m @@ -67,7 +67,7 @@ { // setup X connection and get the initial image from the server - rootContext = xcwm_init(screen); + rootContext = xcwm_context_open(screen); [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh]; @@ -149,12 +149,12 @@ xcwmDispatchQueue = dispatch_queue_create("xcwm.dispatch.queue", NULL); // Start the event loop and set the handler function - xcwm_start_event_loop(rootContext, (void *)eventHandler); + xcwm_event_start_loop(rootContext, (void *)eventHandler); } - (void)applicationWillTerminate:(NSNotification *)aNotification { - xcwm_close(rootContext); + xcwm_context_close(rootContext); const char *spawn[4]; pid_t child; @@ -466,7 +466,7 @@ window->local_data = (id)newWindow; // get image to darw - xcbImage = test_xcwm_get_image(window); + xcbImage = xcwm_image_copy_damaged(window); imageRep = [[XtoqImageRep alloc] initWithData: xcbImage x: 0 y: 0]; // draw the image into a rect @@ -508,8 +508,7 @@ //use dispatch_async() to handle the actual close dispatch_async(xcwmDispatchQueue, ^{ NSLog (@"Call xcwm_request_close(theContext)"); - xcwm_request_close (rootContext, - [aWindow getXcwmWindow]); + xcwm_window_request_close ([aWindow getXcwmWindow]); }); } @@ -553,7 +552,7 @@ int width = (int)moveFrame.size.width; int height = (int)moveFrame.size.height - WINDOWBAR; - xcwm_configure_window(rootContext, window, + xcwm_window_configure(window, x, y - height, height, width); [[moveWindow contentView] setNeedsDisplay: YES]; } -- cgit v1.2.3