src/video/riscos/SDL_wimpvideo.c
branchSDL-1.2
changeset 13054 d07097a0e57e
parent 12913 d07b4feae69c
equal deleted inserted replaced
13053:13b0e1be3ca2 13054:d07097a0e57e
    43 #include "kernel.h"
    43 #include "kernel.h"
    44 #include "swis.h"
    44 #include "swis.h"
    45 
    45 
    46 static int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
    46 static int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
    47 static void WIMP_SetWMCaption(_THIS, const char *title, const char *icon);
    47 static void WIMP_SetWMCaption(_THIS, const char *title, const char *icon);
       
    48 static int WIMP_IconifyWindow(_THIS);
    48 static void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
    49 static void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
    49 
    50 
    50 /* RISC OS Wimp handling helpers */
    51 /* RISC OS Wimp handling helpers */
    51 static unsigned int WIMP_SetupWindow(_THIS, SDL_Surface *surface);
    52 static unsigned int WIMP_SetupWindow(_THIS, SDL_Surface *surface);
    52 static void WIMP_SetDeviceMode(_THIS);
    53 static void WIMP_SetDeviceMode(_THIS);
   192 
   193 
   193 	this->FlipHWSurface = NULL;
   194 	this->FlipHWSurface = NULL;
   194 
   195 
   195 	this->SetCaption = WIMP_SetWMCaption;
   196 	this->SetCaption = WIMP_SetWMCaption;
   196 	this->SetIcon = NULL;
   197 	this->SetIcon = NULL;
   197 	this->IconifyWindow = NULL;
   198 	this->IconifyWindow = WIMP_IconifyWindow;
   198 	
   199 	
   199 	this->ShowWMCursor = WIMP_ShowWMCursor;
   200 	this->ShowWMCursor = WIMP_ShowWMCursor;
   200 	this->WarpWMCursor = WIMP_WarpWMCursor;
   201 	this->WarpWMCursor = WIMP_WarpWMCursor;
   201 
   202 
   202 /* Currently need to set this up here as it only works if you
   203 /* Currently need to set this up here as it only works if you
   380 		regs.r[2] = 3; /* Redraw title */
   381 		regs.r[2] = 3; /* Redraw title */
   381 		_kernel_swi(Wimp_ForceRedraw, &regs, &regs);
   382 		_kernel_swi(Wimp_ForceRedraw, &regs, &regs);
   382 	}
   383 	}
   383 }
   384 }
   384 
   385 
       
   386 int WIMP_IconifyWindow(_THIS)
       
   387 {
       
   388 	_kernel_swi_regs regs;
       
   389 
       
   390 	int block[12];
       
   391 	block[0] = 48;
       
   392 	block[1] = RISCOS_GetTaskHandle();
       
   393 	block[2] = 0;
       
   394 	block[3] = 0;
       
   395 	block[4] = 0x400ca; /* Message_Iconize */
       
   396 	block[5] = this->hidden->window_handle;
       
   397 	block[6] = RISCOS_GetTaskHandle();
       
   398 
       
   399 	SDL_strlcpy((char *)&block[7], this->hidden->title, 20);
       
   400 
       
   401 	regs.r[0] = 17; /* User_Message */
       
   402 	regs.r[1] = (int)block;
       
   403 	regs.r[2] = 0;
       
   404 	_kernel_swi(Wimp_SendMessage, &regs, &regs);
       
   405 
       
   406 	return 1;
       
   407 }
       
   408 
   385 /* Toggle to window from full screen */
   409 /* Toggle to window from full screen */
   386 int WIMP_ToggleFromFullScreen(_THIS)
   410 int WIMP_ToggleFromFullScreen(_THIS)
   387 {     
   411 {     
   388    int width = this->screen->w;
   412    int width = this->screen->w;
   389    int height = this->screen->h;
   413    int height = this->screen->h;