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
7dbd2a0a
Kaydet (Commit)
7dbd2a0a
authored
Ock 24, 2012
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: re-factor headless a little, and start on the mainloop
üst
c2112c7c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
42 deletions
+87
-42
Library_vcl.mk
vcl/Library_vcl.mk
+5
-0
androidinst.cxx
vcl/android/androidinst.cxx
+47
-23
svpinst.cxx
vcl/headless/svpinst.cxx
+26
-19
androidinst.hxx
vcl/inc/android/androidinst.hxx
+6
-0
svpinst.hxx
vcl/inc/headless/svpinst.hxx
+3
-0
No files found.
vcl/Library_vcl.mk
Dosyayı görüntüle @
7dbd2a0a
...
@@ -431,6 +431,11 @@ $(eval $(call gb_Library_use_externals,vcl,\
...
@@ -431,6 +431,11 @@ $(eval $(call gb_Library_use_externals,vcl,\
endif
endif
ifeq ($(GUIBASE),android)
ifeq ($(GUIBASE),android)
$(eval $(call gb_Library_add_libs,vcl,\
-llog \
-landroid \
-llo-bootstrap \
))
$(eval $(call gb_Library_add_defs,vcl,\
$(eval $(call gb_Library_add_defs,vcl,\
-DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
-DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
-DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
-DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
...
...
vcl/android/androidinst.cxx
Dosyayı görüntüle @
7dbd2a0a
...
@@ -30,11 +30,15 @@
...
@@ -30,11 +30,15 @@
#include <headless/svpdummies.hxx>
#include <headless/svpdummies.hxx>
#include <generic/gendata.hxx>
#include <generic/gendata.hxx>
#include <android/log.h>
#include <android/log.h>
#include <android/looper.h>
#include <osl/detail/android.h>
AndroidSalInstance
::
AndroidSalInstance
(
SalYieldMutex
*
pMutex
)
AndroidSalInstance
::
AndroidSalInstance
(
SalYieldMutex
*
pMutex
)
:
SvpSalInstance
(
pMutex
)
:
SvpSalInstance
(
pMutex
)
{
{
fprintf
(
stderr
,
"created Android Sal Instance
\n
"
);
fprintf
(
stderr
,
"created Android Sal Instance for app %p window %p
\n
"
,
global_android_app
,
global_android_app
?
global_android_app
->
window
:
NULL
);
}
}
AndroidSalInstance
::~
AndroidSalInstance
()
AndroidSalInstance
::~
AndroidSalInstance
()
...
@@ -42,6 +46,34 @@ AndroidSalInstance::~AndroidSalInstance()
...
@@ -42,6 +46,34 @@ AndroidSalInstance::~AndroidSalInstance()
fprintf
(
stderr
,
"destroyed Android Sal Instance
\n
"
);
fprintf
(
stderr
,
"destroyed Android Sal Instance
\n
"
);
}
}
void
AndroidSalInstance
::
Wakeup
()
{
if
(
global_android_app
&&
global_android_app
->
looper
)
ALooper_wake
(
global_android_app
->
looper
);
else
fprintf
(
stderr
,
"busted - no global looper
\n
"
);
}
void
AndroidSalInstance
::
DoReleaseYield
(
int
nTimeoutMS
)
{
// release yield mutex
sal_uLong
nAcquireCount
=
ReleaseYieldMutex
();
fprintf
(
stderr
,
"DoReleaseYield for %d ms
\n
"
,
nTimeoutMS
);
// int ALooper_pollOnce(timeoutMs, int* outFd, int* outEvents, void** outData);
// acquire yield mutex again
AcquireYieldMutex
(
nAcquireCount
);
}
bool
AndroidSalInstance
::
AnyInput
(
sal_uInt16
nType
)
{
// FIXME: ideally we should check the input queue to avoid being busy ...
fprintf
(
stderr
,
"FIXME: AnyInput returns true
\n
"
);
// global_android_app->inputQueue ? ...
return
true
;
}
class
AndroidSalSystem
:
public
SvpSalSystem
{
class
AndroidSalSystem
:
public
SvpSalSystem
{
public
:
public
:
AndroidSalSystem
()
:
SvpSalSystem
()
{}
AndroidSalSystem
()
:
SvpSalSystem
()
{}
...
@@ -52,14 +84,9 @@ public:
...
@@ -52,14 +84,9 @@ public:
int
nDefButton
)
int
nDefButton
)
{
{
(
void
)
rButtons
;
(
void
)
nDefButton
;
(
void
)
rButtons
;
(
void
)
nDefButton
;
#if 0
__android_log_print
(
ANDROID_LOG_INFO
,
"LibreOffice - dialog '%s': '%s'"
,
__android_log_print
(
ANDROID_LOG_INFO
,
"LibreOffice - dialog '%s': '%s'"
,
rtl
::
OUStringToOString
(
rTitle
,
RTL_TEXTENCODING_ASCII_US
).
getStr
(),
rtl
::
OUStringToOString
(
rTitle
,
RTL_TEXTENCODING_ASCII_US
).
getStr
(),
rtl
::
OUStringToOString
(
rMessage
,
RTL_TEXTENCODING_ASCII_US
).
getStr
());
rtl
::
OUStringToOString
(
rMessage
,
RTL_TEXTENCODING_ASCII_US
).
getStr
());
#endif
fprintf
(
stderr
,
"LibreOffice - dialog '%s': '%s'"
,
rtl
::
OUStringToOString
(
rTitle
,
RTL_TEXTENCODING_ASCII_US
).
getStr
(),
rtl
::
OUStringToOString
(
rMessage
,
RTL_TEXTENCODING_ASCII_US
).
getStr
());
return
0
;
return
0
;
}
}
};
};
...
@@ -77,19 +104,6 @@ public:
...
@@ -77,19 +104,6 @@ public:
virtual
bool
ErrorTrapPop
(
bool
)
{
return
false
;
}
virtual
bool
ErrorTrapPop
(
bool
)
{
return
false
;
}
};
};
SalInstance
*
CreateSalInstance
()
{
AndroidSalInstance
*
pInstance
=
new
AndroidSalInstance
(
new
SalYieldMutex
()
);
new
AndroidSalData
(
pInstance
);
return
pInstance
;
}
void
DestroySalInstance
(
SalInstance
*
pInst
)
{
pInst
->
ReleaseYieldMutex
();
delete
pInst
;
}
// All the interesting stuff is slaved from the AndroidSalInstance
// All the interesting stuff is slaved from the AndroidSalInstance
void
InitSalData
()
{}
void
InitSalData
()
{}
void
DeInitSalData
()
{}
void
DeInitSalData
()
{}
...
@@ -103,12 +117,8 @@ void SalAbort( const rtl::OUString& rErrorText, bool bDumpCore )
...
@@ -103,12 +117,8 @@ void SalAbort( const rtl::OUString& rErrorText, bool bDumpCore )
aError
=
rtl
::
OUString
::
createFromAscii
(
"Unknown application error"
);
aError
=
rtl
::
OUString
::
createFromAscii
(
"Unknown application error"
);
::
fprintf
(
stderr
,
"%s
\n
"
,
rtl
::
OUStringToOString
(
rErrorText
,
osl_getThreadTextEncoding
()).
getStr
()
);
::
fprintf
(
stderr
,
"%s
\n
"
,
rtl
::
OUStringToOString
(
rErrorText
,
osl_getThreadTextEncoding
()).
getStr
()
);
#if 0
__android_log_print
(
ANDROID_LOG_INFO
,
"SalAbort: '%s'"
,
__android_log_print
(
ANDROID_LOG_INFO
,
"SalAbort: '%s'"
,
rtl
::
OUStringToOString
(
aError
,
RTL_TEXTENCODING_ASCII_US
).
getStr
());
rtl
::
OUStringToOString
(
aError
,
RTL_TEXTENCODING_ASCII_US
).
getStr
());
#endif
fprintf
(
stderr
,
"SalAbort: '%s'"
,
rtl
::
OUStringToOString
(
aError
,
RTL_TEXTENCODING_ASCII_US
).
getStr
()
);
if
(
bDumpCore
)
if
(
bDumpCore
)
abort
();
abort
();
else
else
...
@@ -132,4 +142,18 @@ SalData::~SalData()
...
@@ -132,4 +142,18 @@ SalData::~SalData()
{
{
}
}
// This is our main entry point:
SalInstance
*
CreateSalInstance
()
{
AndroidSalInstance
*
pInstance
=
new
AndroidSalInstance
(
new
SalYieldMutex
()
);
new
AndroidSalData
(
pInstance
);
return
pInstance
;
}
void
DestroySalInstance
(
SalInstance
*
pInst
)
{
pInst
->
ReleaseYieldMutex
();
delete
pInst
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/headless/svpinst.cxx
Dosyayı görüntüle @
7dbd2a0a
...
@@ -325,25 +325,32 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
...
@@ -325,25 +325,32 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
else
else
nTimeoutMS
=
-
1
;
// wait until something happens
nTimeoutMS
=
-
1
;
// wait until something happens
// release yield mutex
DoReleaseYield
(
nTimeoutMS
);
nAcquireCount
=
ReleaseYieldMutex
();
}
// poll
}
struct
pollfd
aPoll
;
aPoll
.
fd
=
m_pTimeoutFDS
[
0
];
void
SvpSalInstance
::
DoReleaseYield
(
int
nTimeoutMS
)
aPoll
.
events
=
POLLIN
;
{
aPoll
.
revents
=
0
;
// poll
poll
(
&
aPoll
,
1
,
nTimeoutMS
);
struct
pollfd
aPoll
;
aPoll
.
fd
=
m_pTimeoutFDS
[
0
];
// acquire yield mutex again
aPoll
.
events
=
POLLIN
;
AcquireYieldMutex
(
nAcquireCount
);
aPoll
.
revents
=
0
;
// clean up pipe
// release yield mutex
if
(
(
aPoll
.
revents
&
POLLIN
)
!=
0
)
sal_uLong
nAcquireCount
=
ReleaseYieldMutex
();
{
int
buffer
;
poll
(
&
aPoll
,
1
,
nTimeoutMS
);
while
(
read
(
m_pTimeoutFDS
[
0
],
&
buffer
,
sizeof
(
buffer
))
>
0
)
continue
;
// acquire yield mutex again
}
AcquireYieldMutex
(
nAcquireCount
);
// clean up pipe
if
(
(
aPoll
.
revents
&
POLLIN
)
!=
0
)
{
int
buffer
;
while
(
read
(
m_pTimeoutFDS
[
0
],
&
buffer
,
sizeof
(
buffer
))
>
0
)
continue
;
}
}
}
}
...
...
vcl/inc/android/androidinst.hxx
Dosyayı görüntüle @
7dbd2a0a
...
@@ -39,6 +39,12 @@ public:
...
@@ -39,6 +39,12 @@ public:
virtual
~
AndroidSalInstance
();
virtual
~
AndroidSalInstance
();
virtual
SalSystem
*
CreateSalSystem
();
virtual
SalSystem
*
CreateSalSystem
();
// mainloop pieces
virtual
void
Wakeup
();
virtual
bool
AnyInput
(
sal_uInt16
nType
);
protected
:
virtual
void
DoReleaseYield
(
int
nTimeoutMS
);
};
};
#endif // ANDROID_SALINST_H
#endif // ANDROID_SALINST_H
...
...
vcl/inc/headless/svpinst.hxx
Dosyayı görüntüle @
7dbd2a0a
...
@@ -95,6 +95,9 @@ class SvpSalInstance : public SalGenericInstance
...
@@ -95,6 +95,9 @@ class SvpSalInstance : public SalGenericInstance
bool
isFrameAlive
(
const
SalFrame
*
pFrame
)
const
;
bool
isFrameAlive
(
const
SalFrame
*
pFrame
)
const
;
protected
:
virtual
void
DoReleaseYield
(
int
nTimeoutMS
);
public
:
public
:
static
SvpSalInstance
*
s_pDefaultInstance
;
static
SvpSalInstance
*
s_pDefaultInstance
;
...
...
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