mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-07 06:39:23 +00:00
* Use varargs in Canvas::print.
* Added min/max size to display::Window. Added flags for windows that should be on located at the left/bottom side of a Frame. * Reversed print order in WindowLog*. * Added display::TextElement and subclasses for flexible printing to a char buffer with associated attributes. Added display::Attributes and display::Canvas::print_attributes. * Added display::WindowText for use with display::TextElement's. * Added ui::ElementMenu for generic menus, and started work adding this to ui::Download. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@751 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/termios.h>
|
||||
#include <torrent/exceptions.h>
|
||||
|
||||
#include "canvas.h"
|
||||
|
||||
@@ -52,6 +53,28 @@ Canvas::resize(int x, int y, int w, int h) {
|
||||
mvwin(m_window, y, x);
|
||||
}
|
||||
|
||||
void
|
||||
Canvas::print_attributes(unsigned int x, unsigned int y, const char* first, const char* last, const attributes_list* attributes) {
|
||||
move(x, y);
|
||||
|
||||
int attr = A_NORMAL;
|
||||
attributes_list::const_iterator attrItr = attributes->begin();
|
||||
|
||||
while (first != last) {
|
||||
if (attrItr != attributes->end() && attrItr->position() == first) {
|
||||
attr = attrItr->attributes();
|
||||
// Set colors or something.
|
||||
|
||||
attrItr++;
|
||||
continue;
|
||||
}
|
||||
|
||||
waddch(m_window, *first++ | attr);
|
||||
}
|
||||
|
||||
// Reset the color.
|
||||
}
|
||||
|
||||
void
|
||||
Canvas::initialize() {
|
||||
if (m_isInitialized)
|
||||
|
||||
Reference in New Issue
Block a user