1 module theme.layout; 2 3 import kernel; 4 import cboxapp; 5 import old; 6 import types; 7 import utils; 8 import theme.manager; 9 import window; 10 import monitor; 11 12 import std.c.stdlib; 13 import deimos.X11.X; 14 import deimos.X11.Xlib; 15 import deimos.X11.keysymdef; 16 import deimos.X11.Xutil; 17 import deimos.X11.Xatom; 18 import std.stdio; 19 import std..string; 20 21 22 struct Layout 23 { 24 const string symbol; 25 void function(Monitor* m) arrange; 26 } 27 28 struct Clr 29 { 30 ulong rgb; 31 32 this(Drw* drw, in string clrname) 33 { 34 if(drw is null) { 35 // lout(__FUNCTION__~"\n\t--> NULL Drw* parm"); 36 exit(EXIT_FAILURE); 37 } 38 39 Colormap cmap; 40 XColor color; 41 42 cmap = DefaultColormap(drw.dpy, drw.screen); 43 if(!XAllocNamedColor(drw.dpy, cmap, cast(char*)clrname.toStringz, &color, &color)) { 44 // lout("error, cannot allocate color '%s'", clrname); 45 exit(EXIT_FAILURE); 46 } 47 this.rgb = color.pixel; 48 } 49 50 static void free(Clr *clr) 51 { 52 if(clr) { 53 DGC.free(clr); 54 } 55 } 56 }