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_WINDOW_H 00026 #define CLIENT_UI_UI_NODE_WINDOW_H 00027 00028 #include "../../../shared/mathlib.h" 00029 00030 /* prototype */ 00031 struct uiNode_s; 00032 struct uiAction_s; 00033 struct uiBehaviour_s; 00034 struct uiKeyBinding_s; 00035 00036 extern const struct uiBehaviour_s const *ui_windowBehaviour; 00037 00038 #define INDEXEDCHILD_HASH_SIZE 32 00039 00040 typedef struct node_index_s { 00041 struct uiNode_s *node; 00042 struct node_index_s *hash_next; 00043 struct node_index_s *next; 00044 } node_index_t; 00045 00049 typedef struct { 00050 int eventTime; 00051 vec2_t noticePos; 00052 qboolean dragButton; 00053 qboolean closeButton; 00054 qboolean preventTypingEscape; 00055 qboolean modal; 00056 qboolean dropdown; 00057 qboolean isFullScreen; 00058 qboolean fill; 00059 qboolean starLayout; 00061 int timeOut; 00062 int lastTime; 00064 struct uiNode_s *parent; 00067 struct uiNode_s *renderNode; 00068 00069 struct uiKeyBinding_s *keyList; 00072 struct uiAction_s *onInit; 00073 struct uiAction_s *onClose; 00074 struct uiAction_s *onTimeOut; 00076 node_index_t *index; 00077 node_index_t *index_hash[INDEXEDCHILD_HASH_SIZE]; 00078 00079 } windowExtraData_t; 00080 00081 void UI_RegisterWindowNode(struct uiBehaviour_s *behaviour); 00082 00083 qboolean UI_WindowIsFullScreen(const struct uiNode_s* const window); 00084 qboolean UI_WindowIsDropDown(const struct uiNode_s* const window); 00085 qboolean UI_WindowIsModal(const struct uiNode_s* const window); 00086 void UI_WindowNodeRegisterKeyBinding(struct uiNode_s* window, struct uiKeyBinding_s *binding); 00087 struct uiKeyBinding_s *UI_WindowNodeGetKeyBinding(const struct uiNode_s* const node, unsigned int key); 00088 void UI_WindowNodeSetRenderNode(struct uiNode_s *node, struct uiNode_s *renderNode); 00089 vec_t *UI_WindowNodeGetNoticePosition(struct uiNode_s *node); 00090 /* child index */ 00091 struct uiNode_s* UI_WindowNodeGetIndexedChild(struct uiNode_s* const node, const char* childName); 00092 qboolean UI_WindowNodeAddIndexedNode(struct uiNode_s* const node, struct uiNode_s* const child); 00093 qboolean UI_WindowNodeRemoveIndexedNode(struct uiNode_s* const node, struct uiNode_s* const child); 00094 00095 #endif