SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
LibreOffice import filters for vector graphic formats
The fun of reverse- and straight engineering


 Fridrich Štrba – fridrich.strba@suse.com
 The Document Foundation
 Software Engineer, SUSE




                                            LGM 2012 - LibreOffice Graphic Import filters
Who Am I?

 Software Engineer in
 SUSE LibreOffice Team

 Diverse background

 FLOSS enthusiast

 Working in free time on
 various projects




                                                                       2
                           LGM 2012 - LibreOffice Graphic Import filters
Agenda


 Vector graphic import filters resulting from the work of
 LibreOffice community



 How we did it
  Framework used
  Missing file-format documentation
  Collaboration patterns
  Incremental reverse-engineering



                                                                                    3
                                        LGM 2012 - LibreOffice Graphic Import filters
Why do we handle legacy file-formats?




                                                                     4
                         LGM 2012 - LibreOffice Graphic Import filters
Legacy formats out there

 ODF is the future of the humanity
  Nevertheless, humanity does not know about it as of now

 Other de facto standards
  Some people use other Office Suites and graphic
  applications :(

 Hard-disks full of bad teenage poetry and indecent drawings
 in funny formats
   LibreOffice offers the freedom to read that pile of …



                                                                                  5
                                      LGM 2012 - LibreOffice Graphic Import filters
Pure intellectual exercise

 Allows to program for LibreOffice without having to
 understand its internals
   Pretty stand-alone functionality communicating with
   LibreOffice over well defined interfaces …
   … almost

 Happy users will reward you
  You will be the hero of the people who can now read their
  documents...
  … and they will get on your nerves listing features that are
  not converted.


                                                                                   6
                                       LGM 2012 - LibreOffice Graphic Import filters
Import filters available to all resulting from
the work of LibreOffice community




                                                                          7
                              LGM 2012 - LibreOffice Graphic Import filters
Vector graphics import filters based on libwpg

 WordPerfect Graphics import filter and libwpg
  Started by Marc Oude-Kotte and yours faithful
  Google Summer of Code by Ariya Hidayat in 2006

 MS Visio import filter and libvisio
  Google Summer of Code by Eilidh McAdam in 2011
  Guest appearance of re-lab's Valek Filippov

 Corel Draw import filter and libcdr
  Work in progress (kind of) started basically at the end of 2011
  Will be in LibreOffice 3.6
  Check http://dev-builds.libreoffice.org for preview fun

                                                                                      8
                                          LGM 2012 - LibreOffice Graphic Import filters
Future directions

 I prefer to speak about future when it becomes a feature
   Too many projects with declarations of intentions and
   nothing at the arrival
   Code speaks louder then press releases

 Google Summer of Code 2012
  An attempt at MS Publisher file-format

 Valek's personal pet file-format
  Macromedia Freehand
    Trying to crowd-source the development

                                                                                  9
                                      LGM 2012 - LibreOffice Graphic Import filters
How we did it?




                                                            10
                 LGM 2012 - LibreOffice Graphic Import filters
Minimize the count of reinvented wheels

 Reuse, embrace and extend
  ODF as interchange format
     Way import filters communicate with LibreOffice
  libwpg's application programming interface
     Reusing OdgGenerator class implementing this interface

 Speedy development
  No need to write any boilerplate code
    LibreOffice import filter itself about 100 LOC
  The core written as a standalone library
    Faster testing

                                                                                  11
                                       LGM 2012 - LibreOffice Graphic Import filters
Graphic Document Representation

namespace libwpg
{
  class WPGPaintInterface
  {
  public:
    virtual   ~WPGPaintInterface () {}
    virtual   void startGraphics (const ::WPXPropertyList &propList) = 0;
    virtual   void endGraphics () = 0;
    virtual   void setStyle (const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient) = 0;
    virtual   void startLayer (const ::WPXPropertyList &propList) = 0;
    virtual   void endLayer () = 0;
    virtual   void startEmbeddedGraphics (const ::WPXPropertyList &propList) = 0;
    virtual   void endEmbeddedGraphics () = 0;
    virtual   void drawRectangle (const ::WPXPropertyList& propList) = 0;
    virtual   void drawEllipse (const ::WPXPropertyList& propList) = 0;
    virtual   void drawPolygon (const ::WPXPropertyListVector &vertices) = 0;
    virtual   void drawPolyline (const ::WPXPropertyListVector &vertices) = 0;
    virtual   void drawPath (const ::WPXPropertyListVector &path) = 0;
    virtual   void drawGraphicObject (const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData) = 0;
    virtual   void startTextObject (const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path) = 0;
    virtual   void endTextObject () = 0;
    virtual   void startTextLine (const ::WPXPropertyList &propList) = 0;
    virtual   void endTextLine () = 0;
    virtual   void startTextSpan (const ::WPXPropertyList &propList) = 0;
    virtual   void endTextSpan () = 0;
    virtual   void insertText (const ::WPXString &str) = 0;
  };
} // namespace libwpg




                                                                                                                    12
                                                                         LGM 2012 - LibreOffice Graphic Import filters
Key Classes

 OdgGenerator.?xx
  Implementation of libwpg::WPGPaintInterface

 OdfDocumentHandler.hxx
  Abstract SAX interface to receive ODF document
  Code that serializes the SAX calls into file (flat ODF and zip-
  based ODF)

 *SVGGenerator.?xx
   Each library has an internal SVG Generator (suboptimal)
   New libwpg will make the SVG Generator part of the public
   API
                                                                                   13
                                        LGM 2012 - LibreOffice Graphic Import filters
Advantages

 Generating ODF is not trivial
  Settings
  Styles
  Automatic styles
  Content

 Provide a linear interface
  Reuse instead of copying the existing ODF generators
  Developer does not waste time designing interface
  Speeds up development by focusing on the essentials



                                                                               14
                                    LGM 2012 - LibreOffice Graphic Import filters
File-format documentation

 Almost none
  For libvisio
    Marginally useful user and developer documentation of MSDN
    Possibility to save using the VDX (xml) file-format
    Basically XML dump of the binary (the same concepts)
  For libcdr
    Document explaining a bit the CMX exchange format (similar
    concepts)


 Reverse engineering
  Based on re-lab's work
    oletoy

                                                                                     15
                                          LGM 2012 - LibreOffice Graphic Import filters
Development method

 Focus on getting “some” result early
  First embedded raster images
    Libreoffice is able to render them without further processing
  Next graphic primitives
    “Everything is just a path”


 Develop tools along the implementation
  Introspection tool improved constantly
    Driven by the need of the implementation
    Reflecting growing understanding of file-format
    Don't solve problems that don't exist



                                                                                        16
                                             LGM 2012 - LibreOffice Graphic Import filters
The team



      Valentin Filippov   Fridrich Štrba     Eilidh McAdam




                                                                                  17
                                       LGM 2012 - LibreOffice Graphic Import filters
Development method II

Design the software as you go

 Some code is better then an abstract design
  Possibility to find and fix real bugs
  Little communication overhead
    Communication by code in git
  Learning by doing mistakes and fixing

 Release soon, release often
  A release every 2-3 weeks
  Good to have intermediary targets

                                                                                 18
                                      LGM 2012 - LibreOffice Graphic Import filters
Extending the file-format coverage

Incremental reverse-engineering
  Nobody reinvents a wheel completely
    Two subsequent versions of the same file-format will have
    some common DNA
  Try to parse lower or higher version using the existing parser
    Fix issues as they appear
    Importance of a small number of reference documents
    covering many features
    Importance of having a working parser for other versions
Experience makes difference
  Different ways of encoding the same information
  Different ways of structuring
                                                                                   19
                                        LGM 2012 - LibreOffice Graphic Import filters
Q&A and Stoning session




      All text and image content in this document is licensed under the Creative Commons Attribution-Share Alike 3.0 License
      (unless otherwise specified). "LibreOffice" and "The Document Foundation" are registered trademarks. Their respective logos
      and icons are subject to international copyright laws. The use of these therefore is subject to the trademark policy.




                                                                                                                     20
                                                                          LGM 2012 - LibreOffice Graphic Import filters

Weitere ähnliche Inhalte

Was ist angesagt?

Overview of microsoft dot net platforms
Overview of microsoft dot net platformsOverview of microsoft dot net platforms
Overview of microsoft dot net platformsAbhijit B.
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studieshushu
 
Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpAbefo
 
Introduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsIntroduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsQUONTRASOLUTIONS
 
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)citizenmatt
 
