shell: Use G_DECLARE_*_TYPE macros

Cut down on boilerplate by using the (no longer that) new helper
macros. We don't care about breaking ABI in private libraries, so
use G_DECLARE_FINAL_TYPE even where the class struct used to be
exposed in the header, except for types we inherit from ourselves
(obviously) or where the class exposes any vfuncs (where changes
could affect inheritance in extensions).
This commit is contained in:
Florian Müllner
2015-09-24 20:07:44 +02:00
parent 58f3b7c748
commit 294702d3f1
33 changed files with 183 additions and 413 deletions

View File

@ -4,12 +4,9 @@
#include "st.h"
#define SHELL_TYPE_GENERIC_CONTAINER (shell_generic_container_get_type ())
#define SHELL_GENERIC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_GENERIC_CONTAINER, ShellGenericContainer))
#define SHELL_GENERIC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_GENERIC_CONTAINER, ShellGenericContainerClass))
#define SHELL_IS_GENERIC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_GENERIC_CONTAINER))
#define SHELL_IS_GENERIC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_GENERIC_CONTAINER))
#define SHELL_GENERIC_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_GENERIC_CONTAINER, ShellGenericContainerClass))
#define SHELL_TYPE_GENERIC_CONTAINER (shell_generic_container_get_type ())
G_DECLARE_FINAL_TYPE (ShellGenericContainer, shell_generic_container,
SHELL, GENERIC_CONTAINER, StWidget)
typedef struct {
float min_size;
@ -22,25 +19,6 @@ typedef struct {
#define SHELL_TYPE_GENERIC_CONTAINER_ALLOCATION (shell_generic_container_allocation_get_type ())
GType shell_generic_container_allocation_get_type (void);
typedef struct _ShellGenericContainer ShellGenericContainer;
typedef struct _ShellGenericContainerClass ShellGenericContainerClass;
typedef struct _ShellGenericContainerPrivate ShellGenericContainerPrivate;
struct _ShellGenericContainer
{
StWidget parent;
ShellGenericContainerPrivate *priv;
};
struct _ShellGenericContainerClass
{
StWidgetClass parent_class;
};
GType shell_generic_container_get_type (void) G_GNUC_CONST;
guint shell_generic_container_get_n_skip_paint (ShellGenericContainer *self);
gboolean shell_generic_container_get_skip_paint (ShellGenericContainer *self,