[Aptitude-svn-commit] r3273 - in branches/aptitude-0.3/aptitude: . src/vscreen
Daniel Burrows
dburrows@costa.debian.org
Sun, 08 May 2005 13:16:12 +0000
Author: dburrows
Date: Sun May 8 13:16:08 2005
New Revision: 3273
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/vscreen/vs_minibuf_win.h
branches/aptitude-0.3/aptitude/src/vscreen/vs_treeitem.h
branches/aptitude-0.3/aptitude/src/vscreen/vscreen.cc
Log:
Make one source file compile, anyway.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Sun May 8 13:16:08 2005
@@ -1,5 +1,11 @@
2005-05-08 Daniel Burrows <dburrows@debian.org>
+ * src/vscreen/vscreen.cc, src/vscreen/vs_minibuf_win.h, src/vscreen/vs_treeitem.h:
+
+ Make vscreen.cc compile, and change some 'get the color' routines
+ to 'get the style'. Note that 'normal' colors now just correspond
+ to an empty style!
+
* src/vscreen/config/style.h:
Oops, use attrs_on, not attr_on.
Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_minibuf_win.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_minibuf_win.h (original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_minibuf_win.h Sun May 8 13:16:08 2005
@@ -1,6 +1,6 @@
// vs_minibuf_win.h -*-c++-*-
//
-// Copyright 2000 Daniel Burrows
+// Copyright 2000-2001, 2004-2005 Daniel Burrows
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
#include "vscreen.h"
#include "vscreen_widget.h"
#include "vs_passthrough.h"
-#include "config/colors.h"
+#include "config/style.h"
#include <list>
@@ -74,9 +74,8 @@
vscreen_widget *get_focus();
- static int retr_header_color() {return get_color("ScreenHeaderColor");}
- static int retr_background_color() {return get_color("DefaultWidgetBackground");}
- static int retr_status_color() {return get_color("ScreenStatusColor");}
+ static const style &retr_header_style() {return get_style("Header");}
+ static const style &retr_status_style() {return get_style("Status");}
void display_error(std::string err);
void add_widget(vscreen_widget *widget);
Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_treeitem.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_treeitem.h (original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_treeitem.h Sun May 8 13:16:08 2005
@@ -1,6 +1,6 @@
// vs_treeitem.h (this is -*-c++-*-)
//
-// Copyright 1999 Daniel Burrows
+// Copyright 1999-2001, 2004-2005 Daniel Burrows
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include "curses++.h"
-#include "config/colors.h"
+#include "config/style.h"
#include "vs_minibuf_win.h"
@@ -127,8 +127,8 @@
int get_depth() {return depth;}
bool get_selectable() {return selectable;}
- virtual int get_normal_attr() {return vs_minibuf_win::retr_background_color();}
- virtual int get_highlight_attr() {return get_normal_attr()|A_BOLD|A_REVERSE;}
+ virtual style get_normal_style() {return style();}
+ virtual style get_highlight_style() {return style_attrs_flip(A_REVERSE);}
virtual void sort(const sortpolicy &sort_method) {}
// Sorts an item's subtree using the given method.
Modified: branches/aptitude-0.3/aptitude/src/vscreen/vscreen.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vscreen.cc (original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vscreen.cc Sun May 8 13:16:08 2005
@@ -39,7 +39,7 @@
#include "vs_tree.h"
#include "config/keybindings.h"
-#include "config/colors.h"
+#include "config/style.h"
// For _()
#include "../aptitude.h"
@@ -295,28 +295,36 @@
vs_text_layout::init_bindings();
vs_tree::init_bindings();
- set_color("Error", COLOR_WHITE, COLOR_RED, A_BOLD);
+ set_style("Error",
+ style_fg(COLOR_WHITE)+style_bg(COLOR_RED)+style_attrs_on(A_BOLD));
- set_color("DefaultWidgetBackground", COLOR_WHITE, COLOR_BLACK, 0);
+ // The 'base' style for the display.
+ set_style("Default",
+ style_fg(COLOR_WHITE)+style_bg(COLOR_BLACK)+style_attrs_on(0));
+
+ set_style("ScreenHeader",
+ style_fg(COLOR_WHITE)+style_bg(COLOR_BLUE)+style_attrs_on(A_BOLD));
+ set_style("ScreenStatus",
+ style_fg(COLOR_WHITE)+style_bg(COLOR_BLUE)+style_attrs_on(A_BOLD));
+
+ set_style("Menu", style_fg(COLOR_WHITE)+style_bg(COLOR_BLUE));
+ set_style("MenuEntry", style());
+ set_style("MenuBorder", style_attrs_on(A_BOLD));
+ set_style("HighlightedMenuEntry", style_attrs_flip(A_REVERSE));
+ set_style("DisabledMenuEntry",
+ style_fg(COLOR_BLACK)+style_attrs_on(A_DIM));
+ set_style("MenuBar", style_attrs_on(A_BOLD));
+ set_style("HighlightedMenuBar", style_attrs_flip(A_REVERSE));
+
+ set_style("MultiplexTab", style_fg(COLOR_WHITE)+style_bg(COLOR_BLUE));
+ set_style("MultiplexTabHighlighted", style_attrs_flip(A_REVERSE));
- set_color("ScreenHeaderColor", COLOR_WHITE, COLOR_BLUE, A_BOLD);
- set_color("ScreenStatusColor", COLOR_WHITE, COLOR_BLUE, A_BOLD);
+ // Edit lines will *always* appear white-on-black.
+ set_style("EditLine", style_fg(COLOR_WHITE)+style_bg(COLOR_BLACK)+style_attrs_on(0));
- set_color("MenuEntry", COLOR_WHITE, COLOR_BLUE, 0);
- set_color("MenuBorder", COLOR_WHITE, COLOR_BLUE, A_BOLD);
- set_color("HighlightedMenuEntry", COLOR_WHITE, COLOR_BLUE, A_BOLD|A_REVERSE);
- set_color("DisabledMenuEntry", COLOR_BLACK, COLOR_BLUE, A_DIM);
- set_color("MenuBar", COLOR_WHITE, COLOR_BLUE, A_BOLD);
- set_color("HighlightedMenuBar", COLOR_BLUE, COLOR_WHITE, A_BOLD);
+ set_style("WidgetFrame", style_fg(COLOR_WHITE)+style_bg(COLOR_BLACK));
- set_color("MultiplexTab", COLOR_WHITE, COLOR_BLUE, 0);
- set_color("MultiplexTabHighlighted", COLOR_BLUE, COLOR_WHITE, 0);
-
- set_color("EditLine", COLOR_WHITE, COLOR_BLACK, 0);
-
- set_color("WidgetFrame", COLOR_WHITE, COLOR_BLACK, 0);
-
- set_color("TreeBackground", COLOR_WHITE, COLOR_BLACK, 0);
+ set_style("TreeBackground", style());
if(toplevel)
vscreen_settoplevel(toplevel);