Statistics
| Branch: | Revision:

chunker-player / chunker_player / player_gui.h @ 10c75ef7

History | View | Annotate | Download (2.85 KB)

1
#ifndef _CHUNKER_PLAYER_GUI_H
2
#define _CHUNKER_PLAYER_GUI_H
3

    
4
#include "player_defines.h"
5
#include "player_core.h"
6
#include "chunker_player.h"
7
#include <SDL.h>
8
// #include <SDL_thread.h>
9
#include <SDL_mutex.h>
10
#include <SDL_ttf.h>
11
#include <SDL_image.h>
12
// #include <SDL_video.h>
13

    
14
typedef struct SButton
15
{
16
        int Hover;
17
        int Visible;
18
        int XOffset;
19
        SDL_Rect ButtonIconBox;
20
        SDL_Surface* ButtonIcon;
21
        SDL_Surface* ButtonHoverIcon;
22
        struct SButton* ToggledButton;
23
        void (*HoverCallback)();
24
        void (*LButtonUpCallback)();
25
} SButton;
26

    
27
int FullscreenWidth;
28
int FullscreenHeight;
29

    
30
float ratio;
31
SDL_Cursor *defaultCursor;
32
SDL_Cursor *handCursor;
33

    
34
SDL_Cursor *InitSystemCursor(const char *image[]);
35
void AspectRatioResize(float aspect_ratio, int width, int height, int* out_width, int* out_height);
36
int ChunkerPlayerGUI_Init();
37
void ChunkerPlayerGUI_Close();
38
void ChunkerPlayerGUI_HandleResize(int w, int h);
39
void ChunkerPlayerGUI_HandleGetFocus();
40
void ChunkerPlayerGUI_HandleMouseMotion(int x, int y);
41
void ChunkerPlayerGUI_HandleLButton(int x, int y);
42
void ChunkerPlayerGUI_HandleKey();
43
void ChunkerPlayerGUI_SetupOverlayRect(SChannel* channel);
44
void ChunkerPlayerGUI_ForceResize(int w, int h);
45
// void ChunkerPlayerGUI_HandleChannelChanged(SChannel* channel);
46
void ChunkerPlayerGUI_SetChannelTitle(char* title);
47
void RedrawButtons();
48
void ChunkerPlayerGUI_ToggleFullscreen();
49
void UpdateOverlaySize(float aspect_ratio, int width, int height);
50
void GetScreenSizeFromOverlay(int overlayWidth, int overlayHeight, int* screenWidth, int* screenHeight);
51
// void ZapDown();
52
// void ZapUp();
53

    
54
SButton Buttons[NBUTTONS];
55

    
56
/* XPM */
57
static char *handXPM[] = {
58
/* columns rows colors chars-per-pixel */
59
"32 32 3 1",
60
"  c black",
61
". c gray100",
62
"X c None",
63
/* pixels */
64
"XXXXX  XXXXXXXXXXXXXXXXXXXXXXXXX",
65
"XXXX .. XXXXXXXXXXXXXXXXXXXXXXXX",
66
"XXXX .. XXXXXXXXXXXXXXXXXXXXXXXX",
67
"XXXX .. XXXXXXXXXXXXXXXXXXXXXXXX",
68
"XXXX .. XXXXXXXXXXXXXXXXXXXXXXXX",
69
"XXXX ..   XXXXXXXXXXXXXXXXXXXXXX",
70
"XXXX .. ..   XXXXXXXXXXXXXXXXXXX",
71
"XXXX .. .. ..  XXXXXXXXXXXXXXXXX",
72
"XXXX .. .. .. . XXXXXXXXXXXXXXXX",
73
"   X .. .. .. .. XXXXXXXXXXXXXXX",
74
" ..  ........ .. XXXXXXXXXXXXXXX",
75
" ... ........... XXXXXXXXXXXXXXX",
76
"X .. ........... XXXXXXXXXXXXXXX",
77
"XX . ........... XXXXXXXXXXXXXXX",
78
"XX ............. XXXXXXXXXXXXXXX",
79
"XXX ............ XXXXXXXXXXXXXXX",
80
"XXX ........... XXXXXXXXXXXXXXXX",
81
"XXXX .......... XXXXXXXXXXXXXXXX",
82
"XXXX .......... XXXXXXXXXXXXXXXX",
83
"XXXXX ........ XXXXXXXXXXXXXXXXX",
84
"XXXXX ........ XXXXXXXXXXXXXXXXX",
85
"XXXXX          XXXXXXXXXXXXXXXXX",
86
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
87
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
88
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
89
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
90
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
91
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
92
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
93
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
94
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
95
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
96
"0,0"
97
};
98

    
99
#endif