/*
- * Copyright (C) 2011 Andy Spencer <andy753421@gmail.com>
- *
- * 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.
- *
- * 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, see <http://www.gnu.org/licenses/>.
+ * Copyright (c) 2011, Andy Spencer <andy753421@gmail.com>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
*/
/* Windowing system interface:
* and control windows. */
+/* Window states */
+typedef enum {
+ st_show, // show as regular window
+ st_full, // fullscreen/maximized
+ st_shade, // show titlebar only
+ st_icon, // iconified/minimized
+ st_hide, // completely hidden
+} state_t;
+
/* Basic window type */
typedef struct win_sys win_sys_t;
typedef struct win_wm win_wm_t;
typedef struct {
int x, y, z;
int w, h;
+ state_t state;
win_sys_t *sys;
win_wm_t *wm;
} win_t;
} ptr_t;
#define PTR(...) ((ptr_t){__VA_ARGS__})
-/* Window states */
-typedef enum {
- st_show, // show as regular window
- st_full, // fullscreen/maximized
- st_shade, // show titlebar only
- st_icon, // iconified/minimized
- st_hide, // completely hidden
-} state_t;
-
/* Move the window to the specified location and set it's
* geometry. The position and size include borders and
/* Starts the main loop */
void sys_run(win_t *root);
+
+/* Exit main loop */
+void sys_exit(void);
+
+/* Free all static data, for memory debugging */
+void sys_free(win_t *root);