From bb1568e551256127c8610fb83e20a0cb15357bad Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 22 Dec 2015 19:11:10 +0000 Subject: [PATCH] Implemented MUIM_Application_CheckRefresh. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@51237 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/muimaster/classes/application.c | 71 +++++++++++++++++++++++++- workbench/libs/muimaster/classes/window.c | 18 ++++++- workbench/libs/muimaster/classes/window.h | 8 +-- 3 files changed, 91 insertions(+), 6 deletions(-) diff --git a/workbench/libs/muimaster/classes/application.c b/workbench/libs/muimaster/classes/application.c index f4c34970a8..b2251f4dfa 100644 --- a/workbench/libs/muimaster/classes/application.c +++ b/workbench/libs/muimaster/classes/application.c @@ -165,7 +165,7 @@ OM_ADDMEMBER done OM_REMMEMBER done MUIM_Application_AboutMUI todo MUIM_Application_AddInputHandler done ? -MUIM_Application_CheckRefresh todo (implementable ?) +MUIM_Application_CheckRefresh done MUIM_Application_GetMenuCheck OBSOLETE MUIM_Application_GetMenuState OBSOLETE MUIM_Application_Input OBSOLETE @@ -2194,6 +2194,73 @@ static IPTR Application__MUIM_Save(struct IClass *cl, Object *obj, return 0; } +/****** Application.mui/MUIM_Application_CheckRefresh ************************ +* +* NAME +* MUIM_Application_CheckRefresh (V11) +* +* SYNOPSIS +* DoMethod(obj, MUIM_Application_CheckRefresh); +* +* FUNCTION +* Redraw any damaged portions within all of the application's windows. +* This method is normally only used in hooks that handle Intuition +* messages received while modal requesters are open (e.g. ASL file +* requesters). If such a hook is not used, a modal requester may damage +* the contents of your application windows when the requester is moved. +* +* NOTES +* The object attributes needed for the ASL tags in the example below may +* not all have valid values unless the parent window is open. Therefore +* the tags should not be passed to MUI_AllocAslRequestTags() in an +* OM_NEW method (for example), but should instead be passed to +* MUI_AslRequestTags() when the requester is shown. +* +* EXAMPLE +* +* \* A hook function to refresh windows when called from asl.library *\ +* AROS_UFH3(static void, IMsgHook, +* AROS_UFHA(struct Hook *, hook, A0), +* AROS_UFHA(struct FileRequester *, req, A2), +* AROS_UFHA(struct IntuiMessage *, imsg, A1)) +* { +* AROS_USERFUNC_INIT +* +* if (imsg->Class == IDCMP_REFRESHWINDOW) +* DoMethod(req->fr_UserData, MUIM_Application_CheckRefresh); +* +* AROS_USERFUNC_EXIT +* } +* +* ... +* +* \* Show the requester *\ +* MUI_AslRequestTags(ASL_FileRequest, req, +* ASLFR_Window, XGET(window, MUIA_Window_Window), +* ASLFR_IntuiMsgFunc, (IPTR)hook, +* ASLFR_UserData, XGET(window, MUIA_ApplicationObject), +* TAG_DONE); +* +****************************************************************************** +* +*/ + +static IPTR Application__MUIM_CheckRefresh(struct IClass *cl, Object *obj, + struct MUIP_Application_CheckRefresh *message) +{ + struct MUI_ApplicationData *data = INST_DATA(cl, obj); + struct MinList *children = NULL; + Object *cstate; + Object *child; + + get(data->app_WindowFamily, MUIA_Family_List, &children); + cstate = (Object *) children->mlh_Head; + while ((child = NextObject(&cstate))) + DoMethod(child, MUIM_Window_Refresh); + + return 0; +} + /* * The class dispatcher */ @@ -2253,6 +2320,8 @@ BOOPSI_DISPATCHER(IPTR, Application_Dispatcher, cl, obj, msg) return Application__MUIM_Load(cl, obj, (APTR) msg); case MUIM_Application_Save: return Application__MUIM_Save(cl, obj, (APTR) msg); + case MUIM_Application_CheckRefresh: + return Application__MUIM_CheckRefresh(cl, obj, (APTR) msg); } return (DoSuperMethodA(cl, obj, msg)); diff --git a/workbench/libs/muimaster/classes/window.c b/workbench/libs/muimaster/classes/window.c index e7c3b9b300..522eb6705e 100644 --- a/workbench/libs/muimaster/classes/window.c +++ b/workbench/libs/muimaster/classes/window.c @@ -1,6 +1,6 @@ /* - Copyright 1999, David Le Corfec. - Copyright 2002-2015, The AROS Development Team. + Copyright © 1999, David Le Corfec. + Copyright © 2002-2015, The AROS Development Team. All rights reserved. $Id$ @@ -4360,6 +4360,18 @@ IPTR Window__MUIM_UpdateMenu(struct IClass *cl, Object *obj, Msg msg) } /************************************************************************** + MUIM_Window_Refresh +**************************************************************************/ +IPTR Window__MUIM_Refresh(struct IClass *cl, Object *obj, Msg msg) +{ + struct MUI_WindowData *data = INST_DATA(cl, obj); + + RefreshWindow(obj, data); + + return 1; +} + +/************************************************************************** MUIM_Export : to export an object's "contents" to a dataspace object. **************************************************************************/ static IPTR Window__MUIM_Export(struct IClass *cl, Object *obj, @@ -4452,6 +4464,8 @@ BOOPSI_DISPATCHER(IPTR, Window_Dispatcher, cl, obj, msg) return Window__MUIM_Snapshot(cl, obj, (APTR) msg); case MUIM_Window_UpdateMenu: return Window__MUIM_UpdateMenu(cl, obj, (APTR) msg); + case MUIM_Window_Refresh: + return Window__MUIM_Refresh(cl, obj, (APTR) msg); case MUIM_Export: return Window__MUIM_Export(cl, obj, (APTR) msg); case MUIM_Import: diff --git a/workbench/libs/muimaster/classes/window.h b/workbench/libs/muimaster/classes/window.h index 3653d7dfb8..793a2106b5 100644 --- a/workbench/libs/muimaster/classes/window.h +++ b/workbench/libs/muimaster/classes/window.h @@ -2,8 +2,8 @@ #define _MUI_CLASSES_WINDOW_H /* - Copyright 1999, David Le Corfec. - Copyright 2002-2003, The AROS Development Team. + Copyright © 1999, David Le Corfec. + Copyright © 2002-2015, The AROS Development Team. All rights reserved. $Id$ @@ -107,7 +107,9 @@ struct MUIP_Window_ToFront #define MUIM_Window_RemControlCharHandler /* PRIV */ \ (MUIB_Window | 0x00000006) /* Zune: V1, PRIV don't use it! */ #define MUIM_Window_UpdateMenu /* PRIV */ \ - (MUIB_Window | 0x00000007) /* Zune: V1, PRIV dont' use it! */ + (MUIB_Window | 0x00000007) /* Zune: V1, PRIV don't use it! */ +#define MUIM_Window_Refresh /* PRIV */ \ + (MUIB_Window | 0x00000008) /* Zune: V1, PRIV don't use it! */ struct MUIP_Window_AddControlCharHandler { -- 2.11.4.GIT