Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwpl.git;a=commitdiff;h=9d4c38e8b4efb8566e7b66e8ad311edd2a04c6fa

commit 9d4c38e8b4efb8566e7b66e8ad311edd2a04c6fa
Author: James Buren <r...@frugalware.org>
Date:   Wed Oct 14 23:04:17 2009 -0500

x11.c
* remove

diff --git a/src/x11.c b/src/x11.c
deleted file mode 100644
index aae1c9e..0000000
--- a/src/x11.c
+++ /dev/null
@@ -1,112 +0,0 @@
-// Includes /*FOLD00*/
-#include <stdlib.h>
-#include <assert.h>
-#include <X11/Xlib.h>
-// Types /*FOLD00*/
-typedef struct {
-  Display *display; // Display pointer
-  Screen *screen;   // Screen pointer
-  Visual *visual;   // Visual pointer
-  Window root;      // Root window ID
-  int depth;        // Depth of screen
-  int width;        // Width of screen
-  int height;       // Height of screen
-} TDisplay;
-
-typedef struct {
-  Window id;
-  int width;
-  int height;
-} TWindow;
-
-typedef enum {
-  X11_ERROR_MEMORY = 0, // Insufficient memory
-  X11_ERROR_DISPLAY     // Cannot open display
-} TX11Error;
-// display_create /*FOLD00*/
-TDisplay *display_create(TX11Error *error) {
-  TDisplay *self;
-
-  assert(error != NULL);
-
-  self = malloc(sizeof(*self));
-
-  if(self == NULL) {
-      (*error) = X11_ERROR_MEMORY;
-      return NULL;
-  }
-
-  self->display = XOpenDisplay(NULL);
-
-  if(self->display == NULL) {
-      (*error) = X11_ERROR_DISPLAY;
-      free(self);
-      return NULL;
-  }
-
-  self->screen = XDefaultScreenOfDisplay(self->display);
-
-  self->visual = XDefaultVisualOfScreen(self->screen);
-
-  self->root = XRootWindowOfScreen(self->screen);
-
-  self->depth = XDefaultDepthOfScreen(self->screen);
-
-  self->width = XWidthOfScreen(self->screen);
-
-  self->height = XHeightOfScreen(self->screen);
-
-  return self;
-}
-// display_destroy /*FOLD00*/
-void display_destroy(TDisplay *self) {
-    assert(self != NULL);
-
-    XCloseDisplay(self->display);
-
-    free(self);
-}
-// window_create /*FOLD00*/
-TWindow *window_create(TDisplay *dsp,int width,int height,TX11Error *error) {
-  TWindow *self;
-
-  assert(dsp != NULL);
-  assert(error != NULL);
-
-  self = malloc(sizeof(*self));
-
-  if(self == NULL) {
-    (*error) = X11_ERROR_MEMORY;
-    return NULL;
-  }
-
-  self->id = XCreateWindow(
-                          dsp->display, // display
-                          dsp->root,    // parent
-                          0,            // x
-                          0,            // y
-                          width,        // width
-                          height,       // height
-                          0,            // border_width
-                          dsp->depth,   // depth
-                          InputOutput,  // class
-                          dsp->visual,  // visual
-                          0,            // mask
-                          NULL          // attributes
-                         );
-
-  self->width = width;
-
-  self->height = height;
-
-  return self;
-}
-// window_destroy /*FOLD00*/
-void window_destroy(TWindow *self,TDisplay *dsp) {
-  assert(self != NULL);
-  assert(dsp != NULL);
-
-  XDestroyWindow(dsp->display,self->id);
-
-  free(self);
-}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to