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_INPUT_H 00026 #define CLIENT_UI_UI_INPUT_H 00027 00028 /* prototype */ 00029 struct uiNode_s; 00030 00031 #define UI_MAX_KEYBINDING 128 00032 00033 typedef struct uiKeyBinding_s { 00034 struct uiNode_s *node; 00035 const struct value_s *property; 00036 int key; 00037 struct uiKeyBinding_s *next; /* next binding from the window list */ 00038 } uiKeyBinding_t; 00039 00040 void UI_SetKeyBinding(const char* path, int key); 00041 00042 /* mouse input */ 00043 void UI_MouseWheel(qboolean down, int x, int y); 00044 void UI_MouseMove(int x, int y); 00045 void UI_MouseDown(int x, int y, int button); 00046 void UI_MouseUp(int x, int y, int button); 00047 void UI_InvalidateMouse(void); 00048 qboolean UI_CheckMouseMove(void); 00049 struct uiNode_s *UI_GetHoveredNode(void); 00050 00051 /* focus */ 00052 void UI_RequestFocus(struct uiNode_s* node); 00053 qboolean UI_HasFocus(const struct uiNode_s* node); 00054 void UI_RemoveFocus(void); 00055 qboolean UI_KeyPressed(unsigned int key, unsigned short unicode); 00056 int UI_GetKeyBindingCount(void); 00057 uiKeyBinding_t* UI_GetKeyBindingByIndex(int index); 00058 00059 /* mouse capture */ 00060 struct uiNode_s* UI_GetMouseCapture(void); 00061 void UI_SetMouseCapture(struct uiNode_s* node); 00062 void UI_MouseRelease(void); 00063 00064 /* all inputs */ 00065 void UI_ReleaseInput(void); 00066 00067 #endif