fix: add gloox lib to make command & fix: move client class to mm window
This commit is contained in:
parent
e8704f731f
commit
b9b1b50599
9 changed files with 10 additions and 30 deletions
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
BINARY=renga
|
BINARY=renga
|
||||||
CPP=clang
|
CPP=clang
|
||||||
FLAGS=-lbe -std=c++20 -lstdc++
|
FLAGS=-lbe -lgloox -std=c++20 -lstdc++
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,13 @@
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
|
||||||
#define kSignature "application/x-vnd.iwakura-Renga"
|
#define kSignature "application/x-vnd.iwakura-Renga"
|
||||||
|
#define appName "Renga"
|
||||||
class Client : public gloox::ConnectionListener, gloox::PresenceHandler {
|
#define appVersion "v0.1"
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class App : public BApplication
|
class App : public BApplication
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
App(void);
|
App(void);
|
||||||
Client *client;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
#include <gloox/connectionlistener.h>
|
|
||||||
#include <gloox/presencehandler.h>
|
|
||||||
#include "Client.h"
|
|
||||||
#include <Application.h>
|
|
||||||
|
|
||||||
Client::
|
|
||||||
|
|
||||||
#endif
|
|
14
src/Client.h
14
src/Client.h
|
@ -1,14 +0,0 @@
|
||||||
#ifndef CLIENT_H
|
|
||||||
#define CLIENT_H
|
|
||||||
|
|
||||||
#include <gloox/connectionlistener.h>
|
|
||||||
#include <gloox/presencehandler.h>
|
|
||||||
#include <Application.h>
|
|
||||||
|
|
||||||
class Client : public gloox::ConnectionListener, gloox::PresenceHandler {
|
|
||||||
public:
|
|
||||||
void connect(void);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
|
|
||||||
Contacts::Contacts(void)
|
Contacts::Contacts()
|
||||||
: BWindow(BRect(200,200,600,400), TITLE, B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_QUIT_ON_WINDOW_CLOSE)
|
: BWindow(BRect(200,200,600,400), TITLE, B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_QUIT_ON_WINDOW_CLOSE)
|
||||||
{
|
{
|
||||||
BGroupLayout *group = new BGroupLayout(B_VERTICAL);
|
BGroupLayout *group = new BGroupLayout(B_VERTICAL);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
class Contacts : public BWindow {
|
class Contacts : public BWindow {
|
||||||
public:
|
public:
|
||||||
Contacts(void);
|
Contacts(void);
|
||||||
|
void onMessage(const char* jid, const char* msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -75,6 +75,7 @@ void MainWindow::MessageReceived(BMessage *msg)
|
||||||
printf("Connect button clicked...\n");
|
printf("Connect button clicked...\n");
|
||||||
|
|
||||||
Hide();
|
Hide();
|
||||||
|
|
||||||
Middleman *middleman = new Middleman(JidInputBox->Text(), PwInputBox->Text(), Application);
|
Middleman *middleman = new Middleman(JidInputBox->Text(), PwInputBox->Text(), Application);
|
||||||
middleman->Show();
|
middleman->Show();
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,6 @@ Middleman::Middleman(const char* jid, const char* password, App *app)
|
||||||
|
|
||||||
group->View()->AdoptSystemColors();
|
group->View()->AdoptSystemColors();
|
||||||
|
|
||||||
group->AddView(new BStringView("label", "Placeholder label (connection middleman to be added)"));
|
group->AddView(new BStringView("label", "Placeholder label (connecting...)"));
|
||||||
group->AddView(new BStringView("label", std::format("JID: {}\nPassword: {}", jid, password).c_str()));
|
group->AddView(new BStringView("label", std::format("JID: {}\nPassword: {}", jid, password).c_str()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#include "../App.h"
|
#include "../App.h"
|
||||||
#define TITLE "Connecting..."
|
#define TITLE "Connecting..."
|
||||||
|
|
||||||
|
// Middleman is the "middle" window that sets up the XMPP connection and manages all windows that require one.
|
||||||
|
// TODO: add client class to mm class for windows to send message
|
||||||
|
|
||||||
class Middleman : public BWindow {
|
class Middleman : public BWindow {
|
||||||
public:
|
public:
|
||||||
Middleman(const char* jid, const char* password, App *app);
|
Middleman(const char* jid, const char* password, App *app);
|
||||||
|
|
Loading…
Reference in a new issue