Difference between revisions of "Mac OS X Porting - Cursors"
From Apache OpenOffice Wiki
Line 5: | Line 5: | ||
==== Simple cursor in Writer ==== | ==== Simple cursor in Writer ==== | ||
+ | kThemeArrowCursor | ||
kThemeIBeamCursor | kThemeIBeamCursor | ||
− | Code location (inside OpenOffice.org sources ) : vcl/source/window/cursor.cxx + vcl/aqua/source/window/salframe.cxx | + | Code location (inside OpenOffice.org sources) : [http://go-oo.org/lxr/source/gsl/vcl/source/window/cursor.cxx vcl/source/window/cursor.cxx] + [http://go-oo.org/lxr/source/gsl/vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx] |
− | and | + | 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 [http://developer.apple.com/documentation/macos8/HumanInterfaceToolbox/AppManager/ProgWithAppearanceMgr/Appearance.9d.html constants] like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor. |
==== Specific cursors ==== | ==== Specific cursors ==== | ||
− | But we also need more specific cursors for example : help cursor, draw cursors… For these | + | But we also need more specific cursors for example : help cursor, draw cursors… For these cursors the only function availables to do 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. |
'''To be continued''' | '''To be continued''' |
Revision as of 20:58, 20 May 2007
Implementing custom cursors
What do we need ?
Simple cursor in Writer
kThemeArrowCursor kThemeIBeamCursor
Code location (inside OpenOffice.org sources) : vcl/source/window/cursor.cxx + vcl/aqua/source/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 cursors the only function availables to do 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.
To be continued