August 2006 Archives
Wed Aug 30 20:33:16 CEST 2006
Native filepicker for Mac OS X
I had yet another hacking session on Mac OS X with Aqua. The result is half-working filepicker for
aquavcl01. Is is not yet ready for inclusion because it crashes a lot and I'm faking files selected
and folder picker is not yet implemented, but it was enough to get some screenshots from it. My primary reason was
to learn OOo's side of filepicker, but it was so easy that I decided to prototype the complete
filepicker and get it to display something.
But let's start from beginning.
OpenOffice.org's filepicker side
I browsed through
XFilePicker implements file service - both Open and Save dialogs, can have extended options like read-only box, preview etc. This is of course not yet implemented ;-) XFolderPicker is used to enter the directory - like in Tools - Options - OpenOffice.org - Paths, e.g. for My Documents.
Native dialogs have to be enabled in Tools - Options - OpenOffice.org - General. To be able to do so, I had to change option dialog in
Other two patches I created add generic fpicker component/uno.dylib module to the build system - scp2 and fpicker changes.
The rest of the code (and hacks) is located in
This is the OpenOffice.org side.
Carbon filepicker side
(Please keep in mind, that I'm unexperienced Mac OS X hacker, everything I wrote here was unknown to me yesterday, so it can be inaccurate or incomplete).
Open and Save dialogs and other file and directory dialogs are implemented in Navigation Services API. There are three good papers about Navigation Services: Overview, Programming Guide and complete reference. If you would like to learn Navigation Services, read them in this order.
So this is OpenOffice.org and also Carbon side of filepicker so I only connected them. But there are still problems. I hope I'll have some time before OOoCon 2006 in Lyon to finish the work to at least some extent. But we are now also in 2.0.4 release phase, so it will be a lot of fun again ;-)
But let's start from beginning.
OpenOffice.org's filepicker side
I browsed through
fpicker
directory and used gnome
as an example. For
native file and folder picker, you have to implement several interfaces:
XFilePicker
and
XFolderPicker.
You'll also need other stuff from ::com::sun::star::ui::dialogs. OpenOffice.org's
API documentation is brilliant. Really, it helped me a lot.
XFilePicker implements file service - both Open and Save dialogs, can have extended options like read-only box, preview etc. This is of course not yet implemented ;-) XFolderPicker is used to enter the directory - like in Tools - Options - OpenOffice.org - Paths, e.g. for My Documents.
Native dialogs have to be enabled in Tools - Options - OpenOffice.org - General. To be able to do so, I had to change option dialog in
svx
a bit
- define Mac OS X/Aqua as one of the platforms where this option can be shown.
Other two patches I created add generic fpicker component/uno.dylib module to the build system - scp2 and fpicker changes.
The rest of the code (and hacks) is located in
fpicker/aqua
directory.
This is the OpenOffice.org side.
Carbon filepicker side
(Please keep in mind, that I'm unexperienced Mac OS X hacker, everything I wrote here was unknown to me yesterday, so it can be inaccurate or incomplete).
Open and Save dialogs and other file and directory dialogs are implemented in Navigation Services API. There are three good papers about Navigation Services: Overview, Programming Guide and complete reference. If you would like to learn Navigation Services, read them in this order.
So this is OpenOffice.org and also Carbon side of filepicker so I only connected them. But there are still problems. I hope I'll have some time before OOoCon 2006 in Lyon to finish the work to at least some extent. But we are now also in 2.0.4 release phase, so it will be a lot of fun again ;-)
Sun Aug 27 11:48:43 CEST 2006
Building OOD680_m2
OOD680_m2 was released on Friday and I started my builds on Saturday.
Current status:
Current status:
- GNU/Linux on x86: builds finished, uploaded
- GNU/Linux on x86_64: builds finished, uploaded
- Solaris/SPARC: build finished
- Windows: build failed in module
crashrep
- P1 issue #i68985#, will be fixed in m3 - Mac OS X: building module
sw
Sat Aug 26 18:42:00 CEST 2006
Identifying memory leaks of OpenOffice.org on Mac OS X
I spent some time today on learning the tool
leaks
on Mac OS X. Its output gives
similar information like valgrind's --leak-check
argument. Very simple description is
available in - mac@porting mailing list archive.
Thu Aug 24 22:42:54 CEST 2006
Day off in Pilsen - the city of beer!
... this blog entry will be boring, as I do not drink beer ;-) Pilsen is the city of beer. You know
that. It is approx. 45 minutes away from the place I live, so we decided to visit it today.
The first stop was at the parking place. After 10 minutes trying to find the parking place, we found one with non-working parking machine (we took a photo of it, just in case... ;-). Good. Then we went to the Museum of West Bohemia to visit exhibition of old, good bedtime stories (we call it Večerníček). The hero of my son was small mole (Krteček). It was great pleasure to watch my son be soo happy! And I was happy too, this all was my youth (so do not ask me my why I shoot so much photos there...).
We had lunch in the hotel restaurant on the central place near the Catedral of Saint Bartoloměj (very good beefsteaks - I had one on green pepper and my wife had one filled with cheese and apple sauce, strange combination ;-).
The afternoon was dedicated to ZOO. The ZOO is located ~20 minutes from the city center and there is a "ZOO train" directly from the central place - very good service, especially for small children who like trains like my son.
I was prepared for classic ZOO, but Pilsen's ZOO is very modern. And of course they have penguins ;-) I especially like their DinoPark. I was not prepared to see something like this in ZOO. If you have a trip to Pilsen, do not forget to visit DinoPark.
Wonderful day with my wife and son (some photos).
The first stop was at the parking place. After 10 minutes trying to find the parking place, we found one with non-working parking machine (we took a photo of it, just in case... ;-). Good. Then we went to the Museum of West Bohemia to visit exhibition of old, good bedtime stories (we call it Večerníček). The hero of my son was small mole (Krteček). It was great pleasure to watch my son be soo happy! And I was happy too, this all was my youth (so do not ask me my why I shoot so much photos there...).
We had lunch in the hotel restaurant on the central place near the Catedral of Saint Bartoloměj (very good beefsteaks - I had one on green pepper and my wife had one filled with cheese and apple sauce, strange combination ;-).
The afternoon was dedicated to ZOO. The ZOO is located ~20 minutes from the city center and there is a "ZOO train" directly from the central place - very good service, especially for small children who like trains like my son.
I was prepared for classic ZOO, but Pilsen's ZOO is very modern. And of course they have penguins ;-) I especially like their DinoPark. I was not prepared to see something like this in ZOO. If you have a trip to Pilsen, do not forget to visit DinoPark.
Wonderful day with my wife and son (some photos).
Thu Aug 24 00:30:35 CEST 2006
Menus and menu items now have correct encoding
I debugged menu items text encoding problem I mentioned yesterday. Menus and menu items
should now be properly encoded. I have seen the string "Ukončit" which means "Exit" in my language
and also "Žádné dokumenty" ("No documents" in Recent documents menu) and "Bez názvu" ("Untitled").
Wed Aug 23 10:00:50 CEST 2006
Native menus work
Yesterday evening, Oliver Braun found the reason why native menus are not correctly populated at
runtime and we had to use accessibility workaround to get them populated. Menu activation events
were not correct. I misread the docs and passed pointer to SalMenu class instead of VCL Menu
class ;-)
This morning, I implemented it and menus now work - well, at least I can correctly exit the application, I see windows in Window menu, etc. Maybe even Recent documents submenu works properly (can you confirm?).
I still have to debug crashes when some (not all) submenus get activated, and work on proper UTF-8 support. I already added my language to the Mac native part of my build system, so we will see how Czech menus look like soon, hopefully ;-)
This morning, I implemented it and menus now work - well, at least I can correctly exit the application, I see windows in Window menu, etc. Maybe even Recent documents submenu works properly (can you confirm?).
I still have to debug crashes when some (not all) submenus get activated, and work on proper UTF-8 support. I already added my language to the Mac native part of my build system, so we will see how Czech menus look like soon, hopefully ;-)
Sun Aug 20 17:09:04 CEST 2006
SRC680_m182 build issue in readlicense_oo
#i68790# - m182: breaks in
readlicense_oo/docs/readme
Fri Aug 11 00:16:44 CEST 2006
OpenOffice.org getting rid of X11 on Macs!
... slowly but the right
way. Enjoy! ;-)
Thu Aug 10 11:58:49 CEST 2006
Good summary of Apple Intel based notebooks' issues
ArsTechnica has very informative article about issues with MacBook Pro and MacBook. They
even go a bit further analyzing if Apple lowers the quality of QA.
I think that these problems are connected with the big boom and quantity instead of lowered QA and hope that Apple will address them properly (and not with one line article on their site ;-).
... I'm still waiting for Core 2 Duo and proper service level in our country...
I think that these problems are connected with the big boom and quantity instead of lowered QA and hope that Apple will address them properly (and not with one line article on their site ;-).
... I'm still waiting for Core 2 Duo and proper service level in our country...
Thu Aug 10 09:43:15 CEST 2006
63 issues for 2.0.4
We still have 63 issues, so still a lot of work. Please help to reduce the number of issues
for 2.0.4 - clean your issues with 2.0.4 target today!
Wed Aug 9 22:52:02 CEST 2006
Cleaning my build system...
I'll take one week off starting on Saturday and when I'm back, I'll clean my build system. I do
build for many languages, but the cooperation from some language teams is not up to the quality
I expect (regularly updated GSI file). E.g. some GSI files still contains unused macro OOO_LICENSE
etc. Some sites/URLs are not up-to-date, time outs, or even do not exist at all.
Please check your URL in my script and browse through the log file.
If you have questions, please mail me.
Please check your URL in my script and browse through the log file.
If you have questions, please mail me.
Tue Aug 8 08:29:17 CEST 2006
WWDC 2006 started
... with keynote from
Steve Jobs and other Apple managers. I was a bit disappointed by announcements in his
presentation. I expected the announcement of Core 2 Duo upgraded MacBook Pro line :-(
The online Apple store was closed during the presentation, and it was a bit slow after it was opened again ;-) Mac Pro was announced (fastest Mac ever ;-). It can be configured - e.g. 16GB of memory will cost you the same as two fully equipped MacBook Pros ;-)
Leopard will support 64bit applications (together with 32bit apps) and virtual desktops (finally!), Time Machine (versioning filesystem?), Boot Camp and TODO items in Mail. Will be available early next year.
To sum up: I only appreciate virtual desktops, because I already use them for about 10 years already...
Kernel sources for Mac OS X also for Intel machines...
Much more interesting news is that VMWare announced development of OS X version of their products. And as Microsoft announced they won't port Virtual PC to Mac OS X, they probably expect VMWare to use the same politics about Player as on other systems. What about Parallels? ;-) It will be interesting to watch the battle...
The online Apple store was closed during the presentation, and it was a bit slow after it was opened again ;-) Mac Pro was announced (fastest Mac ever ;-). It can be configured - e.g. 16GB of memory will cost you the same as two fully equipped MacBook Pros ;-)
Leopard will support 64bit applications (together with 32bit apps) and virtual desktops (finally!), Time Machine (versioning filesystem?), Boot Camp and TODO items in Mail. Will be available early next year.
To sum up: I only appreciate virtual desktops, because I already use them for about 10 years already...
Kernel sources for Mac OS X also for Intel machines...
Much more interesting news is that VMWare announced development of OS X version of their products. And as Microsoft announced they won't port Virtual PC to Mac OS X, they probably expect VMWare to use the same politics about Player as on other systems. What about Parallels? ;-) It will be interesting to watch the battle...
Mon Aug 7 17:46:47 CEST 2006
Houston, I have seen button!
To paraphrase Christian's "Houston, I have seen bitmap" from
yesterday, I can now say "Houston, I have seen button"!
And I have to repeat it again: I really "like" C++. It took me two hours to find the reason why
I almost forgot: I'd like to thank Kendy. His knowledge, compressed into 10 minutes of IRC talk, made this possible.
And I have to repeat it again: I really "like" C++. It took me two hours to find the reason why
drawNativeControl
was not called at all in child workspace aquavcl01... The reason was
missing const
in virtual function prototype. I found it comparing mangled names of
methods from binaries :-(
I almost forgot: I'd like to thank Kendy. His knowledge, compressed into 10 minutes of IRC talk, made this possible.
Wed Aug 2 23:14:53 CEST 2006
Carbon keyboard events
One items on Mac porting list of things to do is keyboard support. For this, we need to understand
which keyboard events you can receive in Carbon. All keyboard events are of
class
Four events are interesting for us:
Keyboard modifiers bits are: cmdKeyBit (8), shiftKeyBit (9), alphaLockBit (10), optionKeyBit (11), controlKeyBit (12), rightShiftKeyBit (13), rightOptionKeyBit (14), rightControlKeyBit (15), kEventKeyModifierNumLockBit (16), kEventKeyModifierFnBit (17). My keyboard is not able to distinguish left and right keys though ("left" bit is set instead).
Sample patch for keyboard events handling is here. Cursor keys up, down work (even with repeat now). Page Up and Page Down work as well. In the font dialog, try to enter some font names or variants or even sizes. All should work now (at least it works here ;-). There are minor issues (matching the current state) - when you select the complete contents of input box, it is not highlighted etc.
kEventClassKeyboard
(see Carbon
Event Manager Reference), section Keyboard events.
Four events are interesting for us:
kEventRawKeyDown
- some key was pressed downkEventRawKeyUp
- some key was releasedkEventRawKeyRepeat
- some key was pressed in the past and still held down, so Repeat event is sent instead of Down eventkEventRawKeyModifiersChanged
- the status of some (or even more) keyboard modifiers changed
kEventParamKeyModifiers
(typeUInt32
) - contains information about status of several modifier keys (see below). This parameter is present with every event mentioned abovekEventParamKeyCode
(typeUInt32
) - see my previous blog about keycodes ;-) Almost every key on the keyboard has its own keycode. We will probably not use it for all keys, only for some (see below for reasons.)kEventParamKeyMacCharCodes
(typeChar
) - contains the character that this key generates.
kEventParamKeyCode
and kEventParamKeyMacCharCodes
are only
present for Up, Down and Repeat events (not for ModifiersChanged event). Notice that Repeat event
doesn't have "repeat count"!
Keyboard modifiers bits are: cmdKeyBit (8), shiftKeyBit (9), alphaLockBit (10), optionKeyBit (11), controlKeyBit (12), rightShiftKeyBit (13), rightOptionKeyBit (14), rightControlKeyBit (15), kEventKeyModifierNumLockBit (16), kEventKeyModifierFnBit (17). My keyboard is not able to distinguish left and right keys though ("left" bit is set instead).
Sample patch for keyboard events handling is here. Cursor keys up, down work (even with repeat now). Page Up and Page Down work as well. In the font dialog, try to enter some font names or variants or even sizes. All should work now (at least it works here ;-). There are minor issues (matching the current state) - when you select the complete contents of input box, it is not highlighted etc.