Home > Linux-Presentation-Foundation

Linux-Presentation-Foundation

Linux-Presentation-Foundation is a project mainly written in C++ and C, based on the GPL-3.0 license.

The Linux Presentation Foundation (or LPF) is a graphical subsystem for rendering user interfaces in Linux-based applications. It is based on the principles of WPF

== Linux Presentation Foundation == '''Linux Presentation Foundation''' is a class library which will make your Linux experience great. I've heard of too many people blaming that Linux is ugly when compared to Windows or Mac OS, from a graphical point of view and that Compiz is able to do many things but mostly not very useful.

== Why LPF? == Developers on Windows have WPF. It is amazing and you can do a lot of incredible effects. You can use XML (XAML is the correct term) to design UIs. This project is not a copy of WPF. It won't be developed in C#, as C# is not quite loved among the Linux developers. It uses C++ and in the future a port to Phyton is possible. The main target of LPF is to give to the Linux world a powerful tool to develop nice and clean UIs. Another priority is to show the world that the power of Linux is unlimited and there is nothing that you can do on Windows that you can't do on Linux, and better.

== Differences to WPF == Due to some lacks of C++ in constrast to C# many classes have different functions and Properties (get & set) can't be implemented. If in WPF you wrote: int temp = this.Width; this.Width = 100; In C++ our only option is: int temp = this.Width(); this.Width(100); In WPF your code is executed (unless you're using threads) in the GUI thread. Which means that you will slow down rendering if you do something slow. In LPF the GUI Rendering thread is executed apart. You can access property of the GUI thread without using ''Dispatcher''s. This may change in the future. In WPF can create threads using: ThreadStart ts = delegate() { ... }; Thread(ts).Start(); passing an eventual parameter. Until c++0x gets known, you create threads here like this: ThreadStart ts(''your_method''); Thread(ts).Start(); where your_method is a function or a static method of a class which accepts none to 6 parameters. ''Start'' must be called with the correct number of parameters.

== Analogies to WPF == The Class Library follows the WPF structure. ''System::Linux::Window'' is child of ''System::Controls::ContentControl'' which is child of ''System::Controls::Control'' which is child of ''System::Linux::FrameworkElement'', ..., which is child of System::Object. You have the powerful System::String class. However Int16, Int32, Int64, UInt16, UInt32, UInt64, Double, Single, Decimal (I'm I missing something?) haven't been developed. You must use int, short int, char, long. There are however typedefs for ''byte'', ''ushort'', ''uint'', ''ulong''. Notice that ''ulong'' is always a 64-bit unsigned type, while ''long'''s size depends on your compiler.

== How does it work? == LPF is not based on Gtk, Qt, Wx or any other widgets library. There are only three low-level libraries used as dependency: '''Xlib''': a library used to communicate to the X Server. The X Server is responsible of managing the different Screens and Windows you might have. '''Cairo''': this powerful library is used during ''rendering''. Cairo is able to draw any kind of image you might imagine taking advantage of hardware acceleration. *'''Cairomm''': this is just a wrapper for C++ around Cairo.

A wrapper around those libraries is being developed to better integrate in the LPF code.

== Is it complete? == No. We are at 0.2% of the total work. This project is still in the Planning phase and there are tons of stubs all the way around. You can however draw some shapes (Rectangles, Circles, Ellipses) with a stroke of an arbitrary size, a Stroke and Fill. You can use the whole Colors and Brushes classes. You can use the SolidColorBrush, the '''LinearGradientBrush''' and the '''RadialGradientBrush'''. You can even use the Alpha Channel. The XAML parser is still far away. We need a consistend base first.

== Is it stable? == It is not even tested yet. Use it at your own risk. But please submit bugs.

== May I help you? I have been a WPF developers for some days... == Sure but keep in mind that this is not easy stuff. You should now at least some basics of Cairo and being an experienced C++ programmer. No Xlib experience is required.

Previous:neighborshare