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
99997d19
Commit
99997d19
authored
Feb 28, 2013
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another little bit of code docs
parent
58e61853
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
12 deletions
+57
-12
main.cpp
src/main.cpp
+4
-3
mainwin.cpp
src/mainwin.cpp
+41
-1
mainwin.h
src/mainwin.h
+12
-8
No files found.
src/main.cpp
View file @
99997d19
...
@@ -29,9 +29,10 @@
...
@@ -29,9 +29,10 @@
*
*
* File: main.cpp
* File: main.cpp
*
*
* Purpose: Core file for the SkyliveX client. It provide core
* Purpose: Core file for the SkyliveX client.
* functionality as the enter point of the client and
* It launches the client and instantiate the main window,
* to load plugins and make them communicate.
* the SkyliveX object (IPC and Plugin loading),
* and establish communication between those two
*
*
*/
*/
#include <QApplication>
#include <QApplication>
...
...
src/mainwin.cpp
View file @
99997d19
...
@@ -27,9 +27,11 @@
...
@@ -27,9 +27,11 @@
*
*
********************************************************************
********************************************************************
*
*
* File:
splashpage
.cpp
* File:
mainwin
.cpp
*
*
* Purpose:
* Purpose:
* This define special methods for
* the mainwindow
*
*
*/
*/
#include "mainwin.h"
#include "mainwin.h"
...
@@ -45,28 +47,66 @@
...
@@ -45,28 +47,66 @@
#include "ipcmsg.h"
#include "ipcmsg.h"
#include "jsbridge.h"
#include "jsbridge.h"
/* Give a name for the IPC messages to this window */
#define SENDER "maingui"
#define SENDER "maingui"
/*
* Method: MainWin
*
* Arguments:
* - QString &htmlfile
*
* This method initialize the mainwindow object
* pointing it to a local html file, and register
* the handlers for the IPC messages that need to be
* handled from the main window.
*
* This class is derived from the SkylivexWin class,
* so, this window object will have a JSBridge
* and can communicate bidirectionally with the
* HTML/javascript side
*
* This will be the primary GUI window, and it will also
* be the father of all others subwindow.
*/
MainWin
::
MainWin
(
QString
&
htmlfile
)
MainWin
::
MainWin
(
QString
&
htmlfile
)
:
SkylivexWin
(
htmlfile
)
:
SkylivexWin
(
htmlfile
)
{
{
// Handle the client initialization stage
registerHandler
((
QString
)
"coreStarted"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_corestarted
);
registerHandler
((
QString
)
"coreStarted"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_corestarted
);
// Called when the skylive server is connected ( in TCP meaning of connected )
registerHandler
((
QString
)
"telescopeConnected"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_connected
);
registerHandler
((
QString
)
"telescopeConnected"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_connected
);
// called when we have a login request from the server or from a plugin
registerHandler
((
QString
)
"asklogin"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_asklogin
);
registerHandler
((
QString
)
"asklogin"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_asklogin
);
// Called when a login succeed
registerHandler
((
QString
)
"loginok"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_loginres
);
registerHandler
((
QString
)
"loginok"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_loginres
);
// Called when a login fail
registerHandler
((
QString
)
"loginfailed"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_loginres
);
registerHandler
((
QString
)
"loginfailed"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_loginres
);
// Called when a plugin ask us to open an URL, for example for skylive Slides
registerHandler
((
QString
)
"openurl"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_openurl
);
registerHandler
((
QString
)
"openurl"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_openurl
);
// Called when a plugin ask us to open the special youtube page window
registerHandler
((
QString
)
"youtubevideo"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_youtubevideo
);
registerHandler
((
QString
)
"youtubevideo"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_youtubevideo
);
// Called when a plugin ask us to close the special youtube page window
registerHandler
((
QString
)
"closeyoutube"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_closeyoutube
);
registerHandler
((
QString
)
"closeyoutube"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_closeyoutube
);
// Set the IPC messages sender name
msgsender
=
SENDER
;
msgsender
=
SENDER
;
// At initialization, the special youtube page window is closed
yt_is_open
=
false
;
yt_is_open
=
false
;
}
}
/* Destructor */
MainWin
::~
MainWin
()
MainWin
::~
MainWin
()
{
{
...
...
src/mainwin.h
View file @
99997d19
...
@@ -27,9 +27,11 @@
...
@@ -27,9 +27,11 @@
*
*
********************************************************************
********************************************************************
*
*
* File:
skylivex
.h
* File:
mainwin
.h
*
*
* Purpose:
* Purpose:
* This file define the special WebView derived object for
* the main window
*
*
*/
*/
#ifndef MAINWIN_H
#ifndef MAINWIN_H
...
@@ -46,8 +48,10 @@
...
@@ -46,8 +48,10 @@
/*
/*
* class MainWin
* class MainWin
* This is just a little webkit transparent window
* This is needed cause the MainWindow is something
* to show the splash screen
* different from the others, all the window
* with access to the c++ core will be subwindow of this one,
* but this will also serve the login window and the splashscreen
*/
*/
class
MainWin
:
public
SkylivexWin
class
MainWin
:
public
SkylivexWin
{
{
...
@@ -57,9 +61,9 @@ class MainWin : public SkylivexWin
...
@@ -57,9 +61,9 @@ class MainWin : public SkylivexWin
public
:
public
:
MainWin
(
QString
&
htmlfile
);
MainWin
(
QString
&
htmlfile
);
~
MainWin
();
~
MainWin
();
QString
msgsender
;
QString
msgsender
;
// The name of the mainwindow for the IPC messages
WebWin
*
yt
;
WebWin
*
yt
;
// a pointer to the special (singleton) Youtube window (if exists)
bool
yt_is_open
;
bool
yt_is_open
;
// a boolean to indicate if the Youtube window is open
void
handle_corestarted
(
SKMessage
&
msg
);
void
handle_corestarted
(
SKMessage
&
msg
);
void
handle_connected
(
SKMessage
&
msg
);
void
handle_connected
(
SKMessage
&
msg
);
void
handle_asklogin
(
SKMessage
&
msg
);
void
handle_asklogin
(
SKMessage
&
msg
);
...
@@ -68,7 +72,7 @@ class MainWin : public SkylivexWin
...
@@ -68,7 +72,7 @@ class MainWin : public SkylivexWin
void
handle_youtubevideo
(
SKMessage
&
msg
);
void
handle_youtubevideo
(
SKMessage
&
msg
);
void
handle_closeyoutube
(
SKMessage
&
msg
);
void
handle_closeyoutube
(
SKMessage
&
msg
);
public
slots
:
public
slots
:
void
ytclosesignal
();
void
ytclosesignal
();
// This slot is needed to close the special youtube window
};
};
...
...
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