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
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
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);
|
2010-09-25 17:46:12 +02:00
|
|
|
void enable_widget (const char *name, unsigned char state);
|
|
|
|
void set_button_label (const char *name, const char *label);
|
|
|
|
unsigned char get_check (const char *name);
|
|
|
|
unsigned int get_entry_value (const char *name);
|
|
|
|
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);
|
|
|
|
void set_check (const char *name, unsigned char value);
|
|
|
|
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);
|
|
|
|
int has_focus (const char *widget);
|
|
|
|
|
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 */
|