mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Merge branch 'file-list-get' into 'master'
Add getter to GdkFileList See merge request GNOME/gtk!4047
This commit is contained in:
commit
e946ee4040
@ -808,8 +808,13 @@ gdk_content_formats_builder_add_mime_type (GdkContentFormatsBuilder *builder,
|
||||
builder->n_mime_types++;
|
||||
}
|
||||
|
||||
/* G_DEFINE_BOXED wants this */
|
||||
typedef gpointer GdkFileList;
|
||||
/* {{{ GdkFileList */
|
||||
|
||||
/* We're using GdkFileList* and GSList* interchangeably, counting on the
|
||||
* fact that we're just passing around gpointers; the only reason why we
|
||||
* have a GdkFileList opaque type is for language bindings, because they
|
||||
* can have no idea what a GSList of GFiles is.
|
||||
*/
|
||||
|
||||
static gpointer
|
||||
gdk_file_list_copy (gpointer list)
|
||||
@ -824,3 +829,23 @@ gdk_file_list_free (gpointer list)
|
||||
}
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GdkFileList, gdk_file_list, gdk_file_list_copy, gdk_file_list_free)
|
||||
|
||||
/**
|
||||
* gdk_file_list_get_files:
|
||||
* @file_list: the file list
|
||||
*
|
||||
* Retrieves the list of files inside a `GdkFileList`.
|
||||
*
|
||||
* This function is meant for language bindings.
|
||||
*
|
||||
* Returns: (transfer container) (element-type GFile): the files inside the list
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
GSList *
|
||||
gdk_file_list_get_files (GdkFileList *file_list)
|
||||
{
|
||||
return g_slist_copy ((GSList *) file_list);
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
@ -111,6 +111,17 @@ void gdk_content_formats_builder_add_gtype (GdkContentForma
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_file_list_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/**
|
||||
* GdkFileList:
|
||||
*
|
||||
* An opaque type representing a list of files.
|
||||
*
|
||||
* Since: 4.6
|
||||
*/
|
||||
typedef struct _GdkFileList GdkFileList;
|
||||
|
||||
GDK_AVAILABLE_IN_4_6
|
||||
GSList * gdk_file_list_get_files (GdkFileList *file_list);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user