Editor is an invisible node used to create an edition mode. The edition mode allow user to move and resize all visible nodes. More...
#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_draw.h"
#include "../ui_input.h"
#include "../ui_nodes.h"
#include "../ui_windows.h"
#include "../ui_render.h"
#include "../ui_actions.h"
#include "ui_node_editor.h"
#include "ui_node_abstractnode.h"
#include "../../input/cl_keys.h"
#include "../../input/cl_input.h"
#include "../../renderer/r_draw.h"
Go to the source code of this file.
Enumerations | |
enum | zoneNode_t { ZONE_NONE = -1, ZONE_TOPRIGHT_CORNER, ZONE_TOPLEFT_CORNER, ZONE_BOTTOMRIGHT_CORNER, ZONE_BOTTOMLEFT_CORNER, ZONE_BODY } |
Functions | |
static void | UI_EditorNodeHighlightNode (uiNode_t *node, const vec4_t color, qboolean displayAnchor) |
static zoneNode_t | UI_EditorNodeGetElementAtPosition (uiNode_t *node, int x, int y) |
static void | UI_EditorNodeDraw (uiNode_t *node) |
static void | UI_EditorNodeDrawOverWindow (uiNode_t *node) |
static void | UI_EditorNodeCapturedMouseMove (uiNode_t *node, int x, int y) |
static void | UI_EditorNodeCapturedMouseLost (uiNode_t *node) |
Called when the node have lost the captured node. | |
static void | UI_EditorNodeMouseUp (uiNode_t *node, int x, int y, int button) |
static void | UI_EditorNodeSelectNode (uiNode_t *node, uiNode_t *selected) |
static void | UI_EditorNodeMouseDown (uiNode_t *node, int x, int y, int button) |
static void | UI_EditorNodeStart (uiNode_t *node, const uiCallContext_t *context) |
static void | UI_EditorNodeStop (uiNode_t *node, const uiCallContext_t *context) |
static void | UI_EditorNodeSelectNext (uiNode_t *node, const uiCallContext_t *context) |
static void | UI_EditorNodeSelectParent (uiNode_t *node, const uiCallContext_t *context) |
static void | UI_EditorNodeSelectFirstChild (uiNode_t *node, const uiCallContext_t *context) |
static void | UI_EditorNodeExtractNode (qFILE *file, uiNode_t *node, int depth) |
static void | UI_EditorNodeExtract_f (void) |
void | UI_RegisterEditorNode (uiBehaviour_t *behaviour) |
Variables | |
static uiNode_t * | anchoredNode = NULL |
static const vec4_t | red = {1.0, 0.0, 0.0, 1.0} |
static const vec4_t | grey = {0.8, 0.8, 0.8, 1.0} |
static const int | anchorSize = 10 |
static zoneNode_t | dragStatus = ZONE_NONE |
static int | startX |
static int | startY |
static const value_t | properties [] |
Editor is an invisible node used to create an edition mode. The edition mode allow user to move and resize all visible nodes.
Definition in file ui_node_editor.c.
enum zoneNode_t |
ZONE_NONE | |
ZONE_TOPRIGHT_CORNER | |
ZONE_TOPLEFT_CORNER | |
ZONE_BOTTOMRIGHT_CORNER | |
ZONE_BOTTOMLEFT_CORNER | |
ZONE_BODY |
Definition at line 43 of file ui_node_editor.c.
static void UI_EditorNodeCapturedMouseLost | ( | uiNode_t * | node | ) | [static] |
Called when the node have lost the captured node.
Definition at line 188 of file ui_node_editor.c.
References dragStatus, and ZONE_NONE.
Referenced by UI_RegisterEditorNode().
static void UI_EditorNodeCapturedMouseMove | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Definition at line 133 of file ui_node_editor.c.
References dragStatus, uiNode_s::pos, uiNode_s::size, startX, startY, Sys_Error(), UI_NodeSetSize(), ZONE_BODY, ZONE_BOTTOMLEFT_CORNER, ZONE_BOTTOMRIGHT_CORNER, ZONE_NONE, ZONE_TOPLEFT_CORNER, and ZONE_TOPRIGHT_CORNER.
Referenced by UI_RegisterEditorNode().
static void UI_EditorNodeDraw | ( | uiNode_t * | node | ) | [static] |
Definition at line 100 of file ui_node_editor.c.
References UI_CaptureDrawOver().
Referenced by UI_RegisterEditorNode().
static void UI_EditorNodeDrawOverWindow | ( | uiNode_t * | node | ) | [static] |
Definition at line 105 of file ui_node_editor.c.
References dragStatus, grey, mousePosX, mousePosY, qfalse, qtrue, red, uiNode_s::root, UI_EditorNodeGetElementAtPosition(), UI_EditorNodeHighlightNode(), UI_GetMouseCapture(), UI_GetNodeAtPosition(), and ZONE_NONE.
Referenced by UI_RegisterEditorNode().
static void UI_EditorNodeExtract_f | ( | void | ) | [static] |
Definition at line 329 of file ui_node_editor.c.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), FILE_WRITE, FS_CloseFile(), FS_OpenFile(), uiNode_s::name, UI_EditorNodeExtractNode(), UI_GetWindow(), and va().
Referenced by UI_RegisterEditorNode().
Definition at line 290 of file ui_node_editor.c.
References uiNode_s::behaviour, uiNode_s::firstChild, FS_Printf(), i, uiNode_s::name, uiBehaviour_s::name, uiNode_s::next, uiNode_s::pos, and uiNode_s::size.
Referenced by UI_EditorNodeExtract_f().
static zoneNode_t UI_EditorNodeGetElementAtPosition | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Definition at line 76 of file ui_node_editor.c.
References anchorSize, uiNode_s::size, UI_NodeAbsoluteToRelativePos(), ZONE_BODY, ZONE_BOTTOMLEFT_CORNER, ZONE_BOTTOMRIGHT_CORNER, ZONE_NONE, ZONE_TOPLEFT_CORNER, and ZONE_TOPRIGHT_CORNER.
Referenced by UI_EditorNodeDrawOverWindow(), and UI_EditorNodeMouseDown().
static void UI_EditorNodeHighlightNode | ( | uiNode_t * | node, | |
const vec4_t | color, | |||
qboolean | displayAnchor | |||
) | [static] |
Definition at line 61 of file ui_node_editor.c.
References anchorSize, pos, R_DrawRect(), uiNode_s::size, UI_DrawFill(), and UI_GetNodeAbsPos().
Referenced by UI_EditorNodeDrawOverWindow().
static void UI_EditorNodeMouseDown | ( | uiNode_t * | node, | |
int | x, | |||
int | y, | |||
int | button | |||
) | [static] |
Definition at line 214 of file ui_node_editor.c.
References dragStatus, K_MOUSE1, mousePosX, mousePosY, uiNode_s::root, startX, startY, UI_EditorNodeGetElementAtPosition(), UI_EditorNodeSelectNode(), UI_GetMouseCapture(), UI_GetNodeAtPosition(), UI_MouseRelease(), ZONE_BODY, and ZONE_NONE.
Referenced by UI_RegisterEditorNode().
static void UI_EditorNodeMouseUp | ( | uiNode_t * | node, | |
int | x, | |||
int | y, | |||
int | button | |||
) | [static] |
Definition at line 193 of file ui_node_editor.c.
References dragStatus, K_MOUSE1, UI_GetMouseCapture(), and ZONE_NONE.
Referenced by UI_RegisterEditorNode().
static void UI_EditorNodeSelectFirstChild | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 281 of file ui_node_editor.c.
References dragStatus, uiNode_s::firstChild, UI_EditorNodeSelectNode(), and ZONE_NONE.
static void UI_EditorNodeSelectNext | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 263 of file ui_node_editor.c.
References dragStatus, uiNode_s::next, UI_EditorNodeSelectNode(), and ZONE_NONE.
Definition at line 202 of file ui_node_editor.c.
References Cvar_Set(), uiNode_s::name, and uiNode_s::root.
Referenced by UI_EditorNodeMouseDown(), UI_EditorNodeSelectFirstChild(), UI_EditorNodeSelectNext(), and UI_EditorNodeSelectParent().
static void UI_EditorNodeSelectParent | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 272 of file ui_node_editor.c.
References dragStatus, uiNode_s::parent, UI_EditorNodeSelectNode(), and ZONE_NONE.
static void UI_EditorNodeStart | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 253 of file ui_node_editor.c.
References UI_SetMouseCapture().
static void UI_EditorNodeStop | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 258 of file ui_node_editor.c.
References UI_MouseRelease().
void UI_RegisterEditorNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 365 of file ui_node_editor.c.
References uiBehaviour_s::capturedMouseLost, uiBehaviour_s::capturedMouseMove, Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), uiBehaviour_s::draw, uiBehaviour_s::drawOverWindow, uiBehaviour_s::extends, uiBehaviour_s::mouseDown, uiBehaviour_s::mouseUp, uiBehaviour_s::name, uiBehaviour_s::properties, UI_CompleteWithWindow(), UI_EditorNodeCapturedMouseLost(), UI_EditorNodeCapturedMouseMove(), UI_EditorNodeDraw(), UI_EditorNodeDrawOverWindow(), UI_EditorNodeExtract_f(), UI_EditorNodeMouseDown(), and UI_EditorNodeMouseUp().
uiNode_t* anchoredNode = NULL [static] |
Definition at line 53 of file ui_node_editor.c.
const int anchorSize = 10 [static] |
Definition at line 56 of file ui_node_editor.c.
Referenced by UI_EditorNodeGetElementAtPosition(), and UI_EditorNodeHighlightNode().
zoneNode_t dragStatus = ZONE_NONE [static] |
Definition at line 57 of file ui_node_editor.c.
Referenced by UI_EditorNodeCapturedMouseLost(), UI_EditorNodeCapturedMouseMove(), UI_EditorNodeDrawOverWindow(), UI_EditorNodeMouseDown(), UI_EditorNodeMouseUp(), UI_EditorNodeSelectFirstChild(), UI_EditorNodeSelectNext(), and UI_EditorNodeSelectParent().
Definition at line 55 of file ui_node_editor.c.
Referenced by UI_EditorNodeDrawOverWindow().
const value_t properties[] [static] |
{ {"start", V_UI_NODEMETHOD, ((size_t) UI_EditorNodeStart), 0}, {"stop", V_UI_NODEMETHOD, ((size_t) UI_EditorNodeStop), 0}, {"selectnext", V_UI_NODEMETHOD, ((size_t) UI_EditorNodeSelectNext), 0}, {"selectparent", V_UI_NODEMETHOD, ((size_t) UI_EditorNodeSelectParent), 0}, {"selectfirstchild", V_UI_NODEMETHOD, ((size_t) UI_EditorNodeSelectFirstChild), 0}, {NULL, V_NULL, 0, 0} }
Definition at line 351 of file ui_node_editor.c.
Definition at line 54 of file ui_node_editor.c.
Referenced by UI_EditorNodeDrawOverWindow().
int startX [static] |
Definition at line 58 of file ui_node_editor.c.
Referenced by UI_EditorNodeCapturedMouseMove(), and UI_EditorNodeMouseDown().
int startY [static] |
Definition at line 59 of file ui_node_editor.c.
Referenced by UI_EditorNodeCapturedMouseMove(), and UI_EditorNodeMouseDown().