gltiki

view src/gltiki.c @ 0:ea177566fe79

initial commit
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sat, 07 Jul 2012 07:07:40 +0300
parents
children
line source
1 /*
2 A simple cross-platform OpenGL GUI toolkit
3 Copyright (C) 2012 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include "gltiki.h"
21 #include "gltiki_impl.h"
23 int gltk_init(void)
24 {
25 return 0;
26 }
28 void gltk_cleanup(void)
29 {
30 }
32 gltk_widget *gltk_create_widget(void)
33 {
34 gltk_widget *w;
36 if(!(w = calloc(1, sizeof *w))) {
37 return 0;
38 }
39 return w;
40 }
42 void gltk_free_widget(gltk_widget *w)
43 {
44 free(w);
45 }
47 void gltk_move(gltk_widget *w, float x, float y)
48 {
49 w->x = x;
50 w->y = y;
51 }
53 void gltk_resize(gltk_widget *w, float xsz, float ysz)
54 {
55 w->width = xsz;
56 w->height = ysz;
57 }
59 /* events */
60 void gltk_event_button(int bn, int state, float x, float y)
61 {
62 }
64 void gltk_event_motion(float x, float y)
65 {
66 }
68 void gltk_event_keyboard(int key, int state)
69 {
70 }
72 /* drawing */
73 void gltk_draw(gltk_widget *wlist)
74 {
75 gltk_widget *w = wlist;
77 while(w) {
78 if(w->draw) {
79 w->draw(w);
80 }
81 w = w->next;
82 }
83 }
85 /* GUI file format */
86 gltk_widget *gltk_load(const char *fname)
87 {
88 return 0;
89 }
91 int gltk_save(const char *fname, gltk_widget *wlist)
92 {
93 return -1;
94 }