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
4d757fce
Kaydet (Commit)
4d757fce
authored
Kas 07, 2014
tarafından
Michael Meeks
Kaydeden (comit)
Markus Mohrhard
Kas 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcldemo: kill all the legacy cruft.
Change-Id: I60d7d30ff20a01e375d9851afd8bd8ce12835752
üst
ff329be4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
108 deletions
+61
-108
Executable_vcldemo.mk
vcl/Executable_vcldemo.mk
+4
-0
vcldemo.cxx
vcl/workben/vcldemo.cxx
+57
-108
No files found.
vcl/Executable_vcldemo.mk
Dosyayı görüntüle @
4d757fce
...
@@ -36,4 +36,8 @@ $(eval $(call gb_Executable_add_exception_objects,vcldemo,\
...
@@ -36,4 +36,8 @@ $(eval $(call gb_Executable_add_exception_objects,vcldemo,\
vcl/workben/vcldemo \
vcl/workben/vcldemo \
))
))
$(eval $(call gb_Executable_use_static_libraries,vcldemo,\
vclmain \
))
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
4d757fce
...
@@ -5,81 +5,30 @@
...
@@ -5,81 +5,30 @@
* This Source Code Form is subject to the terms of the Mozilla Public
* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
*/
#include <sal/main.h>
#include <tools/extendapplicationenvironment.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <vcl/vclmain.hxx>
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/msgbox.hxx>
#include <unistd.h>
#include <stdio.h>
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
css
;
using
namespace
::
com
::
sun
::
star
::
lang
;
using
namespace
cppu
;
// Forward declaration
class
DemoWin
:
public
WorkWindow
void
Main
();
SAL_IMPLEMENT_MAIN
()
{
{
try
public
:
{
DemoWin
()
:
WorkWindow
(
NULL
,
WB_APP
|
WB_STDWORK
)
tools
::
extendApplicationEnvironment
();
Reference
<
XComponentContext
>
xContext
=
defaultBootstrap_InitialComponentContext
();
Reference
<
XMultiServiceFactory
>
xServiceManager
(
xContext
->
getServiceManager
(),
UNO_QUERY
);
if
(
!
xServiceManager
.
is
()
)
Application
::
Abort
(
"Failed to bootstrap"
);
comphelper
::
setProcessServiceFactory
(
xServiceManager
);
InitVCL
();
::
Main
();
DeInitVCL
();
}
catch
(
const
Exception
&
e
)
{
{
SAL_WARN
(
"vcl.app"
,
"Fatal exception: "
<<
e
.
Message
);
return
1
;
}
}
return
0
;
}
class
MyWin
:
public
WorkWindow
{
public
:
MyWin
(
vcl
::
Window
*
pParent
,
WinBits
nWinStyle
);
virtual
void
MouseMove
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
MouseButtonUp
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
KeyInput
(
const
KeyEvent
&
rKEvt
)
SAL_OVERRIDE
;
virtual
void
KeyUp
(
const
KeyEvent
&
rKEvt
)
SAL_OVERRIDE
;
virtual
void
Paint
(
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
virtual
void
Paint
(
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
virtual
void
Resize
()
SAL_OVERRIDE
;
std
::
vector
<
Rectangle
>
partitionAndClear
(
int
nX
,
int
nY
);
std
::
vector
<
Rectangle
>
partitionAndClear
(
int
nX
,
int
nY
);
...
@@ -142,49 +91,7 @@ public:
...
@@ -142,49 +91,7 @@ public:
}
}
};
};
void
Main
()
std
::
vector
<
Rectangle
>
DemoWin
::
partitionAndClear
(
int
nX
,
int
nY
)
{
MyWin
aMainWin
(
NULL
,
WB_APP
|
WB_STDWORK
);
aMainWin
.
SetText
(
OUString
(
"VCLDemo - VCL Workbench"
)
);
aMainWin
.
Show
();
Application
::
Execute
();
}
MyWin
::
MyWin
(
vcl
::
Window
*
pParent
,
WinBits
nWinStyle
)
:
WorkWindow
(
pParent
,
nWinStyle
)
{
}
void
MyWin
::
MouseMove
(
const
MouseEvent
&
rMEvt
)
{
WorkWindow
::
MouseMove
(
rMEvt
);
}
void
MyWin
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
{
Rectangle
aRect
(
0
,
0
,
4
,
4
);
aRect
.
SetPos
(
rMEvt
.
GetPosPixel
()
);
SetFillColor
(
Color
(
COL_RED
));
DrawRect
(
aRect
);
}
void
MyWin
::
MouseButtonUp
(
const
MouseEvent
&
rMEvt
)
{
WorkWindow
::
MouseButtonUp
(
rMEvt
);
}
void
MyWin
::
KeyInput
(
const
KeyEvent
&
rKEvt
)
{
WorkWindow
::
KeyInput
(
rKEvt
);
}
void
MyWin
::
KeyUp
(
const
KeyEvent
&
rKEvt
)
{
WorkWindow
::
KeyUp
(
rKEvt
);
}
std
::
vector
<
Rectangle
>
MyWin
::
partitionAndClear
(
int
nX
,
int
nY
)
{
{
Rectangle
r
;
Rectangle
r
;
std
::
vector
<
Rectangle
>
aRegions
;
std
::
vector
<
Rectangle
>
aRegions
;
...
@@ -219,9 +126,9 @@ std::vector<Rectangle> MyWin::partitionAndClear(int nX, int nY)
...
@@ -219,9 +126,9 @@ std::vector<Rectangle> MyWin::partitionAndClear(int nX, int nY)
return
aRegions
;
return
aRegions
;
}
}
void
My
Win
::
Paint
(
const
Rectangle
&
rRect
)
void
Demo
Win
::
Paint
(
const
Rectangle
&
rRect
)
{
{
fprintf
(
stderr
,
"
My
Win::Paint(%ld,%ld,%ld,%ld)
\n
"
,
rRect
.
getX
(),
rRect
.
getY
(),
rRect
.
getWidth
(),
rRect
.
getHeight
());
fprintf
(
stderr
,
"
Demo
Win::Paint(%ld,%ld,%ld,%ld)
\n
"
,
rRect
.
getX
(),
rRect
.
getY
(),
rRect
.
getWidth
(),
rRect
.
getHeight
());
drawBackground
();
drawBackground
();
...
@@ -236,9 +143,51 @@ void MyWin::Paint( const Rectangle& rRect )
...
@@ -236,9 +143,51 @@ void MyWin::Paint( const Rectangle& rRect )
drawGradient
(
aRegions
[
i
++
]);
drawGradient
(
aRegions
[
i
++
]);
}
}
void
MyWin
::
Resize
()
class
DemoApp
:
public
Application
{
public
:
DemoApp
()
{}
virtual
int
Main
()
SAL_OVERRIDE
{
DemoWin
aMainWin
;
aMainWin
.
SetText
(
"Interactive VCL demo"
);
aMainWin
.
Show
();
Application
::
Execute
();
}
protected
:
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xMSF
;
void
Init
()
SAL_OVERRIDE
{
try
{
uno
::
Reference
<
uno
::
XComponentContext
>
xComponentContext
=
::
cppu
::
defaultBootstrap_InitialComponentContext
();
xMSF
=
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
(
xComponentContext
->
getServiceManager
(),
uno
::
UNO_QUERY
);
if
(
!
xMSF
.
is
()
)
Application
::
Abort
(
"Bootstrap failure - no service manager"
);
::
comphelper
::
setProcessServiceFactory
(
xMSF
);
}
catch
(
const
uno
::
Exception
&
e
)
{
Application
::
Abort
(
"Bootstrap exception "
+
e
.
Message
);
}
}
void
DeInit
()
SAL_OVERRIDE
{
uno
::
Reference
<
lang
::
XComponent
>
(
comphelper
::
getProcessComponentContext
(),
uno
::
UNO_QUERY_THROW
)
->
dispose
();
::
comphelper
::
setProcessServiceFactory
(
NULL
);
}
};
void
vclmain
::
createApplication
()
{
{
WorkWindow
::
Resize
()
;
static
DemoApp
aApp
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* 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