Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
InputArea Class Reference

Represents an input area. More...

#include <frame.h>

Inheritance diagram for InputArea:
Collaboration diagram for InputArea:

Public Member Functions

void constructor (char *defaultText, int ha, int va)
 Constructor for the input area class.
 
void load (FILE *file)
 Loads data from a file.
 
void refresh ()
 Refreshes the input area.
 
void update ()
 Updates the state of the input area.
 
void is_input_area (bool *result)
 Checks if the current area is an input area.
 
void save (FILE *file, Node *editor)
 Saves the current state of the editor node to a file.
 
void free ()
 Frees the resources allocated for the input area class.
 
- Public Member Functions inherited from Frame
void constructor (float x, int xu, float y, int yu, float w, int wu, float h, int hu, int ha, int va, int scroll, Theme *theme)
 Constructor for initializing a frame object with specified parameters.
 
void handle_dimension_unit (float *src, float *dest, int vertical, double size, int unit, double containerWidth, double containerHeight)
 Handles the conversion of dimension units for a given source and destination.
 
void init_frame ()
 Initializes the frame.
 
void load (FILE *file)
 Loads data from a file.
 
void refresh ()
 Refreshes the frame.
 
void refreshContent ()
 Refreshes the content of the frame.
 
void update ()
 Updates the state of the frame.
 
void on_resize ()
 Handles the resize event for the frame.
 
void draw_frame ()
 Draws a frame.
 
void render (mat4 modelMatrix, Shader activeShader, WorldShaders *shaders)
 Renders a frame using the provided model matrix and shader.
 
void save (FILE *file, Node *editor)
 Saves the current state of the editor node to a file.
 
void get_vao (VAO *vao)
 Retrieves the Vertex Array Object (VAO).
 
void is_gui_element (bool *result)
 Determines if the current object is a GUI element.
 
void is_button (bool *result)
 Determines if a button is pressed.
 
void is_input_area (bool *result)
 Checks if the current area is an input area.
 
void is_selectlist (bool *result)
 Checks if the current item is in the selection list.
 
void is_checkbox (bool *result)
 Checks if a condition is a checkbox.
 
bool is_radiobutton ()
 Checks if the current frame is a radio button.
 
void free ()
 Frees the resources allocated for the frame.
 
- Public Member Functions inherited from Node
void constructor ()
 Constructor for the Node class.
 
void initialize_node ()
 Initializes a node.
 
void get_glow_shader (Shader *shader)
 Retrieves the glow shader.
 
void get_settings_data (void ***ptr, int *length)
 Retrieves settings data.
 
void load ()
 Loads the necessary resources or data for the node.
 
void save (FILE *file)
 Saves the current state to the specified file.
 
void prepare_render (mat4 modelMatrix, Shader activeShader)
 Renders a node using the specified model matrix and shader.
 
void render ()
 Renders the node.
 
void update_global_position (vec3 pos, vec3 rot, vec3 scale)
 Updates the global position of a node.
 
void update (vec3 pos, vec3 rot, vec3 scale)
 Updates the position, rotation, and scale of a node.
 
void on_resize ()
 Handles the resize event for the node.
 
void free ()
 Frees the resources allocated by the object.
 
void is_cshape (bool *cshape)
 Checks if the current shape is a custom shape.
 
void is_body (bool *body)
 Sets the body status of the node.
 
void is_area (bool *area)
 Checks if the current node is within a specified area.
 
void is_render_target (bool *render_target)
 Sets the render target status.
 
void is_gui_element (bool *result)
 Determines if the current node is a GUI element.
 
void add_child (Node *child)
 Adds a child node to a parent node.
 
void add_child_and_realloc (Node *child)
 Adds a child node to a parent node and reallocates memory if necessary.
 
void remove_child (Node *child)
 Removes a child node from a parent node.
 
void remove_child_and_realloc (Node *child)
 Removes a child node from a parent node and reallocates memory if necessary.
 
void remove_child_and_free (Node *child)
 Removes a child node from a parent node and frees the memory of the child node.
 
void remove_child_and_free_and_realloc (Node *child)
 Removes a child node from a parent node, frees the memory of the child node, and reallocates memory if necessary.
 
int index_of_child (Node *child)
 Retrieves the index of a child node in a parent node's children array.
 
