From 1a4d7b44eaefd7831860b2ffdf178b00af3e1c7e Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Fri, 22 Dec 2017 18:56:31 +0100 Subject: Modifying signature of ClickHandler pointer of function, PrintMethod pointer of function, adding a boolean to lock a component --- include/gui/component.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include') 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 @@ #ifndef UPEM_C_COMPONENT_H #define UPEM_C_COMPONENT_H +#include /** * File: component.h * Windows and components handling. @@ -8,20 +9,19 @@ * See also: * The famous OS */ - -#include "group.h" +struct Component; /** * Type: ClickHandler * Type of functions that handle mouse's clicks. */ -typedef void (*ClickHandler)(int x_pos, int y_pos); +typedef void (*ClickHandler)(int x_pos, int y_pos, struct Component *parameter); /** * Type: PrintMethod * Type of functions that will be used to print our component. This must be initialized by the initialization function of the component. */ -typedef void (*PrintMethod)(void*); +typedef void (*PrintMethod)(struct Component *); /** * Struct: Component @@ -35,9 +35,10 @@ typedef void (*PrintMethod)(void*); * click_handler - pointer of function that is called on mouse click * print_method - pointer of function that handle the component's print */ -typedef struct { +typedef struct Component { int width, height; int x_pos, y_pos; + bool activated; ClickHandler click_handler; PrintMethod print_method; } Component; -- cgit v1.2.3