Comparing IDL to C++ with IDL to C++11
Comparing IDL to C++ with IDL to C++11Comparing IDL to C++ with IDL to C++11
Comparing IDL to C++ with IDL to C++11Remedy IT
 
OMG CORBA Component Model tutorial
OMG CORBA Component Model tutorialOMG CORBA Component Model tutorial
OMG CORBA Component Model tutorialJohnny Willemsen
 
Introduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsIntroduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsQuontra Solutions
 
Vb.net session 01
Vb.net session 01Vb.net session 01
Vb.net session 01Niit Care
 
CORBA Programming with TAOX11/C++11 tutorial
CORBA Programming with TAOX11/C++11 tutorialCORBA Programming with TAOX11/C++11 tutorial
CORBA Programming with TAOX11/C++11 tutorialRemedy IT
 
Net Fundamentals
Net FundamentalsNet Fundamentals
Net FundamentalsAli Taki
 
Introductionto .netframework by Priyanka Pinglikar
Introductionto .netframework by Priyanka PinglikarIntroductionto .netframework by Priyanka Pinglikar
Introductionto .netframework by Priyanka PinglikarPriyankaPinglikar
 

Was ist angesagt? (14)

Overview of microsoft dot net platforms
Overview of microsoft dot net platformsOverview of microsoft dot net platforms
Overview of microsoft dot net platforms
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
 
Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
 
Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharp
 
Introduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsIntroduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutions
 
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
 
Comparing IDL to C++ with IDL to C++11
Comparing IDL to C++ with IDL to C++11Comparing IDL to C++ with IDL to C++11
Comparing IDL to C++ with IDL to C++11
 
OMG CORBA Component Model tutorial
OMG CORBA Component Model tutorialOMG CORBA Component Model tutorial
OMG CORBA Component Model tutorial
 
1.Philosophy of .NET
1.Philosophy of .NET1.Philosophy of .NET
1.Philosophy of .NET
 
Introduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsIntroduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutions
 
Vb.net session 01
Vb.net session 01Vb.net session 01
Vb.net session 01
 
CORBA Programming with TAOX11/C++11 tutorial
CORBA Programming with TAOX11/C++11 tutorialCORBA Programming with TAOX11/C++11 tutorial
CORBA Programming with TAOX11/C++11 tutorial
 
Net Fundamentals
Net FundamentalsNet Fundamentals
Net Fundamentals
 
Introductionto .netframework by Priyanka Pinglikar
Introductionto .netframework by Priyanka PinglikarIntroductionto .netframework by Priyanka Pinglikar
Introductionto .netframework by Priyanka Pinglikar
 

Ähnlich wie Import filters for vector graphic formats in LibreOffice: the reverse- and straight engineering fun

An Introduction To Linux Development Environment
An Introduction To Linux Development EnvironmentAn Introduction To Linux Development Environment
An Introduction To Linux Development EnvironmentS. M. Hossein Hamidi
 
Epub summit 2017 - Readium, the perfect EPUB/PWP companion
Epub summit 2017 - Readium, the perfect EPUB/PWP companionEpub summit 2017 - Readium, the perfect EPUB/PWP companion
Epub summit 2017 - Readium, the perfect EPUB/PWP companionLaurent Le Meur
 
"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007
"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007
"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007eLiberatica
 
Graphical libraries
Graphical librariesGraphical libraries
Graphical librariesguestbd40369
 
libocon16_areafill
libocon16_areafilllibocon16_areafill
libocon16_areafillHeiko Tietze
 
2013 t-dose - libre office easyhacks
2013   t-dose - libre office easyhacks2013   t-dose - libre office easyhacks
2013 t-dose - libre office easyhacksRob Snelders
 
LibreOffice Development
LibreOffice DevelopmentLibreOffice Development
LibreOffice DevelopmentKohei Yoshida
 
The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...
The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...
The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...Naruhiko Ogasawara
 
Key highlights from libreoffice conference 2014
Key highlights from libreoffice conference 2014Key highlights from libreoffice conference 2014
Key highlights from libreoffice conference 2014Sushil Shinde
 
Dojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectiveDojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectivecjolif
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitcbenDesigning
 
Flexible delivery options
Flexible delivery options Flexible delivery options
Flexible delivery options Micro Focus
 
LibreOffice/OpenOffice.org - non coding extensions
LibreOffice/OpenOffice.org - non coding extensionsLibreOffice/OpenOffice.org - non coding extensions
LibreOffice/OpenOffice.org - non coding extensionsKálmán "KAMI" Szalai
 
Presentation of lpOD (ODF automation platform) at FOSDEM 2010
Presentation of lpOD (ODF automation platform) at FOSDEM 2010Presentation of lpOD (ODF automation platform) at FOSDEM 2010
Presentation of lpOD (ODF automation platform) at FOSDEM 2010Itaapy
 

Ähnlich wie Import filters for vector graphic formats in LibreOffice: the reverse- and straight engineering fun (20)

An Introduction To Linux Development Environment
An Introduction To Linux Development EnvironmentAn Introduction To Linux Development Environment
An Introduction To Linux Development Environment
 
Epub summit 2017 - Readium, the perfect EPUB/PWP companion
Epub summit 2017 - Readium, the perfect EPUB/PWP companionEpub summit 2017 - Readium, the perfect EPUB/PWP companion
Epub summit 2017 - Readium, the perfect EPUB/PWP companion
 
"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007
"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007
"About Firebird and Flamerobin" by Marius Popa @ eLiberatica 2007
 
Graphical libraries
Graphical librariesGraphical libraries
Graphical libraries
 
libocon16_areafill
libocon16_areafilllibocon16_areafill
libocon16_areafill
 
2013 t-dose - libre office easyhacks
2013   t-dose - libre office easyhacks2013   t-dose - libre office easyhacks
2013 t-dose - libre office easyhacks
 
ODFKit
ODFKitODFKit
ODFKit
 
LibreOffice Development
LibreOffice DevelopmentLibreOffice Development
LibreOffice Development
 
Libre office
Libre officeLibre office
Libre office
 
The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...
The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...
The Next Step of LibreOffice non-English Local Communities - LibreOffice Conf...
 
MinGw Compiler
MinGw CompilerMinGw Compiler
MinGw Compiler
 
Key highlights from libreoffice conference 2014
Key highlights from libreoffice conference 2014Key highlights from libreoffice conference 2014
Key highlights from libreoffice conference 2014
 
Dojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectiveDojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspective
 
LibreOffice Online – Nextcloud, One Step Closer Towards Open Source Heaven
LibreOffice Online – Nextcloud, One Step Closer Towards Open Source HeavenLibreOffice Online – Nextcloud, One Step Closer Towards Open Source Heaven
LibreOffice Online – Nextcloud, One Step Closer Towards Open Source Heaven
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitc
 
Flexible delivery options
Flexible delivery options Flexible delivery options
Flexible delivery options
 
Koffice for mobile productivity
Koffice for mobile productivityKoffice for mobile productivity
Koffice for mobile productivity
 
OOoCon Lpod
OOoCon LpodOOoCon Lpod
OOoCon Lpod
 
LibreOffice/OpenOffice.org - non coding extensions
LibreOffice/OpenOffice.org - non coding extensionsLibreOffice/OpenOffice.org - non coding extensions
LibreOffice/OpenOffice.org - non coding extensions
 
Presentation of lpOD (ODF automation platform) at FOSDEM 2010
Presentation of lpOD (ODF automation platform) at FOSDEM 2010Presentation of lpOD (ODF automation platform) at FOSDEM 2010
Presentation of lpOD (ODF automation platform) at FOSDEM 2010
 

Kürzlich hochgeladen

Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Nitya salvi
 
TRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptxTRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptxtrose8
 
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...nirzagarg
 
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...Amil baba
 
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service AvailableCall Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service AvailableNitya salvi
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecturesaipriyacoool
 
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 
怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证
怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证
怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证eeanqy
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationZenSeloveres
 
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789CristineGraceAcuyan
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024Ilham Brata
 
怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证
怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证
怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证eeanqy
 
Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for FriendshipRaebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for FriendshipNitya salvi
 
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Nitya salvi
 
Lecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxLecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxShoaibRajper1
 
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Nitya salvi
 
