home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #3
/
amigamamagazinepolishissue1998.iso
/
blabla
/
prefsexchange
/
mcc_prefsexchange.doc
next >
Wrap
Text File
|
1998-01-24
|
43KB
|
1,344 lines
TABLE OF CONTENTS
PrefsExchange.mcc
PrefsExchange.mcc/MUIA_PrefsExchange_Application
PrefsExchange.mcc/MUIA_PrefsExchange_AppMask
PrefsExchange.mcc/MUIA_PrefsExchange_CopyrightString
PrefsExchange.mcc/MUIA_PrefsExchange_CreateIcons
PrefsExchange.mcc/MUIA_PrefsExchange_DescriptionString
PrefsExchange.mcc/MUIA_PrefsExchange_FileRequester
PrefsExchange.mcc/MUIA_PrefsExchange_GadgetDisplay
PrefsExchange.mcc/MUIA_PrefsExchange_InfoDisplay
PrefsExchange.mcc/MUIA_PrefsExchange_Locale
PrefsExchange.mcc/MUIA_PrefsExchange_MemPool
PrefsExchange.mcc/MUIA_PrefsExchange_MinVersion
PrefsExchange.mcc/MUIA_PrefsExchange_Name
PrefsExchange.mcc/MUIA_PrefsExchange_ParentPCName
PrefsExchange.mcc/MUIA_PrefsExchange_PEPageClass
PrefsExchange.mcc/MUIA_PrefsExchange_PresetSupport
PrefsExchange.mcc/MUIA_PrefsExchange_Priority
PrefsExchange.mcc/MUIA_PrefsExchange_Window
PrefsExchange.mcc/MUIA_PrefsExchange_VersionString
PrefsExchange.mcc/MUIM_PrefsExchange_Action
PrefsExchange.mcc/MUIM_PrefsExchange_AllocIFF
PrefsExchange.mcc/MUIM_PrefsExchange_AllocNotifyRequest
PrefsExchange.mcc/MUIM_PrefsExchange_ARexxCmd
PrefsExchange.mcc/MUIM_PrefsExchange_ContextMenuBuild
PrefsExchange.mcc/MUIM_PrefsExchange_ContextMenuChoice
PrefsExchange.mcc/MUIM_PrefsExchange_CreateGUI
PrefsExchange.mcc/MUIM_PrefsExchange_CreateImage
PrefsExchange.mcc/MUIM_PrefsExchange_DataspaceToPrefs
PrefsExchange.mcc/MUIM_PrefsExchange_DeleteGUI
PrefsExchange.mcc/MUIM_PrefsExchange_DeleteImage
PrefsExchange.mcc/MUIM_PrefsExchange_EndNotify
PrefsExchange.mcc/MUIM_PrefsExchange_FileRequest
PrefsExchange.mcc/MUIM_PrefsExchange_Finish
PrefsExchange.mcc/MUIM_PrefsExchange_FreeIFF
PrefsExchange.mcc/MUIM_PrefsExchange_FreeNotifyRequest
PrefsExchange.mcc/MUIM_PrefsExchange_GetDiskObject
PrefsExchange.mcc/MUIM_PrefsExchange_LoadFile
PrefsExchange.mcc/MUIM_PrefsExchange_MemAllocBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_MemBufferSize
PrefsExchange.mcc/MUIM_PrefsExchange_MemFreeBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_MemMakeBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_MemStrToBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_Message
PrefsExchange.mcc/MUIM_PrefsExchange_NotifyMessage
PrefsExchange.mcc/MUIM_PrefsExchange_PrefsToDataspace
PrefsExchange.mcc/MUIM_PrefsExchange_ReportDOSError
PrefsExchange.mcc/MUIM_PrefsExchange_ReportError
PrefsExchange.mcc/MUIM_PrefsExchange_ReportIFFError
PrefsExchange.mcc/MUIM_PrefsExchange_SaveFile
PrefsExchange.mcc/MUIM_PrefsExchange_SaveIcon
PrefsExchange.mcc/MUIM_PrefsExchange_StartNotify
PrefsExchange.mcc
1. General info
PrefsExchange.mcc is an external class; direct subclass of Notify.mui.
This class is the superclass for all PrefsExchange modules
(#?.prefsclass).
Every subclass of PrefsExchange.mcc is a preferences editor, which
provides methods for loading/saving preferences files and
creating/maintaining/disposing editor GUI.
Please note that .prefsclasses are created in a slightly different way
than .mcp ones.
2. Creating .prefsclasses
Probably the best way to create a new .prefsclass is to use the MCCLib
code by Kai Hoffman (available on Aminet, devs/mui) You'll have to set
preprocessor symbols like this:
SUPERCLASS - "PrefsExchange.mcc"
CLASS - should have the .prefsclass suffix
COPYRIGHT
AUTHOR
VERSION - this must be 16 or higher
REVISION
VERSIONSTR
Do NOT define these symbols:
ONLYGLOBAL
PREFSIMAGE_COMPRESSION
PREFSIMAGE_DEPTH
PREFSIMAGE_MASKING
PREFSIMAGE_WIDTH
PREFSIMAGE_HEIGHT
For your private attributes/methods use your MUI serial number
to get ID values (just like with .mcc/.mcp classes).
PrefsExchange.mcc/MUIA_PrefsExchange_Application
NAME
MUIA_PrefsExchange_Application -- (V16) [..G], Object *
FUNCTION
This attribute holds your application object.
Please use this instead of _app(obj), as your
object is not guaranteed to be added to the application
tree.
SEE ALSO
MUIA_PrefsExchange_Window
PrefsExchange.mcc/MUIA_PrefsExchange_AppMask
NAME
MUIA_PrefsExchange_AppMask -- (V16) [ISG], ULONG
FUNCTION
This attribute holds one or more of APPMASKF_xxx values.
These are:
APPMASKF_DEFAULTS
APPMASKF_RESTORE
APPMASKF_LASTSAVED
APPMASKF_USE
APPMASKF_SAVE
APPMASKF_OPEN
APPMASKF_SAVEAS
APPMASKF_TEST
APPMASKF_CANCEL
(Note they also exist as APPMASKB_xxx values, which specify
corresponding bit numbers).
This bitmask specify which 'actions' are applicable for your
preferences. For example, if you only support 'Last Saved', 'Save'
and 'Reset to Defaults' set this attribute to
APPMASKF_LASTSAVED|APPMASKF_SAVE|APPMASKF_DEFAULTS.
See MUIN_PrefsExchange_Action for more details.
You must supply this tag during object creation time; you can
also change its value later.
Every class must support DEFAULTS, at least one of 'input' and
at least one of 'output' actions.
You're guaranteed not to receive MUIM_PrefsExchange_Action for
actions not included in this mask.
SEE ALSO
MUIM_PrefsExchange_Action
PrefsExchange.mcc/MUIA_PrefsExchange_CopyrightString
NAME
MUIA_PrefsExchange_CopyrightString -- (V16) [I.G], STRPTR
FUNCTION
Set the copyright string for your class here.
You should pass this attribute during OM_NEW.
SEE ALSO
MUIA_PrefsExchange_DescriptionString,
MUIA_PrefsExchange_Name,
MUIA_PrefsExchange_VersionString
PrefsExchange.mcc/MUIA_PrefsExchange_CreateIcons
NAME
MUIA_PrefsExchange_CreateIcons -- (V16) [..G], ULONG
FUNCTION
If it's TRUE, you should create an icon for preferences
file saved during SAVEAS and OPEN. This attribute
is changed whenever the user toggles the corresponding
menuitem.
Generally, you're not required to support this.
SEE ALSO
MUIM_PrefsExchange_GetDiskObject
PrefsExchange.mcc/MUIA_PrefsExchange_DescriptionString
NAME
MUIA_PrefsExchange_DescriptionString -- (V16) [I.G], STRPTR
FUNCTION
Set a short description for your class.
You should pass this tag during OM_NEW.
SEE ALSO
MUIA_PrefsExchange_CopyrightString,
MUIA_PrefsExchange_Name
MUIA_PrefsExchange_VersionString
PrefsExchange.mcc/MUIA_PrefsExchange_FileRequester
NAME
MUIA_PrefsExchange_FileRequester -- (V16) [..G] struct FileRequester *
FUNCTION
It's a pointer to an ASL requester structure. You may use it
during MUIM_PrefsExchange_Action method (APPMASKB_OPEN and
APPMASKB_SAVEAS).
It's guaranteed to be non-NULL.
Don't cache this value - get it before every use.
Read the autodocs for MUIM_PrefsExchange_FileRequest to get
more info.
SEE ALSO
MUIM_PrefsExchange_FileRequest
PrefsExchange.mcc/MUIA_PrefsExchange_GadgetDisplay
NAME
MUIA_PrefsExchange_GadgetDisplay -- (V16) [I..}, ULONG
FUNCTION
Normally, PrefsExchange will create a toolbar for every
editor, which will contain gadgets for all actions
defined in MUIA_PrefsExchange_AppMask.
If you don't want the toolbar, set this attr to FALSE.
SEE ALSO
MUIA_PrefsExchange_InfoDisplay
PrefsExchange.mcc/MUIA_PrefsExchange_InfoDisplay
NAME
MUIA_PrefsExchange_InfoDisplay -- (V16) [I..], ULONG
FUNCTION
Normally, every page will have a little text object,
containing version and copyright strings.
Set this attr to FALSE if you don't want it.
SEE ALSO
MUIA_PrefsExchange_GadgetDisplay
PrefsExchange.mcc/MUIA_PrefsExchange_Locale
NAME
MUIA_PrefsExchange_Locale -- (V16) [..G], struct Locale *
FUNCTION
This attribute holds pointer to Locale used by PrefsExchange.
However, you'll probably want to open your catalog file
during library initialisation, so this attr is not useful.
PrefsExchange.mcc/MUIA_PrefsExchange_MemPool
NAME
MUIA_PrefsExchange_MemPool -- (V16) [..G], APTR
FUNCTION
Get the address of memory pool used by PrefsExchange.
You may use it only from the main task context.
SEE ALSO
MUIM_PrefsExchange_MemAllocBuffer,
MUIM_PrefsExchange_MemBufferSize,
MUIM_PrefsExchange_MemFreeBuffer,
MUIM_PrefsExchange_MemMakeBuffer,
MUIM_PrefsExchange_MemStrToBuffer
PrefsExchange.mcc/MUIA_PrefsExchange_MinVersion
NAME
MUIA_PrefsExchange_MinVersion -- (V16) [I..], ULONG
FUNCTION
During OM_NEW by passing this tag to DoSuperMethod()
you can specify minimal PrefsExchange.mcc version to use.
If specified version is not available, DSM will fail.
PrefsExchange.mcc/MUIA_PrefsExchange_Name
NAME
MUIA_PrefsExchange_Name -- (V16) [I.G], STRPTR
FUNCTION
Set the name of your class (without the .prefsclass suffix).
SEE ALSO
MUIA_PrefsExchange_CopyrightString,
MUIA_PrefsExchange_DescriptionString,
MUIA_PrefsExchange_VersionString
PrefsExchange.mcc/MUIA_PrefsExchange_PEPageClass
NAME
MUIA_PrefsExchange_PEPageClass -- (V16) [..G], struct IClass *
FUNCTION
This attribute is very important. It holds a pointer
to the PEPage class, which is a subclass of Group.mui.
You must return an object of this class during
MUIM_PrefsExchange_CreateGUI.
This is guaranteed to be non-NULL.
SEE ALSO
MUIM_PrefsExchange_CreateGUI
PrefsExchange.mcc/MUIA_PrefsExchange_PresetSupport
NAME
MUIA_PrefsExchange_PresetSupport -- (V16) [ISG] ULONG
FUNCTION
Set this to TRUE if you support the MUIM_PrefsExchange_PrefsToDataspace
and MUIM_PrefsExchange_DataspaceToPrefs mechanism.
If you set this to FALSE, then the submenu 'Presets' will
not appear in your page context menu.
Please note, that even if you set this attribute to FALSE,
then you still must ensure that both those methods will
reach your superclass.
Default for this attribute is TRUE.
SEE ALSO
MUIM_PrefsExchange_DataspaceToPrefs
MUIM_PrefsExchange_PrefsToDataspace
PrefsExchange.mcc/MUIA_PrefsExchange_Priority
NAME
MUIA_PrefsExchange_Priority -- (V16) [I..}, LONG
FUNCTION
Objects with high priority appear above objects with
lower pri in the listview. Objects with equal priority
are sorted alphabetically.
You should set this atrribute to 0.
The Info page has priority of 100000.
PrefsExchange.mcc/MUIA_PrefsExchange_Window
NAME
MUIA_PrefsExchange_Window -- (V16) [..G], Object *
FUNCTION
This attribute holds pointer to the PE window object.
You must use this attribute instead of _win(obj),
as your object will never be added to a window.
Of course, you may use _win(obj) and _app(obj)
on your GUI object between MUIM_Setup
and MUIM_Cleanup.
You may use this attribute to open a requester, for example.
SEE ALSO
MUIA_PrefsExchange_Application
PrefsExchange.mcc/MUIA_PrefsExchange_VersionString
NAME
MUIA_PrefsExchange_VersionString -- (V16) [I.G], STRPTR
FUNCTION
Set a version string for your class.
SEE ALSO
MUIA_PrefsExchange_CopyrightString,
MUIA_PrefsExchange_DescriptionString,
MUIA_PrefsExchange_Name
PrefsExchange.mcc/MUIM_PrefsExchange_Action
NAME
MUIM_PrefsExchange_Action (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_Action, ULONG actionid, ULONG reserved, ULONG flags);
FUNCTION
This is one of the most important methods.
PrefsExchange.mcc doesn't implement this method itself,
you'll have to override it.
You must be prepared to handle this method even outside
the MUIM_PrefsExchange_CreateGUI/DeleteGUI pair.
PrefsExchange issues this method whenever an I/O
action should be performed. 'actionid' will be one of
the following values:
- APPMASKB_DEFAULTS - just restore your prefs to default
values. You must support this method,
and it's not allowed to fail.
- APPMASKB_RESTORE - load prefs file that is currently in use.
It probably resides somewhere in ENV:.
- APPMASKB_LASTSAVED - load the 'last saved' prefs file.
It probably resides somewhere in ENVARC:.
- APPMASKB_USE - save prefs to ENV:.
- APPMASKB_SAVE - save them to both ENVARC: and ENV:
- APPMASKB_OPEN - open a file requester and let the user
decide which prefs file to load.
- APPMASKB_SAVEAS - just like above, but for saving.
If MUIA_PrefsExchange_CreateIcons attr is
set to TRUE, then you should also create
an icon for the prefs file you save.
Have a look at MUIM_PrefsExchange_GetDiskObject.
- APPMASKB_TEST - temporary 'Use' the values. See notes below.
- APPMASKB_CANCEL - undo the APPMASKB_TEST action.
During startup, PE will issue the APPMASKB_DEFAULTS method, followed
by APPMASKB_RESTORE.
If you don't support APPMASKB_RESTORE (see MUIA_PrefsExchange_AppMask)
or if it fails, you'll receive APPMASKB_LASTSAVED instead.
If the user hits 'Save' gadget but you don't support APPMASKB_SAVE,
it will be translated to APPMASKB_USE. If APPMASKB_USE is also
not supported, your class will be simply skipped.
This is how PE translates unsupported APPMASKB_xxx values:
RESTORE -> LASTSAVED -> DEFAULTS
LASTSAVED -> RESTORE -> nop
SAVE -> USE -> nop
USE -> SAVE -> nop
For example, if the user clicks on 'Use', some classes may
receive APPMASKB_USE, but some will receive APPMASKB_SAVE.
OPEN, SAVEAS, TEST and CANCEL are simply
not issued to classes which don't support them.
All this translation is done automatically by PrefsExchange, so
you'll never receive an action which is not supported by
you. See MUIA_PrefsExchange_AppMask for details.
You should implement the TEST just like USE, but you'll
have to store the previous prefs and reUSE them if you get CANCEL.
Some editors, like 'Input', have immediate feedback for every
user action. In this case you won't want to support both
TEST and CANCEL; just rely on MUIM_PrefsExchange_Finish.
If the PREFSEXCHANGE_ACTION_QUIET flag is set, then don't
report any I/O errors.
If the PREFSEXCHANGE_ACTION_CHANGED flag is set, then
you only need to actually save the file if user has
changed the preferences. This flag will only be set
for SAVEAS, SAVE and USE.
If the PREFSEXCHANGE_ACTION_AREXX flag is set, then
this command was requested by an ARexx script.
If the PREFSEXCHANGE_ACTION_INITIAL flag is set, then
PE is setting up at the moment.
If the PREFSEXCHANGE_ACTION_FINISHING flag is set, then
PE is going to quit.
NOTES
Application is locked (with MUIA_Application_Sleep) during
this call.
INPUTS
actionid - (ULONG) - one of APPMASKB_xxx values.
reserved - (ULONG) - reserved for future
flags - (ULONG) - set of PREFSEXCHANGE_ACTION_xxx values
SEE ALSO
MUIA_PrefsExchange_AppMask
MUIM_PrefsExchange_Finish
PrefsExchange.mcc/MUIM_PrefsExchange_AllocIFF
NAME
MUIM_PrefsExchange_AllocIFF (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_AllocIFF, STRPTR name, ULONG mode, ULONG flags);
FUNCTION
It's just a little shortcut.
This method will AllocIFF(), Open(), then InitIFFasDOS(),
finally OpenIFF().
A pointer to struct IFFHandle will be returned (or 0).
You may call MUIM_PrefsExchange_FreeIFF to free this handle.
INPUTS
name - (STRPTR) - pointer to filename
mode - (ULONG) - either MODE_OLDFILE or MODE_NEWFILE
flags - (ULONG) - if PREFSEXCHANGE_ACTION_QUIET is set, then
no error messages will appear.
if PREFSEXCHANGE_ACTION_INITIAL is set, then
the DOS error 'object not found' will not
be reported.
RESULT
a struct IFFHandle * or NULL if something went wrong
SEE ALSO
MUIM_PrefsExchange_FreeIFF,
MUIM_PrefsExchange_LoadFile,
MUIM_PrefsExchange_SaveFile
PrefsExchange.mcc/MUIM_PrefsExchange_AllocNotifyRequest
NAME
MUIM_PrefsExchange_AllocNotifyRequest (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_AllocNotifyRequest,ULONG userdata);
FUNCTION
This method is useful if you need to use DOS notification mechanism.
It will return a pointer to an initialized struct NotifyRequest;
you only have to set the nr_Name field. Do not modify any other
structure fields. PE will use nr_UserData for internal purposes, so
you have to specify your UserData when calling this method. .
Instead of simple StartNotify() please call MUIM_PrefsExchange_StartNotify,
the same for EndNotify(): use MUIM_PrefsExchange_EndNotify.
To free the NotifyRequest call MUIM_PrefsExchange_FreeNotifyRequest.
Every time the notification is triggered you'll receive
MUIM_PrefsExchange_NotifyMessage.
Using these methods saves task signal bits, as all NotifyRequests
share the same message port.
INPUTS
userdata - (ULONG) - you may put some private data here. You'll
receive this value during
MUIM_PrefsExchange_NotifyMessage.
RESULT
a pointer to initialized struct NotifyRequest or 0.
SEE ALSO
MUIM_PrefsExchange_EndNotify,
MUIM_PrefsExchange_FreeNotifyRequest,
MUIM_PrefsExchange_NotifyMessage,
MUIM_PrefsExchange_StartNotify
PrefsExchange.mcc/MUIM_PrefsExchange_ARexxCmd
NAME
MUIM_PrefsExchange_ARexxCmd (V16)
SYNOPSIS
MUIM_PrefsExchange_ARexxCmd(obj, MUIM_PrefsExchange_ARexxCmd, STRPTR command, ULONG reserved);
FUNCTION
PE offers some basic ARexx support for its external classes.
Every time PE receives the PECMD ARexx command, this method
will be issued to the appropiate class.
Syntax for the PECMD command is:
PECMD NAME/A, COMMAND/F
Where 'NAME' stands for classname, and 'COMMAND' string will be
directly passed to you with this method.
The value you return will be passed to ARexx as result code.
You may set the MUIA_Application_RexxString to hold an additional
result.
Application will be locked (with MUIA_Application_Sleep)
during this call.
INPUTS
- command (STRPTR) - pointer to commandstring for you or 0 if no
arguments were given
- reserved (ULONG) - not used
RESULT
result code for the operation.
PrefsExchange.mcc/MUIM_PrefsExchange_ContextMenuBuild
NAME
MUIM_PrefsExchange_ContextMenuBuild (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_ContextMenuBuild, Object *menu);
FUNCTION
If you want to have some custom menuitems in your page's contex
menu, you may override this method. Just create and add your
Menuitem.mui objects to the 'menu' parameter (which is a pointer
to Menu.mui object).
The whole menustrip will be disposed by PE after use.
Please pass this method to your superclass when you're done.
Note, that this method is different than MUIM_ContextMenuBuild.
INPUTS
menu - pointer to Menu.mui object. Add your menuitems
with OM_ADDMEMBER here.
BUGS
Actually, this method belongs to PEPageClass (see
MUIA_PrefsExchange_PEPageClass), but for easier interface it will
be sent to your PrefsExchange.mcc object.
SEE ALSO
MUIM_PrefsExchange_ContextMenuChoice
PrefsExchange.mcc/MUIM_PrefsExchange_ContextMenuChoice
NAME
MUIM_PrefsExchange_ContextMenuChoice (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_ContextMenuChoice, Object *item);
FUNCTION
You'll get this method when any of your menuitems created during
MUIM_PrefsExchange_ContextMenuBuild are selected by the user.
This method is similar to MUIM_ContextMenuChoice.
INPUTS
item - pointer to selected menu item
SEE ALSO
MUIM_PrefsExchange_ContextMenuBuild
PrefsExchange.mcc/MUIM_PrefsExchange_CreateGUI
NAME
MUIM_PrefsExchange_CreateGUI (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_CreateGUI, ULONG reserved);
FUNCTION
This is one of the most important methods.
When you receive this method, you have to create your GUI
object and return it.
The created object should be an instance of PEPage class
(you may obtain its pointer from MUIA_PrefsExchange_PEPageClass).
You may talk to this class just like to the Group.mui.
A simple example:
struct IClass *PEPage;
Object *GUI;
get(obj,MUIA_PrefsExchange_PEPageClass,&PEPage);
GUI=NewObject(PEPage,0, MUIA_Group_Horiz,TRUE,
Child, ... /* let's add our gadgets here */
If you return 0, then your page will be empty when the user
clicks on your entry in the listview.
You'll receive MUIM_PrefsExchange_DeleteGUI when your
GUI object is not required anymore.
In fact, you'll receive CreateGUI/DeleteGUI pairs every
time the user changes current listview entry. For large
GUIs object creation may take some time, so you may
create your object only once and delete it during your
OM_DISPOSE method. In this case, simply do nothing on DeleteGUI
calls.
INPUTS
- reserved (ULONG) - not used at present
RESULT
Object pointer or 0
SEE ALSO
MUIA_PrefsExchange_PEPageClass,
MUIM_PrefsEchange_DeleteGUI
PrefsExchange.mcc/MUIM_PrefsExchange_CreateImage
NAME
MUIM_PrefsExchange_CreateImage (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_CreateImage, ULONG reserved);
FUNCTION
When you receive this method, please create a Bodychunk or Bitmap
object containg an image for the listview. It should be 23x14 pixels.
You may return 0 - in this case you'll get no image :^(.
INPUTS
- reserved (ULONG) - not used at present
RESULT
Object pointer or 0
SEE ALSO
MUIM_PrefsExchange_DeleteImage
PrefsExchange.mcc/MUIM_PrefsExchange_DataspaceToPrefs
NAME
MUIM_PrefsExchange_DataspaceToPrefs (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_DataspaceToPrefs, Object *dataspace);
FUNCTION
When you receive this one, just read all your preferences
from the dataspace object, then pass it to your superclass.
It's opposite to MUIM_PrefsExchange_PrefsToDataspace, please
read the autodocs to get all details.
INPUTS
dataspace (Object *) - pointer to Dataspace.mui
RESULT
just return the value from your superclass
SEE ALSO
MUIA_PrefsExchange_PresetSupport
MUIM_PrefsExchange_PrefsToDataspace
PrefsExchange.mcc/MUIM_PrefsExchange_DeleteGUI
NAME
MUIM_PrefsExchange_DeleteGUI (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_DeleteGUI, Object *GUI);
NAME
This method is sent to you when your GUI object is no more
needed. Just dispose it. Please note, that the GUI pointer
passed to you with this method may be NULL, simply do
nothing in this case.
INPUTS
GUI (Object *) - pointer to an object created with
MUIM_PrefsExchange_CreateGUI
SEE ALSO
MUIM_PrefsExchange_CreateGUI
PrefsExchange.mcc/MUIM_PrefsExchange_DeleteImage
NAME
MUIM_PrefsExchange_DeleteImage (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_DeleteImage, Object *Image);
FUNCTION
Just like MUIM_PrefsExchange_DeleteGUI, but for the image
object created with MUIM_PrefsExchange_CreateImage.
INPUTS
Image (Object *) - pointer to an object created with
MUIM_PrefsExchange_DeleteGUI
SEE ALSO
MUIM_PrefsExchange_CreateImage,
MUIM_PrefsExchange_DeleteGUI
PrefsExchange.mcc/MUIM_PrefsExchange_EndNotify
NAME
MUIM_PrefsExchange_EndNotify (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_EndNotify, struct NotifyRequest *nr);
FUNCTION
Use this method instead of simple EndNotify() for NotifyRequests
created with MUIM_PrefsExchange_AllocNotifyRequest.
It is safe to call this method even if the notify request is not
currently active.
INPUTS
nr (struct NotifyRequest *) - pointer to the structure allocated
by MUIM_PrefsExchange_AllocNotifyRequest
SEE ALSO
MUIM_PrefsExchange_AllocNotifyRequest,
MUIM_PrefsExchange_FreeNotifyRequest,
MUIM_PrefsExchange_NotifyMessage,
MUIM_PrefsExchange_StartNotify
PrefsExchange.mcc/MUIM_PrefsExchange_FileRequest
NAME
MUIM_PrefsExchange_FileRequest (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_FileRequest, APTR fr, ULONG savemode, ULONG reserved, ULONG tag1,...);
FUNCTION
This method will open an ASL file requester. It's useful
during MUIM_PrefsExchange_Action APPMASKB_SAVEAS and APPMASKB_OPEN
calls.
'fr' is a pointer to struct FileRequest *; you may set it to NULL,
and in this case pointer from MUIA_PrefsExchange_FileRequest
will be used. You should generally do that - this way the paths
will be remembered between different prefsclasses.
'savemode' - set this to TRUE if this requester will be used
for saving. PE will set ASLFR_DoSaveMode accordingly and ASLFR_PositiveTest
will be assigned ("Save" or "Open"). You may however
use the tag ASLFR_PositiveText to override this. See notes below.
'reserved' - leave it to 0
'tag1' - you have to specify a complete taglist here. Remember
about TAG_DONE at the end. Please don't use the following tags,
they will be mantained by PE:
- ASLFR_Window (and ASLFR_PubScreenName, ASLFR_Screen etc.)
- ASLFR_SleepWindow (not applicable for MUI windows)
- ASLFR_DoSaveMode (see 'savemode' above)
These attributes will also be set by PE, however you may override them:
- ASLFR_Locale
- ASLFR_RejectIcons (default: TRUE)
- ASLFR_PositiveText
- ASLFR_TitleText (default: 'Select prefs file' or similar)
- ASLFR_DrawersOnly (default: FALSE)
Don't use these (it may change in future)
- ASLFR_PrivateIDCMP
- ASLFR_IntuiMsgFunc - perhaps some support for async reqs will be
available in future versions
- ASLFR_DoMultiSelect (must be always FALSE)
- any pattern/filtering related stuff, like ASLFR_DoPatterns etc.
INPUTS
see above
RESULT
0 if the requester was cancelled, pointer to a string (containing
selected file with path) otherwise. You may free the string
with a call to MUIM_PrefsExchange_MemFreeBuffer.
If you specify ASLFR_DrawersOnly, you'll get a pointer to drawers
name.
SEE ALSO
MUIA_PrefsExchange_FileRequester
PrefsExchange.mcc/MUIM_PrefsExchange_Finish
NAME
MUIM_PrefsExchange_Finish (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_Finish);
FUNCTION
This method will be sent to all classes just before PE exits.
Some prefsclasses which support immediate feedback (like
Input for example) will want to restore all preferences
to their previous values during this method.
SEE ALSO
MUIM_PrefsExchange_Action
PrefsExchange.mcc/MUIM_PrefsExchange_FreeIFF
NAME
MUIM_PrefsExchange_FreeIFF (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_FreeIFF, struct IFFHandle *iff);
FUNCTION
This method will delete the IFFHandle structure allocated with
MUIM_PrefsExchange_AllocIFF. It will CloseIFF(), Close()
and finally FreeIFF().
INPUTS
iff (struct IFFHandle *) - pointer to the structure allocated
by MUIM_PrefsExchange_FreeIFF
SEE ALSO
MUIM_PrefsExchange_AllocIFF
PrefsExchange.mcc/MUIM_PrefsExchange_FreeNotifyRequest
NAME
MUIM_PrefsExchange_FreeNotifyRequest (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_FreeNotifyRequest, struct NotifyRequest *nr);
FUNCTION
Call this method to free the NotifyRequest structure
allocated by MUIM_PrefsExchange_AllocNotifyRequest.
INPUTS
nr (struct NotifyRequest *)
SEE ALSO
MUIM_PrefsExchange_AllocNotifyRequest,
MUIM_PrefsExchange_EndNotify,
MUIM_PrefsExchange_NotifyMessage,
MUIM_PrefsExchange_StartNotify
PrefsExchange.mcc/MUIM_PrefsExchange_GetDiskObject
NAME
MUIM_PrefsExchange_GetDiskObject (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_GetDiskObject, ULONG reserved);
FUNCTION
If you want to save an icon together with prefs file,
You may call this method to obtain a pointer to DiskObject
structure. This way user will be able to configure icons
he/she wants to use
You have to free the DiskObject yourself, using appropiate
function from icon.library.
Please note, that this method may fail with a NULL pointer.
INPUTS
reserved (ULONG) - not used at present
RESULT
struct DiskObject * or NULL
SEE ALSO
MUIA_PrefsExchange_CreateIcons,
icon.library autodocs
PrefsExchange.mcc/MUIM_PrefsExchange_LoadFile
NAME
MUIM_PrefsExchange_LoadFile (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_LoadFile, STRPTR name, ULONG flags);
FUNCTION
This method will open, examine and read the specified file
into allocated memory. If a DOS error occurs, user will see
some info about it unless the PREFSEXCHANGE_ACTION_QUIET flag
is set.
You may free the memory allocated by this function
with MUIM_PrefsExchange_MemFreeBuffer and get its size
with MUIM_PrefsExchange_MemBufferSize.
This function is really trivial, you'll probably want to write
another one that will suit your needs better.
INPUTS
name (STRPTR) - pointer to filename
flags (ULONG) - if PREFSEXCHANGE_ACTION_QUIET is set, then user won't be
bothered with error messages
if PREFSEXCHANGE_ACTION_INITIAL is set, then the DOS
error 'object not found' will not be reported.
RESULT
pointer to loaded data or 0 if failed.
use MUIM_PrefsExchange_MemFreeBuffer to free this memory.
SEE ALSO
MUIM_PrefsExchange_SaveFile,
MUIM_PrefsExchange_MemAllocBuffer,
MUIM_PrefsExchange_MemBufferSize,
MUIM_PrefsExchange_MemFreeBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_MemAllocBuffer
NAME
MUIM_PrefsExchange_MemAllocBuffer (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_MemAllocBuffer, ULONG size, ULONG req);
FUNCTION
The MUIM_PrefsExchange_Memxxx methods provide an interface
to internal PE pool-based memory routines. They're all very
simple, but perhaps they will save you some work.
This function allocates a memory block and keeps track of its size.
The 'req' attribute should always be MEMF_ANY|MEMF_PUBLIC, because
it's the only memory type you'll be able to obtain with this
method. You may also set the MEMF_CLEAR flag to have the newly-
allocated memory cleared with 0es.
Passing NULL size is not a good idea.
It's ok to call this function from subtasks.
INPUTS
size (ULONG) - how many bytes to allocate.
req (ULONG) - requirement flags; just like with AllocMem()
RESULT
a pointer to your memory block. you may only free it with
MUIM_PrefsExchange_MemFreeBuffer.
WARNING: the pointer you get will be aligned to 2, so it's
unsafe to use it with some DOS calls, which require
pointers aligned to 4.
SEE ALSO
MUIM_PrefsExchange_MemBufferSize,
MUIM_PrefsExchange_MemFreeBuffer,
MUIM_PrefsExchange_MemMakeBuffer,
MUIN_PrefsExchange_MemStrToBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_MemBufferSize
NAME
MUIM_PrefsExchange_MemBufferSize (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_MemBufferSize, APTR buffer);
FUNCTION
This method will return the length of a 'buffer' allocated
with MUIM_PrefsExchange_MemAllocBuffer/StrToBuffer/MakeBuffer.
INPUTS
buffer (APTR) - pointer to a memory block
RESULT
size of the memory block
PrefsExchange.mcc/MUIM_PrefsExchange_MemFreeBuffer
NAME
MUIM_PrefsExchange_MemFreeBuffer (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_MemFreeBuffer, APTR buffer);
FUNCTION
This method will free memory allocated with
MUIM_PrefsExchange_MemAllocBuffer/StrToBuffer/MakeBuffer.
INPUTS
buffer (APTR) - pointer to memory block or 0
SEE ALSO
MUIM_PrefsExchange_MemAllocBuffer,
MUIM_PrefsExchange_MemBufferSize,
MUIM_PrefsExchange_MemMakeBuffer,
MUIM_PrefsExchange_MemStrToBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_MemMakeBuffer
NAME
MUIM_PrefsExchange_MemMakeBuffer (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_MemMakeBuffer, APTR mem, ULONG size);
FUNCTION
It will allocate a memory block (just like MUIM_PrefsExchange_AllocBuffer)
which will be filled with data found at 'mem'.
This method is useful when making 'snapshots' of some
data structures.
INPUTS
mem (APTR) - pointer to some data to be copied into new buffer
size (ULONG) - size of the data block
RESULT
pointer to the allocated memory block or 0
SEE ALSO
MUIM_PrefsExchange_MemAllocBuffer,
MUIM_PrefsExchange_MemBufferSize
MUIM_PrefsExchange_MemFreeBuffer,
MUIM_PrefsExchange_MemStrToBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_MemStrToBuffer
NAME
MUIM_PrefsExchange_MemStrToBuffer (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_MemStrToBuffer, STRPTR string);
FUNCTION
This method will make a copy of the given string.
You may free this copy with MUIM_PrefsExchange_MemFreeBuffer.
Empty strings are okay for this method, however passing
a NULL string pointer will simply cause this method to return
0.
INPUTS
string (STRPTR) - pointer to string
RESULT
pointer to a copy of the given string or 0
SEE ALSO
MUIM_PrefsExchange_MemAllocBuffer,
MUIM_PrefsExchange_MemBufferSize,
MUIM_PrefsExchange_MemFreeBuffer,
MUIM_PrefsExchange_MemMakeBuffer
PrefsExchange.mcc/MUIM_PrefsExchange_Message
NAME
MUIM_PrefsExchange_Message (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_Message, STRPTR raw, ULONG arg1,...)
FUNCTION
This method will format a string using given parameters
and display it in the bottom part of the main PE window.
String is formated with RawDoFmt() function. You may
not use newline (LF) codes in your string; however
other MUI text engine formatting sequences are fine.
INPUTS
raw (STRPTR) - raw string
arg1 (ULONG) - list of arguments for text formatting
SEE ALSO
MUIM_PrefsExchange_ReportDOSError,
MUIM_PrefsExchange_ReportError,
MUIM_PrefsExchange_ReportIFFError
PrefsExchange.mcc/MUIM_PrefsExchange_NotifyMessage
NAME
MUIM_PrefsExchange_NotifyMessage (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_NotifyMessage, struct NotifyMessage *nm, ULONG userdata);
FUNCTION
Whenever DOS notification (started with MUIM_PrefsExchange_StartNotify)
is triggered this method will be issued to you.
INPUTS
nm (struct NotifyMessage *) - don't reply it, PE will do it for you
userdata (ULONG) - your ULONG, specified during structure allocation
SEE ALSO
MUIM_PrefsExchange_AllocNotifyRequest,
MUIM_PrefsExchange_EndNotify,
MUIM_PrefsExchange_FreeNotifyRequest,
MUIM_PrefsExchange_StartNotify
PrefsExchange.mcc/MUIM_PrefsExchange_PrefsToDataspace
NAME
MUIM_PrefsExchange_PrefsToDataspace (V16)
SYNOPSIS
DoMethod(obj, MUIM_PrefsExchange_PrefsToDataspace, Object *dataspace);
FUNCTION
When you receive this method, first pass it to your superclass.
If it returns TRUE, then write all your prefsdata to the
Dataspace.mui object. Return TRUE if everything went OK, else
return FALSE. As ID values, you should use values calculated
from your MUI serial number (just like with .mcp classes).
This mechanism is needed for creating 'preset' files, which
combine all preferences from all editors in one file.
You're generally not required to support this method.
INPUTS
dataspace (Object *) - pointer to an object of Dataspace.mui
RESULT
TRUE if everything went OK, FALSE on failure
SEE ALSO
Dataspace.mui autodocs,
MUIA_PrefsExchange_PresetSupport
MUIM_PrefsExchange_DataspaceToPrefs
PrefsExchange.mcc/MUIM_PrefsExchange_ReportDOSError
NAME
MUIM_PrefsExchange_ReportDOSError (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_ReportDOSError, LONG ioerr, STRPTR name);
FUNCTION
It will display a DOS error message.
'name' is a pointer to filename associated with the ioerr code; may be 0.
INPUTS
ioerr (LONG) - errorcode obtained from IoErr()
name (STRPTR) - (optional) pointer to filename
SEE ALSO
MUIM_PrefsExchange_Message,
MUIM_PrefsExchange_ReportError
MUIM_PrefsExchange_ReportIFFError
PrefsExchange.mcc/MUIM_PrefsExchange_ReportError
NAME
MUIM_PrefsExchange_ReportError (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_ReportError, STRPTR error);
FUNCTION
It will display an error-message.
INPUTS
error (STRPTR) - pointer to an error-string
SEE ALSO
MUIM_PrefsExchange_Message,
MUIM_PrefsExchange_ReportDOSError,
MUIM_PrefsExchange_ReportIFFError
PrefsExchange.mcc/MUIM_PrefsExchange_ReportIFFError
NAME
MUIM_PrefsExchange_ReportIFFError (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_ReportIFFError, ULONG ifferr, STRPTR name);
FUNCTION
It will display an iffparse error message.
INPUTS
ifferr (ULONG) - errorcode returned by one of the iffparse.library functions
name (STRPTR) - filename related to the error, may be 0
SEE ALSO
MUIM_PrefsExchange_Message,
MUIM_PrefsExchange_ReportDOSError,
MUIM_PrefsExchange_ReportError
PrefsExchange.mcc/MUIM_PrefsExchange_SaveFile
NAME
MUIM_PrefsExchange_SaveFile (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_SaveFile, STRPTR name, APTR buffer, ULONG size, ULONG flags);
FUNCTION
This method will save a memoryblock to a file.
All DOS errors will be reported, unless PREFSEXCHANGE_ACTION_QUIET flag
is set.
INPUTS
name (STRPTR) - pointer to filename
buffer (APTR) - data pointer
size (ULONG - data size
flags (ULONG) - if PREFSEXCHANGE_ACTION_QUIET is set, then no DOS errors
will be reported
RESULT
TRUE or FALSE
PrefsExchange.mcc/MUIM_PrefsExchange_SaveIcon
NAME
MUIM_PrefsExchange_SaveIcon (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_SaveIcon, STRPTR filename, struct DiskObject *diskobj, ULONG flags)
FUNCTION
This function simply saves an icon file.
'filename' is a pointer to string without the '.info' suffix.
'diskobj' is a pointer to DiskObject structure or NULL - in this
case default icon (got from MUIM_PrefsExchange_GetDiskObject)
will be used.
For 'flags', you may use the value passed to you with
MUIM_PrefsExchange_Action. Currently, only PREFSEXCHANGE_ACTION_QUIET
is recognized, and will suppress all error messages.
You'll want to call this function during APPMASKB_SAVEAS
if the MUIA_PrefsExchange_CreateIcons attribute is set to TRUE.
Normally you should pass NULL for the 'do' parameter.
INPUTS
filename (STRPTR) - pointer to filename (without .font suffix)
diskobj (struct DiskObject *) - pointer to a DiskObject structure or 0
flags (ULONG) - PREFSEXCHANGE_ACTION_QUIET - supress error messages
RESULT
TRUE or FALSE
PrefsExchange.mcc/MUIM_PrefsExchange_StartNotify
NAME
MUIM_PrefsExchange_StartNotify (V16)
SYNOPSIS
DoMethod(obj,MUIM_PrefsExchange_StartNotify, struct NotifyRequest *nr);
FUNCTION
Use this method instead of simple StartNotify() for NotifyRequests
created with MUIM_PrefsExchange_AllocNotifyRequest.
Every time the notification is triggered you'll get
MUIM_PrefsExchange_NotifyMessage method.
INPUTS
nr (struct NotifyRequest *) - pointer to structure allocated with
MUIM_PrefsExchange_AllocNotifyRequest
RESULT
TRUE or FALSE