OCT
17
2006
|
Flake, the lib that saved KOfficeI often get the question what Flake is. And as the answer is getting clearer in the heads of the people designing it, I thought I'd write down an introduction. Flake is the component library for KOffice. The goal is to allow spreadsheets to be embedded in KWord and the text-engine to be embedded in Krita. In order to reach that goal we have to look back a little bit; in the KOffice1.n days (which lasted for the last 6 years) we had this kind of embedding based on widgets. This makes sense in some way since a widget really is a way to have a generic component that can be reused in other places easily. In KOffice we came up with Flake Shapes. A shape is a generic component that, just like a widget, you can reuse in other applications. Example shapes here are a vector shape. Think a circle or even a butterfly shape. Another example is a text shape. Anything from a one liner to a whole page of text. Shapes are designed to follow the Model View Controller (MVC) mechanism. Multiple shapes are each a view to the model. The controller is the Tool, which will be looked into in a bit. I can have 5 shapes showing all one large text document and these make up a 5 page book with that text. You can also reuse a shape to show it at a different zoom level. For page previews, for example. Each shape is a separate component. Shipped as a service (aka plugin) making it easy to share plugins with other applications. Its gotten ridiculously simple to have a styles based text in krita or kivio now, for example. The second big part of flake are Flake Tools. If you want to show text you need a text shape, but the question quickly arises on how you can alter the text, or type new text. Similarly there is a tool to move any shape around, as there is another tool to create and manipulate vector paths. The depth and broadness of Flake goes quite a bit further. Its got nested shapes and its got methods for generating dialogs for user input in a generic manner, etc. We designed loading / saving on a per shape manner as well as copy paste. But we are still looking for an implementor. More info can be found at the wiki
|
![]() |