X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prochac.sk; s=default; t=1452460925; bh=4z5Z5Q/nktK3Hc1/Y4Z0kp7q7S7O2710YB7BTHdyPeI=; h=To:From:Subject:Date; b=c+PgKJSj9PrflqEvvKQhbsQ/+3+kL4iO+Z4FXgsIn3zRJS472jCGfPPyks2U7bdDI 4blD6AVT4BTMDObYott1sGwNMq0U4X8x3V9Yfagyd6Czlo2HomJDaDk5NCJ3IfxIYm swEguge3uQzCEZsAWsDiiuPhVXfAafqCOL5GVNbM= X-Clacks-Overhead: "GNU Terry Pratchett" To: geda-user AT delorie DOT com From: "Milan Prochac (milan AT prochac DOT sk) [via geda-user AT delorie DOT com]" Subject: [geda-user] A new PCB file format - modular system Message-ID: <5692CBD5.3020101@prochac.sk> Date: Sun, 10 Jan 2016 22:23:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-101.0 required=5.0 tests=ALL_TRUSTED, USER_IN_WHITELIST autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on angua.bastl.sk Reply-To: geda-user AT delorie DOT com After reading long discussions about the new PCB file format I tried to implement support for multiple file formats. You can download it here: http://static.bastl.sk/pcb/Modular-file-formats.gz It is also available on launchpad: https://bugs.launchpad.net/pcb/+bug/1532611 The patch implements modular system to support multiple PCB file formats. Attached is also the template of the file-format plugin with instructions. The patch is not too big, but it touches various parts of PCB, so it is possible that some corner cases are not handled properly. Comments and bug reports are welcome. The modular system utilizes existing plugin system; new type of plugin is added to support various file formats. This approach allows implementation of additional file formats as independent shared library with minimal effort. The whole implementation of new file format is reduced to serialization and de-serialization of PCBType data structure, no PCB tweaking is necessary. The template with instructions is provided, as mentioned above. - modular system is available for all layout operations (Load, Save, Save As, Load to buffer, Revert, auto-backup); the element operations will be added later. - action "SaveTo(LayoutAs..." was extended by 3rd argument, specifying file format; if omitted, current (or default) format is used - GUI (GTK only at the moment) was adjusted to allow select file format; for "save" operations it specifies desired format, for "open" operations it is used as filter - file format is detected automatically by modular framework - the versioning system (based on PCB file version #defines) is available - each plugin should confirm it's capability to save data of required version (like 20110603); if not, the file format cannot be used - load-only and save-only formats are supported. If save-only format is used, the layout is not marked as "saved". - the current PCB format is converted to built-in plugin. With this enhancement it should be very easy to implement new file formats. If more of them will be available, the most successful can become new standard PCB format and - hopefully - the data model modifications will be not blocked by hard-to-extend file format anymore... Regards Milan