mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 01:32:25 +00:00
GTK 3 prep: use the glib names for base object types.
All the things like GtkType, GtkObject, gtk_signal_connect and so on should now consistently have the new-style glib names like GType, GObject, g_signal_connect, etc.
This commit is contained in:
parent
2ac190c06d
commit
1e4273a929
@ -254,14 +254,14 @@ static const char *gtk_askpass_setup(struct askpass_ctx *ctx,
|
|||||||
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_action_area
|
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_action_area
|
||||||
(GTK_DIALOG(ctx->dialog))),
|
(GTK_DIALOG(ctx->dialog))),
|
||||||
ctx->drawingareas[i].area);
|
ctx->drawingareas[i].area);
|
||||||
gtk_signal_connect(GTK_OBJECT(ctx->drawingareas[i].area),
|
g_signal_connect(G_OBJECT(ctx->drawingareas[i].area),
|
||||||
"configure_event",
|
"configure_event",
|
||||||
GTK_SIGNAL_FUNC(configure_area),
|
G_CALLBACK(configure_area),
|
||||||
&ctx->drawingareas[i]);
|
&ctx->drawingareas[i]);
|
||||||
gtk_signal_connect(GTK_OBJECT(ctx->drawingareas[i].area),
|
g_signal_connect(G_OBJECT(ctx->drawingareas[i].area),
|
||||||
"expose_event",
|
"expose_event",
|
||||||
GTK_SIGNAL_FUNC(expose_area),
|
G_CALLBACK(expose_area),
|
||||||
&ctx->drawingareas[i]);
|
&ctx->drawingareas[i]);
|
||||||
gtk_widget_show(ctx->drawingareas[i].area);
|
gtk_widget_show(ctx->drawingareas[i].area);
|
||||||
}
|
}
|
||||||
ctx->active_area = rand() % N_DRAWING_AREAS;
|
ctx->active_area = rand() % N_DRAWING_AREAS;
|
||||||
@ -300,10 +300,10 @@ static const char *gtk_askpass_setup(struct askpass_ctx *ctx,
|
|||||||
g_signal_connect(G_OBJECT(ctx->imc), "commit",
|
g_signal_connect(G_OBJECT(ctx->imc), "commit",
|
||||||
G_CALLBACK(input_method_commit_event), ctx);
|
G_CALLBACK(input_method_commit_event), ctx);
|
||||||
#endif
|
#endif
|
||||||
gtk_signal_connect(GTK_OBJECT(ctx->promptlabel), "key_press_event",
|
g_signal_connect(G_OBJECT(ctx->promptlabel), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(key_event), ctx);
|
G_CALLBACK(key_event), ctx);
|
||||||
gtk_signal_connect(GTK_OBJECT(ctx->promptlabel), "key_release_event",
|
g_signal_connect(G_OBJECT(ctx->promptlabel), "key_release_event",
|
||||||
GTK_SIGNAL_FUNC(key_event), ctx);
|
G_CALLBACK(key_event), ctx);
|
||||||
#if GTK_CHECK_VERSION(2,0,0)
|
#if GTK_CHECK_VERSION(2,0,0)
|
||||||
gtk_im_context_set_client_window(ctx->imc,
|
gtk_im_context_set_client_window(ctx->imc,
|
||||||
gtk_widget_get_window(ctx->dialog));
|
gtk_widget_get_window(ctx->dialog));
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
* gtkcols.c - implementation of the `Columns' GTK layout container.
|
* gtkcols.c - implementation of the `Columns' GTK layout container.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gtkcols.h"
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include "gtkcompat.h"
|
#include "gtkcompat.h"
|
||||||
|
#include "gtkcols.h"
|
||||||
|
|
||||||
static void columns_init(Columns *cols);
|
static void columns_init(Columns *cols);
|
||||||
static void columns_class_init(ColumnsClass *klass);
|
static void columns_class_init(ColumnsClass *klass);
|
||||||
@ -21,16 +21,16 @@ static void columns_forall(GtkContainer *container, gboolean include_internals,
|
|||||||
#if !GTK_CHECK_VERSION(2,0,0)
|
#if !GTK_CHECK_VERSION(2,0,0)
|
||||||
static gint columns_focus(GtkContainer *container, GtkDirectionType dir);
|
static gint columns_focus(GtkContainer *container, GtkDirectionType dir);
|
||||||
#endif
|
#endif
|
||||||
static GtkType columns_child_type(GtkContainer *container);
|
static GType columns_child_type(GtkContainer *container);
|
||||||
static void columns_size_request(GtkWidget *widget, GtkRequisition *req);
|
static void columns_size_request(GtkWidget *widget, GtkRequisition *req);
|
||||||
static void columns_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
|
static void columns_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
|
||||||
|
|
||||||
static GtkContainerClass *parent_class = NULL;
|
static GtkContainerClass *parent_class = NULL;
|
||||||
|
|
||||||
#if !GTK_CHECK_VERSION(2,0,0)
|
#if !GTK_CHECK_VERSION(2,0,0)
|
||||||
GtkType columns_get_type(void)
|
GType columns_get_type(void)
|
||||||
{
|
{
|
||||||
static GtkType columns_type = 0;
|
static GType columns_type = 0;
|
||||||
|
|
||||||
if (!columns_type) {
|
if (!columns_type) {
|
||||||
static const GtkTypeInfo columns_info = {
|
static const GtkTypeInfo columns_info = {
|
||||||
@ -319,7 +319,7 @@ static void columns_forall(GtkContainer *container, gboolean include_internals,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkType columns_child_type(GtkContainer *container)
|
static GType columns_child_type(GtkContainer *container)
|
||||||
{
|
{
|
||||||
return GTK_TYPE_WIDGET;
|
return GTK_TYPE_WIDGET;
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,11 @@ extern "C" {
|
|||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#define TYPE_COLUMNS (columns_get_type())
|
#define TYPE_COLUMNS (columns_get_type())
|
||||||
#define COLUMNS(obj) (GTK_CHECK_CAST((obj), TYPE_COLUMNS, Columns))
|
#define COLUMNS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_COLUMNS, Columns))
|
||||||
#define COLUMNS_CLASS(klass) \
|
#define COLUMNS_CLASS(klass) \
|
||||||
(GTK_CHECK_CLASS_CAST((klass), TYPE_COLUMNS, ColumnsClass))
|
(G_TYPE_CHECK_CLASS_CAST((klass), TYPE_COLUMNS, ColumnsClass))
|
||||||
#define IS_COLUMNS(obj) (GTK_CHECK_TYPE((obj), TYPE_COLUMNS))
|
#define IS_COLUMNS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_COLUMNS))
|
||||||
#define IS_COLUMNS_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), TYPE_COLUMNS))
|
#define IS_COLUMNS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_COLUMNS))
|
||||||
|
|
||||||
typedef struct Columns_tag Columns;
|
typedef struct Columns_tag Columns;
|
||||||
typedef struct ColumnsClass_tag ColumnsClass;
|
typedef struct ColumnsClass_tag ColumnsClass;
|
||||||
@ -47,7 +47,7 @@ struct ColumnsChild_tag {
|
|||||||
gint *percentages;
|
gint *percentages;
|
||||||
};
|
};
|
||||||
|
|
||||||
GtkType columns_get_type(void);
|
GType columns_get_type(void);
|
||||||
GtkWidget *columns_new(gint spacing);
|
GtkWidget *columns_new(gint spacing);
|
||||||
void columns_set_cols(Columns *cols, gint ncols, const gint *percentages);
|
void columns_set_cols(Columns *cols, gint ncols, const gint *percentages);
|
||||||
void columns_add(Columns *cols, GtkWidget *child,
|
void columns_add(Columns *cols, GtkWidget *child,
|
||||||
|
@ -16,12 +16,24 @@
|
|||||||
#define gtk1_widget_set_unset_flag(w, flag, b) \
|
#define gtk1_widget_set_unset_flag(w, flag, b) \
|
||||||
((b) ? GTK_WIDGET_SET_FLAGS(w, flag) : GTK_WIDGET_UNSET_FLAGS(w, flag))
|
((b) ? GTK_WIDGET_SET_FLAGS(w, flag) : GTK_WIDGET_UNSET_FLAGS(w, flag))
|
||||||
|
|
||||||
|
#define GType GtkType
|
||||||
|
#define GObject GtkObject
|
||||||
#define G_CALLBACK(x) GTK_SIGNAL_FUNC(x)
|
#define G_CALLBACK(x) GTK_SIGNAL_FUNC(x)
|
||||||
#define G_OBJECT(x) GTK_OBJECT(x)
|
#define G_OBJECT(x) GTK_OBJECT(x)
|
||||||
|
#define G_TYPE_CHECK_INSTANCE_TYPE GTK_CHECK_TYPE
|
||||||
|
#define G_TYPE_CHECK_INSTANCE_CAST GTK_CHECK_CAST
|
||||||
|
#define G_TYPE_CHECK_CLASS_TYPE GTK_CHECK_CLASS_TYPE
|
||||||
|
#define G_TYPE_CHECK_CLASS_CAST GTK_CHECK_CLASS_CAST
|
||||||
|
|
||||||
#define g_ascii_isspace(x) (isspace((unsigned char)(x)))
|
#define g_ascii_isspace(x) (isspace((unsigned char)(x)))
|
||||||
#define g_signal_connect gtk_signal_connect
|
#define g_signal_connect gtk_signal_connect
|
||||||
|
#define g_signal_connect_swapped gtk_signal_connect_object
|
||||||
|
#define g_signal_stop_emission_by_name gtk_signal_emit_stop_by_name
|
||||||
|
#define g_signal_emit_by_name gtk_signal_emit_by_name
|
||||||
|
#define g_signal_handler_disconnect gtk_signal_disconnect
|
||||||
|
#define g_object_get_data gtk_object_get_data
|
||||||
#define g_object_set_data gtk_object_set_data
|
#define g_object_set_data gtk_object_set_data
|
||||||
|
#define g_object_ref_sink gtk_object_sink
|
||||||
|
|
||||||
#define GDK_GRAB_SUCCESS GrabSuccess
|
#define GDK_GRAB_SUCCESS GrabSuccess
|
||||||
|
|
||||||
|
384
unix/gtkdlg.c
384
unix/gtkdlg.c
@ -454,10 +454,10 @@ void dlg_listbox_addwithid(union control *ctrl, void *dlg,
|
|||||||
gtk_container_add(GTK_CONTAINER(uc->menu), menuitem);
|
gtk_container_add(GTK_CONTAINER(uc->menu), menuitem);
|
||||||
gtk_widget_show(menuitem);
|
gtk_widget_show(menuitem);
|
||||||
|
|
||||||
gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
|
g_object_set_data(G_OBJECT(menuitem), "user-data",
|
||||||
GINT_TO_POINTER(id));
|
GINT_TO_POINTER(id));
|
||||||
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
|
g_signal_connect(G_OBJECT(menuitem), "activate",
|
||||||
GTK_SIGNAL_FUNC(menuitem_activate), dp);
|
G_CALLBACK(menuitem_activate), dp);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (uc->list && uc->entry) {
|
if (uc->list && uc->entry) {
|
||||||
@ -471,8 +471,8 @@ void dlg_listbox_addwithid(union control *ctrl, void *dlg,
|
|||||||
gtk_container_add(GTK_CONTAINER(uc->list), listitem);
|
gtk_container_add(GTK_CONTAINER(uc->list), listitem);
|
||||||
gtk_widget_show(listitem);
|
gtk_widget_show(listitem);
|
||||||
|
|
||||||
gtk_object_set_data(GTK_OBJECT(listitem), "user-data",
|
g_object_set_data(G_OBJECT(listitem), "user-data",
|
||||||
GINT_TO_POINTER(id));
|
GINT_TO_POINTER(id));
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -526,20 +526,20 @@ void dlg_listbox_addwithid(union control *ctrl, void *dlg,
|
|||||||
gtk_widget_show(listitem);
|
gtk_widget_show(listitem);
|
||||||
|
|
||||||
if (ctrl->listbox.multisel) {
|
if (ctrl->listbox.multisel) {
|
||||||
gtk_signal_connect(GTK_OBJECT(listitem), "key_press_event",
|
g_signal_connect(G_OBJECT(listitem), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(listitem_multi_key), uc->adj);
|
G_CALLBACK(listitem_multi_key), uc->adj);
|
||||||
} else {
|
} else {
|
||||||
gtk_signal_connect(GTK_OBJECT(listitem), "key_press_event",
|
g_signal_connect(G_OBJECT(listitem), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(listitem_single_key), uc->adj);
|
G_CALLBACK(listitem_single_key), uc->adj);
|
||||||
}
|
}
|
||||||
gtk_signal_connect(GTK_OBJECT(listitem), "focus_in_event",
|
g_signal_connect(G_OBJECT(listitem), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(listitem), "button_press_event",
|
g_signal_connect(G_OBJECT(listitem), "button_press_event",
|
||||||
GTK_SIGNAL_FUNC(listitem_button_press), dp);
|
G_CALLBACK(listitem_button_press), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(listitem), "button_release_event",
|
g_signal_connect(G_OBJECT(listitem), "button_release_event",
|
||||||
GTK_SIGNAL_FUNC(listitem_button_release), dp);
|
G_CALLBACK(listitem_button_release), dp);
|
||||||
gtk_object_set_data(GTK_OBJECT(listitem), "user-data",
|
g_object_set_data(G_OBJECT(listitem), "user-data",
|
||||||
GINT_TO_POINTER(id));
|
GINT_TO_POINTER(id));
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -587,15 +587,14 @@ int dlg_listbox_getid(union control *ctrl, void *dlg, int index)
|
|||||||
#if !GTK_CHECK_VERSION(2,4,0)
|
#if !GTK_CHECK_VERSION(2,4,0)
|
||||||
if (uc->menu || uc->list) {
|
if (uc->menu || uc->list) {
|
||||||
GList *children;
|
GList *children;
|
||||||
GtkObject *item;
|
GObject *item;
|
||||||
|
|
||||||
children = gtk_container_children(GTK_CONTAINER(uc->menu ? uc->menu :
|
children = gtk_container_children(GTK_CONTAINER(uc->menu ? uc->menu :
|
||||||
uc->list));
|
uc->list));
|
||||||
item = GTK_OBJECT(g_list_nth_data(children, index));
|
item = G_OBJECT(g_list_nth_data(children, index));
|
||||||
g_list_free(children);
|
g_list_free(children);
|
||||||
|
|
||||||
return GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(item),
|
return GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), "user-data"));
|
||||||
"user-data"));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if GTK_CHECK_VERSION(2,0,0)
|
#if GTK_CHECK_VERSION(2,0,0)
|
||||||
@ -1083,10 +1082,10 @@ void dlg_error_msg(void *dlg, const char *msg)
|
|||||||
gtk_widget_show(ok);
|
gtk_widget_show(ok);
|
||||||
gtk_widget_set_can_default(ok, TRUE);
|
gtk_widget_set_can_default(ok, TRUE);
|
||||||
gtk_window_set_default(GTK_WINDOW(window), ok);
|
gtk_window_set_default(GTK_WINDOW(window), ok);
|
||||||
gtk_signal_connect(GTK_OBJECT(ok), "clicked",
|
g_signal_connect(G_OBJECT(ok), "clicked",
|
||||||
GTK_SIGNAL_FUNC(errmsg_button_clicked), window);
|
G_CALLBACK(errmsg_button_clicked), window);
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "destroy",
|
g_signal_connect(G_OBJECT(window), "destroy",
|
||||||
GTK_SIGNAL_FUNC(window_destroy), NULL);
|
G_CALLBACK(window_destroy), NULL);
|
||||||
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
|
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
|
||||||
gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(dp->window));
|
gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(dp->window));
|
||||||
set_transient_window_pos(dp->window, window);
|
set_transient_window_pos(dp->window, window);
|
||||||
@ -1166,17 +1165,17 @@ void dlg_coloursel_start(union control *ctrl, void *dlg, int r, int g, int b)
|
|||||||
(gpointer)coloursel);
|
(gpointer)coloursel);
|
||||||
g_object_set_data(G_OBJECT(cancelbutton), "user-data",
|
g_object_set_data(G_OBJECT(cancelbutton), "user-data",
|
||||||
(gpointer)coloursel);
|
(gpointer)coloursel);
|
||||||
gtk_object_set_data(GTK_OBJECT(coloursel), "user-data", (gpointer)uc);
|
g_object_set_data(G_OBJECT(coloursel), "user-data", (gpointer)uc);
|
||||||
gtk_signal_connect(GTK_OBJECT(okbutton), "clicked",
|
g_signal_connect(G_OBJECT(okbutton), "clicked",
|
||||||
GTK_SIGNAL_FUNC(coloursel_ok), (gpointer)dp);
|
G_CALLBACK(coloursel_ok), (gpointer)dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(cancelbutton), "clicked",
|
g_signal_connect(G_OBJECT(cancelbutton), "clicked",
|
||||||
GTK_SIGNAL_FUNC(coloursel_cancel), (gpointer)dp);
|
G_CALLBACK(coloursel_cancel), (gpointer)dp);
|
||||||
gtk_signal_connect_object(GTK_OBJECT(okbutton), "clicked",
|
g_signal_connect_swapped(G_OBJECT(okbutton), "clicked",
|
||||||
GTK_SIGNAL_FUNC(gtk_widget_destroy),
|
G_CALLBACK(gtk_widget_destroy),
|
||||||
(gpointer)coloursel);
|
(gpointer)coloursel);
|
||||||
gtk_signal_connect_object(GTK_OBJECT(cancelbutton), "clicked",
|
g_signal_connect_swapped(G_OBJECT(cancelbutton), "clicked",
|
||||||
GTK_SIGNAL_FUNC(gtk_widget_destroy),
|
G_CALLBACK(gtk_widget_destroy),
|
||||||
(gpointer)coloursel);
|
(gpointer)coloursel);
|
||||||
gtk_widget_show(coloursel);
|
gtk_widget_show(coloursel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1246,9 +1245,9 @@ static gboolean editbox_key(GtkWidget *widget, GdkEventKey *event,
|
|||||||
GtkWidget *parent = gtk_widget_get_parent(widget);
|
GtkWidget *parent = gtk_widget_get_parent(widget);
|
||||||
if (event->keyval == GDK_KEY_Return && parent != NULL) {
|
if (event->keyval == GDK_KEY_Return && parent != NULL) {
|
||||||
gboolean return_val;
|
gboolean return_val;
|
||||||
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
|
g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event");
|
||||||
gtk_signal_emit_by_name(GTK_OBJECT(parent), "key_press_event",
|
g_signal_emit_by_name(G_OBJECT(parent), "key_press_event",
|
||||||
event, &return_val);
|
event, &return_val);
|
||||||
return return_val;
|
return return_val;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1306,7 +1305,7 @@ static gboolean listitem_key(GtkWidget *item, GdkEventKey *event,
|
|||||||
*/
|
*/
|
||||||
GtkWidget *list = item->parent;
|
GtkWidget *list = item->parent;
|
||||||
|
|
||||||
gtk_signal_emit_stop_by_name(GTK_OBJECT(item), "key_press_event");
|
g_signal_stop_emission_by_name(G_OBJECT(item), "key_press_event");
|
||||||
|
|
||||||
if (!multiple &&
|
if (!multiple &&
|
||||||
GTK_WIDGET_STATE(item) != GTK_STATE_SELECTED) {
|
GTK_WIDGET_STATE(item) != GTK_STATE_SELECTED) {
|
||||||
@ -1545,7 +1544,7 @@ static void menuitem_activate(GtkMenuItem *item, gpointer data)
|
|||||||
{
|
{
|
||||||
struct dlgparam *dp = (struct dlgparam *)data;
|
struct dlgparam *dp = (struct dlgparam *)data;
|
||||||
GtkWidget *menushell = GTK_WIDGET(item)->parent;
|
GtkWidget *menushell = GTK_WIDGET(item)->parent;
|
||||||
gpointer optmenu = gtk_object_get_data(GTK_OBJECT(menushell), "user-data");
|
gpointer optmenu = g_object_get_data(G_OBJECT(menushell), "user-data");
|
||||||
struct uctrl *uc = dlg_find_bywidget(dp, GTK_WIDGET(optmenu));
|
struct uctrl *uc = dlg_find_bywidget(dp, GTK_WIDGET(optmenu));
|
||||||
uc->ctrl->generic.handler(uc->ctrl, dp, dp->data, EVENT_SELCHANGE);
|
uc->ctrl->generic.handler(uc->ctrl, dp, dp->data, EVENT_SELCHANGE);
|
||||||
}
|
}
|
||||||
@ -1565,8 +1564,8 @@ static void droplist_selchange(GtkComboBox *combo, gpointer data)
|
|||||||
static void filesel_ok(GtkButton *button, gpointer data)
|
static void filesel_ok(GtkButton *button, gpointer data)
|
||||||
{
|
{
|
||||||
/* struct dlgparam *dp = (struct dlgparam *)data; */
|
/* struct dlgparam *dp = (struct dlgparam *)data; */
|
||||||
gpointer filesel = gtk_object_get_data(GTK_OBJECT(button), "user-data");
|
gpointer filesel = g_object_get_data(G_OBJECT(button), "user-data");
|
||||||
struct uctrl *uc = gtk_object_get_data(GTK_OBJECT(filesel), "user-data");
|
struct uctrl *uc = g_object_get_data(G_OBJECT(filesel), "user-data");
|
||||||
const char *name = gtk_file_selection_get_filename
|
const char *name = gtk_file_selection_get_filename
|
||||||
(GTK_FILE_SELECTION(filesel));
|
(GTK_FILE_SELECTION(filesel));
|
||||||
gtk_entry_set_text(GTK_ENTRY(uc->entry), name);
|
gtk_entry_set_text(GTK_ENTRY(uc->entry), name);
|
||||||
@ -1578,16 +1577,16 @@ static void fontsel_ok(GtkButton *button, gpointer data)
|
|||||||
|
|
||||||
#if !GTK_CHECK_VERSION(2,0,0)
|
#if !GTK_CHECK_VERSION(2,0,0)
|
||||||
|
|
||||||
gpointer fontsel = gtk_object_get_data(GTK_OBJECT(button), "user-data");
|
gpointer fontsel = g_object_get_data(G_OBJECT(button), "user-data");
|
||||||
struct uctrl *uc = gtk_object_get_data(GTK_OBJECT(fontsel), "user-data");
|
struct uctrl *uc = g_object_get_data(G_OBJECT(fontsel), "user-data");
|
||||||
const char *name = gtk_font_selection_dialog_get_font_name
|
const char *name = gtk_font_selection_dialog_get_font_name
|
||||||
(GTK_FONT_SELECTION_DIALOG(fontsel));
|
(GTK_FONT_SELECTION_DIALOG(fontsel));
|
||||||
gtk_entry_set_text(GTK_ENTRY(uc->entry), name);
|
gtk_entry_set_text(GTK_ENTRY(uc->entry), name);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
unifontsel *fontsel = (unifontsel *)gtk_object_get_data
|
unifontsel *fontsel = (unifontsel *)g_object_get_data
|
||||||
(GTK_OBJECT(button), "user-data");
|
(G_OBJECT(button), "user-data");
|
||||||
struct uctrl *uc = (struct uctrl *)fontsel->user_data;
|
struct uctrl *uc = (struct uctrl *)fontsel->user_data;
|
||||||
char *name = unifontsel_get_name(fontsel);
|
char *name = unifontsel_get_name(fontsel);
|
||||||
assert(name); /* should always be ok after OK pressed */
|
assert(name); /* should always be ok after OK pressed */
|
||||||
@ -1600,8 +1599,8 @@ static void fontsel_ok(GtkButton *button, gpointer data)
|
|||||||
static void coloursel_ok(GtkButton *button, gpointer data)
|
static void coloursel_ok(GtkButton *button, gpointer data)
|
||||||
{
|
{
|
||||||
struct dlgparam *dp = (struct dlgparam *)data;
|
struct dlgparam *dp = (struct dlgparam *)data;
|
||||||
gpointer coloursel = gtk_object_get_data(GTK_OBJECT(button), "user-data");
|
gpointer coloursel = g_object_get_data(G_OBJECT(button), "user-data");
|
||||||
struct uctrl *uc = gtk_object_get_data(GTK_OBJECT(coloursel), "user-data");
|
struct uctrl *uc = g_object_get_data(G_OBJECT(coloursel), "user-data");
|
||||||
GtkColorSelection *cs = GTK_COLOR_SELECTION
|
GtkColorSelection *cs = GTK_COLOR_SELECTION
|
||||||
(gtk_color_selection_dialog_get_color_selection
|
(gtk_color_selection_dialog_get_color_selection
|
||||||
(GTK_COLOR_SELECTION_DIALOG(coloursel)));
|
(GTK_COLOR_SELECTION_DIALOG(coloursel)));
|
||||||
@ -1617,8 +1616,8 @@ static void coloursel_ok(GtkButton *button, gpointer data)
|
|||||||
static void coloursel_cancel(GtkButton *button, gpointer data)
|
static void coloursel_cancel(GtkButton *button, gpointer data)
|
||||||
{
|
{
|
||||||
struct dlgparam *dp = (struct dlgparam *)data;
|
struct dlgparam *dp = (struct dlgparam *)data;
|
||||||
gpointer coloursel = gtk_object_get_data(GTK_OBJECT(button), "user-data");
|
gpointer coloursel = g_object_get_data(G_OBJECT(button), "user-data");
|
||||||
struct uctrl *uc = gtk_object_get_data(GTK_OBJECT(coloursel), "user-data");
|
struct uctrl *uc = g_object_get_data(G_OBJECT(coloursel), "user-data");
|
||||||
dp->coloursel_result.ok = FALSE;
|
dp->coloursel_result.ok = FALSE;
|
||||||
uc->ctrl->generic.handler(uc->ctrl, dp, dp->data, EVENT_CALLBACK);
|
uc->ctrl->generic.handler(uc->ctrl, dp, dp->data, EVENT_CALLBACK);
|
||||||
}
|
}
|
||||||
@ -1632,19 +1631,19 @@ static void filefont_clicked(GtkButton *button, gpointer data)
|
|||||||
GtkWidget *filesel =
|
GtkWidget *filesel =
|
||||||
gtk_file_selection_new(uc->ctrl->fileselect.title);
|
gtk_file_selection_new(uc->ctrl->fileselect.title);
|
||||||
gtk_window_set_modal(GTK_WINDOW(filesel), TRUE);
|
gtk_window_set_modal(GTK_WINDOW(filesel), TRUE);
|
||||||
gtk_object_set_data
|
g_object_set_data
|
||||||
(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "user-data",
|
(G_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "user-data",
|
||||||
(gpointer)filesel);
|
(gpointer)filesel);
|
||||||
gtk_object_set_data(GTK_OBJECT(filesel), "user-data", (gpointer)uc);
|
g_object_set_data(G_OBJECT(filesel), "user-data", (gpointer)uc);
|
||||||
gtk_signal_connect
|
g_signal_connect
|
||||||
(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "clicked",
|
(G_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "clicked",
|
||||||
GTK_SIGNAL_FUNC(filesel_ok), (gpointer)dp);
|
G_CALLBACK(filesel_ok), (gpointer)dp);
|
||||||
gtk_signal_connect_object
|
g_signal_connect_swapped
|
||||||
(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "clicked",
|
(G_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "clicked",
|
||||||
GTK_SIGNAL_FUNC(gtk_widget_destroy), (gpointer)filesel);
|
G_CALLBACK(gtk_widget_destroy), (gpointer)filesel);
|
||||||
gtk_signal_connect_object
|
g_signal_connect_swapped
|
||||||
(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->cancel_button), "clicked",
|
(G_OBJECT(GTK_FILE_SELECTION(filesel)->cancel_button), "clicked",
|
||||||
GTK_SIGNAL_FUNC(gtk_widget_destroy), (gpointer)filesel);
|
G_CALLBACK(gtk_widget_destroy), (gpointer)filesel);
|
||||||
gtk_widget_show(filesel);
|
gtk_widget_show(filesel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1689,20 +1688,20 @@ static void filefont_clicked(GtkButton *button, gpointer data)
|
|||||||
gdk_font_unref(font);
|
gdk_font_unref(font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gtk_object_set_data
|
g_object_set_data
|
||||||
(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->ok_button),
|
(G_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->ok_button),
|
||||||
"user-data", (gpointer)fontsel);
|
"user-data", (gpointer)fontsel);
|
||||||
gtk_object_set_data(GTK_OBJECT(fontsel), "user-data", (gpointer)uc);
|
g_object_set_data(G_OBJECT(fontsel), "user-data", (gpointer)uc);
|
||||||
gtk_signal_connect
|
g_signal_connect
|
||||||
(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->ok_button),
|
(G_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->ok_button),
|
||||||
"clicked", GTK_SIGNAL_FUNC(fontsel_ok), (gpointer)dp);
|
"clicked", G_CALLBACK(fontsel_ok), (gpointer)dp);
|
||||||
gtk_signal_connect_object
|
g_signal_connect_swapped
|
||||||
(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->ok_button),
|
(G_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->ok_button),
|
||||||
"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
|
"clicked", G_CALLBACK(gtk_widget_destroy),
|
||||||
(gpointer)fontsel);
|
(gpointer)fontsel);
|
||||||
gtk_signal_connect_object
|
g_signal_connect_swapped
|
||||||
(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->cancel_button),
|
(G_OBJECT(GTK_FONT_SELECTION_DIALOG(fontsel)->cancel_button),
|
||||||
"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
|
"clicked", G_CALLBACK(gtk_widget_destroy),
|
||||||
(gpointer)fontsel);
|
(gpointer)fontsel);
|
||||||
gtk_widget_show(fontsel);
|
gtk_widget_show(fontsel);
|
||||||
|
|
||||||
@ -1717,17 +1716,17 @@ static void filefont_clicked(GtkButton *button, gpointer data)
|
|||||||
gtk_window_set_modal(fontsel->window, TRUE);
|
gtk_window_set_modal(fontsel->window, TRUE);
|
||||||
unifontsel_set_name(fontsel, fontname);
|
unifontsel_set_name(fontsel, fontname);
|
||||||
|
|
||||||
gtk_object_set_data(GTK_OBJECT(fontsel->ok_button),
|
g_object_set_data(G_OBJECT(fontsel->ok_button),
|
||||||
"user-data", (gpointer)fontsel);
|
"user-data", (gpointer)fontsel);
|
||||||
fontsel->user_data = uc;
|
fontsel->user_data = uc;
|
||||||
gtk_signal_connect(GTK_OBJECT(fontsel->ok_button), "clicked",
|
g_signal_connect(G_OBJECT(fontsel->ok_button), "clicked",
|
||||||
GTK_SIGNAL_FUNC(fontsel_ok), (gpointer)dp);
|
G_CALLBACK(fontsel_ok), (gpointer)dp);
|
||||||
gtk_signal_connect_object(GTK_OBJECT(fontsel->ok_button), "clicked",
|
g_signal_connect_swapped(G_OBJECT(fontsel->ok_button), "clicked",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_destroy),
|
G_CALLBACK(unifontsel_destroy),
|
||||||
(gpointer)fontsel);
|
(gpointer)fontsel);
|
||||||
gtk_signal_connect_object(GTK_OBJECT(fontsel->cancel_button),"clicked",
|
g_signal_connect_swapped(G_OBJECT(fontsel->cancel_button),"clicked",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_destroy),
|
G_CALLBACK(unifontsel_destroy),
|
||||||
(gpointer)fontsel);
|
(gpointer)fontsel);
|
||||||
|
|
||||||
gtk_widget_show(GTK_WIDGET(fontsel->window));
|
gtk_widget_show(GTK_WIDGET(fontsel->window));
|
||||||
|
|
||||||
@ -1744,7 +1743,7 @@ static void label_sizealloc(GtkWidget *widget, GtkAllocation *alloc,
|
|||||||
|
|
||||||
gtk_widget_set_usize(uc->text, alloc->width, -1);
|
gtk_widget_set_usize(uc->text, alloc->width, -1);
|
||||||
gtk_label_set_text(GTK_LABEL(uc->text), uc->ctrl->generic.label);
|
gtk_label_set_text(GTK_LABEL(uc->text), uc->ctrl->generic.label);
|
||||||
gtk_signal_disconnect(GTK_OBJECT(uc->text), uc->textsig);
|
g_signal_handler_disconnect(G_OBJECT(uc->text), uc->textsig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -1845,19 +1844,19 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
if (ctrl->button.iscancel)
|
if (ctrl->button.iscancel)
|
||||||
dp->cancelbutton = w;
|
dp->cancelbutton = w;
|
||||||
}
|
}
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "clicked",
|
g_signal_connect(G_OBJECT(w), "clicked",
|
||||||
GTK_SIGNAL_FUNC(button_clicked), dp);
|
G_CALLBACK(button_clicked), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "focus_in_event",
|
g_signal_connect(G_OBJECT(w), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
shortcut_add(scs, gtk_bin_get_child(GTK_BIN(w)),
|
shortcut_add(scs, gtk_bin_get_child(GTK_BIN(w)),
|
||||||
ctrl->button.shortcut, SHORTCUT_UCTRL, uc);
|
ctrl->button.shortcut, SHORTCUT_UCTRL, uc);
|
||||||
break;
|
break;
|
||||||
case CTRL_CHECKBOX:
|
case CTRL_CHECKBOX:
|
||||||
w = gtk_check_button_new_with_label(ctrl->generic.label);
|
w = gtk_check_button_new_with_label(ctrl->generic.label);
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "toggled",
|
g_signal_connect(G_OBJECT(w), "toggled",
|
||||||
GTK_SIGNAL_FUNC(button_toggled), dp);
|
G_CALLBACK(button_toggled), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "focus_in_event",
|
g_signal_connect(G_OBJECT(w), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
shortcut_add(scs, gtk_bin_get_child(GTK_BIN(w)),
|
shortcut_add(scs, gtk_bin_get_child(GTK_BIN(w)),
|
||||||
ctrl->checkbox.shortcut, SHORTCUT_UCTRL, uc);
|
ctrl->checkbox.shortcut, SHORTCUT_UCTRL, uc);
|
||||||
left = TRUE;
|
left = TRUE;
|
||||||
@ -1909,10 +1908,10 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
ctrl->radio.ncolumns - colstart : 1));
|
ctrl->radio.ncolumns - colstart : 1));
|
||||||
columns_force_left_align(COLUMNS(w), b);
|
columns_force_left_align(COLUMNS(w), b);
|
||||||
gtk_widget_show(b);
|
gtk_widget_show(b);
|
||||||
gtk_signal_connect(GTK_OBJECT(b), "toggled",
|
g_signal_connect(G_OBJECT(b), "toggled",
|
||||||
GTK_SIGNAL_FUNC(button_toggled), dp);
|
G_CALLBACK(button_toggled), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(b), "focus_in_event",
|
g_signal_connect(G_OBJECT(b), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
if (ctrl->radio.shortcuts) {
|
if (ctrl->radio.shortcuts) {
|
||||||
shortcut_add(scs, gtk_bin_get_child(GTK_BIN(b)),
|
shortcut_add(scs, gtk_bin_get_child(GTK_BIN(b)),
|
||||||
ctrl->radio.shortcuts[i],
|
ctrl->radio.shortcuts[i],
|
||||||
@ -1957,16 +1956,16 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
signalobject = w;
|
signalobject = w;
|
||||||
}
|
}
|
||||||
uc->entrysig =
|
uc->entrysig =
|
||||||
gtk_signal_connect(GTK_OBJECT(signalobject), "changed",
|
g_signal_connect(G_OBJECT(signalobject), "changed",
|
||||||
GTK_SIGNAL_FUNC(editbox_changed), dp);
|
G_CALLBACK(editbox_changed), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(signalobject), "key_press_event",
|
g_signal_connect(G_OBJECT(signalobject), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(editbox_key), dp);
|
G_CALLBACK(editbox_key), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(signalobject), "focus_in_event",
|
g_signal_connect(G_OBJECT(signalobject), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(signalobject), "focus_out_event",
|
g_signal_connect(G_OBJECT(signalobject), "focus_out_event",
|
||||||
GTK_SIGNAL_FUNC(editbox_lostfocus), dp);
|
G_CALLBACK(editbox_lostfocus), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(signalobject), "focus_out_event",
|
g_signal_connect(G_OBJECT(signalobject), "focus_out_event",
|
||||||
GTK_SIGNAL_FUNC(editbox_lostfocus), dp);
|
G_CALLBACK(editbox_lostfocus), dp);
|
||||||
/*
|
/*
|
||||||
* Edit boxes, for some strange reason, have a minimum
|
* Edit boxes, for some strange reason, have a minimum
|
||||||
* width of 150 in GTK 1.2. We don't want this - we'd
|
* width of 150 in GTK 1.2. We don't want this - we'd
|
||||||
@ -2049,17 +2048,17 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
columns_add(COLUMNS(w), ww, 1, 1);
|
columns_add(COLUMNS(w), ww, 1, 1);
|
||||||
gtk_widget_show(ww);
|
gtk_widget_show(ww);
|
||||||
|
|
||||||
gtk_signal_connect(GTK_OBJECT(uc->entry), "key_press_event",
|
g_signal_connect(G_OBJECT(uc->entry), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(editbox_key), dp);
|
G_CALLBACK(editbox_key), dp);
|
||||||
uc->entrysig =
|
uc->entrysig =
|
||||||
gtk_signal_connect(GTK_OBJECT(uc->entry), "changed",
|
g_signal_connect(G_OBJECT(uc->entry), "changed",
|
||||||
GTK_SIGNAL_FUNC(editbox_changed), dp);
|
G_CALLBACK(editbox_changed), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(uc->entry), "focus_in_event",
|
g_signal_connect(G_OBJECT(uc->entry), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(uc->button), "focus_in_event",
|
g_signal_connect(G_OBJECT(uc->button), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(ww), "clicked",
|
g_signal_connect(G_OBJECT(ww), "clicked",
|
||||||
GTK_SIGNAL_FUNC(filefont_clicked), dp);
|
G_CALLBACK(filefont_clicked), dp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CTRL_LISTBOX:
|
case CTRL_LISTBOX:
|
||||||
@ -2106,10 +2105,10 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
uc->optmenu = w = gtk_option_menu_new();
|
uc->optmenu = w = gtk_option_menu_new();
|
||||||
uc->menu = gtk_menu_new();
|
uc->menu = gtk_menu_new();
|
||||||
gtk_option_menu_set_menu(GTK_OPTION_MENU(w), uc->menu);
|
gtk_option_menu_set_menu(GTK_OPTION_MENU(w), uc->menu);
|
||||||
gtk_object_set_data(GTK_OBJECT(uc->menu), "user-data",
|
g_object_set_data(G_OBJECT(uc->menu), "user-data",
|
||||||
(gpointer)uc->optmenu);
|
(gpointer)uc->optmenu);
|
||||||
gtk_signal_connect(GTK_OBJECT(uc->optmenu), "focus_in_event",
|
g_signal_connect(G_OBJECT(uc->optmenu), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* Late-GTK2 style using a GtkComboBox.
|
* Late-GTK2 style using a GtkComboBox.
|
||||||
@ -2166,10 +2165,10 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
(GTK_SCROLLED_WINDOW(w));
|
(GTK_SCROLLED_WINDOW(w));
|
||||||
|
|
||||||
gtk_widget_show(uc->list);
|
gtk_widget_show(uc->list);
|
||||||
gtk_signal_connect(GTK_OBJECT(uc->list), "selection-changed",
|
g_signal_connect(G_OBJECT(uc->list), "selection-changed",
|
||||||
GTK_SIGNAL_FUNC(list_selchange), dp);
|
G_CALLBACK(list_selchange), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(uc->list), "focus_in_event",
|
g_signal_connect(G_OBJECT(uc->list), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adjust the height of the scrolled window to the
|
* Adjust the height of the scrolled window to the
|
||||||
@ -2209,17 +2208,17 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
button = gtk_button_new_with_label("Up");
|
button = gtk_button_new_with_label("Up");
|
||||||
columns_add(COLUMNS(cols), button, 1, 1);
|
columns_add(COLUMNS(cols), button, 1, 1);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked",
|
g_signal_connect(G_OBJECT(button), "clicked",
|
||||||
GTK_SIGNAL_FUNC(draglist_up), dp);
|
G_CALLBACK(draglist_up), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "focus_in_event",
|
g_signal_connect(G_OBJECT(button), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
button = gtk_button_new_with_label("Down");
|
button = gtk_button_new_with_label("Down");
|
||||||
columns_add(COLUMNS(cols), button, 1, 1);
|
columns_add(COLUMNS(cols), button, 1, 1);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked",
|
g_signal_connect(G_OBJECT(button), "clicked",
|
||||||
GTK_SIGNAL_FUNC(draglist_down), dp);
|
G_CALLBACK(draglist_down), dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "focus_in_event",
|
g_signal_connect(G_OBJECT(button), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), dp);
|
G_CALLBACK(widget_focus), dp);
|
||||||
|
|
||||||
w = cols;
|
w = cols;
|
||||||
}
|
}
|
||||||
@ -2243,8 +2242,8 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
(sel, ctrl->listbox.multisel ? GTK_SELECTION_MULTIPLE :
|
(sel, ctrl->listbox.multisel ? GTK_SELECTION_MULTIPLE :
|
||||||
GTK_SELECTION_SINGLE);
|
GTK_SELECTION_SINGLE);
|
||||||
uc->treeview = w;
|
uc->treeview = w;
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "row-activated",
|
g_signal_connect(G_OBJECT(w), "row-activated",
|
||||||
GTK_SIGNAL_FUNC(listbox_doubleclick), dp);
|
G_CALLBACK(listbox_doubleclick), dp);
|
||||||
g_signal_connect(G_OBJECT(sel), "changed",
|
g_signal_connect(G_OBJECT(sel), "changed",
|
||||||
G_CALLBACK(listbox_selchange), dp);
|
G_CALLBACK(listbox_selchange), dp);
|
||||||
|
|
||||||
@ -2271,10 +2270,10 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
*/
|
*/
|
||||||
cellrend = gtk_cell_renderer_text_new();
|
cellrend = gtk_cell_renderer_text_new();
|
||||||
if (!ctrl->listbox.hscroll) {
|
if (!ctrl->listbox.hscroll) {
|
||||||
gtk_object_set(GTK_OBJECT(cellrend),
|
g_object_set(G_OBJECT(cellrend),
|
||||||
"ellipsize", PANGO_ELLIPSIZE_END,
|
"ellipsize", PANGO_ELLIPSIZE_END,
|
||||||
"ellipsize-set", TRUE,
|
"ellipsize-set", TRUE,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
column = gtk_tree_view_column_new_with_attributes
|
column = gtk_tree_view_column_new_with_attributes
|
||||||
("heading", cellrend, "text", i+1, (char *)NULL);
|
("heading", cellrend, "text", i+1, (char *)NULL);
|
||||||
@ -2369,8 +2368,8 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
|||||||
gtk_misc_set_alignment(GTK_MISC(w), 0.0, 0.0);
|
gtk_misc_set_alignment(GTK_MISC(w), 0.0, 0.0);
|
||||||
gtk_label_set_line_wrap(GTK_LABEL(w), TRUE);
|
gtk_label_set_line_wrap(GTK_LABEL(w), TRUE);
|
||||||
uc->textsig =
|
uc->textsig =
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "size-allocate",
|
g_signal_connect(G_OBJECT(w), "size-allocate",
|
||||||
GTK_SIGNAL_FUNC(label_sizealloc), dp);
|
G_CALLBACK(label_sizealloc), dp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2475,7 +2474,7 @@ gint tree_focus(GtkContainer *container, GtkDirectionType direction,
|
|||||||
{
|
{
|
||||||
struct dlgparam *dp = (struct dlgparam *)data;
|
struct dlgparam *dp = (struct dlgparam *)data;
|
||||||
|
|
||||||
gtk_signal_emit_stop_by_name(GTK_OBJECT(container), "focus");
|
g_signal_stop_emission_by_name(G_OBJECT(container), "focus");
|
||||||
/*
|
/*
|
||||||
* If there's a focused treeitem, we return FALSE to cause the
|
* If there's a focused treeitem, we return FALSE to cause the
|
||||||
* focus to move on to some totally other control. If not, we
|
* focus to move on to some totally other control. If not, we
|
||||||
@ -2490,7 +2489,7 @@ int win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||||||
struct dlgparam *dp = (struct dlgparam *)data;
|
struct dlgparam *dp = (struct dlgparam *)data;
|
||||||
|
|
||||||
if (event->keyval == GDK_KEY_Escape && dp->cancelbutton) {
|
if (event->keyval == GDK_KEY_Escape && dp->cancelbutton) {
|
||||||
gtk_signal_emit_by_name(GTK_OBJECT(dp->cancelbutton), "clicked");
|
g_signal_emit_by_name(G_OBJECT(dp->cancelbutton), "clicked");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2522,15 +2521,13 @@ int win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||||||
case CTRL_BUTTON:
|
case CTRL_BUTTON:
|
||||||
/* Check boxes and buttons get the focus _and_ get toggled. */
|
/* Check boxes and buttons get the focus _and_ get toggled. */
|
||||||
gtk_widget_grab_focus(sc->uc->toplevel);
|
gtk_widget_grab_focus(sc->uc->toplevel);
|
||||||
gtk_signal_emit_by_name(GTK_OBJECT(sc->uc->toplevel),
|
g_signal_emit_by_name(G_OBJECT(sc->uc->toplevel), "clicked");
|
||||||
"clicked");
|
|
||||||
break;
|
break;
|
||||||
case CTRL_FILESELECT:
|
case CTRL_FILESELECT:
|
||||||
case CTRL_FONTSELECT:
|
case CTRL_FONTSELECT:
|
||||||
/* File/font selectors have their buttons pressed (ooer),
|
/* File/font selectors have their buttons pressed (ooer),
|
||||||
* and focus transferred to the edit box. */
|
* and focus transferred to the edit box. */
|
||||||
gtk_signal_emit_by_name(GTK_OBJECT(sc->uc->button),
|
g_signal_emit_by_name(G_OBJECT(sc->uc->button), "clicked");
|
||||||
"clicked");
|
|
||||||
gtk_widget_grab_focus(sc->uc->entry);
|
gtk_widget_grab_focus(sc->uc->entry);
|
||||||
break;
|
break;
|
||||||
case CTRL_RADIO:
|
case CTRL_RADIO:
|
||||||
@ -2555,8 +2552,8 @@ int win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||||||
for (i = 0; i < sc->uc->ctrl->radio.nbuttons; i++)
|
for (i = 0; i < sc->uc->ctrl->radio.nbuttons; i++)
|
||||||
if (schr == sc->uc->ctrl->radio.shortcuts[i]) {
|
if (schr == sc->uc->ctrl->radio.shortcuts[i]) {
|
||||||
gtk_widget_grab_focus(sc->uc->buttons[i]);
|
gtk_widget_grab_focus(sc->uc->buttons[i]);
|
||||||
gtk_signal_emit_by_name
|
g_signal_emit_by_name
|
||||||
(GTK_OBJECT(sc->uc->buttons[i]), "clicked");
|
(G_OBJECT(sc->uc->buttons[i]), "clicked");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2572,9 +2569,9 @@ int win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||||||
* We need to manufacture a button press event :-/ */
|
* We need to manufacture a button press event :-/ */
|
||||||
bev.type = GDK_BUTTON_PRESS;
|
bev.type = GDK_BUTTON_PRESS;
|
||||||
bev.button = 1;
|
bev.button = 1;
|
||||||
gtk_signal_emit_by_name(GTK_OBJECT(sc->uc->optmenu),
|
g_signal_emit_by_name(G_OBJECT(sc->uc->optmenu),
|
||||||
"button_press_event",
|
"button_press_event",
|
||||||
&bev, &returnval);
|
&bev, &returnval);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -2652,10 +2649,9 @@ int tree_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget),
|
g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event");
|
||||||
"key_press_event");
|
|
||||||
if (j >= 0) {
|
if (j >= 0) {
|
||||||
gtk_signal_emit_by_name(GTK_OBJECT(dp->treeitems[j]), "toggle");
|
g_signal_emit_by_name(G_OBJECT(dp->treeitems[j]), "toggle");
|
||||||
gtk_widget_grab_focus(dp->treeitems[j]);
|
gtk_widget_grab_focus(dp->treeitems[j]);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -2666,14 +2662,12 @@ int tree_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||||||
* branches.
|
* branches.
|
||||||
*/
|
*/
|
||||||
if (event->keyval == GDK_Left || event->keyval == GDK_KP_Left) {
|
if (event->keyval == GDK_Left || event->keyval == GDK_KP_Left) {
|
||||||
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget),
|
g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event");
|
||||||
"key_press_event");
|
|
||||||
gtk_tree_item_collapse(GTK_TREE_ITEM(widget));
|
gtk_tree_item_collapse(GTK_TREE_ITEM(widget));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (event->keyval == GDK_Right || event->keyval == GDK_KP_Right) {
|
if (event->keyval == GDK_Right || event->keyval == GDK_KP_Right) {
|
||||||
gtk_signal_emit_stop_by_name(GTK_OBJECT(widget),
|
g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event");
|
||||||
"key_press_event");
|
|
||||||
gtk_tree_item_expand(GTK_TREE_ITEM(widget));
|
gtk_tree_item_expand(GTK_TREE_ITEM(widget));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -2733,14 +2727,14 @@ int get_listitemheight(GtkWidget *w)
|
|||||||
GtkWidget *listitem = gtk_list_item_new_with_label("foo");
|
GtkWidget *listitem = gtk_list_item_new_with_label("foo");
|
||||||
GtkRequisition req;
|
GtkRequisition req;
|
||||||
gtk_widget_size_request(listitem, &req);
|
gtk_widget_size_request(listitem, &req);
|
||||||
gtk_object_sink(GTK_OBJECT(listitem));
|
g_object_ref_sink(G_OBJECT(listitem));
|
||||||
return req.height;
|
return req.height;
|
||||||
#else
|
#else
|
||||||
int height;
|
int height;
|
||||||
GtkCellRenderer *cr = gtk_cell_renderer_text_new();
|
GtkCellRenderer *cr = gtk_cell_renderer_text_new();
|
||||||
gtk_cell_renderer_get_size(cr, w, NULL, NULL, NULL, NULL, &height);
|
gtk_cell_renderer_get_size(cr, w, NULL, NULL, NULL, NULL, &height);
|
||||||
g_object_ref(G_OBJECT(cr));
|
g_object_ref(G_OBJECT(cr));
|
||||||
gtk_object_sink(GTK_OBJECT(cr));
|
g_object_ref_sink(G_OBJECT(cr));
|
||||||
g_object_unref(G_OBJECT(cr));
|
g_object_unref(G_OBJECT(cr));
|
||||||
return height;
|
return height;
|
||||||
#endif
|
#endif
|
||||||
@ -2887,11 +2881,11 @@ int do_config_box(const char *title, Conf *conf, int midsession,
|
|||||||
tree = gtk_tree_new();
|
tree = gtk_tree_new();
|
||||||
gtk_tree_set_view_mode(GTK_TREE(tree), GTK_TREE_VIEW_ITEM);
|
gtk_tree_set_view_mode(GTK_TREE(tree), GTK_TREE_VIEW_ITEM);
|
||||||
gtk_tree_set_selection_mode(GTK_TREE(tree), GTK_SELECTION_BROWSE);
|
gtk_tree_set_selection_mode(GTK_TREE(tree), GTK_SELECTION_BROWSE);
|
||||||
gtk_signal_connect(GTK_OBJECT(tree), "focus",
|
g_signal_connect(G_OBJECT(tree), "focus",
|
||||||
GTK_SIGNAL_FUNC(tree_focus), &dp);
|
G_CALLBACK(tree_focus), &dp);
|
||||||
#endif
|
#endif
|
||||||
gtk_signal_connect(GTK_OBJECT(tree), "focus_in_event",
|
g_signal_connect(G_OBJECT(tree), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), &dp);
|
G_CALLBACK(widget_focus), &dp);
|
||||||
shortcut_add(&scs, label, 'g', SHORTCUT_TREE, tree);
|
shortcut_add(&scs, label, 'g', SHORTCUT_TREE, tree);
|
||||||
gtk_widget_show(treescroll);
|
gtk_widget_show(treescroll);
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), treescroll, TRUE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), treescroll, TRUE, TRUE, 0);
|
||||||
@ -3021,10 +3015,10 @@ int do_config_box(const char *title, Conf *conf, int midsession,
|
|||||||
treeitemlevels[j] = GTK_TREE_ITEM(treeitem);
|
treeitemlevels[j] = GTK_TREE_ITEM(treeitem);
|
||||||
treelevels[j] = NULL;
|
treelevels[j] = NULL;
|
||||||
|
|
||||||
gtk_signal_connect(GTK_OBJECT(treeitem), "key_press_event",
|
g_signal_connect(G_OBJECT(treeitem), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(tree_key_press), &dp);
|
G_CALLBACK(tree_key_press), &dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(treeitem), "focus_in_event",
|
g_signal_connect(G_OBJECT(treeitem), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(widget_focus), &dp);
|
G_CALLBACK(widget_focus), &dp);
|
||||||
|
|
||||||
gtk_widget_show(treeitem);
|
gtk_widget_show(treeitem);
|
||||||
|
|
||||||
@ -3080,9 +3074,9 @@ int do_config_box(const char *title, Conf *conf, int midsession,
|
|||||||
dp.treeitems = snewn(dp.ntreeitems, GtkWidget *);
|
dp.treeitems = snewn(dp.ntreeitems, GtkWidget *);
|
||||||
|
|
||||||
for (index = 0; index < nselparams; index++) {
|
for (index = 0; index < nselparams; index++) {
|
||||||
gtk_signal_connect(GTK_OBJECT(selparams[index].treeitem), "select",
|
g_signal_connect(G_OBJECT(selparams[index].treeitem), "select",
|
||||||
GTK_SIGNAL_FUNC(treeitem_sel),
|
G_CALLBACK(treeitem_sel),
|
||||||
&selparams[index]);
|
&selparams[index]);
|
||||||
dp.treeitems[index] = selparams[index].treeitem;
|
dp.treeitems[index] = selparams[index].treeitem;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -3143,10 +3137,10 @@ int do_config_box(const char *title, Conf *conf, int midsession,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "destroy",
|
g_signal_connect(G_OBJECT(window), "destroy",
|
||||||
GTK_SIGNAL_FUNC(window_destroy), NULL);
|
G_CALLBACK(window_destroy), NULL);
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
|
g_signal_connect(G_OBJECT(window), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(win_key_press), &dp);
|
G_CALLBACK(win_key_press), &dp);
|
||||||
|
|
||||||
gtk_main();
|
gtk_main();
|
||||||
|
|
||||||
@ -3248,10 +3242,10 @@ int messagebox(GtkWidget *parentwin, const char *title, const char *msg,
|
|||||||
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
|
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
|
||||||
gtk_widget_show(window);
|
gtk_widget_show(window);
|
||||||
|
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "destroy",
|
g_signal_connect(G_OBJECT(window), "destroy",
|
||||||
GTK_SIGNAL_FUNC(window_destroy), NULL);
|
G_CALLBACK(window_destroy), NULL);
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
|
g_signal_connect(G_OBJECT(window), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(win_key_press), &dp);
|
G_CALLBACK(win_key_press), &dp);
|
||||||
|
|
||||||
gtk_main();
|
gtk_main();
|
||||||
|
|
||||||
@ -3266,7 +3260,7 @@ int string_width(const char *text)
|
|||||||
GtkWidget *label = gtk_label_new(text);
|
GtkWidget *label = gtk_label_new(text);
|
||||||
GtkRequisition req;
|
GtkRequisition req;
|
||||||
gtk_widget_size_request(label, &req);
|
gtk_widget_size_request(label, &req);
|
||||||
gtk_object_sink(GTK_OBJECT(label));
|
g_object_ref_sink(G_OBJECT(label));
|
||||||
return req.width;
|
return req.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3490,16 +3484,16 @@ void about_box(void *window)
|
|||||||
gtk_window_set_default(GTK_WINDOW(aboutbox), w);
|
gtk_window_set_default(GTK_WINDOW(aboutbox), w);
|
||||||
gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(aboutbox))),
|
gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(aboutbox))),
|
||||||
w, FALSE, FALSE, 0);
|
w, FALSE, FALSE, 0);
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "clicked",
|
g_signal_connect(G_OBJECT(w), "clicked",
|
||||||
GTK_SIGNAL_FUNC(about_close_clicked), NULL);
|
G_CALLBACK(about_close_clicked), NULL);
|
||||||
gtk_widget_show(w);
|
gtk_widget_show(w);
|
||||||
|
|
||||||
w = gtk_button_new_with_label("View Licence");
|
w = gtk_button_new_with_label("View Licence");
|
||||||
gtk_widget_set_can_default(w, TRUE);
|
gtk_widget_set_can_default(w, TRUE);
|
||||||
gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(aboutbox))),
|
gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(aboutbox))),
|
||||||
w, FALSE, FALSE, 0);
|
w, FALSE, FALSE, 0);
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "clicked",
|
g_signal_connect(G_OBJECT(w), "clicked",
|
||||||
GTK_SIGNAL_FUNC(licence_clicked), NULL);
|
G_CALLBACK(licence_clicked), NULL);
|
||||||
gtk_widget_show(w);
|
gtk_widget_show(w);
|
||||||
|
|
||||||
w = gtk_label_new(appname);
|
w = gtk_label_new(appname);
|
||||||
@ -3727,14 +3721,14 @@ void showeventlog(void *estuff, void *parentwin)
|
|||||||
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
|
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
|
||||||
gtk_widget_show(window);
|
gtk_widget_show(window);
|
||||||
|
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "destroy",
|
g_signal_connect(G_OBJECT(window), "destroy",
|
||||||
GTK_SIGNAL_FUNC(eventlog_destroy), es);
|
G_CALLBACK(eventlog_destroy), es);
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
|
g_signal_connect(G_OBJECT(window), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(win_key_press), &es->dp);
|
G_CALLBACK(win_key_press), &es->dp);
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "selection_get",
|
g_signal_connect(G_OBJECT(window), "selection_get",
|
||||||
GTK_SIGNAL_FUNC(eventlog_selection_get), es);
|
G_CALLBACK(eventlog_selection_get), es);
|
||||||
gtk_signal_connect(GTK_OBJECT(window), "selection_clear_event",
|
g_signal_connect(G_OBJECT(window), "selection_clear_event",
|
||||||
GTK_SIGNAL_FUNC(eventlog_selection_clear), es);
|
G_CALLBACK(eventlog_selection_clear), es);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *eventlogstuff_new(void)
|
void *eventlogstuff_new(void)
|
||||||
|
@ -1979,8 +1979,8 @@ static void unifontsel_set_filter_buttons(unifontsel_internal *fs)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < fs->n_filter_buttons; i++) {
|
for (i = 0; i < fs->n_filter_buttons; i++) {
|
||||||
int flagbit = GPOINTER_TO_INT(gtk_object_get_data
|
int flagbit = GPOINTER_TO_INT(g_object_get_data
|
||||||
(GTK_OBJECT(fs->filter_buttons[i]),
|
(G_OBJECT(fs->filter_buttons[i]),
|
||||||
"user-data"));
|
"user-data"));
|
||||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fs->filter_buttons[i]),
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fs->filter_buttons[i]),
|
||||||
!!(fs->filter_flags & flagbit));
|
!!(fs->filter_flags & flagbit));
|
||||||
@ -2203,8 +2203,8 @@ static void unifontsel_button_toggled(GtkToggleButton *tb, gpointer data)
|
|||||||
unifontsel_internal *fs = (unifontsel_internal *)data;
|
unifontsel_internal *fs = (unifontsel_internal *)data;
|
||||||
int newstate = gtk_toggle_button_get_active(tb);
|
int newstate = gtk_toggle_button_get_active(tb);
|
||||||
int newflags;
|
int newflags;
|
||||||
int flagbit = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(tb),
|
int flagbit = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(tb),
|
||||||
"user-data"));
|
"user-data"));
|
||||||
|
|
||||||
if (newstate)
|
if (newstate)
|
||||||
newflags = fs->filter_flags | flagbit;
|
newflags = fs->filter_flags | flagbit;
|
||||||
@ -2565,7 +2565,7 @@ unifontsel *unifontsel_new(const char *wintitle)
|
|||||||
g_object_ref_sink(label);
|
g_object_ref_sink(label);
|
||||||
g_object_unref(label);
|
g_object_unref(label);
|
||||||
#else
|
#else
|
||||||
gtk_object_sink(GTK_OBJECT(label));
|
g_object_ref_sink(G_OBJECT(label));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2733,10 +2733,10 @@ unifontsel *unifontsel_new(const char *wintitle)
|
|||||||
FALSE, FALSE);
|
FALSE, FALSE);
|
||||||
gdk_colormap_alloc_color(gdk_colormap_get_system(), &fs->preview_bg,
|
gdk_colormap_alloc_color(gdk_colormap_get_system(), &fs->preview_bg,
|
||||||
FALSE, FALSE);
|
FALSE, FALSE);
|
||||||
gtk_signal_connect(GTK_OBJECT(fs->preview_area), "expose_event",
|
g_signal_connect(G_OBJECT(fs->preview_area), "expose_event",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_expose_area), fs);
|
G_CALLBACK(unifontsel_expose_area), fs);
|
||||||
gtk_signal_connect(GTK_OBJECT(fs->preview_area), "configure_event",
|
g_signal_connect(G_OBJECT(fs->preview_area), "configure_event",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_configure_area), fs);
|
G_CALLBACK(unifontsel_configure_area), fs);
|
||||||
gtk_widget_set_size_request(fs->preview_area, 1, preview_height);
|
gtk_widget_set_size_request(fs->preview_area, 1, preview_height);
|
||||||
gtk_widget_show(fs->preview_area);
|
gtk_widget_show(fs->preview_area);
|
||||||
ww = fs->preview_area;
|
ww = fs->preview_area;
|
||||||
@ -2767,35 +2767,35 @@ unifontsel *unifontsel_new(const char *wintitle)
|
|||||||
fs->n_filter_buttons = 0;
|
fs->n_filter_buttons = 0;
|
||||||
#ifndef NOT_X_WINDOWS
|
#ifndef NOT_X_WINDOWS
|
||||||
w = gtk_check_button_new_with_label("Show client-side fonts");
|
w = gtk_check_button_new_with_label("Show client-side fonts");
|
||||||
gtk_object_set_data(GTK_OBJECT(w), "user-data",
|
g_object_set_data(G_OBJECT(w), "user-data",
|
||||||
GINT_TO_POINTER(FONTFLAG_CLIENTSIDE));
|
GINT_TO_POINTER(FONTFLAG_CLIENTSIDE));
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "toggled",
|
g_signal_connect(G_OBJECT(w), "toggled",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_button_toggled), fs);
|
G_CALLBACK(unifontsel_button_toggled), fs);
|
||||||
gtk_widget_show(w);
|
gtk_widget_show(w);
|
||||||
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
||||||
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 4, 5, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 4, 5, GTK_FILL, 0, 0, 0);
|
||||||
w = gtk_check_button_new_with_label("Show server-side fonts");
|
w = gtk_check_button_new_with_label("Show server-side fonts");
|
||||||
gtk_object_set_data(GTK_OBJECT(w), "user-data",
|
g_object_set_data(G_OBJECT(w), "user-data",
|
||||||
GINT_TO_POINTER(FONTFLAG_SERVERSIDE));
|
GINT_TO_POINTER(FONTFLAG_SERVERSIDE));
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "toggled",
|
g_signal_connect(G_OBJECT(w), "toggled",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_button_toggled), fs);
|
G_CALLBACK(unifontsel_button_toggled), fs);
|
||||||
gtk_widget_show(w);
|
gtk_widget_show(w);
|
||||||
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
||||||
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 5, 6, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 5, 6, GTK_FILL, 0, 0, 0);
|
||||||
w = gtk_check_button_new_with_label("Show server-side font aliases");
|
w = gtk_check_button_new_with_label("Show server-side font aliases");
|
||||||
gtk_object_set_data(GTK_OBJECT(w), "user-data",
|
g_object_set_data(G_OBJECT(w), "user-data",
|
||||||
GINT_TO_POINTER(FONTFLAG_SERVERALIAS));
|
GINT_TO_POINTER(FONTFLAG_SERVERALIAS));
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "toggled",
|
g_signal_connect(G_OBJECT(w), "toggled",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_button_toggled), fs);
|
G_CALLBACK(unifontsel_button_toggled), fs);
|
||||||
gtk_widget_show(w);
|
gtk_widget_show(w);
|
||||||
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
||||||
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 6, 7, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 6, 7, GTK_FILL, 0, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
w = gtk_check_button_new_with_label("Show non-monospaced fonts");
|
w = gtk_check_button_new_with_label("Show non-monospaced fonts");
|
||||||
gtk_object_set_data(GTK_OBJECT(w), "user-data",
|
g_object_set_data(G_OBJECT(w), "user-data",
|
||||||
GINT_TO_POINTER(FONTFLAG_NONMONOSPACED));
|
GINT_TO_POINTER(FONTFLAG_NONMONOSPACED));
|
||||||
gtk_signal_connect(GTK_OBJECT(w), "toggled",
|
g_signal_connect(G_OBJECT(w), "toggled",
|
||||||
GTK_SIGNAL_FUNC(unifontsel_button_toggled), fs);
|
G_CALLBACK(unifontsel_button_toggled), fs);
|
||||||
gtk_widget_show(w);
|
gtk_widget_show(w);
|
||||||
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
fs->filter_buttons[fs->n_filter_buttons++] = w;
|
||||||
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 7, 8, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), w, 0, 3, 7, 8, GTK_FILL, 0, 0, 0);
|
||||||
|
100
unix/gtkwin.c
100
unix/gtkwin.c
@ -3106,8 +3106,8 @@ void copy_all_menuitem(GtkMenuItem *item, gpointer data)
|
|||||||
void special_menuitem(GtkMenuItem *item, gpointer data)
|
void special_menuitem(GtkMenuItem *item, gpointer data)
|
||||||
{
|
{
|
||||||
struct gui_data *inst = (struct gui_data *)data;
|
struct gui_data *inst = (struct gui_data *)data;
|
||||||
int code = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(item),
|
int code = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item),
|
||||||
"user-data"));
|
"user-data"));
|
||||||
|
|
||||||
if (inst->back)
|
if (inst->back)
|
||||||
inst->back->special(inst->backhandle, code);
|
inst->back->special(inst->backhandle, code);
|
||||||
@ -3522,14 +3522,14 @@ void restart_session_menuitem(GtkMenuItem *item, gpointer data)
|
|||||||
void saved_session_menuitem(GtkMenuItem *item, gpointer data)
|
void saved_session_menuitem(GtkMenuItem *item, gpointer data)
|
||||||
{
|
{
|
||||||
struct gui_data *inst = (struct gui_data *)data;
|
struct gui_data *inst = (struct gui_data *)data;
|
||||||
char *str = (char *)gtk_object_get_data(GTK_OBJECT(item), "user-data");
|
char *str = (char *)g_object_get_data(G_OBJECT(item), "user-data");
|
||||||
|
|
||||||
fork_and_exec_self(inst, -1, "-load", str, NULL);
|
fork_and_exec_self(inst, -1, "-load", str, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void saved_session_freedata(GtkMenuItem *item, gpointer data)
|
void saved_session_freedata(GtkMenuItem *item, gpointer data)
|
||||||
{
|
{
|
||||||
char *str = (char *)gtk_object_get_data(GTK_OBJECT(item), "user-data");
|
char *str = (char *)g_object_get_data(G_OBJECT(item), "user-data");
|
||||||
|
|
||||||
sfree(str);
|
sfree(str);
|
||||||
}
|
}
|
||||||
@ -3550,14 +3550,14 @@ static void update_savedsess_menu(GtkMenuItem *menuitem, gpointer data)
|
|||||||
gtk_menu_item_new_with_label(sesslist.sessions[i]);
|
gtk_menu_item_new_with_label(sesslist.sessions[i]);
|
||||||
gtk_container_add(GTK_CONTAINER(inst->sessionsmenu), menuitem);
|
gtk_container_add(GTK_CONTAINER(inst->sessionsmenu), menuitem);
|
||||||
gtk_widget_show(menuitem);
|
gtk_widget_show(menuitem);
|
||||||
gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
|
g_object_set_data(G_OBJECT(menuitem), "user-data",
|
||||||
dupstr(sesslist.sessions[i]));
|
dupstr(sesslist.sessions[i]));
|
||||||
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
|
g_signal_connect(G_OBJECT(menuitem), "activate",
|
||||||
GTK_SIGNAL_FUNC(saved_session_menuitem),
|
G_CALLBACK(saved_session_menuitem),
|
||||||
inst);
|
inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(menuitem), "destroy",
|
g_signal_connect(G_OBJECT(menuitem), "destroy",
|
||||||
GTK_SIGNAL_FUNC(saved_session_freedata),
|
G_CALLBACK(saved_session_freedata),
|
||||||
inst);
|
inst);
|
||||||
}
|
}
|
||||||
if (sesslist.nsessions <= 1) {
|
if (sesslist.nsessions <= 1) {
|
||||||
GtkWidget *menuitem =
|
GtkWidget *menuitem =
|
||||||
@ -3645,10 +3645,10 @@ void update_specials_menu(void *frontend)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
menuitem = gtk_menu_item_new_with_label(specials[i].name);
|
menuitem = gtk_menu_item_new_with_label(specials[i].name);
|
||||||
gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
|
g_object_set_data(G_OBJECT(menuitem), "user-data",
|
||||||
GINT_TO_POINTER(specials[i].code));
|
GINT_TO_POINTER(specials[i].code));
|
||||||
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
|
g_signal_connect(G_OBJECT(menuitem), "activate",
|
||||||
GTK_SIGNAL_FUNC(special_menuitem), inst);
|
G_CALLBACK(special_menuitem), inst);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (menuitem) {
|
if (menuitem) {
|
||||||
@ -3849,45 +3849,45 @@ int pt_main(int argc, char **argv)
|
|||||||
gtk_widget_set_uposition(GTK_WIDGET(inst->window), x, y);
|
gtk_widget_set_uposition(GTK_WIDGET(inst->window), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->window), "destroy",
|
g_signal_connect(G_OBJECT(inst->window), "destroy",
|
||||||
GTK_SIGNAL_FUNC(destroy), inst);
|
G_CALLBACK(destroy), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->window), "delete_event",
|
g_signal_connect(G_OBJECT(inst->window), "delete_event",
|
||||||
GTK_SIGNAL_FUNC(delete_window), inst);
|
G_CALLBACK(delete_window), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->window), "key_press_event",
|
g_signal_connect(G_OBJECT(inst->window), "key_press_event",
|
||||||
GTK_SIGNAL_FUNC(key_event), inst);
|
G_CALLBACK(key_event), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->window), "key_release_event",
|
g_signal_connect(G_OBJECT(inst->window), "key_release_event",
|
||||||
GTK_SIGNAL_FUNC(key_event), inst);
|
G_CALLBACK(key_event), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->window), "focus_in_event",
|
g_signal_connect(G_OBJECT(inst->window), "focus_in_event",
|
||||||
GTK_SIGNAL_FUNC(focus_event), inst);
|
G_CALLBACK(focus_event), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->window), "focus_out_event",
|
g_signal_connect(G_OBJECT(inst->window), "focus_out_event",
|
||||||
GTK_SIGNAL_FUNC(focus_event), inst);
|
G_CALLBACK(focus_event), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "configure_event",
|
g_signal_connect(G_OBJECT(inst->area), "configure_event",
|
||||||
GTK_SIGNAL_FUNC(configure_area), inst);
|
G_CALLBACK(configure_area), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "expose_event",
|
g_signal_connect(G_OBJECT(inst->area), "expose_event",
|
||||||
GTK_SIGNAL_FUNC(expose_area), inst);
|
G_CALLBACK(expose_area), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "button_press_event",
|
g_signal_connect(G_OBJECT(inst->area), "button_press_event",
|
||||||
GTK_SIGNAL_FUNC(button_event), inst);
|
G_CALLBACK(button_event), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "button_release_event",
|
g_signal_connect(G_OBJECT(inst->area), "button_release_event",
|
||||||
GTK_SIGNAL_FUNC(button_event), inst);
|
G_CALLBACK(button_event), inst);
|
||||||
#if GTK_CHECK_VERSION(2,0,0)
|
#if GTK_CHECK_VERSION(2,0,0)
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "scroll_event",
|
g_signal_connect(G_OBJECT(inst->area), "scroll_event",
|
||||||
GTK_SIGNAL_FUNC(scroll_event), inst);
|
G_CALLBACK(scroll_event), inst);
|
||||||
#endif
|
#endif
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "motion_notify_event",
|
g_signal_connect(G_OBJECT(inst->area), "motion_notify_event",
|
||||||
GTK_SIGNAL_FUNC(motion_event), inst);
|
G_CALLBACK(motion_event), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "selection_received",
|
g_signal_connect(G_OBJECT(inst->area), "selection_received",
|
||||||
GTK_SIGNAL_FUNC(selection_received), inst);
|
G_CALLBACK(selection_received), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "selection_get",
|
g_signal_connect(G_OBJECT(inst->area), "selection_get",
|
||||||
GTK_SIGNAL_FUNC(selection_get), inst);
|
G_CALLBACK(selection_get), inst);
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->area), "selection_clear_event",
|
g_signal_connect(G_OBJECT(inst->area), "selection_clear_event",
|
||||||
GTK_SIGNAL_FUNC(selection_clear), inst);
|
G_CALLBACK(selection_clear), inst);
|
||||||
#if GTK_CHECK_VERSION(2,0,0)
|
#if GTK_CHECK_VERSION(2,0,0)
|
||||||
g_signal_connect(G_OBJECT(inst->imc), "commit",
|
g_signal_connect(G_OBJECT(inst->imc), "commit",
|
||||||
G_CALLBACK(input_method_commit_event), inst);
|
G_CALLBACK(input_method_commit_event), inst);
|
||||||
#endif
|
#endif
|
||||||
if (conf_get_int(inst->conf, CONF_scrollbar))
|
if (conf_get_int(inst->conf, CONF_scrollbar))
|
||||||
gtk_signal_connect(GTK_OBJECT(inst->sbar_adjust), "value_changed",
|
g_signal_connect(G_OBJECT(inst->sbar_adjust), "value_changed",
|
||||||
GTK_SIGNAL_FUNC(scrollbar_moved), inst);
|
G_CALLBACK(scrollbar_moved), inst);
|
||||||
gtk_widget_add_events(GTK_WIDGET(inst->area),
|
gtk_widget_add_events(GTK_WIDGET(inst->area),
|
||||||
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
|
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
|
||||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
||||||
@ -3918,8 +3918,8 @@ int pt_main(int argc, char **argv)
|
|||||||
menuitem = gtk_menu_item_new_with_label(title); \
|
menuitem = gtk_menu_item_new_with_label(title); \
|
||||||
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
|
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
|
||||||
gtk_widget_show(menuitem); \
|
gtk_widget_show(menuitem); \
|
||||||
gtk_signal_connect(GTK_OBJECT(menuitem), "activate", \
|
g_signal_connect(G_OBJECT(menuitem), "activate", \
|
||||||
GTK_SIGNAL_FUNC(func), inst); \
|
G_CALLBACK(func), inst); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define MKSUBMENU(title) do \
|
#define MKSUBMENU(title) do \
|
||||||
|
Loading…
Reference in New Issue
Block a user