From 727cb1420c171dfed8213aa1b47ec3c542968b43 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Wed, 22 Jul 2020 01:02:16 -0500 Subject: deleted: ../Makefile modified: ../color deleted: ../color.c --- Makefile | 4 --- color | Bin 17160 -> 17160 bytes color.c | 84 --------------------------------------------------------------- 3 files changed, 88 deletions(-) delete mode 100644 Makefile delete mode 100644 color.c diff --git a/Makefile b/Makefile deleted file mode 100644 index cbc04cd..0000000 --- a/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -make: - gcc color.c -lX11 -o color -debug: - gcc color.c -lX11 -Wall -o color -ggdb diff --git a/color b/color index f6751bb..ca74642 100755 Binary files a/color and b/color differ diff --git a/color.c b/color.c deleted file mode 100644 index e05e177..0000000 --- a/color.c +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include -#include -#include -#include - -//TODO: fix your ugly ass vim colors, I don't care if it's part of the code - - -int main(void) { - - char text_prompt_buffer[32] = "testing"; //TODO: everything - - Display *display; - Window window; - XEvent event; - Colormap colormap; - int screen; - - XColor background_color; - XTextItem text_prompt; - XGCValues text_prompt_formatting; - GC text_prompt_gc; - - - - - - if((display = XOpenDisplay(NULL)) == NULL) { - printf("Couldn't open display due to fatal error: %s\n", strerror(errno)); - exit(errno); - } - - screen = DefaultScreen(display); - colormap = DefaultColormap(display, screen); - - background_color.red = 0; - background_color.green = 65535; - background_color.blue = 0; - - XAllocColor(display, colormap, &background_color); - - - window = XCreateSimpleWindow(display, RootWindow(display, screen), - 10, 10, - 100, 100, - 0, - background_color.pixel, - background_color.pixel); //last arg is color - - XMapWindow(display, window); - XSelectInput(display, window, KeyPressMask | ExposureMask); - - - //text struct - text_prompt.chars = text_prompt_buffer; - text_prompt.nchars = strlen(text_prompt_buffer); - text_prompt.delta = 0; //what? - text_prompt.font = None; - - //text formatting struct - text_prompt_formatting.foreground = BlackPixel(display, screen); - text_prompt_formatting.background = WhitePixel(display, screen); - text_prompt_gc = XCreateGC(display, window, GCForeground | GCBackground, &text_prompt_formatting); - - - for(;;) { - XNextEvent(display, &event); - switch (event.type) { - case KeyPress: - printf("Key press\n"); - break; - case Expose: - XDrawText(display, window, text_prompt_gc, 10, 10, &text_prompt, 1); //TODO formatting, textprompt - break; - default: - printf("wot\n"); - break; - } - } - - - return 0; -} -- cgit v1.2.3