Another little bit of code docs

parent 58e61853
......@@ -29,9 +29,10 @@
*
* File: main.cpp
*
* Purpose: Core file for the SkyliveX client. It provide core
* functionality as the enter point of the client and
* to load plugins and make them communicate.
* Purpose: Core file for the SkyliveX client.
* It launches the client and instantiate the main window,
* the SkyliveX object (IPC and Plugin loading),
* and establish communication between those two
*
*/
#include <QApplication>
......
......@@ -27,9 +27,11 @@
*
********************************************************************
*
* File: splashpage.cpp
* File: mainwin.cpp
*
* Purpose:
* This define special methods for
* the mainwindow
*
*/
#include "mainwin.h"
......@@ -45,28 +47,66 @@
#include "ipcmsg.h"
#include "jsbridge.h"
/* Give a name for the IPC messages to this window */
#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)
: SkylivexWin(htmlfile)
{
// Handle the client initialization stage
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);
// called when we have a login request from the server or from a plugin
registerHandler((QString)"asklogin", (SKHandlerFunction)&MainWin::handle_asklogin);
// Called when a login succeed
registerHandler((QString)"loginok", (SKHandlerFunction)&MainWin::handle_loginres);
// Called when a login fail
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);
// Called when a plugin ask us to open the special youtube page window
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);
// Set the IPC messages sender name
msgsender = SENDER;
// At initialization, the special youtube page window is closed
yt_is_open=false;
}
/* Destructor */
MainWin::~MainWin()
{
......
......@@ -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
......@@ -46,8 +48,10 @@
/*
* class MainWin
* This is just a little webkit transparent window
* to show the splash screen
* This is needed cause the MainWindow is something
* 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
{
......@@ -57,9 +61,9 @@ class MainWin : public SkylivexWin
public:
MainWin(QString &htmlfile);
~MainWin();
QString msgsender;
WebWin* yt;
bool yt_is_open;
QString msgsender; // The name of the mainwindow for the IPC messages
WebWin* yt; // a pointer to the special (singleton) Youtube window (if exists)
bool yt_is_open; // a boolean to indicate if the Youtube window is open
void handle_corestarted(SKMessage &msg);
void handle_connected(SKMessage &msg);
void handle_asklogin(SKMessage &msg);
......@@ -68,7 +72,7 @@ class MainWin : public SkylivexWin
void handle_youtubevideo(SKMessage &msg);
void handle_closeyoutube(SKMessage &msg);
public slots:
void ytclosesignal();
void ytclosesignal(); // This slot is needed to close the special youtube window
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment