D24003: kwaylandScanner produce version enum per class

Roman Gilg noreply at phabricator.kde.org
Fri Sep 20 17:02:57 BST 2019


romangg added a comment.


  Header output with the patch:
  
    #ifndef KWAYLAND_SERVER_WP_PRIMARY_SELECTION_UNSTABLE_V1_H
    #define KWAYLAND_SERVER_WP_PRIMARY_SELECTION_UNSTABLE_V1_H
    
    #include "global.h"
    #include "resource.h"
    
    #include <KWayland/Server/kwaylandserver_export.h>
    
    namespace KWayland
    {
    namespace Server
    {
    
    class Display;
    
    /**
     * Enum describing the interface versions the PrimarySelectionDeviceManagerV1Interface can support.
     *
     * @since 5.XX
     **/
    enum class PrimarySelectionDeviceManagerV1InterfaceVersion {
        /**
         * zwp_primary_selection_device_manager_v1
         **/
         UnstableV1
    };
    
    /**
     * Enum describing the interface versions the PrimarySelectionDeviceV1Interface can support.
     *
     * @since 5.XX
     **/
    enum class PrimarySelectionDeviceV1InterfaceVersion {
        /**
         * zwp_primary_selection_device_v1
         **/
         UnstableV1
    };
    
    /**
     * Enum describing the interface versions the PrimarySelectionOfferV1Interface can support.
     *
     * @since 5.XX
     **/
    enum class PrimarySelectionOfferV1InterfaceVersion {
        /**
         * zwp_primary_selection_offer_v1
         **/
         UnstableV1
    };
    
    /**
     * Enum describing the interface versions the PrimarySelectionSourceV1Interface can support.
     *
     * @since 5.XX
     **/
    enum class PrimarySelectionSourceV1InterfaceVersion {
        /**
         * zwp_primary_selection_source_v1
         **/
         UnstableV1
    };
    
    class KWAYLANDSERVER_EXPORT PrimarySelectionDeviceManagerV1Interface : public Global
    {
        Q_OBJECT
    public:
        virtual ~PrimarySelectionDeviceManagerV1Interface();
    
        /**
         * @returns The interface version used by this PrimarySelectionDeviceManagerV1Interface
         **/
        PrimarySelectionDeviceManagerV1InterfaceVersion interfaceVersion() const;
    
    protected:
        class Private;
        explicit PrimarySelectionDeviceManagerV1Interface(Private *d, QObject *parent = nullptr);
    
    private:
        Private *d_func() const;
    };
    
    class KWAYLANDSERVER_EXPORT PrimarySelectionDeviceV1Interface : public Resource
    {
        Q_OBJECT
    public:
    
        virtual ~PrimarySelectionDeviceV1Interface();
    
        /**
         * @returns The interface version used by this PrimarySelectionDeviceV1Interface
         **/
        PrimarySelectionDeviceManagerV1InterfaceVersion interfaceVersion() const;
    
    protected:
        class Private;
        explicit PrimarySelectionDeviceV1Interface(Private *p, QObject *parent = nullptr);
    
    private:
        Private *d_func() const;
    };
    
    class KWAYLANDSERVER_EXPORT PrimarySelectionOfferV1Interface : public Global
    {
        Q_OBJECT
    public:
        virtual ~PrimarySelectionOfferV1Interface();
    
        /**
         * @returns The interface version used by this PrimarySelectionOfferV1Interface
         **/
        PrimarySelectionOfferV1InterfaceVersion interfaceVersion() const;
    
    protected:
        class Private;
        explicit PrimarySelectionOfferV1Interface(Private *d, QObject *parent = nullptr);
    
    private:
        Private *d_func() const;
    };
    
    class KWAYLANDSERVER_EXPORT PrimarySelectionSourceV1Interface : public Resource
    {
        Q_OBJECT
    public:
    
        virtual ~PrimarySelectionSourceV1Interface();
    
        /**
         * @returns The interface version used by this PrimarySelectionSourceV1Interface
         **/
        PrimarySelectionDeviceManagerV1InterfaceVersion interfaceVersion() const;
    
    protected:
        class Private;
        explicit PrimarySelectionSourceV1Interface(Private *p, QObject *parent = nullptr);
    
    private:
        Private *d_func() const;
    };
    
    
    }
    }
    
    #endif
  
  Without it just the first enum is generated.
  
  That being said only two of the four defined enums are actually used in the above skeleton and normally only one enum is defined which then determines all interfaces created by the manager. See for example:
  https://cgit.kde.org/kwayland.git/tree/src/server/textinput_interface.h
  
  Mixing different versions does not make sense so it's enough to have one enum for all interfaces.

REPOSITORY
  R127 KWayland

REVISION DETAIL
  https://phabricator.kde.org/D24003

To: gladhorn, #kwin
Cc: romangg, zzag, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190920/57c66c6b/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list