[gtkmm] gtk/gtkmm/*.h: Export class selectively as needed
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] gtk/gtkmm/*.h: Export class selectively as needed
- Date: Tue, 18 May 2021 14:21:12 +0000 (UTC)
commit 4c5a13030b09bfcf345920a3b40165e209b690f6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue May 11 18:03:12 2021 +0800
gtk/gtkmm/*.h: Export class selectively as needed
We want to avoid exporting classes that contain a std::vector<...> or
std::unique_pointer<...> member, so don't export these class as a whole but
export its methods individually.
Also, remove an extraneous GTKMM_API in listviewtext.h.
This will eliminate warnings C4251 and C4275 and avoid having the built code
depend on a specific STL and compiler version
gtk/gtkmm/bitsetconstiter.h | 28 ++++++++++++++--------------
gtk/gtkmm/listviewtext.h | 2 +-
gtk/gtkmm/treemodelcolumn.h | 16 ++++++++--------
3 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkmm/bitsetconstiter.h b/gtk/gtkmm/bitsetconstiter.h
index e15e49b0..abd10400 100644
--- a/gtk/gtkmm/bitsetconstiter.h
+++ b/gtk/gtkmm/bitsetconstiter.h
@@ -36,7 +36,7 @@ namespace Gtk
*
* @newin{3,98}
*/
-class GTKMM_API BitsetConstIter
+class BitsetConstIter
{
public:
using iterator_category = std::bidirectional_iterator_tag;
@@ -46,20 +46,20 @@ public:
using pointer = void;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- BitsetConstIter() {}
- BitsetConstIter(const GtkBitset* bitset, bool is_end);
+ GTKMM_API BitsetConstIter() {}
+ GTKMM_API BitsetConstIter(const GtkBitset* bitset, bool is_end);
#endif // DOXYGEN_SHOULD_SKIP_THIS
- BitsetConstIter(const BitsetConstIter& other);
- BitsetConstIter& operator=(const BitsetConstIter& other);
- BitsetConstIter(BitsetConstIter&& other) noexcept;
- BitsetConstIter& operator=(BitsetConstIter&& other) noexcept;
+ GTKMM_API BitsetConstIter(const BitsetConstIter& other);
+ GTKMM_API BitsetConstIter& operator=(const BitsetConstIter& other);
+ GTKMM_API BitsetConstIter(BitsetConstIter&& other) noexcept;
+ GTKMM_API BitsetConstIter& operator=(BitsetConstIter&& other) noexcept;
- BitsetConstIter& operator++();
- BitsetConstIter operator++(int);
- BitsetConstIter& operator--();
- BitsetConstIter operator--(int);
- reference operator*() const;
+ GTKMM_API BitsetConstIter& operator++();
+ GTKMM_API BitsetConstIter operator++(int);
+ GTKMM_API BitsetConstIter& operator--();
+ GTKMM_API BitsetConstIter operator--(int);
+ GTKMM_API reference operator*() const;
/** Discovers whether the iterator is valid, and not equal to end().
* For instance,
@@ -68,9 +68,9 @@ public:
* do_something();
* @endcode
*/
- explicit operator bool() const noexcept;
+ GTKMM_API explicit operator bool() const noexcept;
- bool equal(const BitsetConstIter& other) const noexcept;
+ GTKMM_API bool equal(const BitsetConstIter& other) const noexcept;
private:
std::unique_ptr<GtkBitsetIter> gobject_;
diff --git a/gtk/gtkmm/listviewtext.h b/gtk/gtkmm/listviewtext.h
index 172811d7..6f05ac7c 100644
--- a/gtk/gtkmm/listviewtext.h
+++ b/gtk/gtkmm/listviewtext.h
@@ -112,7 +112,7 @@ public:
protected:
- class GTKMM_API TextModelColumns : public Gtk::TreeModel::ColumnRecord
+ class TextModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:
TextModelColumns(guint columns_count);
diff --git a/gtk/gtkmm/treemodelcolumn.h b/gtk/gtkmm/treemodelcolumn.h
index 956aa0af..78d8c409 100644
--- a/gtk/gtkmm/treemodelcolumn.h
+++ b/gtk/gtkmm/treemodelcolumn.h
@@ -67,28 +67,28 @@ class GTKMM_API TreeModelColumnBase;
* sure it's instantiated after Gtk::Main), even when creating multiple models
* from it.
*/
-class GTKMM_API TreeModelColumnRecord
+class TreeModelColumnRecord
{
public:
- TreeModelColumnRecord();
- virtual ~TreeModelColumnRecord() noexcept;
+ GTKMM_API TreeModelColumnRecord();
+ GTKMM_API virtual ~TreeModelColumnRecord() noexcept;
/** Adds a TreeModelColumn to this record.
* add() not only registers the @a column, but also assigns a column
* index to it. Once registered, the TreeModelColumn is final, and
* you're free to pass it around by value.
*/
- void add(TreeModelColumnBase& column);
+ GTKMM_API void add(TreeModelColumnBase& column);
- unsigned int size() const;
- const GType* types() const;
+ GTKMM_API unsigned int size() const;
+ GTKMM_API const GType* types() const;
private:
std::vector<GType> column_types_;
// noncopyable
- TreeModelColumnRecord(const TreeModelColumnRecord&);
- TreeModelColumnRecord& operator=(const TreeModelColumnRecord&);
+ GTKMM_API TreeModelColumnRecord(const TreeModelColumnRecord&);
+ GTKMM_API TreeModelColumnRecord& operator=(const TreeModelColumnRecord&);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]