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
038d13ef
Kaydet (Commit)
038d13ef
authored
Mar 30, 2015
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Introduce vcl::IsWindowSystemAvailable()
Change-Id: I6e3f804833db7487ddf7ba75c43d15017dcbe1ba
üst
3d177c7b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
128 additions
and
50 deletions
+128
-50
svapp.hxx
include/vcl/svapp.hxx
+7
-0
x11display.hxx
vcl/inc/unx/x11/x11display.hxx
+25
-0
salinst.cxx
vcl/osx/salinst.cxx
+11
-0
saldata.cxx
vcl/unx/generic/app/saldata.cxx
+2
-50
x11windowprovider.cxx
vcl/unx/generic/gdi/x11windowprovider.cxx
+72
-0
saldata.cxx
vcl/win/source/app/saldata.cxx
+11
-0
No files found.
include/vcl/svapp.hxx
Dosyayı görüntüle @
038d13ef
...
...
@@ -1706,6 +1706,13 @@ inline void Application::EndYield()
PostUserEvent
(
Link
()
);
}
namespace
vcl
{
VCL_DLLPUBLIC
bool
IsWindowSystemAvailable
();
}
#endif // _APP_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/inc/unx/x11/x11display.hxx
0 → 100644
Dosyayı görüntüle @
038d13ef
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_VCL_INC_UNX_X11_X11DISPLAY_HXX
#define INCLUDED_VCL_INC_UNX_X11_X11DISPLAY_HXX
#include <prex.h>
#include <X11/Xproto.h>
#include <postx.h>
#include <rtl/string.hxx>
#include <vcl/dllapi.h>
Display
*
VCL_DLLPUBLIC
OpenX11Display
(
OString
&
rDisplay
);
#endif // INCLUDED_VCL_INC_UNX_X11_X11DISPLAY_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/osx/salinst.cxx
Dosyayı görüntüle @
038d13ef
...
...
@@ -1070,4 +1070,15 @@ NSImage* CreateNSImage( const Image& rImage )
return
pImage
;
}
namespace
vcl
{
bool
IsWindowSystemAvailable
()
{
// Yes I know the parens are not needed. I like them in cases like this. So sue me.
return
([
NSScreen
screens
]
!=
nil
&&
[[
NSScreen
screens
]
count
]
>
0
);
}
}
// namespace vcl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/unx/generic/app/saldata.cxx
Dosyayı görüntüle @
038d13ef
...
...
@@ -39,10 +39,6 @@
#include <sys/time.h>
#endif
#include <prex.h>
#include <X11/Xproto.h>
#include <postx.h>
#include <osl/process.h>
#include <osl/mutex.hxx>
...
...
@@ -52,6 +48,7 @@
#include "unx/sm.hxx"
#include "unx/i18n_im.hxx"
#include "unx/i18n_xkb.hxx"
#include "unx/x11/x11display.hxx"
#include "salinst.hxx"
#include <osl/signal.h>
...
...
@@ -395,53 +392,8 @@ void SalXLib::Init()
pInputMethod
->
SetLocale
();
XrmInitialize
();
/*
* open connection to X11 Display
* try in this order:
* o -display command line parameter,
* o $DISPLAY environment variable
* o default display
*/
Display
*
pDisp
=
NULL
;
// is there a -display command line parameter?
sal_uInt32
nParams
=
osl_getCommandArgCount
();
OUString
aParam
;
OString
aDisplay
;
for
(
sal_uInt16
i
=
0
;
i
<
nParams
;
i
++
)
{
osl_getCommandArg
(
i
,
&
aParam
.
pData
);
if
(
aParam
==
"-display"
)
{
osl_getCommandArg
(
i
+
1
,
&
aParam
.
pData
);
aDisplay
=
OUStringToOString
(
aParam
,
osl_getThreadTextEncoding
());
if
((
pDisp
=
XOpenDisplay
(
aDisplay
.
getStr
()))
!=
NULL
)
{
/*
* if a -display switch was used, we need
* to set the environment accoringly since
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
OUString
envVar
(
"DISPLAY"
);
osl_setEnvironment
(
envVar
.
pData
,
aParam
.
pData
);
}
break
;
}
}
if
(
!
pDisp
&&
aDisplay
.
isEmpty
())
{
// Open $DISPLAY or default...
char
*
pDisplay
=
getenv
(
"DISPLAY"
);
if
(
pDisplay
!=
NULL
)
aDisplay
=
OString
(
pDisplay
);
pDisp
=
XOpenDisplay
(
pDisplay
);
}
Display
*
pDisp
=
OpenX11Display
(
aDisplay
);
if
(
!
pDisp
)
{
...
...
vcl/unx/generic/gdi/x11windowprovider.cxx
Dosyayı görüntüle @
038d13ef
...
...
@@ -7,10 +7,82 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <vcl/svapp.hxx>
#include "unx/x11windowprovider.hxx"
#include "unx/x11/x11display.hxx"
X11WindowProvider
::~
X11WindowProvider
()
{
}
Display
*
OpenX11Display
(
OString
&
rDisplay
)
{
/*
* open connection to X11 Display
* try in this order:
* o -display command line parameter,
* o $DISPLAY environment variable
* o default display
*/
Display
*
pDisp
=
NULL
;
// is there a -display command line parameter?
sal_uInt32
nParams
=
osl_getCommandArgCount
();
OUString
aParam
;
for
(
sal_uInt16
i
=
0
;
i
<
nParams
;
i
++
)
{
osl_getCommandArg
(
i
,
&
aParam
.
pData
);
if
(
aParam
==
"-display"
)
{
osl_getCommandArg
(
i
+
1
,
&
aParam
.
pData
);
rDisplay
=
OUStringToOString
(
aParam
,
osl_getThreadTextEncoding
());
if
((
pDisp
=
XOpenDisplay
(
rDisplay
.
getStr
()))
!=
NULL
)
{
/*
* if a -display switch was used, we need
* to set the environment accoringly since
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
OUString
envVar
(
"DISPLAY"
);
osl_setEnvironment
(
envVar
.
pData
,
aParam
.
pData
);
}
break
;
}
}
if
(
!
pDisp
&&
rDisplay
.
isEmpty
())
{
// Open $DISPLAY or default...
char
*
pDisplay
=
getenv
(
"DISPLAY"
);
if
(
pDisplay
!=
NULL
)
rDisplay
=
OString
(
pDisplay
);
pDisp
=
XOpenDisplay
(
pDisplay
);
}
return
pDisp
;
}
namespace
vcl
{
bool
IsWindowSystemAvailable
()
{
Display
*
pDisp
;
OString
aDisplay
;
pDisp
=
OpenX11Display
(
aDisplay
);
if
(
pDisp
)
XCloseDisplay
(
pDisp
);
return
(
pDisp
!=
nullptr
);
}
}
// namespace vcl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/win/source/app/saldata.cxx
Dosyayı görüntüle @
038d13ef
...
...
@@ -74,4 +74,15 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 )
return
nRet
;
}
namespace
vcl
{
bool
IsWindowSystemAvailable
()
{
return
true
;
// FIXME: we want this to return false if logged in
// to some Cygwin ssh session for instance
}
}
// namespace vcl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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