[gspell] Remove gspell-version.h, replace by direct use of G_MODULE_EXPORT
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gspell] Remove gspell-version.h, replace by direct use of G_MODULE_EXPORT
- Date: Thu, 18 Aug 2022 22:43:47 +0000 (UTC)
commit a51decd44ddf4c2b92a72fa9b518821964d2c527
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date: Tue Aug 16 16:00:00 2022 +0200
Remove gspell-version.h, replace by direct use of G_MODULE_EXPORT
The less the better.
The GSPELL_AVAILABLE_IN_* macros were intended to be used, perhaps one
day, to have something like GTK has: to check at compile time that we
don't depend on too recently added symbols, if we need to deploy a
program on a distro with an older version of the library. Or, use
conditionally newer symbols, etc. With deprecation macros and
everything.
But I prefer not to have all the infrastructure for that in a small
library like gspell. If creating a small library involves adding lots
and lots of scafffolding, it's too much work compared to the size of the
library.
docs/reference/Makefile.am | 3 +--
gspell/Makefile.am | 3 +--
gspell/gspell-checker-dialog.h | 7 +++---
gspell/gspell-checker.h | 26 +++++++++++-----------
gspell/gspell-entry-buffer.h | 11 +++++-----
gspell/gspell-entry.h | 13 ++++++-----
gspell/gspell-enum-types.h.in | 2 +-
gspell/gspell-language-chooser-button.h | 5 ++---
gspell/gspell-language-chooser-dialog.h | 5 ++---
gspell/gspell-language-chooser.h | 11 +++++-----
gspell/gspell-language.h | 20 ++++++++---------
gspell/gspell-navigator-text-view.h | 7 +++---
gspell/gspell-navigator.h | 9 ++++----
gspell/gspell-text-buffer.h | 11 +++++-----
gspell/gspell-text-view.h | 17 +++++++--------
gspell/gspell-version.h | 38 ---------------------------------
gspell/gspell.h | 1 -
17 files changed, 69 insertions(+), 120 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 3812022..00e3966 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -40,8 +40,7 @@ IGNORE_HFILES = \
gspell-inline-checker-text-buffer.h \
gspell-osx.h \
gspell-text-iter.h \
- gspell-utils.h \
- gspell-version.h
+ gspell-utils.h
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS = --xml-mode --output-format=xml
diff --git a/gspell/Makefile.am b/gspell/Makefile.am
index 368f6c2..3d06721 100644
--- a/gspell/Makefile.am
+++ b/gspell/Makefile.am
@@ -28,8 +28,7 @@ gspell_public_headers = \
gspell-navigator.h \
gspell-navigator-text-view.h \
gspell-text-buffer.h \
- gspell-text-view.h \
- gspell-version.h
+ gspell-text-view.h
gspell_public_c_files = \
gspell-checker.c \
diff --git a/gspell/gspell-checker-dialog.h b/gspell/gspell-checker-dialog.h
index 974e28b..efa4ee3 100644
--- a/gspell/gspell-checker-dialog.h
+++ b/gspell/gspell-checker-dialog.h
@@ -27,13 +27,12 @@
#include <gtk/gtk.h>
#include <gspell/gspell-navigator.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_CHECKER_DIALOG (gspell_checker_dialog_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_DERIVABLE_TYPE (GspellCheckerDialog, gspell_checker_dialog,
GSPELL, CHECKER_DIALOG,
GtkDialog)
@@ -46,11 +45,11 @@ struct _GspellCheckerDialogClass
gpointer padding[8];
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GtkWidget * gspell_checker_dialog_new (GtkWindow *parent,
GspellNavigator *navigator);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GspellNavigator * gspell_checker_dialog_get_spell_navigator (GspellCheckerDialog *dialog);
G_END_DECLS
diff --git a/gspell/gspell-checker.h b/gspell/gspell-checker.h
index 8e7760d..77cb3aa 100644
--- a/gspell/gspell-checker.h
+++ b/gspell/gspell-checker.h
@@ -26,15 +26,15 @@
#endif
#include <glib-object.h>
+#include <gmodule.h>
#include <enchant.h>
#include <gspell/gspell-language.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_CHECKER (gspell_checker_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_DERIVABLE_TYPE (GspellChecker, gspell_checker,
GSPELL, CHECKER,
GObject)
@@ -79,52 +79,52 @@ struct _GspellCheckerClass
gpointer padding[12];
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GQuark gspell_checker_error_quark (void);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GspellChecker * gspell_checker_new (const GspellLanguage *language);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_checker_set_language (GspellChecker *checker,
const GspellLanguage *language);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const GspellLanguage *
gspell_checker_get_language (GspellChecker *checker);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
gboolean gspell_checker_check_word (GspellChecker *checker,
const gchar *word,
gssize word_length,
GError **error);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GSList * gspell_checker_get_suggestions (GspellChecker *checker,
const gchar *word,
gssize word_length);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_checker_add_word_to_personal (GspellChecker *checker,
const gchar *word,
gssize word_length);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_checker_add_word_to_session (GspellChecker *checker,
const gchar *word,
gssize word_length);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_checker_clear_session (GspellChecker *checker);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_checker_set_correction (GspellChecker *checker,
const gchar *word,
gssize word_length,
const gchar *replacement,
gssize replacement_length);
-GSPELL_AVAILABLE_IN_1_6
+G_MODULE_EXPORT
EnchantDict * gspell_checker_get_enchant_dict (GspellChecker *checker);
G_END_DECLS
diff --git a/gspell/gspell-entry-buffer.h b/gspell/gspell-entry-buffer.h
index 4a87d15..7eba8c4 100644
--- a/gspell/gspell-entry-buffer.h
+++ b/gspell/gspell-entry-buffer.h
@@ -25,28 +25,27 @@
#endif
#include <gspell/gspell-checker.h>
-#include <gspell/gspell-version.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_ENTRY_BUFFER (gspell_entry_buffer_get_type ())
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
G_DECLARE_FINAL_TYPE (GspellEntryBuffer, gspell_entry_buffer,
GSPELL, ENTRY_BUFFER,
GObject)
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
GspellEntryBuffer * gspell_entry_buffer_get_from_gtk_entry_buffer (GtkEntryBuffer *gtk_buffer);
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
GtkEntryBuffer * gspell_entry_buffer_get_buffer (GspellEntryBuffer *gspell_buffer);
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
GspellChecker * gspell_entry_buffer_get_spell_checker (GspellEntryBuffer
*gspell_buffer);
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
void gspell_entry_buffer_set_spell_checker (GspellEntryBuffer *gspell_buffer,
GspellChecker *spell_checker);
diff --git a/gspell/gspell-entry.h b/gspell/gspell-entry.h
index aa3993a..43236e0 100644
--- a/gspell/gspell-entry.h
+++ b/gspell/gspell-entry.h
@@ -25,30 +25,29 @@
#endif
#include <gtk/gtk.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_ENTRY (gspell_entry_get_type ())
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
G_DECLARE_FINAL_TYPE (GspellEntry, gspell_entry,
GSPELL, ENTRY,
GObject)
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
GspellEntry * gspell_entry_get_from_gtk_entry (GtkEntry *gtk_entry);
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
void gspell_entry_basic_setup (GspellEntry *gspell_entry);
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
GtkEntry * gspell_entry_get_entry (GspellEntry *gspell_entry);
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
gboolean gspell_entry_get_inline_spell_checking (GspellEntry *gspell_entry);
-GSPELL_AVAILABLE_IN_1_4
+G_MODULE_EXPORT
void gspell_entry_set_inline_spell_checking (GspellEntry *gspell_entry,
gboolean enable);
diff --git a/gspell/gspell-enum-types.h.in b/gspell/gspell-enum-types.h.in
index 9f0d92c..69c3644 100644
--- a/gspell/gspell-enum-types.h.in
+++ b/gspell/gspell-enum-types.h.in
@@ -7,7 +7,7 @@
#endif
#include <glib-object.h>
-#include <gspell/gspell-version.h>
+#include <gmodule.h>
G_BEGIN_DECLS
diff --git a/gspell/gspell-language-chooser-button.h b/gspell/gspell-language-chooser-button.h
index 13f8836..45c61bd 100644
--- a/gspell/gspell-language-chooser-button.h
+++ b/gspell/gspell-language-chooser-button.h
@@ -26,13 +26,12 @@
#include <gtk/gtk.h>
#include <gspell/gspell-language.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_LANGUAGE_CHOOSER_BUTTON (gspell_language_chooser_button_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_DERIVABLE_TYPE (GspellLanguageChooserButton, gspell_language_chooser_button,
GSPELL, LANGUAGE_CHOOSER_BUTTON,
GtkButton)
@@ -45,7 +44,7 @@ struct _GspellLanguageChooserButtonClass
gpointer padding[8];
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GtkWidget * gspell_language_chooser_button_new (const GspellLanguage *current_language);
G_END_DECLS
diff --git a/gspell/gspell-language-chooser-dialog.h b/gspell/gspell-language-chooser-dialog.h
index 21c05fc..eb8ac5e 100644
--- a/gspell/gspell-language-chooser-dialog.h
+++ b/gspell/gspell-language-chooser-dialog.h
@@ -27,13 +27,12 @@
#include <gtk/gtk.h>
#include <gspell/gspell-language.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_LANGUAGE_CHOOSER_DIALOG (gspell_language_chooser_dialog_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_DERIVABLE_TYPE (GspellLanguageChooserDialog, gspell_language_chooser_dialog,
GSPELL, LANGUAGE_CHOOSER_DIALOG,
GtkDialog)
@@ -46,7 +45,7 @@ struct _GspellLanguageChooserDialogClass
gpointer padding[8];
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GtkWidget * gspell_language_chooser_dialog_new (GtkWindow *parent,
const GspellLanguage *current_language,
GtkDialogFlags flags);
diff --git a/gspell/gspell-language-chooser.h b/gspell/gspell-language-chooser.h
index 43fbeb6..b2c2089 100644
--- a/gspell/gspell-language-chooser.h
+++ b/gspell/gspell-language-chooser.h
@@ -26,13 +26,12 @@
#include <glib-object.h>
#include <gspell/gspell-language.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_LANGUAGE_CHOOSER (gspell_language_chooser_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_INTERFACE (GspellLanguageChooser, gspell_language_chooser,
GSPELL, LANGUAGE_CHOOSER,
GObject)
@@ -51,17 +50,17 @@ struct _GspellLanguageChooserInterface
const GspellLanguage *language);
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const GspellLanguage * gspell_language_chooser_get_language (GspellLanguageChooser *chooser);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_language_chooser_set_language (GspellLanguageChooser *chooser,
const GspellLanguage *language);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const gchar * gspell_language_chooser_get_language_code (GspellLanguageChooser *chooser);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_language_chooser_set_language_code (GspellLanguageChooser *chooser,
const gchar
*language_code);
diff --git a/gspell/gspell-language.h b/gspell/gspell-language.h
index effc579..d63d586 100644
--- a/gspell/gspell-language.h
+++ b/gspell/gspell-language.h
@@ -32,7 +32,7 @@
#endif
#include <glib-object.h>
-#include <gspell/gspell-version.h>
+#include <gmodule.h>
G_BEGIN_DECLS
@@ -40,34 +40,34 @@ typedef struct _GspellLanguage GspellLanguage;
#define GSPELL_TYPE_LANGUAGE (gspell_language_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GType gspell_language_get_type (void) G_GNUC_CONST;
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const GList * gspell_language_get_available (void);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const GspellLanguage *
gspell_language_get_default (void);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const GspellLanguage *
gspell_language_lookup (const gchar *language_code);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const gchar * gspell_language_get_code (const GspellLanguage *language);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
const gchar * gspell_language_get_name (const GspellLanguage *language);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
gint gspell_language_compare (const GspellLanguage *language_a,
const GspellLanguage *language_b);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GspellLanguage *gspell_language_copy (const GspellLanguage *language);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_language_free (GspellLanguage *language);
G_END_DECLS
diff --git a/gspell/gspell-navigator-text-view.h b/gspell/gspell-navigator-text-view.h
index 84adf5f..860e907 100644
--- a/gspell/gspell-navigator-text-view.h
+++ b/gspell/gspell-navigator-text-view.h
@@ -27,13 +27,12 @@
#include <gtk/gtk.h>
#include <gspell/gspell-navigator.h>
#include <gspell/gspell-checker.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_NAVIGATOR_TEXT_VIEW (gspell_navigator_text_view_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_DERIVABLE_TYPE (GspellNavigatorTextView, gspell_navigator_text_view,
GSPELL, NAVIGATOR_TEXT_VIEW,
GInitiallyUnowned)
@@ -46,10 +45,10 @@ struct _GspellNavigatorTextViewClass
gpointer padding[8];
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GspellNavigator * gspell_navigator_text_view_new (GtkTextView *view);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GtkTextView * gspell_navigator_text_view_get_view (GspellNavigatorTextView *navigator);
G_END_DECLS
diff --git a/gspell/gspell-navigator.h b/gspell/gspell-navigator.h
index 6f0d377..73b0c51 100644
--- a/gspell/gspell-navigator.h
+++ b/gspell/gspell-navigator.h
@@ -26,13 +26,12 @@
#include <glib-object.h>
#include <gspell/gspell-checker.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_NAVIGATOR (gspell_navigator_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_INTERFACE (GspellNavigator, gspell_navigator,
GSPELL, NAVIGATOR,
GInitiallyUnowned)
@@ -55,18 +54,18 @@ struct _GspellNavigatorInterface
const gchar *change_to);
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
gboolean gspell_navigator_goto_next (GspellNavigator *navigator,
gchar **word,
GspellChecker **spell_checker,
GError **error);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_navigator_change (GspellNavigator *navigator,
const gchar *word,
const gchar *change_to);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_navigator_change_all (GspellNavigator *navigator,
const gchar *word,
const gchar *change_to);
diff --git a/gspell/gspell-text-buffer.h b/gspell/gspell-text-buffer.h
index 600119a..d9b59cf 100644
--- a/gspell/gspell-text-buffer.h
+++ b/gspell/gspell-text-buffer.h
@@ -25,28 +25,27 @@
#endif
#include <gspell/gspell-checker.h>
-#include <gspell/gspell-version.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_TEXT_BUFFER (gspell_text_buffer_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_FINAL_TYPE (GspellTextBuffer, gspell_text_buffer,
GSPELL, TEXT_BUFFER,
GObject)
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GspellTextBuffer * gspell_text_buffer_get_from_gtk_text_buffer (GtkTextBuffer *gtk_buffer);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GtkTextBuffer * gspell_text_buffer_get_buffer (GspellTextBuffer
*gspell_buffer);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GspellChecker * gspell_text_buffer_get_spell_checker (GspellTextBuffer
*gspell_buffer);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_text_buffer_set_spell_checker (GspellTextBuffer *gspell_buffer,
GspellChecker *spell_checker);
diff --git a/gspell/gspell-text-view.h b/gspell/gspell-text-view.h
index dace325..6782bf3 100644
--- a/gspell/gspell-text-view.h
+++ b/gspell/gspell-text-view.h
@@ -25,13 +25,12 @@
#endif
#include <gtk/gtk.h>
-#include <gspell/gspell-version.h>
G_BEGIN_DECLS
#define GSPELL_TYPE_TEXT_VIEW (gspell_text_view_get_type ())
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
G_DECLARE_DERIVABLE_TYPE (GspellTextView, gspell_text_view,
GSPELL, TEXT_VIEW,
GObject)
@@ -44,26 +43,26 @@ struct _GspellTextViewClass
gpointer padding[8];
};
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GspellTextView * gspell_text_view_get_from_gtk_text_view (GtkTextView *gtk_view);
-GSPELL_AVAILABLE_IN_1_2
+G_MODULE_EXPORT
void gspell_text_view_basic_setup (GspellTextView *gspell_view);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
GtkTextView * gspell_text_view_get_view (GspellTextView *gspell_view);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
gboolean gspell_text_view_get_inline_spell_checking (GspellTextView *gspell_view);
-GSPELL_AVAILABLE_IN_ALL
+G_MODULE_EXPORT
void gspell_text_view_set_inline_spell_checking (GspellTextView *gspell_view,
gboolean enable);
-GSPELL_AVAILABLE_IN_1_2
+G_MODULE_EXPORT
gboolean gspell_text_view_get_enable_language_menu (GspellTextView *gspell_view);
-GSPELL_AVAILABLE_IN_1_2
+G_MODULE_EXPORT
void gspell_text_view_set_enable_language_menu (GspellTextView *gspell_view,
gboolean
enable_language_menu);
diff --git a/gspell/gspell.h b/gspell/gspell.h
index 0d0fcfd..b0f7970 100644
--- a/gspell/gspell.h
+++ b/gspell/gspell.h
@@ -36,7 +36,6 @@
#include <gspell/gspell-text-view.h>
#include <gspell/gspell-enum-types.h>
-#include <gspell/gspell-version.h>
#undef GSPELL_H_INSIDE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]