Education ClassRoom/Previous Logs/gsl

From Apache OpenOffice Wiki
Jump to: navigation, search

[10:59] <PhilippL> Hi everybody

[10:59] * lgodard (n=lgodard@gateway.nuxeo.com) has joined #education.openoffice.org

[11:00] <PhilippL> I have uploaded some slides to http://gsl.openoffice.org/files/documents/16/4245/gsl_overview.odp

[11:00] <PhilippL> Which may be illustrating to what I'm going to say.

[11:00] <PhilippL> So, I'm here to talk a little about the gsl project.

[11:00] <ericb2> hello PhilippL , thank you very much for presenting us the GSL project

[11:01] <PhilippL> First, what does it mean ? GSL stands for Graphics System Layer.

[11:02] <PhilippL> Actually there are some modules in it that have not so much to do with graphics, but essentially GSL is about binding to the graphical subsystems of the system OOo runs on.

[11:02] * PhilippL switches to slide # 2

[11:02] <PhilippL> The core functionality of GSL is providing OOo's toolkit functionality.

[11:03] <PhilippL> Toolkit meaning what gtk is for Gnome, Qt for KDE or Swing / AWT for Java.

[11:03] <PhilippL> The parts of gsl I'm going to talk about a little are mainly located in the vcl, toolkit, dtrans and rsc modules of gsl.

[11:04] <PhilippL> VCL (Visual Control Layer) is the traditional toolkit of OOo.

[11:04] <PhilippL> In use basically since 1997 (meaning in StarOffice before OOo went OpenSource in 2001).

[11:05] <PhilippL> VCL is a C++ toolkit, based heavily on C++ inheritance mechanisms.

[11:05] <PhilippL> Since these are not so easily help binary compatibly.

[11:06] <PhilippL> toolkit was invented, which as a stable UNO API.

[11:06] <PhilippL> UNO meaning (Unified Network Objects)

[11:06] <PhilippL> which is OOo's kind of distributed objects (think Corba or .NET)

[11:07] <PhilippL> toolkit is supposed to be a thin wrapper around vcl that binds the (changing) vcl interface to UNO based services which stay binary compatible.

[11:08] <PhilippL> Then there is the rsc (resource compiler), currently still OOo's most heavily used method of doing localization.

[11:08] * PhilippL switches to slide 3

[11:08] <PhilippL> So let's talk a little more about vcl.

[11:09] <PhilippL> vcl is the core of gsl, providing the main event loop, everything that produces output (Windows, virtua devices, printers,...), most controls (Edit fields, buttons, ...)

[11:10] <PhilippL> it also does a lot for reading system specific settings like theme colors, does native looking widget rendering (NWF).

[11:10] <PhilippL> Basically without vcl you wouldn't see a single pixel.

[11:10] <PhilippL> And at some point it is presumed to go away :-)

[11:10] <PhilippL> But more to that later.

[11:11] * PhilippL switches to slide 4

[11:11] <PhilippL> A little more on toolkit: toolkit is your way to go if you want to write UI code that is going to be binary compatible.

[11:12] <PhilippL> A conditio sine qua non if you're writing extensions.

[11:12] <PhilippL> There are other ways, like using java, of course, but the UNO services provided by toolkit are going to stay for a while.

[11:12] <PhilippL> Making sure that your extension won't only run in OOo 3.0, but 3.1, 3.2 and whatever is going to follow.

[11:13] * PhilippL switches to slide 5

[11:13] <PhilippL> Then there is clipboard and drag&drop functionality.

[11:14] <PhilippL> Logically and implementationwise this is tied quite closely to the main event queue, so it should belong into vcl itself.

[11:14] <PhilippL> That actually is where it originally was, but at the time a new implementation came around, UNO had become to get "en vogue".

[11:15] <PhilippL> So this functionality was put out into an own UNO service library and has staid there since.

[11:16] <PhilippL> If that is a good thing is open to debate, but at least it shows how much flexibility we have with the concepts of UNO. In principle you could exchange the clipboard functionality by your own version, just replacing the service.

[11:16] * PhilippL switches to slide 6

[11:16] <PhilippL> The resource compiler

[11:17] <PhilippL> I mention it mainly because it will come up in an example I will come to later.

[11:17] <PhilippL> RSC is a compiler taking in a "resource source" file containg UI descriptions.

[11:18] <PhilippL> It also contains localizations of everything that needs to be localized (Strings, bitmaps, potentially whole elements).

[11:18] <PhilippL> it compiles this source into a multitude of binary output files, one for each locale requested.

[11:19] <PhilippL> So you end up with one resource file for english, french, german, whatever each.

[11:19] * PhilippL switches to slide 7

[11:19] <PhilippL> There is so many stuff in gsl, let's pick one concrete example.

[11:20] <PhilippL> What you're first going to see when starting OOo is always a Window.

[11:20] <PhilippL> So how does it work ?

[11:20] <PhilippL> From the system point of view, exactly one window is involved here.

[11:21] <PhilippL> This is abstracted using per system implementation in vcl's system dependent layer called SAL: System Abstraction Layer.

[11:21] <PhilippL> Incidentally there is another sal in the porting project.

[11:21] <PhilippL> That one is OOo's equivalent to the C runtime library.

[11:22] <PhilippL> It also means (you guessed it) System Abstraction Layer.

[11:22] <PhilippL> The same name is a historical accident, however vcl's sal layer existed first :-)

[11:22] <PhilippL> So this one system window will usually contain multiple vcl Windows.

[11:23] <PhilippL> That is because vcl uses "soft windows" or "gadgets" as they are e.g. called in the X11 toolkit.

[11:23] <PhilippL> Basically a gadget is only a clip region that confines drawing of a logical window into its own borders.

Personal tools