1 #ifndef FENETRE_BY_KLEVH 2 #define FENETRE_BY_KLEVH 12 #include <SDL2/SDL_ttf.h> 13 #include <SDL2/SDL_image.h> 15 #ifdef DEBUG_SDL2_NO_VIDEO 16 extern Uint32 currentDisplaied;
28 #define absolu(a) ((a>0)?a:-a) 52 void (*keyPress)(SDL_Keycode c);
54 void (*keyReleased)(SDL_Keycode c);
58 void (*onFocus)(void);
60 void (*unFocus)(void);
62 void (*onMouseMotion)(int, int);
85 #ifndef DEBUG_SDL2_NO_VIDEO int setOnWheelWindow(void(*onWheel)(int))
set behavior of window when a wheel event occure
Definition: Window.c:344
int getOriginWindow(int *x, int *y)
get the origin point of the current window
Definition: Window.c:388
int getIDCurrentWindow(Uint32 *ID)
Getter for the current window ID.
Definition: Window.c:260
Window * current
Definition: Window.h:133
int getDataWindow(void **data)
get the data package of a window
Definition: Window.c:429
List (display code) of list (plan) of element.
Definition: Element.h:169
int initWidth
Definition: Window.h:77
int setXOriginWindow(int x)
set the x coordinate of the origin point of the current window
Definition: Window.c:408
EventWindow events
Definition: Window.h:98
int stop
Definition: Window.h:114
Behaviors of a window to events.
Definition: Window.h:45
Uint32 initIteratorWindow()
Initialise the iterator of the windows' list.
Definition: Window.c:134
int close
Definition: Window.h:104
Uint32 ticks
Definition: Window.h:120
int focused
Definition: Window.h:118
struct ListElement * liste
Definition: Window.h:96
int setUnFocusedWindow(void(*unFocus)(void))
set behavior of window when the window lose focus
Definition: Window.c:377
int setDisplayCodeWindow(int displayCode)
Change the display code of the current window.
Definition: Window.c:122
int displayCode
Definition: Window.h:79
struct Window * next
Definition: Window.h:100
int setOnMouseMotionWindow(void(*onMouseMotion)(int, int))
set behavior of window when a wheel event occure
Definition: Window.c:355
List of list (display code) of list (plan) of elements.
Definition: Element.h:184
int getIDWindow(Uint32 *ID)
Getter for the currently displaied window ID.
Definition: Window.c:247
int setDataWindow(void *data)
set the data package of a window
Definition: Window.c:422
int setColorWindow(const int color[4])
Change the background color of the current window.
Definition: Window.c:198
SDL_Window * window
Definition: Window.h:86
int setYOriginWindow(int y)
set the y coordinate of the origin point of the current window
Definition: Window.c:415
SANDAL2 window.
Definition: Window.h:70
int setOriginWindow(int x, int y)
set the origin point of the current window
Definition: Window.c:399
struct ListDCElement * current
Definition: Window.h:110
int setKeyReleasedWindow(void(*keyReleased)(SDL_Keycode c))
set the behaviour of the current window when a key is released
Definition: Window.c:311
unsigned count
Definition: Window.h:137
int setActionWindow(void(*action)(void))
set the continuous behaviour of the current window
Definition: Window.c:289
int state
Definition: Window.h:116
int getDimensionWindow(int *w, int *h)
Put the width of the current window in w (if not NULL) and its height in h (if not NULL) ...
Definition: Window.c:158
int getRealDimensionWindow(int *width, int *height)
Getter for the real dimension of the current window (do not use this function to calculate elements' ...
Definition: Window.c:231
void * data
Definition: Window.h:112
int setDisplayWindow(Uint32 windowID)
set the window to be displaied and the current window
Definition: Window.c:437
int setCoordWindow(int x, int y)
Set for the current window position.
Definition: Window.c:220
int getDisplayCodeWindow(int *d)
Put the display code of the current window in d (if not NULL)
Definition: Window.c:174
int setKeyPressedWindow(void(*keyPress)(SDL_Keycode c))
set the behaviour of the current window when a key is pressed
Definition: Window.c:300
int getCoordWindow(int *x, int *y)
Getter for the current window position.
Definition: Window.c:209
Window * currentDisplay
Definition: Window.h:135
Window * first
Definition: Window.h:129
int setOnFocusedWindow(void(*onFocus)(void))
set behavior of window when the window gain focus
Definition: Window.c:366
unsigned toDelete
Definition: Window.h:102
Window * last
Definition: Window.h:131
int initHeight
Definition: Window.h:75
SDL_Renderer * renderer
Definition: Window.h:94
int setOnClickWindow(void(*onCLick)(int))
set the behaviour of the current window when it is clicked
Definition: Window.c:322
ListWindow * _windows_SANDAL2
list of windows WARNING : do not touch this variable, never ... trust me
Definition: Window.c:3
Uint32 nextWindow()
Go to the next window.
Definition: Window.c:145
int origin[2]
Definition: Window.h:83
int getColorWindow(int color[4])
Put the background color of the current window in color.
Definition: Window.c:187
int resizeWindow(unsigned width, unsigned height)
Resize the current window.
Definition: Window.c:109
int background[4]
Definition: Window.h:81
int width
Definition: Window.h:73
int setUnClickWindow(void(*unCLick)(int))
set the behaviour of the current window when it is unclicked
Definition: Window.c:333
int displayToChange
Definition: Window.h:108
int setIconWindow(const char *icon_path)
Set the current window's icon.
Definition: Window.c:273
list of windows
Definition: Window.h:128
int height
Definition: Window.h:71
int newDisplayCode
Definition: Window.h:106