// =============================================================== ConfigurationWindow.h
/*
* ConfigurationWindow.h
*
* Created on: Jan 2, 2019
* Author: forsaken
*/
#ifndef CONFIGURATIONWINDOW_H_
#define CONFIGURATIONWINDOW_H_
#include <gtk/gtk.h>
namespace Rgb {
class ConfigurationWindow {
protected:
GtkApplication* app;
GtkWidget* window;
public:
ConfigurationWindow(GtkApplication* app);
virtual ~ConfigurationWindow();
void show();
};
} /* namespace Rgb */
#endif /* CONFIGURATIONWINDOW_H_ */
// =============================================================== main.cpp
#include <iostream>
#include <gtk/gtk.h>
#include <dbus/dbus.h>
static void appActivate(GtkApplication* app, gpointer userData) {
Rgb::ConfigurationWindow* window = new Rgb::ConfigurationWindow(app);
window->show();
}
int main(int argc, char **argv) {
int result = 0;
GtkApplication* app;
gtk_application_new("org.forsaken.RgbFrontend", G_APPLICATION_FLAGS_NONE);
g_signal_connect(app, "activate", G_CALLBACK(appActivate), NULL);
result = g_application_run(G_APPLICATION(app), argc, argv);
g_object_unref(app);
return result;
/*
DBusError dbusError;
DBusConnection* dbusConnection;
dbus_error_init(&dbusError);
dbusConnection = dbus_bus_get(DBUS_BUS_SESSION, &dbusError);
return 0;
*/
}
// =============================================================== ConfigurationWindow.cpp
/*
* ConfigurationWindow.cpp
*
* Created on: Jan 2, 2019
* Author: forsaken
*/
#include "ConfigurationWindow.h"
namespace Rgb {
ConfigurationWindow::ConfigurationWindow(GtkApplication* app) {
this->app = app;
this->window = gtk_application_window_new(app);
gtk_window_set_title(GTK_WINDOW(this->window), "RGB-Configuration");
gtk_window_set_default_size(GTK_WINDOW(this->window), 200, 200);
}
ConfigurationWindow::~ConfigurationWindow() {
}
void ConfigurationWindow::show() {
gtk_widget_show_all(this->window);
}
} /* namespace Rgb */