2017-11-17 16:31:59 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
2017-11-18 01:19:53 +00:00
|
|
|
* Copyright (C) 2017 Benjamin Otte
|
2017-11-17 16:31:59 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GTK_CONTENT_FORMATS_H__
|
|
|
|
#define __GTK_CONTENT_FORMATS_H__
|
|
|
|
|
|
|
|
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
|
|
|
#error "Only <gdk/gdk.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include <gdk/gdkversionmacros.h>
|
|
|
|
#include <gdk/gdktypes.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2017-11-18 01:19:53 +00:00
|
|
|
#define GDK_TYPE_CONTENT_FORMATS (gdk_content_formats_get_type ())
|
2017-11-17 16:31:59 +00:00
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-25 20:59:39 +00:00
|
|
|
const char * gdk_intern_mime_type (const char *string);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 01:19:53 +00:00
|
|
|
GType gdk_content_formats_get_type (void) G_GNUC_CONST;
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 01:19:53 +00:00
|
|
|
GdkContentFormats * gdk_content_formats_new (const char **mime_types,
|
|
|
|
guint n_mime_types);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-28 01:02:06 +00:00
|
|
|
GdkContentFormats * gdk_content_formats_new_for_gtype (GType type);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 01:19:53 +00:00
|
|
|
GdkContentFormats * gdk_content_formats_ref (GdkContentFormats *formats);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 01:19:53 +00:00
|
|
|
void gdk_content_formats_unref (GdkContentFormats *formats);
|
2017-11-17 16:31:59 +00:00
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 04:53:25 +00:00
|
|
|
void gdk_content_formats_print (GdkContentFormats *formats,
|
|
|
|
GString *string);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 04:53:25 +00:00
|
|
|
char * gdk_content_formats_to_string (GdkContentFormats *formats);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 14:58:17 +00:00
|
|
|
const GType * gdk_content_formats_get_gtypes (GdkContentFormats *formats,
|
|
|
|
gsize *n_gtypes);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 03:42:43 +00:00
|
|
|
const char * const * gdk_content_formats_get_mime_types (GdkContentFormats *formats,
|
|
|
|
gsize *n_mime_types);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 02:54:42 +00:00
|
|
|
GdkContentFormats * gdk_content_formats_union (GdkContentFormats *first,
|
|
|
|
const GdkContentFormats *second) G_GNUC_WARN_UNUSED_RESULT;
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 14:58:17 +00:00
|
|
|
gboolean gdk_content_formats_match (const GdkContentFormats *first,
|
2017-11-24 10:34:19 +00:00
|
|
|
const GdkContentFormats *second);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-24 10:34:19 +00:00
|
|
|
GType gdk_content_formats_match_gtype (const GdkContentFormats *first,
|
|
|
|
const GdkContentFormats *second);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-24 10:34:19 +00:00
|
|
|
const char * gdk_content_formats_match_mime_type (const GdkContentFormats *first,
|
|
|
|
const GdkContentFormats *second);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 14:58:17 +00:00
|
|
|
gboolean gdk_content_formats_contain_gtype (const GdkContentFormats *formats,
|
|
|
|
GType type);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 03:42:43 +00:00
|
|
|
gboolean gdk_content_formats_contain_mime_type (const GdkContentFormats *formats,
|
2017-11-18 01:19:53 +00:00
|
|
|
const char *mime_type);
|
2017-11-17 16:31:59 +00:00
|
|
|
|
Allow binding GdkContentFormatsBuilder
GdkContentFormatsBuilder is currently not introspectable, as it does not
have a GType. We can turn it into a boxed type, but we need to implement
memory management for it.
The current gdk_content_formats_builder_free() function returns a newly
constructed value, so we cannot use it as a GBoxedFreeFunc; additionally
copying a GdkContentFormatsBuilder contents would make it a bit odd, as
you could get multiple identical GdkContentFormats out of the copies.
A simple approach is to model the GdkContentFormatsBuilder API to follow
the GBytes one: use reference counting for memory management, and have
a function to release a reference, return a GdkContentFormats, and reset
the GdkContentFormatsBuilder state.
For language bindings, we can provide a get_formats() function that
returns the GdkContentFormats instance and resets the builder instance,
leaving the reference count untouched.
For C convenience we can keep gdk_content_formats_builder_free(), and
make it a wrapper around gdk_content_formats_builder_get_formats(), with
the guarantee that it'll free the builder instance regardless of its
current reference count.
https://bugzilla.gnome.org/show_bug.cgi?id=793097
https://blogs.gnome.org/otte/2018/02/03/builders/
2018-02-01 16:43:15 +00:00
|
|
|
#define GDK_TYPE_CONTENT_FORMATS_BUILDER (gdk_content_formats_builder_get_type ())
|
|
|
|
|
2017-11-20 01:47:45 +00:00
|
|
|
typedef struct _GdkContentFormatsBuilder GdkContentFormatsBuilder;
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
Allow binding GdkContentFormatsBuilder
GdkContentFormatsBuilder is currently not introspectable, as it does not
have a GType. We can turn it into a boxed type, but we need to implement
memory management for it.
The current gdk_content_formats_builder_free() function returns a newly
constructed value, so we cannot use it as a GBoxedFreeFunc; additionally
copying a GdkContentFormatsBuilder contents would make it a bit odd, as
you could get multiple identical GdkContentFormats out of the copies.
A simple approach is to model the GdkContentFormatsBuilder API to follow
the GBytes one: use reference counting for memory management, and have
a function to release a reference, return a GdkContentFormats, and reset
the GdkContentFormatsBuilder state.
For language bindings, we can provide a get_formats() function that
returns the GdkContentFormats instance and resets the builder instance,
leaving the reference count untouched.
For C convenience we can keep gdk_content_formats_builder_free(), and
make it a wrapper around gdk_content_formats_builder_get_formats(), with
the guarantee that it'll free the builder instance regardless of its
current reference count.
https://bugzilla.gnome.org/show_bug.cgi?id=793097
https://blogs.gnome.org/otte/2018/02/03/builders/
2018-02-01 16:43:15 +00:00
|
|
|
GType gdk_content_formats_builder_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
Allow binding GdkContentFormatsBuilder
GdkContentFormatsBuilder is currently not introspectable, as it does not
have a GType. We can turn it into a boxed type, but we need to implement
memory management for it.
The current gdk_content_formats_builder_free() function returns a newly
constructed value, so we cannot use it as a GBoxedFreeFunc; additionally
copying a GdkContentFormatsBuilder contents would make it a bit odd, as
you could get multiple identical GdkContentFormats out of the copies.
A simple approach is to model the GdkContentFormatsBuilder API to follow
the GBytes one: use reference counting for memory management, and have
a function to release a reference, return a GdkContentFormats, and reset
the GdkContentFormatsBuilder state.
For language bindings, we can provide a get_formats() function that
returns the GdkContentFormats instance and resets the builder instance,
leaving the reference count untouched.
For C convenience we can keep gdk_content_formats_builder_free(), and
make it a wrapper around gdk_content_formats_builder_get_formats(), with
the guarantee that it'll free the builder instance regardless of its
current reference count.
https://bugzilla.gnome.org/show_bug.cgi?id=793097
https://blogs.gnome.org/otte/2018/02/03/builders/
2018-02-01 16:43:15 +00:00
|
|
|
GdkContentFormatsBuilder *gdk_content_formats_builder_new (void);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
Allow binding GdkContentFormatsBuilder
GdkContentFormatsBuilder is currently not introspectable, as it does not
have a GType. We can turn it into a boxed type, but we need to implement
memory management for it.
The current gdk_content_formats_builder_free() function returns a newly
constructed value, so we cannot use it as a GBoxedFreeFunc; additionally
copying a GdkContentFormatsBuilder contents would make it a bit odd, as
you could get multiple identical GdkContentFormats out of the copies.
A simple approach is to model the GdkContentFormatsBuilder API to follow
the GBytes one: use reference counting for memory management, and have
a function to release a reference, return a GdkContentFormats, and reset
the GdkContentFormatsBuilder state.
For language bindings, we can provide a get_formats() function that
returns the GdkContentFormats instance and resets the builder instance,
leaving the reference count untouched.
For C convenience we can keep gdk_content_formats_builder_free(), and
make it a wrapper around gdk_content_formats_builder_get_formats(), with
the guarantee that it'll free the builder instance regardless of its
current reference count.
https://bugzilla.gnome.org/show_bug.cgi?id=793097
https://blogs.gnome.org/otte/2018/02/03/builders/
2018-02-01 16:43:15 +00:00
|
|
|
GdkContentFormatsBuilder *gdk_content_formats_builder_ref (GdkContentFormatsBuilder *builder);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
Allow binding GdkContentFormatsBuilder
GdkContentFormatsBuilder is currently not introspectable, as it does not
have a GType. We can turn it into a boxed type, but we need to implement
memory management for it.
The current gdk_content_formats_builder_free() function returns a newly
constructed value, so we cannot use it as a GBoxedFreeFunc; additionally
copying a GdkContentFormatsBuilder contents would make it a bit odd, as
you could get multiple identical GdkContentFormats out of the copies.
A simple approach is to model the GdkContentFormatsBuilder API to follow
the GBytes one: use reference counting for memory management, and have
a function to release a reference, return a GdkContentFormats, and reset
the GdkContentFormatsBuilder state.
For language bindings, we can provide a get_formats() function that
returns the GdkContentFormats instance and resets the builder instance,
leaving the reference count untouched.
For C convenience we can keep gdk_content_formats_builder_free(), and
make it a wrapper around gdk_content_formats_builder_get_formats(), with
the guarantee that it'll free the builder instance regardless of its
current reference count.
https://bugzilla.gnome.org/show_bug.cgi?id=793097
https://blogs.gnome.org/otte/2018/02/03/builders/
2018-02-01 16:43:15 +00:00
|
|
|
void gdk_content_formats_builder_unref (GdkContentFormatsBuilder *builder);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
Allow binding GdkContentFormatsBuilder
GdkContentFormatsBuilder is currently not introspectable, as it does not
have a GType. We can turn it into a boxed type, but we need to implement
memory management for it.
The current gdk_content_formats_builder_free() function returns a newly
constructed value, so we cannot use it as a GBoxedFreeFunc; additionally
copying a GdkContentFormatsBuilder contents would make it a bit odd, as
you could get multiple identical GdkContentFormats out of the copies.
A simple approach is to model the GdkContentFormatsBuilder API to follow
the GBytes one: use reference counting for memory management, and have
a function to release a reference, return a GdkContentFormats, and reset
the GdkContentFormatsBuilder state.
For language bindings, we can provide a get_formats() function that
returns the GdkContentFormats instance and resets the builder instance,
leaving the reference count untouched.
For C convenience we can keep gdk_content_formats_builder_free(), and
make it a wrapper around gdk_content_formats_builder_get_formats(), with
the guarantee that it'll free the builder instance regardless of its
current reference count.
https://bugzilla.gnome.org/show_bug.cgi?id=793097
https://blogs.gnome.org/otte/2018/02/03/builders/
2018-02-01 16:43:15 +00:00
|
|
|
GdkContentFormats * gdk_content_formats_builder_free_to_formats (GdkContentFormatsBuilder *builder) G_GNUC_WARN_UNUSED_RESULT;
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
Allow binding GdkContentFormatsBuilder
GdkContentFormatsBuilder is currently not introspectable, as it does not
have a GType. We can turn it into a boxed type, but we need to implement
memory management for it.
The current gdk_content_formats_builder_free() function returns a newly
constructed value, so we cannot use it as a GBoxedFreeFunc; additionally
copying a GdkContentFormatsBuilder contents would make it a bit odd, as
you could get multiple identical GdkContentFormats out of the copies.
A simple approach is to model the GdkContentFormatsBuilder API to follow
the GBytes one: use reference counting for memory management, and have
a function to release a reference, return a GdkContentFormats, and reset
the GdkContentFormatsBuilder state.
For language bindings, we can provide a get_formats() function that
returns the GdkContentFormats instance and resets the builder instance,
leaving the reference count untouched.
For C convenience we can keep gdk_content_formats_builder_free(), and
make it a wrapper around gdk_content_formats_builder_get_formats(), with
the guarantee that it'll free the builder instance regardless of its
current reference count.
https://bugzilla.gnome.org/show_bug.cgi?id=793097
https://blogs.gnome.org/otte/2018/02/03/builders/
2018-02-01 16:43:15 +00:00
|
|
|
GdkContentFormats * gdk_content_formats_builder_to_formats (GdkContentFormatsBuilder *builder) G_GNUC_WARN_UNUSED_RESULT;
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 01:47:45 +00:00
|
|
|
void gdk_content_formats_builder_add_formats (GdkContentFormatsBuilder *builder,
|
2017-11-20 02:54:42 +00:00
|
|
|
const GdkContentFormats *formats);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 01:47:45 +00:00
|
|
|
void gdk_content_formats_builder_add_mime_type(GdkContentFormatsBuilder *builder,
|
|
|
|
const char *mime_type);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-20 14:58:17 +00:00
|
|
|
void gdk_content_formats_builder_add_gtype (GdkContentFormatsBuilder *builder,
|
|
|
|
GType type);
|
2017-11-20 01:47:45 +00:00
|
|
|
|
2017-11-29 08:37:50 +00:00
|
|
|
/* dunno where else to put this */
|
|
|
|
#define GDK_TYPE_FILE_LIST (gdk_file_list_get_type ())
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-29 08:37:50 +00:00
|
|
|
GType gdk_file_list_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
|
2017-11-17 16:31:59 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_CONTENT_FORMATS_H__ */
|