Automatic style cleanup with the astyle program.
This commit is contained in:
parent
082f2ad34e
commit
a651de0f53
|
@ -10,183 +10,153 @@
|
|||
#include "SmileTextRender.h"
|
||||
|
||||
//tmp
|
||||
BMessage* faces=NULL;
|
||||
bool valid=false;
|
||||
bool fname=false;
|
||||
bool svg=false;
|
||||
bool size=true;
|
||||
BMessage* faces = NULL;
|
||||
bool valid = false;
|
||||
bool fname = false;
|
||||
bool svg = false;
|
||||
bool size = true;
|
||||
BString filename;
|
||||
BString face;
|
||||
BPath path;
|
||||
BString gCharacters;
|
||||
|
||||
Emoconfig::Emoconfig(const char* xmlfile):BMessage()
|
||||
Emoconfig::Emoconfig(const char* xmlfile): BMessage()
|
||||
{
|
||||
fEmoticonSize = 16.0; //default
|
||||
numfaces=0;
|
||||
|
||||
numfaces = 0;
|
||||
|
||||
fParser = XML_ParserCreate(NULL);
|
||||
|
||||
XML_SetUserData(fParser, this);
|
||||
XML_SetElementHandler(fParser, StartElement, EndElement);
|
||||
XML_SetCharacterDataHandler(fParser, Characters);
|
||||
|
||||
|
||||
//path!
|
||||
BPath p(xmlfile);
|
||||
p.GetParent(&path);
|
||||
|
||||
|
||||
// loading the config file..
|
||||
BFile* settings=new BFile(xmlfile,B_READ_ONLY);
|
||||
BFile* settings = new BFile(xmlfile, B_READ_ONLY);
|
||||
off_t size;
|
||||
settings->GetSize(&size);
|
||||
if(size)
|
||||
{
|
||||
void *buffer=malloc(size);
|
||||
size=settings->Read(buffer,size);
|
||||
if (size) {
|
||||
void* buffer = malloc(size);
|
||||
size = settings->Read(buffer, size);
|
||||
XML_Parse(fParser, (const char*)buffer, size, true);
|
||||
free(buffer);
|
||||
}
|
||||
delete settings;
|
||||
|
||||
if(fParser)
|
||||
|
||||
if (fParser)
|
||||
XML_ParserFree(fParser);
|
||||
|
||||
|
||||
printf("Emoconfig: loaded %d faces\n", numfaces);
|
||||
|
||||
}
|
||||
|
||||
Emoconfig::~Emoconfig()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
Emoconfig::StartElement(void * /*pUserData*/, const char * pName, const char ** /*pAttr*/)
|
||||
void
|
||||
Emoconfig::StartElement(void * /*pUserData*/, const char* pName, const char** /*pAttr*/)
|
||||
{
|
||||
//printf("StartElement %s\n",pName);
|
||||
BString name(pName);
|
||||
if(name.ICompare("emoticon")==0)
|
||||
{
|
||||
faces=new BMessage();
|
||||
svg=false;
|
||||
}
|
||||
else
|
||||
if(name.ICompare("text")==0 && faces)
|
||||
{
|
||||
valid=true;
|
||||
}
|
||||
else
|
||||
if(name.ICompare("file")==0 && faces)
|
||||
{
|
||||
fname=true;
|
||||
} else
|
||||
if(name.ICompare("svg")==0 && faces)
|
||||
{
|
||||
// printf("File is SVG\n");
|
||||
svg=true;
|
||||
} else
|
||||
if(name.ICompare("size")==0)
|
||||
{
|
||||
size=true;
|
||||
if (name.ICompare("emoticon") == 0) {
|
||||
faces = new BMessage();
|
||||
svg = false;
|
||||
} else if (name.ICompare("text") == 0 && faces) {
|
||||
valid = true;
|
||||
} else if (name.ICompare("file") == 0 && faces) {
|
||||
fname = true;
|
||||
} else if (name.ICompare("svg") == 0 && faces) {
|
||||
// printf("File is SVG\n");
|
||||
svg = true;
|
||||
} else if (name.ICompare("size") == 0) {
|
||||
size = true;
|
||||
gCharacters = "";
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Emoconfig::EndElement(void * pUserData, const char * pName)
|
||||
void
|
||||
Emoconfig::EndElement(void* pUserData, const char* pName)
|
||||
{
|
||||
//printf("EndElement %s\n",pName);
|
||||
BString name(pName);
|
||||
|
||||
if(name.ICompare("emoticon")==0 && faces)
|
||||
{
|
||||
|
||||
if (name.ICompare("emoticon") == 0 && faces) {
|
||||
//faces->PrintToStream(); //debug
|
||||
delete faces;
|
||||
faces=NULL;
|
||||
|
||||
}
|
||||
else
|
||||
if(name.ICompare("text")==0 && faces)
|
||||
{
|
||||
valid=false;
|
||||
faces->AddString("face",face);
|
||||
faces = NULL;
|
||||
|
||||
} else if (name.ICompare("text") == 0 && faces) {
|
||||
valid = false;
|
||||
faces->AddString("face", face);
|
||||
//printf("to ]%s[\n",face.String());
|
||||
face.SetTo("");
|
||||
|
||||
}
|
||||
else
|
||||
if(name.ICompare("file")==0 && faces)
|
||||
{
|
||||
|
||||
} else if (name.ICompare("file") == 0 && faces) {
|
||||
//load file
|
||||
|
||||
|
||||
//compose the filename
|
||||
BPath p(path);
|
||||
p.Append(filename.String());
|
||||
BBitmap *icons = NULL;
|
||||
|
||||
if ( !svg )
|
||||
{ //
|
||||
icons=BTranslationUtils::GetBitmap(p.Path());
|
||||
BBitmap* icons = NULL;
|
||||
|
||||
if ( !svg ) {
|
||||
//
|
||||
icons = BTranslationUtils::GetBitmap(p.Path());
|
||||
}
|
||||
|
||||
|
||||
//assign to faces;
|
||||
fname=false;
|
||||
|
||||
// printf("Filename %s [%s]\n",p.Path(),path.Path());
|
||||
if(!icons) return;
|
||||
|
||||
int i=0;
|
||||
fname = false;
|
||||
|
||||
// printf("Filename %s [%s]\n",p.Path(),path.Path());
|
||||
if (!icons) return;
|
||||
|
||||
int i = 0;
|
||||
BString s;
|
||||
while(faces->FindString("face",i,&s)==B_OK)
|
||||
{
|
||||
|
||||
if(i==0)
|
||||
{
|
||||
((Emoconfig*)pUserData)->menu.AddPointer(s.String(),(const void*)icons);
|
||||
((Emoconfig*)pUserData)->menu.AddString("face",s.String());
|
||||
while (faces->FindString("face", i, &s) == B_OK) {
|
||||
|
||||
if (i == 0) {
|
||||
((Emoconfig*)pUserData)->menu.AddPointer(s.String(), (const void*)icons);
|
||||
((Emoconfig*)pUserData)->menu.AddString("face", s.String());
|
||||
}
|
||||
((BMessage*)pUserData)->AddPointer(s.String(),(const void*)icons);
|
||||
((BMessage*)pUserData)->AddString("face",s.String());
|
||||
((BMessage*)pUserData)->AddPointer(s.String(), (const void*)icons);
|
||||
((BMessage*)pUserData)->AddString("face", s.String());
|
||||
((Emoconfig*)pUserData)->numfaces++;
|
||||
i++;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else
|
||||
if(name.ICompare("size")==0)
|
||||
{
|
||||
if ( size )
|
||||
{
|
||||
|
||||
|
||||
} else if (name.ICompare("size") == 0) {
|
||||
if ( size ) {
|
||||
((Emoconfig*)pUserData)->fEmoticonSize = atoi(gCharacters.String());
|
||||
}
|
||||
|
||||
|
||||
size = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
Emoconfig::Characters(void * /*pUserData*/, const char * pString, int pLen)
|
||||
void
|
||||
Emoconfig::Characters(void * /*pUserData*/, const char* pString, int pLen)
|
||||
{
|
||||
BString f(pString,pLen);
|
||||
BString f(pString, pLen);
|
||||
//printf("Characters %s\n",f.String());
|
||||
if(faces && valid)
|
||||
{
|
||||
if (faces && valid) {
|
||||
f.RemoveAll(" ");
|
||||
f.RemoveAll("\"");
|
||||
if(f.Length()>0)
|
||||
face.Append(f);
|
||||
}
|
||||
else
|
||||
if(fname)
|
||||
{
|
||||
if (f.Length() > 0)
|
||||
face.Append(f);
|
||||
} else if (fname) {
|
||||
f.RemoveAll(" ");
|
||||
filename=f;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = f;
|
||||
|
||||
} else {
|
||||
gCharacters.Append(f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,23 +8,25 @@
|
|||
|
||||
class Emoconfig : public BMessage
|
||||
{
|
||||
public:
|
||||
Emoconfig(const char* xmlfile);
|
||||
~Emoconfig();
|
||||
int numfaces;
|
||||
BMessage menu;
|
||||
|
||||
float GetEmoticonSize() { return fEmoticonSize; }
|
||||
|
||||
private:
|
||||
public:
|
||||
Emoconfig(const char* xmlfile);
|
||||
~Emoconfig();
|
||||
int numfaces;
|
||||
BMessage menu;
|
||||
|
||||
float fEmoticonSize;
|
||||
XML_Parser fParser;
|
||||
float GetEmoticonSize() {
|
||||
return fEmoticonSize;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
float fEmoticonSize;
|
||||
XML_Parser fParser;
|
||||
|
||||
static void StartElement(void* pUserData, const char* pName, const char** pAttr);
|
||||
static void EndElement(void* pUserData, const char* pName);
|
||||
static void Characters(void* pUserData, const char* pString, int pLen);
|
||||
|
||||
static void StartElement(void * pUserData, const char * pName, const char ** pAttr);
|
||||
static void EndElement(void * pUserData, const char * pName);
|
||||
static void Characters(void * pUserData, const char * pString, int pLen);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,7 +12,7 @@ Emoticor::Get()
|
|||
{
|
||||
if (fInstance == NULL)
|
||||
fInstance = new Emoticor();
|
||||
|
||||
|
||||
return fInstance;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ Emoticor::~Emoticor()
|
|||
delete fConfig;
|
||||
}
|
||||
|
||||
Emoconfig*
|
||||
Emoconfig*
|
||||
Emoticor::Config()
|
||||
{
|
||||
return fConfig;
|
||||
|
@ -41,76 +41,71 @@ Emoticor::LoadConfig(const char* txt)
|
|||
}
|
||||
|
||||
void
|
||||
Emoticor::_findTokens(RunView *fTextView,BString text,int tokenstart, int16 cols ,int16 font ,int16 cols2 ,int16 font2)
|
||||
Emoticor::_findTokens(RunView* fTextView, BString text, int tokenstart, int16 cols , int16 font , int16 cols2 , int16 font2)
|
||||
{
|
||||
//******************************************
|
||||
// "Iteration is human, recursion is divine"
|
||||
//******************************************
|
||||
|
||||
|
||||
|
||||
|
||||
int32 newindex = 0;
|
||||
BString cur;
|
||||
int i = tokenstart;
|
||||
|
||||
if (fConfig != NULL)
|
||||
{
|
||||
while(fConfig->FindString("face",i,&cur)==B_OK)
|
||||
//for(int i=tokenstart;i<config->numfaces;i++)
|
||||
|
||||
if (fConfig != NULL) {
|
||||
while (fConfig->FindString("face", i, &cur) == B_OK)
|
||||
//for(int i=tokenstart;i<config->numfaces;i++)
|
||||
{
|
||||
i++;
|
||||
i++;
|
||||
//if(config->FindString("face",i,&cur)!=B_OK) return;
|
||||
|
||||
newindex=0;
|
||||
|
||||
while(true)
|
||||
{
|
||||
newindex=text.IFindFirst(cur.String(),0);
|
||||
//printf("Try %d %s -- match %d\n",i,cur->original.String(),newindex);
|
||||
|
||||
if(newindex!=B_ERROR)
|
||||
{
|
||||
//take a walk on the left side ;)
|
||||
|
||||
//printf("Found at %ld \n",newindex);
|
||||
|
||||
if(newindex-1>=0)
|
||||
{
|
||||
BString left;
|
||||
text.CopyInto(left,0,newindex);
|
||||
//printf("ready to recourse! [%s]\n",left.String());
|
||||
_findTokens(fTextView,left,tokenstart+1,cols,font,cols2,font2);
|
||||
}
|
||||
|
||||
|
||||
text.Remove(0,newindex+cur.Length());
|
||||
|
||||
//printf("remaning [%s] printed [%s]\n",text.String(),cur->original.String());
|
||||
|
||||
fTextView->Append(cur.String(),cols2,cols2,font2);
|
||||
|
||||
if(text.Length()==0) return; //useless stack
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
|
||||
newindex = 0;
|
||||
|
||||
while (true) {
|
||||
newindex = text.IFindFirst(cur.String(), 0);
|
||||
//printf("Try %d %s -- match %d\n",i,cur->original.String(),newindex);
|
||||
|
||||
if (newindex != B_ERROR) {
|
||||
//take a walk on the left side ;)
|
||||
|
||||
//printf("Found at %ld \n",newindex);
|
||||
|
||||
if (newindex - 1 >= 0) {
|
||||
BString left;
|
||||
text.CopyInto(left, 0, newindex);
|
||||
//printf("ready to recourse! [%s]\n",left.String());
|
||||
_findTokens(fTextView, left, tokenstart + 1, cols, font, cols2, font2);
|
||||
}
|
||||
|
||||
|
||||
text.Remove(0, newindex + cur.Length());
|
||||
|
||||
//printf("remaning [%s] printed [%s]\n",text.String(),cur->original.String());
|
||||
|
||||
fTextView->Append(cur.String(), cols2, cols2, font2);
|
||||
|
||||
if (text.Length() == 0) return; //useless stack
|
||||
} else
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fTextView->Append(text.String(),cols,cols,font);
|
||||
|
||||
|
||||
fTextView->Append(text.String(), cols, cols, font);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
Emoticor::AddText(RunView *fTextView,const char * txt, int16 cols ,int16 font ,int16 cols2 ,int16 font2 )
|
||||
Emoticor::AddText(RunView* fTextView, const char* txt, int16 cols , int16 font , int16 cols2 , int16 font2 )
|
||||
{
|
||||
|
||||
|
||||
BString left(txt);
|
||||
|
||||
// if(!fConfig)
|
||||
// fTextView->Append(txt,cols,cols,font);
|
||||
|
||||
_findTokens(fTextView,left,0,cols,font,cols2,font2);
|
||||
|
||||
// if(!fConfig)
|
||||
// fTextView->Append(txt,cols,cols,font);
|
||||
|
||||
_findTokens(fTextView, left, 0, cols, font, cols2, font2);
|
||||
|
||||
return;
|
||||
|
||||
|
|
|
@ -8,23 +8,23 @@
|
|||
|
||||
class Emoticor
|
||||
{
|
||||
public:
|
||||
|
||||
static Emoticor* Get(); //singleton
|
||||
public:
|
||||
|
||||
static Emoticor* Get(); //singleton
|
||||
|
||||
|
||||
void AddText(RunView* fTextView, const char* text, int16 cols , int16 font , int16 cols2 , int16 font2 );
|
||||
void LoadConfig(const char*);
|
||||
|
||||
Emoconfig* Config();
|
||||
|
||||
~Emoticor();
|
||||
|
||||
private:
|
||||
Emoticor();
|
||||
Emoconfig* fConfig;
|
||||
void _findTokens(RunView* fTextView, BString text, int tokenstart, int16 cols , int16 font , int16 cols2 , int16 font2);
|
||||
|
||||
|
||||
void AddText(RunView *fTextView,const char* text, int16 cols ,int16 font ,int16 cols2 ,int16 font2 );
|
||||
void LoadConfig(const char*);
|
||||
|
||||
Emoconfig *Config();
|
||||
|
||||
~Emoticor();
|
||||
|
||||
private:
|
||||
Emoticor();
|
||||
Emoconfig* fConfig;
|
||||
void _findTokens(RunView *fTextView,BString text,int tokenstart, int16 cols ,int16 font ,int16 cols2 ,int16 font2);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,43 +1,46 @@
|
|||
#ifndef _NormalTextRender_H_
|
||||
#define _NormalTextRender_H_
|
||||
|
||||
#include "TextRender.h"
|
||||
#include <Font.h>
|
||||
#include <View.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
class NormalTextRender : public TextRender
|
||||
{
|
||||
public:
|
||||
|
||||
NormalTextRender(BFont f):TextRender(){
|
||||
font=f;
|
||||
}
|
||||
virtual ~NormalTextRender() {};
|
||||
|
||||
virtual void Render(BView *target,const char* txt,int16 num,BPoint pos) {
|
||||
|
||||
target->SetFont(&font);
|
||||
target->DrawString(txt,num,pos);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
virtual float Size(){ return font.Size();}
|
||||
|
||||
virtual void GetHeight(font_height *height){ font.GetHeight(height); };
|
||||
|
||||
|
||||
virtual void
|
||||
GetEscapements(const char charArray[], int32 numChars,float escapementArray[])
|
||||
{
|
||||
font.GetEscapements(charArray,numChars,escapementArray);
|
||||
}
|
||||
|
||||
private:
|
||||
BFont font;
|
||||
|
||||
};
|
||||
#endif
|
||||
#ifndef _NormalTextRender_H_
|
||||
#define _NormalTextRender_H_
|
||||
|
||||
#include "TextRender.h"
|
||||
#include <Font.h>
|
||||
#include <View.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
class NormalTextRender : public TextRender
|
||||
{
|
||||
public:
|
||||
|
||||
NormalTextRender(BFont f): TextRender() {
|
||||
font = f;
|
||||
}
|
||||
virtual ~NormalTextRender() {};
|
||||
|
||||
virtual void Render(BView* target, const char* txt, int16 num, BPoint pos) {
|
||||
|
||||
target->SetFont(&font);
|
||||
target->DrawString(txt, num, pos);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
virtual float Size() {
|
||||
return font.Size();
|
||||
}
|
||||
|
||||
virtual void GetHeight(font_height* height) {
|
||||
font.GetHeight(height);
|
||||
};
|
||||
|
||||
|
||||
virtual void
|
||||
GetEscapements(const char charArray[], int32 numChars, float escapementArray[]) {
|
||||
font.GetEscapements(charArray, numChars, escapementArray);
|
||||
}
|
||||
|
||||
private:
|
||||
BFont font;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -73,52 +73,55 @@ template<class T> class BObjectList;
|
|||
template<class T>
|
||||
struct UnaryPredicate {
|
||||
|
||||
virtual int operator()(const T *) const
|
||||
// virtual could be avoided here if FindBinaryInsertionIndex,
|
||||
// etc. were member template functions
|
||||
{ return 0; }
|
||||
virtual int operator()(const T*) const
|
||||
// virtual could be avoided here if FindBinaryInsertionIndex,
|
||||
// etc. were member template functions
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
static int _unary_predicate_glue(const void *item, void *context);
|
||||
static int _unary_predicate_glue(const void* item, void* context);
|
||||
|
||||
friend class BObjectList<T>;
|
||||
friend class BObjectList<T>;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
int
|
||||
UnaryPredicate<T>::_unary_predicate_glue(const void *item, void *context)
|
||||
UnaryPredicate<T>::_unary_predicate_glue(const void* item, void* context)
|
||||
{
|
||||
return ((UnaryPredicate<T> *)context)->operator()((const T *)item);
|
||||
return ((UnaryPredicate<T> *)context)->operator()((const T*)item);
|
||||
}
|
||||
|
||||
|
||||
class _PointerList_ : public BList {
|
||||
class _PointerList_ : public BList
|
||||
{
|
||||
public:
|
||||
_PointerList_(const _PointerList_ &list);
|
||||
_PointerList_(int32 itemsPerBlock = 20, bool owning = false);
|
||||
~_PointerList_();
|
||||
|
||||
typedef void *(* GenericEachFunction)(void *, void *);
|
||||
typedef int (* GenericCompareFunction)(const void *, const void *);
|
||||
typedef int (* GenericCompareFunctionWithState)(const void *, const void *,
|
||||
void *);
|
||||
typedef int (* UnaryPredicateGlue)(const void *, void *);
|
||||
typedef void *(* GenericEachFunction)(void*, void*);
|
||||
typedef int (* GenericCompareFunction)(const void*, const void*);
|
||||
typedef int (* GenericCompareFunctionWithState)(const void*, const void*,
|
||||
void*);
|
||||
typedef int (* UnaryPredicateGlue)(const void*, void*);
|
||||
|
||||
void *EachElement(GenericEachFunction, void *);
|
||||
void* EachElement(GenericEachFunction, void*);
|
||||
void SortItems(GenericCompareFunction);
|
||||
void SortItems(GenericCompareFunctionWithState, void *state);
|
||||
void SortItems(GenericCompareFunctionWithState, void* state);
|
||||
void HSortItems(GenericCompareFunction);
|
||||
void HSortItems(GenericCompareFunctionWithState, void *state);
|
||||
void HSortItems(GenericCompareFunctionWithState, void* state);
|
||||
|
||||
void *BinarySearch(const void *, GenericCompareFunction) const;
|
||||
void *BinarySearch(const void *, GenericCompareFunctionWithState, void *state) const;
|
||||
void* BinarySearch(const void*, GenericCompareFunction) const;
|
||||
void* BinarySearch(const void*, GenericCompareFunctionWithState, void* state) const;
|
||||
|
||||
int32 BinarySearchIndex(const void *, GenericCompareFunction) const;
|
||||
int32 BinarySearchIndex(const void *, GenericCompareFunctionWithState, void *state) const;
|
||||
int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const;
|
||||
int32 BinarySearchIndex(const void*, GenericCompareFunction) const;
|
||||
int32 BinarySearchIndex(const void*, GenericCompareFunctionWithState, void* state) const;
|
||||
int32 BinarySearchIndexByPredicate(const void*, UnaryPredicateGlue) const;
|
||||
|
||||
bool Owning() const;
|
||||
bool ReplaceItem(int32, void *);
|
||||
bool ReplaceItem(int32, void*);
|
||||
|
||||
protected:
|
||||
bool owning;
|
||||
|
@ -126,124 +129,127 @@ protected:
|
|||
};
|
||||
|
||||
template<class T>
|
||||
class BObjectList : private _PointerList_ {
|
||||
class BObjectList : private _PointerList_
|
||||
{
|
||||
public:
|
||||
|
||||
// iteration and sorting
|
||||
typedef T *(* EachFunction)(T *, void *);
|
||||
typedef const T *(* ConstEachFunction)(const T *, void *);
|
||||
typedef int (* CompareFunction)(const T *, const T *);
|
||||
typedef int (* CompareFunctionWithState)(const T *, const T *, void *state);
|
||||
typedef T *(* EachFunction)(T*, void*);
|
||||
typedef const T *(* ConstEachFunction)(const T*, void*);
|
||||
typedef int (* CompareFunction)(const T*, const T*);
|
||||
typedef int (* CompareFunctionWithState)(const T*, const T*, void* state);
|
||||
|
||||
BObjectList(int32 itemsPerBlock = 20, bool owning = false);
|
||||
BObjectList(const BObjectList &list);
|
||||
// clones list; if list is owning, makes copies of all
|
||||
// the items
|
||||
BObjectList(const BObjectList& list);
|
||||
// clones list; if list is owning, makes copies of all
|
||||
// the items
|
||||
|
||||
virtual ~BObjectList();
|
||||
|
||||
BObjectList &operator=(const BObjectList &list);
|
||||
// clones list; if list is owning, makes copies of all
|
||||
// the items
|
||||
BObjectList& operator=(const BObjectList& list);
|
||||
// clones list; if list is owning, makes copies of all
|
||||
// the items
|
||||
|
||||
// adding and removing
|
||||
// ToDo:
|
||||
// change Add calls to return const item
|
||||
bool AddItem(T *);
|
||||
bool AddItem(T *, int32);
|
||||
bool AddList(BObjectList *);
|
||||
bool AddList(BObjectList *, int32);
|
||||
bool AddItem(T*);
|
||||
bool AddItem(T*, int32);
|
||||
bool AddList(BObjectList*);
|
||||
bool AddList(BObjectList*, int32);
|
||||
|
||||
bool RemoveItem(T *, bool deleteIfOwning = true);
|
||||
// if owning, deletes the removed item
|
||||
T *RemoveItemAt(int32);
|
||||
// returns the removed item
|
||||
bool RemoveItem(T*, bool deleteIfOwning = true);
|
||||
// if owning, deletes the removed item
|
||||
T* RemoveItemAt(int32);
|
||||
// returns the removed item
|
||||
|
||||
void MakeEmpty();
|
||||
|
||||
// item access
|
||||
T *ItemAt(int32) const;
|
||||
T* ItemAt(int32) const;
|
||||
|
||||
bool ReplaceItem(int32 index, T *);
|
||||
// if list is owning, deletes the item at <index> first
|
||||
T *SwapWithItem(int32 index, T *newItem);
|
||||
// same as ReplaceItem, except does not delete old item at <index>,
|
||||
// returns it instead
|
||||
bool ReplaceItem(int32 index, T*);
|
||||
// if list is owning, deletes the item at <index> first
|
||||
T* SwapWithItem(int32 index, T* newItem);
|
||||
// same as ReplaceItem, except does not delete old item at <index>,
|
||||
// returns it instead
|
||||
|
||||
T *FirstItem() const;
|
||||
T *LastItem() const;
|
||||
T* FirstItem() const;
|
||||
T* LastItem() const;
|
||||
|
||||
// misc. getters
|
||||
int32 IndexOf(const T *) const;
|
||||
bool HasItem(const T *) const;
|
||||
int32 IndexOf(const T*) const;
|
||||
bool HasItem(const T*) const;
|
||||
bool IsEmpty() const;
|
||||
int32 CountItems() const;
|
||||
|
||||
T *EachElement(EachFunction, void *);
|
||||
const T *EachElement(ConstEachFunction, void *) const;
|
||||
T* EachElement(EachFunction, void*);
|
||||
const T* EachElement(ConstEachFunction, void*) const;
|
||||
|
||||
void SortItems(CompareFunction);
|
||||
void SortItems(CompareFunctionWithState, void *state);
|
||||
void SortItems(CompareFunctionWithState, void* state);
|
||||
void HSortItems(CompareFunction);
|
||||
void HSortItems(CompareFunctionWithState, void *state);
|
||||
void HSortItems(CompareFunctionWithState, void* state);
|
||||
|
||||
// linear search, returns first item that matches predicate
|
||||
const T *FindIf(const UnaryPredicate<T> &) const;
|
||||
T *FindIf(const UnaryPredicate<T> &);
|
||||
const T* FindIf(const UnaryPredicate<T> &) const;
|
||||
T* FindIf(const UnaryPredicate<T> &);
|
||||
|
||||
// list must be sorted with CompareFunction for these to work
|
||||
T *BinarySearch(const T &, CompareFunction) const;
|
||||
T *BinarySearch(const T &, CompareFunctionWithState, void *state) const;
|
||||
T* BinarySearch(const T&, CompareFunction) const;
|
||||
T* BinarySearch(const T&, CompareFunctionWithState, void* state) const;
|
||||
|
||||
template<typename Key>
|
||||
T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *))
|
||||
const;
|
||||
T* BinarySearchByKey(const Key& key, int (*compare)(const Key*, const T*))
|
||||
const;
|
||||
|
||||
template<typename Key>
|
||||
T *BinarySearchByKey(const Key &key,
|
||||
int (*compare)(const Key *, const T *, void *), void *state) const;
|
||||
T* BinarySearchByKey(const Key& key,
|
||||
int (*compare)(const Key*, const T*, void*), void* state) const;
|
||||
|
||||
int32 BinarySearchIndex(const T &item, CompareFunction compare) const;
|
||||
int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare,
|
||||
void *state) const;
|
||||
int32 BinarySearchIndex(const T& item, CompareFunction compare) const;
|
||||
int32 BinarySearchIndex(const T& item, CompareFunctionWithState compare,
|
||||
void* state) const;
|
||||
|
||||
template<typename Key>
|
||||
int32 BinarySearchIndexByKey(const Key &key,
|
||||
int (*compare)(const Key *, const T *)) const;
|
||||
int32 BinarySearchIndexByKey(const Key& key,
|
||||
int (*compare)(const Key*, const T*)) const;
|
||||
|
||||
// Binary insertion - list must be sorted with CompareFunction for
|
||||
// these to work
|
||||
|
||||
// simple insert
|
||||
bool BinaryInsert(T *, CompareFunction);
|
||||
bool BinaryInsert(T *, CompareFunctionWithState, void *state);
|
||||
bool BinaryInsert(T *, const UnaryPredicate<T> &);
|
||||
bool BinaryInsert(T*, CompareFunction);
|
||||
bool BinaryInsert(T*, CompareFunctionWithState, void* state);
|
||||
bool BinaryInsert(T*, const UnaryPredicate<T> &);
|
||||
|
||||
// unique insert, returns false if item already in list
|
||||
bool BinaryInsertUnique(T *, CompareFunction);
|
||||
bool BinaryInsertUnique(T *, CompareFunctionWithState, void *state);
|
||||
bool BinaryInsertUnique(T *, const UnaryPredicate<T> &);
|
||||
bool BinaryInsertUnique(T*, CompareFunction);
|
||||
bool BinaryInsertUnique(T*, CompareFunctionWithState, void* state);
|
||||
bool BinaryInsertUnique(T*, const UnaryPredicate<T> &);
|
||||
|
||||
// insert a copy of the item, returns new inserted item
|
||||
T *BinaryInsertCopy(const T ©This, CompareFunction);
|
||||
T *BinaryInsertCopy(const T ©This, CompareFunctionWithState, void *state);
|
||||
T* BinaryInsertCopy(const T& copyThis, CompareFunction);
|
||||
T* BinaryInsertCopy(const T& copyThis, CompareFunctionWithState, void* state);
|
||||
|
||||
// insert a copy of the item if not in list already
|
||||
// returns new inserted item or existing item in case of a conflict
|
||||
T *BinaryInsertCopyUnique(const T ©This, CompareFunction);
|
||||
T *BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState, void *state);
|
||||
T* BinaryInsertCopyUnique(const T& copyThis, CompareFunction);
|
||||
T* BinaryInsertCopyUnique(const T& copyThis, CompareFunctionWithState, void* state);
|
||||
|
||||
int32 FindBinaryInsertionIndex(const UnaryPredicate<T> &, bool *alreadyInList = 0) const;
|
||||
// returns either the index into which a new item should be inserted
|
||||
// or index of an existing item that matches the predicate
|
||||
int32 FindBinaryInsertionIndex(const UnaryPredicate<T> &, bool* alreadyInList = 0) const;
|
||||
// returns either the index into which a new item should be inserted
|
||||
// or index of an existing item that matches the predicate
|
||||
|
||||
// deprecated API, will go away
|
||||
BList *AsBList()
|
||||
{ return this; }
|
||||
const BList *AsBList() const
|
||||
{ return this; }
|
||||
BList* AsBList() {
|
||||
return this;
|
||||
}
|
||||
const BList* AsBList() const {
|
||||
return this;
|
||||
}
|
||||
private:
|
||||
void SetItem(int32, T *);
|
||||
void SetItem(int32, T*);
|
||||
};
|
||||
|
||||
template<class Item, class Result, class Param1>
|
||||
|
@ -262,7 +268,7 @@ WhileEachListItem(BObjectList<Item> *list, Result (Item::*func)(Param1), Param1
|
|||
|
||||
template<class Item, class Result, class Param1>
|
||||
Result
|
||||
WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item *, Param1), Param1 p1)
|
||||
WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item*, Param1), Param1 p1)
|
||||
{
|
||||
Result result = 0;
|
||||
int32 count = list->CountItems();
|
||||
|
@ -277,7 +283,7 @@ WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item *, Param1), Param
|
|||
template<class Item, class Result, class Param1, class Param2>
|
||||
Result
|
||||
WhileEachListItem(BObjectList<Item> *list, Result (Item::*func)(Param1, Param2),
|
||||
Param1 p1, Param2 p2)
|
||||
Param1 p1, Param2 p2)
|
||||
{
|
||||
Result result = 0;
|
||||
int32 count = list->CountItems();
|
||||
|
@ -291,8 +297,8 @@ WhileEachListItem(BObjectList<Item> *list, Result (Item::*func)(Param1, Param2),
|
|||
|
||||
template<class Item, class Result, class Param1, class Param2>
|
||||
Result
|
||||
WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item *, Param1, Param2),
|
||||
Param1 p1, Param2 p2)
|
||||
WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item*, Param1, Param2),
|
||||
Param1 p1, Param2 p2)
|
||||
{
|
||||
Result result = 0;
|
||||
int32 count = list->CountItems();
|
||||
|
@ -306,8 +312,8 @@ WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item *, Param1, Param2
|
|||
|
||||
template<class Item, class Result, class Param1, class Param2, class Param3, class Param4>
|
||||
Result
|
||||
WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item *, Param1, Param2,
|
||||
Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4)
|
||||
WhileEachListItem(BObjectList<Item> *list, Result (*func)(Item*, Param1, Param2,
|
||||
Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4)
|
||||
{
|
||||
Result result = 0;
|
||||
int32 count = list->CountItems();
|
||||
|
@ -330,7 +336,7 @@ EachListItemIgnoreResult(BObjectList<Item> *list, Result (Item::*func)())
|
|||
|
||||
template<class Item, class Param1>
|
||||
void
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item *, Param1), Param1 p1)
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item*, Param1), Param1 p1)
|
||||
{
|
||||
int32 count = list->CountItems();
|
||||
for (int32 index = 0; index < count; index++)
|
||||
|
@ -340,7 +346,7 @@ EachListItem(BObjectList<Item> *list, void (*func)(Item *, Param1), Param1 p1)
|
|||
template<class Item, class Param1, class Param2>
|
||||
void
|
||||
EachListItem(BObjectList<Item> *list, void (Item::*func)(Param1, Param2),
|
||||
Param1 p1, Param2 p2)
|
||||
Param1 p1, Param2 p2)
|
||||
{
|
||||
int32 count = list->CountItems();
|
||||
for (int32 index = 0; index < count; index++)
|
||||
|
@ -349,8 +355,8 @@ EachListItem(BObjectList<Item> *list, void (Item::*func)(Param1, Param2),
|
|||
|
||||
template<class Item, class Param1, class Param2>
|
||||
void
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item *,Param1, Param2),
|
||||
Param1 p1, Param2 p2)
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item*, Param1, Param2),
|
||||
Param1 p1, Param2 p2)
|
||||
{
|
||||
int32 count = list->CountItems();
|
||||
for (int32 index = 0; index < count; index++)
|
||||
|
@ -359,8 +365,8 @@ EachListItem(BObjectList<Item> *list, void (*func)(Item *,Param1, Param2),
|
|||
|
||||
template<class Item, class Param1, class Param2, class Param3>
|
||||
void
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item *,Param1, Param2,
|
||||
Param3), Param1 p1, Param2 p2, Param3 p3)
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item*, Param1, Param2,
|
||||
Param3), Param1 p1, Param2 p2, Param3 p3)
|
||||
{
|
||||
int32 count = list->CountItems();
|
||||
for (int32 index = 0; index < count; index++)
|
||||
|
@ -370,8 +376,8 @@ EachListItem(BObjectList<Item> *list, void (*func)(Item *,Param1, Param2,
|
|||
|
||||
template<class Item, class Param1, class Param2, class Param3, class Param4>
|
||||
void
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item *,Param1, Param2,
|
||||
Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4)
|
||||
EachListItem(BObjectList<Item> *list, void (*func)(Item*, Param1, Param2,
|
||||
Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4)
|
||||
{
|
||||
int32 count = list->CountItems();
|
||||
for (int32 index = 0; index < count; index++)
|
||||
|
@ -401,7 +407,7 @@ BObjectList<T>::BObjectList(const BObjectList<T> &list)
|
|||
// make our own copies in an owning list
|
||||
int32 count = list.CountItems();
|
||||
for (int32 index = 0; index < count; index++) {
|
||||
T *item = list.ItemAt(index);
|
||||
T* item = list.ItemAt(index);
|
||||
if (item)
|
||||
item = new T(*item);
|
||||
SetItem(index, item);
|
||||
|
@ -427,7 +433,7 @@ BObjectList<T>::operator=(const BObjectList<T> &list)
|
|||
// make our own copies in an owning list
|
||||
int32 count = list.CountItems();
|
||||
for (int32 index = 0; index < count; index++) {
|
||||
T *item = list.ItemAt(index);
|
||||
T* item = list.ItemAt(index);
|
||||
if (item)
|
||||
item = new T(*item);
|
||||
SetItem(index, item);
|
||||
|
@ -438,17 +444,17 @@ BObjectList<T>::operator=(const BObjectList<T> &list)
|
|||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::AddItem(T *item)
|
||||
BObjectList<T>::AddItem(T* item)
|
||||
{
|
||||
// need to cast to void * to make T work for const pointers
|
||||
return _PointerList_::AddItem((void *)item);
|
||||
return _PointerList_::AddItem((void*)item);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::AddItem(T *item, int32 atIndex)
|
||||
BObjectList<T>::AddItem(T* item, int32 atIndex)
|
||||
{
|
||||
return _PointerList_::AddItem((void *)item, atIndex);
|
||||
return _PointerList_::AddItem((void*)item, atIndex);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
@ -468,9 +474,9 @@ BObjectList<T>::AddList(BObjectList<T> *newItems, int32 atIndex)
|
|||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::RemoveItem(T *item, bool deleteIfOwning)
|
||||
BObjectList<T>::RemoveItem(T* item, bool deleteIfOwning)
|
||||
{
|
||||
bool result = _PointerList_::RemoveItem((void *)item);
|
||||
bool result = _PointerList_::RemoveItem((void*)item);
|
||||
|
||||
if (result && Owning() && deleteIfOwning)
|
||||
delete item;
|
||||
|
@ -482,67 +488,67 @@ template<class T>
|
|||
T *
|
||||
BObjectList<T>::RemoveItemAt(int32 index)
|
||||
{
|
||||
return (T *)_PointerList_::RemoveItem(index);
|
||||
return (T*)_PointerList_::RemoveItem(index);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T *
|
||||
BObjectList<T>::ItemAt(int32 index) const
|
||||
{
|
||||
return (T *)_PointerList_::ItemAt(index);
|
||||
return (T*)_PointerList_::ItemAt(index);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::ReplaceItem(int32 index, T *item)
|
||||
BObjectList<T>::ReplaceItem(int32 index, T* item)
|
||||
{
|
||||
if (owning)
|
||||
delete ItemAt(index);
|
||||
return _PointerList_::ReplaceItem(index, (void *)item);
|
||||
return _PointerList_::ReplaceItem(index, (void*)item);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::SwapWithItem(int32 index, T *newItem)
|
||||
BObjectList<T>::SwapWithItem(int32 index, T* newItem)
|
||||
{
|
||||
T *result = ItemAt(index);
|
||||
_PointerList_::ReplaceItem(index, (void *)newItem);
|
||||
T* result = ItemAt(index);
|
||||
_PointerList_::ReplaceItem(index, (void*)newItem);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void
|
||||
BObjectList<T>::SetItem(int32 index, T *newItem)
|
||||
BObjectList<T>::SetItem(int32 index, T* newItem)
|
||||
{
|
||||
_PointerList_::ReplaceItem(index, (void *)newItem);
|
||||
_PointerList_::ReplaceItem(index, (void*)newItem);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
int32
|
||||
BObjectList<T>::IndexOf(const T *item) const
|
||||
BObjectList<T>::IndexOf(const T* item) const
|
||||
{
|
||||
return _PointerList_::IndexOf((void *)item);
|
||||
return _PointerList_::IndexOf((void*)item);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::FirstItem() const
|
||||
{
|
||||
return (T *)_PointerList_::FirstItem();
|
||||
return (T*)_PointerList_::FirstItem();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::LastItem() const
|
||||
{
|
||||
return (T *)_PointerList_::LastItem();
|
||||
return (T*)_PointerList_::LastItem();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::HasItem(const T *item) const
|
||||
BObjectList<T>::HasItem(const T* item) const
|
||||
{
|
||||
return _PointerList_::HasItem((void *)item);
|
||||
return _PointerList_::HasItem((void*)item);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
@ -573,19 +579,19 @@ BObjectList<T>::MakeEmpty()
|
|||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::EachElement(EachFunction func, void *params)
|
||||
BObjectList<T>::EachElement(EachFunction func, void* params)
|
||||
{
|
||||
return (T *)_PointerList_::EachElement((GenericEachFunction)func, params);
|
||||
return (T*)_PointerList_::EachElement((GenericEachFunction)func, params);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
const T *
|
||||
BObjectList<T>::EachElement(ConstEachFunction func, void *params) const
|
||||
BObjectList<T>::EachElement(ConstEachFunction func, void* params) const
|
||||
{
|
||||
return (const T *)
|
||||
const_cast<BObjectList<T> *>(this)->_PointerList_::EachElement(
|
||||
(GenericEachFunction)func, params);
|
||||
return (const T*)
|
||||
const_cast<BObjectList<T> *>(this)->_PointerList_::EachElement(
|
||||
(GenericEachFunction)func, params);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
@ -620,7 +626,7 @@ BObjectList<T>::SortItems(CompareFunction function)
|
|||
|
||||
template<class T>
|
||||
void
|
||||
BObjectList<T>::SortItems(CompareFunctionWithState function, void *state)
|
||||
BObjectList<T>::SortItems(CompareFunctionWithState function, void* state)
|
||||
{
|
||||
_PointerList_::SortItems((GenericCompareFunctionWithState)function, state);
|
||||
}
|
||||
|
@ -634,86 +640,86 @@ BObjectList<T>::HSortItems(CompareFunction function)
|
|||
|
||||
template<class T>
|
||||
void
|
||||
BObjectList<T>::HSortItems(CompareFunctionWithState function, void *state)
|
||||
BObjectList<T>::HSortItems(CompareFunctionWithState function, void* state)
|
||||
{
|
||||
_PointerList_::HSortItems((GenericCompareFunctionWithState)function, state);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::BinarySearch(const T &key, CompareFunction func) const
|
||||
BObjectList<T>::BinarySearch(const T& key, CompareFunction func) const
|
||||
{
|
||||
return (T*)_PointerList_::BinarySearch(&key,
|
||||
(GenericCompareFunction)func);
|
||||
(GenericCompareFunction)func);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::BinarySearch(const T &key, CompareFunctionWithState func, void *state) const
|
||||
BObjectList<T>::BinarySearch(const T& key, CompareFunctionWithState func, void* state) const
|
||||
{
|
||||
return (T*)_PointerList_::BinarySearch(&key,
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
template<typename Key>
|
||||
T *
|
||||
BObjectList<T>::BinarySearchByKey(const Key &key,
|
||||
int (*compare)(const Key *, const T *)) const
|
||||
BObjectList<T>::BinarySearchByKey(const Key& key,
|
||||
int (*compare)(const Key*, const T*)) const
|
||||
{
|
||||
return (T*)_PointerList_::BinarySearch(&key,
|
||||
(GenericCompareFunction)compare);
|
||||
(GenericCompareFunction)compare);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
template<typename Key>
|
||||
T *
|
||||
BObjectList<T>::BinarySearchByKey(const Key &key,
|
||||
int (*compare)(const Key *, const T *, void *), void *state) const
|
||||
BObjectList<T>::BinarySearchByKey(const Key& key,
|
||||
int (*compare)(const Key*, const T*, void*), void* state) const
|
||||
{
|
||||
return (T*)_PointerList_::BinarySearch(&key,
|
||||
(GenericCompareFunctionWithState)compare, state);
|
||||
(GenericCompareFunctionWithState)compare, state);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
int32
|
||||
BObjectList<T>::BinarySearchIndex(const T &item, CompareFunction compare) const
|
||||
BObjectList<T>::BinarySearchIndex(const T& item, CompareFunction compare) const
|
||||
{
|
||||
return _PointerList_::BinarySearchIndex(&item,
|
||||
(GenericCompareFunction)compare);
|
||||
(GenericCompareFunction)compare);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
int32
|
||||
BObjectList<T>::BinarySearchIndex(const T &item,
|
||||
CompareFunctionWithState compare, void *state) const
|
||||
BObjectList<T>::BinarySearchIndex(const T& item,
|
||||
CompareFunctionWithState compare, void* state) const
|
||||
{
|
||||
return _PointerList_::BinarySearchIndex(&item,
|
||||
(GenericCompareFunctionWithState)compare, state);
|
||||
(GenericCompareFunctionWithState)compare, state);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
template<typename Key>
|
||||
int32
|
||||
BObjectList<T>::BinarySearchIndexByKey(const Key &key,
|
||||
int (*compare)(const Key *, const T *)) const
|
||||
BObjectList<T>::BinarySearchIndexByKey(const Key& key,
|
||||
int (*compare)(const Key*, const T*)) const
|
||||
{
|
||||
return _PointerList_::BinarySearchIndex(&key,
|
||||
(GenericCompareFunction)compare);
|
||||
(GenericCompareFunction)compare);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::BinaryInsert(T *item, CompareFunction func)
|
||||
BObjectList<T>::BinaryInsert(T* item, CompareFunction func)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(item,
|
||||
(GenericCompareFunction)func);
|
||||
(GenericCompareFunction)func);
|
||||
if (index >= 0) {
|
||||
// already in list, add after existing
|
||||
return AddItem(item, index + 1);
|
||||
|
@ -724,10 +730,10 @@ BObjectList<T>::BinaryInsert(T *item, CompareFunction func)
|
|||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::BinaryInsert(T *item, CompareFunctionWithState func, void *state)
|
||||
BObjectList<T>::BinaryInsert(T* item, CompareFunctionWithState func, void* state)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(item,
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
if (index >= 0) {
|
||||
// already in list, add after existing
|
||||
return AddItem(item, index + 1);
|
||||
|
@ -738,10 +744,10 @@ BObjectList<T>::BinaryInsert(T *item, CompareFunctionWithState func, void *state
|
|||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::BinaryInsertUnique(T *item, CompareFunction func)
|
||||
BObjectList<T>::BinaryInsertUnique(T* item, CompareFunction func)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(item,
|
||||
(GenericCompareFunction)func);
|
||||
(GenericCompareFunction)func);
|
||||
if (index >= 0)
|
||||
return false;
|
||||
|
||||
|
@ -750,10 +756,10 @@ BObjectList<T>::BinaryInsertUnique(T *item, CompareFunction func)
|
|||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state)
|
||||
BObjectList<T>::BinaryInsertUnique(T* item, CompareFunctionWithState func, void* state)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(item,
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
if (index >= 0)
|
||||
return false;
|
||||
|
||||
|
@ -763,76 +769,76 @@ BObjectList<T>::BinaryInsertUnique(T *item, CompareFunctionWithState func, void
|
|||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::BinaryInsertCopy(const T ©This, CompareFunction func)
|
||||
BObjectList<T>::BinaryInsertCopy(const T& copyThis, CompareFunction func)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(©This,
|
||||
(GenericCompareFunction)func);
|
||||
(GenericCompareFunction)func);
|
||||
|
||||
if (index >= 0)
|
||||
index++;
|
||||
else
|
||||
index = -index - 1;
|
||||
|
||||
T *newItem = new T(copyThis);
|
||||
T* newItem = new T(copyThis);
|
||||
AddItem(newItem, index);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::BinaryInsertCopy(const T ©This, CompareFunctionWithState func, void *state)
|
||||
BObjectList<T>::BinaryInsertCopy(const T& copyThis, CompareFunctionWithState func, void* state)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(©This,
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
|
||||
if (index >= 0)
|
||||
index++;
|
||||
else
|
||||
index = -index - 1;
|
||||
|
||||
T *newItem = new T(copyThis);
|
||||
T* newItem = new T(copyThis);
|
||||
AddItem(newItem, index);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::BinaryInsertCopyUnique(const T ©This, CompareFunction func)
|
||||
BObjectList<T>::BinaryInsertCopyUnique(const T& copyThis, CompareFunction func)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(©This,
|
||||
(GenericCompareFunction)func);
|
||||
(GenericCompareFunction)func);
|
||||
if (index >= 0)
|
||||
return ItemAt(index);
|
||||
|
||||
index = -index - 1;
|
||||
T *newItem = new T(copyThis);
|
||||
T* newItem = new T(copyThis);
|
||||
AddItem(newItem, index);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T *
|
||||
BObjectList<T>::BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState func,
|
||||
void *state)
|
||||
BObjectList<T>::BinaryInsertCopyUnique(const T& copyThis, CompareFunctionWithState func,
|
||||
void* state)
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndex(©This,
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
(GenericCompareFunctionWithState)func, state);
|
||||
if (index >= 0)
|
||||
return ItemAt(index);
|
||||
|
||||
index = -index - 1;
|
||||
T *newItem = new T(copyThis);
|
||||
T* newItem = new T(copyThis);
|
||||
AddItem(newItem, index);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
int32
|
||||
BObjectList<T>::FindBinaryInsertionIndex(const UnaryPredicate<T> &pred, bool *alreadyInList)
|
||||
const
|
||||
BObjectList<T>::FindBinaryInsertionIndex(const UnaryPredicate<T> &pred, bool* alreadyInList)
|
||||
const
|
||||
{
|
||||
int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred,
|
||||
(UnaryPredicateGlue)&UnaryPredicate<T>::_unary_predicate_glue);
|
||||
(UnaryPredicateGlue)&UnaryPredicate<T>::_unary_predicate_glue);
|
||||
|
||||
if (alreadyInList)
|
||||
*alreadyInList = index >= 0;
|
||||
|
@ -845,14 +851,14 @@ BObjectList<T>::FindBinaryInsertionIndex(const UnaryPredicate<T> &pred, bool *al
|
|||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::BinaryInsert(T *item, const UnaryPredicate<T> &pred)
|
||||
BObjectList<T>::BinaryInsert(T* item, const UnaryPredicate<T> &pred)
|
||||
{
|
||||
return AddItem(item, FindBinaryInsertionIndex(pred));
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::BinaryInsertUnique(T *item, const UnaryPredicate<T> &pred)
|
||||
BObjectList<T>::BinaryInsertUnique(T* item, const UnaryPredicate<T> &pred)
|
||||
{
|
||||
bool alreadyInList;
|
||||
int32 index = FindBinaryInsertionIndex(pred, &alreadyInList);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,25 +1,25 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is The Vision Team.
|
||||
* Portions created by The Vision Team are
|
||||
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Rene Gollent
|
||||
* Todd Lair
|
||||
*/
|
||||
|
||||
|
||||
#ifndef RUNVIEW_H_
|
||||
#define RUNVIEW_H_
|
||||
|
||||
|
@ -50,71 +50,68 @@ class BPopUpMenu;
|
|||
|
||||
class SelectPos
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
int16 fLine;
|
||||
int16 fOffset;
|
||||
|
||||
SelectPos (
|
||||
int16 selLine = 0,
|
||||
int16 selOffset = 0)
|
||||
: fLine (selLine),
|
||||
fOffset (selOffset)
|
||||
{ }
|
||||
SelectPos (
|
||||
int16 selLine = 0,
|
||||
int16 selOffset = 0)
|
||||
: fLine (selLine),
|
||||
fOffset (selOffset)
|
||||
{ }
|
||||
|
||||
SelectPos (const SelectPos &pos)
|
||||
: fLine (pos.fLine),
|
||||
fOffset (pos.fOffset)
|
||||
{ }
|
||||
SelectPos (const SelectPos& pos)
|
||||
: fLine (pos.fLine),
|
||||
fOffset (pos.fOffset)
|
||||
{ }
|
||||
|
||||
~SelectPos (void)
|
||||
{ }
|
||||
~SelectPos (void)
|
||||
{ }
|
||||
|
||||
SelectPos &operator = (const SelectPos &pos)
|
||||
{
|
||||
fLine = pos.fLine;
|
||||
fOffset = pos.fOffset;
|
||||
SelectPos& operator = (const SelectPos& pos) {
|
||||
fLine = pos.fLine;
|
||||
fOffset = pos.fOffset;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline int operator == (const SelectPos& rhs) const {
|
||||
return ((fLine == rhs.fLine) && (fOffset == rhs.fOffset));
|
||||
}
|
||||
|
||||
inline int operator != (const SelectPos& rhs) const {
|
||||
return (!(*this == rhs));
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline int operator == (const SelectPos &rhs) const
|
||||
{
|
||||
return ((fLine == rhs.fLine) && (fOffset == rhs.fOffset));
|
||||
}
|
||||
|
||||
inline int operator != (const SelectPos &rhs) const
|
||||
{
|
||||
return (!(*this == rhs));
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
class RunView : public BView
|
||||
{
|
||||
BScrollView *fScroller;
|
||||
BCursor *fURLCursor;
|
||||
Theme *fTheme;
|
||||
BScrollView* fScroller;
|
||||
BCursor* fURLCursor;
|
||||
Theme* fTheme;
|
||||
|
||||
Line *fWorking;
|
||||
Line *fLines[LINE_COUNT];
|
||||
Line* fWorking;
|
||||
Line* fLines[LINE_COUNT];
|
||||
int16 fLine_count,
|
||||
fClickCount;
|
||||
fClickCount;
|
||||
|
||||
char* fStamp_format;
|
||||
char* fClipping_name;
|
||||
|
||||
char *fStamp_format;
|
||||
char *fClipping_name;
|
||||
|
||||
SelectPos fSp_start, fSp_end;
|
||||
|
||||
|
||||
int32 fTracking;
|
||||
SelectPos fTrack_offset;
|
||||
BMessageRunner *fOff_view_runner;
|
||||
BMessageRunner* fOff_view_runner;
|
||||
bigtime_t fOff_view_time;
|
||||
|
||||
bool fResizedirty;
|
||||
bool fFontsdirty;
|
||||
BPopUpMenu *fMyPopUp;
|
||||
BPopUpMenu* fMyPopUp;
|
||||
BPoint fLastClick;
|
||||
bigtime_t fLastClickTime;
|
||||
|
||||
|
@ -127,62 +124,64 @@ class RunView : public BView
|
|||
void CheckURLCursor (BPoint);
|
||||
void BuildPopUp (void);
|
||||
|
||||
bool CheckClickBounds (const SelectPos &, const BPoint &) const;
|
||||
void LoadURL(const char *url);
|
||||
|
||||
public:
|
||||
bool CheckClickBounds (const SelectPos&, const BPoint&) const;
|
||||
void LoadURL(const char* url);
|
||||
|
||||
RunView (
|
||||
BRect,
|
||||
const char *,
|
||||
Theme *,
|
||||
uint32 = B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||
uint32 = 0UL);
|
||||
public:
|
||||
|
||||
RunView (
|
||||
BRect,
|
||||
const char*,
|
||||
Theme*,
|
||||
uint32 = B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||
uint32 = 0UL);
|
||||
virtual ~RunView (void);
|
||||
|
||||
virtual void AttachedToWindow (void);
|
||||
virtual void DetachedFromWindow (void);
|
||||
virtual void FrameResized (float, float);
|
||||
virtual void TargetedByScrollView (BScrollView *);
|
||||
virtual void TargetedByScrollView (BScrollView*);
|
||||
virtual void Show ();
|
||||
virtual void Draw (BRect);
|
||||
virtual void MessageReceived (BMessage *);
|
||||
virtual void MessageReceived (BMessage*);
|
||||
|
||||
virtual void SetViewColor (rgb_color);
|
||||
void SetViewColor (uchar red, uchar green, uchar blue, uchar alpha = 255)
|
||||
{ rgb_color color = {red, green, blue, alpha}; SetViewColor (color); }
|
||||
void SetViewColor (uchar red, uchar green, uchar blue, uchar alpha = 255) {
|
||||
rgb_color color = {red, green, blue, alpha};
|
||||
SetViewColor (color);
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void MouseDown (BPoint);
|
||||
virtual void MouseMoved (BPoint, uint32, const BMessage *);
|
||||
virtual void MouseMoved (BPoint, uint32, const BMessage*);
|
||||
virtual void MouseUp (BPoint);
|
||||
|
||||
|
||||
void Append (const char *, int32, int16, int16, int16);
|
||||
void Append (const char *, int16, int16, int16);
|
||||
|
||||
|
||||
void Append (const char*, int32, int16, int16, int16);
|
||||
void Append (const char*, int16, int16, int16);
|
||||
|
||||
void Clear (void);
|
||||
|
||||
int16 LineCount (void) const;
|
||||
const char *LineAt (int16) const;
|
||||
const char* LineAt (int16) const;
|
||||
|
||||
void SetTimeStampFormat (const char *);
|
||||
void SetTheme (Theme *);
|
||||
void SetTimeStampFormat (const char*);
|
||||
void SetTheme (Theme*);
|
||||
|
||||
SelectPos PositionAt (BPoint) const;
|
||||
BPoint PointAt (SelectPos) const;
|
||||
|
||||
BRect GetTextFrame (const SelectPos &, const SelectPos &) const;
|
||||
bool IntersectSelection (const SelectPos &, const SelectPos &) const;
|
||||
void GetSelectionText (BString &) const;
|
||||
void Select (const SelectPos &, const SelectPos &);
|
||||
|
||||
BRect GetTextFrame (const SelectPos&, const SelectPos&) const;
|
||||
bool IntersectSelection (const SelectPos&, const SelectPos&) const;
|
||||
void GetSelectionText (BString&) const;
|
||||
void Select (const SelectPos&, const SelectPos&);
|
||||
void SelectAll (void);
|
||||
void SetClippingName (const char *);
|
||||
bool FindText(const char *);
|
||||
void SetClippingName (const char*);
|
||||
bool FindText(const char*);
|
||||
|
||||
void ScrollToBottom(void);
|
||||
void ScrollToSelection(void);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -1,53 +1,52 @@
|
|||
#ifndef _SmileTextRender_H_
|
||||
#define _SmileTextRender_H_
|
||||
|
||||
#include "TextRender.h"
|
||||
#include <Font.h>
|
||||
#include <View.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <TranslationUtils.h>
|
||||
#include <Resources.h>
|
||||
#include <String.h>
|
||||
|
||||
#include "Emoticor.h"
|
||||
|
||||
class SmileTextRender : public TextRender
|
||||
{
|
||||
public:
|
||||
|
||||
SmileTextRender():TextRender(){};
|
||||
|
||||
virtual ~SmileTextRender() {};
|
||||
|
||||
virtual void Render(BView *target,const char* txt,int16 num,BPoint pos) {
|
||||
|
||||
BBitmap *pointer=NULL;
|
||||
BString f(txt,num);
|
||||
|
||||
if(Emoticor::Get()->Config()->FindPointer(f.String(),(void**)&pointer)==B_OK)
|
||||
{
|
||||
target->SetDrawingMode( B_OP_ALPHA );
|
||||
target->DrawBitmapAsync( pointer,BPoint(pos.x, pos.y- (Emoticor::Get()->Config()->GetEmoticonSize()/2)) );
|
||||
target->SetDrawingMode( B_OP_OVER );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
virtual float Size(){ return Emoticor::Get()->Config()->GetEmoticonSize();}
|
||||
|
||||
virtual void GetHeight(font_height *h)
|
||||
{
|
||||
h->descent = h->ascent = Emoticor::Get()->Config()->GetEmoticonSize()/2;
|
||||
h->leading=0;
|
||||
};
|
||||
|
||||
virtual void
|
||||
GetEscapements(const char * /*charArray*/, int32 numChars,float escapementArray[])
|
||||
{
|
||||
//font.GetEscapements(charArray,numChars,escapementArray);
|
||||
escapementArray[0]=1;
|
||||
for(int i=1;i<numChars;i++) escapementArray[i]=0;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
#ifndef _SmileTextRender_H_
|
||||
#define _SmileTextRender_H_
|
||||
|
||||
#include "TextRender.h"
|
||||
#include <Font.h>
|
||||
#include <View.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <TranslationUtils.h>
|
||||
#include <Resources.h>
|
||||
#include <String.h>
|
||||
|
||||
#include "Emoticor.h"
|
||||
|
||||
class SmileTextRender : public TextRender
|
||||
{
|
||||
public:
|
||||
|
||||
SmileTextRender(): TextRender() {};
|
||||
|
||||
virtual ~SmileTextRender() {};
|
||||
|
||||
virtual void Render(BView* target, const char* txt, int16 num, BPoint pos) {
|
||||
|
||||
BBitmap* pointer = NULL;
|
||||
BString f(txt, num);
|
||||
|
||||
if (Emoticor::Get()->Config()->FindPointer(f.String(), (void**)&pointer) == B_OK) {
|
||||
target->SetDrawingMode( B_OP_ALPHA );
|
||||
target->DrawBitmapAsync( pointer, BPoint(pos.x, pos.y - (Emoticor::Get()->Config()->GetEmoticonSize() / 2)) );
|
||||
target->SetDrawingMode( B_OP_OVER );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
virtual float Size() {
|
||||
return Emoticor::Get()->Config()->GetEmoticonSize();
|
||||
}
|
||||
|
||||
virtual void GetHeight(font_height* h) {
|
||||
h->descent = h->ascent = Emoticor::Get()->Config()->GetEmoticonSize() / 2;
|
||||
h->leading = 0;
|
||||
};
|
||||
|
||||
virtual void
|
||||
GetEscapements(const char * /*charArray*/, int32 numChars, float escapementArray[]) {
|
||||
//font.GetEscapements(charArray,numChars,escapementArray);
|
||||
escapementArray[0] = 1;
|
||||
for (int i = 1; i < numChars; i++) escapementArray[i] = 0;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
|
||||
class TextRender
|
||||
{
|
||||
public:
|
||||
TextRender(){};
|
||||
virtual ~TextRender() {};
|
||||
|
||||
virtual void Render(BView *target,const char*,int16 num,BPoint pos) = 0;
|
||||
virtual void GetHeight(font_height *height) = 0;
|
||||
virtual void GetEscapements(const char charArray[], int32 numChars,float escapementArray[])=0;
|
||||
virtual float Size() = 0;
|
||||
//
|
||||
|
||||
public:
|
||||
TextRender() {};
|
||||
virtual ~TextRender() {};
|
||||
|
||||
virtual void Render(BView* target, const char*, int16 num, BPoint pos) = 0;
|
||||
virtual void GetHeight(font_height* height) = 0;
|
||||
virtual void GetEscapements(const char charArray[], int32 numChars, float escapementArray[]) = 0;
|
||||
virtual float Size() = 0;
|
||||
//
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
* The Initial Developer of the Original Code is The Vision Team.
|
||||
* Portions created by The Vision Team are
|
||||
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Rene Gollent
|
||||
* Todd Lair
|
||||
* Andrea Anzani, andrea.anzani@gmail.com
|
||||
*/
|
||||
|
||||
|
||||
#define NUMBER_THEME_READERS 1000
|
||||
|
||||
#include <Message.h>
|
||||
|
@ -48,79 +48,79 @@ int16 Theme::SelectionBack = 3;
|
|||
|
||||
|
||||
Theme::Theme (
|
||||
const char *n,
|
||||
int16 foreCount,
|
||||
int16 backCount,
|
||||
int16 renderCount)
|
||||
: name (NULL),
|
||||
fores (NULL),
|
||||
backs (NULL),
|
||||
text_renders (NULL),
|
||||
fore_count (max_c (foreCount, 4)),
|
||||
back_count (max_c (backCount, 4)),
|
||||
render_count (max_c (renderCount, 4))
|
||||
const char* n,
|
||||
int16 foreCount,
|
||||
int16 backCount,
|
||||
int16 renderCount)
|
||||
: name (NULL),
|
||||
fores (NULL),
|
||||
backs (NULL),
|
||||
text_renders (NULL),
|
||||
fore_count (max_c (foreCount, 4)),
|
||||
back_count (max_c (backCount, 4)),
|
||||
render_count (max_c (renderCount, 4))
|
||||
{
|
||||
|
||||
|
||||
fSoftLineIndent = (float)(MARGIN_WIDTH / 2.0);
|
||||
fTextMargin = (float)(MARGIN_WIDTH / 2.0);
|
||||
|
||||
name = strcpy (new char [strlen (n) + 1], n);
|
||||
|
||||
fores = new rgb_color [fore_count];
|
||||
backs = new rgb_color [back_count];
|
||||
|
||||
normal_textrender = new NormalTextRender(be_plain_font);
|
||||
|
||||
text_renders = (TextRender**)malloc(render_count*sizeof(TextRender*));
|
||||
for ( int i=0; i<render_count; i++ )
|
||||
name = strcpy (new char [strlen (n) + 1], n);
|
||||
|
||||
fores = new rgb_color [fore_count];
|
||||
backs = new rgb_color [back_count];
|
||||
|
||||
normal_textrender = new NormalTextRender(be_plain_font);
|
||||
|
||||
text_renders = (TextRender**)malloc(render_count * sizeof(TextRender*));
|
||||
for ( int i = 0; i < render_count; i++ )
|
||||
text_renders[i] = normal_textrender;
|
||||
|
||||
|
||||
|
||||
sid = create_sem (NUMBER_THEME_READERS, name);
|
||||
|
||||
rgb_color def_timestamp_fore = {200, 150, 150, 255};
|
||||
rgb_color def_timestamp_back = {255, 255, 255, 255};
|
||||
rgb_color def_fore = {0, 0, 0, 255};
|
||||
rgb_color def_back = {255, 255, 255, 255};
|
||||
|
||||
fores[0] = def_timestamp_fore;
|
||||
|
||||
int16 i;
|
||||
for (i = 1; i < fore_count; ++i)
|
||||
fores[i] = def_fore;
|
||||
sid = create_sem (NUMBER_THEME_READERS, name);
|
||||
|
||||
backs[0] = def_timestamp_back;
|
||||
for (i = 1; i < back_count; ++i)
|
||||
backs[i] = def_back;
|
||||
rgb_color def_timestamp_fore = {200, 150, 150, 255};
|
||||
rgb_color def_timestamp_back = {255, 255, 255, 255};
|
||||
rgb_color def_fore = {0, 0, 0, 255};
|
||||
rgb_color def_back = {255, 255, 255, 255};
|
||||
|
||||
fores[0] = def_timestamp_fore;
|
||||
|
||||
int16 i;
|
||||
for (i = 1; i < fore_count; ++i)
|
||||
fores[i] = def_fore;
|
||||
|
||||
backs[0] = def_timestamp_back;
|
||||
for (i = 1; i < back_count; ++i)
|
||||
backs[i] = def_back;
|
||||
}
|
||||
|
||||
Theme::~Theme (void)
|
||||
{
|
||||
delete_sem (sid);
|
||||
delete_sem (sid);
|
||||
|
||||
//delete [] fonts;
|
||||
for ( int i=0; i<render_count; i++ )
|
||||
//delete [] fonts;
|
||||
for ( int i = 0; i < render_count; i++ )
|
||||
if ( text_renders[i] )
|
||||
text_renders[i]=NULL;
|
||||
|
||||
delete normal_textrender;
|
||||
|
||||
delete [] backs;
|
||||
delete [] fores;
|
||||
delete [] name;
|
||||
text_renders[i] = NULL;
|
||||
|
||||
delete normal_textrender;
|
||||
|
||||
delete [] backs;
|
||||
delete [] fores;
|
||||
delete [] name;
|
||||
}
|
||||
|
||||
int16
|
||||
Theme::CountForegrounds (void) const
|
||||
{
|
||||
return fore_count;
|
||||
return fore_count;
|
||||
}
|
||||
|
||||
int16
|
||||
Theme::CountBackgrounds (void) const
|
||||
{
|
||||
return back_count;
|
||||
return back_count;
|
||||
}
|
||||
/*
|
||||
int16
|
||||
|
@ -133,53 +133,53 @@ Theme::CountFonts (void) const
|
|||
int16
|
||||
Theme::CountTextRenders (void) const
|
||||
{
|
||||
return render_count;
|
||||
return render_count;
|
||||
}
|
||||
|
||||
void
|
||||
Theme::ReadLock (void)
|
||||
{
|
||||
acquire_sem (sid);
|
||||
acquire_sem (sid);
|
||||
}
|
||||
|
||||
void
|
||||
Theme::ReadUnlock (void)
|
||||
{
|
||||
release_sem (sid);
|
||||
release_sem (sid);
|
||||
}
|
||||
|
||||
void
|
||||
Theme::WriteLock (void)
|
||||
{
|
||||
acquire_sem_etc (sid, NUMBER_THEME_READERS, 0, 0);
|
||||
acquire_sem_etc (sid, NUMBER_THEME_READERS, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
Theme::WriteUnlock (void)
|
||||
{
|
||||
release_sem_etc (sid, NUMBER_THEME_READERS, 0);
|
||||
release_sem_etc (sid, NUMBER_THEME_READERS, 0);
|
||||
}
|
||||
|
||||
const rgb_color
|
||||
const rgb_color
|
||||
Theme::ForegroundAt (int16 which) const
|
||||
{
|
||||
rgb_color color = {0, 0, 0, 255};
|
||||
rgb_color color = {0, 0, 0, 255};
|
||||
|
||||
if (which >= fore_count || which < 0)
|
||||
return color;
|
||||
if (which >= fore_count || which < 0)
|
||||
return color;
|
||||
|
||||
return fores[which];
|
||||
return fores[which];
|
||||
}
|
||||
|
||||
const rgb_color
|
||||
Theme::BackgroundAt (int16 which) const
|
||||
{
|
||||
rgb_color color = {255, 255, 255, 255};
|
||||
rgb_color color = {255, 255, 255, 255};
|
||||
|
||||
if (which >= back_count || which < 0)
|
||||
return color;
|
||||
if (which >= back_count || which < 0)
|
||||
return color;
|
||||
|
||||
return backs[which];
|
||||
return backs[which];
|
||||
}
|
||||
/*
|
||||
const BFont &
|
||||
|
@ -193,63 +193,63 @@ Theme::FontAt (int16 which) const
|
|||
*/
|
||||
|
||||
TextRender*
|
||||
Theme::TextRenderAt (int16 which)
|
||||
Theme::TextRenderAt (int16 which)
|
||||
{
|
||||
if ( which < 0 ){
|
||||
//printf("Theme::TextRenderAt(): which < 0 (%d)\n", which);
|
||||
return normal_textrender;
|
||||
}
|
||||
if ( which >= render_count ){
|
||||
//printf("Theme::TextRenderAt(): which >= render_count (%d, %d)\n", which, render_count);
|
||||
return normal_textrender;
|
||||
}
|
||||
|
||||
return text_renders[which];
|
||||
if ( which < 0 ) {
|
||||
//printf("Theme::TextRenderAt(): which < 0 (%d)\n", which);
|
||||
return normal_textrender;
|
||||
}
|
||||
if ( which >= render_count ) {
|
||||
//printf("Theme::TextRenderAt(): which >= render_count (%d, %d)\n", which, render_count);
|
||||
return normal_textrender;
|
||||
}
|
||||
|
||||
return text_renders[which];
|
||||
}
|
||||
|
||||
bool
|
||||
Theme::SetForeground (int16 which, const rgb_color color)
|
||||
{
|
||||
if (which >= fore_count || which < 0)
|
||||
return false;
|
||||
if (which >= fore_count || which < 0)
|
||||
return false;
|
||||
|
||||
fores[which] = color;
|
||||
return true;
|
||||
fores[which] = color;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
Theme::SetBackground (int16 which, const rgb_color color)
|
||||
{
|
||||
if (which >= back_count || which < 0)
|
||||
return false;
|
||||
if (which >= back_count || which < 0)
|
||||
return false;
|
||||
|
||||
backs[which] = color;
|
||||
return true;
|
||||
backs[which] = color;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Theme::SetTextRender(int16 which,TextRender *trender)
|
||||
Theme::SetTextRender(int16 which, TextRender* trender)
|
||||
{
|
||||
|
||||
|
||||
if (which >= render_count || which < 0 || !trender)
|
||||
return false;
|
||||
|
||||
text_renders[which] = trender;
|
||||
return true;
|
||||
|
||||
|
||||
if (which >= render_count || which < 0 || !trender)
|
||||
return false;
|
||||
|
||||
text_renders[which] = trender;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
Theme::AddView (BView *view)
|
||||
Theme::AddView (BView* view)
|
||||
{
|
||||
list.AddItem (view);
|
||||
list.AddItem (view);
|
||||
}
|
||||
|
||||
void
|
||||
Theme::RemoveView (BView *view)
|
||||
Theme::RemoveView (BView* view)
|
||||
{
|
||||
list.RemoveItem (view);
|
||||
list.RemoveItem (view);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
* The Initial Developer of the Original Code is The Vision Team.
|
||||
* Portions created by The Vision Team are
|
||||
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Rene Gollent
|
||||
* Todd Lair
|
||||
*/
|
||||
|
||||
|
||||
#ifndef THEME_H_
|
||||
#define THEME_H_
|
||||
|
||||
|
@ -37,23 +37,23 @@ class NormalTextRender;
|
|||
|
||||
class Theme
|
||||
{
|
||||
char *name;
|
||||
rgb_color *fores;
|
||||
rgb_color *backs;
|
||||
TextRender **text_renders; //FIX!!
|
||||
|
||||
char* name;
|
||||
rgb_color* fores;
|
||||
rgb_color* backs;
|
||||
TextRender** text_renders; //FIX!!
|
||||
|
||||
int16 fore_count;
|
||||
int16 back_count;
|
||||
int16 render_count;
|
||||
|
||||
BList list;
|
||||
sem_id sid;
|
||||
|
||||
|
||||
float fSoftLineIndent;
|
||||
float fTextMargin;
|
||||
NormalTextRender* normal_textrender;
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
static int16 TimestampFore;
|
||||
static int16 TimestampBack;
|
||||
|
@ -66,15 +66,16 @@ class Theme
|
|||
static int16 NormalFont;
|
||||
static int16 SelectionBack;
|
||||
|
||||
Theme (
|
||||
const char *,
|
||||
int16,
|
||||
int16,
|
||||
int16);
|
||||
Theme (
|
||||
const char*,
|
||||
int16,
|
||||
int16,
|
||||
int16);
|
||||
virtual ~Theme (void);
|
||||
|
||||
const char *Name (void) const
|
||||
{ return name; }
|
||||
const char* Name (void) const {
|
||||
return name;
|
||||
}
|
||||
|
||||
void ReadLock (void);
|
||||
void ReadUnlock (void);
|
||||
|
@ -83,36 +84,44 @@ class Theme
|
|||
|
||||
int16 CountForegrounds (void) const;
|
||||
int16 CountBackgrounds (void) const;
|
||||
// int16 CountFonts (void) const;
|
||||
// int16 CountFonts (void) const;
|
||||
int16 CountTextRenders (void) const;
|
||||
|
||||
|
||||
const rgb_color ForegroundAt (int16) const;
|
||||
const rgb_color BackgroundAt (int16) const;
|
||||
|
||||
|
||||
//const BFont &FontAt (int16) const;
|
||||
|
||||
TextRender* TextRenderAt(int16);
|
||||
|
||||
bool SetForeground (int16, const rgb_color);
|
||||
bool SetForeground (int16 w, uchar r, uchar g, uchar b, uchar a = 255)
|
||||
{ rgb_color color = {r, g, b, a}; return SetForeground (w, color); }
|
||||
bool SetForeground (int16 w, uchar r, uchar g, uchar b, uchar a = 255) {
|
||||
rgb_color color = {r, g, b, a};
|
||||
return SetForeground (w, color);
|
||||
}
|
||||
bool SetBackground (int16, const rgb_color);
|
||||
bool SetBackground (int16 w, uchar r, uchar g, uchar b, uchar a = 255)
|
||||
{ rgb_color color = {r, g, b, a}; return SetBackground (w, color); }
|
||||
|
||||
bool SetBackground (int16 w, uchar r, uchar g, uchar b, uchar a = 255) {
|
||||
rgb_color color = {r, g, b, a};
|
||||
return SetBackground (w, color);
|
||||
}
|
||||
|
||||
//bool SetFont (int16, const BFont &);
|
||||
bool SetTextRender(int16, TextRender *);
|
||||
|
||||
bool SetTextRender(int16, TextRender*);
|
||||
|
||||
void SetSoftLineIndent(float indent);
|
||||
void SetTextMargin(float margin);
|
||||
|
||||
float TextMargin() const { return fTextMargin; }
|
||||
float SoftLineIndent() const { return fSoftLineIndent; }
|
||||
|
||||
|
||||
|
||||
void AddView (BView *);
|
||||
void RemoveView (BView *);
|
||||
|
||||
float TextMargin() const {
|
||||
return fTextMargin;
|
||||
}
|
||||
float SoftLineIndent() const {
|
||||
return fSoftLineIndent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AddView (BView*);
|
||||
void RemoveView (BView*);
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is The Vision Team.
|
||||
* Portions created by The Vision Team are
|
||||
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Rene Gollent
|
||||
* Todd Lair
|
||||
*/
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "URLCrunch.h"
|
||||
|
||||
URLCrunch::URLCrunch (const char *data, int32 len)
|
||||
URLCrunch::URLCrunch (const char* data, int32 len)
|
||||
: buffer (""),
|
||||
current_pos (0)
|
||||
{
|
||||
|
@ -36,14 +36,13 @@ URLCrunch::~URLCrunch (void)
|
|||
}
|
||||
|
||||
int32
|
||||
URLCrunch::Crunch (BString *url)
|
||||
URLCrunch::Crunch (BString* url)
|
||||
{
|
||||
if (current_pos >= buffer.Length())
|
||||
return B_ERROR;
|
||||
|
||||
const int32 tagNum = 7;
|
||||
const char *tags[tagNum] =
|
||||
{
|
||||
const char* tags[tagNum] = {
|
||||
"http://",
|
||||
"https://",
|
||||
"www.",
|
||||
|
@ -63,37 +62,33 @@ URLCrunch::Crunch (BString *url)
|
|||
markers[i] = buffer.IFindFirst (tags[i], pos);
|
||||
|
||||
for (i = 0; i < tagNum; ++i)
|
||||
|
||||
|
||||
if (markers[i] != B_ERROR
|
||||
&& markers[i] < marker)
|
||||
{
|
||||
&& markers[i] < marker) {
|
||||
url_length = markers[i] + strlen(tags[i]);
|
||||
|
||||
|
||||
url_length += strcspn (buffer.String() + url_length, " \t\n|\\<>\")(][}{;'*^");
|
||||
|
||||
|
||||
int len (strlen (tags[i]));
|
||||
|
||||
if (url_length - markers[i] > len
|
||||
&& (isdigit (buffer[markers[i] + len])
|
||||
|| isalpha (buffer[markers[i] + len])))
|
||||
{
|
||||
&& (isdigit (buffer[markers[i] + len])
|
||||
|| isalpha (buffer[markers[i] + len]))) {
|
||||
marker = markers[i];
|
||||
pos = url_length + 1;
|
||||
url_length -= marker;
|
||||
}
|
||||
else
|
||||
} else
|
||||
pos = markers[i] + 1;
|
||||
}
|
||||
|
||||
if (marker < buffer.Length())
|
||||
{
|
||||
*url = "";
|
||||
|
||||
url->Append (buffer.String() + marker, url_length);
|
||||
}
|
||||
if (marker < buffer.Length()) {
|
||||
*url = "";
|
||||
|
||||
current_pos = pos;
|
||||
url->Append (buffer.String() + marker, url_length);
|
||||
}
|
||||
|
||||
current_pos = pos;
|
||||
|
||||
return marker < buffer.Length() ? marker : B_ERROR;
|
||||
}
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is The Vision Team.
|
||||
* Portions created by The Vision Team are
|
||||
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Todd Lair
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef URLCRUNCH_H_
|
||||
#define URLCRUNCH_H_
|
||||
|
||||
|
@ -30,11 +30,11 @@ class URLCrunch
|
|||
BString buffer;
|
||||
int32 current_pos;
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
URLCrunch (const char *, int32);
|
||||
~URLCrunch (void);
|
||||
int32 Crunch (BString *);
|
||||
URLCrunch (const char*, int32);
|
||||
~URLCrunch (void);
|
||||
int32 Crunch (BString*);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
* The Initial Developer of the Original Code is The Vision Team.
|
||||
* Portions created by The Vision Team are
|
||||
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Wade Majors <wade@ezri.org>
|
||||
* Todd Lair
|
||||
* Andrew Bazan
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
|
@ -33,287 +33,277 @@
|
|||
const float doubleClickThresh = 6;
|
||||
|
||||
BString
|
||||
GetWord (const char *cData, int32 wordNeeded)
|
||||
GetWord (const char* cData, int32 wordNeeded)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Get word number {wordNeeded} from {cData}
|
||||
* (space delimited)
|
||||
*/
|
||||
|
||||
BString data (cData);
|
||||
BString buffer ("-9z99");
|
||||
int32 wordAt (1), place (0);
|
||||
/*
|
||||
* Function purpose: Get word number {wordNeeded} from {cData}
|
||||
* (space delimited)
|
||||
*/
|
||||
|
||||
while (wordAt != wordNeeded && place != B_ERROR)
|
||||
{
|
||||
if ((place = data.FindFirst ('\x20', place)) != B_ERROR)
|
||||
if (++place < data.Length()
|
||||
&& data[place] != '\x20')
|
||||
++wordAt;
|
||||
}
|
||||
BString data (cData);
|
||||
BString buffer ("-9z99");
|
||||
int32 wordAt (1), place (0);
|
||||
|
||||
if (wordAt == wordNeeded
|
||||
&& place != B_ERROR
|
||||
&& place < data.Length())
|
||||
{
|
||||
int32 end (data.FindFirst ('\x20', place));
|
||||
while (wordAt != wordNeeded && place != B_ERROR) {
|
||||
if ((place = data.FindFirst ('\x20', place)) != B_ERROR)
|
||||
if (++place < data.Length()
|
||||
&& data[place] != '\x20')
|
||||
++wordAt;
|
||||
}
|
||||
|
||||
if (end == B_ERROR)
|
||||
end = data.Length();
|
||||
if (wordAt == wordNeeded
|
||||
&& place != B_ERROR
|
||||
&& place < data.Length()) {
|
||||
int32 end (data.FindFirst ('\x20', place));
|
||||
|
||||
data.CopyInto (buffer, place, end - place);
|
||||
}
|
||||
if (end == B_ERROR)
|
||||
end = data.Length();
|
||||
|
||||
return buffer;
|
||||
data.CopyInto (buffer, place, end - place);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
BString
|
||||
GetWordColon (const char *cData, int32 wordNeeded)
|
||||
GetWordColon (const char* cData, int32 wordNeeded)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Get word number {wordNeeded} from {cData}
|
||||
* (colon delimited)
|
||||
*/
|
||||
|
||||
BString data (cData);
|
||||
BString buffer ("-9z99");
|
||||
int32 wordAt (1), place (0);
|
||||
/*
|
||||
* Function purpose: Get word number {wordNeeded} from {cData}
|
||||
* (colon delimited)
|
||||
*/
|
||||
|
||||
while (wordAt != wordNeeded && place != B_ERROR)
|
||||
{
|
||||
if ((place = data.FindFirst (':', place)) != B_ERROR)
|
||||
if (++place < data.Length()
|
||||
&& data[place] != ':')
|
||||
++wordAt;
|
||||
}
|
||||
BString data (cData);
|
||||
BString buffer ("-9z99");
|
||||
int32 wordAt (1), place (0);
|
||||
|
||||
if (wordAt == wordNeeded
|
||||
&& place != B_ERROR
|
||||
&& place < data.Length())
|
||||
{
|
||||
int32 end (data.FindFirst (':', place));
|
||||
while (wordAt != wordNeeded && place != B_ERROR) {
|
||||
if ((place = data.FindFirst (':', place)) != B_ERROR)
|
||||
if (++place < data.Length()
|
||||
&& data[place] != ':')
|
||||
++wordAt;
|
||||
}
|
||||
|
||||
if (end == B_ERROR)
|
||||
end = data.Length();
|
||||
if (wordAt == wordNeeded
|
||||
&& place != B_ERROR
|
||||
&& place < data.Length()) {
|
||||
int32 end (data.FindFirst (':', place));
|
||||
|
||||
data.CopyInto (buffer, place, end - place);
|
||||
}
|
||||
if (end == B_ERROR)
|
||||
end = data.Length();
|
||||
|
||||
return buffer;
|
||||
data.CopyInto (buffer, place, end - place);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
BString
|
||||
RestOfString (const char *cData, int32 wordStart)
|
||||
RestOfString (const char* cData, int32 wordStart)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Get word number {wordStart} from {cData}
|
||||
* append the rest of the string after {wordStart}
|
||||
* (space delimited)
|
||||
*/
|
||||
/*
|
||||
* Function purpose: Get word number {wordStart} from {cData}
|
||||
* append the rest of the string after {wordStart}
|
||||
* (space delimited)
|
||||
*/
|
||||
|
||||
BString data (cData);
|
||||
int32 wordAt (1), place (0);
|
||||
BString buffer ("-9z99");
|
||||
|
||||
while (wordAt != wordStart && place != B_ERROR)
|
||||
{
|
||||
if ((place = data.FindFirst ('\x20', place)) != B_ERROR)
|
||||
if (++place < data.Length()
|
||||
&& data[place] != '\x20')
|
||||
++wordAt;
|
||||
}
|
||||
BString data (cData);
|
||||
int32 wordAt (1), place (0);
|
||||
BString buffer ("-9z99");
|
||||
|
||||
if (wordAt == wordStart
|
||||
&& place != B_ERROR
|
||||
&& place < data.Length())
|
||||
data.CopyInto (buffer, place, data.Length() - place);
|
||||
while (wordAt != wordStart && place != B_ERROR) {
|
||||
if ((place = data.FindFirst ('\x20', place)) != B_ERROR)
|
||||
if (++place < data.Length()
|
||||
&& data[place] != '\x20')
|
||||
++wordAt;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
if (wordAt == wordStart
|
||||
&& place != B_ERROR
|
||||
&& place < data.Length())
|
||||
data.CopyInto (buffer, place, data.Length() - place);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
BString
|
||||
GetNick (const char *cData)
|
||||
GetNick (const char* cData)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Get nickname from {cData}
|
||||
*
|
||||
* Expected format: nickname!user@host.name
|
||||
*/
|
||||
|
||||
BString data (cData);
|
||||
BString theNick;
|
||||
/*
|
||||
* Function purpose: Get nickname from {cData}
|
||||
*
|
||||
* Expected format: nickname!user@host.name
|
||||
*/
|
||||
|
||||
for (int32 i = 1; i < data.Length() && data[i] != '!' && data[i] != '\x20'; ++i)
|
||||
theNick += data[i];
|
||||
BString data (cData);
|
||||
BString theNick;
|
||||
|
||||
return theNick;
|
||||
for (int32 i = 1; i < data.Length() && data[i] != '!' && data[i] != '\x20'; ++i)
|
||||
theNick += data[i];
|
||||
|
||||
return theNick;
|
||||
}
|
||||
|
||||
BString
|
||||
GetIdent (const char *cData)
|
||||
GetIdent (const char* cData)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Get identname/username from {cData}
|
||||
*
|
||||
* Expected format: nickname!user@host.name
|
||||
*/
|
||||
|
||||
BString data (GetWord(cData, 1));
|
||||
BString theIdent;
|
||||
int32 place[2];
|
||||
/*
|
||||
* Function purpose: Get identname/username from {cData}
|
||||
*
|
||||
* Expected format: nickname!user@host.name
|
||||
*/
|
||||
|
||||
if ((place[0] = data.FindFirst ('!')) != B_ERROR
|
||||
&& (place[1] = data.FindFirst ('@')) != B_ERROR)
|
||||
{
|
||||
++(place[0]);
|
||||
data.CopyInto (theIdent, place[0], place[1] - place[0]);
|
||||
}
|
||||
|
||||
return theIdent;
|
||||
BString data (GetWord(cData, 1));
|
||||
BString theIdent;
|
||||
int32 place[2];
|
||||
|
||||
if ((place[0] = data.FindFirst ('!')) != B_ERROR
|
||||
&& (place[1] = data.FindFirst ('@')) != B_ERROR) {
|
||||
++(place[0]);
|
||||
data.CopyInto (theIdent, place[0], place[1] - place[0]);
|
||||
}
|
||||
|
||||
return theIdent;
|
||||
}
|
||||
|
||||
BString
|
||||
GetAddress (const char *cData)
|
||||
GetAddress (const char* cData)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Get address/hostname from {cData}
|
||||
*
|
||||
* Expected format: nickname!user@host.name
|
||||
*/
|
||||
/*
|
||||
* Function purpose: Get address/hostname from {cData}
|
||||
*
|
||||
* Expected format: nickname!user@host.name
|
||||
*/
|
||||
|
||||
BString data (GetWord(cData, 1));
|
||||
BString address;
|
||||
int32 place;
|
||||
BString data (GetWord(cData, 1));
|
||||
BString address;
|
||||
int32 place;
|
||||
|
||||
if ((place = data.FindFirst ('@')) != B_ERROR)
|
||||
{
|
||||
int32 length (data.FindFirst ('\x20', place));
|
||||
if ((place = data.FindFirst ('@')) != B_ERROR) {
|
||||
int32 length (data.FindFirst ('\x20', place));
|
||||
|
||||
if (length == B_ERROR)
|
||||
length = data.Length();
|
||||
if (length == B_ERROR)
|
||||
length = data.Length();
|
||||
|
||||
++place;
|
||||
data.CopyInto (address, place, length - place);
|
||||
}
|
||||
++place;
|
||||
data.CopyInto (address, place, length - place);
|
||||
}
|
||||
|
||||
return address;
|
||||
return address;
|
||||
}
|
||||
|
||||
BString
|
||||
TimeStamp()
|
||||
{
|
||||
/*
|
||||
* Function purpose: Return the timestamp string
|
||||
*
|
||||
*/
|
||||
|
||||
// if(!vision_app->GetBool ("timestamp"))
|
||||
// return "";
|
||||
|
||||
// const char *ts_format (vision_app->GetString ("timestamp_format"));
|
||||
const char *ts_format = "[%H:%M]";
|
||||
/*
|
||||
* Function purpose: Return the timestamp string
|
||||
*
|
||||
*/
|
||||
|
||||
time_t myTime (time (0));
|
||||
tm curTime;
|
||||
localtime_r (&myTime, &curTime);
|
||||
|
||||
char tempTime[32];
|
||||
tempTime[strftime (tempTime, 31, ts_format, &curTime)] = '\0';
|
||||
|
||||
return BString (tempTime).Append('\x20', 1);
|
||||
// if(!vision_app->GetBool ("timestamp"))
|
||||
// return "";
|
||||
|
||||
// const char *ts_format (vision_app->GetString ("timestamp_format"));
|
||||
const char* ts_format = "[%H:%M]";
|
||||
|
||||
time_t myTime (time (0));
|
||||
tm curTime;
|
||||
localtime_r (&myTime, &curTime);
|
||||
|
||||
char tempTime[32];
|
||||
tempTime[strftime (tempTime, 31, ts_format, &curTime)] = '\0';
|
||||
|
||||
return BString (tempTime).Append('\x20', 1);
|
||||
}
|
||||
|
||||
|
||||
BString
|
||||
ExpandKeyed (
|
||||
const char *incoming,
|
||||
const char *keys,
|
||||
const char **expansions)
|
||||
const char* incoming,
|
||||
const char* keys,
|
||||
const char** expansions)
|
||||
{
|
||||
BString buffer;
|
||||
BString buffer;
|
||||
|
||||
while (incoming && *incoming)
|
||||
{
|
||||
if (*incoming == '$')
|
||||
{
|
||||
const char *place;
|
||||
while (incoming && *incoming) {
|
||||
if (*incoming == '$') {
|
||||
const char* place;
|
||||
|
||||
++incoming;
|
||||
++incoming;
|
||||
|
||||
if ((place = strchr (keys, *incoming)) != 0)
|
||||
buffer += expansions[place - keys];
|
||||
else
|
||||
buffer += *incoming;
|
||||
}
|
||||
else
|
||||
buffer += *incoming;
|
||||
if ((place = strchr (keys, *incoming)) != 0)
|
||||
buffer += expansions[place - keys];
|
||||
else
|
||||
buffer += *incoming;
|
||||
} else
|
||||
buffer += *incoming;
|
||||
|
||||
++incoming;
|
||||
}
|
||||
++incoming;
|
||||
}
|
||||
|
||||
buffer += "\n";
|
||||
buffer += "\n";
|
||||
|
||||
return buffer;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
BString
|
||||
StringToURI (const char *string)
|
||||
StringToURI (const char* string)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Converts {string} to a URI safe format
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Function purpose: Converts {string} to a URI safe format
|
||||
*
|
||||
*/
|
||||
|
||||
BString buffer (string);
|
||||
buffer.ToLower();
|
||||
buffer.ReplaceAll ("%", "%25"); // do this first!
|
||||
buffer.ReplaceAll ("\n", "%20");
|
||||
buffer.ReplaceAll (" ", "%20");
|
||||
buffer.ReplaceAll ("\"", "%22");
|
||||
buffer.ReplaceAll ("#", "%23");
|
||||
buffer.ReplaceAll ("@", "%40");
|
||||
buffer.ReplaceAll ("`", "%60");
|
||||
buffer.ReplaceAll (":", "%3A");
|
||||
buffer.ReplaceAll ("<", "%3C");
|
||||
buffer.ReplaceAll (">", "%3E");
|
||||
buffer.ReplaceAll ("[", "%5B");
|
||||
buffer.ReplaceAll ("\\", "%5C");
|
||||
buffer.ReplaceAll ("]", "%5D");
|
||||
buffer.ReplaceAll ("^", "%5E");
|
||||
buffer.ReplaceAll ("{", "%7B");
|
||||
buffer.ReplaceAll ("|", "%7C");
|
||||
buffer.ReplaceAll ("}", "%7D");
|
||||
buffer.ReplaceAll ("~", "%7E");
|
||||
return buffer;
|
||||
BString buffer (string);
|
||||
buffer.ToLower();
|
||||
buffer.ReplaceAll ("%", "%25"); // do this first!
|
||||
buffer.ReplaceAll ("\n", "%20");
|
||||
buffer.ReplaceAll (" ", "%20");
|
||||
buffer.ReplaceAll ("\"", "%22");
|
||||
buffer.ReplaceAll ("#", "%23");
|
||||
buffer.ReplaceAll ("@", "%40");
|
||||
buffer.ReplaceAll ("`", "%60");
|
||||
buffer.ReplaceAll (":", "%3A");
|
||||
buffer.ReplaceAll ("<", "%3C");
|
||||
buffer.ReplaceAll (">", "%3E");
|
||||
buffer.ReplaceAll ("[", "%5B");
|
||||
buffer.ReplaceAll ("\\", "%5C");
|
||||
buffer.ReplaceAll ("]", "%5D");
|
||||
buffer.ReplaceAll ("^", "%5E");
|
||||
buffer.ReplaceAll ("{", "%7B");
|
||||
buffer.ReplaceAll ("|", "%7C");
|
||||
buffer.ReplaceAll ("}", "%7D");
|
||||
buffer.ReplaceAll ("~", "%7E");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
BString
|
||||
DurationString (int64 value)
|
||||
{
|
||||
/*
|
||||
* Function purpose: Return a duration string based on {value}
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Function purpose: Return a duration string based on {value}
|
||||
*
|
||||
*/
|
||||
|
||||
BString duration;
|
||||
bigtime_t micro = value;
|
||||
bigtime_t milli = micro/1000;
|
||||
bigtime_t sec = milli/1000;
|
||||
bigtime_t min = sec/60;
|
||||
bigtime_t hours = min/60;
|
||||
bigtime_t days = hours/24;
|
||||
bigtime_t milli = micro / 1000;
|
||||
bigtime_t sec = milli / 1000;
|
||||
bigtime_t min = sec / 60;
|
||||
bigtime_t hours = min / 60;
|
||||
bigtime_t days = hours / 24;
|
||||
|
||||
char message[512] = "";
|
||||
if (days)
|
||||
sprintf(message, "%Ld day%s ",days,days!=1?"s":"");
|
||||
|
||||
if (hours%24)
|
||||
sprintf(message, "%s%Ld hr%s ",message, hours%24,(hours%24)!=1?"s":"");
|
||||
|
||||
if (min%60)
|
||||
sprintf(message, "%s%Ld min%s ",message, min%60, (min%60)!=1?"s":"");
|
||||
sprintf(message, "%Ld day%s ", days, days != 1 ? "s" : "");
|
||||
|
||||
sprintf(message, "%s%Ld.%Ld sec%s",message, sec%60, (milli%1000), (sec%60)!=1?"s":"");
|
||||
if (hours % 24)
|
||||
sprintf(message, "%s%Ld hr%s ", message, hours % 24, (hours % 24) != 1 ? "s" : "");
|
||||
|
||||
if (min % 60)
|
||||
sprintf(message, "%s%Ld min%s ", message, min % 60, (min % 60) != 1 ? "s" : "");
|
||||
|
||||
sprintf(message, "%s%Ld.%Ld sec%s", message, sec % 60, (milli % 1000), (sec % 60) != 1 ? "s" : "");
|
||||
|
||||
duration += message;
|
||||
|
||||
|
@ -322,57 +312,56 @@ DurationString (int64 value)
|
|||
|
||||
|
||||
const char *
|
||||
RelToAbsPath (const char *append_)
|
||||
RelToAbsPath (const char* append_)
|
||||
{
|
||||
app_info ai;
|
||||
be_app->GetAppInfo (&ai);
|
||||
|
||||
BEntry entry (&ai.ref);
|
||||
BPath path;
|
||||
entry.GetPath (&path);
|
||||
path.GetParent (&path);
|
||||
path.Append (append_);
|
||||
|
||||
return path.Path();
|
||||
app_info ai;
|
||||
be_app->GetAppInfo (&ai);
|
||||
|
||||
BEntry entry (&ai.ref);
|
||||
BPath path;
|
||||
entry.GetPath (&path);
|
||||
path.GetParent (&path);
|
||||
path.Append (append_);
|
||||
|
||||
return path.Path();
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
Get440Len (const char *cData)
|
||||
Get440Len (const char* cData)
|
||||
{
|
||||
BString data (cData);
|
||||
BString data (cData);
|
||||
|
||||
if (data.Length() < 440)
|
||||
return data.Length();
|
||||
else
|
||||
{
|
||||
int32 place (data.FindLast ('\x20', 440));
|
||||
if (place == B_ERROR)
|
||||
return 440;
|
||||
return place;
|
||||
}
|
||||
if (data.Length() < 440)
|
||||
return data.Length();
|
||||
else {
|
||||
int32 place (data.FindLast ('\x20', 440));
|
||||
if (place == B_ERROR)
|
||||
return 440;
|
||||
return place;
|
||||
}
|
||||
}
|
||||
|
||||
uint16
|
||||
CheckClickCount(BPoint point, BPoint &lastClick, bigtime_t sysTime, bigtime_t &lastClickTime, int16 &clickCount)
|
||||
CheckClickCount(BPoint point, BPoint& lastClick, bigtime_t sysTime, bigtime_t& lastClickTime, int16& clickCount)
|
||||
{
|
||||
// check time and proximity
|
||||
BPoint delta = point - lastClick;
|
||||
// check time and proximity
|
||||
BPoint delta = point - lastClick;
|
||||
|
||||
bigtime_t timeDelta = sysTime - lastClickTime;
|
||||
bigtime_t timeDelta = sysTime - lastClickTime;
|
||||
|
||||
bigtime_t doubleClickSpeed;
|
||||
get_click_speed(&doubleClickSpeed);
|
||||
bigtime_t doubleClickSpeed;
|
||||
get_click_speed(&doubleClickSpeed);
|
||||
|
||||
lastClickTime = sysTime;
|
||||
lastClickTime = sysTime;
|
||||
|
||||
if (timeDelta < doubleClickSpeed
|
||||
&& fabs(delta.x) < doubleClickThresh
|
||||
&& fabs(delta.y) < doubleClickThresh)
|
||||
return (++clickCount);
|
||||
if (timeDelta < doubleClickSpeed
|
||||
&& fabs(delta.x) < doubleClickThresh
|
||||
&& fabs(delta.y) < doubleClickThresh)
|
||||
return (++clickCount);
|
||||
|
||||
lastClick = point;
|
||||
clickCount = 1;
|
||||
return clickCount;
|
||||
lastClick = point;
|
||||
clickCount = 1;
|
||||
return clickCount;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,70 +1,68 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Vision.
|
||||
*
|
||||
* The Initial Developer of the Original Code is The Vision Team.
|
||||
* Portions created by The Vision Team are
|
||||
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Wade Majors <wade@ezri.org>
|
||||
* Todd Lair
|
||||
* Andrew Bazan
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _UTILITIES_H
|
||||
#define _UTILITIES_H_
|
||||
|
||||
#include <String.h>
|
||||
|
||||
template<class T> class AutoDestructor {
|
||||
public:
|
||||
AutoDestructor(T *t)
|
||||
{
|
||||
fObject = t;
|
||||
}
|
||||
|
||||
virtual ~AutoDestructor(void)
|
||||
{
|
||||
delete fObject;
|
||||
}
|
||||
|
||||
void SetTo(T *t)
|
||||
{
|
||||
delete fObject;
|
||||
fObject = t;
|
||||
}
|
||||
|
||||
private:
|
||||
T *fObject;
|
||||
template<class T> class AutoDestructor
|
||||
{
|
||||
public:
|
||||
AutoDestructor(T* t) {
|
||||
fObject = t;
|
||||
}
|
||||
|
||||
virtual ~AutoDestructor(void) {
|
||||
delete fObject;
|
||||
}
|
||||
|
||||
void SetTo(T* t) {
|
||||
delete fObject;
|
||||
fObject = t;
|
||||
}
|
||||
|
||||
private:
|
||||
T* fObject;
|
||||
};
|
||||
|
||||
|
||||
class BMessage;
|
||||
class BPoint;
|
||||
|
||||
BString GetWord (const char *, int32);
|
||||
BString RestOfString (const char *, int32);
|
||||
BString GetNick (const char *);
|
||||
BString GetIdent (const char *);
|
||||
BString GetAddress (const char *);
|
||||
BString GetWord (const char*, int32);
|
||||
BString RestOfString (const char*, int32);
|
||||
BString GetNick (const char*);
|
||||
BString GetIdent (const char*);
|
||||
BString GetAddress (const char*);
|
||||
BString TimeStamp (void);
|
||||
BString ExpandKeyed (const char *, const char *, const char **);
|
||||
BString ExpandKeyed (const char*, const char*, const char**);
|
||||
BString DurationString (int64);
|
||||
BString StringToURI (const char *);
|
||||
const char *RelToAbsPath (const char *);
|
||||
BString GetWordColon (const char *, int32);
|
||||
int32 Get440Len (const char *);
|
||||
uint16 CheckClickCount(BPoint, BPoint &, bigtime_t, bigtime_t &, int16 &);
|
||||
BString StringToURI (const char*);
|
||||
const char* RelToAbsPath (const char*);
|
||||
BString GetWordColon (const char*, int32);
|
||||
int32 Get440Len (const char*);
|
||||
uint16 CheckClickCount(BPoint, BPoint&, bigtime_t, bigtime_t&, int16&);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Ŝarĝante…
Reference in New Issue