Ismael's blog

Aller au contenu | Aller au menu | Aller à la recherche

Tuesday 8 May 2007

Aqua: 3 patches concerning salframes committed

These days, I have continued my work on salframe. I implemented two sister functions: setMaxClientSize(long nWidth, long nHeight) and setMinClientSize(long nWidth, long nHeight) in vcl/aqua/source/window/salframe.cxx. Now, windows can't be resized less than their minimal size nor more than their maximal size (less used). This code is now committed.

I have also committed a patch concerning utility windows. This is part of my work on aqua dialogs and windows. I won't commit code for sheet windows or alert dialogs now, because it is not mature enough.


Before applying the patch (on the left); with the patch (on the right)



Nearly a month ago, i committed a patch for cursors (but i didn't blogged about it as i didn't take the time to do so). I implemented the main 18 out of 94 cursors used in OOo. This code uses the system cursors of MacOS X, for the cursors specific to OOo, we'll have to use Cocoa (for more informations concerning cursors implementation see the wiki page where Yvan Barthélémy and Eric Bachard wrote what they thought concerning cursors, but unfortunately, i found this page after having coded cursors. I will update it as soon as possible.) And to finish, as usual, screenshots!

Cursor for links, hand cursor to move objects and text cursor.

Wednesday 4 April 2007

Aqua: Patch concerning windows and dialogs

I have made a patch concerning my work on aqua windows and dialogs so that interested people can test it and give me feedbacks. This patch improves the use of dialogs in OOo mac, following the Aqua Human Interface Guidelines. I have also implemented functions like SetMinSize()/SetMaxSize() or Flush().

This patch concerns also the platform independent part of VCL. Indeed, when a new window is created, its flags have many details on it (a flag for a dialog window can have one of these values: WINDOW_DIALOG, WINDOW_TABDIALOG, WINDOW_MODALDIALOG, WINDOW_MODELESSDIALOG, WINDOW_MESSBOX, WINDOW_INFOBOX, WINDOW_WARNINGBOX, WINDOW_ERRORBOX, WINDOW_QUERYBOX) but when this part of VCL calls the native implementation, many details are lost especially when the window is a dialog (the flag for a dialog window is SAL_FRAME_STYLE_DIALOG although, in the platform independent part, it can have all the precedent values(WINDOW_MODELESSDIALOG, WINDOW_MESSBOX....)).

Therefore i added new flags: SAL_FRAME_STYLE_TAB_DIALOG, SAL_FRAME_STYLE_MODELESS_DIALOG, SAL_FRAME_STYLE_MODAL_DIALOG, SAL_FRAME_STYLE_MESSBOX, SAL_FRAME_STYLE_QUERYBOX, SAL_FRAME_STYLE_INFOBOX, SAL_FRAME_STYLE_WARNINGBOX, SAL_FRAME_STYLE_ERRORBOX. Thanks to these details, the correct dialog is created in the aqua part of VCL.

As it is work in progress, some bugs remain: menus of utility windows are behind the utility windows, for example.


Old screenshot of my work

Enjoy it!

The patch

Monday 26 March 2007

Aqua: utility windows

In my work to have aqua windows which respect better the AHIG (see my previous post), i encountered a very annoying bug: utility windows were in front of all windows, including windows of another activated application.


On this screenshot XCode is the activated window and OpenOffice is behind it but the OOo Style Window is in front of XCode.
(The transparency is just for fun and to see what is behind the utility window)


But now the bug is fixed, utility windows are only visible when their parent document window is activated. When another application is activated or another OpenOffice.org document window, utility windows disappear. They also disappear when Exposé (a MacOS X feature which shows all the windows opened in the same view) is launched (which is the correct behavior as Exposé only shows document windows and main windows but not dialogs).
I don't put a screenshot of the working solution because when another application is the top most window, the utility window disappears and so there's nothing to see. ;-)

Monday 5 March 2007

Aqua: native windows and dialogs following AHIG

Few days ago, as i was reading another time the Apple Human Interface Guidelines (AHIG), (the chapter concerning Windows and Dialogs), i thought it could be great for the OpenOffice.org aqua port to have dialogs and windows which respect better the AHIG.
Here's how windows looked before:

