示例#1
0
static void
drag_data_get_callback (GtkWidget *widget,
		  	GdkDragContext *context,
		  	GtkSelectionData *selection_data,
		  	guint info,
		 	guint32 time,
			gpointer callback_data)
{
	NemoLocationBar *self;
	GFile *location;
	gchar *uri;

	g_assert (selection_data != NULL);
	self = callback_data;

	location = nemo_location_bar_get_location (self);
	uri = g_file_get_uri (location);

	switch (info) {
	case NEMO_DND_URI_LIST:
	case NEMO_DND_TEXT_PLAIN:
		gtk_selection_data_set (selection_data,
					gtk_selection_data_get_target (selection_data),
					8, (guchar *) uri,
					strlen (uri));
		break;
	default:
		g_assert_not_reached ();
	}
	g_free (uri);
	g_object_unref (location);
}
示例#2
0
static void
drag_data_get_callback (GtkWidget *widget,
		  	GdkDragContext *context,
		  	GtkSelectionData *selection_data,
		  	guint info,
		 	guint32 time,
			gpointer callback_data)
{
	NemoLocationBar *self;
	char *entry_text;

	g_assert (selection_data != NULL);
	self = callback_data;

	entry_text = nemo_location_bar_get_location (self);

	switch (info) {
	case NEMO_DND_URI_LIST:
	case NEMO_DND_TEXT_PLAIN:
		gtk_selection_data_set (selection_data,
					gtk_selection_data_get_target (selection_data),
					8, (guchar *) entry_text,
					strlen (entry_text));
		break;
	default:
		g_assert_not_reached ();
	}
	g_free (entry_text);
}
示例#3
0
static void
emit_location_changed (NemoLocationBar *bar)
{
	GFile *location;

	location = nemo_location_bar_get_location (bar);
	g_signal_emit (bar, signals[LOCATION_CHANGED], 0, location);
	g_object_unref (location);
}
示例#4
0
static void
emit_location_changed (NemoLocationBar *bar)
{
	char *location;

	location = nemo_location_bar_get_location (bar);
	g_signal_emit (bar,
		       signals[LOCATION_CHANGED], 0,
		       location);
	g_free (location);
}