Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
4b1b17f4
Kaydet (Commit)
4b1b17f4
authored
Eki 12, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert IDET flags to typed_flags
Change-Id: Iaaea3b3693ab4c67a60e48e7de8865413e8e246b
üst
7adac063
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
44 deletions
+52
-44
IdleDetection.hxx
sd/source/ui/inc/tools/IdleDetection.hxx
+35
-27
MasterPageContainerQueue.cxx
sd/source/ui/sidebar/MasterPageContainerQueue.cxx
+3
-3
SlsViewCacheContext.cxx
sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
+2
-2
IdleDetection.cxx
sd/source/ui/tools/IdleDetection.cxx
+12
-12
No files found.
sd/source/ui/inc/tools/IdleDetection.hxx
Dosyayı görüntüle @
4b1b17f4
...
@@ -21,9 +21,39 @@
...
@@ -21,9 +21,39 @@
#define INCLUDED_SD_SOURCE_UI_INC_TOOLS_IDLEDETECTION_HXX
#define INCLUDED_SD_SOURCE_UI_INC_TOOLS_IDLEDETECTION_HXX
#include <sal/types.h>
#include <sal/types.h>
#include <o3tl/typed_flags_set.hxx>
namespace
vcl
{
class
Window
;
}
namespace
vcl
{
class
Window
;
}
namespace
sd
{
namespace
tools
{
enum
class
IdleState
{
/** When GetIdleState() returns this value, then the system is idle.
*/
Idle
=
0x0000
,
/** There are system event pending.
*/
SystemEventPending
=
0x0001
,
/** A full screen slide show is running and is active. In contrast
there may be a full screen show be running in an inactive window,
i.e. in the background.
*/
FullScreenShowActive
=
0x0002
,
/** A slide show is running in a window.
*/
WindowShowActive
=
0x0004
,
/** A window is being painted.
*/
WindowPainting
=
0x0008
,
};
}
}
// end of namespace ::sd::tools
namespace
o3tl
{
template
<>
struct
typed_flags
<::
sd
::
tools
::
IdleState
>
:
is_typed_flags
<::
sd
::
tools
::
IdleState
,
0x0f
>
{};
}
namespace
sd
{
namespace
tools
{
namespace
sd
{
namespace
tools
{
/** Detect whether the system is idle and some time consuming operation may
/** Detect whether the system is idle and some time consuming operation may
...
@@ -33,49 +63,27 @@ namespace sd { namespace tools {
...
@@ -33,49 +63,27 @@ namespace sd { namespace tools {
class
IdleDetection
class
IdleDetection
{
{
public
:
public
:
/** When GetIdleState() returns this value, then the system is idle.
*/
static
const
sal_Int32
IDET_IDLE
=
0x0000
;
/** There are system event pending.
*/
static
const
sal_Int32
IDET_SYSTEM_EVENT_PENDING
=
0x0001
;
/** A full screen slide show is running and is active. In contrast
there may be a full screen show be running in an inactive window,
i.e. in the background.
*/
static
const
sal_Int32
IDET_FULL_SCREEN_SHOW_ACTIVE
=
0x0002
;
/** A slide show is running in a window.
*/
static
const
sal_Int32
IDET_WINDOW_SHOW_ACTIVE
=
0x0004
;
/** A window is being painted.
*/
static
const
sal_Int32
IDET_WINDOW_PAINTING
=
0x0008
;
/** Determine whether the system is idle.
/** Determine whether the system is idle.
@param pWindow
@param pWindow
When a valid Window pointer is given then it is checked
When a valid Window pointer is given then it is checked
whether the window is currently being painting.
whether the window is currently being painting.
@return
@return
This method either returns I
DET_IDLE
or a combination of
This method either returns I
dleState::Idle
or a combination of
IdleStates values or-ed together that describe what the system
IdleStates values or-ed together that describe what the system
is currently doing so that the caller can decide what to do.
is currently doing so that the caller can decide what to do.
*/
*/
static
sal_Int32
GetIdleState
(
const
vcl
::
Window
*
pWindow
);
static
IdleState
GetIdleState
(
const
vcl
::
Window
*
pWindow
);
private
:
private
:
/** Check whether there are input events pending.
/** Check whether there are input events pending.
*/
*/
static
sal_Int32
CheckInputPending
();
static
IdleState
CheckInputPending
();
/** Check whether a slide show is running full screen or in a window.
/** Check whether a slide show is running full screen or in a window.
*/
*/
static
sal_Int32
CheckSlideShowRunning
();
static
IdleState
CheckSlideShowRunning
();
static
sal_Int32
CheckWindowPainting
(
const
vcl
::
Window
&
rWindow
);
static
IdleState
CheckWindowPainting
(
const
vcl
::
Window
&
rWindow
);
};
};
}
}
// end of namespace ::sd::tools
}
}
// end of namespace ::sd::tools
...
...
sd/source/ui/sidebar/MasterPageContainerQueue.cxx
Dosyayı görüntüle @
4b1b17f4
...
@@ -187,10 +187,10 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer, void
...
@@ -187,10 +187,10 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer, void
break
;
break
;
// First check whether the system is idle.
// First check whether the system is idle.
sal_Int32
nIdleState
(
tools
::
IdleDetection
::
GetIdleState
(
nullptr
));
tools
::
IdleState
nIdleState
(
tools
::
IdleDetection
::
GetIdleState
(
nullptr
));
if
(
nIdleState
!=
tools
::
Idle
Detection
::
IDET_IDLE
)
if
(
nIdleState
!=
tools
::
Idle
State
::
Idle
)
{
{
if
(
(
nIdleState
&
tools
::
IdleDetection
::
IDET_FULL_SCREEN_SHOW_ACTIVE
)
!=
0
)
if
(
nIdleState
&
tools
::
IdleState
::
FullScreenShowActive
)
bIsShowingFullScreenShow
=
true
;
bIsShowingFullScreenShow
=
true
;
break
;
break
;
}
}
...
...
sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
Dosyayı görüntüle @
4b1b17f4
...
@@ -65,8 +65,8 @@ void ViewCacheContext::NotifyPreviewCreation (
...
@@ -65,8 +65,8 @@ void ViewCacheContext::NotifyPreviewCreation (
bool
ViewCacheContext
::
IsIdle
()
bool
ViewCacheContext
::
IsIdle
()
{
{
sal_Int32
nIdleState
(
tools
::
IdleDetection
::
GetIdleState
(
mrSlideSorter
.
GetContentWindow
()));
tools
::
IdleState
nIdleState
(
tools
::
IdleDetection
::
GetIdleState
(
mrSlideSorter
.
GetContentWindow
()));
if
(
nIdleState
==
tools
::
Idle
Detection
::
IDET_IDLE
)
if
(
nIdleState
==
tools
::
Idle
State
::
Idle
)
return
true
;
return
true
;
else
else
return
false
;
return
false
;
...
...
sd/source/ui/tools/IdleDetection.cxx
Dosyayı görüntüle @
4b1b17f4
...
@@ -33,25 +33,25 @@ using namespace ::com::sun::star;
...
@@ -33,25 +33,25 @@ using namespace ::com::sun::star;
namespace
sd
{
namespace
tools
{
namespace
sd
{
namespace
tools
{
sal_Int32
IdleDetection
::
GetIdleState
(
const
vcl
::
Window
*
pWindow
)
IdleState
IdleDetection
::
GetIdleState
(
const
vcl
::
Window
*
pWindow
)
{
{
sal_Int32
nResult
(
CheckInputPending
()
|
CheckSlideShowRunning
());
IdleState
nResult
(
CheckInputPending
()
|
CheckSlideShowRunning
());
if
(
pWindow
!=
nullptr
)
if
(
pWindow
!=
nullptr
)
nResult
|=
CheckWindowPainting
(
*
pWindow
);
nResult
|=
CheckWindowPainting
(
*
pWindow
);
return
nResult
;
return
nResult
;
}
}
sal_Int32
IdleDetection
::
CheckInputPending
()
IdleState
IdleDetection
::
CheckInputPending
()
{
{
if
(
Application
::
AnyInput
(
VclInputFlags
::
MOUSE
|
VclInputFlags
::
KEYBOARD
|
VclInputFlags
::
PAINT
))
if
(
Application
::
AnyInput
(
VclInputFlags
::
MOUSE
|
VclInputFlags
::
KEYBOARD
|
VclInputFlags
::
PAINT
))
return
I
DET_SYSTEM_EVENT_PENDING
;
return
I
dleState
::
SystemEventPending
;
else
else
return
I
DET_IDLE
;
return
I
dleState
::
Idle
;
}
}
sal_Int32
IdleDetection
::
CheckSlideShowRunning
()
IdleState
IdleDetection
::
CheckSlideShowRunning
()
{
{
sal_Int32
eResult
(
IDET_IDLE
);
IdleState
eResult
(
IdleState
::
Idle
);
bool
bIsSlideShowShowing
=
false
;
bool
bIsSlideShowShowing
=
false
;
...
@@ -83,9 +83,9 @@ sal_Int32 IdleDetection::CheckSlideShowRunning()
...
@@ -83,9 +83,9 @@ sal_Int32 IdleDetection::CheckSlideShowRunning()
if
(
xSlideShow
.
is
()
&&
xSlideShow
->
isRunning
()
)
if
(
xSlideShow
.
is
()
&&
xSlideShow
->
isRunning
()
)
{
{
if
(
xSlideShow
->
isFullScreen
())
if
(
xSlideShow
->
isFullScreen
())
eResult
|=
I
DET_FULL_SCREEN_SHOW_ACTIVE
;
eResult
|=
I
dleState
::
FullScreenShowActive
;
else
else
eResult
|=
I
DET_WINDOW_SHOW_ACTIVE
;
eResult
|=
I
dleState
::
WindowShowActive
;
}
}
}
}
}
}
...
@@ -93,12 +93,12 @@ sal_Int32 IdleDetection::CheckSlideShowRunning()
...
@@ -93,12 +93,12 @@ sal_Int32 IdleDetection::CheckSlideShowRunning()
return
eResult
;
return
eResult
;
}
}
sal_Int32
IdleDetection
::
CheckWindowPainting
(
const
vcl
::
Window
&
rWindow
)
IdleState
IdleDetection
::
CheckWindowPainting
(
const
vcl
::
Window
&
rWindow
)
{
{
if
(
rWindow
.
IsInPaint
())
if
(
rWindow
.
IsInPaint
())
return
I
DET_WINDOW_PAINTING
;
return
I
dleState
::
WindowPainting
;
else
else
return
I
DET_IDLE
;
return
I
dleState
::
Idle
;
}
}
}
}
// end of namespace ::sd::tools
}
}
// end of namespace ::sd::tools
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment