ThunarxProviderPlugin

ThunarxProviderPlugin

Synopsis

#include <thunarx/thunarx.h>

                    ThunarxProviderPlugin;
struct              ThunarxProviderPluginIface;
gboolean            thunarx_provider_plugin_get_resident
                                                        (const ThunarxProviderPlugin *plugin);
void                thunarx_provider_plugin_set_resident
                                                        (ThunarxProviderPlugin *plugin,
                                                         gboolean resident);
GType               thunarx_provider_plugin_register_type
                                                        (ThunarxProviderPlugin *plugin,
                                                         GType type_parent,
                                                         const gchar *type_name,
                                                         const GTypeInfo *type_info,
                                                         GTypeFlags type_flags);
void                thunarx_provider_plugin_add_interface
                                                        (ThunarxProviderPlugin *plugin,
                                                         GType instance_type,
                                                         GType interface_type,
                                                         const GInterfaceInfo *interface_info);
GType               thunarx_provider_plugin_register_enum
                                                        (ThunarxProviderPlugin *plugin,
                                                         const gchar *name,
                                                         const GEnumValue *const_static_values);
GType               thunarx_provider_plugin_register_flags
                                                        (ThunarxProviderPlugin *plugin,
                                                         const gchar *name,
                                                         const GFlagsValue *const_static_values);
#define             THUNARX_DEFINE_TYPE                 (TN,
                                                         t_n,
                                                         T_P)
#define             THUNARX_DEFINE_TYPE_WITH_CODE       (TN,
                                                         t_n,
                                                         T_P,
                                                         _C_)
#define             THUNARX_DEFINE_ABSTRACT_TYPE        (TN,
                                                         t_n,
                                                         T_P)
#define             THUNARX_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN,
                                                         t_n,
                                                         T_P,
                                                         _C_)
#define             THUNARX_DEFINE_TYPE_EXTENDED        (TypeName,
                                                         type_name,
                                                         TYPE_PARENT,
                                                         flags,
                                                         CODE)
#define             THUNARX_IMPLEMENT_INTERFACE         (TYPE_IFACE,
                                                         iface_init)

Description

Details

ThunarxProviderPlugin

typedef struct _ThunarxProviderPlugin ThunarxProviderPlugin;


struct ThunarxProviderPluginIface

struct ThunarxProviderPluginIface {
  gboolean (*get_resident)    (const ThunarxProviderPlugin *plugin);
  void     (*set_resident)    (ThunarxProviderPlugin       *plugin,
                               gboolean                     resident);

  GType    (*register_type)   (ThunarxProviderPlugin       *plugin,
                               GType                        type_parent,
                               const gchar                 *type_name,
                               const GTypeInfo             *type_info,
                               GTypeFlags                   type_flags);
  void     (*add_interface)   (ThunarxProviderPlugin       *plugin,
                               GType                        instance_type,
                               GType                        interface_type,
                               const GInterfaceInfo        *interface_info);
  GType    (*register_enum)   (ThunarxProviderPlugin       *plugin,
                               const gchar                 *name,
                               const GEnumValue            *const_static_values);
  GType    (*register_flags)  (ThunarxProviderPlugin       *plugin,
                               const gchar                 *name,
                               const GFlagsValue           *const_static_values);
};


thunarx_provider_plugin_get_resident ()

gboolean            thunarx_provider_plugin_get_resident
                                                        (const ThunarxProviderPlugin *plugin);

Determines whether the application is allowed to unload plugin from memory when no longer needed and reload it on demand. If FALSE is returned, then the application may unload plugin, else if TRUE is returned the application will take care that plugin is never unloaded from memory during the lifetime of the application.

plugin :

a ThunarxProviderPlugin.

Returns :

TRUE if plugin will be kept in memory once loaded for the first time.

thunarx_provider_plugin_set_resident ()

void                thunarx_provider_plugin_set_resident
                                                        (ThunarxProviderPlugin *plugin,
                                                         gboolean resident);

