Atrinik Client  4.0
Data Structures | Macros | Typedefs | Enumerations
widget.h File Reference

Go to the source code of this file.

Data Structures

struct  widgetdata
 
struct  _widget_container
 
struct  _widget_label
 
struct  _widget_texture
 
struct  widget_input_struct
 
struct  _widget_container_strip
 
struct  _menu
 
struct  _menuitem
 
struct  widgetevent
 
struct  widgetmove
 
struct  widgetresize
 

Macros

#define WIDGET_REDRAW(__tmp)   __tmp->redraw = 1;
 
#define WIDGET_SHOW(_widget)   widget_show(_widget, 1);
 
#define WIDGET_SHOW_TOGGLE(_widget)   widget_show(_widget, !(_widget)->show);
 
#define WIDGET_SHOW_TOGGLE_ALL(__id)   widget_show_toggle_all(__id);
 
#define WIDGET_SHOW_CHANGE(_id, _state)
 
#define WIDGET_REDRAW_ALL(__id)   widget_redraw_all(__id);
 
#define TEXTWIN(__textwin)   ((textwin_struct *) ((__textwin)->subwidget))
 
#define WIDGET_INPUT(_widget)   ((widget_input_struct *) (_widget)->subwidget)
 
#define CONTAINER(__widget_container)   (_widget_container *) (__widget_container->subwidget)
 
#define LABEL(__widget_label)   (_widget_label *) (__widget_label->subwidget)
 
#define WIDGET_TEXTURE(__widget_texture)   (_widget_texture *) (__widget_texture->subwidget)
 
#define CONTAINER_STRIP(__widget_container_strip)   (_widget_container_strip *) ( ((_widget_container *) (__widget_container_strip->subwidget))->subcontainer)
 
#define MENU(__menu)   ((_menu *) ( (( ((_widget_container_strip *) ((_widget_container *) (__menu->subwidget))->subcontainer))->subcontainer_strip)))
 
#define MENUITEM(__menuitem)   (_menuitem *) ( (( ((_widget_container_strip *) ((_widget_container *) (__menuitem->subwidget))->subcontainer))->subcontainer_strip))
 
#define INVENTORY(_widget)   ((inventory_struct *) ((_widget)->subwidget))
 
#define WIDGET_BORDER_SIZE   1
 

Typedefs

typedef struct widgetdata widgetdata
 
typedef struct _widget_container _widget_container
 
typedef struct _widget_label _widget_label
 
typedef struct _widget_texture _widget_texture
 
typedef struct widget_input_struct widget_input_struct
 
typedef struct
_widget_container_strip 
_widget_container_strip
 
typedef struct _menu _menu
 
typedef struct _menuitem _menuitem
 
typedef enum WidgetID WidgetID
 
typedef struct widgetevent widgetevent
 
typedef struct widgetmove widgetmove
 
typedef struct widgetresize widgetresize
 

Enumerations

enum  _MEvent { MOUSE_UP = 1, MOUSE_DOWN, MOUSE_MOVE }
 
enum  WidgetID {
  MAP_ID, STAT_ID, MENU_B_ID, QUICKSLOT_ID,
  CHATWIN_ID, PDOLL_ID, PLAYER_INFO_ID, MAPNAME_ID,
  INPUT_ID, FPS_ID, MPLAYER_ID, SPELLS_ID,
  SKILLS_ID, PARTY_ID, NOTIFICATION_ID, CONTAINER_ID,
  LABEL_ID, TEXTURE_ID, BUDDY_ID, ACTIVE_EFFECTS_ID,
  PROTECTIONS_ID, MINIMAP_ID, TARGET_ID, INVENTORY_ID,
  NETWORK_GRAPH_ID, TOTAL_WIDGETS
}
 
enum  { CONTAINER_STRIP_ID = TOTAL_WIDGETS, MENU_ID, MENUITEM_ID, TOTAL_SUBWIDGETS }
 
enum  {
  RESIZE_LEFT = 1, RESIZE_TOP = 2, RESIZE_RIGHT = 4, RESIZE_BOTTOM = 8,
  RESIZE_TOPLEFT = RESIZE_TOP | RESIZE_LEFT, RESIZE_TOPRIGHT = RESIZE_TOP | RESIZE_RIGHT, RESIZE_BOTTOMRIGHT = RESIZE_BOTTOM | RESIZE_RIGHT, RESIZE_BOTTOMLEFT = RESIZE_BOTTOM | RESIZE_LEFT
}
 
enum  { MENU_NORMAL, MENU_SUBMENU, MENU_CHECKBOX, MENU_RADIO }
 
enum  { WIDGET_TEXTURE_TYPE_NONE, WIDGET_TEXTURE_TYPE_NORMAL, WIDGET_TEXTURE_TYPE_EMPTY, WIDGET_TEXTURE_TYPE_NUM }
 

Detailed Description

Widget header file.

Definition in file widget.h.

Macro Definition Documentation

#define TEXTWIN (   __textwin)    ((textwin_struct *) ((__textwin)->subwidget))

Macros to grab extended widget attributes. This works similar to inheritance.

Definition at line 417 of file widget.h.

#define WIDGET_REDRAW (   __tmp)    __tmp->redraw = 1;

Macro to redraw widget using the array.

Definition at line 398 of file widget.h.

#define WIDGET_SHOW_CHANGE (   _id,
  _state 
)
Value:
do { \
bool _state_ = _state != 0; \
for (widgetdata *_widget_ = cur_widget[_id]; _widget_ != NULL; \
_widget_ = _widget_->type_next) { \
widget_show(_widget_, _state_); \
} \
} while (0)
struct widgetdata * type_next
Definition: widget.h:101
void widget_show(widgetdata *widget, int show)
Definition: widget.c:2582
widgetdata * cur_widget[TOTAL_SUBWIDGETS]
Definition: widget.c:75

Definition at line 403 of file widget.h.

Typedef Documentation

typedef struct _menu _menu

A menu. This is a special strip container that contains the menuitems inside.

typedef struct _menuitem _menuitem

A menuitem that holds the pointer to the function that is called when it is clicked on. It is a special strip container that contains the string inside. This allows the menu to detect how long the string is so that it can resize itself to fit it on the fly.

Information about a widget container. Containers can hold widgets inside them.

A more specialized kind of container, where widgets snap into it when inserted, and where widgets are sorted into rows and columns.

typedef struct widgetdata widgetdata

Information about a widget.

typedef struct widgetevent widgetevent

Used for mouse button/move events

typedef enum WidgetID WidgetID

The widget type IDs.

typedef struct widgetmove widgetmove

This is used when moving a widget with the mouse.

typedef struct widgetresize widgetresize

This is used when resizing a widget with the mouse.

Enumeration Type Documentation

anonymous enum

The widget subtype IDs. These are derived from base widgets.

Enumerator
CONTAINER_STRIP_ID 

First element must be equal to TOTAL_WIDGETS.

TOTAL_SUBWIDGETS 

The total number of subwidgets.

Definition at line 319 of file widget.h.

anonymous enum

Widget resize flags.

Definition at line 330 of file widget.h.

anonymous enum

Menu types.

Definition at line 342 of file widget.h.

enum _MEvent

A mouse event.

Definition at line 280 of file widget.h.

enum WidgetID

The widget type IDs.

Enumerator
TOTAL_WIDGETS 

The total number of widgets.

Definition at line 287 of file widget.h.