コード例 #1
0
static void
gedit_encodings_combo_box_dispose (GObject *object)
{
	GeditEncodingsComboBox *combo = GEDIT_ENCODINGS_COMBO_BOX (object);

	g_clear_object (&combo->priv->store);
	g_clear_object (&combo->priv->enc_settings);

	G_OBJECT_CLASS (gedit_encodings_combo_box_parent_class)->dispose (object);
}
コード例 #2
0
static void
gedit_encodings_combo_box_dispose (GObject *object)
{
    GeditEncodingsComboBox *combo = GEDIT_ENCODINGS_COMBO_BOX (object);

    if (combo->priv->store != NULL)
    {
        g_object_unref (combo->priv->store);
        combo->priv->store = NULL;
    }

    G_OBJECT_CLASS (gedit_encodings_combo_box_parent_class)->dispose (object);
}
コード例 #3
0
const GeditEncoding *
gedit_conversion_error_message_area_get_encoding (GtkWidget *message_area)
{
	gpointer menu;

#if !GTK_CHECK_VERSION (2, 17, 1)
	g_return_val_if_fail (GEDIT_IS_MESSAGE_AREA (message_area), NULL);
#else
	g_return_val_if_fail (GTK_IS_INFO_BAR (message_area), NULL);
#endif

	menu = g_object_get_data (G_OBJECT (message_area), 
				  "gedit-message-area-encoding-menu");	
	g_return_val_if_fail (menu, NULL);
	
	return gedit_encodings_combo_box_get_selected_encoding
					(GEDIT_ENCODINGS_COMBO_BOX (menu));
}
コード例 #4
0
static void
gedit_encodings_combo_box_get_property (GObject    *object,
                                        guint       prop_id,
                                        GValue 	   *value,
                                        GParamSpec *pspec)
{
    GeditEncodingsComboBox *combo;

    combo = GEDIT_ENCODINGS_COMBO_BOX (object);

    switch (prop_id)
    {
    case PROP_SAVE_MODE:
        g_value_set_boolean (value, combo->priv->save_mode);
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
        break;
    }
}
コード例 #5
0
static void
gedit_encodings_combo_box_constructed (GObject *object)
{
	GeditEncodingsComboBox *combo = GEDIT_ENCODINGS_COMBO_BOX (object);
	GtkCellRenderer *text_renderer;

	/* Setup up the cells */
	text_renderer = gtk_cell_renderer_text_new ();
	gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (combo),
				  text_renderer, TRUE);

	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
					text_renderer,
					"text",
					NAME_COLUMN,
					NULL);

	update_menu (combo);

	G_OBJECT_CLASS (gedit_encodings_combo_box_parent_class)->constructed (object);
}