Renamed the FontServer class to FontManager.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14642 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+8
-8
@@ -6,8 +6,8 @@
|
||||
* DarkWyrm <bpmagic@columbus.rr.com>
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
*/
|
||||
#ifndef FONT_SERVER_H
|
||||
#define FONT_SERVER_H
|
||||
#ifndef FONT_MANAGER_H
|
||||
#define FONT_MANAGER_H
|
||||
|
||||
|
||||
#include <Font.h>
|
||||
@@ -28,13 +28,13 @@ class ServerFont;
|
||||
|
||||
|
||||
/*!
|
||||
\class FontServer FontServer.h
|
||||
\class FontManager FontManager.h
|
||||
\brief Manager for the largest part of the font subsystem
|
||||
*/
|
||||
class FontServer : public BLocker {
|
||||
class FontManager : public BLocker {
|
||||
public:
|
||||
FontServer();
|
||||
~FontServer();
|
||||
FontManager();
|
||||
~FontManager();
|
||||
|
||||
status_t InitCheck() { return fInitStatus; }
|
||||
|
||||
@@ -82,6 +82,6 @@ class FontServer : public BLocker {
|
||||
};
|
||||
|
||||
extern FT_Library gFreeTypeLibrary;
|
||||
extern FontServer *gFontServer;
|
||||
extern FontManager *gFontManager;
|
||||
|
||||
#endif /* FONTSERVER_H_ */
|
||||
#endif /* FONT_MANAGER_H */
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <View.h> // for B_FONT_ALL
|
||||
|
||||
#include "RGBColor.h"
|
||||
#include "FontServer.h"
|
||||
#include "FontManager.h"
|
||||
#include "ServerFont.h"
|
||||
#include "PatternHandler.h"
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "DecorManager.h"
|
||||
#include "DefaultDecorator.h"
|
||||
#include "Desktop.h"
|
||||
#include "FontServer.h"
|
||||
#include "FontManager.h"
|
||||
#include "HWInterface.h"
|
||||
#include "RegistrarDefs.h"
|
||||
#include "RGBColor.h"
|
||||
@@ -99,14 +99,14 @@ AppServer::AppServer()
|
||||
sAppServer = this;
|
||||
|
||||
// Create the font server and scan the proper directories.
|
||||
gFontServer = new FontServer;
|
||||
gFontServer->Lock();
|
||||
gFontServer->ScanSystemFolders();
|
||||
gFontManager = new FontManager;
|
||||
gFontManager->Lock();
|
||||
gFontManager->ScanSystemFolders();
|
||||
|
||||
if (!gFontServer->SetSystemPlain(DEFAULT_PLAIN_FONT_FAMILY,
|
||||
if (!gFontManager->SetSystemPlain(DEFAULT_PLAIN_FONT_FAMILY,
|
||||
DEFAULT_PLAIN_FONT_STYLE,
|
||||
DEFAULT_PLAIN_FONT_SIZE) &&
|
||||
!gFontServer->SetSystemPlain(FALLBACK_PLAIN_FONT_FAMILY,
|
||||
!gFontManager->SetSystemPlain(FALLBACK_PLAIN_FONT_FAMILY,
|
||||
DEFAULT_PLAIN_FONT_STYLE,
|
||||
DEFAULT_PLAIN_FONT_SIZE)) {
|
||||
printf("Couldn't set plain to %s (fallback: %s), %s %d pt\n",
|
||||
@@ -116,10 +116,10 @@ AppServer::AppServer()
|
||||
DEFAULT_PLAIN_FONT_SIZE);
|
||||
}
|
||||
|
||||
if (!gFontServer->SetSystemBold(DEFAULT_BOLD_FONT_FAMILY,
|
||||
if (!gFontManager->SetSystemBold(DEFAULT_BOLD_FONT_FAMILY,
|
||||
DEFAULT_BOLD_FONT_STYLE,
|
||||
DEFAULT_BOLD_FONT_SIZE) &&
|
||||
!gFontServer->SetSystemBold(FALLBACK_BOLD_FONT_FAMILY,
|
||||
!gFontManager->SetSystemBold(FALLBACK_BOLD_FONT_FAMILY,
|
||||
DEFAULT_BOLD_FONT_STYLE,
|
||||
DEFAULT_BOLD_FONT_SIZE)) {
|
||||
printf("Couldn't set bold to %s (fallback: %s), %s %d pt\n",
|
||||
@@ -129,10 +129,10 @@ AppServer::AppServer()
|
||||
DEFAULT_BOLD_FONT_SIZE);
|
||||
}
|
||||
|
||||
if (!gFontServer->SetSystemFixed(DEFAULT_FIXED_FONT_FAMILY,
|
||||
if (!gFontManager->SetSystemFixed(DEFAULT_FIXED_FONT_FAMILY,
|
||||
DEFAULT_FIXED_FONT_STYLE,
|
||||
DEFAULT_FIXED_FONT_SIZE) &&
|
||||
!gFontServer->SetSystemFixed(FALLBACK_FIXED_FONT_FAMILY,
|
||||
!gFontManager->SetSystemFixed(FALLBACK_FIXED_FONT_FAMILY,
|
||||
DEFAULT_FIXED_FONT_STYLE,
|
||||
DEFAULT_FIXED_FONT_SIZE)) {
|
||||
printf("Couldn't set fixed to %s (fallback: %s), %s %d pt\n",
|
||||
@@ -142,7 +142,7 @@ AppServer::AppServer()
|
||||
DEFAULT_FIXED_FONT_SIZE);
|
||||
}
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
|
||||
// Load the GUI colors here and set the global set to the values contained therein. If this
|
||||
// is not possible, set colors to the defaults
|
||||
@@ -175,7 +175,7 @@ AppServer::~AppServer()
|
||||
gScreenManager->Lock();
|
||||
gScreenManager->Quit();
|
||||
|
||||
delete gFontServer;
|
||||
delete gFontManager;
|
||||
}
|
||||
|
||||
|
||||
@@ -378,9 +378,9 @@ AppServer::_DispatchMessage(int32 code, BPrivate::LinkReceiver& msg)
|
||||
// Attached data:
|
||||
// 1) port_id reply port
|
||||
|
||||
gFontServer->Lock();
|
||||
bool needsUpdate = gFontServer->FontsNeedUpdated();
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Lock();
|
||||
bool needsUpdate = gFontManager->FontsNeedUpdated();
|
||||
gFontManager->Unlock();
|
||||
|
||||
// Seeing how the client merely wants an answer, we'll skip the BPortLink
|
||||
// and all its overhead and just write the code to port.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "ColorUtils.h"
|
||||
#include "DisplayDriver.h"
|
||||
#include "FontServer.h"
|
||||
#include "FontManager.h"
|
||||
#include "LayerData.h"
|
||||
#include "PatternHandler.h"
|
||||
#include "RGBColor.h"
|
||||
@@ -38,7 +38,7 @@ DefaultDecorator::DefaultDecorator(BRect rect, int32 wlook, int32 wfeel, int32 w
|
||||
fTruncatedTitle("")
|
||||
{
|
||||
ServerFont font(_look == B_FLOATING_WINDOW_LOOK ?
|
||||
*gFontServer->GetSystemPlain() : *gFontServer->GetSystemBold());
|
||||
*gFontManager->GetSystemPlain() : *gFontManager->GetSystemBold());
|
||||
font.SetFlags(B_FORCE_ANTIALIASING);
|
||||
font.SetSpacing(B_STRING_SPACING);
|
||||
SetFont(&font);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <Path.h>
|
||||
#include <String.h>
|
||||
|
||||
#include <FontServer.h>
|
||||
#include <FontManager.h>
|
||||
#include <FontFamily.h>
|
||||
#include <ServerFont.h>
|
||||
#include "ServerConfig.h"
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
static FTC_Manager ftmanager;
|
||||
FT_Library gFreeTypeLibrary;
|
||||
FontServer *gFontServer = NULL;
|
||||
FontManager *gFontManager = NULL;
|
||||
|
||||
//#define PRINT_FONT_LIST
|
||||
|
||||
@@ -49,7 +49,7 @@ face_requester(FTC_FaceID face_id, FT_Library library,
|
||||
|
||||
|
||||
//! Does basic set up so that directories can be scanned
|
||||
FontServer::FontServer()
|
||||
FontManager::FontManager()
|
||||
: BLocker("font server lock"),
|
||||
fFamilies(20),
|
||||
fPlain(NULL),
|
||||
@@ -72,7 +72,7 @@ FontServer::FontServer()
|
||||
|
||||
|
||||
//! Frees items allocated in the constructor and shuts down FreeType
|
||||
FontServer::~FontServer()
|
||||
FontManager::~FontManager()
|
||||
{
|
||||
FTC_Manager_Done(ftmanager);
|
||||
FT_Done_FreeType(gFreeTypeLibrary);
|
||||
@@ -84,7 +84,7 @@ FontServer::~FontServer()
|
||||
\return The number of unique font families currently available
|
||||
*/
|
||||
int32
|
||||
FontServer::CountFamilies(void)
|
||||
FontManager::CountFamilies(void)
|
||||
{
|
||||
return fFamilies.CountItems();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ FontServer::CountFamilies(void)
|
||||
\return The number of font styles currently available for the font family
|
||||
*/
|
||||
int32
|
||||
FontServer::CountStyles(const char *familyName)
|
||||
FontManager::CountStyles(const char *familyName)
|
||||
{
|
||||
FontFamily *family = GetFamily(familyName);
|
||||
if (family)
|
||||
@@ -111,7 +111,7 @@ FontServer::CountStyles(const char *familyName)
|
||||
\param family The family to remove
|
||||
*/
|
||||
void
|
||||
FontServer::RemoveFamily(const char *familyName)
|
||||
FontManager::RemoveFamily(const char *familyName)
|
||||
{
|
||||
FontFamily *family = GetFamily(familyName);
|
||||
if (family) {
|
||||
@@ -123,7 +123,7 @@ FontServer::RemoveFamily(const char *familyName)
|
||||
|
||||
//! Scans the four default system font folders
|
||||
void
|
||||
FontServer::ScanSystemFolders(void)
|
||||
FontManager::ScanSystemFolders(void)
|
||||
{
|
||||
ScanDirectory("/boot/beos/etc/fonts/ttfonts/");
|
||||
|
||||
@@ -140,7 +140,7 @@ FontServer::ScanSystemFolders(void)
|
||||
\brief Adds the FontFamily/FontStyle that is represented by this path.
|
||||
*/
|
||||
void
|
||||
FontServer::_AddFont(BPath &path)
|
||||
FontManager::_AddFont(BPath &path)
|
||||
{
|
||||
FT_Face face;
|
||||
FT_Error error = FT_New_Face(gFreeTypeLibrary, path.Path(), 0, &face);
|
||||
@@ -181,7 +181,7 @@ FontServer::_AddFont(BPath &path)
|
||||
\param directoryPath Path of the folder to scan.
|
||||
*/
|
||||
status_t
|
||||
FontServer::ScanDirectory(const char *directoryPath)
|
||||
FontManager::ScanDirectory(const char *directoryPath)
|
||||
{
|
||||
// This bad boy does all the real work. It loads each entry in the
|
||||
// directory. If a valid font file, it adds both the family and the style.
|
||||
@@ -232,7 +232,7 @@ FontServer::ScanDirectory(const char *directoryPath)
|
||||
\return An FT_CharMap or NULL if unsuccessful
|
||||
*/
|
||||
FT_CharMap
|
||||
FontServer::_GetSupportedCharmap(const FT_Face& face)
|
||||
FontManager::_GetSupportedCharmap(const FT_Face& face)
|
||||
{
|
||||
for (int32 i = 0; i < face->num_charmaps; i++) {
|
||||
FT_CharMap charmap = face->charmaps[i];
|
||||
@@ -266,7 +266,7 @@ FontServer::_GetSupportedCharmap(const FT_Face& face)
|
||||
|
||||
|
||||
FontFamily*
|
||||
FontServer::GetFamilyByIndex(int32 index) const
|
||||
FontManager::GetFamilyByIndex(int32 index) const
|
||||
{
|
||||
return fFamilies.ItemAt(index);
|
||||
}
|
||||
@@ -278,7 +278,7 @@ FontServer::GetFamilyByIndex(int32 index) const
|
||||
\return Pointer to the specified family or NULL if not found.
|
||||
*/
|
||||
FontFamily*
|
||||
FontServer::GetFamily(const char* name) const
|
||||
FontManager::GetFamily(const char* name) const
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
@@ -296,7 +296,7 @@ FontServer::GetFamily(const char* name) const
|
||||
|
||||
|
||||
FontFamily*
|
||||
FontServer::GetFamily(uint16 familyID) const
|
||||
FontManager::GetFamily(uint16 familyID) const
|
||||
{
|
||||
for (int32 i = 0; i < fFamilies.CountItems(); i++) {
|
||||
FontFamily *family = (FontFamily*)fFamilies.ItemAt(i);
|
||||
@@ -309,7 +309,7 @@ FontServer::GetFamily(uint16 familyID) const
|
||||
|
||||
|
||||
FontStyle*
|
||||
FontServer::GetStyleByIndex(const char* familyName, int32 index) const
|
||||
FontManager::GetStyleByIndex(const char* familyName, int32 index) const
|
||||
{
|
||||
FontFamily* family = GetFamily(familyName);
|
||||
if (family != NULL)
|
||||
@@ -332,7 +332,7 @@ FontServer::GetStyleByIndex(const char* familyName, int32 index) const
|
||||
\return The FontStyle having those attributes or NULL if not available
|
||||
*/
|
||||
FontStyle*
|
||||
FontServer::GetStyle(const char* familyName, const char* styleName, uint16 familyID,
|
||||
FontManager::GetStyle(const char* familyName, const char* styleName, uint16 familyID,
|
||||
uint16 styleID, uint16 face)
|
||||
{
|
||||
FontFamily* family;
|
||||
@@ -367,7 +367,7 @@ FontServer::GetStyle(const char* familyName, const char* styleName, uint16 famil
|
||||
\return The FontStyle having those attributes or NULL if not available
|
||||
*/
|
||||
FontStyle*
|
||||
FontServer::GetStyle(uint16 familyID, uint16 styleID)
|
||||
FontManager::GetStyle(uint16 familyID, uint16 styleID)
|
||||
{
|
||||
FontFamily *family = GetFamily(familyID);
|
||||
if (family)
|
||||
@@ -384,7 +384,7 @@ FontServer::GetStyle(uint16 familyID, uint16 styleID)
|
||||
Do NOT delete this object. If you access it, make a copy of it.
|
||||
*/
|
||||
ServerFont*
|
||||
FontServer::GetSystemPlain()
|
||||
FontManager::GetSystemPlain()
|
||||
{
|
||||
return fPlain;
|
||||
}
|
||||
@@ -397,7 +397,7 @@ FontServer::GetSystemPlain()
|
||||
Do NOT delete this object. If you access it, make a copy of it.
|
||||
*/
|
||||
ServerFont*
|
||||
FontServer::GetSystemBold()
|
||||
FontManager::GetSystemBold()
|
||||
{
|
||||
return fBold;
|
||||
}
|
||||
@@ -410,7 +410,7 @@ FontServer::GetSystemBold()
|
||||
Do NOT delete this object. If you access it, make a copy of it.
|
||||
*/
|
||||
ServerFont*
|
||||
FontServer::GetSystemFixed()
|
||||
FontManager::GetSystemFixed()
|
||||
{
|
||||
return fFixed;
|
||||
}
|
||||
@@ -425,7 +425,7 @@ FontServer::GetSystemFixed()
|
||||
|
||||
*/
|
||||
bool
|
||||
FontServer::SetSystemPlain(const char* familyName, const char* styleName, float size)
|
||||
FontManager::SetSystemPlain(const char* familyName, const char* styleName, float size)
|
||||
{
|
||||
FontStyle *style = GetStyle(familyName, styleName);
|
||||
if (style == NULL)
|
||||
@@ -447,7 +447,7 @@ FontServer::SetSystemPlain(const char* familyName, const char* styleName, float
|
||||
|
||||
*/
|
||||
bool
|
||||
FontServer::SetSystemBold(const char* familyName, const char* styleName, float size)
|
||||
FontManager::SetSystemBold(const char* familyName, const char* styleName, float size)
|
||||
{
|
||||
FontStyle *style = GetStyle(familyName, styleName);
|
||||
if (style == NULL)
|
||||
@@ -469,7 +469,7 @@ FontServer::SetSystemBold(const char* familyName, const char* styleName, float s
|
||||
|
||||
*/
|
||||
bool
|
||||
FontServer::SetSystemFixed(const char* familyName, const char* styleName, float size)
|
||||
FontManager::SetSystemFixed(const char* familyName, const char* styleName, float size)
|
||||
{
|
||||
FontStyle *style = GetStyle(familyName, styleName);
|
||||
if (style == NULL)
|
||||
@@ -35,7 +35,7 @@ SharedLibrary libappserver.so :
|
||||
ServerBitmap.cpp
|
||||
ServerCursor.cpp
|
||||
ServerFont.cpp
|
||||
FontServer.cpp
|
||||
FontManager.cpp
|
||||
SystemPalette.cpp
|
||||
TokenHandler.cpp
|
||||
Utils.cpp
|
||||
|
||||
@@ -41,8 +41,8 @@ DrawData::DrawData()
|
||||
fLineJoinMode(B_BEVEL_JOIN),
|
||||
fMiterLimit(B_DEFAULT_MITER_LIMIT)
|
||||
{
|
||||
if (gFontServer && gFontServer->GetSystemPlain())
|
||||
fFont = *(gFontServer->GetSystemPlain());
|
||||
if (gFontManager && gFontManager->GetSystemPlain())
|
||||
fFont = *(gFontManager->GetSystemPlain());
|
||||
|
||||
fUnscaledFontSize = fFont.Size();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "Desktop.h"
|
||||
#include "DecorManager.h"
|
||||
#include "DisplayDriver.h"
|
||||
#include "FontServer.h"
|
||||
#include "FontManager.h"
|
||||
#include "HWInterface.h"
|
||||
#include "LayerData.h"
|
||||
#include "OffscreenServerWindow.h"
|
||||
@@ -1117,9 +1117,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
|
||||
// received when the client-side global font list has been
|
||||
// refreshed
|
||||
gFontServer->Lock();
|
||||
gFontServer->FontsUpdated();
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Lock();
|
||||
gFontManager->FontsUpdated();
|
||||
gFontManager->Unlock();
|
||||
break;
|
||||
}
|
||||
case AS_QUERY_FONTS_CHANGED:
|
||||
@@ -1131,9 +1131,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
bool checkonly;
|
||||
link.Read<bool>(&checkonly);
|
||||
|
||||
gFontServer->Lock();
|
||||
bool needsUpdate = gFontServer->FontsNeedUpdated();
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Lock();
|
||||
bool needsUpdate = gFontManager->FontsNeedUpdated();
|
||||
gFontManager->Unlock();
|
||||
|
||||
if(checkonly)
|
||||
{
|
||||
@@ -1144,9 +1144,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
{
|
||||
if(needsUpdate)
|
||||
{
|
||||
gFontServer->Lock();
|
||||
gFontServer->ScanSystemFolders();
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Lock();
|
||||
gFontManager->ScanSystemFolders();
|
||||
gFontManager->Unlock();
|
||||
fLink.StartMessage(SERVER_TRUE);
|
||||
fLink.Flush();
|
||||
}
|
||||
@@ -1170,9 +1170,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
int32 index;
|
||||
link.Read<int32>(&index);
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontFamily *family = gFontServer->GetFamilyByIndex(index);
|
||||
FontFamily *family = gFontManager->GetFamilyByIndex(index);
|
||||
if (family) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.AttachString(family->Name());
|
||||
@@ -1180,7 +1180,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1201,8 +1201,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
link.ReadString(family, sizeof(font_family));
|
||||
link.Read<int32>(&styleIndex);
|
||||
|
||||
gFontServer->Lock();
|
||||
FontStyle *fontStyle = gFontServer->GetStyleByIndex(family, styleIndex);
|
||||
gFontManager->Lock();
|
||||
FontStyle *fontStyle = gFontManager->GetStyleByIndex(family, styleIndex);
|
||||
if (fontStyle != NULL) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.AttachString(fontStyle->Name());
|
||||
@@ -1211,7 +1211,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1229,9 +1229,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
link.Read<uint16>(&familyID);
|
||||
link.Read<uint16>(&styleID);
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontStyle *fontStyle = gFontServer->GetStyle(familyID, styleID);
|
||||
FontStyle *fontStyle = gFontManager->GetStyle(familyID, styleID);
|
||||
if (fontStyle != NULL) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.AttachString(fontStyle->Family()->Name());
|
||||
@@ -1240,7 +1240,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
fLink.Flush();
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
break;
|
||||
}
|
||||
case AS_GET_FONT_DIRECTION:
|
||||
@@ -1257,9 +1257,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
link.Read<int32>(&familyID);
|
||||
link.Read<int32>(&styleID);
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontStyle *fontStyle = gFontServer->GetStyle(familyID, styleID);
|
||||
FontStyle *fontStyle = gFontManager->GetStyle(familyID, styleID);
|
||||
if (fontStyle) {
|
||||
font_direction direction = fontStyle->Direction();
|
||||
|
||||
@@ -1268,7 +1268,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1286,16 +1286,16 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
link.Read<int32>(&familyID);
|
||||
link.Read<int32>(&styleID);
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontStyle *fontStyle = gFontServer->GetStyle(familyID, styleID);
|
||||
FontStyle *fontStyle = gFontManager->GetStyle(familyID, styleID);
|
||||
if (fontStyle) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<uint16>((uint16)fontStyle->FileFormat());
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1394,16 +1394,16 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
link.Read<uint16>(&familyID);
|
||||
link.Read<uint16>(&styleID);
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontStyle *fontStyle = gFontServer->GetStyle(familyID, styleID);
|
||||
FontStyle *fontStyle = gFontManager->GetStyle(familyID, styleID);
|
||||
if (fontStyle != NULL) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<int32>(fontStyle->TunedCount());
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1437,16 +1437,16 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
link.Read<uint16>(&familyID);
|
||||
link.Read<uint16>(&styleID);
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontStyle *fontStyle = gFontServer->GetStyle(familyID, styleID);
|
||||
FontStyle *fontStyle = gFontManager->GetStyle(familyID, styleID);
|
||||
if (fontStyle != NULL) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<bool>(fontStyle->IsFixedWidth());
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1476,9 +1476,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
&& link.Read<uint16>(&styleID) == B_OK
|
||||
&& link.Read<uint16>(&face) == B_OK) {
|
||||
// get the font and return IDs and face
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontStyle *fontStyle = gFontServer->GetStyle(family, style,
|
||||
FontStyle *fontStyle = gFontManager->GetStyle(family, style,
|
||||
familyID, styleID, face);
|
||||
|
||||
if (fontStyle != NULL) {
|
||||
@@ -1493,7 +1493,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
} else
|
||||
fLink.StartMessage(B_NAME_NOT_FOUND);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
@@ -1506,13 +1506,13 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
// Returns:
|
||||
// 1) int32 - # of font families
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<int32>(gFontServer->CountFamilies());
|
||||
fLink.Attach<int32>(gFontManager->CountFamilies());
|
||||
fLink.Flush();
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
break;
|
||||
}
|
||||
case AS_COUNT_FONT_STYLES:
|
||||
@@ -1526,16 +1526,16 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
font_family familyName;
|
||||
link.ReadString(familyName, sizeof(font_family));
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontFamily *family = gFontServer->GetFamily(familyName);
|
||||
FontFamily *family = gFontManager->GetFamily(familyName);
|
||||
if (family != NULL) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<int32>(family->CountStyles());
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1551,18 +1551,18 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
// 4) uint16 - face flags
|
||||
// 5) uint32 - font flags
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
ServerFont *font = NULL;
|
||||
switch (code) {
|
||||
case AS_SET_SYSFONT_PLAIN:
|
||||
font = gFontServer->GetSystemPlain();
|
||||
font = gFontManager->GetSystemPlain();
|
||||
break;
|
||||
case AS_SET_SYSFONT_BOLD:
|
||||
font = gFontServer->GetSystemBold();
|
||||
font = gFontManager->GetSystemBold();
|
||||
break;
|
||||
case AS_SET_SYSFONT_FIXED:
|
||||
font = gFontServer->GetSystemFixed();
|
||||
font = gFontManager->GetSystemFixed();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1576,7 +1576,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
@@ -1593,16 +1593,16 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
link.Read<uint16>(&styleID);
|
||||
link.Read<float>(&size);
|
||||
|
||||
gFontServer->Lock();
|
||||
gFontManager->Lock();
|
||||
|
||||
FontStyle *fontStyle = gFontServer->GetStyle(familyID, styleID);
|
||||
FontStyle *fontStyle = gFontManager->GetStyle(familyID, styleID);
|
||||
if (fontStyle != NULL) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<font_height>(fontStyle->GetHeight(size));
|
||||
} else
|
||||
fLink.StartMessage(B_BAD_VALUE);
|
||||
|
||||
gFontServer->Unlock();
|
||||
gFontManager->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <UTF8.h>
|
||||
|
||||
#include "Angle.h"
|
||||
#include "FontServer.h"
|
||||
#include "FontManager.h"
|
||||
#include "moreUTF8.h"
|
||||
#include "truncate_string.h"
|
||||
|
||||
@@ -267,9 +267,9 @@ ServerFont::SetFamilyAndStyle(uint16 familyID, uint16 styleID)
|
||||
{
|
||||
FontStyle* style = NULL;
|
||||
|
||||
if (gFontServer->Lock()) {
|
||||
style = gFontServer->GetStyle(familyID, styleID);
|
||||
gFontServer->Unlock();
|
||||
if (gFontManager->Lock()) {
|
||||
style = gFontManager->GetStyle(familyID, styleID);
|
||||
gFontManager->Unlock();
|
||||
}
|
||||
|
||||
if (!style)
|
||||
|
||||
@@ -25,7 +25,7 @@ StaticLibrary libpainter.a :
|
||||
# font_support
|
||||
# is contained within libagg.a,
|
||||
# but we need a modified version that
|
||||
# uses the FontServer
|
||||
# uses the FontManager
|
||||
agg_font_freetype.cpp
|
||||
|
||||
AGGTextRenderer.cpp
|
||||
|
||||
@@ -89,8 +89,8 @@ Painter::Painter()
|
||||
fPatternHandler(new PatternHandler()),
|
||||
fTextRenderer(new AGGTextRenderer())
|
||||
{
|
||||
if (gFontServer && gFontServer->GetSystemPlain())
|
||||
fFont = *gFontServer->GetSystemPlain();
|
||||
if (gFontManager && gFontManager->GetSystemPlain())
|
||||
fFont = *gFontManager->GetSystemPlain();
|
||||
|
||||
_UpdateFont();
|
||||
_UpdateLineWidth();
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <Font.h>
|
||||
#include <Rect.h>
|
||||
#include <FontServer.h>
|
||||
#include <FontManager.h>
|
||||
#include <ServerFont.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <Bitmap.h>
|
||||
#include <ByteOrder.h>
|
||||
#include <Entry.h>
|
||||
#include <FontServer.h>
|
||||
#include <FontManager.h>
|
||||
#include <Message.h>
|
||||
#include <ServerFont.h>
|
||||
#include <UTF8.h>
|
||||
|
||||
Reference in New Issue
Block a user