Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
934c7aa8
Commit
934c7aa8
authored
Feb 15, 2013
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorganized windows and IPC classes
parent
47ba2a47
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
106 additions
and
75 deletions
+106
-75
skylivex.pro
skylivex.pro
+9
-2
main.cpp
src/main.cpp
+14
-40
mainwin.cpp
src/mainwin.cpp
+25
-1
mainwin.h
src/mainwin.h
+21
-19
plugins.cpp
src/plugins.cpp
+1
-1
plugins.h
src/plugins.h
+3
-2
skylivex.cpp
src/skylivex.cpp
+14
-0
skylivex.h
src/skylivex.h
+19
-10
No files found.
skylivex.pro
View file @
934c7aa8
SOURCES
=
src
/
main
.
cpp
src
/
splashpage
.
cpp
src
/
skylivex
.
h
SOURCES
=
src
/
main
.
cpp
\
src
/
mainwin
.
cpp
\
src
/
skylivex
.
cpp
#
src
/
plugins
.
cpp
HEADERS
=
src
/
skylivex
.
h
\
src
/
mainwin
.
h
#
src
/
plugins
.
h
src
/
pluginsinterfaces
.
h
QT
+=
network
webkitwidgets
widgets
OTHER_FILES
+=
\
gui
/
splash
.
html
gui
/
splash
.
html
\
gui
/
img
/
logo
.
png
src/main.cpp
View file @
934c7aa8
...
...
@@ -36,41 +36,10 @@
*/
#include <QApplication>
#include <QFile>
#include <Q
Object
>
#include <Q
Timer
>
#include "mainwin.h"
#include "skylivex.h"
/*
* class SkyliveX
* This is the core of the SkyliveX client.
* Here the inter-thread and inter-process communication
* with plugins is done, so, the magic happen here
*/
class
SkyliveX
:
public
QObject
{
Q_OBJECT
public
:
SkyliveX
(
QObject
*
parent
=
0
)
:
QObject
(
parent
)
{}
~
SkyliveX
()
{}
public
slots
:
void
run
()
{
emit
finished
();
}
signals
:
void
finished
();
};
/*
* Not less important than the core is the main window.
* It is a Wekbit object that load our HTML/js gui
* for the main window!
*/
//class MainWindow
/*
* main loop.
...
...
@@ -85,25 +54,30 @@ int main(int argc, char *argv[])
{
// Start our application object
QApplication
skylivex
(
argc
,
argv
);
QApplication
skylivex
app
(
argc
,
argv
);
// Start the splash screen. also
// the splash screen is a (transparent) webkit object
QFile
splashfile
(
"gui/splash.html"
);
SplashPage
splashwin
(
splashfile
);
splashwin
.
show
();
MainWin
mainw
(
splashfile
);
mainw
.
show
();
// Instance of the core ITC/IPC messasing
SkyliveX
*
skx
=
new
SkyliveX
(
&
skylivex
);
SkyliveX
*
skx
=
new
SkyliveX
(
&
skylivex
app
);
// connect the "finished" signal coming from the ITC/IPC to the qui call
QObject
::
connect
(
skx
,
SIGNAL
(
finished
()),
&
sk
x
,
SLOT
(
quit
())
);
QObject
::
connect
(
skx
,
SIGNAL
(
finished
()),
&
sk
ylivexapp
,
SLOT
(
quit
()),
Qt
::
QueuedConnection
);
// and give a slot to the ITC/IPC in the main loop
QTimer
::
signalShot
(
0
,
skx
,
SLOT
(
run
()));
QTimer
::
singleShot
(
0
,
skx
,
SLOT
(
initialize
()));
// process IPC events when we are in idle from the main window
QTimer
*
skxprocess
=
new
QTimer
(
skx
);
QObject
::
connect
(
skxprocess
,
SIGNAL
(
timeout
()),
skx
,
SLOT
(
process
()));
skxprocess
->
start
();
// and then.. go!
return
skylivex
.
exec
();
return
skylivex
app
.
exec
();
}
src/mainwin.cpp
View file @
934c7aa8
...
...
@@ -27,8 +27,32 @@
*
********************************************************************
*
* File:
* File:
splashpage.cpp
*
* Purpose:
*
*/
#include "mainwin.h"
#include <QFile>
#include <QDir>
MainWin
::
MainWin
(
QFile
&
htmlfile
)
:
QWebView
(
0
)
{
htmlfile
.
open
(
QIODevice
::
ReadOnly
);
htmlFileName
=
QString
::
fromUtf8
(
htmlfile
.
readAll
().
constData
());
QUrl
baseUrl
=
QUrl
::
fromLocalFile
(
QDir
::
current
().
absoluteFilePath
(
"gui/dummy.html"
));
setWindowFlags
(
Qt
::
FramelessWindowHint
);
page
()
->
setPalette
(
palette
());
setAttribute
(
Qt
::
WA_TranslucentBackground
,
true
);
setAttribute
(
Qt
::
WA_OpaquePaintEvent
,
false
);
setHtml
(
htmlFileName
,
baseUrl
);
resize
(
250
,
200
);
}
MainWin
::~
MainWin
()
{
}
src/
splashpage.cpp
→
src/
mainwin.h
View file @
934c7aa8
...
...
@@ -27,32 +27,34 @@
*
********************************************************************
*
* File: s
plashpage.cpp
* File: s
kylivex.h
*
* Purpose:
*
*/
#include "skylivex.h"
#ifndef MAINWIN_H
#define MAINWIN_H
#include <QWebView>
#include <QUrl>
#include <QFile>
#include <Q
Dir
>
#include <Q
String
>
SplashPage
::
SplashPage
(
QFile
&
splash_html
)
:
QWebView
(
0
)
/*
* class MainWin
* This is just a little webkit transparent window
* to show the splash screen
*/
class
MainWin
:
public
QWebView
{
splash_html
.
open
(
QIODevice
::
ReadOnly
)
;
splashFile
=
QString
::
fromUtf8
(
splash_html
.
readAll
().
constData
())
;
QUrl
baseUrl
=
QUrl
::
fromLocalFile
(
QDir
::
current
().
absoluteFilePath
(
"gui/dummy.html"
))
;
QUrl
baseurl
;
QFile
htmlfile
;
QString
htmlFileName
;
setWindowFlags
(
Qt
::
FramelessWindowHint
);
page
()
->
setPalette
(
palette
()
);
setAttribute
(
Qt
::
WA_TranslucentBackground
,
true
);
setAttribute
(
Qt
::
WA_OpaquePaintEvent
,
false
)
;
public
:
MainWin
(
QFile
&
htmlfile
);
~
MainWin
(
);
}
;
setHtml
(
splashFile
,
baseUrl
);
resize
(
250
,
200
);
}
SplashPage
::~
SplashPage
()
{
}
#endif
src/plugins.cpp
View file @
934c7aa8
...
...
@@ -35,4 +35,4 @@
#include <QPluginLoader>
#include "pluginsinterfaces.h"
#define sarca
src/plugins.h
View file @
934c7aa8
...
...
@@ -29,6 +29,7 @@
*
* File:
*
* Purpose:
*
* Purpose
*/
#define TEST
src/
ipc
.cpp
→
src/
skylivex
.cpp
View file @
934c7aa8
...
...
@@ -32,3 +32,17 @@
* Purpose:
*
*/
#include "skylivex.h"
#include <iostream>
void
SkyliveX
::
initialize
()
{
std
::
cout
<<
"antani"
<<
std
::
endl
;
}
void
SkyliveX
::
process
()
{
std
::
cout
<<
"process"
<<
std
::
endl
;
}
src/skylivex.h
View file @
934c7aa8
...
...
@@ -35,20 +35,29 @@
#ifndef SKYLIVEX_H
#define SKYLIVEX_H
#include <QWebView>
#include <QUrl>
#include <QFile>
#include <QString>
#include <QObject>
class
SplashPage
:
public
QWebView
/*
* class SkyliveX
* This is the core of the SkyliveX client.
* Here the inter-thread and inter-process communication
* with plugins is done, so, the magic happen here
*/
class
SkyliveX
:
public
QObject
{
QUrl
baseurl
;
QFile
splash_html
;
QString
splashFile
;
Q_OBJECT
public
:
SplashPage
(
QFile
&
splash_html
);
~
SplashPage
();
SkyliveX
(
QObject
*
parent
=
0
)
:
QObject
(
parent
)
{}
~
SkyliveX
()
{}
public
slots
:
void
initialize
();
void
process
();
signals
:
void
finished
();
};
#endif
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