ui_node_editor.c File Reference

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"
Include dependency graph for ui_node_editor.c:

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_tanchoredNode = 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 []

Detailed Description

Editor is an invisible node used to create an edition mode. The edition mode allow user to move and resize all visible nodes.

Note:
type "mn_push editor" to use it, Escape button to close it, and "mn_extract" to extract a window to a script

Definition in file ui_node_editor.c.


Enumeration Type Documentation

enum zoneNode_t
Enumerator:
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.


Function Documentation

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]
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]
static void UI_EditorNodeExtract_f ( void   )  [static]
Note:
not moved into V_UI_NODEMETHOD because it is more a generic tool than a method of the node editor

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().

static void UI_EditorNodeExtractNode ( qFILE file,
uiNode_t node,
int  depth 
) [static]
static zoneNode_t UI_EditorNodeGetElementAtPosition ( uiNode_t node,
int  x,
int  y 
) [static]
static void UI_EditorNodeHighlightNode ( uiNode_t node,
const vec4_t  color,
qboolean  displayAnchor 
) [static]
static void UI_EditorNodeMouseDown ( uiNode_t node,
int  x,
int  y,
int  button 
) [static]
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]
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.

static void UI_EditorNodeSelectNode ( uiNode_t node,
uiNode_t selected 
) [static]
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  ) 

Variable Documentation

uiNode_t* anchoredNode = NULL [static]

Definition at line 53 of file ui_node_editor.c.

const int anchorSize = 10 [static]
zoneNode_t dragStatus = ZONE_NONE [static]
const vec4_t grey = {0.8, 0.8, 0.8, 1.0} [static]

Definition at line 55 of file ui_node_editor.c.

Referenced by UI_EditorNodeDrawOverWindow().

const value_t properties[] [static]
Initial value:
 {
    
    {"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.

const vec4_t red = {1.0, 0.0, 0.0, 1.0} [static]

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().


Generated by  doxygen 1.6.2