void print (int level)
 Prints the details of a node at a specified level of indentation.
 
void emit_ready (...)
 Emits the 'ready' signal for the node.
 
void emit_update (...)
 Emits an update event for the node.
 
void emit_signal (...)
 Emits a signal if the node has a script and the script has a signal handler.
 

Public Attributes

ButtonState state
 
char text [256]
 
char defaultText [256]
 
- Public Attributes inherited from Frame
vec4 overflow
 
vec2 relPos
 
vec2 absPos
 
vec2 scale
 
vec2 size
 
vec2 contentSize
 
vec2 scroll
 
vec2 scrollTarget
 
char unit [4]
 
char alignment [2]
 
Themetheme
 
SDL_Surface * contentSurface
 
TextureMap contentTexture
 
union { 
 
   Label *   label 
 
   Button *   button 
 
   InputArea *   inputArea 
 
   SelectList *   selectList 
 
   ImageFrame *   imageFrame 
 
   RadioButton *   radiobutton 
 
   Slider *   slider 
 
};  
 
FrameFlags flags
 
- Public Attributes inherited from Node
void * object
 
struct Node ** children
 
struct Nodeparent
 
u16 length
 
u8 type
 
u8 flags
 
vec3 pos
 
vec3 rot
 
vec3 scale
 
vec3 globalPos
 
vec3 globalRot
 
vec3 globalScale
 
Behaviorbehavior
 
BehaviorAttributeattribute
 
u8 attributes_count
 
Shader shader
 

Additional Inherited Members

- Static Public Attributes inherited from Frame
static VBO _vbo = 0
 Static variable to store the Vertex Buffer Object (VBO) identifier.
 
static VAO _vao = 0
 Static variable to store the Vertex Array Object (VAO) identifier.
 
- Static Public Attributes inherited from Node
static Shader glowShader = 0
 A static Shader variable used for glow effect.
 

Detailed Description

Represents an input area.

This structure holds information about an input area, including its state, text, and default text.

Member Function Documentation

◆ constructor()

void InputArea::constructor ( char *  defaultText,
int  ha,
int  va 
)
inline

Constructor for the input area class.

This function initializes an input area with the specified default text, horizontal alignment, and vertical alignment.

Parameters
defaultTextA pointer to a character array containing the default text to be displayed in the input area.
haAn integer representing the horizontal alignment of the input area. Possible values can be defined as constants or enums elsewhere in the code.
vaAn integer representing the vertical alignment of the input area. Possible values can be defined as constants or enums elsewhere in the code.

◆ load()

void InputArea::load ( FILE *  file)
inline

Loads data from a file.

This function reads data from the given file and processes it accordingly.

Parameters
fileA pointer to the file to be loaded.

◆ refresh()

void InputArea::refresh ( )
inline

Refreshes the input area.

This function is responsible for refreshing the input area, updating its state and rendering any necessary changes. It should be called whenever the input area needs to be redrawn or updated.

◆ update()

void InputArea::update ( )
inline

Updates the state of the input area.

This function is responsible for updating the state of the input area. It should be called whenever there is a need to refresh or change the state of the input area based on user interactions or other events.

◆ is_input_area()

void InputArea::is_input_area ( bool *  result)
inline

Checks if the current area is an input area.

This function sets the value of the provided boolean pointer to indicate whether the current area is an input area.

Parameters
resultA pointer to a boolean variable where the result will be stored.
  • true: if the current area is an input area.
  • false: otherwise.

◆ save()

void InputArea::save ( FILE *  file,
Node editor 
)
inline

Saves the current state of the editor node to a file.

This function writes the state of the given editor node to the specified file.

Parameters
fileA pointer to the FILE object where the editor node state will be saved.
editorA pointer to the Node object representing the editor node whose state is to be saved.

◆ free()

void InputArea::free ( )
inline

Frees the resources allocated for the input area class.

This function is responsible for releasing any memory or resources that were allocated for the input area class. It should be called when the input area is no longer needed to prevent memory leaks.

Member Data Documentation

◆ state

ButtonState InputArea::state

Current state of the input area.

◆ text

char InputArea::text[256]

Text entered in the input area.

◆ defaultText

char InputArea::defaultText[256]

Default text of the input area.


The documentation for this class was generated from the following files: