diff options
author | Philip Chimento <philip@endlessm.com> | 2014-06-25 17:34:17 -0700 |
---|---|---|
committer | Philip Chimento <philip@endlessm.com> | 2014-08-20 15:45:03 -0700 |
commit | 160720dd2ce245787fdf642d1ba1774036e841f0 (patch) | |
tree | 09b05621cfc9e660978fac372ca04143c68333ca | |
parent | e94358f195633cba1b50f30884b91cc1fa8766da (diff) |
Introduce versioning macros
The first version is going to be version 0.0, after which we will
bump up to development version 0.1.
[endlessm/eos-sdk#418]
-rw-r--r-- | endless/endless.h | 4 | ||||
-rw-r--r-- | endless/eosapplication.h | 6 | ||||
-rw-r--r-- | endless/eoscustomcontainer.h | 4 | ||||
-rw-r--r-- | endless/eosenums.h | 1 | ||||
-rw-r--r-- | endless/eosflexygrid.h | 28 | ||||
-rw-r--r-- | endless/eospagemanager.h | 30 | ||||
-rw-r--r-- | endless/eostypes.h | 2 | ||||
-rw-r--r-- | endless/eosversion.h | 70 | ||||
-rw-r--r-- | endless/eoswindow.h | 26 |
9 files changed, 120 insertions, 51 deletions
diff --git a/endless/endless.h b/endless/endless.h index c2b4f6d..bfc8524 100644 --- a/endless/endless.h +++ b/endless/endless.h @@ -20,11 +20,11 @@ G_BEGIN_DECLS #undef _EOS_SDK_INSIDE_ENDLESS_H -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_DEPRECATED_IN_0_0 gboolean eos_hello_sample_function (GFile *file, GError **error); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 const gchar * eos_get_system_personality (void); G_END_DECLS diff --git a/endless/eosapplication.h b/endless/eosapplication.h index 36afc80..67d4194 100644 --- a/endless/eosapplication.h +++ b/endless/eosapplication.h @@ -55,14 +55,14 @@ struct _EosApplicationClass gpointer _padding[8]; }; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GType eos_application_get_type (void) G_GNUC_CONST; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 EosApplication *eos_application_new (const gchar *application_id, GApplicationFlags flags); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GFile *eos_application_get_config_dir (EosApplication *self); G_END_DECLS diff --git a/endless/eoscustomcontainer.h b/endless/eoscustomcontainer.h index 743bc59..14b5abd 100644 --- a/endless/eoscustomcontainer.h +++ b/endless/eoscustomcontainer.h @@ -56,10 +56,10 @@ struct _EosCustomContainerClass gpointer _padding[8]; }; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GType eos_custom_container_get_type (void) G_GNUC_CONST; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GtkWidget *eos_custom_container_new (void); G_END_DECLS diff --git a/endless/eosenums.h b/endless/eosenums.h index fda9819..257f435 100644 --- a/endless/eosenums.h +++ b/endless/eosenums.h @@ -42,6 +42,7 @@ typedef enum EOS_FLEXY_SHAPE_LARGE } EosFlexyShape; +EOS_SDK_AVAILABLE_IN_0_0 GType eos_flexy_shape_get_type (void) G_GNUC_CONST; G_END_DECLS diff --git a/endless/eosflexygrid.h b/endless/eosflexygrid.h index 87fedc8..d18162d 100644 --- a/endless/eosflexygrid.h +++ b/endless/eosflexygrid.h @@ -88,31 +88,31 @@ struct _EosFlexyGridClass gpointer _padding[8]; }; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GType eos_flexy_grid_get_type (void) G_GNUC_CONST; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GtkWidget * eos_flexy_grid_new (void); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_flexy_grid_set_cell_size (EosFlexyGrid *grid, int size); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 guint eos_flexy_grid_get_cell_size (EosFlexyGrid *grid); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_flexy_grid_set_cell_spacing (EosFlexyGrid *grid, int spacing); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 guint eos_flexy_grid_get_cell_spacing (EosFlexyGrid *grid); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_flexy_grid_insert (EosFlexyGrid *grid, GtkWidget *child, int index_); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_flexy_grid_set_sort_func (EosFlexyGrid *grid, EosFlexyGridSortFunc sort_func, gpointer data, GDestroyNotify notify); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 EosFlexyGridCell * eos_flexy_grid_get_cell_at_coords (EosFlexyGrid *grid, double x_pos, double y_pos); @@ -133,17 +133,17 @@ struct _EosFlexyGridCellClass gpointer _padding[8]; }; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GType eos_flexy_grid_cell_get_type (void) G_GNUC_CONST; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GtkWidget * eos_flexy_grid_cell_new (void); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_flexy_grid_cell_set_shape (EosFlexyGridCell *cell, EosFlexyShape shape); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 EosFlexyShape eos_flexy_grid_cell_get_shape (EosFlexyGridCell *cell); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 gboolean eos_flexy_grid_cell_get_selected (EosFlexyGridCell *cell); G_END_DECLS diff --git a/endless/eospagemanager.h b/endless/eospagemanager.h index 38e0ac0..86cdacd 100644 --- a/endless/eospagemanager.h +++ b/endless/eospagemanager.h @@ -56,67 +56,67 @@ struct _EosPageManagerClass gpointer _padding[8]; }; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GType eos_page_manager_get_type (void) G_GNUC_CONST; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GtkWidget *eos_page_manager_new (void); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GtkWidget *eos_page_manager_get_page_left_topbar_widget (EosPageManager *self, GtkWidget *page); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_page_manager_set_page_left_topbar_widget (EosPageManager *self, GtkWidget *page, GtkWidget *left_topbar_widget); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GtkWidget *eos_page_manager_get_page_center_topbar_widget (EosPageManager *self, GtkWidget *page); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_page_manager_set_page_center_topbar_widget (EosPageManager *self, GtkWidget *page, GtkWidget *center_topbar_widget); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 const gchar *eos_page_manager_get_page_background_uri (EosPageManager *self, GtkWidget *page); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_page_manager_set_page_background_uri (EosPageManager *self, GtkWidget *page, const gchar *background); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 const gchar *eos_page_manager_get_page_background_size (EosPageManager *self, GtkWidget *page); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_page_manager_set_page_background_size (EosPageManager *self, GtkWidget *page, const gchar *size); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 const gchar *eos_page_manager_get_page_background_position (EosPageManager *self, GtkWidget *page); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_page_manager_set_page_background_position (EosPageManager *self, GtkWidget *page, const gchar *position); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 gboolean eos_page_manager_get_page_background_repeats (EosPageManager *self, GtkWidget *page); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_page_manager_set_page_background_repeats (EosPageManager *self, GtkWidget *page, gboolean repeats); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_page_manager_remove_page_by_name (EosPageManager *self, const gchar *name); diff --git a/endless/eostypes.h b/endless/eostypes.h index 1feaf48..a15a309 100644 --- a/endless/eostypes.h +++ b/endless/eostypes.h @@ -7,9 +7,9 @@ #error "Please do not include this header file directly." #endif +#include "eosversion.h" #include "eosenums.h" #include "eosmacros.h" -#include "eosversion.h" #include <glib-object.h> diff --git a/endless/eosversion.h b/endless/eosversion.h index 318413c..5870c26 100644 --- a/endless/eosversion.h +++ b/endless/eosversion.h @@ -7,6 +7,74 @@ #error "Please do not include this header file directly." #endif -#define EOS_SDK_ALL_API_VERSIONS +#include <glib.h> + +#ifdef EOS_SDK_DISABLE_DEPRECATION_WARNINGS +#define EOS_SDK_DEPRECATED +#define EOS_SDK_DEPRECATED_FOR(f) +#define EOS_SDK_UNAVAILABLE(maj,min) +#else +#define EOS_SDK_DEPRECATED G_DEPRECATED +#define EOS_SDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) +#define EOS_SDK_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) +#endif + +/* Each new stable series should add a new version symbol here. If necessary, +define EOS_SDK_VERSION_MIN_REQUIRED and EOS_SDK_VERSION_MAX_ALLOWED to one of +these macros. */ +#define EOS_SDK_VERSION_0_0 (G_ENCODE_VERSION (0, 0)) + +#if (EOS_SDK_MINOR_VERSION == 99) +#define EOS_SDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (EOS_SDK_MAJOR_VERSION + 1, 0)) +#elif (EOS_SDK_MINOR_VERSION % 2) +#define EOS_SDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (EOS_SDK_MAJOR_VERSION, EOS_SDK_MINOR_VERSION + 1)) +#else +#define EOS_SDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (EOS_SDK_MAJOR_VERSION, EOS_SDK_MINOR_VERSION)) +#endif + +/* evaluates to the previous stable version */ +#if (EOS_SDK_MINOR_VERSION == 99) +#define EOS_SDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (EOS_SDK_MAJOR_VERSION + 1, 0)) +#elif (EOS_SDK_MINOR_VERSION % 2) +#define EOS_SDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (EOS_SDK_MAJOR_VERSION, EOS_SDK_MINOR_VERSION - 1)) +#else +#define EOS_SDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (EOS_SDK_MAJOR_VERSION, EOS_SDK_MINOR_VERSION - 2)) +#endif + +#ifndef EOS_SDK_VERSION_MIN_REQUIRED +# define EOS_SDK_VERSION_MIN_REQUIRED (EOS_SDK_VERSION_CUR_STABLE) +#endif + +#ifndef EOS_SDK_VERSION_MAX_ALLOWED +# if EOS_SDK_VERSION_MIN_REQUIRED > EOS_SDK_VERSION_PREV_STABLE +# define EOS_SDK_VERSION_MAX_ALLOWED (EOS_SDK_VERSION_MIN_REQUIRED) +# else +# define EOS_SDK_VERSION_MAX_ALLOWED (EOS_SDK_VERSION_CUR_STABLE) +# endif +#endif + +/* sanity checks */ +#if EOS_SDK_VERSION_MAX_ALLOWED < EOS_SDK_VERSION_MIN_REQUIRED +#error "EOS_SDK_VERSION_MAX_ALLOWED must be >= EOS_SDK_VERSION_MIN_REQUIRED" +#endif +#if EOS_SDK_VERSION_MIN_REQUIRED < EOS_SDK_VERSION_0_0 +#error "EOS_SDK_VERSION_MIN_REQUIRED must be >= EOS_SDK_VERSION_0_0" +#endif + +/* Every new stable minor release should add a set of macros here */ + +#if EOS_SDK_VERSION_MIN_REQUIRED >= EOS_SDK_VERSION_0_0 +# define EOS_SDK_DEPRECATED_IN_0_0 EOS_SDK_DEPRECATED +# define EOS_SDK_DEPRECATED_IN_0_0_FOR(f) EOS_SDK_DEPRECATED_FOR(f) +#else +# define EOS_SDK_DEPRECATED_IN_0_0 +# define EOS_SDK_DEPRECATED_IN_0_0_FOR(f) +#endif + +#if EOS_SDK_VERSION_MAX_ALLOWED < EOS_SDK_VERSION_0_0 +# define EOS_SDK_AVAILABLE_IN_0_0 EOS_SDK_UNAVAILABLE(0, 0) +#else +# define EOS_SDK_AVAILABLE_IN_0_0 +#endif #endif /* API_VERSION_H */ diff --git a/endless/eoswindow.h b/endless/eoswindow.h index af39160..14ff399 100644 --- a/endless/eoswindow.h +++ b/endless/eoswindow.h @@ -58,48 +58,48 @@ struct _EosWindowClass gpointer _padding[8]; }; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GType eos_window_get_type (void) G_GNUC_CONST; -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 GtkWidget *eos_window_new (EosApplication *application); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 EosPageManager *eos_window_get_page_manager (EosWindow *self); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_window_set_page_manager (EosWindow *self, EosPageManager *page_manager); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 gboolean eos_window_get_font_scaling_active (EosWindow *self); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_window_set_font_scaling_active (EosWindow *self, gboolean is_scaling); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 gint eos_window_get_font_scaling_default_size (EosWindow *self); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_window_set_font_scaling_default_size (EosWindow *self, gint new_default_font_size); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 gint eos_window_get_font_scaling_default_window_size (EosWindow *self); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_window_set_font_scaling_default_window_size (EosWindow *self, gint new_default_window_size); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 gint eos_window_get_font_scaling_min_font_size (EosWindow *self); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 void eos_window_set_font_scaling_min_font_size (EosWindow *self, gint new_min_font_size); -EOS_SDK_ALL_API_VERSIONS +EOS_SDK_AVAILABLE_IN_0_0 gdouble eos_window_get_font_scaling_calculated_font_size (EosWindow *self); G_END_DECLS |