Skip to content

Commit

Permalink
Reformat: xrServerEntities
Browse files Browse the repository at this point in the history
  • Loading branch information
invokr committed Jan 15, 2017
1 parent 6852d9d commit 00c727d
Show file tree
Hide file tree
Showing 109 changed files with 13,860 additions and 14,267 deletions.
7 changes: 3 additions & 4 deletions src/xrServerEntities/InfoPortionDefs.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#pragma once


typedef shared_str INFO_DATA;
DEFINE_VECTOR(INFO_DATA, KNOWN_INFO_VECTOR, KNOWN_INFO_VECTOR_IT);

class CFindByIDPred
{
public:
CFindByIDPred(shared_str element_to_find) {element = element_to_find;}
IC bool operator () (const INFO_DATA& data) const {return data == element;}
CFindByIDPred(shared_str element_to_find) { element = element_to_find; }
IC bool operator()(const INFO_DATA& data) const { return data == element; }
private:
shared_str element;
shared_str element;
};
84 changes: 45 additions & 39 deletions src/xrServerEntities/ItemListTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,56 @@

//---------------------------------------------------------------------------

class ListItem{
friend class CListHelper;
friend class TItemList;
shared_str key;
int type;
void* item;
public:
typedef fastdelegate::FastDelegate1<ListItem*> TOnListItemFocused;
typedef fastdelegate::FastDelegate1<ListItem*> TOnClick;
TOnClick OnClickEvent;
TOnListItemFocused OnItemFocused;
TOnDrawThumbnail OnDrawThumbnail;
class ListItem
{
friend class CListHelper;
friend class TItemList;
shared_str key;
int type;
void* item;

public:
int tag;
LPVOID m_Object;
int icon_index;
u32 prop_color;
typedef fastdelegate::FastDelegate1<ListItem*> TOnListItemFocused;
typedef fastdelegate::FastDelegate1<ListItem*> TOnClick;
TOnClick OnClickEvent;
TOnListItemFocused OnItemFocused;
TOnDrawThumbnail OnDrawThumbnail;

public:
enum{
flShowCB = (1<<0),
flCBChecked = (1<<1),
flDrawThumbnail = (1<<2),
flDrawCanvas = (1<<3),
flSorted = (1<<4),
flHidden = (1<<5),
};
Flags32 m_Flags;
int tag;
LPVOID m_Object;
int icon_index;
u32 prop_color;

public:
ListItem (int _type):type(_type),prop_color(0),item(0),key(0),tag(0),icon_index(-1),OnDrawThumbnail(0),OnItemFocused(0),m_Object(0){m_Flags.zero();}
virtual ~ListItem (){};
void SetName (LPCSTR _key){key=_key;}
enum
{
flShowCB = (1 << 0),
flCBChecked = (1 << 1),
flDrawThumbnail = (1 << 2),
flDrawCanvas = (1 << 3),
flSorted = (1 << 4),
flHidden = (1 << 5),
};
Flags32 m_Flags;

IC void Visible (BOOL val){m_Flags.set(flHidden, !val);}
IC BOOL Visible () const{ return !m_Flags.test(flHidden);}
IC int Type (){return type;}
IC void* Item (){return item;}
IC LPCSTR Key (){return *key;}
IC void SetIcon (int index){icon_index=index;}
public:
ListItem(int _type)
: type(_type), prop_color(0), item(0), key(0), tag(0), icon_index(-1), OnDrawThumbnail(0), OnItemFocused(0),
m_Object(0)
{
m_Flags.zero();
}
virtual ~ListItem(){};
void SetName(LPCSTR _key) { key = _key; }
IC void Visible(BOOL val) { m_Flags.set(flHidden, !val); }
IC BOOL Visible() const { return !m_Flags.test(flHidden); }
IC int Type() { return type; }
IC void* Item() { return item; }
IC LPCSTR Key() { return *key; }
IC void SetIcon(int index) { icon_index = index; }
};

DEFINE_VECTOR (ListItem*,ListItemsVec,ListItemsIt);
DEFINE_VECTOR(ListItem*, ListItemsVec, ListItemsIt);
//---------------------------------------------------------------------------
#endif




Loading

0 comments on commit 00c727d

Please sign in to comment.