-Bring BeDecorator back at a compilable state

-Some updates to the DecoratorManager to try to make it working. The add-on is not identified properly but I can't find out why...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34749 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2009-12-22 21:06:58 +00:00
parent cfcee452a4
commit 4550f38949
6 changed files with 19 additions and 10 deletions
@@ -166,7 +166,8 @@ BeDecorator::SetLook(DesktopSettings& settings,
font.SetFlags(B_FORCE_ANTIALIASING); font.SetFlags(B_FORCE_ANTIALIASING);
font.SetSpacing(B_STRING_SPACING); font.SetSpacing(B_STRING_SPACING);
SetFont(&font); // TODO Make this work...
// SetFont(&font);
Decorator::SetLook(settings, look, updateRegion); Decorator::SetLook(settings, look, updateRegion);
_DoLayout(); _DoLayout();
@@ -639,8 +640,9 @@ BeDecorator::_DoLayout()
fMinTabSize += offset + size; fMinTabSize += offset + size;
// fMaxTabSize contains fMinWidth + the width required for the title // fMaxTabSize contains fMinWidth + the width required for the title
fMaxTabSize = fDrawingEngine ? ceilf(fDrawingEngine->StringWidth(Title(), strlen(Title()), // TODO : check what escapement_delta is supposed to do
&fDrawState)) : 0.0; fMaxTabSize = fDrawingEngine ? ceilf(fDrawingEngine->StringWidth(Title(), strlen(Title())/*,
&fDrawState*/)) : 0.0;
if (fMaxTabSize > 0.0) if (fMaxTabSize > 0.0)
fMaxTabSize += fTextOffset; fMaxTabSize += fTextOffset;
fMaxTabSize += fMinTabSize; fMaxTabSize += fMinTabSize;
@@ -985,7 +987,7 @@ BeDecorator::_DrawTitle(BRect r)
: fTabRect.bottom - fTextOffset; : fTabRect.bottom - fTextOffset;
} }
fDrawingEngine->DrawString(fTruncatedTitle.String(), fTruncatedTitleLength, titlePos, &fDrawState); fDrawingEngine->DrawString(fTruncatedTitle.String(), fTruncatedTitleLength, titlePos/*, &fDrawState*/);
} }
// _DrawZoom // _DrawZoom
@@ -12,6 +12,7 @@
#include "Decorator.h" #include "Decorator.h"
#include <Region.h> #include <Region.h>
#include "RGBColor.h"
class Desktop; class Desktop;
+3 -1
View File
@@ -3,9 +3,11 @@ SubDir HAIKU_TOP src add-ons decorators BeDecorator ;
UseFreeTypeHeaders ; UseFreeTypeHeaders ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app ] ; UseHeaders [ FDirName $(HAIKU_TOP) src servers app ] ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing ] ; UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing ] ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing Painter ] ;
UsePrivateHeaders app shared interface graphics ; UsePrivateHeaders app shared interface graphics ;
UseLibraryHeaders agg ;
Addon ClassicBe : Addon ClassicBe :
BeDecorator.cpp BeDecorator.cpp
: be <nogrist>app_server : be <nogrist>app_server $(TARGET_LIBSTDC++) $(TARGET_LIBSUPC++)
; ;
+3 -2
View File
@@ -1,10 +1,11 @@
SubDir HAIKU_TOP src add-ons decorators MacDecorator ; SubDir HAIKU_TOP src add-ons decorators MacDecorator ;
UseFreeTypeHeaders ; UseFreeTypeHeaders ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app server ] ; UseHeaders [ FDirName $(HAIKU_TOP) src servers app ] ;
UsePrivateHeaders [ FDirName servers app ] ; UsePrivateHeaders [ FDirName servers app ] ;
Addon MacDecorator : Addon MacDecorator :
MacDecorator.cpp MacDecorator.cpp
: be libappserver.so : be <nogrist>app_server
# libappserver.so
; ;
+1 -1
View File
@@ -1,7 +1,7 @@
SubDir HAIKU_TOP src add-ons decorators WinDecorator ; SubDir HAIKU_TOP src add-ons decorators WinDecorator ;
UseFreeTypeHeaders ; UseFreeTypeHeaders ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app server ] ; UseHeaders [ FDirName $(HAIKU_TOP) src servers app ] ;
UsePrivateHeaders [ FDirName servers app ] ; UsePrivateHeaders [ FDirName servers app ] ;
Addon WinDecorator : Addon WinDecorator :
+5 -2
View File
@@ -13,6 +13,8 @@
#include <Path.h> #include <Path.h>
#include <Rect.h> #include <Rect.h>
#include <syslog.h>
#include "AppServer.h" #include "AppServer.h"
#include "DefaultDecorator.h" #include "DefaultDecorator.h"
#include "Desktop.h" #include "Desktop.h"
@@ -115,9 +117,9 @@ DecorManager::DecorManager()
DecorInfo *defaultDecor = new DecorInfo(-1, "Default", NULL); DecorInfo *defaultDecor = new DecorInfo(-1, "Default", NULL);
fDecorList.AddItem(defaultDecor); fDecorList.AddItem(defaultDecor);
#if 0
// Add any on disk // Add any on disk
RescanDecorators(); RescanDecorators();
#if 0
// Find out which one should be the active one // Find out which one should be the active one
BDirectory dir; BDirectory dir;
@@ -171,7 +173,7 @@ DecorManager::RescanDecorators()
continue; continue;
image_id image = load_add_on(path.Path()); image_id image = load_add_on(path.Path());
if (image != B_OK) if (image < 0)
continue; continue;
// As of now, we do nothing with decorator versions, but the possibility // As of now, we do nothing with decorator versions, but the possibility
@@ -182,6 +184,7 @@ DecorManager::RescanDecorators()
create_decorator* createFunc; create_decorator* createFunc;
// Get the instantiation function // Get the instantiation function
// TODO : this is not working for some reason
status_t status = get_image_symbol(image, "instantiate_decorator", status_t status = get_image_symbol(image, "instantiate_decorator",
B_SYMBOL_TYPE_TEXT, (void**)&createFunc); B_SYMBOL_TYPE_TEXT, (void**)&createFunc);
if (status != B_OK) { if (status != B_OK) {