From e37155c67037f35d73ab9329f2ebebb9334b1d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 7 Nov 2005 16:19:40 +0000 Subject: [PATCH] * The font list is now cached client-side. The app_server is only queried for updates. * Optimized retrieving the font list from the server. * This greatly simplifies the app_server communication for getting the font list as well - there are now only 2 commands instead of 6. * Moved extra font flags creation from ServerApp to FontStyle::Flags(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14751 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/ServerProtocol.h | 8 +- src/kits/interface/Font.cpp | 354 ++++++++++++++----- src/servers/app/AppServer.cpp | 24 -- src/servers/app/FontFamily.cpp | 16 +- src/servers/app/FontManager.cpp | 19 + src/servers/app/ServerApp.cpp | 139 ++------ src/tests/apps/fake_app_server/AppServer.cpp | 9 +- 7 files changed, 329 insertions(+), 240 deletions(-) diff --git a/headers/private/app/ServerProtocol.h b/headers/private/app/ServerProtocol.h index 2beb9eca84..f0cc9ea443 100644 --- a/headers/private/app/ServerProtocol.h +++ b/headers/private/app/ServerProtocol.h @@ -115,12 +115,8 @@ enum { AS_SET_SYSTEM_FONT, AS_GET_SYSTEM_FONTS, - AS_QUERY_FONTS_CHANGED, - AS_UPDATED_CLIENT_FONTLIST, - AS_GET_FAMILY_NAME, - AS_GET_STYLE_NAME, - AS_COUNT_FONT_FAMILIES, - AS_COUNT_FONT_STYLES, + AS_GET_FONT_LIST_REVISION, + AS_GET_FAMILY_AND_STYLES, AS_GET_FAMILY_AND_STYLE, AS_GET_FAMILY_AND_STYLE_IDS, diff --git a/src/kits/interface/Font.cpp b/src/kits/interface/Font.cpp index 562ba174fd..71ecd51d99 100644 --- a/src/kits/interface/Font.cpp +++ b/src/kits/interface/Font.cpp @@ -9,11 +9,14 @@ */ +#include + #include #include -#include +#include #include +#include #include #include #include @@ -21,9 +24,11 @@ #include #include +#include #include #include #include +#include const float kUninitializedAscent = INFINITY; @@ -39,6 +44,261 @@ const BFont *be_bold_font = &sBoldFont; const BFont *be_fixed_font = &sFixedFont; +struct style { + BString name; + uint16 face; + uint32 flags; +}; + +struct family { + BString name; + uint32 flags; + BObjectList