4 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version. The Blender
10 * Foundation also sells licenses for use in proprietary software under
11 * the Blender License. See http://www.blender.org/BL/ for information
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24 * All rights reserved.
26 * The Original Code is: all of this file.
28 * Contributor(s): none yet.
30 * ***** END GPL/BL DUAL LICENSE BLOCK *****
33 /* Abstract window operations */
35 #include "GHOST_C-api.h"
37 typedef struct _Window Window;
38 typedef void (*WindowHandlerFP) (Window *win, void *user_data, short evt, short val, char ascii);
40 Window* window_open (char *title, int x, int y, int width, int height, int start_maximized);
41 void window_set_handler (Window *win, WindowHandlerFP handler, void *user_data);
42 void window_destroy (Window *win);
44 void window_set_timer (Window *win, int delay_ms, int event);
46 void window_make_active (Window *win);
47 void window_swap_buffers (Window *win);
49 #ifdef _WIN32 // FULLSCREEN
50 void window_toggle_fullscreen(Window *win, int fullscreen);
53 void window_raise (Window *win);
54 void window_lower (Window *win);
56 short window_get_qual (Window *win);
57 short window_get_mbut (Window *win);
58 void window_get_mouse (Window *win, short *mval);
60 void window_get_position (Window *win, int *posx_r, int *poxy_r);
62 void window_get_size (Window *win, int *width_r, int *height_r);
63 void window_set_size (Window *win, int width, int height);
65 char* window_get_title (Window *win);
66 void window_set_title (Window *win, char *title);
68 void window_set_cursor (Window *win, int cursor);
69 void window_set_custom_cursor (Window *win, unsigned char mask[16][2],
70 unsigned char bitmap[16][2], int hotx, int hoty );
72 void window_warp_pointer (Window *win, int x, int y);
74 void window_queue_redraw (Window *win);
76 /* Global windowing operations */
78 Window* winlay_get_active_window(void);
80 void winlay_process_events (int wait_for_event);
82 void winlay_get_screensize (int *width_r, int *height_r);
86 GHOST_WindowHandle ghostwin;
88 /* Handler and private data for handler */
89 WindowHandlerFP handler;
93 int size[2], position[2];
96 /* Last known mouse/button/qualifier state */
98 int lqual; /* (LR_SHFTKEY, LR_CTRLKEY, LR_ALTKEY) */
99 int lmbut; /* (L_MOUSE, M_MOUSE, R_MOUSE) */
102 /* Tracks the faked mouse button, if non-zero it is
103 * the event number of the last faked button.
107 GHOST_TimerTaskHandle timer;