Made scanning of all font folders a compile-time option
Moved the scanning of individual font folders to FontServer Implemented server-side code for update_font_families Removed ClientFontList from the build git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13938 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -39,6 +39,7 @@ public:
|
|||||||
int32 CountFamilies(void);
|
int32 CountFamilies(void);
|
||||||
int32 CountStyles(const char *family);
|
int32 CountStyles(const char *family);
|
||||||
void RemoveFamily(const char *family);
|
void RemoveFamily(const char *family);
|
||||||
|
void ScanSystemFolders(void);
|
||||||
status_t ScanDirectory(const char *path);
|
status_t ScanDirectory(const char *path);
|
||||||
void SaveList(void);
|
void SaveList(void);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ MergeObject <libbe>interface_kit.o :
|
|||||||
ChannelControl.cpp
|
ChannelControl.cpp
|
||||||
ChannelSlider.cpp
|
ChannelSlider.cpp
|
||||||
CheckBox.cpp
|
CheckBox.cpp
|
||||||
ClientFontList.cpp
|
|
||||||
ColorUtils.cc
|
ColorUtils.cc
|
||||||
ColorControl.cpp
|
ColorControl.cpp
|
||||||
Control.cpp
|
Control.cpp
|
||||||
|
|||||||
@@ -100,14 +100,7 @@ AppServer::AppServer()
|
|||||||
// Create the font server and scan the proper directories.
|
// Create the font server and scan the proper directories.
|
||||||
gFontServer = new FontServer;
|
gFontServer = new FontServer;
|
||||||
gFontServer->Lock();
|
gFontServer->Lock();
|
||||||
|
gFontServer->ScanSystemFolders();
|
||||||
// Used for testing purposes
|
|
||||||
|
|
||||||
// TODO: Re-enable scanning of all font directories when server is actually put to use
|
|
||||||
gFontServer->ScanDirectory("/boot/beos/etc/fonts/ttfonts/");
|
|
||||||
// gFontServer->ScanDirectory("/boot/beos/etc/fonts/PS-Type1/");
|
|
||||||
// gFontServer->ScanDirectory("/boot/home/config/fonts/ttfonts/");
|
|
||||||
// gFontServer->ScanDirectory("/boot/home/config/fonts/psfonts/");
|
|
||||||
gFontServer->SaveList();
|
gFontServer->SaveList();
|
||||||
|
|
||||||
if (!gFontServer->SetSystemPlain(DEFAULT_PLAIN_FONT_FAMILY,
|
if (!gFontServer->SetSystemPlain(DEFAULT_PLAIN_FONT_FAMILY,
|
||||||
@@ -327,14 +320,6 @@ AppServer::_DispatchMessage(int32 code, BPrivate::LinkReceiver& msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case AS_UPDATED_CLIENT_FONTLIST:
|
|
||||||
// received when the client-side global font list has been
|
|
||||||
// refreshed
|
|
||||||
gFontServer->Lock();
|
|
||||||
gFontServer->FontsUpdated();
|
|
||||||
gFontServer->Unlock();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AS_QUERY_FONTS_CHANGED:
|
case AS_QUERY_FONTS_CHANGED:
|
||||||
{
|
{
|
||||||
// Client application is asking if the font list has changed since
|
// Client application is asking if the font list has changed since
|
||||||
|
|||||||
@@ -181,6 +181,19 @@ FontServer::GetFamily(const char* name) const
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Scans the four default system font folders
|
||||||
|
void
|
||||||
|
FontServer::ScanSystemFolders(void)
|
||||||
|
{
|
||||||
|
ScanDirectory("/boot/beos/etc/fonts/ttfonts/");
|
||||||
|
|
||||||
|
// We don't scan these in test mode to help shave off some startup time
|
||||||
|
#if !TEST_MODE
|
||||||
|
ScanDirectory("/boot/beos/etc/fonts/PS-Type1/");
|
||||||
|
ScanDirectory("/boot/home/config/fonts/ttfonts/");
|
||||||
|
ScanDirectory("/boot/home/config/fonts/psfonts/");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Scan a folder for all valid fonts
|
\brief Scan a folder for all valid fonts
|
||||||
|
|||||||
@@ -1200,17 +1200,38 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
}
|
}
|
||||||
case AS_QUERY_FONTS_CHANGED:
|
case AS_QUERY_FONTS_CHANGED:
|
||||||
{
|
{
|
||||||
FTRACE(("ServerApp %s: AS_QUERY_FONTS_CHANGED unimplemented\n",
|
FTRACE(("ServerApp %s: AS_QUERY_FONTS_CHANGED\n",Signature()));
|
||||||
Signature()));
|
|
||||||
// Attached Data:
|
// Attached Data:
|
||||||
// 1) bool check flag
|
// 1) bool check flag
|
||||||
|
bool checkonly;
|
||||||
|
link.Read<bool>(&checkonly);
|
||||||
|
|
||||||
// if just checking, just give an answer,
|
gFontServer->Lock();
|
||||||
// if not and needs updated,
|
bool needsUpdate = gFontServer->FontsNeedUpdated();
|
||||||
// sync the font list and return true else return false
|
gFontServer->Unlock();
|
||||||
// TODO: actually do the above...
|
|
||||||
fLink.StartMessage(SERVER_FALSE);
|
if(checkonly)
|
||||||
fLink.Flush();
|
{
|
||||||
|
fLink.StartMessage(needsUpdate ? SERVER_TRUE : SERVER_FALSE);
|
||||||
|
fLink.Flush();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(needsUpdate)
|
||||||
|
{
|
||||||
|
gFontServer->Lock();
|
||||||
|
gFontServer->ScanSystemFolders();
|
||||||
|
gFontServer->Unlock();
|
||||||
|
fLink.StartMessage(SERVER_TRUE);
|
||||||
|
fLink.Flush();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fLink.StartMessage(SERVER_FALSE);
|
||||||
|
fLink.Flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_GET_FAMILY_NAME:
|
case AS_GET_FAMILY_NAME:
|
||||||
|
|||||||
Reference in New Issue
Block a user