ui_node_panel.h

Go to the documentation of this file.
00001 
00005 /*
00006 Copyright (C) 2002-2010 UFO: Alien Invasion.
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017 See the GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023 */
00024 
00025 #ifndef CLIENT_UI_UI_NODE_PANEL_H
00026 #define CLIENT_UI_UI_NODE_PANEL_H
00027 
00028 #include "ui_node_abstractscrollable.h"
00029 
00030 struct uiNode_s;
00031 struct uiBehaviour_s;
00032 
00033 typedef enum {
00034     LAYOUT_NONE,
00035     LAYOUT_TOP_DOWN_FLOW,
00036     LAYOUT_BORDER,
00037     LAYOUT_PACK,
00038     LAYOUT_STAR,
00039     LAYOUT_CLIENT,
00040     LAYOUT_COLUMN,
00041 
00042     LAYOUT_MAX,
00043     LAYOUT_ENSURE_32BIT = 0x7FFFFFFF
00044 } panelLayout_t;
00045 
00046 typedef enum {
00047     LAYOUTALIGN_NONE = 0,
00048 
00049     /* vertical and horizontal flag bits */
00050     LAYOUTALIGN_H_MASK    = 0x03,
00051     LAYOUTALIGN_H_LEFT    = 0x01,
00052     LAYOUTALIGN_H_MIDDLE  = 0x02,
00053     LAYOUTALIGN_H_RIGHT   = 0x03,
00054     LAYOUTALIGN_V_MASK    = 0x0C,
00055     LAYOUTALIGN_V_TOP     = 0x04,
00056     LAYOUTALIGN_V_MIDDLE  = 0x08,
00057     LAYOUTALIGN_V_BOTTOM  = 0x0C,
00058 
00059     /* common alignment */
00060     LAYOUTALIGN_TOPLEFT     = LAYOUTALIGN_V_TOP | LAYOUTALIGN_H_LEFT,
00061     LAYOUTALIGN_TOP         = LAYOUTALIGN_V_TOP | LAYOUTALIGN_H_MIDDLE,
00062     LAYOUTALIGN_TOPRIGHT    = LAYOUTALIGN_V_TOP | LAYOUTALIGN_H_RIGHT,
00063     LAYOUTALIGN_LEFT        = LAYOUTALIGN_V_MIDDLE | LAYOUTALIGN_H_LEFT,
00064     LAYOUTALIGN_MIDDLE      = LAYOUTALIGN_V_MIDDLE | LAYOUTALIGN_H_MIDDLE,
00065     LAYOUTALIGN_RIGHT       = LAYOUTALIGN_V_MIDDLE | LAYOUTALIGN_H_RIGHT,
00066     LAYOUTALIGN_BOTTOMLEFT  = LAYOUTALIGN_V_BOTTOM | LAYOUTALIGN_H_LEFT,
00067     LAYOUTALIGN_BOTTOM      = LAYOUTALIGN_V_BOTTOM | LAYOUTALIGN_H_MIDDLE,
00068     LAYOUTALIGN_BOTTOMRIGHT = LAYOUTALIGN_V_BOTTOM | LAYOUTALIGN_H_RIGHT,
00069 
00070     /* special align, everything bigger 0x10 */
00071     LAYOUTALIGN_SPECIAL     = 0x10,
00072 
00073     /* pack and star layout manager only */
00074     LAYOUTALIGN_FILL,
00075 
00076     LAYOUTALIGN_MAX,
00077     LAYOUTALIGN_ENSURE_32BIT = 0x7FFFFFFF
00078 } layoutAlign_t;
00079 
00084 #define UI_GET_VERTICAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_V_MASK & align))
00085 
00089 #define UI_GET_HORIZONTAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_H_MASK & align))
00090 
00094 typedef struct {
00095     abstractScrollableExtraData_t super;
00096     panelLayout_t layout;   
00097     int layoutMargin;       
00098     int layoutColumns;      
00099 } panelExtraData_t;
00100 
00101 void UI_RegisterPanelNode(struct uiBehaviour_s *behaviour);
00102 
00103 void UI_StarLayout(struct uiNode_s *node);
00104 
00105 #endif

Generated by  doxygen 1.6.2