diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-02-05 20:27:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-07 22:02:12 +0200 |
commit | b3d077a9201d10f2243a7e187af93feb9bfd26ff (patch) | |
tree | 799424c2c64337c40325b326e0ebe16c65763e26 | |
parent | 79ca031fb2e8802aa4383362f83306fad6895729 (diff) |
hidpi cursors for macOS
Change-Id: I39bdc93048733627a54c4f7b4b2e7df4f073ef25
Reviewed-on: https://gerrit.libreoffice.org/67424
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
84 files changed, 324 insertions, 317 deletions
diff --git a/vcl/osx/res/cursors/neswsize.png b/icon-themes/colibre/vcl/res/nesize.png Binary files differindex 91b89b5803ec..91b89b5803ec 100644 --- a/vcl/osx/res/cursors/neswsize.png +++ b/icon-themes/colibre/vcl/res/nesize.png diff --git a/vcl/osx/res/cursors/nwsesize.png b/icon-themes/colibre/vcl/res/nwsize.png Binary files differindex fc6a33288ef2..fc6a33288ef2 100644 --- a/vcl/osx/res/cursors/nwsesize.png +++ b/icon-themes/colibre/vcl/res/nwsize.png diff --git a/icon-themes/colibre/vcl/res/sesize.png b/icon-themes/colibre/vcl/res/sesize.png Binary files differnew file mode 100644 index 000000000000..fc6a33288ef2 --- /dev/null +++ b/icon-themes/colibre/vcl/res/sesize.png diff --git a/icon-themes/colibre/vcl/res/swsize.png b/icon-themes/colibre/vcl/res/swsize.png Binary files differnew file mode 100644 index 000000000000..91b89b5803ec --- /dev/null +++ b/icon-themes/colibre/vcl/res/swsize.png diff --git a/icon-themes/colibre/vcl/res/hourglass.png b/icon-themes/colibre/vcl/res/wait.png Binary files differindex 822368d7c950..822368d7c950 100644 --- a/icon-themes/colibre/vcl/res/hourglass.png +++ b/icon-themes/colibre/vcl/res/wait.png diff --git a/icon-themes/colibre/vcl/res/window_nesize.png b/icon-themes/colibre/vcl/res/window_nesize.png Binary files differnew file mode 100644 index 000000000000..91b89b5803ec --- /dev/null +++ b/icon-themes/colibre/vcl/res/window_nesize.png diff --git a/icon-themes/colibre/vcl/res/window_nwsize.png b/icon-themes/colibre/vcl/res/window_nwsize.png Binary files differnew file mode 100644 index 000000000000..fc6a33288ef2 --- /dev/null +++ b/icon-themes/colibre/vcl/res/window_nwsize.png diff --git a/icon-themes/colibre/vcl/res/window_sesize.png b/icon-themes/colibre/vcl/res/window_sesize.png Binary files differnew file mode 100644 index 000000000000..fc6a33288ef2 --- /dev/null +++ b/icon-themes/colibre/vcl/res/window_sesize.png diff --git a/icon-themes/colibre/vcl/res/window_swsize.png b/icon-themes/colibre/vcl/res/window_swsize.png Binary files differnew file mode 100644 index 000000000000..91b89b5803ec --- /dev/null +++ b/icon-themes/colibre/vcl/res/window_swsize.png diff --git a/icon-themes/colibre_svg/vcl/res/hourglass.svg b/icon-themes/colibre_svg/vcl/res/wait.svg index c5747c9d7fa0..c5747c9d7fa0 100644 --- a/icon-themes/colibre_svg/vcl/res/hourglass.svg +++ b/icon-themes/colibre_svg/vcl/res/wait.svg diff --git a/icon-themes/karasa_jaga/vcl/res/hourglass.png b/icon-themes/karasa_jaga/vcl/res/wait.svg Binary files differindex b8906abe5e85..b8906abe5e85 100644 --- a/icon-themes/karasa_jaga/vcl/res/hourglass.png +++ b/icon-themes/karasa_jaga/vcl/res/wait.svg diff --git a/icon-themes/karasa_jaga_svg/vcl/res/hourglass.svg b/icon-themes/karasa_jaga_svg/vcl/res/wait.svg index 546373d0e742..546373d0e742 100644 --- a/icon-themes/karasa_jaga_svg/vcl/res/hourglass.svg +++ b/icon-themes/karasa_jaga_svg/vcl/res/wait.svg diff --git a/vcl/Package_osxres.mk b/vcl/Package_osxres.mk index 10451fec779e..dfbc35a9703c 100644 --- a/vcl/Package_osxres.mk +++ b/vcl/Package_osxres.mk @@ -13,72 +13,6 @@ $(eval $(call gb_Package_add_files_with_dir,vcl_osxres,Resources,\ MainMenu.nib/classes.nib \ MainMenu.nib/info.nib \ MainMenu.nib/keyedobjects.nib \ - cursors/ase.png \ - cursors/asn.png \ - cursors/asne.png \ - cursors/asns.png \ - cursors/asnswe.png \ - cursors/asnw.png \ - cursors/ass.png \ - cursors/asse.png \ - cursors/assw.png \ - cursors/asw.png \ - cursors/aswe.png \ - cursors/chain.png \ - cursors/chainnot.png \ - cursors/chart.png \ - cursors/copydata.png \ - cursors/copydlnk.png \ - cursors/copyf.png \ - cursors/copyf2.png \ - cursors/copyflnk.png \ - cursors/crook.png \ - cursors/crop.png \ - cursors/darc.png \ - cursors/dbezier.png \ - cursors/dcapt.png \ - cursors/dcirccut.png \ - cursors/dconnect.png \ - cursors/dellipse.png \ - cursors/detectiv.png \ - cursors/dfree.png \ - cursors/dline.png \ - cursors/dpie.png \ - cursors/dpolygon.png \ - cursors/drect.png \ - cursors/dtext.png \ - cursors/fill.png \ - cursors/help.png \ - cursors/hourglass.png \ - cursors/hshear.png \ - cursors/linkdata.png \ - cursors/linkf.png \ - cursors/magnify.png \ - cursors/mirror.png \ - cursors/movebw.png \ - cursors/movedata.png \ - cursors/movedlnk.png \ - cursors/movef.png \ - cursors/movef2.png \ - cursors/moveflnk.png \ - cursors/movept.png \ - cursors/neswsize.png \ - cursors/notallow.png \ - cursors/nullptr.png \ - cursors/nwsesize.png \ - cursors/pen.png \ - cursors/pivotcol.png \ - cursors/pivotdel.png \ - cursors/pivotfld.png \ - cursors/pivotrow.png \ - cursors/rotate.png \ - cursors/tblsele.png \ - cursors/tblsels.png \ - cursors/tblselse.png \ - cursors/tblselsw.png \ - cursors/tblselw.png \ - cursors/vshear.png \ - cursors/vtext.png \ )) # vim:set noet sw=4 ts=4: diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst index 667bf76b3ade..b5242aa79794 100644 --- a/vcl/inc/bitmaps.hlst +++ b/vcl/inc/bitmaps.hlst @@ -183,7 +183,6 @@ #define RID_CURSOR_DRAW_TEXT "vcl/res/draw_text.png" #define RID_CURSOR_FILL "vcl/res/fill.png" #define RID_CURSOR_HELP "vcl/res/help.png" -#define RID_CURSOR_HOURGLASS "vcl/res/hourglass.png" #define RID_CURSOR_H_SHEAR "vcl/res/h_shear.png" #define RID_CURSOR_LINK_DATA "vcl/res/link_data.png" #define RID_CURSOR_LINK_FILE "vcl/res/link_file.png" @@ -215,6 +214,15 @@ #define RID_CURSOR_TEXT_VERTICAL "vcl/res/text_vertical.png" #define RID_CURSOR_HIDE_WHITESPACE "vcl/res/hide_whitespace.png" #define RID_CURSOR_SHOW_WHITESPACE "vcl/res/show_whitespace.png" +#define RID_CURSOR_WAIT "vcl/res/wait.png" +#define RID_CURSOR_NWSIZE "vcl/res/nwsize.png" +#define RID_CURSOR_NESIZE "vcl/res/nesize.png" +#define RID_CURSOR_SWSIZE "vcl/res/swsize.png" +#define RID_CURSOR_SESIZE "vcl/res/sesize.png" +#define RID_CURSOR_WINDOW_NWSIZE "vcl/res/window_nwsize.png" +#define RID_CURSOR_WINDOW_NESIZE "vcl/res/window_nesize.png" +#define RID_CURSOR_WINDOW_SWSIZE "vcl/res/window_swsize.png" +#define RID_CURSOR_WINDOW_SESIZE "vcl/res/window_sesize.png" #define CHEVRON "sfx2/res/chevron.png" diff --git a/vcl/inc/cursor_hotspots.hxx b/vcl/inc/cursor_hotspots.hxx new file mode 100644 index 000000000000..74a041ddd9ca --- /dev/null +++ b/vcl/inc/cursor_hotspots.hxx @@ -0,0 +1,169 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_VCL_INC_CURSOR_HOTSPOTS_HXX +#define INCLUDED_VCL_INC_CURSOR_HOTSPOTS_HXX + +#define help_curs_x_hot 0 +#define help_curs_y_hot 0 +#define pen_curs_x_hot 3 +#define pen_curs_y_hot 27 +#define nodrop_curs_x_hot 9 +#define nodrop_curs_y_hot 9 +#define magnify_curs_x_hot 12 +#define magnify_curs_y_hot 13 +#define rotate_curs_x_hot 15 +#define rotate_curs_y_hot 15 +#define hshear_curs_x_hot 15 +#define hshear_curs_y_hot 15 +#define vshear_curs_x_hot 15 +#define vshear_curs_y_hot 15 +#define drawline_curs_x_hot 7 +#define drawline_curs_y_hot 7 +#define drawrect_curs_x_hot 7 +#define drawrect_curs_y_hot 7 +#define drawpolygon_curs_x_hot 7 +#define drawpolygon_curs_y_hot 7 +#define drawbezier_curs_x_hot 7 +#define drawbezier_curs_y_hot 7 +#define drawarc_curs_x_hot 7 +#define drawarc_curs_y_hot 7 +#define drawpie_curs_x_hot 7 +#define drawpie_curs_y_hot 7 +#define drawcirclecut_curs_x_hot 7 +#define drawcirclecut_curs_y_hot 7 +#define drawellipse_curs_x_hot 7 +#define drawellipse_curs_y_hot 7 +#define drawconnect_curs_x_hot 7 +#define drawconnect_curs_y_hot 7 +#define drawtext_curs_x_hot 8 +#define drawtext_curs_y_hot 8 +#define mirror_curs_x_hot 14 +#define mirror_curs_y_hot 12 +#define crook_curs_x_hot 15 +#define crook_curs_y_hot 14 +#define crop_curs_x_hot 9 +#define crop_curs_y_hot 9 +#define movepoint_curs_x_hot 0 +#define movepoint_curs_y_hot 0 +#define movebezierweight_curs_x_hot 0 +#define movebezierweight_curs_y_hot 0 +#define drawfreehand_curs_x_hot 8 +#define drawfreehand_curs_y_hot 8 +#define drawcaption_curs_x_hot 8 +#define drawcaption_curs_y_hot 8 +#define movedata_curs_x_hot 1 +#define movedata_curs_y_hot 1 +#define copydata_curs_x_hot 1 +#define copydata_curs_y_hot 1 +#define linkdata_curs_x_hot 1 +#define linkdata_curs_y_hot 1 +#define movedlnk_curs_x_hot 1 +#define movedlnk_curs_y_hot 1 +#define copydlnk_curs_x_hot 1 +#define copydlnk_curs_y_hot 1 +#define movefile_curs_x_hot 9 +#define movefile_curs_y_hot 9 +#define copyfile_curs_x_hot 9 +#define copyfile_curs_y_hot 9 +#define linkfile_curs_x_hot 9 +#define linkfile_curs_y_hot 9 +#define moveflnk_curs_x_hot 9 +#define moveflnk_curs_y_hot 9 +#define copyflnk_curs_x_hot 9 +#define copyflnk_curs_y_hot 9 +#define movefiles_curs_x_hot 8 +#define movefiles_curs_y_hot 9 +#define copyfiles_curs_x_hot 8 +#define copyfiles_curs_y_hot 9 + +#define chart_curs_x_hot 15 +#define chart_curs_y_hot 16 +#define detective_curs_x_hot 12 +#define detective_curs_y_hot 13 +#define pivotcol_curs_x_hot 7 +#define pivotcol_curs_y_hot 5 +#define pivotfld_curs_x_hot 8 +#define pivotfld_curs_y_hot 7 +#define pivotrow_curs_x_hot 8 +#define pivotrow_curs_y_hot 7 +#define pivotdel_curs_x_hot 9 +#define pivotdel_curs_y_hot 8 + +#define chain_curs_x_hot 0 +#define chain_curs_y_hot 2 +#define chainnot_curs_x_hot 2 +#define chainnot_curs_y_hot 2 + +#define ase_curs_x_hot 19 +#define ase_curs_y_hot 16 +#define asn_curs_x_hot 16 +#define asn_curs_y_hot 12 +#define asne_curs_x_hot 21 +#define asne_curs_y_hot 10 +#define asns_curs_x_hot 15 +#define asns_curs_y_hot 15 +#define asnswe_curs_x_hot 15 +#define asnswe_curs_y_hot 15 +#define asnw_curs_x_hot 10 +#define asnw_curs_y_hot 10 +#define ass_curs_x_hot 15 +#define ass_curs_y_hot 19 +#define asse_curs_x_hot 21 +#define asse_curs_y_hot 21 +#define assw_curs_x_hot 10 +#define assw_curs_y_hot 21 +#define asw_curs_x_hot 12 +#define asw_curs_y_hot 15 +#define aswe_curs_x_hot 15 +#define aswe_curs_y_hot 15 +#define nullcurs_x_hot 2 +#define nullcurs_y_hot 2 + +#define fill_curs_x_hot 10 +#define fill_curs_y_hot 22 +#define vertcurs_curs_x_hot 8 +#define vertcurs_curs_y_hot 8 +#define tblsele_curs_x_hot 14 +#define tblsele_curs_y_hot 8 +#define tblsels_curs_x_hot 7 +#define tblsels_curs_y_hot 14 +#define tblselse_curs_x_hot 14 +#define tblselse_curs_y_hot 14 +#define tblselw_curs_x_hot 1 +#define tblselw_curs_y_hot 8 +#define tblselsw_curs_x_hot 1 +#define tblselsw_curs_y_hot 14 +#define hidewhitespace_curs_x_hot 0 +#define hidewhitespace_curs_y_hot 10 +#define showwhitespace_curs_x_hot 0 +#define showwhitespace_curs_y_hot 10 + +#define wait_curs_x_hot 10 +#define wait_curs_y_hot 10 +#define nwsize_curs_x_hot 10 +#define nwsize_curs_y_hot 10 +#define nesize_curs_x_hot 10 +#define nesize_curs_y_hot 10 +#define swsize_curs_x_hot 10 +#define swsize_curs_y_hot 10 +#define sesize_curs_x_hot 10 +#define sesize_curs_y_hot 10 +#define window_nwsize_curs_x_hot 10 +#define window_nwsize_curs_y_hot 10 +#define window_nesize_curs_x_hot 10 +#define window_nesize_curs_y_hot 10 +#define window_swsize_curs_x_hot 10 +#define window_swsize_curs_y_hot 10 +#define window_sesize_curs_x_hot 10 +#define window_sesize_curs_y_hot 10 + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/osx/res/cursors/ase.png b/vcl/osx/res/cursors/ase.png Binary files differdeleted file mode 100644 index a3a30e0bcdce..000000000000 --- a/vcl/osx/res/cursors/ase.png +++ /dev/null diff --git a/vcl/osx/res/cursors/asn.png b/vcl/osx/res/cursors/asn.png Binary files differdeleted file mode 100644 index 7a140b1ec926..000000000000 --- a/vcl/osx/res/cursors/asn.png +++ /dev/null diff --git a/vcl/osx/res/cursors/asne.png b/vcl/osx/res/cursors/asne.png Binary files differdeleted file mode 100644 index 311506aeb349..000000000000 --- a/vcl/osx/res/cursors/asne.png +++ /dev/null diff --git a/vcl/osx/res/cursors/asns.png b/vcl/osx/res/cursors/asns.png Binary files differdeleted file mode 100644 index 1c8950eb28bc..000000000000 --- a/vcl/osx/res/cursors/asns.png +++ /dev/null diff --git a/vcl/osx/res/cursors/asnswe.png b/vcl/osx/res/cursors/asnswe.png Binary files differdeleted file mode 100644 index aae5246fbbc0..000000000000 --- a/vcl/osx/res/cursors/asnswe.png +++ /dev/null diff --git a/vcl/osx/res/cursors/asnw.png b/vcl/osx/res/cursors/asnw.png Binary files differdeleted file mode 100644 index 9fd0036df077..000000000000 --- a/vcl/osx/res/cursors/asnw.png +++ /dev/null diff --git a/vcl/osx/res/cursors/ass.png b/vcl/osx/res/cursors/ass.png Binary files differdeleted file mode 100644 index bee09e736ad1..000000000000 --- a/vcl/osx/res/cursors/ass.png +++ /dev/null diff --git a/vcl/osx/res/cursors/asse.png b/vcl/osx/res/cursors/asse.png Binary files differdeleted file mode 100644 index d7883211d44f..000000000000 --- a/vcl/osx/res/cursors/asse.png +++ /dev/null diff --git a/vcl/osx/res/cursors/assw.png b/vcl/osx/res/cursors/assw.png Binary files differdeleted file mode 100644 index 0b0a496a52ec..000000000000 --- a/vcl/osx/res/cursors/assw.png +++ /dev/null diff --git a/vcl/osx/res/cursors/asw.png b/vcl/osx/res/cursors/asw.png Binary files differdeleted file mode 100644 index 5a4b9519e075..000000000000 --- a/vcl/osx/res/cursors/asw.png +++ /dev/null diff --git a/vcl/osx/res/cursors/aswe.png b/vcl/osx/res/cursors/aswe.png Binary files differdeleted file mode 100644 index b9c5afaac043..000000000000 --- a/vcl/osx/res/cursors/aswe.png +++ /dev/null diff --git a/vcl/osx/res/cursors/chain.png b/vcl/osx/res/cursors/chain.png Binary files differdeleted file mode 100644 index dbf069924d73..000000000000 --- a/vcl/osx/res/cursors/chain.png +++ /dev/null diff --git a/vcl/osx/res/cursors/chainnot.png b/vcl/osx/res/cursors/chainnot.png Binary files differdeleted file mode 100644 index 547703edf12c..000000000000 --- a/vcl/osx/res/cursors/chainnot.png +++ /dev/null diff --git a/vcl/osx/res/cursors/chart.png b/vcl/osx/res/cursors/chart.png Binary files differdeleted file mode 100644 index de5514006e1f..000000000000 --- a/vcl/osx/res/cursors/chart.png +++ /dev/null diff --git a/vcl/osx/res/cursors/copydata.png b/vcl/osx/res/cursors/copydata.png Binary files differdeleted file mode 100644 index b6202fd9144f..000000000000 --- a/vcl/osx/res/cursors/copydata.png +++ /dev/null diff --git a/vcl/osx/res/cursors/copydlnk.png b/vcl/osx/res/cursors/copydlnk.png Binary files differdeleted file mode 100644 index fab24c9f8f7c..000000000000 --- a/vcl/osx/res/cursors/copydlnk.png +++ /dev/null diff --git a/vcl/osx/res/cursors/copyf.png b/vcl/osx/res/cursors/copyf.png Binary files differdeleted file mode 100644 index 70546d0c0c22..000000000000 --- a/vcl/osx/res/cursors/copyf.png +++ /dev/null diff --git a/vcl/osx/res/cursors/copyf2.png b/vcl/osx/res/cursors/copyf2.png Binary files differdeleted file mode 100644 index b6f76051f10f..000000000000 --- a/vcl/osx/res/cursors/copyf2.png +++ /dev/null diff --git a/vcl/osx/res/cursors/copyflnk.png b/vcl/osx/res/cursors/copyflnk.png Binary files differdeleted file mode 100644 index 23561e484e36..000000000000 --- a/vcl/osx/res/cursors/copyflnk.png +++ /dev/null diff --git a/vcl/osx/res/cursors/crook.png b/vcl/osx/res/cursors/crook.png Binary files differdeleted file mode 100644 index 4378f8df8351..000000000000 --- a/vcl/osx/res/cursors/crook.png +++ /dev/null diff --git a/vcl/osx/res/cursors/crop.png b/vcl/osx/res/cursors/crop.png Binary files differdeleted file mode 100644 index 92a778ada31a..000000000000 --- a/vcl/osx/res/cursors/crop.png +++ /dev/null diff --git a/vcl/osx/res/cursors/darc.png b/vcl/osx/res/cursors/darc.png Binary files differdeleted file mode 100644 index 9772a1c6b85a..000000000000 --- a/vcl/osx/res/cursors/darc.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dbezier.png b/vcl/osx/res/cursors/dbezier.png Binary files differdeleted file mode 100644 index 988498137e9a..000000000000 --- a/vcl/osx/res/cursors/dbezier.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dcapt.png b/vcl/osx/res/cursors/dcapt.png Binary files differdeleted file mode 100644 index d1ef82818735..000000000000 --- a/vcl/osx/res/cursors/dcapt.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dcirccut.png b/vcl/osx/res/cursors/dcirccut.png Binary files differdeleted file mode 100644 index cb4ed0e85ecd..000000000000 --- a/vcl/osx/res/cursors/dcirccut.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dconnect.png b/vcl/osx/res/cursors/dconnect.png Binary files differdeleted file mode 100644 index e4a43bdbe021..000000000000 --- a/vcl/osx/res/cursors/dconnect.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dellipse.png b/vcl/osx/res/cursors/dellipse.png Binary files differdeleted file mode 100644 index 319c4574c7c1..000000000000 --- a/vcl/osx/res/cursors/dellipse.png +++ /dev/null diff --git a/vcl/osx/res/cursors/detectiv.png b/vcl/osx/res/cursors/detectiv.png Binary files differdeleted file mode 100644 index abe93f263d4d..000000000000 --- a/vcl/osx/res/cursors/detectiv.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dfree.png b/vcl/osx/res/cursors/dfree.png Binary files differdeleted file mode 100644 index 2de92942adde..000000000000 --- a/vcl/osx/res/cursors/dfree.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dline.png b/vcl/osx/res/cursors/dline.png Binary files differdeleted file mode 100644 index 6afb670ef8a8..000000000000 --- a/vcl/osx/res/cursors/dline.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dpie.png b/vcl/osx/res/cursors/dpie.png Binary files differdeleted file mode 100644 index 44a9474846b9..000000000000 --- a/vcl/osx/res/cursors/dpie.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dpolygon.png b/vcl/osx/res/cursors/dpolygon.png Binary files differdeleted file mode 100644 index 847e6ad9bea5..000000000000 --- a/vcl/osx/res/cursors/dpolygon.png +++ /dev/null diff --git a/vcl/osx/res/cursors/drect.png b/vcl/osx/res/cursors/drect.png Binary files differdeleted file mode 100644 index ff3dcbba07b4..000000000000 --- a/vcl/osx/res/cursors/drect.png +++ /dev/null diff --git a/vcl/osx/res/cursors/dtext.png b/vcl/osx/res/cursors/dtext.png Binary files differdeleted file mode 100644 index ee375f0e47a0..000000000000 --- a/vcl/osx/res/cursors/dtext.png +++ /dev/null diff --git a/vcl/osx/res/cursors/fill.png b/vcl/osx/res/cursors/fill.png Binary files differdeleted file mode 100644 index 220641b9beb4..000000000000 --- a/vcl/osx/res/cursors/fill.png +++ /dev/null diff --git a/vcl/osx/res/cursors/help.png b/vcl/osx/res/cursors/help.png Binary files differdeleted file mode 100644 index e29c19eccd22..000000000000 --- a/vcl/osx/res/cursors/help.png +++ /dev/null diff --git a/vcl/osx/res/cursors/hourglass.png b/vcl/osx/res/cursors/hourglass.png Binary files differdeleted file mode 100644 index 822368d7c950..000000000000 --- a/vcl/osx/res/cursors/hourglass.png +++ /dev/null diff --git a/vcl/osx/res/cursors/hshear.png b/vcl/osx/res/cursors/hshear.png Binary files differdeleted file mode 100644 index b45beded2d93..000000000000 --- a/vcl/osx/res/cursors/hshear.png +++ /dev/null diff --git a/vcl/osx/res/cursors/linkdata.png b/vcl/osx/res/cursors/linkdata.png Binary files differdeleted file mode 100644 index 6432db0155b6..000000000000 --- a/vcl/osx/res/cursors/linkdata.png +++ /dev/null diff --git a/vcl/osx/res/cursors/linkf.png b/vcl/osx/res/cursors/linkf.png Binary files differdeleted file mode 100644 index e17107fec9ff..000000000000 --- a/vcl/osx/res/cursors/linkf.png +++ /dev/null diff --git a/vcl/osx/res/cursors/magnify.png b/vcl/osx/res/cursors/magnify.png Binary files differdeleted file mode 100644 index 4e73146b91e4..000000000000 --- a/vcl/osx/res/cursors/magnify.png +++ /dev/null diff --git a/vcl/osx/res/cursors/mirror.png b/vcl/osx/res/cursors/mirror.png Binary files differdeleted file mode 100644 index 8fac93f0b6df..000000000000 --- a/vcl/osx/res/cursors/mirror.png +++ /dev/null diff --git a/vcl/osx/res/cursors/movebw.png b/vcl/osx/res/cursors/movebw.png Binary files differdeleted file mode 100644 index 63bf76ad3942..000000000000 --- a/vcl/osx/res/cursors/movebw.png +++ /dev/null diff --git a/vcl/osx/res/cursors/movedata.png b/vcl/osx/res/cursors/movedata.png Binary files differdeleted file mode 100644 index 60ece8a53e59..000000000000 --- a/vcl/osx/res/cursors/movedata.png +++ /dev/null diff --git a/vcl/osx/res/cursors/movedlnk.png b/vcl/osx/res/cursors/movedlnk.png Binary files differdeleted file mode 100644 index 6951cd718d97..000000000000 --- a/vcl/osx/res/cursors/movedlnk.png +++ /dev/null diff --git a/vcl/osx/res/cursors/movef.png b/vcl/osx/res/cursors/movef.png Binary files differdeleted file mode 100644 index 97a01c88fa4d..000000000000 --- a/vcl/osx/res/cursors/movef.png +++ /dev/null diff --git a/vcl/osx/res/cursors/movef2.png b/vcl/osx/res/cursors/movef2.png Binary files differdeleted file mode 100644 index 2cdddb410aae..000000000000 --- a/vcl/osx/res/cursors/movef2.png +++ /dev/null diff --git a/vcl/osx/res/cursors/moveflnk.png b/vcl/osx/res/cursors/moveflnk.png Binary files differdeleted file mode 100644 index 53301ba58c50..000000000000 --- a/vcl/osx/res/cursors/moveflnk.png +++ /dev/null diff --git a/vcl/osx/res/cursors/movept.png b/vcl/osx/res/cursors/movept.png Binary files differdeleted file mode 100644 index 41945deb1916..000000000000 --- a/vcl/osx/res/cursors/movept.png +++ /dev/null diff --git a/vcl/osx/res/cursors/notallow.png b/vcl/osx/res/cursors/notallow.png Binary files differdeleted file mode 100644 index df770a495194..000000000000 --- a/vcl/osx/res/cursors/notallow.png +++ /dev/null diff --git a/vcl/osx/res/cursors/nullptr.png b/vcl/osx/res/cursors/nullptr.png Binary files differdeleted file mode 100644 index 489636595bec..000000000000 --- a/vcl/osx/res/cursors/nullptr.png +++ /dev/null diff --git a/vcl/osx/res/cursors/pen.png b/vcl/osx/res/cursors/pen.png Binary files differdeleted file mode 100644 index 81b583086778..000000000000 --- a/vcl/osx/res/cursors/pen.png +++ /dev/null diff --git a/vcl/osx/res/cursors/pivotcol.png b/vcl/osx/res/cursors/pivotcol.png Binary files differdeleted file mode 100644 index 1c38b915b886..000000000000 --- a/vcl/osx/res/cursors/pivotcol.png +++ /dev/null diff --git a/vcl/osx/res/cursors/pivotdel.png b/vcl/osx/res/cursors/pivotdel.png Binary files differdeleted file mode 100644 index fbd663ee36c1..000000000000 --- a/vcl/osx/res/cursors/pivotdel.png +++ /dev/null diff --git a/vcl/osx/res/cursors/pivotfld.png b/vcl/osx/res/cursors/pivotfld.png Binary files differdeleted file mode 100644 index 04375de1efe6..000000000000 --- a/vcl/osx/res/cursors/pivotfld.png +++ /dev/null diff --git a/vcl/osx/res/cursors/pivotrow.png b/vcl/osx/res/cursors/pivotrow.png Binary files differdeleted file mode 100644 index 18ef0e8e59ba..000000000000 --- a/vcl/osx/res/cursors/pivotrow.png +++ /dev/null diff --git a/vcl/osx/res/cursors/rotate.png b/vcl/osx/res/cursors/rotate.png Binary files differdeleted file mode 100644 index a8137e077e56..000000000000 --- a/vcl/osx/res/cursors/rotate.png +++ /dev/null diff --git a/vcl/osx/res/cursors/tblsele.png b/vcl/osx/res/cursors/tblsele.png Binary files differdeleted file mode 100644 index a2da05e009d1..000000000000 --- a/vcl/osx/res/cursors/tblsele.png +++ /dev/null diff --git a/vcl/osx/res/cursors/tblsels.png b/vcl/osx/res/cursors/tblsels.png Binary files differdeleted file mode 100644 index ba20589c794f..000000000000 --- a/vcl/osx/res/cursors/tblsels.png +++ /dev/null diff --git a/vcl/osx/res/cursors/tblselse.png b/vcl/osx/res/cursors/tblselse.png Binary files differdeleted file mode 100644 index 4ee7f62b304b..000000000000 --- a/vcl/osx/res/cursors/tblselse.png +++ /dev/null diff --git a/vcl/osx/res/cursors/tblselsw.png b/vcl/osx/res/cursors/tblselsw.png Binary files differdeleted file mode 100644 index 11d7cb34d64d..000000000000 --- a/vcl/osx/res/cursors/tblselsw.png +++ /dev/null diff --git a/vcl/osx/res/cursors/tblselw.png b/vcl/osx/res/cursors/tblselw.png Binary files differdeleted file mode 100644 index 62813a975855..000000000000 --- a/vcl/osx/res/cursors/tblselw.png +++ /dev/null diff --git a/vcl/osx/res/cursors/vshear.png b/vcl/osx/res/cursors/vshear.png Binary files differdeleted file mode 100644 index b01cb6c935e1..000000000000 --- a/vcl/osx/res/cursors/vshear.png +++ /dev/null diff --git a/vcl/osx/res/cursors/vtext.png b/vcl/osx/res/cursors/vtext.png Binary files differdeleted file mode 100644 index dcc1080e5fcf..000000000000 --- a/vcl/osx/res/cursors/vtext.png +++ /dev/null diff --git a/vcl/osx/res/cursors/wshide.png b/vcl/osx/res/cursors/wshide.png Binary files differdeleted file mode 100644 index 0195b91cdb39..000000000000 --- a/vcl/osx/res/cursors/wshide.png +++ /dev/null diff --git a/vcl/osx/res/cursors/wsshow.png b/vcl/osx/res/cursors/wsshow.png Binary files differdeleted file mode 100644 index fe374643eb20..000000000000 --- a/vcl/osx/res/cursors/wsshow.png +++ /dev/null diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx index fc13822f99d5..e0e974ff1f3d 100644 --- a/vcl/osx/saldata.cxx +++ b/vcl/osx/saldata.cxx @@ -24,6 +24,13 @@ #include <osx/salnsmenu.h> #include <osx/salinst.h> #include <o3tl/enumarray.hxx> +#include <tools/stream.hxx> +#include <vcl/ImageTree.hxx> +#include <vcl/settings.hxx> +#include <i18nlangtag/languagetag.hxx> +#include <sal/log.hxx> +#include <bitmaps.hlst> +#include <cursor_hotspots.hxx> #import "apple_remote/RemoteMainController.h" @@ -114,134 +121,152 @@ void SalData::ensureThreadAutoreleasePool() } } -struct curs_ent -{ - const char* pBaseName; - const NSPoint aHotSpot; -}; -const o3tl::enumarray<PointerStyle, curs_ent> aCursorTab = +NSImage* load_icon_by_name(const OUString& rIconName) { -curs_ent{ nullptr, { 0, 0 } }, //PointerStyle::Arrow -{ "nullptr", { 16, 16 } }, //PointerStyle::Null -{ "hourglass", { 15, 15 } }, //PointerStyle::Wait -{ nullptr, { 0, 0 } }, //PointerStyle::Text -{ "help", { 0, 0 } }, //PointerStyle::Help -{ nullptr, { 0, 0 } }, //PointerStyle::Cross -{ nullptr, { 0, 0 } }, //PointerStyle::Move -{ nullptr, { 0, 0 } }, //PointerStyle::NSize -{ nullptr, { 0, 0 } }, //PointerStyle::SSize -{ nullptr, { 0, 0 } }, //PointerStyle::WSize -{ nullptr, { 0, 0 } }, //PointerStyle::ESize -{ "nwsesize", { 15, 15 } }, //PointerStyle::NWSize -{ "neswsize", { 15, 15 } }, //PointerStyle::NESize -{ "neswsize", { 15, 15 } }, //PointerStyle::SWSize -{ "nwsesize", { 15, 15 } }, //PointerStyle::SESize -{ nullptr, { 0, 0 } }, //PointerStyle::WindowNSize -{ nullptr, { 0, 0 } }, //PointerStyle::WindowSSize -{ nullptr, { 0, 0 } }, //PointerStyle::WindowWSize -{ nullptr, { 0, 0 } }, //PointerStyle::WindowESize -{ "nwsesize", { 15, 15 } }, //PointerStyle::WindowNWSize -{ "neswsize", { 15, 15 } }, //PointerStyle::WindowNESize -{ "neswsize", { 15, 15 } }, //PointerStyle::WindowSWSize -{ "nwsesize", { 15, 15 } }, //PointerStyle::WindowSESize -{ nullptr, { 0, 0 } }, //PointerStyle::HSplit -{ nullptr, { 0, 0 } }, //PointerStyle::VSplit -{ nullptr, { 0, 0 } }, //PointerStyle::HSizeBar -{ nullptr, { 0, 0 } }, //PointerStyle::VSizeBar -{ nullptr, { 0, 0 } }, //PointerStyle::Hand -{ nullptr, { 0, 0 } }, //PointerStyle::RefHand -{ "pen", { 3, 27 } }, //PointerStyle::Pen -{ "magnify", { 12, 13 } }, //PointerStyle::Magnify -{ "fill", { 10, 22 } }, //PointerStyle::Fill -{ "rotate", { 15, 15 } }, //PointerStyle::Rotate -{ "hshear", { 15, 15 } }, //PointerStyle::HShear -{ "vshear", { 15, 15 } }, //PointerStyle::VShear -{ "mirror", { 14, 12 } }, //PointerStyle::Mirror -{ "crook", { 15, 14 } }, //PointerStyle::Crook -{ "crop", { 9, 9 } }, //PointerStyle::Crop -{ "movept", { 0, 0 } }, //PointerStyle::MovePoint -{ "movebw", { 0, 0 } }, //PointerStyle::MoveBezierWeight -{ "movedata", { 0, 0 } }, //PointerStyle::MoveData -{ "copydata", { 0, 0 } }, //PointerStyle::CopyData -{ "linkdata", { 0, 0 } }, //PointerStyle::LinkData -{ "movedlnk", { 0, 0 } }, //PointerStyle::MoveDataLink -{ "copydlnk", { 0, 0 } }, //PointerStyle::CopyDataLink -{ "movef", { 8, 8 } }, //PointerStyle::MoveFile -{ "copyf", { 8, 8 } }, //PointerStyle::CopyFile -{ "linkf", { 8, 8 } }, //PointerStyle::LinkFile -{ "moveflnk", { 8, 8 } }, //PointerStyle::MoveFileLink -{ "copyflnk", { 8, 8 } }, //PointerStyle::CopyFileLink -{ "movef2", { 7, 8 } }, //PointerStyle::MoveFiles -{ "copyf2", { 7, 8 } }, //PointerStyle::CopyFiles -{ "notallow", { 15, 15 } }, //PointerStyle::NotAllowed -{ "dline", { 8, 8 } }, //PointerStyle::DrawLine -{ "drect", { 8, 8 } }, //PointerStyle::DrawRect -{ "dpolygon", { 8, 8 } }, //PointerStyle::DrawPolygon -{ "dbezier", { 8, 8 } }, //PointerStyle::DrawBezier -{ "darc", { 8, 8 } }, //PointerStyle::DrawArc -{ "dpie", { 8, 8 } }, //PointerStyle::DrawPie -{ "dcirccut", { 8, 8 } }, //PointerStyle::DrawCircleCut -{ "dellipse", { 8, 8 } }, //PointerStyle::DrawEllipse -{ "dfree", { 8, 8 } }, //PointerStyle::DrawFreehand -{ "dconnect", { 8, 8 } }, //PointerStyle::DrawConnect -{ "dtext", { 8, 8 } }, //PointerStyle::DrawText -{ "dcapt", { 8, 8 } }, //PointerStyle::DrawCaption -{ "chart", { 15, 16 } }, //PointerStyle::Chart -{ "detectiv", { 12, 13 } }, //PointerStyle::Detective -{ "pivotcol", { 7, 5 } }, //PointerStyle::PivotCol -{ "pivotrow", { 8, 7 } }, //PointerStyle::PivotRow -{ "pivotfld", { 8, 7 } }, //PointerStyle::PivotField -{ "chain", { 0, 2 } }, //PointerStyle::Chain -{ "chainnot", { 2, 2 } }, //PointerStyle::ChainNotAllowed -{ "asn", { 16, 12 } }, //PointerStyle::AutoScrollN -{ "ass", { 15, 19 } }, //PointerStyle::AutoScrollS -{ "asw", { 12, 15 } }, //PointerStyle::AutoScrollW -{ "ase", { 19, 16 } }, //PointerStyle::AutoScrollE -{ "asnw", { 10, 10 } }, //PointerStyle::AutoScrollNW -{ "asne", { 21, 10 } }, //PointerStyle::AutoScrollNE -{ "assw", { 21, 21 } }, //PointerStyle::AutoScrollSW -{ "asse", { 21, 21 } }, //PointerStyle::AutoScrollSE -{ "asns", { 15, 15 } }, //PointerStyle::AutoScrollNS -{ "aswe", { 15, 15 } }, //PointerStyle::AutoScrollWE -{ "asnswe", { 15, 15 } }, //PointerStyle::AutoScrollNSWE -{ "vtext", { 15, 15 } }, //PointerStyle::TextVertical -{ "pivotdel", { 18, 15 } }, //PointerStyle::PivotDelete -{ "tblsels", { 15, 30 } }, //PointerStyle::TabSelectS -{ "tblsele", { 30, 16 } }, //PointerStyle::TabSelectE -{ "tblselse", { 30, 30 } }, //PointerStyle::TabSelectSE -{ "tblselw", { 1, 16 } }, //PointerStyle::TabSelectW -{ "tblselsw", { 1, 30 } }, //PointerStyle::TabSelectSW -{ "wshide", { 16, 16 } }, //PointerStyle::HideWhitespace -{ "wsshow", { 16, 16 } } //PointerStyle::ShowWhitespace -}; + OUString sIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme(); + OUString sUILang = Application::GetSettings().GetUILanguageTag().getBcp47(); + auto xMemStm = ImageTree::get().getImageStream(rIconName, sIconTheme, sUILang); + if (!xMemStm) + return nullptr; + + auto data = xMemStm->GetData(); + auto length = xMemStm->TellEnd(); + NSData * byteData = [NSData dataWithBytes:data length:length]; + NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData:byteData]; + NSSize imageSize = NSMakeSize(CGImageGetWidth([imageRep CGImage]), CGImageGetHeight([imageRep CGImage])); + + NSImage * image = [[NSImage alloc] initWithSize:imageSize]; + [image addRepresentation:imageRep]; + return image; +} + +#define MAKE_CURSOR( vcl_name, name, name2 ) \ + case vcl_name: \ + aHotSpot = NSPoint{name##curs_x_hot, name##curs_y_hot}; \ + aIconName = name2; \ + break NSCursor* SalData::getCursor( PointerStyle i_eStyle ) { NSCursor* pCurs = maCursors[ i_eStyle ]; - if( pCurs == INVALID_CURSOR_PTR ) + if( pCurs != INVALID_CURSOR_PTR ) + return pCurs; + + NSPoint aHotSpot; + OUString aIconName; + + switch( i_eStyle ) { - pCurs = nil; - if( aCursorTab[ i_eStyle ].pBaseName ) - { - NSPoint aHotSpot = aCursorTab[ i_eStyle ].aHotSpot; - CFStringRef pCursorName = - CFStringCreateWithCStringNoCopy( - kCFAllocatorDefault, - aCursorTab[ i_eStyle ].pBaseName, - kCFStringEncodingASCII, - kCFAllocatorNull ); - CFBundleRef hMain = CFBundleGetMainBundle(); - CFURLRef hURL = CFBundleCopyResourceURL( hMain, pCursorName, CFSTR("png"), CFSTR("cursors") ); - if( hURL ) - { - pCurs = [[NSCursor alloc] initWithImage: [[NSImage alloc] initWithContentsOfURL: const_cast<NSURL*>(reinterpret_cast<NSURL const *>(hURL))] hotSpot: aHotSpot]; - CFRelease( hURL ); - } - CFRelease( pCursorName ); + // TODO + MAKE_CURSOR( PointerStyle::Wait, wait_, RID_CURSOR_WAIT ); + MAKE_CURSOR( PointerStyle::NWSize, nwsize_, RID_CURSOR_NWSIZE ); + MAKE_CURSOR( PointerStyle::NESize, nesize_, RID_CURSOR_NESIZE ); + MAKE_CURSOR( PointerStyle::SWSize, swsize_, RID_CURSOR_SWSIZE ); + MAKE_CURSOR( PointerStyle::SESize, sesize_, RID_CURSOR_SESIZE ); + MAKE_CURSOR( PointerStyle::WindowNWSize, window_nwsize_, RID_CURSOR_WINDOW_NWSIZE ); + MAKE_CURSOR( PointerStyle::WindowNESize, window_nesize_, RID_CURSOR_WINDOW_NESIZE ); + MAKE_CURSOR( PointerStyle::WindowSWSize, window_swsize_, RID_CURSOR_WINDOW_SWSIZE ); + MAKE_CURSOR( PointerStyle::WindowSESize, window_sesize_, RID_CURSOR_WINDOW_SESIZE ); + + MAKE_CURSOR( PointerStyle::Help, help_, RID_CURSOR_HELP ); + MAKE_CURSOR( PointerStyle::Pen, pen_, RID_CURSOR_PEN ); + MAKE_CURSOR( PointerStyle::Null, null, RID_CURSOR_NULL ); + MAKE_CURSOR( PointerStyle::Magnify, magnify_, RID_CURSOR_MAGNIFY ); + MAKE_CURSOR( PointerStyle::Fill, fill_, RID_CURSOR_FILL ); + MAKE_CURSOR( PointerStyle::MoveData, movedata_, RID_CURSOR_MOVE_DATA ); + MAKE_CURSOR( PointerStyle::CopyData, copydata_, RID_CURSOR_COPY_DATA ); + MAKE_CURSOR( PointerStyle::MoveFile, movefile_, RID_CURSOR_MOVE_FILE ); + MAKE_CURSOR( PointerStyle::CopyFile, copyfile_, RID_CURSOR_COPY_FILE ); + MAKE_CURSOR( PointerStyle::MoveFiles, movefiles_, RID_CURSOR_MOVE_FILES ); + MAKE_CURSOR( PointerStyle::CopyFiles, copyfiles_, RID_CURSOR_COPY_FILES ); + MAKE_CURSOR( PointerStyle::NotAllowed, nodrop_, RID_CURSOR_NOT_ALLOWED ); + MAKE_CURSOR( PointerStyle::Rotate, rotate_, RID_CURSOR_ROTATE ); + MAKE_CURSOR( PointerStyle::HShear, hshear_, RID_CURSOR_H_SHEAR ); + MAKE_CURSOR( PointerStyle::VShear, vshear_, RID_CURSOR_V_SHEAR ); + MAKE_CURSOR( PointerStyle::DrawLine, drawline_, RID_CURSOR_DRAW_LINE ); + MAKE_CURSOR( PointerStyle::DrawRect, drawrect_, RID_CURSOR_DRAW_RECT ); + MAKE_CURSOR( PointerStyle::DrawPolygon, drawpolygon_, RID_CURSOR_DRAW_POLYGON ); + MAKE_CURSOR( PointerStyle::DrawBezier, drawbezier_, RID_CURSOR_DRAW_BEZIER ); + MAKE_CURSOR( PointerStyle::DrawArc, drawarc_, RID_CURSOR_DRAW_ARC ); + MAKE_CURSOR( PointerStyle::DrawPie, drawpie_, RID_CURSOR_DRAW_PIE ); + MAKE_CURSOR( PointerStyle::DrawCircleCut, drawcirclecut_, RID_CURSOR_DRAW_CIRCLE_CUT ); + MAKE_CURSOR( PointerStyle::DrawEllipse, drawellipse_, RID_CURSOR_DRAW_ELLIPSE ); + MAKE_CURSOR( PointerStyle::DrawConnect, drawconnect_, RID_CURSOR_DRAW_CONNECT ); + MAKE_CURSOR( PointerStyle::DrawText, drawtext_, RID_CURSOR_DRAW_TEXT ); + MAKE_CURSOR( PointerStyle::Mirror, mirror_, RID_CURSOR_MIRROR ); + MAKE_CURSOR( PointerStyle::Crook, crook_, RID_CURSOR_CROOK ); + MAKE_CURSOR( PointerStyle::Crop, crop_, RID_CURSOR_CROP ); + MAKE_CURSOR( PointerStyle::MovePoint, movepoint_, RID_CURSOR_MOVE_POINT ); + MAKE_CURSOR( PointerStyle::MoveBezierWeight, movebezierweight_, RID_CURSOR_MOVE_BEZIER_WEIGHT ); + MAKE_CURSOR( PointerStyle::DrawFreehand, drawfreehand_, RID_CURSOR_DRAW_FREEHAND ); + MAKE_CURSOR( PointerStyle::DrawCaption, drawcaption_, RID_CURSOR_DRAW_CAPTION ); + MAKE_CURSOR( PointerStyle::LinkData, linkdata_, RID_CURSOR_LINK_DATA ); + MAKE_CURSOR( PointerStyle::MoveDataLink, movedlnk_, RID_CURSOR_MOVE_DATA_LINK ); + MAKE_CURSOR( PointerStyle::CopyDataLink, copydlnk_, RID_CURSOR_COPY_DATA_LINK ); + MAKE_CURSOR( PointerStyle::LinkFile, linkfile_, RID_CURSOR_LINK_FILE ); + MAKE_CURSOR( PointerStyle::MoveFileLink, moveflnk_, RID_CURSOR_MOVE_FILE_LINK ); + MAKE_CURSOR( PointerStyle::CopyFileLink, copyflnk_, RID_CURSOR_COPY_FILE_LINK ); + MAKE_CURSOR( PointerStyle::Chart, chart_, RID_CURSOR_CHART ); + MAKE_CURSOR( PointerStyle::Detective, detective_, RID_CURSOR_DETECTIVE ); + MAKE_CURSOR( PointerStyle::PivotCol, pivotcol_, RID_CURSOR_PIVOT_COLUMN ); + MAKE_CURSOR( PointerStyle::PivotRow, pivotrow_, RID_CURSOR_PIVOT_ROW ); + MAKE_CURSOR( PointerStyle::PivotField, pivotfld_, RID_CURSOR_PIVOT_FIELD ); + MAKE_CURSOR( PointerStyle::PivotDelete, pivotdel_, RID_CURSOR_PIVOT_DELETE ); + MAKE_CURSOR( PointerStyle::Chain, chain_, RID_CURSOR_CHAIN ); + MAKE_CURSOR( PointerStyle::ChainNotAllowed, chainnot_, RID_CURSOR_CHAIN_NOT_ALLOWED ); + MAKE_CURSOR( PointerStyle::AutoScrollN, asn_, RID_CURSOR_AUTOSCROLL_N ); + MAKE_CURSOR( PointerStyle::AutoScrollS, ass_, RID_CURSOR_AUTOSCROLL_S ); + MAKE_CURSOR( PointerStyle::AutoScrollW, asw_, RID_CURSOR_AUTOSCROLL_W ); + MAKE_CURSOR( PointerStyle::AutoScrollE, ase_, RID_CURSOR_AUTOSCROLL_E ); + MAKE_CURSOR( PointerStyle::AutoScrollNW, asnw_, RID_CURSOR_AUTOSCROLL_NW ); + MAKE_CURSOR( PointerStyle::AutoScrollNE, asne_, RID_CURSOR_AUTOSCROLL_NE ); + MAKE_CURSOR( PointerStyle::AutoScrollSW, assw_, RID_CURSOR_AUTOSCROLL_SW ); + MAKE_CURSOR( PointerStyle::AutoScrollSE, asse_, RID_CURSOR_AUTOSCROLL_SE ); + MAKE_CURSOR( PointerStyle::AutoScrollNS, asns_, RID_CURSOR_AUTOSCROLL_NS ); + MAKE_CURSOR( PointerStyle::AutoScrollWE, aswe_, RID_CURSOR_AUTOSCROLL_WE ); + MAKE_CURSOR( PointerStyle::AutoScrollNSWE, asnswe_, RID_CURSOR_AUTOSCROLL_NSWE ); + MAKE_CURSOR( PointerStyle::TextVertical, vertcurs_, RID_CURSOR_TEXT_VERTICAL ); + + // #i32329# + MAKE_CURSOR( PointerStyle::TabSelectS, tblsels_, RID_CURSOR_TAB_SELECT_S ); + MAKE_CURSOR( PointerStyle::TabSelectE, tblsele_, RID_CURSOR_TAB_SELECT_E ); + MAKE_CURSOR( PointerStyle::TabSelectSE, tblselse_, RID_CURSOR_TAB_SELECT_SE ); + MAKE_CURSOR( PointerStyle::TabSelectW, tblselw_, RID_CURSOR_TAB_SELECT_W ); + MAKE_CURSOR( PointerStyle::TabSelectSW, tblselsw_, RID_CURSOR_TAB_SELECT_SW ); + + MAKE_CURSOR( PointerStyle::HideWhitespace, hidewhitespace_, RID_CURSOR_HIDE_WHITESPACE ); + MAKE_CURSOR( PointerStyle::ShowWhitespace, showwhitespace_, RID_CURSOR_SHOW_WHITESPACE ); + + default: + SAL_WARN( "vcl", "pointer style " << static_cast<sal_Int32>(i_eStyle) << "not implemented" ); + assert( false && "pointer style not implemented" ); + break; + } + + NSImage* theImage = load_icon_by_name(aIconName); + assert ([theImage size].width == 128 || [theImage size].width == 32); + if ([theImage size].width == 128) + { + // If we have a 128x128 image, generate scaled versions of it. + // This will result in macOS picking a reasonably sized image for different screen dpi. + NSSize cursorSize = NSMakeSize(32,32); + NSImage *multiResImage = [[NSImage alloc] initWithSize:cursorSize]; + for (int scale = 1; scale <= 4; scale++) { + NSAffineTransform *xform = [[NSAffineTransform alloc] init]; + [xform scaleBy:scale]; + id hints = @{ NSImageHintCTM: xform }; + CGImageRef rasterCGImage = [theImage CGImageForProposedRect:NULL context:nil hints:hints]; + NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:rasterCGImage]; + [rep setSize:cursorSize]; + [multiResImage addRepresentation:rep]; } - maCursors[ i_eStyle ] = pCurs; + pCurs = [[NSCursor alloc] initWithImage: multiResImage hotSpot: aHotSpot]; } + else + pCurs = [[NSCursor alloc] initWithImage: theImage hotSpot: aHotSpot]; + + maCursors[ i_eStyle ] = pCurs; return pCurs; } diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 0ab8d9160dcf..a9ebc417f15b 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -925,7 +925,7 @@ NSCursor* AquaSalFrame::getCurrentCursor() pCursor = GetSalData()->getCursor( mePointerStyle ); if( pCursor == nil ) { - OSL_FAIL( "unmapped cursor" ); + assert( false && "unmapped cursor" ); pCursor = [NSCursor arrowCursor]; } break; diff --git a/vcl/unx/gtk3/gtk3gtkdata.cxx b/vcl/unx/gtk3/gtk3gtkdata.cxx index 3c010c274cb0..f15f099ab646 100644 --- a/vcl/unx/gtk3/gtk3gtkdata.cxx +++ b/vcl/unx/gtk3/gtk3gtkdata.cxx @@ -38,6 +38,7 @@ #include <unx/salobj.h> #include <unx/geninst.h> #include <bitmaps.hlst> +#include <cursor_hotspots.hxx> #include <osl/thread.h> #include <osl/process.h> @@ -57,136 +58,6 @@ #include <chrono> -#define nodrop_curs_x_hot 9 -#define nodrop_curs_y_hot 9 -#define magnify_curs_x_hot 12 -#define magnify_curs_y_hot 13 -#define rotate_curs_x_hot 15 -#define rotate_curs_y_hot 15 -#define hshear_curs_x_hot 15 -#define hshear_curs_y_hot 15 -#define vshear_curs_x_hot 15 -#define vshear_curs_y_hot 15 -#define drawline_curs_x_hot 7 -#define drawline_curs_y_hot 7 -#define drawrect_curs_x_hot 7 -#define drawrect_curs_y_hot 7 -#define drawpolygon_curs_x_hot 7 -#define drawpolygon_curs_y_hot 7 -#define drawbezier_curs_x_hot 7 -#define drawbezier_curs_y_hot 7 -#define drawarc_curs_x_hot 7 -#define drawarc_curs_y_hot 7 -#define drawpie_curs_x_hot 7 -#define drawpie_curs_y_hot 7 -#define drawcirclecut_curs_x_hot 7 -#define drawcirclecut_curs_y_hot 7 -#define drawellipse_curs_x_hot 7 -#define drawellipse_curs_y_hot 7 -#define drawconnect_curs_x_hot 7 -#define drawconnect_curs_y_hot 7 -#define drawtext_curs_x_hot 8 -#define drawtext_curs_y_hot 8 -#define mirror_curs_x_hot 14 -#define mirror_curs_y_hot 12 -#define crook_curs_x_hot 15 -#define crook_curs_y_hot 14 -#define crop_curs_x_hot 9 -#define crop_curs_y_hot 9 -#define movepoint_curs_x_hot 0 -#define movepoint_curs_y_hot 0 -#define movebezierweight_curs_x_hot 0 -#define movebezierweight_curs_y_hot 0 -#define drawfreehand_curs_x_hot 8 -#define drawfreehand_curs_y_hot 8 -#define drawcaption_curs_x_hot 8 -#define drawcaption_curs_y_hot 8 -#define movedata_curs_x_hot 1 -#define movedata_curs_y_hot 1 -#define copydata_curs_x_hot 1 -#define copydata_curs_y_hot 1 -#define linkdata_curs_x_hot 1 -#define linkdata_curs_y_hot 1 -#define movedlnk_curs_x_hot 1 -#define movedlnk_curs_y_hot 1 -#define copydlnk_curs_x_hot 1 -#define copydlnk_curs_y_hot 1 -#define movefile_curs_x_hot 9 -#define movefile_curs_y_hot 9 -#define copyfile_curs_x_hot 9 -#define copyfile_curs_y_hot 9 -#define linkfile_curs_x_hot 9 -#define linkfile_curs_y_hot 9 -#define moveflnk_curs_x_hot 9 -#define moveflnk_curs_y_hot 9 -#define copyflnk_curs_x_hot 9 -#define copyflnk_curs_y_hot 9 -#define movefiles_curs_x_hot 8 -#define movefiles_curs_y_hot 9 -#define copyfiles_curs_x_hot 8 -#define copyfiles_curs_y_hot 9 - -#define chart_curs_x_hot 15 -#define chart_curs_y_hot 16 -#define detective_curs_x_hot 12 -#define detective_curs_y_hot 13 -#define pivotcol_curs_x_hot 7 -#define pivotcol_curs_y_hot 5 -#define pivotfld_curs_x_hot 8 -#define pivotfld_curs_y_hot 7 -#define pivotrow_curs_x_hot 8 -#define pivotrow_curs_y_hot 7 -#define pivotdel_curs_x_hot 9 -#define pivotdel_curs_y_hot 8 - -#define chain_curs_x_hot 0 -#define chain_curs_y_hot 2 -#define chainnot_curs_x_hot 2 -#define chainnot_curs_y_hot 2 - -#define ase_curs_x_hot 19 -#define ase_curs_y_hot 16 -#define asn_curs_x_hot 16 -#define asn_curs_y_hot 12 -#define asne_curs_x_hot 21 -#define asne_curs_y_hot 10 -#define asns_curs_x_hot 15 -#define asns_curs_y_hot 15 -#define asnswe_curs_x_hot 15 -#define asnswe_curs_y_hot 15 -#define asnw_curs_x_hot 10 -#define asnw_curs_y_hot 10 -#define ass_curs_x_hot 15 -#define ass_curs_y_hot 19 -#define asse_curs_x_hot 21 -#define asse_curs_y_hot 21 -#define assw_curs_x_hot 10 -#define assw_curs_y_hot 21 -#define asw_curs_x_hot 12 -#define asw_curs_y_hot 15 -#define aswe_curs_x_hot 15 -#define aswe_curs_y_hot 15 -#define nullcurs_x_hot 2 -#define nullcurs_y_hot 2 - -#define fill_curs_x_hot 10 -#define fill_curs_y_hot 22 -#define vertcurs_curs_x_hot 8 -#define vertcurs_curs_y_hot 8 -#define tblsele_curs_x_hot 14 -#define tblsele_curs_y_hot 8 -#define tblsels_curs_x_hot 7 -#define tblsels_curs_y_hot 14 -#define tblselse_curs_x_hot 14 -#define tblselse_curs_y_hot 14 -#define tblselw_curs_x_hot 1 -#define tblselw_curs_y_hot 8 -#define tblselsw_curs_x_hot 1 -#define tblselsw_curs_y_hot 14 -#define hidewhitespace_curs_x_hot 0 -#define hidewhitespace_curs_y_hot 10 -#define showwhitespace_curs_x_hot 0 -#define showwhitespace_curs_y_hot 10 using namespace vcl_sal; |