PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/include/ttk/ttk.h

https://github.com/MostAwesomeDude/ttk
C Header | 515 lines | 423 code | 58 blank | 34 comment | 12 complexity | ca46eac42fa762b82c2b752bd2a90d13 MD5 | raw file
Possible License(s): GPL-2.0
  1. /*
  2. * Copyright (c) 2005 Joshua Oreman
  3. *
  4. * This file is a part of TTK.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. */
  20. #ifndef _TTK_H_
  21. #define _TTK_H_
  22. #define TTK_POD_X11 0
  23. #define TTK_POD_1G 01
  24. #define TTK_POD_2G 02
  25. #define TTK_POD_3G 04
  26. #define TTK_POD_PP5002 07
  27. #define TTK_POD_4G 010
  28. #define TTK_POD_MINI_1G 020
  29. #define TTK_POD_PHOTO 040
  30. #define TTK_POD_PP5020 070
  31. #define TTK_POD_MINI_2G 0100
  32. #define TTK_POD_MINI 0120
  33. #define TTK_POD_NANO 0200
  34. #define TTK_POD_VIDEO 0400
  35. #define TTK_POD_PP5022 0700 /* also includes 5021 */
  36. #define TTK_POD_SANSA 01000
  37. #define TTK_POD_PP5024 07000
  38. #define TTK_POD_PP502X 07770
  39. #define TTK_BUTTON_ACTION '\n'
  40. #define TTK_BUTTON_PREVIOUS 'w'
  41. #define TTK_BUTTON_NEXT 'f'
  42. #define TTK_BUTTON_MENU 'm'
  43. #define TTK_BUTTON_PLAY 'd'
  44. #define TTK_BUTTON_HOLD 'h'
  45. #define TTK_MOVE_ABS 0
  46. #define TTK_MOVE_REL 1
  47. #define TTK_MOVE_END 2
  48. #define TTK_DIRTY_HEADER 1
  49. #define TTK_DIRTY_WINDOWAREA 2
  50. #define TTK_DIRTY_SCREEN 4
  51. #define TTK_DIRTY_INPUT 8
  52. #define TTK_FILTHY 15
  53. extern int ttk_dirty;
  54. #define TTK_INPUT_ENTER '\r'
  55. #define TTK_INPUT_BKSP '\b'
  56. #define TTK_INPUT_LEFT '\1'
  57. #define TTK_INPUT_RIGHT '\2'
  58. #define TTK_INPUT_END '\0'
  59. struct TWidget;
  60. struct TWindow;
  61. struct TWidgetList;
  62. #define TTK_NO_BACKGROUND -1
  63. typedef struct _ttk_timer
  64. {
  65. int started;
  66. int delay;
  67. void (*fn)();
  68. struct _ttk_timer *next;
  69. } *ttk_timer;
  70. typedef unsigned short uc16;
  71. #ifdef SDL
  72. #include "SDL.h"
  73. #include "SDL_image.h"
  74. #include "ttk/SDL_gfxPrimitives.h"
  75. #include "ttk/SDL_rotozoom.h"
  76. typedef Uint32 ttk_color;
  77. #ifndef NO_TF
  78. #include "SDL_ttf.h"
  79. #endif
  80. #ifndef NO_SF
  81. #include "SFont.h"
  82. #endif
  83. struct Bitmap_Font;
  84. struct _TTF_Font;
  85. typedef SDL_Surface *ttk_surface;
  86. typedef struct _ttk_font {
  87. #ifndef NO_SF
  88. SFont_Font *sf;
  89. SFont_Font *sfi; // inverted
  90. #endif
  91. struct Bitmap_Font *bf;
  92. #ifndef NO_TF
  93. struct _TTF_Font *tf;
  94. #endif
  95. void (*draw)(struct _ttk_font *, ttk_surface, int, int, ttk_color, const char *);
  96. void (*draw_lat1)(struct _ttk_font *, ttk_surface, int, int, ttk_color, const char *);
  97. void (*draw_uc16)(struct _ttk_font *, ttk_surface, int, int, ttk_color, const uc16 *);
  98. int (*width)(struct _ttk_font *, const char *);
  99. int (*width_lat1)(struct _ttk_font *, const char *);
  100. int (*width_uc16)(struct _ttk_font *, const uc16 *);
  101. void (*free)(struct _ttk_font *);
  102. int height;
  103. int ofs;
  104. struct ttk_fontinfo *fi;
  105. } * ttk_font;
  106. typedef struct ttk_point { int x, y; } ttk_point;
  107. typedef struct _ttk_gc
  108. {
  109. int fg, bg, usebg, xormode;
  110. ttk_font font;
  111. } *ttk_gc;
  112. #elif defined(MWIN)
  113. #include "nano-X.h"
  114. typedef unsigned int TTK_ID;
  115. typedef GR_COLOR ttk_color;
  116. typedef GR_POINT ttk_point;
  117. typedef TTK_ID ttk_gc;
  118. typedef TTK_ID ttk_surface;
  119. typedef struct _ttk_font
  120. {
  121. GR_FONT_ID f;
  122. GR_FONT_INFO inf;
  123. int ofs;
  124. struct ttk_fontinfo *fi;
  125. } * ttk_font;
  126. #else /* Hotdog */
  127. #include "hotdog.h"
  128. typedef uint32 ttk_color;
  129. typedef hd_surface ttk_surface;
  130. typedef hd_point ttk_point;
  131. typedef struct _ttk_font
  132. {
  133. hd_font *f;
  134. int ofs;
  135. struct ttk_fontinfo *fi;
  136. } * ttk_font;
  137. typedef struct _ttk_gc {
  138. ttk_color fg, bg;
  139. int usebg, xormode;
  140. ttk_font font;
  141. } *ttk_gc;
  142. #endif
  143. typedef struct TWidgetList
  144. {
  145. struct TWidget *v;
  146. struct TWidgetList *next;
  147. } TWidgetList;
  148. struct TApItem;
  149. typedef struct TWindow
  150. {
  151. const char *title;
  152. TWidgetList *widgets;
  153. int x, y, w, h, color;
  154. ttk_surface srf;
  155. int titlefree;
  156. int dirty;
  157. struct TApItem *background;
  158. /* readonly */ struct TWidget *focus;
  159. /* private */ struct TWidget *input;
  160. /* private */ int show_header;
  161. /* private */ int epoch;
  162. /* private */ int inbuf[32]; // circular buffer
  163. /* private */ int inbuf_start, inbuf_end;
  164. /* private */ int onscreen;
  165. int data;
  166. void *data2;
  167. } TWindow;
  168. typedef struct TWindowStack {
  169. TWindow *w;
  170. int minimized;
  171. struct TWindowStack *next;
  172. } TWindowStack;
  173. #define TTK_EV_CLICK 1
  174. #define TTK_EV_UNUSED 2
  175. #define TTK_EV_DONE 4
  176. #define TTK_EV_RET(x) ((x)<<8)
  177. /**TWidget**/
  178. typedef struct TWidget
  179. {
  180. int x, y, w, h;
  181. int focusable;
  182. int dirty;
  183. int holdtime;
  184. int keyrepeat;
  185. int rawkeys;
  186. /* readonly */ TWindow *win;
  187. /* private */ int framelast, framedelay;
  188. /* private */ int timerlast, timerdelay;
  189. void (*draw) (struct TWidget *, ttk_surface);
  190. int (*scroll) (struct TWidget *, int);
  191. int (*stap) (struct TWidget *, int);
  192. int (*button) (struct TWidget *, int, int);
  193. int (*down) (struct TWidget *, int);
  194. int (*held) (struct TWidget *, int);
  195. int (*input) (struct TWidget *, int);
  196. int (*frame) (struct TWidget *);
  197. int (*timer) (struct TWidget *);
  198. void (*destroy) (struct TWidget *);
  199. void *data;
  200. void *data2;
  201. } TWidget;
  202. typedef struct ttk_fontinfo {
  203. char file[64]; /* font file, relative to /usr/share/fonts on iPod, fonts/ on X11 */
  204. char name[64]; /* font name */
  205. int size; /* font size (px) */
  206. ttk_font f; /* the font itself */
  207. int loaded;
  208. int good;
  209. int offset;
  210. int refs;
  211. struct ttk_fontinfo *next;
  212. } ttk_fontinfo;
  213. typedef struct ttk_screeninfo {
  214. int w, h, bpp;
  215. int wx, wy;
  216. ttk_surface srf;
  217. } ttk_screeninfo;
  218. //--//
  219. extern TWindowStack *ttk_windows;
  220. extern ttk_font ttk_menufont, ttk_textfont;
  221. extern ttk_screeninfo *ttk_screen;
  222. extern ttk_fontinfo *ttk_fonts;
  223. extern int ttk_epoch;
  224. //--//
  225. int ttk_version_check (int yourver);
  226. TWindow *ttk_init();
  227. int ttk_run();
  228. void ttk_quit();
  229. int ttk_get_podversion();
  230. void ttk_get_screensize (int *w, int *h, int *bpp);
  231. void ttk_set_emulation (int w, int h, int bpp);
  232. void ttk_click_ex(int period, int duration); // the "click" sound
  233. void ttk_click(); // the "click" sound
  234. TWindow *ttk_new_window();
  235. void ttk_free_window (TWindow *win);
  236. void ttk_show_window (TWindow *win);
  237. void ttk_draw_window (TWindow *win);
  238. void ttk_popup_window (TWindow *win);
  239. void ttk_move_window (TWindow *win, int offset, int whence);
  240. int ttk_hide_window (TWindow *win);
  241. void ttk_set_popup (TWindow *win);
  242. #define ttk_popdown_window(w) ttk_hide_window(w)
  243. void ttk_window_title (TWindow *win, const char *str);
  244. #define ttk_window_set_title(w,s) ttk_window_title(w,s)
  245. void ttk_window_show_header (TWindow *win);
  246. void ttk_window_hide_header (TWindow *win);
  247. enum ttk_justification {
  248. TTK_TEXT_CENTER = 0,
  249. TTK_TEXT_LEFT,
  250. TTK_TEXT_RIGHT
  251. };
  252. void ttk_header_set_text_position( int x );
  253. void ttk_header_set_text_justification( enum ttk_justification j );
  254. TWidget *ttk_new_widget (int x, int y);
  255. void ttk_free_widget (TWidget *wid);
  256. TWindow *ttk_add_widget (TWindow *win, TWidget *wid); // returns win
  257. int ttk_remove_widget (TWindow *win, TWidget *wid);
  258. void ttk_widget_set_fps (TWidget *wid, int fps);
  259. void ttk_widget_set_inv_fps (TWidget *wid, int fps_m1);
  260. void ttk_widget_set_timer (TWidget *wid, int ms);
  261. void ttk_add_header_widget (TWidget *wid);
  262. void ttk_remove_header_widget (TWidget *wid);
  263. void ttk_set_global_event_handler (int (*fn)(int, int, int));
  264. void ttk_set_global_unused_handler (int (*fn)(int, int, int));
  265. int ttk_button_pressed (int button);
  266. void ttk_update_lcd (int xstart, int ystart, int xend, int yend, unsigned char *data);
  267. void ttk_start_cop (void (*fn)());
  268. void ttk_stop_cop();
  269. void ttk_sleep_cop();
  270. void ttk_wake_cop();
  271. ttk_timer ttk_create_timer (int ms, void (*fn)());
  272. void ttk_destroy_timer (ttk_timer tim);
  273. void ttk_set_transition_frames (int frames);
  274. void ttk_set_clicker (void (*fn)());
  275. void ttk_set_scroll_multiplier (int num, int denom);
  276. int ttk_input_start_for (TWindow *win, TWidget *inmethod);
  277. void ttk_input_move_for (TWindow *win, int x, int y);
  278. void ttk_input_size_for (TWindow *win, int *w, int *h);
  279. int ttk_input_start (TWidget *inmethod);
  280. void ttk_input_move (int x, int y);
  281. void ttk_input_size (int *w, int *h);
  282. void ttk_input_char (int ch);
  283. void ttk_input_end();
  284. // -- Implemented by GFX driver --
  285. #if !defined(SDL) && !defined(MWIN) /* Hotdog */
  286. #define TTK_ACOLOR(r,g,b,a) HD_RGBA(r,g,b,a)
  287. #define TTK_COLOR(r,g,b) HD_RGB(r,g,b)
  288. #else
  289. #define TTK_ACOLOR(r,g,b,a) ttk_makecol(r,g,b)
  290. #define TTK_COLOR(r,g,b) ttk_makecol(r,g,b)
  291. #endif
  292. ttk_color ttk_makecol (int r, int g, int b);
  293. ttk_color ttk_makecol_ex (int r, int g, int b, ttk_surface srf);
  294. void ttk_unmakecol (ttk_color col, int *r, int *g, int *b);
  295. void ttk_unmakecol_ex (ttk_color col, int *r, int *g, int *b, ttk_surface srf);
  296. /* Implemented by TTK core: */ ttk_color ttk_mapcol (ttk_color col, ttk_surface src, ttk_surface dst);
  297. ttk_gc ttk_new_gc();
  298. ttk_gc ttk_copy_gc (ttk_gc other);
  299. ttk_color ttk_gc_get_foreground (ttk_gc gc);
  300. ttk_color ttk_gc_get_background (ttk_gc gc);
  301. ttk_font ttk_gc_get_font (ttk_gc gc);
  302. void ttk_gc_set_foreground (ttk_gc gc, ttk_color fgcol);
  303. void ttk_gc_set_background (ttk_gc gc, ttk_color bgcol);
  304. void ttk_gc_set_font (ttk_gc gc, ttk_font font);
  305. void ttk_gc_set_usebg (ttk_gc gc, int flag);
  306. void ttk_gc_set_xormode (ttk_gc gc, int flag);
  307. void ttk_free_gc (ttk_gc gc);
  308. ttk_color ttk_getpixel (ttk_surface srf, int x, int y);
  309. void ttk_pixel (ttk_surface srf, int x, int y, ttk_color col);
  310. void ttk_pixel_gc (ttk_surface srf, ttk_gc gc, int x, int y);
  311. void ttk_line (ttk_surface srf, int x1, int y1, int x2, int y2, ttk_color col);
  312. void ttk_line_gc (ttk_surface srf, ttk_gc gc, int x1, int y1, int x2, int y2);
  313. void ttk_aaline (ttk_surface srf, int x1, int y1, int x2, int y2, ttk_color col);
  314. void ttk_aaline_gc (ttk_surface srf, ttk_gc gc, int x1, int y1, int x2, int y2);
  315. void ttk_rect (ttk_surface srf, int x1, int y1, int x2, int y2, ttk_color col);
  316. void ttk_rect_gc (ttk_surface srf, ttk_gc gc, int x, int y, int w, int h);
  317. void ttk_fillrect (ttk_surface srf, int x1, int y1, int x2, int y2, ttk_color col);
  318. void ttk_fillrect_gc (ttk_surface srf, ttk_gc gc, int x, int y, int w, int h);
  319. void ttk_hgradient( ttk_surface srf, int x1, int y1, int x2, int y2,
  320. ttk_color left, ttk_color right );
  321. void ttk_vgradient(ttk_surface srf, int x1, int y1, int x2, int y2,
  322. ttk_color top, ttk_color bottom );
  323. void ttk_poly (ttk_surface srf, int nv, short *vx, short *vy, ttk_color col);
  324. void ttk_poly_pt (ttk_surface srf, ttk_point *v, int n, ttk_color col);
  325. void ttk_poly_gc (ttk_surface srf, ttk_gc gc, int n, ttk_point *v);
  326. void ttk_aapoly (ttk_surface srf, int nv, short *vx, short *vy, ttk_color col);
  327. void ttk_aapoly_pt (ttk_surface srf, ttk_point *v, int n, ttk_color col);
  328. void ttk_aapoly_gc (ttk_surface srf, ttk_gc gc, int n, ttk_point *v);
  329. void ttk_fillpoly (ttk_surface srf, int nv, short *vx, short *vy, ttk_color col);
  330. void ttk_fillpoly_pt (ttk_surface srf, ttk_point *v, int n, ttk_color col);
  331. void ttk_fillpoly_gc (ttk_surface srf, ttk_gc gc, int n, ttk_point *v);
  332. #if !defined(SDL) && !defined(MWIN) /* Hotdog */
  333. void ttk_polyline (ttk_surface srf, int nv, short *vx, short *vy, ttk_color col);
  334. void ttk_polyline_pt (ttk_surface srf, ttk_point *v, int n, ttk_color col);
  335. void ttk_polyline_gc (ttk_surface srf, ttk_gc gc, int n, ttk_point *v);
  336. void ttk_aapolyline (ttk_surface srf, int nv, short *vx, short *vy, ttk_color col);
  337. void ttk_aapolyline_pt (ttk_surface srf, ttk_point *v, int n, ttk_color col);
  338. void ttk_aapolyline_gc (ttk_surface srf, ttk_gc gc, int n, ttk_point *v);
  339. #endif
  340. void ttk_ellipse (ttk_surface srf, int x, int y, int rx, int ry, ttk_color col);
  341. void ttk_ellipse_gc (ttk_surface srf, ttk_gc gc, int x, int y, int rx, int ry);
  342. void ttk_aaellipse (ttk_surface srf, int x, int y, int rx, int ry, ttk_color col);
  343. void ttk_aaellipse_gc (ttk_surface srf, ttk_gc gc, int x, int y, int rx, int ry);
  344. void ttk_fillellipse (ttk_surface srf, int x, int y, int rx, int ry, ttk_color col);
  345. void ttk_fillellipse_gc (ttk_surface srf, ttk_gc gc, int x, int y, int rx, int ry);
  346. void ttk_aafillellipse (ttk_surface srf, int xc, int yc, int rx, int ry, ttk_color col);
  347. void ttk_aafillellipse_gc (ttk_surface srf, ttk_gc gc, int xc, int yc, int rx, int ry);
  348. void ttk_bezier (ttk_surface srf, int x1, int y1, int x2, int y2,
  349. int x3, int y3, int x4, int y4, int level, ttk_color col);
  350. void ttk_bezier_gc (ttk_surface srf, ttk_gc gc, int x1, int y1, int x2, int y2,
  351. int x3, int y3, int x4, int y4, int level);
  352. void ttk_aabezier (ttk_surface srf, int x1, int y1, int x2, int y2,
  353. int x3, int y3, int x4, int y4, int level, ttk_color col);
  354. void ttk_aabezier_gc (ttk_surface srf, ttk_gc gc, int x1, int y1, int x2, int y2,
  355. int x3, int y3, int x4, int y4, int level);
  356. void ttk_bitmap (ttk_surface srf, int x, int y, int w, int h, unsigned short *data, ttk_color col);
  357. void ttk_bitmap_gc (ttk_surface srf, ttk_gc gc, int x, int y, int w, int h, unsigned short *data);
  358. // Font funcs. Implemented in core TTK:
  359. ttk_fontinfo *ttk_get_fontinfo (const char *name, int size);
  360. ttk_font ttk_get_font (const char *name, int size);
  361. void ttk_done_fontinfo (ttk_fontinfo *fi);
  362. void ttk_done_font (ttk_font f);
  363. // GFX driver:
  364. void ttk_text (ttk_surface srf, ttk_font fnt, int x, int y, ttk_color col, const char *str); /* UTF-8 */
  365. void ttk_textf (ttk_surface srf, ttk_font fnt, int x, int y, ttk_color col, const char *fmt, ...);
  366. void ttk_text_lat1 (ttk_surface srf, ttk_font fnt, int x, int y, ttk_color col, const char *str);
  367. void ttk_text_uc16 (ttk_surface srf, ttk_font fnt, int x, int y, ttk_color col, const uc16 *str);
  368. void ttk_text_gc (ttk_surface srf, ttk_gc gc, int x, int y, const char *str);
  369. int ttk_text_width (ttk_font fnt, const char *str); /* UTF-8 */
  370. int ttk_text_width_lat1 (ttk_font fnt, const char *str);
  371. int ttk_text_width_uc16 (ttk_font fnt, const uc16 *str);
  372. int ttk_text_width_gc (ttk_gc gc, const char *str);
  373. int ttk_text_height (ttk_font fnt);
  374. int ttk_text_height_gc (ttk_gc gc);
  375. ttk_surface ttk_load_image (const char *path);
  376. void ttk_free_image (ttk_surface img);
  377. void ttk_blit_image (ttk_surface src, ttk_surface dst, int dx, int dy);
  378. void ttk_blit_image_ex (ttk_surface src, int sx, int sy, int sw, int sh,
  379. ttk_surface dst, int dx, int dy);
  380. ttk_surface ttk_new_surface (int w, int h, int bpp);
  381. ttk_surface ttk_scale_surface (ttk_surface srf, float factor);
  382. void ttk_surface_get_dimen (ttk_surface srf, int *w, int *h);
  383. void ttk_free_surface (ttk_surface srf);
  384. #ifdef IPOD
  385. #define TTK_SCROLLMOD(dir,n) \
  386. do { \
  387. static int sofar = 0; \
  388. sofar += dir; \
  389. if (sofar > -n && sofar < n) return 0; \
  390. dir = sofar / n; \
  391. sofar -= dir * n; \
  392. } while (0)
  393. #else
  394. #define TTK_SCROLLMOD(dir,n)
  395. #endif
  396. // -- Colors --
  397. #undef WHITE
  398. #undef GREY
  399. #undef DKGREY
  400. #undef BLACK
  401. #define WHITE 255, 255, 255
  402. #define GREY 160, 160, 160
  403. #define DKGREY 80, 80, 80
  404. #define BLACK 0, 0, 0
  405. #ifdef SDL
  406. #define CKEY 255, 0, 255
  407. #elif defined(MWIN)
  408. #define CKEY 255, 255, 255
  409. #else /* Hotdog */
  410. #define CKEY -1, -1, 0x00000000 /* zero-alpha */
  411. #endif
  412. #undef MIN
  413. #undef MAX
  414. #define MIN(x,y) (((x)<(y))?(x):(y))
  415. #define MAX(x,y) (((x)>(y))?(x):(y))
  416. /* Steve Brown's scroll wheel acceleration macro, version 2-poit-oh
  417. * Amplifies scroll events with a timeout
  418. * arg1: (variable) event to be amplified
  419. * arg2: (constant int) slow accel by this factor
  420. * arg3: (constant int) maximum acceleration factor
  421. */
  422. /* TODO: these timers need to be fine-tuned on a real iPod */
  423. #define TTK_ACCEL_L 150 /* events below this delay are accel'ed */
  424. #define TTK_ACCEL_H 250 /* events between the two are decel'ed */
  425. #define TTK_SCROLL_ACCEL(ttk_accel_event, ttk_accel_slow, ttk_accel_max) \
  426. do { \
  427. static int ttk_accel_throttle = 0; \
  428. static int ttk_accel_timer = 0; \
  429. static int ttk_accel_now = 0; \
  430. ttk_accel_now = ttk_getticks() - ttk_accel_timer; \
  431. if(ttk_accel_now > TTK_ACCEL_H || ttk_accel_throttle * ttk_accel_event < 0) { \
  432. ttk_accel_throttle = 0; /* user changed direction or timed out; stop accel */ \
  433. } else if(ttk_accel_now > TTK_ACCEL_L && abs(ttk_accel_throttle) > abs(ttk_accel_event)) {/* slow the accel */ \
  434. ttk_accel_throttle -= ttk_accel_event; \
  435. } else { /* increase accel coefficient up to max */ \
  436. ttk_accel_throttle += ttk_accel_event; /* count can be negative, meaning backwards direction*/ \
  437. } \
  438. ttk_accel_event *= MIN(abs(ttk_accel_throttle / ttk_accel_slow) + 1, ttk_accel_max); \
  439. ttk_accel_timer += ttk_accel_now; \
  440. } while (0)
  441. // -- Private --
  442. #define TTK_NO_EVENT 0
  443. #define TTK_BUTTON_DOWN 1
  444. #define TTK_BUTTON_UP 2
  445. #define TTK_SCROLL 3
  446. #define TTK_TOUCH 4
  447. #define TTK_LIFT 5
  448. #define TTK_TAP 6
  449. void ttk_gfx_init();
  450. void ttk_gfx_update (ttk_surface srf);
  451. void ttk_load_font (ttk_fontinfo *fi, const char *fname, int size);
  452. int ttk_get_event (int *arg); /* ret=>ev code, see above; arg=>button pressed */
  453. int ttk_get_rawevent (int *arg);
  454. int ttk_getticks();
  455. void ttk_delay (int ms);
  456. #include "appearance.h"
  457. #endif