libgnt/libgnt

Make GntMenu entirely private.

2019-04-24, Elliott Sales de Andrade
50e4271f8b4a
Parents 0f4ef296f3f9
Children 2e237235d055
Make GntMenu entirely private.
  • +14 -0
    gntmenu.c
  • +2 -38
    gntmenu.h
  • --- a/gntmenu.c Wed Apr 24 01:05:07 2019 -0400
    +++ b/gntmenu.c Wed Apr 24 01:06:29 2019 -0400
    @@ -27,6 +27,20 @@
    #include <ctype.h>
    #include <string.h>
    +struct _GntMenu
    +{
    + GntTree parent;
    + GntMenuType type;
    +
    + GList *list;
    + guint selected;
    +
    + /* This will keep track of its immediate submenu which is visible so
    + * that keystrokes can be passed to it. */
    + GntMenu *submenu;
    + GntMenu *parentmenu;
    +};
    +
    enum
    {
    SIGS = 1,
    --- a/gntmenu.h Wed Apr 24 01:05:07 2019 -0400
    +++ b/gntmenu.h Wed Apr 24 01:06:29 2019 -0400
    @@ -35,15 +35,9 @@
    #include "gntcolors.h"
    #include "gntkeys.h"
    -#define GNT_TYPE_MENU (gnt_menu_get_type())
    -#define GNT_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_MENU, GntMenu))
    -#define GNT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_MENU, GntMenuClass))
    -#define GNT_IS_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_MENU))
    -#define GNT_IS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_MENU))
    -#define GNT_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_MENU, GntMenuClass))
    +#define GNT_TYPE_MENU gnt_menu_get_type()
    typedef struct _GntMenu GntMenu;
    -typedef struct _GntMenuClass GntMenuClass;
    #include "gntmenuitem.h"
    @@ -62,36 +56,6 @@
    GNT_MENU_POPUP,
    } GntMenuType;
    -/**
    - * GntMenu:
    - *
    - * Access to any fields is deprecated. See inline comments for replacements.
    - */
    -struct _GntMenu
    -{
    - GntTree parent;
    - GntMenuType GNTSEAL(type);
    -
    - GList *GNTSEAL(list);
    - guint GNTSEAL(selected);
    -
    - /* This will keep track of its immediate submenu which is visible so that
    - * keystrokes can be passed to it. */
    - GntMenu *GNTSEAL(submenu);
    - GntMenu *GNTSEAL(parentmenu);
    -};
    -
    -struct _GntMenuClass
    -{
    - GntTreeClass parent;
    -
    - /*< private >*/
    - void (*gnt_reserved1)(void);
    - void (*gnt_reserved2)(void);
    - void (*gnt_reserved3)(void);
    - void (*gnt_reserved4)(void);
    -};
    -
    G_BEGIN_DECLS
    /**
    @@ -99,7 +63,7 @@
    *
    * Returns: The GType for GntMenu.
    */
    -GType gnt_menu_get_type(void);
    +G_DECLARE_FINAL_TYPE(GntMenu, gnt_menu, GNT, MENU, GntTree)
    /**
    * gnt_menu_new: