src/video/riscos/SDL_wimpvideo.c
branchSDL-1.2
changeset 13054 d07097a0e57e
parent 12913 d07b4feae69c
     1.1 --- a/src/video/riscos/SDL_wimpvideo.c	Tue Sep 03 23:00:00 2019 +0300
     1.2 +++ b/src/video/riscos/SDL_wimpvideo.c	Tue Sep 03 23:11:10 2019 +0300
     1.3 @@ -45,6 +45,7 @@
     1.4  
     1.5  static int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
     1.6  static void WIMP_SetWMCaption(_THIS, const char *title, const char *icon);
     1.7 +static int WIMP_IconifyWindow(_THIS);
     1.8  static void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
     1.9  
    1.10  /* RISC OS Wimp handling helpers */
    1.11 @@ -194,7 +195,7 @@
    1.12  
    1.13  	this->SetCaption = WIMP_SetWMCaption;
    1.14  	this->SetIcon = NULL;
    1.15 -	this->IconifyWindow = NULL;
    1.16 +	this->IconifyWindow = WIMP_IconifyWindow;
    1.17  	
    1.18  	this->ShowWMCursor = WIMP_ShowWMCursor;
    1.19  	this->WarpWMCursor = WIMP_WarpWMCursor;
    1.20 @@ -382,6 +383,29 @@
    1.21  	}
    1.22  }
    1.23  
    1.24 +int WIMP_IconifyWindow(_THIS)
    1.25 +{
    1.26 +	_kernel_swi_regs regs;
    1.27 +
    1.28 +	int block[12];
    1.29 +	block[0] = 48;
    1.30 +	block[1] = RISCOS_GetTaskHandle();
    1.31 +	block[2] = 0;
    1.32 +	block[3] = 0;
    1.33 +	block[4] = 0x400ca; /* Message_Iconize */
    1.34 +	block[5] = this->hidden->window_handle;
    1.35 +	block[6] = RISCOS_GetTaskHandle();
    1.36 +
    1.37 +	SDL_strlcpy((char *)&block[7], this->hidden->title, 20);
    1.38 +
    1.39 +	regs.r[0] = 17; /* User_Message */
    1.40 +	regs.r[1] = (int)block;
    1.41 +	regs.r[2] = 0;
    1.42 +	_kernel_swi(Wimp_SendMessage, &regs, &regs);
    1.43 +
    1.44 +	return 1;
    1.45 +}
    1.46 +
    1.47  /* Toggle to window from full screen */
    1.48  int WIMP_ToggleFromFullScreen(_THIS)
    1.49  {