nsxiv01121ce
Basic app_* stuff
+27 −1
2 files changed
| @@ -16,6 +16,28 @@ | |||
| 16 | 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 17 | 17 | */ | |
| 18 | 18 | ||
| 19 | + | #include <X11/Xlib.h> | |
| 20 | + | ||
| 19 | 21 | #include "sxiv.h" | |
| 20 | 22 | #include "app.h" | |
| 21 | 23 | ||
| 24 | + | void app_init(app_t *app) { | |
| 25 | + | if (app == NULL) | |
| 26 | + | return; | |
| 27 | + | ||
| 28 | + | app->fileidx = 0; | |
| 29 | + | ||
| 30 | + | app->img.zoom = 100; | |
| 31 | + | app->img.scalemode = SCALE_DOWN; | |
| 32 | + | ||
| 33 | + | app->win.w = WIN_WIDTH; | |
| 34 | + | app->win.h = WIN_HEIGHT; | |
| 35 | + | ||
| 36 | + | win_open(&app->win); | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | void app_run(app_t *app) { | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | void app_quit(app_t *app) { | |
| 43 | + | } | |
| @@ -23,11 +23,15 @@ | |||
| 23 | 23 | #include "window.h" | |
| 24 | 24 | ||
| 25 | 25 | typedef struct app_s { | |
| 26 | − | const char **filenames; | |
| 26 | + | char **filenames; | |
| 27 | 27 | unsigned int filecnt; | |
| 28 | 28 | unsigned int fileidx; | |
| 29 | 29 | img_t img; | |
| 30 | 30 | win_t win; | |
| 31 | 31 | } app_t; | |
| 32 | 32 | ||
| 33 | + | void app_init(app_t*); | |
| 34 | + | void app_run(app_t*); | |
| 35 | + | void app_quit(app_t*); | |
| 36 | + | ||
| 33 | 37 | #endif /* APP_H */ | |