LibreOffice Module svtools (master) 1
Classes | Macros | Functions | Variables
ruler.cxx File Reference
#include <tools/debug.hxx>
#include <tools/poly.hxx>
#include <vcl/event.hxx>
#include <vcl/settings.hxx>
#include <vcl/vcllayout.hxx>
#include <vcl/virdev.hxx>
#include <vcl/ptrstyle.hxx>
#include <sal/log.hxx>
#include <svtools/ruler.hxx>
#include <svtools/svtresid.hxx>
#include <svtools/strings.hrc>
#include <svtools/colorcfg.hxx>
#include "accessibleruler.hxx"
#include <memory>
#include <vector>
Include dependency graph for ruler.cxx:

Go to the source code of this file.

Classes

class  ImplRulerData
 

Macros

#define RULER_OFF   3
 
#define RULER_RESIZE_OFF   4
 
#define RULER_MIN_SIZE   3
 
#define RULER_VAR_SIZE   8
 
#define RULER_UPDATE_LINES   0x01
 
#define RULER_CLIP   150
 
#define RULER_UNIT_MM   0
 
#define RULER_UNIT_CM   1
 
#define RULER_UNIT_M   2
 
#define RULER_UNIT_KM   3
 
#define RULER_UNIT_INCH   4
 
#define RULER_UNIT_FOOT   5
 
#define RULER_UNIT_MILE   6
 
#define RULER_UNIT_POINT   7
 
#define RULER_UNIT_PICA   8
 
#define RULER_UNIT_CHAR   9
 
#define RULER_UNIT_LINE   10
 
#define RULER_UNIT_COUNT   11
 

Functions

static void ImplCenterTabPos (Point &rPos, sal_uInt16 nTabStyle)
 
static void lcl_RotateRect_Impl (tools::Rectangle &rRect, const tools::Long nReference, bool bRightAligned)
 
static void ImplDrawRulerTab (vcl::RenderContext &rRenderContext, const Point &rPos, sal_uInt16 nStyle, WinBits nWinBits)
 
static int adjustSize (int nOrig)
 

Variables

const RulerUnitData aImplRulerUnitTab [RULER_UNIT_COUNT]
 
static RulerTabData ruler_tab
 

Macro Definition Documentation

◆ RULER_CLIP

#define RULER_CLIP   150

Definition at line 51 of file ruler.cxx.

◆ RULER_MIN_SIZE

#define RULER_MIN_SIZE   3

Definition at line 45 of file ruler.cxx.

◆ RULER_OFF

#define RULER_OFF   3

Definition at line 43 of file ruler.cxx.

◆ RULER_RESIZE_OFF

#define RULER_RESIZE_OFF   4

Definition at line 44 of file ruler.cxx.

◆ RULER_UNIT_CHAR

#define RULER_UNIT_CHAR   9

Definition at line 62 of file ruler.cxx.

◆ RULER_UNIT_CM

#define RULER_UNIT_CM   1

Definition at line 54 of file ruler.cxx.

◆ RULER_UNIT_COUNT

#define RULER_UNIT_COUNT   11

Definition at line 64 of file ruler.cxx.

◆ RULER_UNIT_FOOT

#define RULER_UNIT_FOOT   5

Definition at line 58 of file ruler.cxx.

◆ RULER_UNIT_INCH

#define RULER_UNIT_INCH   4

Definition at line 57 of file ruler.cxx.

◆ RULER_UNIT_KM

#define RULER_UNIT_KM   3

Definition at line 56 of file ruler.cxx.

◆ RULER_UNIT_LINE

#define RULER_UNIT_LINE   10

Definition at line 63 of file ruler.cxx.

◆ RULER_UNIT_M

#define RULER_UNIT_M   2

Definition at line 55 of file ruler.cxx.

◆ RULER_UNIT_MILE

#define RULER_UNIT_MILE   6

Definition at line 59 of file ruler.cxx.

◆ RULER_UNIT_MM

#define RULER_UNIT_MM   0

Definition at line 53 of file ruler.cxx.

◆ RULER_UNIT_PICA

#define RULER_UNIT_PICA   8

Definition at line 61 of file ruler.cxx.

◆ RULER_UNIT_POINT

#define RULER_UNIT_POINT   7

Definition at line 60 of file ruler.cxx.

◆ RULER_UPDATE_LINES

#define RULER_UPDATE_LINES   0x01

Definition at line 49 of file ruler.cxx.

◆ RULER_VAR_SIZE

#define RULER_VAR_SIZE   8

Definition at line 47 of file ruler.cxx.

Function Documentation

◆ adjustSize()

static int adjustSize ( int  nOrig)
static

Definition at line 972 of file ruler.cxx.

Referenced by Ruler::ApplySettings(), and Ruler::ImplInitSettings().

◆ ImplCenterTabPos()

static void ImplCenterTabPos ( Point rPos,
sal_uInt16  nTabStyle 
)
static

◆ ImplDrawRulerTab()

static void ImplDrawRulerTab ( vcl::RenderContext rRenderContext,
const Point rPos,
sal_uInt16  nStyle,
WinBits  nWinBits 
)
static

◆ lcl_RotateRect_Impl()

static void lcl_RotateRect_Impl ( tools::Rectangle rRect,
const tools::Long  nReference,
bool  bRightAligned 
)
static

Variable Documentation

◆ aImplRulerUnitTab

const RulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT]
Initial value:
=
{
{ MapUnit::Map100thMM, 100, 25.0, 25.0, 50.0, 100.0, " mm" },
{ MapUnit::Map100thMM, 1000, 100.0, 500.0, 1000.0, 1000.0, " cm" },
{ MapUnit::MapMM, 1000, 10.0, 250.0, 500.0, 1000.0, " m" },
{ MapUnit::MapCM, 100000, 12500.0, 25000.0, 50000.0, 100000.0, " km" },
{ MapUnit::Map1000thInch, 1000, 62.5, 125.0, 500.0, 1000.0, "\"" },
{ MapUnit::Map100thInch, 1200, 120.0, 120.0, 600.0, 1200.0, "'" },
{ MapUnit::Map10thInch, 633600, 63360.0, 63360.0, 316800.0, 633600.0, " miles" },
{ MapUnit::MapPoint, 1, 12.0, 12.0, 12.0, 36.0, " pt" },
{ MapUnit::Map100thMM, 423, 423.0, 423.0, 423.0, 846.0, " pc" },
{ MapUnit::Map100thMM, 371, 371.0, 371.0, 371.0, 743.0, " ch" },
{ MapUnit::Map100thMM, 551, 551.0, 551.0, 551.0, 1102.0, " li" }
}

Definition at line 141 of file ruler.cxx.

Referenced by Ruler::GetCurrentRulerUnit(), Ruler::ImplDrawTicks(), and Ruler::SetUnit().

◆ ruler_tab

RulerTabData ruler_tab
static
Initial value:
=
{
0,
7,
6,
2,
2,
8,
4,
4,
2,
4,
1,
5,
3,
3,
1,
5
}

Definition at line 156 of file ruler.cxx.

Referenced by ImplCenterTabPos(), Ruler::ImplDoHitTest(), ImplDrawRulerTab(), Ruler::ImplDrawTicks(), Ruler::ImplInit(), and Ruler::Ruler().