Essential UI/UX Design Principles: A Comprehensive Guide
Essential UI/UX Design Principles: A Comprehensive GuideEssential UI/UX Design Principles: A Comprehensive Guide
Essential UI/UX Design Principles: A Comprehensive GuideDesign Studio UI UX
 
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证ehyxf
 

Kürzlich hochgeladen (20)

Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
 
TRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptxTRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptx
 
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
 
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
 
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service AvailableCall Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
 
怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证
怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证
怎样办理伯明翰城市大学毕业证(BCU毕业证书)成绩单留信认证
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
 
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024
 
怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证
怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证
怎样办理伦敦国王学院毕业证(KCL毕业证书)成绩单留信认证
 
Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Meerut [ 7014168258 ] Call Me For Genuine Models We...
 
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for FriendshipRaebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
 
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
 
Lecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxLecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptx
 
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
 
Essential UI/UX Design Principles: A Comprehensive Guide
Essential UI/UX Design Principles: A Comprehensive GuideEssential UI/UX Design Principles: A Comprehensive Guide
Essential UI/UX Design Principles: A Comprehensive Guide
 
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
 

Import filters for vector graphic formats in LibreOffice: the reverse- and straight engineering fun

  • 1. LibreOffice import filters for vector graphic formats The fun of reverse- and straight engineering Fridrich Štrba – fridrich.strba@suse.com The Document Foundation Software Engineer, SUSE LGM 2012 - LibreOffice Graphic Import filters
  • 2. Who Am I? Software Engineer in SUSE LibreOffice Team Diverse background FLOSS enthusiast Working in free time on various projects 2 LGM 2012 - LibreOffice Graphic Import filters
  • 3. Agenda Vector graphic import filters resulting from the work of LibreOffice community How we did it Framework used Missing file-format documentation Collaboration patterns Incremental reverse-engineering 3 LGM 2012 - LibreOffice Graphic Import filters
  • 4. Why do we handle legacy file-formats? 4 LGM 2012 - LibreOffice Graphic Import filters
  • 5. Legacy formats out there ODF is the future of the humanity Nevertheless, humanity does not know about it as of now Other de facto standards Some people use other Office Suites and graphic applications :( Hard-disks full of bad teenage poetry and indecent drawings in funny formats LibreOffice offers the freedom to read that pile of … 5 LGM 2012 - LibreOffice Graphic Import filters
  • 6. Pure intellectual exercise Allows to program for LibreOffice without having to understand its internals Pretty stand-alone functionality communicating with LibreOffice over well defined interfaces … … almost Happy users will reward you You will be the hero of the people who can now read their documents... … and they will get on your nerves listing features that are not converted. 6 LGM 2012 - LibreOffice Graphic Import filters
  • 7. Import filters available to all resulting from the work of LibreOffice community 7 LGM 2012 - LibreOffice Graphic Import filters
  • 8. Vector graphics import filters based on libwpg WordPerfect Graphics import filter and libwpg Started by Marc Oude-Kotte and yours faithful Google Summer of Code by Ariya Hidayat in 2006 MS Visio import filter and libvisio Google Summer of Code by Eilidh McAdam in 2011 Guest appearance of re-lab's Valek Filippov Corel Draw import filter and libcdr Work in progress (kind of) started basically at the end of 2011 Will be in LibreOffice 3.6 Check http://dev-builds.libreoffice.org for preview fun 8 LGM 2012 - LibreOffice Graphic Import filters
  • 9. Future directions I prefer to speak about future when it becomes a feature Too many projects with declarations of intentions and nothing at the arrival Code speaks louder then press releases Google Summer of Code 2012 An attempt at MS Publisher file-format Valek's personal pet file-format Macromedia Freehand Trying to crowd-source the development 9 LGM 2012 - LibreOffice Graphic Import filters
  • 10. How we did it? 10 LGM 2012 - LibreOffice Graphic Import filters
  • 11. Minimize the count of reinvented wheels Reuse, embrace and extend ODF as interchange format Way import filters communicate with LibreOffice libwpg's application programming interface Reusing OdgGenerator class implementing this interface Speedy development No need to write any boilerplate code LibreOffice import filter itself about 100 LOC The core written as a standalone library Faster testing 11 LGM 2012 - LibreOffice Graphic Import filters
  • 12. Graphic Document Representation namespace libwpg { class WPGPaintInterface { public: virtual ~WPGPaintInterface () {} virtual void startGraphics (const ::WPXPropertyList &propList) = 0; virtual void endGraphics () = 0; virtual void setStyle (const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient) = 0; virtual void startLayer (const ::WPXPropertyList &propList) = 0; virtual void endLayer () = 0; virtual void startEmbeddedGraphics (const ::WPXPropertyList &propList) = 0; virtual void endEmbeddedGraphics () = 0; virtual void drawRectangle (const ::WPXPropertyList& propList) = 0; virtual void drawEllipse (const ::WPXPropertyList& propList) = 0; virtual void drawPolygon (const ::WPXPropertyListVector &vertices) = 0; virtual void drawPolyline (const ::WPXPropertyListVector &vertices) = 0; virtual void drawPath (const ::WPXPropertyListVector &path) = 0; virtual void drawGraphicObject (const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData) = 0; virtual void startTextObject (const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path) = 0; virtual void endTextObject () = 0; virtual void startTextLine (const ::WPXPropertyList &propList) = 0; virtual void endTextLine () = 0; virtual void startTextSpan (const ::WPXPropertyList &propList) = 0; virtual void endTextSpan () = 0; virtual void insertText (const ::WPXString &str) = 0; }; } // namespace libwpg 12 LGM 2012 - LibreOffice Graphic Import filters
  • 13. Key Classes OdgGenerator.?xx Implementation of libwpg::WPGPaintInterface OdfDocumentHandler.hxx Abstract SAX interface to receive ODF document Code that serializes the SAX calls into file (flat ODF and zip- based ODF) *SVGGenerator.?xx Each library has an internal SVG Generator (suboptimal) New libwpg will make the SVG Generator part of the public API 13 LGM 2012 - LibreOffice Graphic Import filters
  • 14. Advantages Generating ODF is not trivial Settings Styles Automatic styles Content Provide a linear interface Reuse instead of copying the existing ODF generators Developer does not waste time designing interface Speeds up development by focusing on the essentials 14 LGM 2012 - LibreOffice Graphic Import filters
  • 15. File-format documentation Almost none For libvisio Marginally useful user and developer documentation of MSDN Possibility to save using the VDX (xml) file-format Basically XML dump of the binary (the same concepts) For libcdr Document explaining a bit the CMX exchange format (similar concepts) Reverse engineering Based on re-lab's work oletoy 15 LGM 2012 - LibreOffice Graphic Import filters
  • 16. Development method Focus on getting “some” result early First embedded raster images Libreoffice is able to render them without further processing Next graphic primitives “Everything is just a path” Develop tools along the implementation Introspection tool improved constantly Driven by the need of the implementation Reflecting growing understanding of file-format Don't solve problems that don't exist 16 LGM 2012 - LibreOffice Graphic Import filters
  • 17. The team Valentin Filippov Fridrich Štrba Eilidh McAdam 17 LGM 2012 - LibreOffice Graphic Import filters
  • 18. Development method II Design the software as you go Some code is better then an abstract design Possibility to find and fix real bugs Little communication overhead Communication by code in git Learning by doing mistakes and fixing Release soon, release often A release every 2-3 weeks Good to have intermediary targets 18 LGM 2012 - LibreOffice Graphic Import filters
  • 19. Extending the file-format coverage Incremental reverse-engineering Nobody reinvents a wheel completely Two subsequent versions of the same file-format will have some common DNA Try to parse lower or higher version using the existing parser Fix issues as they appear Importance of a small number of reference documents covering many features Importance of having a working parser for other versions Experience makes difference Different ways of encoding the same information Different ways of structuring 19 LGM 2012 - LibreOffice Graphic Import filters
  • 20. Q&A and Stoning session All text and image content in this document is licensed under the Creative Commons Attribution-Share Alike 3.0 License (unless otherwise specified). "LibreOffice" and "The Document Foundation" are registered trademarks. Their respective logos and icons are subject to international copyright laws. The use of these therefore is subject to the trademark policy. 20 LGM 2012 - LibreOffice Graphic Import filters