1 // ---------------------------------------------------------------------------- 2 // 3 // Copyright (C) 2010-2017 Fons Adriaensen <fons@linuxaudio.org> 4 // 5 // This program is free software; you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation; either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 // 15 // You should have received a copy of the GNU General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 // 18 // ---------------------------------------------------------------------------- 19 20 21 #include "styles.h" 22 23 24 XftColor *XftColors [NXFTCOLORS]; 25 XftFont *XftFonts [NXFTFONTS]; 26 X_button_style Bst0; 27 X_textln_style Tst0; 28 29 30 void styles_init (X_display *disp, X_resman *xrm) 31 { 32 XftColors [C_MAIN_BG] = disp->alloc_xftcolor (0.2f, 0.2f, 0.2f, 1.0f); 33 XftColors [C_MAIN_FG] = disp->alloc_xftcolor (1.0f, 1.0f, 1.0f, 1.0f); 34 XftColors [C_MAIN_LS] = disp->alloc_xftcolor (0.5f, 0.5f, 0.5f, 1.0f); 35 XftColors [C_MAIN_DS] = disp->alloc_xftcolor (0.0f, 0.0f, 0.0f, 1.0f); 36 XftColors [C_DISP_BG] = disp->alloc_xftcolor (0.0f, 0.0f, 0.0f, 1.0f); 37 38 XftFonts [F_TEXT] = disp->alloc_xftfont (xrm->get (".font.text", "helvetica:bold:pixelsize=11")); 39 XftFonts [F_JKMP] = disp->alloc_xftfont (xrm->get (".font.butt", "luxi:bold:pixelsize=10")); RotaryCtl(X_window * parent,X_callback * cbobj,int cbind,RotaryGeom * rgeom,int xp,int yp)40 41 Bst0.size.x = 30; 42 Bst0.size.y = 16; 43 Bst0.font = XftFonts [F_JKMP]; 44 Bst0.type = X_button_style::PLAIN; 45 Bst0.color.bg[0] = disp->alloc_color ("#000000", 0); 46 Bst0.color.fg[0] = disp->alloc_xftcolor ("#8080ff", 0); 47 Bst0.color.bg[1] = disp->alloc_color ("#000000", 0); 48 Bst0.color.fg[1] = disp->alloc_xftcolor ("#40ff40", 0); 49 Bst0.color.bg[2] = disp->alloc_color ("#000000", 0); 50 Bst0.color.fg[2] = disp->alloc_xftcolor ("#ffff00", 0); 51 Bst0.color.bg[3] = disp->alloc_color ("#ff2000", 0); 52 Bst0.color.fg[3] = disp->alloc_xftcolor ("#ffffff", 0); 53 54 Tst0.font = XftFonts [F_TEXT]; 55 Tst0.color.normal.bgnd = XftColors [C_MAIN_BG]->pixel; 56 Tst0.color.normal.text = XftColors [C_MAIN_FG]; 57 } 58 59 60 void styles_fini (X_display *disp) 61 { 62 } 63