2018-11-16 00:42:29 +01:00
|
|
|
/*****************************************************************************\
|
|
|
|
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
|
|
|
|
This file is licensed under the Snes9x License.
|
|
|
|
For further information, consult the LICENSE file in the root directory.
|
|
|
|
\*****************************************************************************/
|
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
#ifndef __GTK_BUILDER_WINDOW_H
|
|
|
|
#define __GTK_BUILDER_WINDOW_H
|
2010-09-25 17:46:12 +02:00
|
|
|
|
2018-11-07 01:46:44 +01:00
|
|
|
#include "gtk_2_3_compat.h"
|
2010-09-25 17:46:12 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const char *signal;
|
|
|
|
GCallback function;
|
2010-09-26 11:19:15 +02:00
|
|
|
} GtkBuilderWindowCallbacks;
|
2010-09-25 17:46:12 +02:00
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
class GtkBuilderWindow
|
2010-09-25 17:46:12 +02:00
|
|
|
{
|
|
|
|
public:
|
2010-09-26 11:19:15 +02:00
|
|
|
GtkBuilderWindow (const char *root);
|
|
|
|
~GtkBuilderWindow ();
|
2010-09-25 17:46:12 +02:00
|
|
|
GtkWidget *get_widget (const char *name);
|
|
|
|
void resize (int width, int height);
|
2018-11-02 21:52:26 +01:00
|
|
|
GtkWindow *get_window ();
|
|
|
|
void refresh ();
|
|
|
|
int get_width ();
|
|
|
|
int get_height ();
|
2010-09-25 17:46:12 +02:00
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
void signal_connect (GtkBuilderWindowCallbacks *callbacks);
|
2018-12-28 23:32:32 +01:00
|
|
|
void enable_widget (const char *name, bool state);
|
2010-09-25 17:46:12 +02:00
|
|
|
void set_button_label (const char *name, const char *label);
|
|
|
|
unsigned char get_check (const char *name);
|
2018-12-28 23:32:32 +01:00
|
|
|
int get_entry_value (const char *name);
|
2010-09-25 17:46:12 +02:00
|
|
|
const char *get_entry_text (const char *name);
|
|
|
|
unsigned char get_combo (const char *name);
|
2011-02-05 13:36:27 +01:00
|
|
|
void combo_box_append (const char *name, const char *value);
|
|
|
|
void combo_box_append (GtkComboBox *combo, const char *value);
|
2017-11-20 20:06:13 +01:00
|
|
|
double get_spin (const char *name);
|
2010-09-25 17:46:12 +02:00
|
|
|
float get_slider (const char *name);
|
2018-12-28 23:32:32 +01:00
|
|
|
void set_check (const char *name, bool value);
|
2010-09-25 17:46:12 +02:00
|
|
|
void set_entry_value (const char *name, unsigned int value);
|
|
|
|
void set_entry_text (const char *name, const char *text);
|
|
|
|
void set_combo (const char *name, unsigned char value);
|
2017-11-20 20:06:13 +01:00
|
|
|
void set_spin (const char *name, double value);
|
2010-09-25 17:46:12 +02:00
|
|
|
void set_slider (const char *name, float value);
|
2018-12-28 23:32:32 +01:00
|
|
|
bool has_focus (const char *widget);
|
2010-09-25 17:46:12 +02:00
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
protected:
|
|
|
|
static void signal_connection_func (GtkBuilder *, GObject *, const gchar *, const char *, GObject *, GConnectFlags, gpointer);
|
|
|
|
|
|
|
|
GtkWidget *window;
|
|
|
|
GtkBuilder *builder;
|
|
|
|
GtkBuilderWindowCallbacks *callbacks;
|
2010-09-25 17:46:12 +02:00
|
|
|
};
|
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
#endif /* __GTK_BUILDER_WINDOW_H */
|