]> git.mdlowis.com Git - projs/tide.git/commitdiff
minor cleanup and tweaks of the acme-like color scheme
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 5 Apr 2018 19:53:43 +0000 (15:53 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 5 Apr 2018 19:53:43 +0000 (15:53 -0400)
.gitignore
config.mk
lib/config.c
lib/x11.c

index d741e7c55548a76f65f9bf99031259c96f50f88c..395ebbc0b9a27a5c7d9b2c1e48a24d26f8822a2b 100644 (file)
@@ -55,3 +55,4 @@ hl-cpp
 pty
 tfetch
 tctl
+flaws.txt
index 9a9d43d2eb5dac23f77608b0f8085bf445bc1f4d..3f2a72a90e6e1c3e757748258b81c8f3f5dff2df 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -16,7 +16,7 @@ INCS += -I/usr/include/freetype2
 # Compiler Setup
 CC = cc
 CFLAGS = -g --std=c99 -MMD $(INCS)
-
+CFLAGS += -Wall -Werror
 # Linker Setup
 LD = $(CC)
 LDFLAGS = $(LIBS) -lX11 -lXft -lfontconfig -lutil
index 99ab05d15507171ede76a05913044612a5db407a..aaec5697fc3b6976811d7574ff8aab43def8d638 100644 (file)
@@ -34,47 +34,46 @@ int /* Integer config options */
 
 #if defined(GRUVBOX)
 int Palette[ClrCount] = {
-    [Red]      = 0xFFfb4934, // Red
-    [Green]    = 0xFFb8bb26, // Green
-    [Yellow]   = 0xFFfabd2f, // Yellow
-    [Blue]     = 0xFF83a598, // Blue
-    [Purple]   = 0xFF93869b, // Purple
-    [Aqua]     = 0xFF8ec07c, // Aqua
-    [Orange]   = 0xFFfe8019, // Orange
-    [EditBg]   = 0xFF1d2021, // Edit region background
-    [EditFg]   = 0xFFd5c4a1, // Edit region text
-    [EditSel]  = 0xFF504945, // Edit region selection
-    [EditCsr]  = 0xFFfbf1c7, // Edit region cursor
-    [TagsBg]   = 0xFF3c3836, // Tags region background
-    [TagsFg]   = 0xFFd5c4a1, // Tags region text
-    [TagsSel]  = 0xFF504945, // Tags region selection
-    [TagsCsr]  = 0xFFfbf1c7, // Tags region cursor
-    [ScrollBg] = 0xFF665c54, // Scroll region background
-    [ScrollFg] = 0xFF1d2021, // Scroll region foreground
-    [VerBdr]   = 0xFF665c54, // Vertical border
-    [HorBdr]   = 0xFF665c54, // Horizontal border
+    [Red]      = 0xfb4934, // Red
+    [Green]    = 0xb8bb26, // Green
+    [Yellow]   = 0xfabd2f, // Yellow
+    [Blue]     = 0x83a598, // Blue
+    [Purple]   = 0x93869b, // Purple
+    [Aqua]     = 0x8ec07c, // Aqua
+    [Orange]   = 0xfe8019, // Orange
+    [EditBg]   = 0x1d2021, // Edit region background
+    [EditFg]   = 0xd5c4a1, // Edit region text
+    [EditSel]  = 0x504945, // Edit region selection
+    [EditCsr]  = 0xfbf1c7, // Edit region cursor
+    [TagsBg]   = 0x3c3836, // Tags region background
+    [TagsFg]   = 0xd5c4a1, // Tags region text
+    [TagsSel]  = 0x504945, // Tags region selection
+    [TagsCsr]  = 0xfbf1c7, // Tags region cursor
+    [ScrollBg] = 0x665c54, // Scroll region background
+    [ScrollFg] = 0x1d2021, // Scroll region foreground
+    [VerBdr]   = 0x665c54, // Vertical border
+    [HorBdr]   = 0x665c54, // Horizontal border
 };
 #elif defined(PARCHMENT)
 int Palette[ClrCount] = {
-    [Red]      = 0xFF880000, // Red
-    [Green]    = 0xFF005500, // Green
-    [Yellow]   = 0xFFeeee9e, // Yellow
-    [Blue]     = 0xFF004488, // Blue
-    [Purple]   = 0xFF770077, // Purple
-    [Aqua]     = 0xFF007777, // Aqua
-    [Orange]   = 0xFF000000, // Orange ???
-    [EditBg]   = 0xFFffffea, // Edit region background
-    [EditFg]   = 0xFF000000, // Edit region text
-    [EditSel]  = 0xFFeeee9e, // Edit region selection
-    [EditCsr]  = 0xFF000000, // Edit region cursor
-    [TagsBg]   = 0xFFeaffff, // Tags region background
-    [TagsFg]   = 0xFF000000, // Tags region text
-    [TagsSel]  = 0xFF9eeeee, // Tags region selection
-    [TagsCsr]  = 0xFF000000, // Tags region cursor
-    [ScrollBg] = 0xff99994c, // Scroll region background
-    [ScrollFg] = 0xFFffffea, // Scroll region foreground
-    [VerBdr]   = 0xFF8888cc, // Vertical border
-    [HorBdr]   = 0xFF8888cc, // Horizontal border
+    [Red]      = 0x772222, // Red
+    [Green]    = 0x227722, // Green
+    [Blue]     = 0x222277, // Blue
+    [Yellow]   = 0x000000, // Yellow ???
+    [Purple]   = 0x000000, // Purple ???
+    [Aqua]     = 0x000000, // Aqua   ???
+    [Orange]   = 0x000000, // Orange ???
+    [EditBg]   = 0xefefda, // Edit region background
+    [EditSel]  = 0xdede8e, // Edit region selection
+    [EditFg]   = 0x000000, // Edit region text
+    [EditCsr]  = 0x000000, // Edit region cursor
+    [TagsBg]   = 0xdaefef, // Tags region background
+    [TagsSel]  = 0x8edede, // Tags region selection
+    [TagsFg]   = 0x000000, // Tags region text
+    [TagsCsr]  = 0x000000, // Tags region cursor
+    [ScrollBg] = 0x89893c, // Scroll region background
+    [ScrollFg] = 0xefefda, // Scroll region foreground
+    [VerBdr]   = 0x89893c, // Vertical border
+    [HorBdr]   = 0x000000, // Horizontal border
 };
 #endif
-
index 83ee496e266cabb69670b5f81f48894f69715592..a1ec712b10358ddd8ee9989c71625eb70684c416 100644 (file)
--- a/lib/x11.c
+++ b/lib/x11.c
@@ -64,10 +64,8 @@ static void (*EventHandlers[LASTEvent])(XEvent*) = {
 
 enum { FontCacheSize = 16 };
 
-static void oninput(int mods, Rune key);
 static void draw_glyphs(size_t x, size_t y, UGlyph* glyphs, size_t rlen, size_t ncols);
 static WinRegion getregion(size_t x, size_t y);
-
 static struct XSel* selfetch(Atom atom);
 static void xftcolor(XftColor* xc, int id);
 
@@ -452,7 +450,7 @@ static WinRegion getregion(size_t x, size_t y) {
 static void xftcolor(XftColor* xc, int id) {
     #define COLOR(c) ((c) | ((c) >> 8))
     uint32_t c = Palette[id];
-    xc->color.alpha = COLOR((c & 0xFF000000) >> 16);
+    xc->color.alpha = 0xFFFF;
     xc->color.red   = COLOR((c & 0x00FF0000) >> 8);
     xc->color.green = COLOR((c & 0x0000FF00));
     xc->color.blue  = COLOR((c & 0x000000FF) << 8);
@@ -551,7 +549,7 @@ static void xselnotify(XEvent* e) {
         return;
     struct XSel* sel = selfetch( e->xselection.selection );
     Atom rtype;
-    unsigned long format = 0, nitems = 0, nleft = 0, nread = 0;
+    unsigned long format = 0, nitems = 0, nleft = 0;
     unsigned char* propdata = NULL;
     XGetWindowProperty(X.display, X.self, sel->atom, 0, -1, False, AnyPropertyType, &rtype,
                        (int*)&format, &nitems, &nleft, &propdata);
@@ -753,7 +751,7 @@ static void draw_view(int i, int width, int height, int bg, int fg, int csr, int
     View* view = win_view(i);
     x11_draw_rect(bg, 0, Regions[i].y - 3, width, Regions[i].height + 8);
     x11_draw_rect(HorBdr, 0, Regions[i].y - 3, width, 1);
-    for (size_t line = 0, y = 0; y < view->nrows; y++) {
+    for (size_t y = 0; y < view->nrows; y++) {
         Row* row = view_getrow(view, y);
         draw_glyphs(Regions[i].x, Regions[i].y + ((y+1) * fheight), row->cols, row->rlen, row->len);
     }