void WindowManager::read_configuration(void) { ELOG("Reading config"); Fl_Config conf(fl_find_config_file(WM_CONFIG_FILE, 0)); conf.set_section("TitleBar"); conf.read("Active color", wm_conf->title_active_color, fl_rgb(0, 0, 128)); conf.read("Normal color", wm_conf->title_normal_color, fl_rgb(192, 192, 192)); conf.read("Active color text", wm_conf->title_active_color_text, fl_rgb(255, 255, 255)); conf.read("Normal color text", wm_conf->title_normal_color_text, fl_rgb(0, 0, 128)); conf.read("Box type", wm_conf->title_box_type, 0); conf.read("Height", wm_conf->title_height, 20); int la; conf.read("Text align", la, 0); wm_conf->title_label_align = convert_align(la); conf.set_section("Resize"); conf.read("Opaque resize", wm_conf->frame_do_opaque, false); conf.read("Animate", wm_conf->frame_animate, true); conf.read("Animate Speed", wm_conf->frame_animate_speed, 15); conf.set_section("Misc"); conf.read("Use theme", wm_conf->use_theme); notify_clients(); }
void Fl_Scopes_Manager::t_color(int n, int t, RGB_Color_T c_rgb) { Scope_Windows[n]->Plot->trace_free_color(t); fl_set_color(FL_FREE_COLOR, fl_rgb((unsigned char)(c_rgb.r*255.), (unsigned char)(c_rgb.g*255.), (unsigned char)(c_rgb.b*255.))); Scope_Windows[n]->Plot->trace_color(t, c_rgb.r, c_rgb.g, c_rgb.b); Trace_Page[n][t]->label_color(fl_rgb((unsigned char)(c_rgb.r*255.), (unsigned char)(c_rgb.g*255.), (unsigned char)(c_rgb.b*255.))); Trace_Page[n][t]->redraw(); }
inline void Fl_Scopes_Manager::select_trace_color_i(Fl_Button *bb, void *v) { s_idx_T *idx = (s_idx_T *)v; int scope = idx->scope_idx; int trace = idx->trace_idx; uchar r,g,b; Fl_Color c; c = Scope_Windows[scope]->Plot->trace_color(trace); fl_get_color(c,r,g,b); if (!fl_color_chooser("New color:",r,g,b)) return; c = FL_FREE_COLOR; Scope_Windows[scope]->Plot->trace_free_color(trace); fl_set_color(FL_FREE_COLOR, fl_rgb(r,g,b)); Scope_Windows[scope]->Plot->trace_color(trace, r/255.,g/255.,b/255.); Trace_Page[scope][trace]->label_color(fl_rgb(r,g,b)); Trace_Page[scope][trace]->redraw(); }
void WindowManager::read_configuration() { Fl_String buf; Fl_Config wmconf(fl_find_config_file("wmanager.conf", 0)); wmconf.set_section("TitleBar"); wmconf.read("Active color", title_active_color, fl_rgb(0,0,128)); wmconf.read("Normal color", title_normal_color, fl_rgb(192,192,192)); wmconf.read("Active color text", title_active_color_text, fl_rgb(255,255,255)); wmconf.read("Normal color text", title_normal_color_text, fl_rgb(0,0,128)); wmconf.read("Box type", Titlebar::box_type, 0); wmconf.read("Height", Titlebar::default_height, 20); wmconf.read("Text align", Titlebar::label_align, 0); Titlebar::label_align = real_align(Titlebar::label_align); wmconf.set_section("Resize"); wmconf.read("Opaque resize", Frame::do_opaque, false); wmconf.read("Animate", Frame::animate, true); wmconf.read("Animate Speed", Frame::animate_speed, 15); wmconf.set_section("Misc"); bool theme = false; wmconf.read("Use theme", theme, false); if(theme) { wmconf.read("Theme path", buf, 0); Theme::instance()->load(buf); Theme::instance()->use(true); } else { Theme::instance()->unload(); Theme::instance()->use(false); } notify_all(); read_hotkeys_configuration(); }
inline void Fl_Scopes_Manager::select_bg_color_i(Fl_Button *bb, void *v) { long n = (long)v; uchar r,g,b; Fl_Color c; c = Scope_Windows[n]->Plot->bg_color(); fl_get_color(c,r,g,b); if (!fl_color_chooser("New color:",r,g,b)) return; c = FL_FREE_COLOR; Scope_Windows[n]->Plot->bg_free_color(); fl_set_color(FL_FREE_COLOR, fl_rgb(r,g,b)); Scope_Windows[n]->Plot->bg_color(r/255.,g/255.,b/255.); }
extern "C" bool fltk_theme() { Fl_Boxtype vertup = new Fl_Shaded_Box(FL_THIN_UP_BOX, true); Fl_Boxtype vertdown = new Fl_Shaded_Box(FL_THIN_DOWN_BOX, true); Fl_Boxtype vertfr = new Fl_Shaded_Box(FL_BORDER_BOX, true); Fl_Boxtype vertflat = new Fl_Shaded_Box(FL_FLAT_BOX, true); Fl_Boxtype verthl = new Fl_Shaded_Box(FL_HIGHLIGHT_BOX, true); Fl_Boxtype horup = new Fl_Shaded_Box(FL_THIN_UP_BOX, false); Fl_Boxtype hordown = new Fl_Shaded_Box(FL_THIN_DOWN_BOX, false); //Fl_Boxtype horfr = new Fl_Shaded_Box(FL_BORDER_BOX, false); Fl_Boxtype horflat = new Fl_Shaded_Box(FL_FLAT_BOX, false); Fl_Color bc = fl_rgb(180,210,230); Fl_Style::scrollbar_width = 15; Fl_Widget::default_style->box = vertdown; //Fl_Widget::default_style->button_box = vertup; Fl_Widget::default_style->color = bc; //Fl_Widget::default_style->highlight_color = FL_LIGHT2; Fl_Style* s; if ((s = Fl_Style::find("window"))) { s->box = FL_FLAT_BOX;//vertflat; s->color = fl_rgb(180,200,215); } if ((s = Fl_Style::find("group"))) { s->box = FL_NO_BOX; s->color = bc; s->button_color = bc; } if ((s = Fl_Style::find("menu"))) { s->selection_text_color = fl_darker(FL_BLUE); s->selection_color = bc; s->box = vertfr; s->color = fl_lighter(FL_BLUE); s->button_box = vertfr; } if ((s = Fl_Style::find("menu bar"))) { s->color = bc; s->highlight_label_color = fl_darker(FL_BLUE); s->selection_text_color = fl_darker(FL_BLUE); s->highlight_color = FL_GRAY; s->box = vertflat; s->button_box = FL_NO_BOX; } if ((s = Fl_Style::find("choice"))) { s->box = FL_THIN_DOWN_BOX; s->button_color = bc; } if ((s = Fl_Style::find("button"))) { s->selection_color = fl_darker(bc); s->color = bc; s->box = vertup; } if ((s = Fl_Style::find("scrollbar"))) { s->color = bc; s->button_color = bc; s->button_box = vertup; } if ((s = Fl_Style::find("menu button"))) { s->color = bc; s->box = vertup; } if((s = Fl_Style::find("browser"))) { s->box = FL_THIN_DOWN_BOX; s->color = fl_rgb(235,245,255); } if((s = Fl_Style::find("input browser"))) { s->box = FL_THIN_DOWN_BOX; s->button_color = bc; s->color = fl_rgb(235,245,255); } if((s = Fl_Style::find("input"))) { s->box = hordown; } if ((s = Fl_Style::find("listview header"))) { s->button_box = vertup; s->button_color = bc; } if ((s = Fl_Style::find("listview"))) { s->button_color = fl_lighter(bc); } if ((s = Fl_Style::find("slider"))) { s->box = hordown; s->button_box = horup; s->color = bc; s->button_color = fl_darker(bc); s->focus_box = FL_NO_BOX; } if ((s = Fl_Style::find("value slider"))) { s->box = hordown; s->button_box = horup; s->color = bc; s->button_color = fl_darker(bc); s->focus_box = FL_NO_BOX; } if ((s = Fl_Style::find("highlight button"))) { s->box = verthl; s->color = bc; s->highlight_color = fl_lighter(bc); } if ((s = Fl_Style::find("tool bar"))) { //s->highlight_color = FL_GRAY; s->box = vertup; } if ((s = Fl_Style::find("tabs"))) { s->box = FL_THIN_UP_BOX; s->color = fl_rgb(180,200,215); s->button_color = fl_rgb(180,200,215); } if ((s = Fl_Style::find("pack"))) { s->box = horflat; } if ((s = Fl_Style::find("workspace"))) { s->box = FL_THIN_DOWN_BOX;; } if ((s = Fl_Style::find("mdi viewport"))) { s->box = FL_FLAT_BOX;//vertflat; s->color = fl_rgb(180,200,215); } if ((s = Fl_Style::find("panel"))) { s->box = horup; s->color = bc; } if ((s = Fl_Style::find("light button"))) { s->selection_color = fl_lighter(FL_BLUE); } if ((s = Fl_Style::find("calendar"))) { s->box = FL_NO_BOX; s->button_box = vertup; s->button_color = fl_rgb(60,120,200); } return true; }
void WindowManager::init_internals(void) { ELOG("Starting window manager"); wm_conf = new WindowManagerConfig; app_starting = false; // defaults, in case world goes down wm_conf->title_active_color = fl_rgb(0,0,128); wm_conf->title_active_color_text = fl_rgb(255,255,255); wm_conf->title_normal_color = fl_rgb(192,192,192); wm_conf->title_normal_color_text = fl_rgb(0,0,128); wm_conf->title_label_align = FL_ALIGN_LEFT; wm_conf->title_height = 20; wm_conf->title_box_type = 0; wm_conf->frame_do_opaque = false; wm_conf->frame_animate = true; wm_conf->frame_animate_speed = 15; fl_open_display(); XSetErrorHandler(xerror_handler); wm_area.set(0, 0, Fl::w(), Fl::h()); read_configuration(); read_xset_configuration(); //register_protocols(); #ifdef _DEBUG InitAtoms(fl_display, atom_map); register_events(); #else InitAtoms(fl_display); #endif //cur = XCreateFontCursor(fl_display, XC_left_ptr); //XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), cur); // load cursor cur = new CursorHandler; cur->load(X_CURSORS); cur->set_root_cursor(); sound_system = new SoundSystem(); sound_system->init(); sound_system->add(SOUND_MINIMIZE, "sounds/minimize.ogg"); sound_system->add(SOUND_MAXIMIZE, "sounds/maximize.ogg"); sound_system->add(SOUND_CLOSE, "sounds/close.ogg"); sound_system->add(SOUND_RESTORE, "sounds/restore.ogg"); sound_system->add(SOUND_SHADE, "sounds/shade.ogg"); // the world is starting here show(); register_protocols(); hint_stuff = new Hints; hint_stuff->icccm_set_iconsizes(this); init_clients(); Fl::add_handler(wm_event_handler); XSync(fl_display, 0); is_running = true; }
void Fl_Scopes_Manager::g_color(int n, RGB_Color_T c_rgb) { Scope_Windows[n]->Plot->grid_free_color(); fl_set_color(FL_FREE_COLOR, fl_rgb((unsigned char)(c_rgb.r*255.), (unsigned char)(c_rgb.g*255.), (unsigned char)(c_rgb.b*255.))); Scope_Windows[n]->Plot->grid_color(c_rgb.r, c_rgb.g, c_rgb.b); }
Fl_Color Fl_Color_Chooser::value() const { Fl_Color ret = fl_rgb(uchar(255*r()+.5f), uchar(255*g()+.5f), uchar(255*b()+.5f)); return (ret ? ret : (Fl_Color)FL_BLACK); }