forked from iPodLinux-Community/Floydzilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pz.h
135 lines (114 loc) · 4.49 KB
/
pz.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
* Copyright (C) 2004 Bernard Leach
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PZ_H__
#define __PZ_H__
#define MWINCLUDECOLORS
#include "nano-X.h"
#include "appearance.h"
#define HEADER_BASELINE 15
#define HEADER_TOPLINE 20
#define KEY_CLICK 1
#define KEY_UNUSED 2
#define EVENT_UNUSED 4
#define FONT_HEIGHT 14
/* pz.c */
extern GR_SCREEN_INFO screen_info;
extern int hw_version;
void pz_draw_header(char *header);
GR_GC_ID pz_get_gc(int copy);
GR_WINDOW_ID pz_new_window(int x, int y, int w, int h, void(*do_draw)(void), int(*keystroke)(GR_EVENT * event));
void pz_close_window(GR_WINDOW_ID wid);
void pz_event_handler(GR_EVENT *event);
/* display.c */
void set_backlight_timer(void);
void set_contrast(void);
void toggle_backlight(void);
/* image.c */
int is_image_type(char *extension);
void new_image_window(char *filename);
/* message.c */
void new_message_window(char *message);
void pz_error(char *fmt, ...);
void pz_perror(char *msg);
/* dialog.c */
int dialog_create( char * title, char * text,
char * button0, char * button1, char * button2,
int timeout, int is_error );
/* use the following macros though... */
/* no timeout, messages */
#define DIALOG_MESSAGE( title, text, buttont )\
dialog_create( (title), (text), (button), NULL, NULL, 0, 0 )
#define DIALOG_MESSAGE_2( title, text, button, but1 )\
dialog_create( (title), (text), (button), (but1), NULL, 0, 0 )
#define DIALOG_MESSAGE_3( title, text, button, but1, but2 )\
dialog_create( (title), (text), (button), (but1), (but2), 0, 0 )
/* no timeout, errors */
#define DIALOG_ERROR( title, text, button )\
dialog_create( (title), (text), (button), NULL, NULL, 0, 1 )
#define DIALOG_ERROR_2( title, text, button, but1 )\
dialog_create( (title), (text), (button), (but1), NULL, 0, 1 )
#define DIALOG_ERROR_3( title, text, button, but1, but2 )\
dialog_create( (title), (text), (button), (but1), (but2), 0, 1 )
/* with timeout, messages */
#define DIALOG_MESSAGE_T( title, text, button, timeout )\
dialog_create( (title), (text), (button), NULL, NULL, timeout, 0 )
#define DIALOG_MESSAGE_T2( title, text, button, but1, timeout )\
dialog_create( (title), (text), (button), (but1), NULL, timeout, 0 )
#define DIALOG_MESSAGE_T3( title, text, button, but1, but2, timeout )\
dialog_create( (title), (text), (button), (but1), (but2), timeout, 0 )
/* with timeout, errors */
#define DIALOG_ERROR_T( title, text, button, timeout )\
dialog_create( (title), (text), (button), NULL, NULL, timeout, 1 )
#define DIALOG_ERROR_T2( title, text, button, but1, timeout )\
dialog_create( (title), (text), (button), (but1), NULL, timeout, 1 )
#define DIALOG_ERROR_T3( title, text, button, but1, but2, timeout )\
dialog_create( (title), (text), (button), (but1), (but2), timeout, 1 )
/* for the 'handle event' methods. */
#define IPOD_BUTTON_ACTION ('\r')
#define IPOD_BUTTON_MENU ('m')
#define IPOD_BUTTON_REWIND ('w')
#define IPOD_BUTTON_FORWARD ('f')
#define IPOD_BUTTON_PLAY ('d')
#define IPOD_SWITCH_HOLD ('h')
#define IPOD_WHEEL_CLOCKWISE ('r')
#define IPOD_WHEEL_ANTICLOCKWISE ('l')
#define IPOD_WHEEL_COUNTERCLOCKWISE ('l')
#define IPOD_REMOTE_PLAY ('1')
#define IPOD_REMOTE_VOL_UP ('2')
#define IPOD_REMOTE_VOL_DOWN ('3')
#define IPOD_REMOTE_FORWARD ('4')
#define IPOD_REMOTE_REWIND ('5')
/* locale stuff */
#ifdef LOCALE
#include <libintl.h>
#include <locale.h>
#ifdef IPOD
#ifndef __UCLIBC_HAS_LOCALE__
#error "You need to update your toolchain if you wish to have locale support. (http://ipodlinux.org/Toolchain)"
#endif /* !__UCLIBC_HAS_LOCALE__ */
#define LOCALEDIR "/usr/share/locale"
#else /* !IPOD */
#define LOCALEDIR "./locale"
#endif /* IPOD */
#define _(String) gettext(String)
#else /* !LOCALE */
#define _(String) String
#define gettext(String) String
#endif /* LOCALE */
#define N_(String) String
#endif /* !__PZ_H__ */