Short: MMamM Author: Stefan Kleinheinrich Type: dev/mui Version: 0.3 MMamM requires an installed MorphOS SDK, without you won't even get a useable GUI. MMamM (MUI MUI and more MUI) is tool for creating and maintaining MUI custom-classes soley based on C(++) sources. It was designed in to be non-destructive on preexisting sources. Code parts unrelated to the MUI class will remain unaffected and so will already implemented methods (unless you delete them...). MMamM will attempt to load existing classes, but anything that isn't really close to the coding style generated MMamM will have issues. MMamM will also generate/update MUICLasses.c(pp) and MUIClasses.h in the same directory as class is saved. Shortcomings of this release: - only classes defined in mui.h can be used as baseclass - whatever you type in the "argument" field will be copied into the source verbatim no sanity checks whatsoever - when changing a class name and/or it's filename you may end up yourself with a muiclasses.h/c referencing a nonexistant class (tried my best to keep it sane) - no proper manual/documentation ;) Basic usage: On startup the GUI will be disabled and you either have to select "New" or "Open" from menu. At the top you have a string gadeget for the name of your class, at the right you can select which MUI class it should be based on. You can enter any name here, but MMamM won't know about any methods defined for classes not found in mui.h. In the "Methods" rider you have to listview, left side for the ones defined in your class, right side for methods that can be overloaded based the type of the baseclass. Those can be pulled into the left listview, where they will appear in blue, while custom methods will appear in black. The argument and name can't be changed for overloaded methods. New classes will have OM_NEW,OM_SET and OM_GET defined as default, you can delete them but doing so will the "Attributes" part of MMamM to be fully useable. For custom classes you can select an argument: - "Msg" if you don't need one - MV_ULONG/LONG/STRPTR/APTR if you only need a single argumnet of that type - MV__ if you want something special. These will be defined in muiclasses.h as stumps only containing "ULONG MethodID", add further entries afterwards In the "Attributes" rider you can add attributes to your class. At default the are created with code OM_SET(OM_NEW) and OM_GET and an entry in your INST_DATA. You can disable "Set" and enablle "Init" if you want an attribute to only be assigned to in OM_NEW. INST_DATA entry is created either as "Copy" for non-pointer types and "Reference" for all pointer types. Pointer types whose size can be determined can also be copied (a passes struct MyStuff *foo would be stored as struct MyStuff foo in INST_DATA). This is disabled for pointers to unknown objects/sizes like "APTR","Object*" or STRPTR). Setting up a minimal test project: - copy main.c into an empty directory - start MMamM and name your class "MyString" - change baseclass to MUIC_String - add methods and attributes as you wish - save as MyString.c in the new directory - (MMamM will generate MUIClasses.c and .h) - you can now compile&link all 3 sources by hand, create your own makefile or - fire up FlowStudio - select "New Project" from the menu - name it and save into the same directory as the sources (saving it elsewhere might cause problems) - select "Add Project Files" and add all 3 sources (and MUIClasses.h) - you should now be able to build the project - in main.c change the "StringObject" to "MyStringObject" - build again and you have an app using your new class How to (not) handle the generated sources: The key feature of MMamM is that it can reload files that have already been touched by the user to add,change or remove methods and attributes without destroying user code. Some caution has to applied. - always make sure you have a recent backup of your files in case something does go wrong - don't change the formating of the functions or the dispatcher - when adding comments or string constant be aware that MMamM may read them as C source - don't name things that are only a longer version of something allready existing as the stringsearch functions aren't sophisticated enough for it MM_MyClass_Dostuff and MM_MyClass_DostuffExtra -> bad MM_MyClass_Dostuff and MM_MyClass_DoExtrastuff -> good Things you are supposed to do: - add functions, variables etc not directly part of the MUI class - add functional code between the struct Data... and return... lines - add additional code in the doset() function - add tags before TAG_MORE in the mNew() function Contact: skleinheinrich@t-online.de