src/video/gem/SDL_gemevents.c
branchSDL-1.2
changeset 11561 e990d334b75a
parent 11560 c267eabdc97f
child 11568 6fbdeeef1935
equal deleted inserted replaced
11560:c267eabdc97f 11561:e990d334b75a
   185 	}
   185 	}
   186 }
   186 }
   187 
   187 
   188 static int do_messages(_THIS, short *message, short latest_msg_id)
   188 static int do_messages(_THIS, short *message, short latest_msg_id)
   189 {
   189 {
   190 	int quit, update_work_area, align_work_area, sdl_resize;
   190 	int quit, update_work_area, iconified, sdl_resize;
   191 
   191 
   192 	quit = update_work_area = align_work_area = sdl_resize = 0;
   192 	quit = update_work_area = iconified = sdl_resize = 0;
   193 	switch (message[0]) {
   193 	switch (message[0]) {
   194 		case MSG_SDL_ID:
   194 		case MSG_SDL_ID:
   195 			quit=(message[1] == latest_msg_id);
   195 			quit=(message[1] == latest_msg_id);
   196 			break;
   196 			break;
   197 		case WM_CLOSED:
   197 		case WM_CLOSED:
   199 			SDL_PrivateQuit();
   199 			SDL_PrivateQuit();
   200 			quit=1;
   200 			quit=1;
   201 			break;
   201 			break;
   202 		case WM_MOVED:
   202 		case WM_MOVED:
   203 			wind_set(message[3],WF_CURRXYWH,message[4],message[5],message[6],message[7]);
   203 			wind_set(message[3],WF_CURRXYWH,message[4],message[5],message[6],message[7]);
   204 			update_work_area = align_work_area = 1;
   204 			update_work_area = 1;
   205 			break;
   205 			break;
   206 		case WM_TOPPED:
   206 		case WM_TOPPED:
   207 			wind_set(message[3],WF_TOP,message[4],0,0,0);
   207 			wind_set(message[3],WF_TOP,message[4],0,0,0);
   208 			/* Continue with TOP event processing */
   208 			/* Continue with TOP event processing */
   209 		case WM_ONTOP:
   209 		case WM_ONTOP:
   231 					(short)(((unsigned long)GEM_icon_name)>>16),
   231 					(short)(((unsigned long)GEM_icon_name)>>16),
   232 					(short)(((unsigned long)GEM_icon_name) & 0xffff),
   232 					(short)(((unsigned long)GEM_icon_name) & 0xffff),
   233 					0,0);
   233 					0,0);
   234 				GEM_refresh_name = SDL_FALSE;
   234 				GEM_refresh_name = SDL_FALSE;
   235 			}
   235 			}
   236 			update_work_area = 1;
   236 			update_work_area = iconified = 1;
   237 			break;
   237 			break;
   238 		case WM_UNICONIFY:
   238 		case WM_UNICONIFY:
   239 			wind_set (message[3],WF_UNICONIFY,message[4],message[5],message[6],message[7]);
   239 			wind_set (message[3],WF_UNICONIFY,message[4],message[5],message[6],message[7]);
   240 			/* If we're not active, make ourselves active */
   240 			/* If we're not active, make ourselves active */
   241 			if ( !(SDL_GetAppState() & SDL_APPACTIVE) ) {
   241 			if ( !(SDL_GetAppState() & SDL_APPACTIVE) ) {
   247 					(short)(((unsigned long)GEM_title_name)>>16),
   247 					(short)(((unsigned long)GEM_title_name)>>16),
   248 					(short)(((unsigned long)GEM_title_name) & 0xffff),
   248 					(short)(((unsigned long)GEM_title_name) & 0xffff),
   249 					0,0);
   249 					0,0);
   250 				GEM_refresh_name = SDL_FALSE;
   250 				GEM_refresh_name = SDL_FALSE;
   251 			}
   251 			}
   252 			update_work_area = align_work_area = 1;
   252 			update_work_area = 1;
   253 			break;
   253 			break;
   254 		case WM_SIZED:
   254 		case WM_SIZED:
   255 			wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
   255 			wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
   256 			update_work_area = align_work_area = sdl_resize = 1;
   256 			update_work_area = sdl_resize = 1;
   257 			GEM_win_fulled = SDL_FALSE;		/* Cancel maximized flag */
   257 			GEM_win_fulled = SDL_FALSE;		/* Cancel maximized flag */
   258 			GEM_lock_redraw = SDL_TRUE;		/* Prevent redraw till buffers resized */
   258 			GEM_lock_redraw = SDL_TRUE;		/* Prevent redraw till buffers resized */
   259 			break;
   259 			break;
   260 		case WM_FULLED:
   260 		case WM_FULLED:
   261 			{
   261 			{
   270 					w = GEM_desk_w;
   270 					w = GEM_desk_w;
   271 					h = GEM_desk_h;
   271 					h = GEM_desk_h;
   272 					GEM_win_fulled = SDL_TRUE;
   272 					GEM_win_fulled = SDL_TRUE;
   273 				}
   273 				}
   274 				wind_set (message[3], WF_CURRXYWH, x, y, w, h);
   274 				wind_set (message[3], WF_CURRXYWH, x, y, w, h);
   275 				update_work_area = align_work_area = sdl_resize = 1;
   275 				update_work_area = sdl_resize = 1;
   276 				GEM_lock_redraw = SDL_TRUE;		/* Prevent redraw till buffers resized */
   276 				GEM_lock_redraw = SDL_TRUE;		/* Prevent redraw till buffers resized */
   277 			}
   277 			}
   278 			break;
   278 			break;
   279 		case WM_BOTTOMED:
   279 		case WM_BOTTOMED:
   280 			wind_set(message[3],WF_BOTTOM,0,0,0,0);
   280 			wind_set(message[3],WF_BOTTOM,0,0,0,0);
   286 			}
   286 			}
   287 			break;
   287 			break;
   288 	}
   288 	}
   289 
   289 
   290 	if (update_work_area) {
   290 	if (update_work_area) {
   291 		GEM_align_work_area(this, message[3], 1);
   291 		GEM_align_work_area(this, message[3], 1, iconified);
   292 
   292 
   293 		if (sdl_resize) {
   293 		if (sdl_resize) {
   294 			SDL_PrivateResize(GEM_work_w, GEM_work_h);
   294 			SDL_PrivateResize(GEM_work_w, GEM_work_h);
   295 		}
   295 		}
   296 	}
   296 	}