summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam NAILI2017-12-22 18:56:31 +0100
committerAdam NAILI2017-12-22 18:56:31 +0100
commit1a4d7b44eaefd7831860b2ffdf178b00af3e1c7e (patch)
treedc19f80279d7705d84d5533a54dbdee343973b6a
parenta05d3ad97d513c03d671059a5bae18487af23e24 (diff)
downloadmorpher-1a4d7b44eaefd7831860b2ffdf178b00af3e1c7e.tar.gz
Modifying signature of ClickHandler pointer of function, PrintMethod pointer of function, adding a boolean to lock a component
-rw-r--r--include/gui/component.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/gui/component.h b/include/gui/component.h
index 50aee63..dd101dc 100644
--- a/include/gui/component.h
+++ b/include/gui/component.h
@@ -1,6 +1,7 @@
1#ifndef UPEM_C_COMPONENT_H 1#ifndef UPEM_C_COMPONENT_H
2#define UPEM_C_COMPONENT_H 2#define UPEM_C_COMPONENT_H
3 3
4#include <stdbool.h>
4/** 5/**
5 * File: component.h 6 * File: component.h
6 * Windows and components handling. 7 * Windows and components handling.
@@ -8,20 +9,19 @@
8 * See also: 9 * See also:
9 * The famous OS 10 * The famous OS
10 */ 11 */
11 12struct Component;
12#include "group.h"
13 13
14/** 14/**
15 * Type: ClickHandler 15 * Type: ClickHandler
16 * Type of functions that handle mouse's clicks. 16 * Type of functions that handle mouse's clicks.
17 */ 17 */
18typedef void (*ClickHandler)(int x_pos, int y_pos); 18typedef void (*ClickHandler)(int x_pos, int y_pos, struct Component *parameter);
19 19
20/** 20/**
21 * Type: PrintMethod 21 * Type: PrintMethod
22 * Type of functions that will be used to print our component. This must be initialized by the initialization function of the component. 22 * Type of functions that will be used to print our component. This must be initialized by the initialization function of the component.
23 */ 23 */
24typedef void (*PrintMethod)(void*); 24typedef void (*PrintMethod)(struct Component *);
25 25
26/** 26/**
27 * Struct: Component 27 * Struct: Component
@@ -35,9 +35,10 @@ typedef void (*PrintMethod)(void*);
35 * click_handler - pointer of function that is called on mouse click 35 * click_handler - pointer of function that is called on mouse click
36 * print_method - pointer of function that handle the component's print 36 * print_method - pointer of function that handle the component's print
37 */ 37 */
38typedef struct { 38typedef struct Component {
39 int width, height; 39 int width, height;
40 int x_pos, y_pos; 40 int x_pos, y_pos;
41 bool activated;
41 ClickHandler click_handler; 42 ClickHandler click_handler;
42 PrintMethod print_method; 43 PrintMethod print_method;
43} Component; 44} Component;