Difference between revisions of "Mac OS X Porting - Cursors"
From Apache OpenOffice Wiki
Line 2: | Line 2: | ||
=== What do we need ? === | === What do we need ? === | ||
+ | |||
+ | ==== Simple cursor in Writer ==== | ||
+ | |||
+ | kThemeIBeamCursor | ||
+ | |||
+ | Code location (inside OpenOffice.org sources ) : vcl/source/windo</cursor.cxx + vcl/aqua/soruce/window/salframe.cxx | ||
+ | |||
+ | and windows existing implementation will help. | ||
+ | |||
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with constants like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor. | Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with constants like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor. | ||
+ | ==== Specific cursors ==== | ||
But we also need more specific cursors for example : help cursor, draw cursors… For these cursor the only function availables to to this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors. | But we also need more specific cursors for example : help cursor, draw cursors… For these cursor the only function availables to to this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors. | ||
[[Category:Porting]] | [[Category:Porting]] | ||
[[Category:Aqua]] | [[Category:Aqua]] |
Revision as of 12:45, 23 January 2007
Implementing custom cursors
What do we need ?
Simple cursor in Writer
kThemeIBeamCursor
Code location (inside OpenOffice.org sources ) : vcl/source/windo</cursor.cxx + vcl/aqua/soruce/window/salframe.cxx
and windows existing implementation will help.
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with constants like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.
Specific cursors
But we also need more specific cursors for example : help cursor, draw cursors… For these cursor the only function availables to to this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.