/* $Id: gui_window.c,v 1.2 2013/02/18 00:06:44 steffen Exp $ */ /*************************************************************************** * gui_window.c * * Copyright (C) 2013 Steffen Pohle * steffen@gulpe.de *************************************************************************** * basic windows functions ***************************************************************************/ /* * 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 3 of the License, or * (at your option) any later version. * * main.c 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, see . */ #include "osmroute.h" #include "draw.h" #include "gui.h" #include "system.h" /* * reset all window data, do not allocate anything */ void gui_window_new (GUIWindow *win, int w, int h, char *title) { int i; for (i = 0; i < GUI_MAX_ITEM; i++) { win->items[i].item = NULL; win->items[i].type = GUI_NONE; } strncpy (win->title, title, GUI_TEXTLEN); win->screen = NULL; win->screen_changed = 1; win->h = h; win->w = w; win->focus = NULL; d_printf ("guiwindow_new %p width:%d height:%d", win, w, h); }; /* * closes the window, but does not free the memory. */ void gui_window_close (GUIWindow *win) { int i; for (i = 0; i < GUI_MAX_ITEM; i++) { win->items[i].type = GUI_NONE; win->items[i].item = NULL; } win->title[0] = 0; gfx_img_free (win->screen); win->screen = NULL; win->screen_changed = 1; win->h = 0; win->w = 0; };