riscos: implement SDL_WM_IconifyWindow() SDL-1.2
authorCameron Cawley <ccawley2011@gmail.com>
Tue, 03 Sep 2019 23:11:10 +0300
branchSDL-1.2
changeset 13054d07097a0e57e
parent 13053 13b0e1be3ca2
child 13055 2641390846e1
riscos: implement SDL_WM_IconifyWindow()
README.RISCOS
WhatsNew
docs.html
src/video/riscos/SDL_wimpvideo.c
     1.1 --- a/README.RISCOS	Tue Sep 03 23:00:00 2019 +0300
     1.2 +++ b/README.RISCOS	Tue Sep 03 23:11:10 2019 +0300
     1.3 @@ -81,7 +81,7 @@
     1.4  The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL.
     1.5  
     1.6  video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL.
     1.7 -Window Manager - Mostly done. SetIcon/IconifyWindow not implemented.
     1.8 +Window Manager - Mostly done. SetIcon not implemented.
     1.9  Events - Mostly done. Resize and some joystick events missing.
    1.10  Joystick - Currently assumes a single joystick with 4 buttons.
    1.11  Audio - Done
     2.1 --- a/WhatsNew	Tue Sep 03 23:00:00 2019 +0300
     2.2 +++ b/WhatsNew	Tue Sep 03 23:11:10 2019 +0300
     2.3 @@ -80,6 +80,7 @@
     2.4  - RISC OS: mouse fixes. restore mouse palette when exiting while mouse
     2.5    is in focus. don't reset mouse focus when recreating the window.
     2.6  - RISC OS: support Windows and Menu key input.
     2.7 +- RISC OS: implement SDL_WM_IconifyWindow()
     2.8  - Configuration: fix library detection selecting wrong lib (bug 2795.)
     2.9  - Configuration: fix detecting dynamic library support on powerpc64le
    2.10    (bug 3481.)
     3.1 --- a/docs.html	Tue Sep 03 23:00:00 2019 +0300
     3.2 +++ b/docs.html	Tue Sep 03 23:11:10 2019 +0300
     3.3 @@ -197,6 +197,9 @@
     3.4    RISC OS: support Windows and Menu key input.
     3.5  </P>
     3.6  <P>
     3.7 +  RISC OS: implement SDL_WM_IconifyWindow()
     3.8 +</P>
     3.9 +<P>
    3.10    Configuration: fix library detection selecting wrong lib (bug <a href="https://bugzilla.libsdl.org/show_bug.cgi?id=2795">2795</a>.)
    3.11  </P>
    3.12  <P>
     4.1 --- a/src/video/riscos/SDL_wimpvideo.c	Tue Sep 03 23:00:00 2019 +0300
     4.2 +++ b/src/video/riscos/SDL_wimpvideo.c	Tue Sep 03 23:11:10 2019 +0300
     4.3 @@ -45,6 +45,7 @@
     4.4  
     4.5  static int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
     4.6  static void WIMP_SetWMCaption(_THIS, const char *title, const char *icon);
     4.7 +static int WIMP_IconifyWindow(_THIS);
     4.8  static void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
     4.9  
    4.10  /* RISC OS Wimp handling helpers */
    4.11 @@ -194,7 +195,7 @@
    4.12  
    4.13  	this->SetCaption = WIMP_SetWMCaption;
    4.14  	this->SetIcon = NULL;
    4.15 -	this->IconifyWindow = NULL;
    4.16 +	this->IconifyWindow = WIMP_IconifyWindow;
    4.17  	
    4.18  	this->ShowWMCursor = WIMP_ShowWMCursor;
    4.19  	this->WarpWMCursor = WIMP_WarpWMCursor;
    4.20 @@ -382,6 +383,29 @@
    4.21  	}
    4.22  }
    4.23  
    4.24 +int WIMP_IconifyWindow(_THIS)
    4.25 +{
    4.26 +	_kernel_swi_regs regs;
    4.27 +
    4.28 +	int block[12];
    4.29 +	block[0] = 48;
    4.30 +	block[1] = RISCOS_GetTaskHandle();
    4.31 +	block[2] = 0;
    4.32 +	block[3] = 0;
    4.33 +	block[4] = 0x400ca; /* Message_Iconize */
    4.34 +	block[5] = this->hidden->window_handle;
    4.35 +	block[6] = RISCOS_GetTaskHandle();
    4.36 +
    4.37 +	SDL_strlcpy((char *)&block[7], this->hidden->title, 20);
    4.38 +
    4.39 +	regs.r[0] = 17; /* User_Message */
    4.40 +	regs.r[1] = (int)block;
    4.41 +	regs.r[2] = 0;
    4.42 +	_kernel_swi(Wimp_SendMessage, &regs, &regs);
    4.43 +
    4.44 +	return 1;
    4.45 +}
    4.46 +
    4.47  /* Toggle to window from full screen */
    4.48  int WIMP_ToggleFromFullScreen(_THIS)
    4.49  {