* Added LinkReceiver methods that return the length of the string.

* AS_GET_STRING_WIDTHS now uses this method to send the strings to the app_server;
  ie. it no longer sends the whole strings, and it saves sending the string length
  separately.
* BFont::StringWidth() will now always return 0.0f in case of an error (instead of
  some random value)
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16525 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-02-27 13:09:37 +00:00
parent 30da2fcb94
commit 2ed942c199
4 changed files with 27 additions and 30 deletions
+5 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2005, Haiku.
* Copyright 2001-2006, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -32,13 +32,12 @@ class LinkReceiver {
int32 Code() const;
virtual status_t Read(void *data, ssize_t size);
status_t ReadString(char **string);
status_t ReadString(BString& string);
status_t ReadString(char** _string, size_t* _length = NULL);
status_t ReadString(BString& string, size_t* _length = NULL);
status_t ReadString(char *buffer, size_t bufferSize);
template <class Type> status_t Read(Type *data)
{
return Read(data, sizeof(Type));
}
{ return Read(data, sizeof(Type)); }
protected:
virtual status_t ReadFromPort(bigtime_t timeout);
+7 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2005, Haiku.
* Copyright 2001-2006, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -60,8 +60,8 @@ class ServerLink {
bool NeedsReply() const;
status_t Read(void *data, ssize_t size);
status_t ReadString(char *buffer, size_t bufferSize);
status_t ReadString(BString& string);
status_t ReadString(char **string);
status_t ReadString(BString& string, size_t* _length = NULL);
status_t ReadString(char** _string, size_t* _length = NULL);
status_t ReadRegion(BRegion *region);
status_t ReadShape(BShape *shape);
template <class Type> status_t Read(Type *data);
@@ -173,15 +173,15 @@ ServerLink::ReadString(char *buffer, size_t bufferSize)
}
inline status_t
ServerLink::ReadString(BString& string)
ServerLink::ReadString(BString& string, size_t* _length)
{
return fReceiver->ReadString(string);
return fReceiver->ReadString(string, _length);
}
inline status_t
ServerLink::ReadString(char **string)
ServerLink::ReadString(char** _string, size_t* _length)
{
return fReceiver->ReadString(string);
return fReceiver->ReadString(_string, _length);
}
template <class Type> status_t