As we can see, the windows and dialogs don't look really mac/aqua. So i investigated and i discovered how windows and dialogs were implemented in VCL (Visual Class Library), and how worked the actual aqua implementation of them. In the native implementation, the function which creates windows and dialogs, receives a flag to know what type of window it will create. But this flags, which can take many values, has only one value to describe dialogs although the dialog can be a simple message box or a complex settings dialog (SAL_FRAME_STYLE_DIALOG).
I read also the platform independent ("general") code of VCL which then calls native function to draw native controls like windows, buttons, images.... And what i discovered was a good surprise. Indeed, when a dialog is created the different types of dialogs have different values ( WINDOW_MODALDIALOG, WINDOW_MODELESSDIALOG, WINDOW_MESSBOX, WINDOW_ERRORBOX ...) but after, when it has to create the window, all these different types of dialogs are created using the same flag: SAL_FRAME_STYLE_DIALOG, surely because windows and unix implementation don't care about all these different types but MacOS does. So i added flags for MacOS in this part; these flags shouldn't bother non-MacOS implementations as they are ORed (|) to the old flag. Thanks to these modifications, the dialog usage in aqua port of OOo follows better the AHIG, but there are still some problems.

I also noticed incomplete use of flags in the platform independent part: for example the error box (that we can see in the upper image), is defined as WINDOW_MESSBOX and not as WINDOW_ERRORBOX which would be better.

Here's a screenshot of my work (which has to continued):

Monday 19 February 2007

Aqua: patch to fix instant crash of calc committed

For my first commit, I committed the patch which fixes issue 73691 (aquavcl01-> calc does instant crashes in some situations). This issue was in the top ten of issues to be fixed before first alpha release of the aqua port.
The problem was that the width/height of some images were negative and make ooo crash. After some investigations, I found that the problem came from the "general" implementation of vcl, and so i did as it has been done in unix and windows implementation, i put some absolute values.

Another screenshot of calc by Eric Bachard: http://www.openoffice.org/nonav/issues/showattachment.cgi/43141/aqua_calc04.jpg

Wednesday 14 February 2007

Aqua: bug concerning drawing of alpha images fixed

I have now fixed the bug concerning the drawing of alpha images (using drawAlphaBitmap and createWithMask functions). Indeed, although i fixed the bug caused by images with an X or Y position different from 0, images in dialogs were upside down. This bug is now fixed.
Here are some screenshots:


Dialog with the bug


Dialog with the bugfix. The toolbar has correct images too.


Native contextual menus (thanks to Eric Bachard) with transparent images

But, now, with the patch, images in the top menu are upside down but this can be easily fixed.

And here are the patches:
Patch1
Patch2

Update: the patches have been committed to CWS aquavcl01

Sunday 4 February 2007

Nice comic strip about Vista

Here's a nice comic strip about the numerous versions of Vista, on geekculture.com.

Yes there are (too??) many versions and the link found by Shaun McDonald shows it (his blog).

Saturday 3 February 2007

Report about FLOSS for the European Commission

The report Merit (287 pages The PDF document) for the European Commission points out the force of FLOSS (Free/Libre/Open Source Software) in Europe. This report is based on numerous study concerning FLOSS (part in companies, contributors, benefits for administrations or companies ....). The software value is estimated to about 2 billion euros available to economic actors. It favors the creation of Small and Medium Companies, and so of jobs. It also enables companies to make some saving of money in R&D.

The report also points out that Europe is the continent which has the most commits, the most FOSS developers and leaders.

Graph showing the repartition of FOSS developers

The report also talks about OpenOffice.org. Indeed, it points out that Openoffice.org is used by 21.5% of European public bodies (page 29). On page 30-31,

Table 1 shows the shares of respondents using specific applications by country. It is clear that Mozilla/Firefox is among the most popular FLOSS applications, while a significant share of respondents especially in Latin America uses OpenOffice and the database applications MySQL or PostgreSQL.

usage of some FLOSS in administrations

On page 102:

The results of this time-use analysis has show that no statistically significant variation in productivity measured in number of document processed per day and average effort per document has been found over a period of 32 weeks between two randomised groups of users, one to whom OpenOffice was introduced, and one that kept using Microsoft Office. This is perhaps surprising, since users were not previously familiar with OpenOffice. Indeed, the group of users was also asked whether as a result of the experimentation they thought they could do with OpenOffice the same amount of work they could do with Microsoft Office. As shown in Figure 46, under 10% of respondents thought they could not, more than 20% thought they definitely could perform as well with OpenOffice, while almost 60% thought they could be as productive with OpenOffice (as confirmed by the time-use analysis) though with some problems. Given their previous lack of experience with OpenOffice the fact that problems were subjectively perceived is unsurprising, but the fact that objectively the productivity of users remained the same and did not reduce is important.

