mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-10 01:55:19 -04:00
Addition of two more Services / Applications.
(1) A PhotoService / Dialog to share slideshows. (2) A Network View service, derived from p3disc for a graphical view of peers. Both of these need a little help to get them fully functional. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@375 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3ed1eef186
commit
08860b25e6
28 changed files with 3297 additions and 235 deletions
|
@ -9,14 +9,16 @@ include $(RS_TOP_DIR)/scripts/config.mk
|
|||
|
||||
RSOBJ = p3peers.o \
|
||||
p3rank.o \
|
||||
p3photo.o \
|
||||
p3msgs.o \
|
||||
p3discovery.o \
|
||||
p3face-file.o \
|
||||
p3face-server.o \
|
||||
p3face-config.o \
|
||||
p3face-startup.o \
|
||||
p3face-msgs.o \
|
||||
rstypes.o \
|
||||
rsiface.o \
|
||||
p3face-msgs.o
|
||||
rsiface.o
|
||||
|
||||
# pqistrings.o \
|
||||
# p3face-people.o
|
||||
|
|
40
libretroshare/src/rsserver/p3discovery.cc
Normal file
40
libretroshare/src/rsserver/p3discovery.cc
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* libretroshare/src/rsserver: p3discovery.cc
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
* Copyright 2008-2008 by Robert Fernie.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rsserver/p3discovery.h"
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
RsDisc *rsDisc = NULL;
|
||||
|
||||
bool p3Discovery::getDiscFriends(std::string id, std::list<std::string> &friends)
|
||||
{
|
||||
if (mDisc)
|
||||
{
|
||||
return mDisc->potentialproxies(id, friends);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
48
libretroshare/src/rsserver/p3discovery.h
Normal file
48
libretroshare/src/rsserver/p3discovery.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
#ifndef RETROSHARE_P3_DISC_INTERFACE_H
|
||||
#define RETROSHARE_P3_DISC_INTERFACE_H
|
||||
|
||||
/*
|
||||
* libretroshare/src/rsserver: p3discovery.h
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
* Copyright 2008-2008 by Robert Fernie.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rsiface/rsdisc.h"
|
||||
#include "services/p3disc.h"
|
||||
|
||||
class p3Discovery: public RsDisc
|
||||
{
|
||||
public:
|
||||
|
||||
p3Discovery(p3disc *disc)
|
||||
:mDisc(disc) { return; }
|
||||
virtual ~p3Discovery() { return; }
|
||||
|
||||
virtual bool getDiscFriends(std::string id, std::list<std::string> &friends);
|
||||
|
||||
private:
|
||||
|
||||
p3disc *mDisc;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -47,6 +47,7 @@
|
|||
#include "services/p3chatservice.h"
|
||||
#include "services/p3gamelauncher.h"
|
||||
#include "services/p3ranking.h"
|
||||
#include "services/p3photoservice.h"
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
@ -55,10 +56,13 @@
|
|||
// for blocking signals
|
||||
#include <signal.h>
|
||||
|
||||
/* Implemented Rs Interfaces */
|
||||
#include "rsserver/p3face.h"
|
||||
#include "rsserver/p3peers.h"
|
||||
#include "rsserver/p3rank.h"
|
||||
#include "rsserver/p3msgs.h"
|
||||
#include "rsserver/p3discovery.h"
|
||||
#include "rsserver/p3photo.h"
|
||||
#include "rsiface/rsgame.h"
|
||||
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
|
@ -522,6 +526,13 @@ int RsServer::StartupRetroShare(RsInit *config)
|
|||
CachePair cp(mRanking, mRanking, CacheId(RS_SERVICE_TYPE_RANK, 0));
|
||||
mCacheStrapper -> addCachePair(cp);
|
||||
|
||||
p3PhotoService *photoService = new p3PhotoService(RS_SERVICE_TYPE_PHOTO,
|
||||
mCacheStrapper, mCacheTransfer,
|
||||
localcachedir, remotecachedir);
|
||||
|
||||
CachePair cp2(photoService, photoService, CacheId(RS_SERVICE_TYPE_PHOTO, 0));
|
||||
mCacheStrapper -> addCachePair(cp2);
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
mConnMgr->setDhtMgr(mDhtMgr);
|
||||
|
@ -661,6 +672,8 @@ int RsServer::StartupRetroShare(RsInit *config)
|
|||
rsGameLauncher = gameLauncher;
|
||||
rsRanks = new p3Rank(mRanking);
|
||||
rsMsgs = new p3Msgs(mAuthMgr, msgSrv, chatSrv);
|
||||
rsDisc = new p3Discovery(ad);
|
||||
rsPhoto = new p3Photo(photoService);
|
||||
|
||||
/* put a welcome message in! */
|
||||
if (config->firsttime_run)
|
||||
|
|
137
libretroshare/src/rsserver/p3photo.cc
Normal file
137
libretroshare/src/rsserver/p3photo.cc
Normal file
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
* libretroshare/src/rsserver: p3photo.cc
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
* Copyright 2007-2008 by Robert Fernie.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rsserver/p3photo.h"
|
||||
#include "services/p3photoservice.h"
|
||||
|
||||
RsPhoto *rsPhoto = NULL;
|
||||
|
||||
|
||||
RsPhotoDetails::RsPhotoDetails()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RsPhotoShowDetails::RsPhotoShowDetails()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
p3Photo::p3Photo(p3PhotoService *p3ps)
|
||||
:mPhoto(p3ps)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
p3Photo::~p3Photo()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* access data */
|
||||
bool p3Photo::getPhotoList(std::string id, std::list<std::string> hashs)
|
||||
{
|
||||
return mPhoto->getPhotoList(id, hashs);
|
||||
}
|
||||
|
||||
bool p3Photo::getShowList(std::string id, std::list<std::string> showIds)
|
||||
{
|
||||
return mPhoto -> getShowList(id, showIds);
|
||||
}
|
||||
|
||||
|
||||
bool p3Photo::getShowDetails(std::string id, std::string showId, RsPhotoShowDetails &detail)
|
||||
{
|
||||
return mPhoto -> getShowDetails(id, showId, detail);
|
||||
}
|
||||
|
||||
|
||||
bool p3Photo::getPhotoDetails(std::string id, std::string photoId, RsPhotoDetails &detail)
|
||||
{
|
||||
return mPhoto -> getPhotoDetails(id, photoId, detail);
|
||||
}
|
||||
|
||||
|
||||
/* add / delete */
|
||||
std::string p3Photo::createShow(std::string name)
|
||||
{
|
||||
return mPhoto -> createShow(name);
|
||||
}
|
||||
|
||||
bool p3Photo::deleteShow(std::string showId)
|
||||
{
|
||||
return mPhoto -> deleteShow(showId);
|
||||
}
|
||||
|
||||
bool p3Photo::addPhotoToShow(std::string showId, std::string photoId, int16_t index)
|
||||
{
|
||||
return mPhoto -> addPhotoToShow(showId, photoId, index);
|
||||
}
|
||||
|
||||
bool p3Photo::movePhotoInShow(std::string showId, std::string photoId, int16_t index)
|
||||
{
|
||||
return mPhoto -> movePhotoInShow(showId, photoId, index);
|
||||
}
|
||||
|
||||
bool p3Photo::removePhotoFromShow(std::string showId, std::string photoId)
|
||||
{
|
||||
return mPhoto -> removePhotoFromShow(showId, photoId);
|
||||
}
|
||||
|
||||
|
||||
std::string p3Photo::addPhoto(std::string path) /* add from file */
|
||||
{
|
||||
return mPhoto -> addPhoto(path); /* add from file */
|
||||
}
|
||||
|
||||
bool p3Photo::addPhoto(std::string srcId, std::string photoId) /* add from peers photos */
|
||||
{
|
||||
return mPhoto -> addPhoto(srcId, photoId); /* add from peers photos */
|
||||
|
||||
}
|
||||
|
||||
bool p3Photo::deletePhoto(std::string photoId)
|
||||
{
|
||||
return mPhoto -> deletePhoto(photoId);
|
||||
}
|
||||
|
||||
|
||||
/* modify properties (TODO) */
|
||||
bool p3Photo::modifyShow(std::string showId, std::wstring name, std::wstring comment)
|
||||
{
|
||||
return mPhoto -> modifyShow(showId, name, comment);
|
||||
}
|
||||
|
||||
bool p3Photo::modifyPhoto(std::string photoId, std::wstring name, std::wstring comment)
|
||||
{
|
||||
return mPhoto -> modifyPhoto(photoId, name, comment);
|
||||
}
|
||||
|
||||
bool p3Photo::modifyShowComment(std::string showId, std::string photoId, std::wstring comment)
|
||||
{
|
||||
return mPhoto -> modifyShowComment(showId, photoId, comment);
|
||||
}
|
||||
|
||||
|
66
libretroshare/src/rsserver/p3photo.h
Normal file
66
libretroshare/src/rsserver/p3photo.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
#ifndef RETROSHARE_P3_PHOTO_INTERFACE_H
|
||||
#define RETROSHARE_P3_PHOTO_INTERFACE_H
|
||||
|
||||
/*
|
||||
* libretroshare/src/rsserver: p3photo.h
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
* Copyright 2007-2008 by Robert Fernie.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rsiface/rsphoto.h"
|
||||
#include "services/p3photoservice.h"
|
||||
|
||||
class p3Photo: public RsPhoto
|
||||
{
|
||||
public:
|
||||
|
||||
p3Photo(p3PhotoService *p3ps);
|
||||
virtual ~p3Photo();
|
||||
|
||||
/* access data */
|
||||
virtual bool getPhotoList(std::string id, std::list<std::string> hashs);
|
||||
virtual bool getShowList(std::string id, std::list<std::string> showIds);
|
||||
virtual bool getShowDetails(std::string id, std::string showId, RsPhotoShowDetails &detail);
|
||||
virtual bool getPhotoDetails(std::string id, std::string photoId, RsPhotoDetails &detail);
|
||||
|
||||
/* add / delete */
|
||||
virtual std::string createShow(std::string name);
|
||||
virtual bool deleteShow(std::string showId);
|
||||
virtual bool addPhotoToShow(std::string showId, std::string photoId, int16_t index);
|
||||
virtual bool movePhotoInShow(std::string showId, std::string photoId, int16_t index);
|
||||
virtual bool removePhotoFromShow(std::string showId, std::string photoId);
|
||||
|
||||
virtual std::string addPhoto(std::string path); /* add from file */
|
||||
virtual bool addPhoto(std::string srcId, std::string photoId); /* add from peers photos */
|
||||
virtual bool deletePhoto(std::string photoId);
|
||||
|
||||
/* modify properties (TODO) */
|
||||
virtual bool modifyShow(std::string showId, std::wstring name, std::wstring comment);
|
||||
virtual bool modifyPhoto(std::string photoId, std::wstring name, std::wstring comment);
|
||||
virtual bool modifyShowComment(std::string showId, std::string photoId, std::wstring comment);
|
||||
|
||||
private:
|
||||
|
||||
p3PhotoService *mPhoto;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue