diff options
author | Ashod Nakashian <ashodnakashian@yahoo.com> | 2015-08-30 22:52:03 -0400 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-01 09:33:35 +0000 |
commit | 54a2c8c006e2f216e9d8c6b0ed625180c843c48b (patch) | |
tree | f418de3d5ec3dbb10435d8cb7e993ad7c5d232bf /vcl | |
parent | 55b2b9586662f3fe0f01633d41ddadefe08a84a1 (diff) |
tdf#39080 Interactive hide-whitespace mode
Support for enabling and disabling hide-whitespace
by clicking between page frames.
Disabled header and footer decorators when
hide-whitepsace is enabled, and page size
is trimmed to the contents of each page.
Experimental/suggestive mouse pointers added
but only tested on Windows.
Change-Id: Ia2faeeda9e3e783ffaf5340aa69303a4218892a7
Reviewed-on: https://gerrit.libreoffice.org/18156
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/x11_cursors/salcursors.h | 4 | ||||
-rw-r--r-- | vcl/inc/unx/x11_cursors/wshide_curs.h | 29 | ||||
-rw-r--r-- | vcl/inc/unx/x11_cursors/wshide_mask.h | 29 | ||||
-rw-r--r-- | vcl/inc/unx/x11_cursors/wsshow_curs.h | 29 | ||||
-rw-r--r-- | vcl/inc/unx/x11_cursors/wsshow_mask.h | 29 | ||||
-rw-r--r-- | vcl/inc/win/salids.hrc | 20 | ||||
-rw-r--r-- | vcl/osx/res/cursors/wshide.png | bin | 0 -> 2878 bytes | |||
-rw-r--r-- | vcl/osx/res/cursors/wsshow.png | bin | 0 -> 2884 bytes | |||
-rw-r--r-- | vcl/osx/saldata.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 9 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkdata.cxx | 3 | ||||
-rw-r--r-- | vcl/win/source/src/salsrc.rc | 2 | ||||
-rw-r--r-- | vcl/win/source/src/wshide.cur | bin | 0 -> 326 bytes | |||
-rw-r--r-- | vcl/win/source/src/wsshow.cur | bin | 0 -> 326 bytes | |||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 4 |
15 files changed, 150 insertions, 12 deletions
diff --git a/vcl/inc/unx/x11_cursors/salcursors.h b/vcl/inc/unx/x11_cursors/salcursors.h index 5eb74e661c42..627352f9ef4c 100644 --- a/vcl/inc/unx/x11_cursors/salcursors.h +++ b/vcl/inc/unx/x11_cursors/salcursors.h @@ -152,5 +152,9 @@ #include "unx/x11_cursors/tblselsw_mask.h" #include "unx/x11_cursors/paintbrush_curs.h" #include "unx/x11_cursors/paintbrush_mask.h" +#include "unx/x11_cursors/wshide_curs.h" +#include "unx/x11_cursors/wshide_mask.h" +#include "unx/x11_cursors/wsshow_curs.h" +#include "unx/x11_cursors/wsshow_mask.h" /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/wshide_curs.h b/vcl/inc/unx/x11_cursors/wshide_curs.h new file mode 100644 index 000000000000..e8fd2723024c --- /dev/null +++ b/vcl/inc/unx/x11_cursors/wshide_curs.h @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#define hidewhitespace_curs_width 16 +#define hidewhitespace_curs_height 16 +#define hidewhitespace_curs_x_hot 0 +#define hidewhitespace_curs_y_hot 10 +static unsigned char hidewhitespace_curs_bits[] = { + 0x00, 0x01, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, 0xFF, 0xFF, + 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0x00, 0x01, + 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0x00, 0x01, }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/wshide_mask.h b/vcl/inc/unx/x11_cursors/wshide_mask.h new file mode 100644 index 000000000000..8547baa25183 --- /dev/null +++ b/vcl/inc/unx/x11_cursors/wshide_mask.h @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#define hidewhitespace_mask_width 16 +#define hidewhitespace_mask_height 16 +#define hidewhitespace_mask_x_hot 0 +#define hidewhitespace_mask_y_hot 10 +static unsigned char hidewhitespace_mask_bits[] = { + 0x00, 0x01, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, 0xFF, 0xFF, + 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0x00, 0x01, + 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0x00, 0x01, }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/wsshow_curs.h b/vcl/inc/unx/x11_cursors/wsshow_curs.h new file mode 100644 index 000000000000..56b705e69796 --- /dev/null +++ b/vcl/inc/unx/x11_cursors/wsshow_curs.h @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#define showwhitespace_curs_width 16 +#define showwhitespace_curs_height 16 +#define showwhitespace_curs_x_hot 0 +#define showwhitespace_curs_y_hot 10 +static unsigned char showwhitespace_curs_bits[] = { + 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x81, + 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0xFF, 0xFF, + 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/wsshow_mask.h b/vcl/inc/unx/x11_cursors/wsshow_mask.h new file mode 100644 index 000000000000..2da7aea99094 --- /dev/null +++ b/vcl/inc/unx/x11_cursors/wsshow_mask.h @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#define showwhitespace_mask_width 16 +#define showwhitespace_mask_height 16 +#define showwhitespace_mask_x_hot 0 +#define showwhitespace_mask_y_hot 10 +static unsigned char showwhitespace_mask_bits[] = { + 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x81, + 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0xFF, 0xFF, + 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/win/salids.hrc b/vcl/inc/win/salids.hrc index acc0f4381f38..e5a0e1835a56 100644 --- a/vcl/inc/win/salids.hrc +++ b/vcl/inc/win/salids.hrc @@ -60,12 +60,12 @@ #define SAL_RESID_POINTER_DRAW_CONNECT 10047 #define SAL_RESID_POINTER_DRAW_TEXT 10048 #define SAL_RESID_POINTER_DRAW_CAPTION 10049 -#define SAL_RESID_POINTER_CHART 10050 +#define SAL_RESID_POINTER_CHART 10050 #define SAL_RESID_POINTER_DETECTIVE 10051 #define SAL_RESID_POINTER_PIVOT_COL 10052 #define SAL_RESID_POINTER_PIVOT_ROW 10053 #define SAL_RESID_POINTER_PIVOT_FIELD 10054 -#define SAL_RESID_POINTER_CHAIN 10055 +#define SAL_RESID_POINTER_CHAIN 10055 #define SAL_RESID_POINTER_CHAIN_NOTALLOWED 10056 #define SAL_RESID_POINTER_TIMEEVENT_MOVE 10057 #define SAL_RESID_POINTER_TIMEEVENT_SIZE 10058 @@ -80,15 +80,17 @@ #define SAL_RESID_POINTER_AUTOSCROLL_NS 10067 #define SAL_RESID_POINTER_AUTOSCROLL_WE 10068 #define SAL_RESID_POINTER_AUTOSCROLL_NSWE 10069 -#define SAL_RESID_POINTER_AIRBRUSH 10070 +#define SAL_RESID_POINTER_AIRBRUSH 10070 #define SAL_RESID_POINTER_TEXT_VERTICAL 10071 #define SAL_RESID_POINTER_PIVOT_DELETE 10072 -#define SAL_RESID_POINTER_TAB_SELECT_S 10073 -#define SAL_RESID_POINTER_TAB_SELECT_E 10074 -#define SAL_RESID_POINTER_TAB_SELECT_SE 10075 -#define SAL_RESID_POINTER_TAB_SELECT_W 10076 -#define SAL_RESID_POINTER_TAB_SELECT_SW 10077 -#define SAL_RESID_POINTER_PAINTBRUSH 10078 +#define SAL_RESID_POINTER_TAB_SELECT_S 10073 +#define SAL_RESID_POINTER_TAB_SELECT_E 10074 +#define SAL_RESID_POINTER_TAB_SELECT_SE 10075 +#define SAL_RESID_POINTER_TAB_SELECT_W 10076 +#define SAL_RESID_POINTER_TAB_SELECT_SW 10077 +#define SAL_RESID_POINTER_PAINTBRUSH 10078 +#define SAL_RESID_POINTER_HIDEWHITESPACE 10079 +#define SAL_RESID_POINTER_SHOWWHITESPACE 10080 #define SAL_RESID_BITMAP_50 11000 diff --git a/vcl/osx/res/cursors/wshide.png b/vcl/osx/res/cursors/wshide.png Binary files differnew file mode 100644 index 000000000000..0195b91cdb39 --- /dev/null +++ b/vcl/osx/res/cursors/wshide.png diff --git a/vcl/osx/res/cursors/wsshow.png b/vcl/osx/res/cursors/wsshow.png Binary files differnew file mode 100644 index 000000000000..fe374643eb20 --- /dev/null +++ b/vcl/osx/res/cursors/wsshow.png diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx index 1dff45e2aee5..ea89aa5502ba 100644 --- a/vcl/osx/saldata.cxx +++ b/vcl/osx/saldata.cxx @@ -206,7 +206,9 @@ curs_ent{ NULL, { 0, 0 } }, //PointerStyle::Arrow { "tblselse", { 30, 30 } }, //PointerStyle::TabSelectSE { "tblselw", { 1, 16 } }, //PointerStyle::TabSelectW { "tblselsw", { 1, 30 } }, //PointerStyle::TabSelectSW -{ "pntbrsh", { 9, 16 } } //PointerStyle::Paintbrush +{ "pntbrsh", { 9, 16 } }, //PointerStyle::Paintbrush +{ "wshide", { 16, 16 } }, //PointerStyle::HideWhitespace +{ "wsshow", { 16, 16 } } //PointerStyle::ShowWhitespace }; NSCursor* SalData::getCursor( PointerStyle i_eStyle ) diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 4b47eda86841..ee6a1b892f6b 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -1797,10 +1797,17 @@ Cursor SalDisplay::GetPointer( PointerStyle ePointerStyle ) break; // #i20119# Paintbrush tool - case PointerStyle::Paintbrush : + case PointerStyle::Paintbrush: MAKE_CURSOR( paintbrush_ ); break; + case PointerStyle::HideWhitespace: + MAKE_CURSOR( hidewhitespace_ ); + break; + case PointerStyle::ShowWhitespace: + MAKE_CURSOR( showwhitespace_ ); + break; + default: OSL_FAIL("pointer not implemented"); aCur = XCreateFontCursor( pDisp_, XC_arrow ); diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index d6f71589de51..694d057fdc4a 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -474,6 +474,9 @@ GdkCursor *GtkSalDisplay::getCursor( PointerStyle ePointerStyle ) // #i20119# MAKE_CURSOR( PointerStyle::Paintbrush, paintbrush_ ); + MAKE_CURSOR( PointerStyle::HideWhitespace, hidewhitespace_ ); + MAKE_CURSOR( PointerStyle::ShowWhitespace, showwhitespace_ ); + default: SAL_WARN( "vcl.gtk", "pointer " << static_cast<int>(ePointerStyle) << "not implemented" ); break; diff --git a/vcl/win/source/src/salsrc.rc b/vcl/win/source/src/salsrc.rc index 2084bc13609f..c45935c59594 100644 --- a/vcl/win/source/src/salsrc.rc +++ b/vcl/win/source/src/salsrc.rc @@ -83,6 +83,8 @@ SAL_RESID_POINTER_TAB_SELECT_SE CURSOR tblselse.cur SAL_RESID_POINTER_TAB_SELECT_W CURSOR tblselw.cur SAL_RESID_POINTER_TAB_SELECT_SW CURSOR tblselsw.cur SAL_RESID_POINTER_PAINTBRUSH CURSOR pntbrsh.cur +SAL_RESID_POINTER_HIDEWHITESPACE CURSOR wshide.cur +SAL_RESID_POINTER_SHOWWHITESPACE CURSOR wsshow.cur SAL_RESID_BITMAP_50 BITMAP "50.bmp" diff --git a/vcl/win/source/src/wshide.cur b/vcl/win/source/src/wshide.cur Binary files differnew file mode 100644 index 000000000000..bfa8fdfdbac0 --- /dev/null +++ b/vcl/win/source/src/wshide.cur diff --git a/vcl/win/source/src/wsshow.cur b/vcl/win/source/src/wsshow.cur Binary files differnew file mode 100644 index 000000000000..e0c21060344d --- /dev/null +++ b/vcl/win/source/src/wsshow.cur diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 3a61bc2e1338..3ac3f8f3c6ec 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2156,8 +2156,10 @@ void WinSalFrame::SetPointer( PointerStyle ePointerStyle ) { 0, 0, SAL_RESID_POINTER_TAB_SELECT_SW }, // POINTER_TAB_SELECT_SW // #i20119# - { 0, 0, SAL_RESID_POINTER_PAINTBRUSH } // POINTER_PAINTBRUSH + { 0, 0, SAL_RESID_POINTER_PAINTBRUSH }, // POINTER_PAINTBRUSH + { 0, 0, SAL_RESID_POINTER_HIDEWHITESPACE }, // POINTER_HIDEWHITESPACE + { 0, 0, SAL_RESID_POINTER_SHOWWHITESPACE } // POINTER_UNHIDEWHITESPACE }; // Mousepointer loaded ? |