From bff387f17a9c1ceed4dff21579d73bab21f7587b Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Fri, 21 Mar 2003 15:49:28 +0000 Subject: [PATCH] Set up sources to begin work on added BPicture support git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2979 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/Jamfile | 1 + src/servers/app/server/ServerApp.cpp | 30 +++++++++++++++++++++++- src/servers/app/server/ServerApp.h | 2 +- src/servers/app/server/ServerPicture.cpp | 27 +++++++++++++++++++++ src/servers/app/server/ServerPicture.h | 25 ++++++++++++++++++++ 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 src/servers/app/server/ServerPicture.cpp create mode 100644 src/servers/app/server/ServerPicture.h diff --git a/src/servers/app/server/Jamfile b/src/servers/app/server/Jamfile index 125d238284..5120ef465d 100644 --- a/src/servers/app/server/Jamfile +++ b/src/servers/app/server/Jamfile @@ -46,6 +46,7 @@ Server app_server : ScreenDriver.cpp ServerBitmap.cpp ServerCursor.cpp + ServerPicture.cpp ViewDriver.cpp WinBorder.cpp ; diff --git a/src/servers/app/server/ServerApp.cpp b/src/servers/app/server/ServerApp.cpp index f675458883..7ebd68fadc 100644 --- a/src/servers/app/server/ServerApp.cpp +++ b/src/servers/app/server/ServerApp.cpp @@ -41,11 +41,12 @@ #include "ServerWindow.h" #include "ServerCursor.h" #include "ServerBitmap.h" +#include "ServerPicture.h" #include "ServerConfig.h" #include "LayerData.h" #include "Utils.h" -#define DEBUG_SERVERAPP +//#define DEBUG_SERVERAPP /*! \brief Constructor @@ -80,6 +81,7 @@ ServerApp::ServerApp(port_id sendport, port_id rcvport, int32 handlerID, char *s _winlist=new BList(0); _bmplist=new BList(0); + _piclist=new BList(0); _isactive=false; ServerCursor *defaultc=cursormanager->GetCursor(B_CURSOR_DEFAULT); @@ -125,6 +127,16 @@ printf("ServerApp %s:~ServerApp()\n",_signature.String()); _bmplist->MakeEmpty(); delete _bmplist; + ServerPicture *temppic; + for(i=0;i<_piclist->CountItems();i++) + { + temppic=(ServerPicture*)_piclist->ItemAt(i); + if(temppic) + delete temppic; + } + _piclist->MakeEmpty(); + delete _piclist; + delete _applink; _applink=NULL; if(_appcursor) @@ -450,6 +462,22 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer) break; } + case AS_CREATE_PICTURE: + { + break; + } + case AS_DELETE_PICTURE: + { + break; + } + case AS_CLONE_PICTURE: + { + break; + } + case AS_DOWNLOAD_PICTURE: + { + break; + } case AS_SET_SCREEN_MODE: { // Attached data diff --git a/src/servers/app/server/ServerApp.h b/src/servers/app/server/ServerApp.h index 3e64f5389c..3872f41e1f 100644 --- a/src/servers/app/server/ServerApp.h +++ b/src/servers/app/server/ServerApp.h @@ -79,7 +79,7 @@ protected: thread_id _monitor_thread; team_id _target_id; PortLink *_applink; - BList *_winlist, *_bmplist; + BList *_winlist, *_bmplist, *_piclist; DisplayDriver *_driver; ServerCursor *_appcursor; sem_id _lock; diff --git a/src/servers/app/server/ServerPicture.cpp b/src/servers/app/server/ServerPicture.cpp new file mode 100644 index 0000000000..a1d3b793ad --- /dev/null +++ b/src/servers/app/server/ServerPicture.cpp @@ -0,0 +1,27 @@ +#include +#include "TokenHandler.h" +#include "ServerPicture.h" + +TokenHandler picture_token_handler; + +ServerPicture::ServerPicture(void) +{ + _token=picture_token_handler.GetToken(); + + _initialized=false; + + int8 *ptr; + _area=create_area("ServerPicture",(void**)&ptr,B_ANY_ADDRESS,B_PAGE_SIZE, + B_NO_LOCK,B_READ_AREA | B_WRITE_AREA); + + if(_area!=B_BAD_VALUE && _area!=B_NO_MEMORY && _area!=B_ERROR) + _initialized=true; + + arealink=(_initialized)?new AreaLink(_area):NULL; +} + +ServerPicture::~ServerPicture(void) +{ + if(arealink) + delete arealink; +} diff --git a/src/servers/app/server/ServerPicture.h b/src/servers/app/server/ServerPicture.h new file mode 100644 index 0000000000..f2c2b9184c --- /dev/null +++ b/src/servers/app/server/ServerPicture.h @@ -0,0 +1,25 @@ +#ifndef SERVER_PICTURE_H +#define SERVER_PICTURE_H + +#include + +class AreaLink; + +class ServerPicture +{ +public: + ServerPicture(void); + ~ServerPicture(void); + + bool InitCheck(void) { return _initialized; } + area_id Area(void) { return _area; } + int32 GetToken(void) { return _token; } +private: + + AreaLink *arealink; + bool _initialized; + area_id _area; + int32 _token; +}; + +#endif \ No newline at end of file