This method is used to instruct the application that plugin must be kept in memory during the lifetime of the application. The default is to allow the application to unload plugin from the memory when no longer needed. If this method is invoked with a resident value of TRUE then the application will never try to unload plugin.

This method has no effect unless called from the thunar_extension_initialize method of the plugin.

plugin :

a ThunarxProviderPlugin.

resident :

TRUE to make plugin resident in memory.

thunarx_provider_plugin_register_type ()

GType               thunarx_provider_plugin_register_type
                                                        (ThunarxProviderPlugin *plugin,
                                                         GType type_parent,
                                                         const gchar *type_name,
                                                         const GTypeInfo *type_info,
                                                         GTypeFlags type_flags);

Looks up or registers a type that is implemented with a particular type plugin. If a type with name type_name was previously registered, the GType identifier for the type is returned, otherwise the type is newly registered, and the resulting GType identifier returned.

When reregistering a type (typically because a module is unloaded then reloaded, and reinitialized), module and type_parent must be the same as they were previously.

plugin :

a ThunarxProviderPlugin.

type_parent :

the type for the parent class.

type_name :

name for the type.

type_info :

type information structure.

type_flags :

flags field providing details about the type.

Returns :

the new or existing type id.

thunarx_provider_plugin_add_interface ()

void                thunarx_provider_plugin_add_interface
                                                        (ThunarxProviderPlugin *plugin,
                                                         GType instance_type,
                                                         GType interface_type,
                                                         const GInterfaceInfo *interface_info);

Registers an additional interface for a type, whose interface lives in the given type plugin. If the interface was already registered for the type in this plugin, nothing will be done.

As long as any instances of the type exist, the type plugin will not be unloaded.

plugin :

a ThunarxProviderPlugin.

instance_type :

type to which to add the interface.

interface_type :

interface type to add.

interface_info :

type information structure.

thunarx_provider_plugin_register_enum ()

GType               thunarx_provider_plugin_register_enum
                                                        (ThunarxProviderPlugin *plugin,
                                                         const gchar *name,
                                                         const GEnumValue *const_static_values);

Looks up or registers an enumeration that is implemented with a particular type plugin. If a type with name name was previously registered, the GType identifier for the type is returned, otherwise the type is newly registered, and the resulting GType identifier returned.

As long as any instances of the type exist, the type plugin will not be unloaded.

plugin :

a ThunarxProviderPlugin.

name :

the name for the type.

const_static_values :

an array of GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.

Returns :

the new or existing type id.

thunarx_provider_plugin_register_flags ()

GType               thunarx_provider_plugin_register_flags
                                                        (ThunarxProviderPlugin *plugin,
                                                         const gchar *name,
                                                         const GFlagsValue *const_static_values);

Looks up or registers a flags type that is implemented with a particular type plugin. If a type with name qname was previously registered, the GType identifier for the type is returned, otherwise the type is newly registered, and the resulting GType identifier returned.

As long as any instances of the type exist, the type plugin will not be unloaded.

plugin :

a ThunarxProviderPlugin.

name :

name for the type.

const_static_values :

an array of GFlagsValue structs for the possible flags values. The array is terminated by a struct with all members being 0.

Returns :

the new or existing type id.

THUNARX_DEFINE_TYPE()

#define THUNARX_DEFINE_TYPE(TN, t_n, T_P)                         THUNARX_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {})


THUNARX_DEFINE_TYPE_WITH_CODE()

#define THUNARX_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)          THUNARX_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, _C_)


THUNARX_DEFINE_ABSTRACT_TYPE()

#define THUNARX_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P)                THUNARX_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, {})


THUNARX_DEFINE_ABSTRACT_TYPE_WITH_CODE()

#define THUNARX_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN, t_n, T_P, _C_) THUNARX_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, _C_)


THUNARX_DEFINE_TYPE_EXTENDED()

#define             THUNARX_DEFINE_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE)


THUNARX_IMPLEMENT_INTERFACE()

#define             THUNARX_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)