Skip to content

Commit

Permalink
riscos: implement SDL_WM_IconifyWindow()
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 committed Sep 3, 2019
1 parent 9e6e012 commit 5a28385
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.RISCOS
Expand Up @@ -81,7 +81,7 @@ Current level of implementation
The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL.

video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL.
Window Manager - Mostly done. SetIcon/IconifyWindow not implemented.
Window Manager - Mostly done. SetIcon not implemented.
Events - Mostly done. Resize and some joystick events missing.
Joystick - Currently assumes a single joystick with 4 buttons.
Audio - Done
Expand Down
1 change: 1 addition & 0 deletions WhatsNew
Expand Up @@ -80,6 +80,7 @@ Changes include:
- RISC OS: mouse fixes. restore mouse palette when exiting while mouse
is in focus. don't reset mouse focus when recreating the window.
- RISC OS: support Windows and Menu key input.
- RISC OS: implement SDL_WM_IconifyWindow()
- Configuration: fix library detection selecting wrong lib (bug 2795.)
- Configuration: fix detecting dynamic library support on powerpc64le
(bug 3481.)
Expand Down
3 changes: 3 additions & 0 deletions docs.html
Expand Up @@ -196,6 +196,9 @@ <H2> SDL 1.2.16 Release Notes </H2>
<P>
RISC OS: support Windows and Menu key input.
</P>
<P>
RISC OS: implement SDL_WM_IconifyWindow()
</P>
<P>
Configuration: fix library detection selecting wrong lib (bug <a href="https://bugzilla.libsdl.org/show_bug.cgi?id=2795">2795</a>.)
</P>
Expand Down
26 changes: 25 additions & 1 deletion src/video/riscos/SDL_wimpvideo.c
Expand Up @@ -45,6 +45,7 @@

static int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
static void WIMP_SetWMCaption(_THIS, const char *title, const char *icon);
static int WIMP_IconifyWindow(_THIS);
static void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects);

/* RISC OS Wimp handling helpers */
Expand Down Expand Up @@ -194,7 +195,7 @@ void WIMP_SetDeviceMode(_THIS)

this->SetCaption = WIMP_SetWMCaption;
this->SetIcon = NULL;
this->IconifyWindow = NULL;
this->IconifyWindow = WIMP_IconifyWindow;

this->ShowWMCursor = WIMP_ShowWMCursor;
this->WarpWMCursor = WIMP_WarpWMCursor;
Expand Down Expand Up @@ -382,6 +383,29 @@ void WIMP_SetWMCaption(_THIS, const char *title, const char *icon)
}
}

int WIMP_IconifyWindow(_THIS)
{
_kernel_swi_regs regs;

int block[12];
block[0] = 48;
block[1] = RISCOS_GetTaskHandle();
block[2] = 0;
block[3] = 0;
block[4] = 0x400ca; /* Message_Iconize */
block[5] = this->hidden->window_handle;
block[6] = RISCOS_GetTaskHandle();

SDL_strlcpy((char *)&block[7], this->hidden->title, 20);

regs.r[0] = 17; /* User_Message */
regs.r[1] = (int)block;
regs.r[2] = 0;
_kernel_swi(Wimp_SendMessage, &regs, &regs);

return 1;
}

/* Toggle to window from full screen */
int WIMP_ToggleFromFullScreen(_THIS)
{
Expand Down

0 comments on commit 5a28385

Please sign in to comment.