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);
|
|
|
|
GtkWindow *get_window (void);
|
|
|
|
void refresh (void);
|
|
|
|
int get_width (void);
|
|
|
|
int get_height (void);
|
|
|
|
|
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);
|
2010-09-25 17:46:12 +02:00
|
|
|
unsigned int get_spin (const char *name);
|
|
|
|
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);
|
|
|
|
void set_spin (const char *name, unsigned int value);
|
|
|
|
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 */
|