LibreOffice Module vcl (master) 1
imivctl2.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include "imivctl.hxx"
21#include <sal/log.hxx>
22
24{
25 pView = pOwner;
26 pCurEntry = nullptr;
27 nDeltaWidth = 0;
28 nDeltaHeight= 0;
29 nCols = 0;
30 nRows = 0;
31}
32
34{
35}
36
38 bool bVertical )
39{
40 sal_uInt16 nCount = rList.size();
41 if( !nCount )
42 return 0;
43
44 sal_uInt16 nCurPos = 0;
45 tools::Long nPrevValue = LONG_MIN;
46 while( nCount )
47 {
48 const tools::Rectangle& rRect = pView->GetEntryBoundRect( rList[nCurPos] );
49 tools::Long nCurValue;
50 if( bVertical )
51 nCurValue = rRect.Top();
52 else
53 nCurValue = rRect.Left();
54 if( nValue >= nPrevValue && nValue <= nCurValue )
55 return nCurPos;
56 nPrevValue = nCurValue;
57 nCount--;
58 nCurPos++;
59 }
60 return rList.size();
61}
62
64{
66 DBG_ASSERT(xColumns==nullptr&&xRows==nullptr,"ImplCreate: Not cleared");
67
68 SetDeltas();
69
70 xColumns.reset(new IconChoiceMap);
71 xRows.reset(new IconChoiceMap);
72
73 size_t nCount = pView->maEntries.size();
74 for( size_t nCur = 0; nCur < nCount; nCur++ )
75 {
76 SvxIconChoiceCtrlEntry* pEntry = pView->maEntries[ nCur ].get();
77 // const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
78 tools::Rectangle rRect( pView->CalcBmpRect( pEntry ) );
79 short nY = static_cast<short>( ((rRect.Top()+rRect.Bottom())/2) / nDeltaHeight );
80 short nX = static_cast<short>( ((rRect.Left()+rRect.Right())/2) / nDeltaWidth );
81
82 // capture rounding errors
83 if( nY >= nRows )
84 nY = sal::static_int_cast< short >(nRows - 1);
85 if( nX >= nCols )
86 nX = sal::static_int_cast< short >(nCols - 1);
87
88 SvxIconChoiceCtrlEntryPtrVec& rColEntry = (*xColumns)[nX];
89 sal_uInt16 nIns = GetSortListPos( rColEntry, rRect.Top(), true );
90 rColEntry.insert( rColEntry.begin() + nIns, pEntry );
91
92 SvxIconChoiceCtrlEntryPtrVec& rRowEntry = (*xRows)[nY];
93 nIns = GetSortListPos( rRowEntry, rRect.Left(), false );
94 rRowEntry.insert( rRowEntry.begin() + nIns, pEntry );
95
96 pEntry->nX = nX;
97 pEntry->nY = nY;
98 }
99}
100
101
103{
104 if( xColumns )
105 {
106 xColumns.reset();
107 xRows.reset();
108 pCurEntry = nullptr;
109 nDeltaWidth = 0;
110 nDeltaHeight = 0;
111 }
112}
113
114SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol, sal_uInt16 nTop, sal_uInt16 nBottom,
115 bool bDown, bool bSimple )
116{
117 DBG_ASSERT(pCurEntry, "SearchCol: No reference entry");
118 IconChoiceMap::iterator mapIt = xColumns->find( nCol );
119 if ( mapIt == xColumns->end() )
120 return nullptr;
121 SvxIconChoiceCtrlEntryPtrVec const & rList = mapIt->second;
122 const sal_uInt16 nCount = rList.size();
123 if( !nCount )
124 return nullptr;
125
127
128 if( bSimple )
129 {
130 SvxIconChoiceCtrlEntryPtrVec::const_iterator it = std::find( rList.begin(), rList.end(), pCurEntry );
131
132 assert(it != rList.end()); //Entry not in Col-List
133 if (it == rList.end())
134 return nullptr;
135
136 if( bDown )
137 {
138 while( ++it != rList.end() )
139 {
140 SvxIconChoiceCtrlEntry* pEntry = *it;
141 const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
142 if( rRect.Top() > rRefRect.Top() )
143 return pEntry;
144 }
145 return nullptr;
146 }
147 else
148 {
149 SvxIconChoiceCtrlEntryPtrVec::const_reverse_iterator it2(it);
150 while (it2 != rList.rend())
151 {
152 SvxIconChoiceCtrlEntry* pEntry = *it2;
153 const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
154 if( rRect.Top() < rRefRect.Top() )
155 return pEntry;
156 ++it2;
157 }
158 return nullptr;
159 }
160 }
161
162 if( nTop > nBottom )
163 std::swap(nTop, nBottom);
164
165 tools::Long nMinDistance = LONG_MAX;
166 SvxIconChoiceCtrlEntry* pResult = nullptr;
167 for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
168 {
169 SvxIconChoiceCtrlEntry* pEntry = rList[ nCur ];
170 if( pEntry != pCurEntry )
171 {
172 sal_uInt16 nY = pEntry->nY;
173 if( nY >= nTop && nY <= nBottom )
174 {
175 const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
176 tools::Long nDistance = rRect.Top() - rRefRect.Top();
177 if( nDistance < 0 )
178 nDistance *= -1;
179 if( nDistance && nDistance < nMinDistance )
180 {
181 nMinDistance = nDistance;
182 pResult = pEntry;
183 }
184 }
185 }
186 }
187 return pResult;
188}
189
190SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow, sal_uInt16 nLeft, sal_uInt16 nRight,
191 bool bRight, bool bSimple )
192{
193 DBG_ASSERT(pCurEntry,"SearchRow: No reference entry");
194 IconChoiceMap::iterator mapIt = xRows->find( nRow );
195 if ( mapIt == xRows->end() )
196 return nullptr;
197 SvxIconChoiceCtrlEntryPtrVec const & rList = mapIt->second;
198 const sal_uInt16 nCount = rList.size();
199 if( !nCount )
200 return nullptr;
201
203
204 if( bSimple )
205 {
206 SvxIconChoiceCtrlEntryPtrVec::const_iterator it = std::find( rList.begin(), rList.end(), pCurEntry );
207
208 assert(it != rList.end()); //Entry not in Row-List
209 if (it == rList.end())
210 return nullptr;
211
212 if( bRight )
213 {
214 while( ++it != rList.end() )
215 {
216 SvxIconChoiceCtrlEntry* pEntry = *it;
217 const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
218 if( rRect.Left() > rRefRect.Left() )
219 return pEntry;
220 }
221 return nullptr;
222 }
223 else
224 {
225 SvxIconChoiceCtrlEntryPtrVec::const_reverse_iterator it2(it);
226 while (it2 != rList.rend())
227 {
228 SvxIconChoiceCtrlEntry* pEntry = *it2;
229 const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
230 if( rRect.Left() < rRefRect.Left() )
231 return pEntry;
232 ++it2;
233 }
234 return nullptr;
235 }
236
237 }
238 if( nRight < nLeft )
239 std::swap(nRight, nLeft);
240
241 tools::Long nMinDistance = LONG_MAX;
242 SvxIconChoiceCtrlEntry* pResult = nullptr;
243 for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
244 {
245 SvxIconChoiceCtrlEntry* pEntry = rList[ nCur ];
246 if( pEntry != pCurEntry )
247 {
248 sal_uInt16 nX = pEntry->nX;
249 if( nX >= nLeft && nX <= nRight )
250 {
251 const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
252 tools::Long nDistance = rRect.Left() - rRefRect.Left();
253 if( nDistance < 0 )
254 nDistance *= -1;
255 if( nDistance && nDistance < nMinDistance )
256 {
257 nMinDistance = nDistance;
258 pResult = pEntry;
259 }
260 }
261 }
262 }
263 return pResult;
264}
265
266
267/*
268 Searches, starting from the passed value, the next entry to the left/to the
269 right. Example for bRight = sal_True:
270
271 c
272 b c
273 a b c
274 S 1 1 1 ====> search direction
275 a b c
276 b c
277 c
278
279 S : starting position
280 1 : first searched rectangle
281 a,b,c : 2nd, 3rd, 4th searched rectangle
282*/
283
285{
286 SvxIconChoiceCtrlEntry* pResult;
287 pCurEntry = pCtrlEntry;
288 Create();
289 sal_uInt16 nY = pCtrlEntry->nY;
290 sal_uInt16 nX = pCtrlEntry->nX;
291 DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column");
292 DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row");
293 // neighbor in same row?
294 if( bRight )
295 pResult = SearchRow(
296 nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), true, true );
297 else
298 pResult = SearchRow( nY, 0, nX, false, true );
299 if( pResult )
300 return pResult;
301
302 tools::Long nCurCol = nX;
303
304 tools::Long nColOffs, nLastCol;
305 if( bRight )
306 {
307 nColOffs = 1;
308 nLastCol = nCols;
309 }
310 else
311 {
312 nColOffs = -1;
313 nLastCol = -1; // 0-1
314 }
315
316 sal_uInt16 nRowMin = nY;
317 sal_uInt16 nRowMax = nY;
318 do
319 {
320 SvxIconChoiceCtrlEntry* pEntry = SearchCol(static_cast<sal_uInt16>(nCurCol), nRowMin, nRowMax, true, false);
321 if( pEntry )
322 return pEntry;
323 if( nRowMin )
324 nRowMin--;
325 if( nRowMax < (nRows-1))
326 nRowMax++;
327 nCurCol += nColOffs;
328 } while( nCurCol != nLastCol );
329 return nullptr;
330}
331
333{
335 {
336 const tools::Long nPos = static_cast<tools::Long>(pView->GetEntryListPos( pStart ));
337 tools::Long nEntriesInView = pView->aOutputSize.Height() / pView->nGridDY;
338 nEntriesInView *=
340 tools::Long nNewPos = nPos;
341 if( bDown )
342 {
343 nNewPos += nEntriesInView;
344 if( nNewPos >= static_cast<tools::Long>(pView->maEntries.size()) )
345 nNewPos = pView->maEntries.size() - 1;
346 }
347 else
348 {
349 nNewPos -= nEntriesInView;
350 if( nNewPos < 0 )
351 nNewPos = 0;
352 }
353 if( nPos != nNewPos )
354 return pView->maEntries[ static_cast<size_t>(nNewPos) ].get();
355 return nullptr;
356 }
357 tools::Long nOpt = pView->GetEntryBoundRect( pStart ).Top();
358 if( bDown )
359 {
360 nOpt += pView->aOutputSize.Height();
361 nOpt -= pView->nGridDY;
362 }
363 else
364 {
365 nOpt -= pView->aOutputSize.Height();
366 nOpt += pView->nGridDY;
367 }
368 if( nOpt < 0 )
369 nOpt = 0;
370
371 tools::Long nPrevErr = LONG_MAX;
372
373 SvxIconChoiceCtrlEntry* pPrev = pStart;
374 SvxIconChoiceCtrlEntry* pNext = GoUpDown( pStart, bDown );
375 while( pNext )
376 {
377 tools::Long nCur = pView->GetEntryBoundRect( pNext ).Top();
378 tools::Long nErr = nOpt - nCur;
379 if( nErr < 0 )
380 nErr *= -1;
381 if( nErr > nPrevErr )
382 return pPrev;
383 nPrevErr = nErr;
384 pPrev = pNext;
385 pNext = GoUpDown( pNext, bDown );
386 }
387 if( pPrev != pStart )
388 return pPrev;
389 return nullptr;
390}
391
393{
395 {
396 sal_uLong nPos = pView->GetEntryListPos( pCtrlEntry );
397 if( bDown && nPos < (pView->maEntries.size() - 1) )
398 return pView->maEntries[ nPos + 1 ].get();
399 else if( !bDown && nPos > 0 )
400 return pView->maEntries[ nPos - 1 ].get();
401 return nullptr;
402 }
403
404 SvxIconChoiceCtrlEntry* pResult;
405 pCurEntry = pCtrlEntry;
406 Create();
407 sal_uInt16 nY = pCtrlEntry->nY;
408 sal_uInt16 nX = pCtrlEntry->nX;
409 DBG_ASSERT(nY<nRows,"GoUpDown:Bad column");
410 DBG_ASSERT(nX<nCols,"GoUpDown:Bad row");
411
412 // neighbor in same column?
413 if( bDown )
414 pResult = SearchCol(
415 nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), true, true );
416 else
417 pResult = SearchCol( nX, 0, nY, false, true );
418 if( pResult )
419 return pResult;
420
421 tools::Long nCurRow = nY;
422
423 tools::Long nRowOffs, nLastRow;
424 if( bDown )
425 {
426 nRowOffs = 1;
427 nLastRow = nRows;
428 }
429 else
430 {
431 nRowOffs = -1;
432 nLastRow = -1; // 0-1
433 }
434
435 sal_uInt16 nColMin = nX;
436 sal_uInt16 nColMax = nX;
437 do
438 {
439 SvxIconChoiceCtrlEntry* pEntry = SearchRow(static_cast<sal_uInt16>(nCurRow), nColMin, nColMax, true, false);
440 if( pEntry )
441 return pEntry;
442 if( nColMin )
443 nColMin--;
444 if( nColMax < (nCols-1))
445 nColMax++;
446 nCurRow += nRowOffs;
447 } while( nCurRow != nLastRow );
448 return nullptr;
449}
450
452{
453 const Size& rSize = pView->aVirtOutputSize;
454 nCols = rSize.Width() / pView->nGridDX;
455 if( !nCols )
456 nCols = 1;
457 nRows = rSize.Height() / pView->nGridDY;
458 if( (nRows * pView->nGridDY) < rSize.Height() )
459 nRows++;
460 if( !nRows )
461 nRows = 1;
462
463 nDeltaWidth = static_cast<short>(rSize.Width() / nCols);
464 nDeltaHeight = static_cast<short>(rSize.Height() / nRows);
465 if( !nDeltaHeight )
466 {
467 nDeltaHeight = 1;
468 SAL_INFO("vcl", "SetDeltas:Bad height");
469 }
470 if( !nDeltaWidth )
471 {
472 nDeltaWidth = 1;
473 SAL_INFO("vcl", "SetDeltas:Bad width");
474 }
475}
476
478 : _pView(pView), _nGridCols(0), _nGridRows(0)
479{
480}
481
483{
484}
485
487{
488 if( !_pGridMap )
489 Create_Impl();
490 else
491 {
492 sal_uInt16 nNewGridRows = _nGridRows;
493 sal_uInt16 nNewGridCols = _nGridCols;
495 nNewGridRows += 50;
496 else
497 nNewGridCols += 50;
498
499 size_t nNewCellCount = static_cast<size_t>(nNewGridRows) * nNewGridCols;
500 bool* pNewGridMap = new bool[nNewCellCount];
501 size_t nOldCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
502 memcpy(pNewGridMap, _pGridMap.get(), nOldCellCount * sizeof(bool));
503 memset(pNewGridMap + nOldCellCount, 0, (nNewCellCount-nOldCellCount) * sizeof(bool));
504 _pGridMap.reset( pNewGridMap );
505 _nGridRows = nNewGridRows;
506 _nGridCols = nNewGridCols;
507 }
508}
509
511{
512 DBG_ASSERT(!_pGridMap,"Unnecessary call to IcnGridMap_Impl::Create_Impl()");
513 if( _pGridMap )
514 return;
517 _nGridRows += 50; // avoid resize of gridmap too often
518 else
519 _nGridCols += 50;
520
521 size_t nCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
522 _pGridMap.reset( new bool[nCellCount] );
523 memset(_pGridMap.get(), 0, nCellCount * sizeof(bool));
524
525 const size_t nCount = _pView->maEntries.size();
526 for( size_t nCur=0; nCur < nCount; nCur++ )
527 OccupyGrids( _pView->maEntries[ nCur ].get() );
528}
529
530void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const
531{
532 tools::Long nX, nY;
534 {
535 // The view grows in vertical direction. Its max. width is _pView->nMaxVirtWidth
536 nX = _pView->nMaxVirtWidth;
537 if( !nX )
540 nX -= _pView->nVerSBarWidth;
541
543 }
544 else
545 {
546 // The view grows in horizontal direction. Its max. height is _pView->nMaxVirtHeight
548 if( !nY )
551 nY -= _pView->nHorSBarHeight;
553 }
554
555 if( !nX )
557 if( !nY )
559
560 tools::Long nDX = nX / _pView->nGridDX;
561 tools::Long nDY = nY / _pView->nGridDY;
562
563 if( !nDX )
564 nDX++;
565 if( !nDY )
566 nDY++;
567
568 rDX = static_cast<sal_uInt16>(nDX);
569 rDY = static_cast<sal_uInt16>(nDY);
570}
571
572GridId IcnGridMap_Impl::GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY )
573{
574 Create();
576 return nGridX + ( static_cast<GridId>(nGridY) * _nGridCols );
577 else
578 return nGridY + ( static_cast<GridId>(nGridX) * _nGridRows );
579}
580
582{
583 Create();
584
585 tools::Long nX = rDocPos.X();
586 tools::Long nY = rDocPos.Y();
587 nX -= LROFFS_WINBORDER;
588 nY -= TBOFFS_WINBORDER;
589 nX /= _pView->nGridDX;
590 nY /= _pView->nGridDY;
591 if( nX >= _nGridCols )
592 {
593 nX = _nGridCols - 1;
594 }
595 if( nY >= _nGridRows )
596 {
597 nY = _nGridRows - 1;
598 }
599 GridId nId = GetGrid( static_cast<sal_uInt16>(nX), static_cast<sal_uInt16>(nY) );
601 return nId;
602}
603
605{
606 Create();
607 sal_uInt16 nGridX, nGridY;
608 GetGridCoord( nId, nGridX, nGridY );
609 const tools::Long nLeft = nGridX * _pView->nGridDX+ LROFFS_WINBORDER;
610 const tools::Long nTop = nGridY * _pView->nGridDY + TBOFFS_WINBORDER;
611 return tools::Rectangle(
612 nLeft, nTop,
613 nLeft + _pView->nGridDX,
614 nTop + _pView->nGridDY );
615}
616
618{
619 Create();
620 sal_uLong nStart = 0;
621 bool bExpanded = false;
622
623 while( true )
624 {
625 const sal_uLong nCount = static_cast<sal_uInt16>(_nGridCols * _nGridRows);
626 for( sal_uLong nCur = nStart; nCur < nCount; nCur++ )
627 {
628 if( !_pGridMap[ nCur ] )
629 {
630 _pGridMap[ nCur ] = true;
631 return static_cast<GridId>(nCur);
632 }
633 }
634 DBG_ASSERT(!bExpanded,"ExpandGrid failed");
635 if( bExpanded )
636 return 0; // prevent never ending loop
637 bExpanded = true;
638 Expand();
639 nStart = nCount;
640 }
641}
642
643// An entry only means that there's a GridRect lying under its center. This
644// variant is much faster than allocating via the bounding rectangle but can
645// lead to small overlaps.
647{
649 return;
650 OccupyGrid( GetGrid( pEntry->aRect.Center()) );
651}
652
654{
655 if( _pGridMap )
656 {
657 _pGridMap.reset();
658 _nGridRows = 0;
659 _nGridCols = 0;
661 }
662}
663
664sal_uLong IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, sal_uInt16 nDX, sal_uInt16 nDY)
665{
666 tools::Long ndx = (rSizePixel.Width() - LROFFS_WINBORDER) / nDX;
667 if( ndx < 0 ) ndx *= -1;
668 tools::Long ndy = (rSizePixel.Height() - TBOFFS_WINBORDER) / nDY;
669 if( ndy < 0 ) ndy *= -1;
670 return static_cast<sal_uLong>(ndx * ndy);
671}
672
674{
675 if( !_pGridMap )
676 return;
677
678 sal_uInt16 nCols, nRows;
679 GetMinMapSize( nCols, nRows );
681 {
682 if( nCols != _nGridCols )
683 Clear();
684 else if( nRows >= _nGridRows )
685 Expand();
686 }
687 else
688 {
689 if( nRows != _nGridRows )
690 Clear();
691 else if( nCols >= _nGridCols )
692 Expand();
693 }
694}
695
696// Independently of the view's alignment (TOP or LEFT), the gridmap
697// should contain the data in a continuous region, to make it possible
698// to copy the whole block if the gridmap needs to be expanded.
699void IcnGridMap_Impl::GetGridCoord( GridId nId, sal_uInt16& rGridX, sal_uInt16& rGridY )
700{
701 Create();
703 {
704 rGridX = static_cast<sal_uInt16>(nId % _nGridCols);
705 rGridY = static_cast<sal_uInt16>(nId / _nGridCols);
706 }
707 else
708 {
709 rGridX = static_cast<sal_uInt16>(nId / _nGridRows);
710 rGridY = static_cast<sal_uInt16>(nId % _nGridRows);
711 }
712}
713
714
715/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetSortListPos(SvxIconChoiceCtrlEntryPtrVec &rList, tools::Long nValue, bool bVertical)
Definition: imivctl2.cxx:37
SvxIconChoiceCtrlEntry * pCurEntry
Definition: imivctl.hxx:432
SvxIconChoiceCtrlEntry * GoPageUpDown(SvxIconChoiceCtrlEntry *, bool bDown)
Definition: imivctl2.cxx:332
void ImplCreate()
Definition: imivctl2.cxx:63
SvxIconChoiceCtrlEntry * SearchCol(sal_uInt16 nCol, sal_uInt16 nTop, sal_uInt16 nBottom, bool bDown, bool bSimple)
Definition: imivctl2.cxx:114
short nDeltaHeight
Definition: imivctl.hxx:431
tools::Long nRows
Definition: imivctl.hxx:429
short nDeltaWidth
Definition: imivctl.hxx:430
SvxIconChoiceCtrl_Impl * pView
Definition: imivctl.hxx:425
SvxIconChoiceCtrlEntry * SearchRow(sal_uInt16 nRow, sal_uInt16 nLeft, sal_uInt16 nRight, bool bRight, bool bSimple)
Definition: imivctl2.cxx:190
void SetDeltas()
Definition: imivctl2.cxx:451
std::unique_ptr< IconChoiceMap > xRows
Definition: imivctl.hxx:427
void Create()
Definition: imivctl.hxx:435
tools::Long nCols
Definition: imivctl.hxx:428
SvxIconChoiceCtrlEntry * GoLeftRight(SvxIconChoiceCtrlEntry *, bool bRight)
Definition: imivctl2.cxx:284
std::unique_ptr< IconChoiceMap > xColumns
Definition: imivctl.hxx:426
SvxIconChoiceCtrlEntry * GoUpDown(SvxIconChoiceCtrlEntry *, bool bDown)
Definition: imivctl2.cxx:392
IcnCursor_Impl(SvxIconChoiceCtrl_Impl *pOwner)
Definition: imivctl2.cxx:23
static sal_uLong GetGridCount(const Size &rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight)
Definition: imivctl2.cxx:664
void OccupyGrid(GridId nId)
Definition: imivctl.hxx:492
void OccupyGrids(const SvxIconChoiceCtrlEntry *)
Definition: imivctl2.cxx:646
void Create_Impl()
Definition: imivctl2.cxx:510
IcnGridMap_Impl(SvxIconChoiceCtrl_Impl *pView)
Definition: imivctl2.cxx:477
GridId GetGrid(const Point &rDocPos)
Definition: imivctl2.cxx:581
tools::Rectangle GetGridRect(GridId)
Definition: imivctl2.cxx:604
GridId GetUnoccupiedGrid()
Definition: imivctl2.cxx:617
void GetGridCoord(GridId, sal_uInt16 &rGridX, sal_uInt16 &rGridY)
Definition: imivctl2.cxx:699
SvxIconChoiceCtrl_Impl * _pView
Definition: imivctl.hxx:471
void OutputSizeChanged()
Definition: imivctl2.cxx:673
tools::Rectangle _aLastOccupiedGrid
Definition: imivctl.hxx:470
std::unique_ptr< bool[]> _pGridMap
Definition: imivctl.hxx:472
sal_uInt16 _nGridCols
Definition: imivctl.hxx:473
void GetMinMapSize(sal_uInt16 &rDX, sal_uInt16 &rDY) const
Definition: imivctl2.cxx:530
sal_uInt16 _nGridRows
Definition: imivctl.hxx:473
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
tools::Rectangle aRect
Definition: ivctrl.hxx:73
VclPtr< SvtIconChoiceCtrl > pView
Definition: imivctl.hxx:130
tools::Long nMaxVirtHeight
Definition: imivctl.hxx:134
const tools::Rectangle & GetEntryBoundRect(SvxIconChoiceCtrlEntry *)
Definition: imivctl1.cxx:1566
bool IsAutoArrange() const
Definition: imivctl.hxx:231
tools::Long nVerSBarWidth
Definition: imivctl.hxx:253
tools::Rectangle CalcBmpRect(SvxIconChoiceCtrlEntry *, const Point *pPos=nullptr)
Definition: imivctl1.cxx:1573
std::vector< std::unique_ptr< SvxIconChoiceCtrlEntry > > maEntries
Definition: imivctl.hxx:116
tools::Long nHorSBarHeight
Definition: imivctl.hxx:252
tools::Long nMaxVirtWidth
Definition: imivctl.hxx:133
tools::Long nGridDX
Definition: imivctl.hxx:250
static bool IsBoundingRectValid(const tools::Rectangle &rRect)
Definition: imivctl.hxx:341
tools::Long nGridDY
Definition: imivctl.hxx:251
sal_Int32 GetEntryListPos(SvxIconChoiceCtrlEntry const *) const
Definition: imivctl1.cxx:2598
IconChoiceFlags nFlags
Definition: imivctl.hxx:139
constexpr Point Center() const
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
Size GetOutputSizePixel() const
Definition: window3.cxx:89
int nCount
#define DBG_ASSERT(sCon, aError)
sal_Int16 nValue
sal_uLong GridId
Definition: imivctl.hxx:101
#define DEFAULT_MAX_VIRT_WIDTH
Definition: imivctl.hxx:79
#define DEFAULT_MAX_VIRT_HEIGHT
Definition: imivctl.hxx:80
#define TBOFFS_WINBORDER
Definition: imivctl.hxx:69
std::vector< SvxIconChoiceCtrlEntry * > SvxIconChoiceCtrlEntryPtrVec
Definition: imivctl.hxx:109
std::map< sal_uInt16, SvxIconChoiceCtrlEntryPtrVec > IconChoiceMap
Definition: imivctl.hxx:421
#define LROFFS_WINBORDER
Definition: imivctl.hxx:68
#define WB_ALIGN_TOP
Definition: ivctrl.hxx:169
SvLinkSource * pOwner
sal_uInt16 nPos
const long LONG_MAX
#define SAL_INFO(area, stream)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
sal_Int16 nId
sal_uIntPtr sal_uLong