* Fix TextElement* to use rpc::target_type.

* Moved most of src/ui/download.cc to use commands for TextElements.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@967 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-08-30 16:33:52 +00:00
parent 32b74ffc48
commit 73c41074ec
28 changed files with 476 additions and 115 deletions
+6 -6
View File
@@ -43,7 +43,7 @@
namespace display {
char*
TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* attributes, void* object) {
TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* attributes, rpc::target_type target) {
Attributes baseAttribute = attributes->back();
push_attribute(attributes, Attributes(first, m_attributes, Attributes::color_invalid));
@@ -52,18 +52,18 @@ TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* a
if (m_flags & flag_escape_hex) {
char buffer[last - first];
char* bufferLast = copy_string(buffer, buffer + (last - first), object);
char* bufferLast = copy_string(buffer, buffer + (last - first), target);
first = rak::transform_hex(buffer, bufferLast, first, last);
} else if (m_flags & flag_escape_html) {
char buffer[last - first];
char* bufferLast = copy_string(buffer, buffer + (last - first), object);
char* bufferLast = copy_string(buffer, buffer + (last - first), target);
first = rak::copy_escape_html(buffer, bufferLast, first, last);
} else {
first = copy_string(first, last, object);
first = copy_string(first, last, target);
}
push_attribute(attributes, Attributes(first, baseAttribute));
@@ -72,7 +72,7 @@ TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* a
}
char*
TextElementString::copy_string(char* first, char* last, void* object) {
TextElementString::copy_string(char* first, char* last, rpc::target_type target) {
extent_type length = std::min<extent_type>(last - first, m_string.size());
std::memcpy(first, m_string.c_str(), length);
@@ -81,7 +81,7 @@ TextElementString::copy_string(char* first, char* last, void* object) {
}
char*
TextElementCString::copy_string(char* first, char* last, void* object) {
TextElementCString::copy_string(char* first, char* last, rpc::target_type target) {
extent_type length = std::min<extent_type>(last - first, m_length);
std::memcpy(first, m_string, length);