File Index Symbol Index

#include "WindowsResourceService.h"
namespace
vl
{
namespace
presentation
{
namespace
windows
{
/*********************************************************************** WindowsCursor ***********************************************************************/
WindowsCursor
::
WindowsCursor
(
HCURSOR
_handle
) :handle(
_handle
) ,isSystemCursor(
false
) ,systemCursorType(
INativeCursor
::
Arrow
) { }
WindowsCursor
::
WindowsCursor
(
SystemCursorType
type
) ,isSystemCursor(
true
) ,systemCursorType(
type
) {
switch
(
type
) {
case
SmallWaiting
:
break
;
case
LargeWaiting
:
break
;
case
Arrow
:
break
;
case
Cross
:
break
;
case
Hand
:
break
;
case
Help
:
break
;
case
IBeam
:
break
;
case
SizeAll
:
break
;
case
SizeNESW
:
break
;
case
SizeNS
:
break
;
case
SizeNWSE
:
break
;
case
SizeWE
:
break
; } }
bool
WindowsCursor
::
IsSystemCursor
() {
return
isSystemCursor
; }
INativeCursor
::
SystemCursorType
WindowsCursor
::
GetSystemCursorType
() {
return
systemCursorType
; }
HCURSOR
WindowsCursor
::
GetCursorHandle
() {
return
handle
; }
/*********************************************************************** WindowsResourceService ***********************************************************************/
WindowsResourceService
::
WindowsResourceService
() { {
systemCursors
.
Resize
(
INativeCursor
::
SystemCursorCount
);
for
(
vint
i
=
0
;
i
<
systemCursors
.
Count
();
i
++) {
systemCursors
[
i
]
=
new
WindowsCursor
((
INativeCursor
::
SystemCursorType
)
i
); } } {
NONCLIENTMETRICS
metrics
;
metrics
.
cbSize
=
sizeof
(
NONCLIENTMETRICS
);
if
(!*
metrics
.
lfMessageFont
.
lfFaceName
) {
metrics
.
cbSize
=
sizeof
(
NONCLIENTMETRICS
)-
sizeof
(
metrics
.
iPaddedBorderWidth
); }
defaultFont
.
fontFamily
=
metrics
.
lfMessageFont
.
lfFaceName
;
defaultFont
.
size
=
metrics
.
lfMessageFont
.
lfHeight
;
if
(
defaultFont
.
size
<
0
) {
defaultFont
.
size
=-
defaultFont
.
size
; } } }
INativeCursor
*
WindowsResourceService
::
GetSystemCursor
(
INativeCursor
::
SystemCursorType
type
) {
vint
index
=(
vint
)
type
;
if
(
0
<=
index
&&
index
<
systemCursors
.
Count
()) {
return
systemCursors
[
index
].
Obj
(); }
else
{
return
0
; } }
INativeCursor
*
WindowsResourceService
::
GetDefaultSystemCursor
() {
return
GetSystemCursor
(
INativeCursor
::
Arrow
); }
FontProperties
WindowsResourceService
::
GetDefaultFont
() {
return
defaultFont
; }
void
WindowsResourceService
::
SetDefaultFont
(
const
FontProperties
&
value
) {
defaultFont
=
value
; } } } }