2010-05-07 04:47:10 -05:00
|
|
|
/*
|
2011-12-03 16:38:03 -06:00
|
|
|
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
|
2021-06-12 21:42:10 -05:00
|
|
|
* Copyright 2014, Funky Idea Software
|
|
|
|
* Copyright 2021, Jaidyn Levesque
|
2010-05-07 04:47:10 -05:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _CAYA_UTILS_H
|
|
|
|
#define _CAYA_UTILS_H
|
|
|
|
|
|
|
|
#include <image.h>
|
2010-05-08 11:21:36 -05:00
|
|
|
|
2021-06-04 13:57:04 -05:00
|
|
|
#include <GraphicsDefs.h>
|
2010-05-07 04:47:10 -05:00
|
|
|
#include <Mime.h>
|
2010-05-09 03:23:53 -05:00
|
|
|
#include <Resources.h>
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
#include "CayaConstants.h"
|
|
|
|
|
|
|
|
const char* CayaStatusToString(CayaStatus status);
|
2010-05-09 04:38:30 -05:00
|
|
|
|
2010-05-09 03:23:53 -05:00
|
|
|
BResources* CayaResources();
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2010-05-09 04:38:30 -05:00
|
|
|
const char* CayaAccountsPath();
|
|
|
|
const char* CayaAccountPath(const char* signature);
|
Allow multiple protocols per add-on
Now an add-on can contain multiple protocols, and the protocol API has
changed. An add-on must now export protocol_count() and protocol_at(),
with the latter replacing protocol(). protocol_count() returning the
amount of protocols in a given add-on, and protocol_at(i) giving a
new CayaProtocol* "at" the given index.
CayaProtocol has also been changed, adding Signature(),
FriendlySignature(), Icon(), Path(), and SetPath(). The reasoning is
that different protocols (even within a single add-on) will have
different signatures and icons, so this data should be accessible from
the protocol itself.
CayaProtocolAddOn now has CountProtocols() and ProtocolAt(i), allowing
the accessing of multiple protocols. A CayaProtocolAddOn can be given a
default protocol index in the constructor, whose protocol will be
returned with Protocol(). Version() was also moved from CayaProtocol to
CayaProtocolAddOn.
2021-05-21 13:33:43 -05:00
|
|
|
const char* CayaAccountPath(const char* signature, const char* subsignature);
|
2010-05-09 04:38:30 -05:00
|
|
|
|
2021-05-24 14:20:57 -05:00
|
|
|
const char* CayaCachePath();
|
2021-06-12 21:42:10 -05:00
|
|
|
const char* CayaAccountCachePath(const char* accountName);
|
|
|
|
const char* CayaRoomsCachePath(const char* accountName);
|
|
|
|
const char* CayaRoomCachePath(const char* accountName, const char* roomIdentifier);
|
2021-05-24 14:20:57 -05:00
|
|
|
|
2021-06-04 13:57:04 -05:00
|
|
|
rgb_color CayaTintColor(rgb_color color, int severity);
|
2021-06-07 00:56:26 -05:00
|
|
|
rgb_color CayaForegroundColor(rgb_color background);
|
2021-06-04 13:57:04 -05:00
|
|
|
|
2021-06-06 12:02:26 -05:00
|
|
|
// Borrowed from BePodder's own libfunky
|
|
|
|
status_t ReadAttributeData(BNode* node, const char* name, char** buffer, int32 *size);
|
|
|
|
status_t WriteAttributeMessage(BNode* node, const char* name, BMessage* data);
|
|
|
|
status_t ReadAttributeMessage(BNode* node, const char* name, BMessage* data);
|
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
extern "C" status_t our_image(image_info& image);
|
|
|
|
|
2021-06-04 13:57:04 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
#endif // _CAYA_UTILS_H
|
2021-06-04 13:57:04 -05:00
|
|
|
|