Commit f2a2d6c9 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

big header formatting cleanup: indentation, vtable formatting, consistent

2008-09-02  Michael Natterer  <mitch@imendio.com>

	* *.h: big header formatting cleanup: indentation, vtable
	formatting, consistent spacing in (* vfunc), trailing whitespace
	removal. Formatting should be pretty consistent in all GIO headers
	now.


svn path=/trunk/; revision=7433
parent 920f3bff
2008-09-02 Michael Natterer <mitch@imendio.com>
* *.h: big header formatting cleanup: indentation, vtable
formatting, consistent spacing in (* vfunc), trailing whitespace
removal. Formatting should be pretty consistent in all GIO headers
now.
2008-09-02 Matthias Clasen <mclasen@redhat.com>
* gmount.h: Document guess_content_type sync vfunc.
......
......@@ -86,45 +86,43 @@ struct _GAppInfoIface
/* Virtual Table */
GAppInfo * (*dup) (GAppInfo *appinfo);
gboolean (*equal) (GAppInfo *appinfo1,
GAppInfo * (* dup) (GAppInfo *appinfo);
gboolean (* equal) (GAppInfo *appinfo1,
GAppInfo *appinfo2);
const char * (*get_id) (GAppInfo *appinfo);
const char * (*get_name) (GAppInfo *appinfo);
const char * (*get_description) (GAppInfo *appinfo);
const char * (*get_executable) (GAppInfo *appinfo);
GIcon * (*get_icon) (GAppInfo *appinfo);
gboolean (*launch) (GAppInfo *appinfo,
const char * (* get_id) (GAppInfo *appinfo);
const char * (* get_name) (GAppInfo *appinfo);
const char * (* get_description) (GAppInfo *appinfo);
const char * (* get_executable) (GAppInfo *appinfo);
GIcon * (* get_icon) (GAppInfo *appinfo);
gboolean (* launch) (GAppInfo *appinfo,
GList *filenames,
GAppLaunchContext *launch_context,
GError **error);
gboolean (*supports_uris) (GAppInfo *appinfo);
gboolean (*supports_files) (GAppInfo *appinfo);
gboolean (*launch_uris) (GAppInfo *appinfo,
gboolean (* supports_uris) (GAppInfo *appinfo);
gboolean (* supports_files) (GAppInfo *appinfo);
gboolean (* launch_uris) (GAppInfo *appinfo,
GList *uris,
GAppLaunchContext *launch_context,
GError **error);
gboolean (*should_show) (GAppInfo *appinfo);
gboolean (* should_show) (GAppInfo *appinfo);
/* For changing associations */
gboolean (*set_as_default_for_type) (GAppInfo *appinfo,
gboolean (* set_as_default_for_type) (GAppInfo *appinfo,
const char *content_type,
GError **error);
gboolean (*set_as_default_for_extension) (GAppInfo *appinfo,
gboolean (* set_as_default_for_extension) (GAppInfo *appinfo,
const char *extension,
GError **error);
gboolean (*add_supports_type) (GAppInfo *appinfo,
gboolean (* add_supports_type) (GAppInfo *appinfo,
const char *content_type,
GError **error);
gboolean (*can_remove_supports_type) (GAppInfo *appinfo);
gboolean (*remove_supports_type) (GAppInfo *appinfo,
gboolean (* can_remove_supports_type) (GAppInfo *appinfo);
gboolean (* remove_supports_type) (GAppInfo *appinfo,
const char *content_type,
GError **error);
};
GType g_app_info_get_type (void) G_GNUC_CONST;
GType g_app_launch_context_get_type (void) G_GNUC_CONST;
GAppInfo * g_app_info_create_from_commandline (const char *commandline,
const char *application_name,
GAppInfoCreateFlags flags,
......@@ -193,13 +191,13 @@ struct _GAppLaunchContextClass
{
GObjectClass parent_class;
char * (*get_display) (GAppLaunchContext *context,
char * (* get_display) (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
char * (*get_startup_notify_id) (GAppLaunchContext *context,
char * (* get_startup_notify_id) (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
void (*launch_failed) (GAppLaunchContext *context,
void (* launch_failed) (GAppLaunchContext *context,
const char *startup_notify_id);
/* Padding for future expansion */
......@@ -210,6 +208,7 @@ struct _GAppLaunchContextClass
void (*_g_reserved5) (void);
};
GType g_app_launch_context_get_type (void) G_GNUC_CONST;
GAppLaunchContext *g_app_launch_context_new (void);
char * g_app_launch_context_get_display (GAppLaunchContext *context,
GAppInfo *info,
......
......@@ -27,7 +27,8 @@
G_BEGIN_DECLS
typedef struct {
typedef struct
{
gpointer async_object;
GError * error;
gpointer user_data;
......
......@@ -59,8 +59,8 @@ struct _GAsyncResultIface
/* Virtual Table */
gpointer (*get_user_data) (GAsyncResult *async_result);
GObject * (*get_source_object) (GAsyncResult *async_result);
gpointer (* get_user_data) (GAsyncResult *async_result);
GObject * (* get_source_object) (GAsyncResult *async_result);
};
GType g_async_result_get_type (void) G_GNUC_CONST;
......
......@@ -118,7 +118,6 @@ int g_buffered_input_stream_read_byte (GBufferedInputStream *st
GCancellable *cancellable,
GError **error);
G_END_DECLS
#endif /* __G_BUFFERED_INPUT_STREAM_H__ */
......@@ -27,7 +27,6 @@
#ifndef __G_CONTENT_TYPE_H__
#define __G_CONTENT_TYPE_H__
#include <glib.h>
#include <gio/giotypes.h>
G_BEGIN_DECLS
......
......@@ -59,6 +59,7 @@ struct _GDataInputStream
struct _GDataInputStreamClass
{
GBufferedInputStreamClass parent_class;
/*< private >*/
/* Padding for future expansion */
void (*_g_reserved1) (void);
......@@ -69,7 +70,7 @@ struct _GDataInputStreamClass
};
GType g_data_input_stream_get_type (void) G_GNUC_CONST;
GDataInputStream* g_data_input_stream_new (GInputStream *base_stream);
GDataInputStream * g_data_input_stream_new (GInputStream *base_stream);
void g_data_input_stream_set_byte_order (GDataInputStream *stream,
GDataStreamByteOrder order);
......
......@@ -60,6 +60,7 @@ struct _GDataOutputStream
struct _GDataOutputStreamClass
{
GFilterOutputStreamClass parent_class;
/*< private >*/
/* Padding for future expansion */
void (*_g_reserved1) (void);
......@@ -71,7 +72,7 @@ struct _GDataOutputStreamClass
GType g_data_output_stream_get_type (void) G_GNUC_CONST;
GDataOutputStream* g_data_output_stream_new (GOutputStream *base_stream);
GDataOutputStream * g_data_output_stream_new (GOutputStream *base_stream);
void g_data_output_stream_set_byte_order (GDataOutputStream *stream,
GDataStreamByteOrder order);
......
......@@ -80,15 +80,15 @@ struct _GDesktopAppInfoLookupIface
{
GTypeInterface g_iface;
GAppInfo * (*get_default_for_uri_scheme) (GDesktopAppInfoLookup *lookup,
GAppInfo * (* get_default_for_uri_scheme) (GDesktopAppInfoLookup *lookup,
const char *uri_scheme);
};
GType g_desktop_app_info_lookup_get_type (void) G_GNUC_CONST;
GAppInfo *g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *lookup,
const char *uri_scheme);
G_END_DECLS
#endif /* __G_DESKTOP_APP_INFO_H__ */
......@@ -61,7 +61,6 @@ G_BEGIN_DECLS
* @enumerate_identifiers: Returns an array strings listing the kinds
* of identifiers which the #GDrive has.
*
*
* Interface for creating #GDrive implementations.
*/
typedef struct _GDriveIface GDriveIface;
......@@ -71,39 +70,39 @@ struct _GDriveIface
GTypeInterface g_iface;
/* signals */
void (*changed) (GDrive *drive);
void (*disconnected) (GDrive *drive);
void (*eject_button) (GDrive *drive);
void (* changed) (GDrive *drive);
void (* disconnected) (GDrive *drive);
void (* eject_button) (GDrive *drive);
/* Virtual Table */
char * (*get_name) (GDrive *drive);
GIcon * (*get_icon) (GDrive *drive);
gboolean (*has_volumes) (GDrive *drive);
GList * (*get_volumes) (GDrive *drive);
gboolean (*is_media_removable) (GDrive *drive);
gboolean (*has_media) (GDrive *drive);
gboolean (*is_media_check_automatic) (GDrive *drive);
gboolean (*can_eject) (GDrive *drive);
gboolean (*can_poll_for_media) (GDrive *drive);
void (*eject) (GDrive *drive,
char * (* get_name) (GDrive *drive);
GIcon * (* get_icon) (GDrive *drive);
gboolean (* has_volumes) (GDrive *drive);
GList * (* get_volumes) (GDrive *drive);
gboolean (* is_media_removable) (GDrive *drive);
gboolean (* has_media) (GDrive *drive);
gboolean (* is_media_check_automatic) (GDrive *drive);
gboolean (* can_eject) (GDrive *drive);
gboolean (* can_poll_for_media) (GDrive *drive);
void (* eject) (GDrive *drive,
GMountUnmountFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*eject_finish) (GDrive *drive,
gboolean (* eject_finish) (GDrive *drive,
GAsyncResult *result,
GError **error);
void (*poll_for_media) (GDrive *drive,
void (* poll_for_media) (GDrive *drive,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*poll_for_media_finish) (GDrive *drive,
gboolean (* poll_for_media_finish) (GDrive *drive,
GAsyncResult *result,
GError **error);
char * (*get_identifier) (GDrive *drive,
char * (* get_identifier) (GDrive *drive,
const char *kind);
char ** (*enumerate_identifiers) (GDrive *drive);
char ** (* enumerate_identifiers) (GDrive *drive);
};
GType g_drive_get_type (void) G_GNUC_CONST;
......
......@@ -19,9 +19,9 @@
*
*/
#include <config.h>
#include "gicon.h"
#include "gemblem.h"
#include "glibintl.h"
#include "gioenums.h"
......
......@@ -26,10 +26,8 @@
#ifndef __G_EMBLEM_H__
#define __G_EMBLEM_H__
#include <gio/gicon.h>
#include <gio/gioenums.h>
G_BEGIN_DECLS
#define G_TYPE_EMBLEM (g_emblem_get_type ())
......
......@@ -29,8 +29,7 @@
#define __G_EMBLEMED_ICON_H__
#include <gio/gicon.h>
#include "gemblem.h"
#include <gio/gemblem.h>
G_BEGIN_DECLS
......@@ -58,7 +57,6 @@ GList *g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed);
void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed,
GEmblem *emblem);
G_END_DECLS
#endif /* __G_EMBLEMED_ICON_H__ */
This diff is collapsed.
......@@ -39,7 +39,8 @@ G_BEGIN_DECLS
*
* Information about a specific attribute.
**/
struct _GFileAttributeInfo {
struct _GFileAttributeInfo
{
char *name;
GFileAttributeType type;
GFileAttributeInfoFlags flags;
......@@ -53,7 +54,8 @@ struct _GFileAttributeInfo {
* Acts as a lightweight registry for possible valid file attributes.
* The registry stores Key-Value pair formats as #GFileAttributeInfo<!-- -->s.
**/
struct _GFileAttributeInfoList {
struct _GFileAttributeInfoList
{
GFileAttributeInfo *infos;
int n_infos;
};
......@@ -71,5 +73,4 @@ void g_file_attribute_info_list_add (GFileAttributeInfoL
G_END_DECLS
#endif /* __G_FILE_INFO_H__ */
......@@ -31,7 +31,6 @@
G_BEGIN_DECLS
#define G_TYPE_FILE_ENUMERATOR (g_file_enumerator_get_type ())
#define G_FILE_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_ENUMERATOR, GFileEnumerator))
#define G_FILE_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_ENUMERATOR, GFileEnumeratorClass))
......@@ -62,28 +61,28 @@ struct _GFileEnumeratorClass
/* Virtual Table */
GFileInfo *(*next_file) (GFileEnumerator *enumerator,
GFileInfo * (* next_file) (GFileEnumerator *enumerator,
GCancellable *cancellable,
GError **error);
gboolean (*close_fn) (GFileEnumerator *enumerator,
gboolean (* close_fn) (GFileEnumerator *enumerator,
GCancellable *cancellable,
GError **error);
void (*next_files_async) (GFileEnumerator *enumerator,
void (* next_files_async) (GFileEnumerator *enumerator,
int num_files,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GList * (*next_files_finish) (GFileEnumerator *enumerator,
GList * (* next_files_finish) (GFileEnumerator *enumerator,
GAsyncResult *res,
GError **error);
void (*close_async) (GFileEnumerator *enumerator,
void (* close_async) (GFileEnumerator *enumerator,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*close_finish) (GFileEnumerator *enumerator,
gboolean (* close_finish) (GFileEnumerator *enumerator,
GAsyncResult *res,
GError **error);
......
......@@ -47,9 +47,9 @@ typedef struct _GFileIconClass GFileIconClass;
GType g_file_icon_get_type (void) G_GNUC_CONST;
GIcon *g_file_icon_new (GFile *file);
GIcon * g_file_icon_new (GFile *file);
GFile *g_file_icon_get_file (GFileIcon *icon);
GFile * g_file_icon_get_file (GFileIcon *icon);
G_END_DECLS
......
......@@ -814,5 +814,4 @@ const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMa
G_END_DECLS
#endif /* __G_FILE_INFO_H__ */
......@@ -61,26 +61,27 @@ struct _GFileInputStreamClass
{
GInputStreamClass parent_class;
goffset (*tell) (GFileInputStream *stream);
gboolean (*can_seek) (GFileInputStream *stream);
gboolean (*seek) (GFileInputStream *stream,
goffset (* tell) (GFileInputStream *stream);
gboolean (* can_seek) (GFileInputStream *stream);
gboolean (* seek) (GFileInputStream *stream,
goffset offset,
GSeekType type,
GCancellable *cancellable,
GError **error);
GFileInfo *(*query_info) (GFileInputStream *stream,
GFileInfo * (* query_info) (GFileInputStream *stream,
char *attributes,
GCancellable *cancellable,
GError **error);
void (*query_info_async) (GFileInputStream *stream,
void (* query_info_async) (GFileInputStream *stream,
char *attributes,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileInfo *(*query_info_finish) (GFileInputStream *stream,
GFileInfo * (* query_info_finish) (GFileInputStream *stream,
GAsyncResult *res,
GError **error);
/*< private >*/
/* Padding for future expansion */
void (*_g_reserved1) (void);
......@@ -106,7 +107,6 @@ GFileInfo *g_file_input_stream_query_info_finish (GFileInputStream *stream,
GAsyncResult *result,
GError **error);
G_END_DECLS
#endif /* __G_FILE_FILE_INPUT_STREAM_H__ */
......@@ -59,13 +59,13 @@ struct _GFileMonitorClass
GObjectClass parent_class;
/* Signals */
void (* changed) (GFileMonitor* monitor,
GFile* file,
GFile* other_file,
void (* changed) (GFileMonitor *monitor,
GFile *file,
GFile *other_file,
GFileMonitorEvent event_type);
/* Virtual Table */
gboolean (*cancel)(GFileMonitor* monitor);
gboolean (* cancel) (GFileMonitor *monitor);
/*< private >*/
/* Padding for future expansion */
......
......@@ -45,7 +45,8 @@ G_BEGIN_DECLS
**/
typedef struct _GFilenameCompleterClass GFilenameCompleterClass;
struct _GFilenameCompleterClass {
struct _GFilenameCompleterClass
{
GObjectClass parent_class;
/*< public >*/
......
......@@ -61,32 +61,32 @@ struct _GFileOutputStreamClass
{
GOutputStreamClass parent_class;
goffset (*tell) (GFileOutputStream *stream);
gboolean (*can_seek) (GFileOutputStream *stream);
gboolean (*seek) (GFileOutputStream *stream,
goffset (* tell) (GFileOutputStream *stream);
gboolean (* can_seek) (GFileOutputStream *stream);
gboolean (* seek) (GFileOutputStream *stream,
goffset offset,
GSeekType type,
GCancellable *cancellable,
GError **error);
gboolean (*can_truncate) (GFileOutputStream *stream);
gboolean (*truncate_fn) (GFileOutputStream *stream,
gboolean (* can_truncate) (GFileOutputStream *stream);
gboolean (* truncate_fn) (GFileOutputStream *stream,
goffset size,
GCancellable *cancellable,
GError **error);
GFileInfo *(*query_info) (GFileOutputStream *stream,
GFileInfo * (* query_info) (GFileOutputStream *stream,
char *attributes,
GCancellable *cancellable,
GError **error);
void (*query_info_async) (GFileOutputStream *stream,
void (* query_info_async) (GFileOutputStream *stream,
char *attributes,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileInfo *(*query_info_finish) (GFileOutputStream *stream,
GFileInfo * (* query_info_finish) (GFileOutputStream *stream,
GAsyncResult *res,
GError **error);
char *(*get_etag) (GFileOutputStream *stream);
char * (* get_etag) (GFileOutputStream *stream);
/* Padding for future expansion */
void (*_g_reserved1) (void);
......
......@@ -67,7 +67,8 @@ struct _GFilterInputStreamClass
GType g_filter_input_stream_get_type (void) G_GNUC_CONST;
GInputStream *g_filter_input_stream_get_base_stream (GFilterInputStream *stream);
GInputStream * g_filter_input_stream_get_base_stream (GFilterInputStream *stream);
G_END_DECLS
#endif /* __G_FILTER_INPUT_STREAM_H__ */
......@@ -67,7 +67,8 @@ struct _GFilterOutputStreamClass
GType g_filter_output_stream_get_type (void) G_GNUC_CONST;
GOutputStream *g_filter_output_stream_get_base_stream (GFilterOutputStream *stream);
GOutputStream * g_filter_output_stream_get_base_stream (GFilterOutputStream *stream);
G_END_DECLS
#endif /* __G_FILTER_OUTPUT_STREAM_H__ */
......@@ -59,8 +59,8 @@ struct _GIconIface
/* Virtual Table */
guint (*hash) (GIcon *icon);
gboolean (*equal) (GIcon *icon1,
guint (* hash) (GIcon *icon);
gboolean (* equal) (GIcon *icon1,
GIcon *icon2);
};
......
......@@ -98,7 +98,7 @@ struct _GInputStreamClass
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (* close_finish)(GInputStream *stream,
gboolean (* close_finish) (GInputStream *stream,
GAsyncResult *result,
GError **error);
......
......@@ -32,8 +32,6 @@
G_BEGIN_DECLS
GQuark g_io_error_quark (void);
/**
* G_IO_ERROR:
*
......@@ -42,6 +40,7 @@ GQuark g_io_error_quark (void);
**/
#define G_IO_ERROR g_io_error_quark()
GQuark g_io_error_quark (void);
GIOErrorEnum g_io_error_from_errno (gint err_no);
G_END_DECLS
......
......@@ -49,7 +49,7 @@ typedef struct _GIOModuleClass GIOModuleClass;
GType g_io_module_get_type (void) G_GNUC_CONST;
GIOModule *g_io_module_new (const gchar *filename);
GList *g_io_modules_load_all_in_directory (const char *dirname);
GList *g_io_modules_load_all_in_directory (const gchar *dirname);
GIOExtensionPoint *g_io_extension_point_register (const char *name);
GIOExtensionPoint *g_io_extension_point_lookup (const char *name);
......@@ -69,7 +69,9 @@ const char * g_io_extension_get_name (GIOExtension *extension);
gint g_io_extension_get_priority (GIOExtension *extension);
GTypeClass* g_io_extension_ref_class (GIOExtension *extension);
/* API for the modules to implement */
/**
* g_io_module_load:
* @module: a #GIOModule.
......
......@@ -27,7 +27,6 @@
#ifndef __G_IO_SCHEDULER_H__
#define __G_IO_SCHEDULER_H__
#include <glib.h>
#include <gio/giotypes.h>
G_BEGIN_DECLS
......
......@@ -27,7 +27,6 @@
#ifndef __GIO_TYPES_H__
#define __GIO_TYPES_H__
#include <glib-object.h>
#include <gio/gioenums.h>
G_BEGIN_DECLS
......
......@@ -59,17 +59,17 @@ struct _GLoadableIconIface
/* Virtual Table */
GInputStream * (*load) (GLoadableIcon *icon,
GInputStream * (* load) (GLoadableIcon *icon,
int size,
char **type,
GCancellable *cancellable,
GError **error);
void (*load_async) (GLoadableIcon *icon,
void (* load_async) (GLoadableIcon *icon,
int size,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GInputStream * (*load_finish) (GLoadableIcon *icon,
GInputStream * (* load_finish) (GLoadableIcon *icon,
GAsyncResult *res,
char **type,
GError **error);
......@@ -77,7 +77,6 @@ struct _GLoadableIconIface
GType g_loadable_icon_get_type (void) G_GNUC_CONST;
GInputStream *g_loadable_icon_load (GLoadableIcon *icon,
int size,
char **type,
......
......@@ -43,21 +43,25 @@ typedef struct _GLocalDirectoryMonitorClass GLocalDirectoryMonitorClass;
struct _GLocalDirectoryMonitor
{
GFileMonitor parent_instance;
gchar *dirname;
/* For mount emulation */
GUnixMountMonitor *mount_monitor;
gboolean was_mounted;
};
struct _GLocalDirectoryMonitorClass {
struct _GLocalDirectoryMonitorClass
{
GFileMonitorClass parent_class;
gboolean mount_notify;
gboolean (*is_supported) (void);
gboolean (* is_supported) (void);
};
GType g_local_directory_monitor_get_type (void) G_GNUC_CONST;
GFileMonitor* _g_local_directory_monitor_new (const char *dirname,
GFileMonitor * _g_local_directory_monitor_new (const char *dirname,
GFileMonitorFlags flags,
GError **error);
......
......@@ -39,16 +39,14 @@ typedef struct _GLocalFileEnumerator GLocalFileEnumerator;
typedef struct _GLocalFileEnumeratorClass GLocalFileEnumeratorClass;
typedef struct _GLocalFileEnumeratorPrivate GLocalFileEnumeratorPrivate;
struct _GLocalFileEnumeratorClass
{
GFileEnumeratorClass parent_class;
};
GType _g_local_file_enumerator_get_type (void) G_GNUC_CONST;
GFileEnumerator *_g_local_file_enumerator_new (GLocalFile *file,
GFileEnumerator * _g_local_file_enumerator_new (GLocalFile *file,
const char *attributes,
GFileQueryInfoFlags flags,
GCancellable *cancellable,
......
......@@ -32,7 +32,8 @@
G_BEGIN_DECLS
typedef struct {
typedef struct
{
gboolean writable;
gboolean is_sticky;
gboolean has_trash_dir;
......
......@@ -53,7 +53,7 @@ struct _GLocalFileInputStreamClass
GType _g_local_file_input_stream_get_type (void) G_GNUC_CONST;
GFileInputStream *_g_local_file_input_stream_new (int fd);
GFileInputStream * _g_local_file_input_stream_new (int fd);
G_END_DECLS
......
......@@ -41,17 +41,20 @@ typedef struct _GLocalFileMonitorClass GLocalFileMonitorClass;
struct _GLocalFileMonitor