static GtkWidget *
message_box_new (GladeXML *xml, GType widget_type,
		 GladeWidgetInfo *info)
{
    GtkWidget *dialog;
    const char *buttons[] = { NULL };
    const char *type = "generic", *message = NULL;
    int i;

    for (i = 0; i < info->n_properties; i++) {
	const char *name  = info->properties[i].name;
	const char *value = info->properties[i].value;	

	if (!strcmp (name, "message"))
	    message = value;
	if (!strcmp (name, "message_box_type"))
	    type = value;
    }

    dialog = glade_standard_build_widget (xml, widget_type, info);

    mate_message_box_construct (MATE_MESSAGE_BOX (dialog), message, type, buttons);

    return dialog;
}
static GtkWidget *
icon_list_new (GladeXML *xml, GType widget_type,
	       GladeWidgetInfo *info)
{
    GtkWidget *gil;
    int flags = 0;
    int icon_width = 0;
    int i;

    for (i = 0; i < info->n_properties; i++) {
	const char *name  = info->properties[i].name;
	const char *value = info->properties[i].value;

	if (!strcmp (name, "text_editable")) {
	    if (BOOL (value))
		flags |= MATE_ICON_LIST_IS_EDITABLE;
	} else if (!strcmp (name, "text_static")) {
	    if (BOOL (value))
		flags |= MATE_ICON_LIST_STATIC_TEXT;
	} else if (!strcmp (name, "icon_width")) {
	    icon_width = INT (value);
	}
    }

    gil = glade_standard_build_widget (xml, widget_type, info);

    mate_icon_list_construct (MATE_ICON_LIST (gil),
			       icon_width, NULL, flags);

    return gil;
}
static GtkWidget *
date_edit_new (GladeXML *xml, GType widget_type,
	       GladeWidgetInfo *info)
{
    GtkWidget *de;

    de = glade_standard_build_widget (xml, widget_type, info);

    g_object_set (G_OBJECT (de), "time", time (NULL), NULL);

    return de;
}
static GtkWidget *
dialog_new (GladeXML *xml, GType widget_type,
	    GladeWidgetInfo *info)
{
    GtkWidget *dialog;
    const char *buttons[] = { NULL };

    dialog = glade_standard_build_widget (xml, widget_type, info);

    mate_dialog_constructv (MATE_DIALOG (dialog), NULL, buttons);

    return dialog;
}
예제 #5
0
static GtkWidget *
dock_item_build (GladeXML *xml, GType widget_type,
		 GladeWidgetInfo *info)
{
	GtkWidget *w;

	w = glade_standard_build_widget (xml, widget_type, info);

	g_free(BONOBO_DOCK_ITEM (w)->name);
	BONOBO_DOCK_ITEM (w)->name = g_strdup (info->name);

	return w;
}
static GtkWidget *
app_build (GladeXML *xml, GType widget_type,
	   GladeWidgetInfo *info)
{
    GtkWidget *app;
    char *s;

    app = glade_standard_build_widget (xml, widget_type, info);

    g_object_get (G_OBJECT (mate_program_get ()),
		  MATE_PARAM_APP_ID, &s,
		  NULL);

    g_object_set (G_OBJECT (app), "app_id", s, NULL);

    g_free (s);

    return app;
}
static GtkWidget *
druid_page_edge_new (GladeXML *xml, GType widget_type,
		     GladeWidgetInfo *info)
{
    GtkWidget *druid;
    MateEdgePosition position = MATE_EDGE_OTHER;
    int i;

    const char *title, *text;
    char *filename;
    GdkPixbuf *logo, *watermark, *top_watermark;

    title = text = NULL;
    logo = watermark = top_watermark = NULL;

    for (i = 0; i < info->n_properties; i++) {
	const char *name  = info->properties[i].name;
	const char *value = info->properties[i].value;	

	if (!strcmp (name, "position"))
	    position = glade_enum_from_string (
		MATE_TYPE_EDGE_POSITION, value);
	else if (!strcmp (name, "text"))
	    text = value;
	else if (!strcmp (name, "title"))
	    title = value;
	else if (!strcmp (name, "logo")) {
	    if (logo)
		g_object_unref (G_OBJECT (logo));
	    filename = glade_xml_relative_file (xml, value);
	    logo = gdk_pixbuf_new_from_file (filename, NULL);
	    g_free (filename);
	} else if (!strcmp (name, "watermark")) {
	    if (watermark)
		g_object_unref (G_OBJECT (watermark));
	    filename = glade_xml_relative_file (xml, value);
	    watermark = gdk_pixbuf_new_from_file (filename, NULL);
	    g_free (filename);
	} else if (!strcmp (name, "top_watermark")) {
	    if (top_watermark)
		g_object_unref (G_OBJECT (top_watermark));
	    filename = glade_xml_relative_file (xml, value);
	    top_watermark = gdk_pixbuf_new_from_file (filename, NULL);
	    g_free (filename);
	}

    }

    druid = glade_standard_build_widget (xml, widget_type, info);

    mate_druid_page_edge_construct (
	MATE_DRUID_PAGE_EDGE (druid),
	position, TRUE, title, text,
	logo, watermark, top_watermark);

    if (logo)
	g_object_unref (G_OBJECT (logo));
    if (watermark)
	g_object_unref (G_OBJECT (watermark));
    if (top_watermark)
	g_object_unref (G_OBJECT (top_watermark));

    return druid;
}