Commit 95ecfc8e authored by Alexandru Fazakas's avatar Alexandru Fazakas

general: Remove include guards in favor of pragma once

The traditional include guards are not as easy to handle
and require extra thought into the names.

Pragma once is an easier, more contributor friendly approach.

Closes #294

general: Remove include guards in favor of pragma once

The traditional include guards are not as easy to handle
and require extra thought into the names.

Pragma once is an easier, more contributor friendly approach.

Closes #294
parent b1be1fc6
......@@ -19,8 +19,7 @@
Authors: Anders Carlsson <andersca@gnu.org>
*/
#ifndef EEL_ACCESSIBILITY_H
#define EEL_ACCESSIBILITY_H
#pragma once
#include <glib-object.h>
#include <atk/atkobject.h>
......@@ -74,6 +73,4 @@ typedef struct {
PangoLayout *(*get_layout) (GObject *text);
} EelAccessibleTextIface;
GType eel_accessible_text_get_type (void);
#endif /* EEL_ACCESSIBILITY_H */
GType eel_accessible_text_get_type (void);
\ No newline at end of file
......@@ -21,8 +21,7 @@
Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef EEL_ART_EXTENSIONS_H
#define EEL_ART_EXTENSIONS_H
#pragma once
#include <glib.h>
......@@ -59,6 +58,4 @@ void eel_drect_union (EelDRect *dest,
const EelDRect *src1,
const EelDRect *src2);
G_END_DECLS
#endif /* EEL_ART_EXTENSIONS_H */
G_END_DECLS
\ No newline at end of file
......@@ -32,8 +32,7 @@
* Raph Levien <raph@gimp.org>
*/
#ifndef EEL_CANVAS_H
#define EEL_CANVAS_H
#pragma once
#include <gtk/gtk.h>
#include <gtk/gtk-a11y.h>
......@@ -495,6 +494,4 @@ struct _EelCanvasItemAccessibleClass
GtkAccessibleClass parent_class;
};
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -19,8 +19,7 @@
Author: Darin Adler <darin@eazel.com>
*/
#ifndef EEL_DEBUG_H
#define EEL_DEBUG_H
#pragma once
#include <glib.h>
......@@ -38,6 +37,4 @@ void eel_debug_call_at_shutdown (EelFunction function);
void eel_debug_call_at_shutdown_with_data (GFreeFunc function,
gpointer data);
G_END_DECLS
#endif /* EEL_DEBUG_H */
G_END_DECLS
\ No newline at end of file
......@@ -22,8 +22,7 @@
Authors: John Sullivan <sullivan@eazel.com>
*/
#ifndef EEL_GLIB_EXTENSIONS_H
#define EEL_GLIB_EXTENSIONS_H
#pragma once
#include <glib.h>
......@@ -36,6 +35,4 @@ gboolean eel_g_lists_sort_and_check_for_intersection (GList **
/* NULL terminated string arrays (strv). */
gboolean eel_g_strv_equal (char **a,
char **b);
#endif /* EEL_GLIB_EXTENSIONS_H */
char **b);
\ No newline at end of file
......@@ -19,8 +19,7 @@
Authors: Andy Hertzfeld <andy@eazel.com>
*/
#ifndef EEL_GRAPHIC_EFFECTS_H
#define EEL_GRAPHIC_EFFECTS_H
#pragma once
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
......@@ -30,6 +29,4 @@ GdkPixbuf *eel_create_spotlight_pixbuf (GdkPixbuf *source_pixbuf);
/* return a pixbuf colorized with the color specified by the parameters */
GdkPixbuf* eel_create_colorized_pixbuf (GdkPixbuf *source_pixbuf,
GdkRGBA *color);
#endif /* EEL_GRAPHIC_EFFECTS_H */
GdkRGBA *color);
\ No newline at end of file
......@@ -23,8 +23,7 @@
Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef EEL_GTK_EXTENSIONS_H
#define EEL_GTK_EXTENSIONS_H
#pragma once
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
......@@ -35,6 +34,4 @@ char * eel_gtk_window_get_geometry_string (GtkWindow
/* GtkMenu and GtkMenuItem */
GtkMenuItem * eel_gtk_menu_append_separator (GtkMenu *menu);
GtkMenuItem * eel_gtk_menu_insert_separator (GtkMenu *menu,
int index);
#endif /* EEL_GTK_EXTENSIONS_H */
int index);
\ No newline at end of file
......@@ -20,6 +20,8 @@
Author: Darin Adler <darin@eazel.com>
*/
#pragma once
#include "eel-self-checks.h"
void eel_run_lib_self_checks (void);
......
......@@ -19,63 +19,60 @@
Author: Darin Adler <darin@eazel.com>
*/
#ifndef EEL_SELF_CHECKS_H
#define EEL_SELF_CHECKS_H
#pragma once
#include <glib.h>
#include <eel/eel-art-extensions.h>
#define EEL_CHECK_RESULT(type, expression, expected_value) \
G_STMT_START { \
eel_before_check (#expression, __FILE__, __LINE__); \
eel_check_##type##_result (expression, expected_value); \
eel_before_check (#expression, __FILE__, __LINE__); \
eel_check_##type##_result (expression, expected_value); \
} G_STMT_END
#define EEL_CHECK_BOOLEAN_RESULT(expression, expected_value) \
EEL_CHECK_RESULT(boolean, expression, expected_value)
EEL_CHECK_RESULT(boolean, expression, expected_value)
#define EEL_CHECK_INTEGER_RESULT(expression, expected_value) \
EEL_CHECK_RESULT(integer, expression, expected_value)
EEL_CHECK_RESULT(integer, expression, expected_value)
#define EEL_CHECK_DOUBLE_RESULT(expression, expected_value) \
EEL_CHECK_RESULT(double, expression, expected_value)
EEL_CHECK_RESULT(double, expression, expected_value)
#define EEL_CHECK_STRING_RESULT(expression, expected_value) \
EEL_CHECK_RESULT(string, expression, expected_value)
EEL_CHECK_RESULT(string, expression, expected_value)
#define EEL_CHECK_RECTANGLE_RESULT(expression, expected_x0, expected_y0, expected_x1, expected_y1) \
G_STMT_START { \
eel_before_check (#expression, __FILE__, __LINE__); \
eel_check_rectangle_result (expression, expected_x0, expected_y0, expected_x1, expected_y1); \
eel_before_check (#expression, __FILE__, __LINE__); \
eel_check_rectangle_result (expression, expected_x0, expected_y0, expected_x1, expected_y1); \
} G_STMT_END
void eel_exit_if_self_checks_failed (void);
void eel_before_check_function (const char *name);
void eel_after_check_function (void);
void eel_before_check (const char *expression,
const char *file_name,
int line_number);
const char *file_name,
int line_number);
void eel_after_check (void);
/* Both 'result' and 'expected' get freed with g_free */
void eel_report_check_failure (char *result,
char *expected);
char *expected);
void eel_check_boolean_result (gboolean result,
gboolean expected_value);
gboolean expected_value);
void eel_check_integer_result (long result,
long expected_value);
long expected_value);
void eel_check_double_result (double result,
double expected_value);
double expected_value);
void eel_check_rectangle_result (EelIRect result,
int expected_x0,
int expected_y0,
int expected_x1,
int expected_y1);
int expected_x0,
int expected_y0,
int expected_x1,
int expected_y1);
void eel_check_string_result (char *result,
const char *expected_value);
const char *expected_value);
#define EEL_SELF_CHECK_FUNCTION_PROTOTYPE(function) \
void function (void);
void function (void);
#define EEL_CALL_SELF_CHECK_FUNCTION(function) \
eel_before_check_function (#function); \
function (); \
eel_after_check_function ();
#endif /* EEL_SELF_CHECKS_H */
eel_before_check_function (#function); \
function (); \
eel_after_check_function ();
......@@ -20,8 +20,7 @@
Authors: Darin Adler <darin@eazel.com>
*/
#ifndef EEL_STOCK_DIALOGS_H
#define EEL_STOCK_DIALOGS_H
#pragma once
#include <gtk/gtk.h>
......@@ -73,6 +72,4 @@ GtkDialog *eel_create_question_dialog (const char *primary_text,
int response_one,
const char *answer_two,
int response_two,
GtkWindow *parent);
#endif /* EEL_STOCK_DIALOGS_H */
GtkWindow *parent);
\ No newline at end of file
......@@ -20,8 +20,7 @@
Authors: Darin Adler <darin@eazel.com>
*/
#ifndef EEL_STRING_H
#define EEL_STRING_H
#pragma once
#include <glib.h>
#include <string.h>
......@@ -86,6 +85,4 @@ eel_ref_str eel_ref_str_get_unique (const char *string);
eel_ref_str eel_ref_str_ref (eel_ref_str str);
void eel_ref_str_unref (eel_ref_str str);
#define eel_ref_str_peek(__str) ((const char *)(__str))
#endif /* EEL_STRING_H */
#define eel_ref_str_peek(__str) ((const char *)(__str))
\ No newline at end of file
......@@ -24,8 +24,7 @@
John Sullivan <sullivan@eazel.com>
*/
#ifndef EEL_VFS_EXTENSIONS_H
#define EEL_VFS_EXTENSIONS_H
#pragma once
#include <glib.h>
......@@ -48,5 +47,3 @@ void eel_filename_get_rename_region (const char *
char * eel_filename_get_extension_offset (const char *filename);
G_END_DECLS
#endif /* EEL_VFS_EXTENSIONS_H */
......@@ -20,8 +20,7 @@
Authors: Maciej Stachowiak <mjs@eazel.com>
*/
#ifndef EEL_H
#define EEL_H
#pragma once
#include <eel/eel-art-extensions.h>
#include <eel/eel-glib-extensions.h>
......@@ -30,6 +29,4 @@
#include <eel/eel-self-checks.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#endif /* EEL_H */
#include <eel/eel-vfs-extensions.h>
\ No newline at end of file
......@@ -16,8 +16,7 @@
* along with Nautilus. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef NAUTILUS_IMAGE_PROPERTIES_PAGE_PROVIDER_H
#define NAUTILUS_IMAGE_PROPERTIES_PAGE_PROVIDER_H
#pragma once
#include <glib-object.h>
......@@ -28,6 +27,4 @@ G_DECLARE_FINAL_TYPE (NautilusImagesPropertiesPageProvider,
NAUTILUS, IMAGE_PROPERTIES_PAGE_PROVIDER,
GObject)
void nautilus_image_properties_page_provider_load (GTypeModule *module);
#endif
void nautilus_image_properties_page_provider_load (GTypeModule *module);
\ No newline at end of file
......@@ -16,8 +16,7 @@
* Author: Alexander Larsson <alexl@redhat.com>
*/
#ifndef NAUTILUS_IMAGE_PROPERTIES_PAGE_H
#define NAUTILUS_IMAGE_PROPERTIES_PAGE_H
#pragma once
#include <gtk/gtk.h>
......@@ -33,6 +32,4 @@ G_DECLARE_FINAL_TYPE (NautilusImagesPropertiesPage,
void nautilus_image_properties_page_load_from_file_info (NautilusImagesPropertiesPage *page,
NautilusFileInfo *file_info);
NautilusImagesPropertiesPage *nautilus_image_properties_page_new (void);
#endif
NautilusImagesPropertiesPage *nautilus_image_properties_page_new (void);
\ No newline at end of file
......@@ -20,8 +20,7 @@
*
*/
#ifndef NAUTILUS_NSTE_H
#define NAUTILUS_NSTE_H
#pragma once
#include <glib-object.h>
......@@ -33,6 +32,4 @@ G_DECLARE_FINAL_TYPE (NautilusNste, nautilus_nste, NAUTILUS, NSTE, GObject)
void nautilus_nste_load (GTypeModule *module);
G_END_DECLS
#endif /* NAUTILUS_NSTE_H */
G_END_DECLS
\ No newline at end of file
libgd @ 752f65e9
Subproject commit 752f65e91ea0d9a2ee8a2d21343bbd97bd0d038a
......@@ -27,8 +27,7 @@
* returned column refers to a string attribute which can be filled in
* by NautilusInfoProvider */
#ifndef NAUTILUS_COLUMN_PROVIDER_H
#define NAUTILUS_COLUMN_PROVIDER_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -68,6 +67,4 @@ struct _NautilusColumnProviderInterface
/* Interface Functions */
GList *nautilus_column_provider_get_columns (NautilusColumnProvider *provider);
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -21,8 +21,7 @@
*
*/
#ifndef NAUTILUS_COLUMN_H
#define NAUTILUS_COLUMN_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -54,5 +53,3 @@ NautilusColumn *nautilus_column_new (const char *name,
*/
G_END_DECLS
#endif
......@@ -20,8 +20,7 @@
*
*/
#ifndef NAUTILUS_EXTENSION_PRIVATE_H
#define NAUTILUS_EXTENSION_PRIVATE_H
#pragma once
#include <libnautilus-extension/nautilus-file-info.h>
......@@ -29,6 +28,4 @@ G_BEGIN_DECLS
extern NautilusFileInfo *(*nautilus_file_info_getter) (GFile *location, gboolean create);
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -24,13 +24,10 @@
* needs information about a file. They are passed a NautilusFileInfo
* object which should be filled with relevant information */
#ifndef NAUTILUS_EXTENSION_TYPES_H
#define NAUTILUS_EXTENSION_TYPES_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "This header is deprecated, include <nautilus-extension.h> instead."
#endif
#include <nautilus-extension.h>
#endif
......@@ -16,6 +16,8 @@
* License along with libnautilus-extension. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef NAUTILUS_EXTENSION_H
#define NAUTILUS_EXTENSION_H
......@@ -38,6 +40,4 @@
void nautilus_module_initialize (GTypeModule *module);
void nautilus_module_shutdown (void);
void nautilus_module_list_types (const GType **types,
int *num_types);
#endif
int *num_types);
\ No newline at end of file
......@@ -22,8 +22,7 @@
* provides access to the asynchronous data in the NautilusFile.
* Extensions are passed objects of this type for operations. */
#ifndef NAUTILUS_FILE_INFO_H
#define NAUTILUS_FILE_INFO_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -171,6 +170,4 @@ NautilusFileInfo *nautilus_file_info_create (GFile *location);
NautilusFileInfo *nautilus_file_info_lookup_for_uri (const char *uri);
NautilusFileInfo *nautilus_file_info_create_for_uri (const char *uri);
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -26,8 +26,7 @@
* needs information about a file. They are passed a NautilusFileInfo
* object which should be filled with relevant information */
#ifndef NAUTILUS_INFO_PROVIDER_H
#define NAUTILUS_INFO_PROVIDER_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -124,6 +123,4 @@ void nautilus_info_provider_update_complete_invoke (GClosure
NautilusOperationHandle *handle,
NautilusOperationResult result);
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -28,8 +28,7 @@
* Extensions are called when Nautilus displays a location.
*/
#ifndef NAUTILUS_LOCATION_WIDGET_PROVIDER_H
#define NAUTILUS_LOCATION_WIDGET_PROVIDER_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -73,6 +72,4 @@ GtkWidget *nautilus_location_widget_provider_get_widget (NautilusLocationWidgetP
const char *uri,
GtkWidget *window);
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -21,13 +21,10 @@
*
*/
#ifndef NAUTILUS_MENU_ITEM_H
#define NAUTILUS_MENU_ITEM_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
#endif
#include "nautilus-menu.h"
#endif
#include "nautilus-menu.h"
\ No newline at end of file
......@@ -26,8 +26,7 @@
* Nautilus constructs the context menu for a file. They are passed a
* list of NautilusFileInfo objects which holds the current selection */
#ifndef NAUTILUS_MENU_PROVIDER_H
#define NAUTILUS_MENU_PROVIDER_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -85,5 +84,3 @@ GList *nautilus_menu_provider_get_background_items (NautilusMenuProvider *p
void nautilus_menu_provider_emit_items_updated_signal (NautilusMenuProvider *provider);
G_END_DECLS
#endif
......@@ -22,17 +22,16 @@
*
*/
#ifndef NAUTILUS_MENU_H
#define NAUTILUS_MENU_H
#include <glib-object.h>
/* This should be removed at some point. */
#include "nautilus-extension-types.h"
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
#endif
#include <glib-object.h>
/* This should be removed at some point. */
#include "nautilus-extension-types.h"
G_BEGIN_DECLS
#define NAUTILUS_TYPE_MENU (nautilus_menu_get_type ())
......@@ -80,6 +79,4 @@ void nautilus_menu_item_set_submenu (NautilusMenuItem *item,
* menu (NautilusMenu) - The menu belonging to this item. May be null.
*/
G_END_DECLS
#endif /* NAUTILUS_MENU_H */
G_END_DECLS
\ No newline at end of file
......@@ -27,8 +27,7 @@
* list of NautilusFileInfo objects for which information should
* be displayed */
#ifndef NAUTILUS_PROPERTY_PAGE_PROVIDER_H
#define NAUTILUS_PROPERTY_PAGE_PROVIDER_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -72,6 +71,4 @@ struct _NautilusPropertyPageProviderInterface
GList *nautilus_property_page_provider_get_pages (NautilusPropertyPageProvider *provider,
GList *files);
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -21,8 +21,7 @@
*
*/
#ifndef NAUTILUS_PROPERTY_PAGE_H
#define NAUTILUS_PROPERTY_PAGE_H
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
......@@ -51,6 +50,4 @@ NautilusPropertyPage *nautilus_property_page_new (const char *name,
* page (widget) - the property page to display
*/
G_END_DECLS
#endif
G_END_DECLS
\ No newline at end of file
......@@ -16,8 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EGG_ANIMATION_H
#define EGG_ANIMATION_H
#pragma once
#include <gdk/gdk.h>
......@@ -72,6 +71,4 @@ EggAnimation* egg_object_animate_full (gpointer object,
const gchar *first_property,
...) G_GNUC_NULL_TERMINATED;
G_END_DECLS
#endif /* EGG_ANIMATION_H */
G_END_DECLS
\ No newline at end of file
......@@ -16,8 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EGG_FRAME_SOURCE_H
#define EGG_FRAME_SOURCE_H
#pragma once
#include <glib.h>
......@@ -27,6 +26,4 @@ guint egg_frame_source_add (guint frames_per_sec,
GSourceFunc callback,
gpointer user_data);
G_END_DECLS
#endif /* EGG_FRAME_SOURCE_H */
G_END_DECLS
\ No newline at end of file
......@@ -16,8 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IDE_BOX_THEATRIC_H
#define IDE_BOX_THEATRIC_H
#pragma once
#include <gtk/gtk.h>
......@@ -28,6 +27,4 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (IdeBoxTheatric, ide_box_theatric,
IDE, BOX_THEATRIC, GObject)
G_END_DECLS
#endif /* IDE_BOX_THEATRIC_H */
G_END_DECLS
\ No newline at end of file
......@@ -16,8 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IDE_CAIRO_H
#define IDE_CAIRO_H
#pragma once
#include <gtk/gtk.h>
......@@ -63,6 +62,4 @@ _ide_cairo_rectangle_contains_rectangle (const cairo_rectangle_int_t *a,
a->y + (int) a->height >= b->y + (int) b->height);
}
G_END_DECLS
#endif /* IDE_CAIRO_H */
G_END_DECLS
\ No newline at end of file
......@@ -22,7 +22,6 @@
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#endif
G_BEGIN_DECLS
#define NAUTILUS_TYPE_GTK_PLACES_VIEW (nautilus_gtk_places_view_get_type ())
......@@ -80,4 +79,4 @@ GtkWidget * nautilus_gtk_places_view_new (void)
G_END_DECLS
#endif /* NAUTILUS_GTK_PLACES_VIEW_H */
#endif
\ No newline at end of file
......@@ -16,12 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NAUTILUS_GTK_PLACES_VIEW_ROW_H
#define NAUTILUS_GTK_PLACES_VIEW_ROW_H
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#endif
#pragma once
G_BEGIN_DECLS
......@@ -56,6 +51,4 @@ void nautilus_gtk_places_view_row_set_path_size_group (Nauti
void nautilus_gtk_places_view_row_set_space_size_group (NautilusGtkPlacesViewRow *row,
GtkSizeGroup *group);
G_END_DECLS
#endif /* NAUTILUS_GTK_PLACES_VIEW_ROW_H */