Welcome to your wiki!
This is the default page, edit it as you see fit. To add a page simply reference it within brackets, e.g.: [SamplePage].
The wiki uses Markdown syntax.
The format interface is defined by the FileFormat abstract class in common/comicdata.h. When you implement a new format for ComicSub, you have to derive your main class from FileFormat, create a global instance of the class and then register it in FormatRegister::registerFormats() in common/comicdata.cpp. Your main class must implement the following methods:
Method for loading a whole comicbook. The first argument, basedir, will contain a path from which to load external files. The second argument, device, will contain pointer to a valid QIODevice instance containing raw data for loading. Your format takes ownership of this device and it is your responsibility to close and delete it when you're done. You must also open the device yourself with the appropriate settings. You may keep it open as long as needed for your data provider.
You must return a valid non-NULL pointer to CSBRoot instance the contents of which must follow the data specification below. On error throw CSBException with information about the error (line number is optional, negative value means it is not applicable).
This method is optional. It will not be called when readonly() returns true. The first argument, basedir, will contain a path on which you can base relative paths to any external files you need to record. The second argument, device, will contain QIODevice instance to which you will save the data in your format. You must open the device yourself with the appropriate settings and close it before save() terminates. The last argument, data, will contain comicbook data following the specification below. On error throw CSBException with information about the error and negative line number.
Return true if your format can load the file specified by the argument. Just checking filename extension is enough, you do not have to guarantee that load() will return successfully.
This method is optional. Return true if your format does not implement save() (default behavior).
Return single localized filter string for file dialogs.
Data provider is an object which takes care of loading additional data (for now only page images). The base class DataProvider in common/comicdata.h provides basic implementation which only supports external files. Extend this class if you need to load data bundled in an archive.
Page images are assigned consecutive integer IDs starting with 0. Keeping all pages loaded is allowed but not recommended. Your data provider must implement the following methods:
External page support is mandatory. Check that the file specified by the argument can be successfully loaded and add it to the end of image list. Return its ID. On error return negative value.
External page support is mandatory. This method will behave the same as above except the file specified by the second argument will be inserted on the position specified by the first argument. Pages on position pos and greater will be moved to the next position. If pos is greater than the total number of pages, behave exactly as addExternalPage().
Remove page specified by the argument and move any pages after the removed page to their preceding position.
Load and return page image specified by the argument. On error return null QImage.
Return absolute path to external file corresponding to page specified by the argument. If there is no such external file (for example because the page is loaded from an archive), return null QString.
Any CSBRoot instance passed between the application core and instances of classes derived from FileFormat will adhere to the following rules:
Description of style for overlay.
This class has no children.
Description of single page in the comicbook.
This class has no parameters.
This class may contain any number of children of class rectangle or ellipse. These entries may be freely mixed. They will be rendered as overlays in the order in which they're listed, the last on top.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.