mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
94 lines
No EOL
2.3 KiB
C++
94 lines
No EOL
2.3 KiB
C++
#ifndef APP_BROWSER_HPP
|
|
#define APP_BROWSER_HPP
|
|
|
|
#include <giomm/simpleaction.h>
|
|
#include <glibmm/i18n.h>
|
|
#include <glibmm/refptr.h>
|
|
#include <glibmm/varianttype.h>
|
|
#include <gtkmm/application.h>
|
|
#include <gtkmm/applicationwindow.h>
|
|
#include <gtkmm/object.h>
|
|
#include <sqlite3.h>
|
|
|
|
namespace app
|
|
{
|
|
namespace browser
|
|
{
|
|
class Header;
|
|
class Main;
|
|
}
|
|
|
|
class Browser : public Gtk::ApplicationWindow
|
|
{
|
|
public:
|
|
|
|
/*
|
|
* Tab class database
|
|
*
|
|
* Allowed parental access to enums and relationship methods
|
|
*/
|
|
struct Database
|
|
{
|
|
// APP_BROWSER__*
|
|
struct Session
|
|
{
|
|
enum
|
|
{
|
|
ID,
|
|
TIME,
|
|
WIDTH,
|
|
HEIGHT,
|
|
IS_FULLSCREEN
|
|
}; // table fields index
|
|
|
|
static int init(
|
|
sqlite3 * db
|
|
); // return sqlite3_exec status code
|
|
|
|
static int clean(
|
|
sqlite3 * db
|
|
); // return sqlite3_finalize status code
|
|
|
|
static sqlite3_int64 add(
|
|
sqlite3 * db,
|
|
const int & WIDTH,
|
|
const int & HEIGHT,
|
|
const bool & IS_FULLSCREEN
|
|
); // return sqlite3_last_insert_rowid
|
|
};
|
|
};
|
|
|
|
/*
|
|
* Internal members
|
|
*/
|
|
private:
|
|
|
|
// Database
|
|
sqlite3 * db;
|
|
|
|
// Components
|
|
app::browser::Header * browserHeader;
|
|
app::browser::Main * browserMain;
|
|
|
|
// Defaults
|
|
static const int WIDTH = 640;
|
|
static const int HEIGHT = 480;
|
|
static const bool IS_FULLSCREEN = false;
|
|
|
|
/*
|
|
* Browser class API
|
|
*/
|
|
public:
|
|
|
|
Browser(
|
|
sqlite3 * db
|
|
);
|
|
|
|
// Actions
|
|
int session_restore(); // return sqlite3_finalize status code
|
|
void session_clean();
|
|
void session_save();
|
|
};
|
|
}
|
|
|
|
#endif // APP_BROWSER_HPP
|