Productivity with OOo compared to MSOffice felt by users

On page 244, there's also accounts of migrations from MSOffice to OpenOffice. Here's a quote from the conclusion of this case study:

There is also no evidence that using OOo may cause additional costs to the organizations as the pattern of use of OOo is similar to the one of MSO, in term of daily documents worked and average time spent on them.

The report concludes about OpenOffice (page 283):

OpenOffice.org has all the functionalities that public offices need to create documents, spreadsheets, and presentations

[...]

OpenOffice.org is free, extremely stable, and supports the ISO Open Document Standard.

[...]

In our study the motivations to transit to OSS are: the exchange of documents in an open shared format (ODS), reuse of old hardware in some cases, and being independent of software vendors even when creating a distribution or an application for local needs.

[...]

It is not always justified to base the migration on the promise of lower license costs, although in our study initial purchasing costs are lower for the OSS

[...]

There are no extra costs due to lack of productivity arising from the use of the OOo.



This report is a great document and can be interesting for companies or administrations which plan to migrate to FLOSS (and so to OpenOffice), as it is based on real examples of migrations.

French links about this report:

Thursday 25 January 2007

Report about OOo's adoption

The FOSS Observatory (Observatoire du logiciel libre (french link)) has published a report (the PDF document) concerning the progress of the adoption of some FOSS. Their study is based on the demand of training instead of the number of licenses sold, which is more interesting for this type of software and which allows to measure the interest of companies and administrations for them. This report points out that Openoffice.org use has increased of 30% in one year (2005 to 2006), like linux. The best progression is for MySQL (+50%). For the others: PHP +20% and Java +5%.

The document says:

L’open source, une banalité pour les entreprises. Cette progression du nombre de formations open source est liée au recours de plus en plus systématique des entreprises aux logiciels libres, et à l’arrivée à maturité des éditeurs open source. Dans l’ensemble, les entreprises sont motivées par la plus grande indépendance vis à vis des éditeurs qu’apportent les logiciels libres et l’aspect économique (coût d’acquisition plus faible). Depuis quelques années elles se sont formées et disposent désormais d’un personnel qualifié sur certains outils open source.

Free translation:

Open source, a banality for companies. This progress of the number of training for open source software is due to the more and more systematic use of FOSS in companies, but also to the arrival of mature FOSS. On the whole, companies are motivated by the greater independence towards software editors, which is what FOSS provide. But also for economical reasons (buying costs are lower for FOSS). For few years, they have trained themselves and have now a skilled staff on some FOSS.

The major interest of FOSS is the independence towards editors by open formats and standards compliance. And what is great, is that companies and some (1) administrations start to understand this important thing. For office, as ODF is now an ISO standard, which moreover is open, companies and administrations have to think before using MS Office and OpenXML, its proprietary format. Here, FOSS have a great advantage, and i hope people will understand the importance of standards and switch to FOSS or at least standard compliant softwares.

1: The french department of education considers OpenOffice as a way to have cheaper licenses of MS Office (<40 euros). Here's a link in French which contains the letter of the ministry and an analyse Framablog

Saturday 20 January 2007

Bug with images in aqua contextual menus fixed

Eric Bachard (his blog) found a bug in aqua contextual menus, few weeks ago: images weren't transparent.
I firstly thought it came from native contextual menus implementation as it couldn't come from the CreateWithMask function because menu images were correctly drawn. After some investigations, i found that the AquaSalGraphics::drawAlphaBitmap function (located in salgdi.cxx) was the function used to draw bitmaps for contextual menus but also for toolbars and some images, and this function wasn't implemented. This explains why images weren't transparent. So i decided to implement it. I read the unix implementation of this function to have a starting base.
Once implemented, this function seemed to work. But for some images, i encountered a bug. It concerns images which have an X or Y position in the context which differs from 0. After hard work, i found that the bug came a bit from the current function and mainly from the AquaSalBitmap::CreateWithMask function which is called in drawAlphaBitmap. These two functions didn't work with an X or Y different from 0. I fixed it and here's the result:



Images in toolbar and in contextual menus have now a transparent background

And here are the patches: http://lebasket.free.fr/OOo/20_01_07/