ThunarxProviderPlugin

ThunarxProviderPlugin — The interface to the plugin type registration

Functions

Properties

gboolean resident Read / Write

Types and Values

Object Hierarchy

    GInterface
    ╰── ThunarxProviderPlugin

Includes

#include <thunarx/thunarx.h>

Description

ThunarxProviderPlugin is the interface to the file manager's type plugin loader implementation. It provides methods to extensions - also called provider plugins - to register dynamic types and control certain aspects of the plugin (see thunarx_provider_plugin_set_resident()).

Functions

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.

Parameters

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 .

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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)

Types and Values

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);
};

Interface with virtual methods implemented by the file manager and accessible from the extensions.

Members

get_resident ()

see thunarx_provider_plugin_get_resident().

 

set_resident ()

see thunarx_provider_plugin_set_resident().

 

register_type ()

see thunarx_provider_plugin_register_type().

 

add_interface ()

see thunarx_provider_plugin_add_interface().

 

register_enum ()

see thunarx_provider_plugin_register_enum().

 

register_flags ()

see thunarx_provider_plugin_register_flags().

 

Property Details

The “resident” property

  “resident”                 gboolean

Tells whether a plugin must reside in memory once loaded for the first time. See thunarx_provider_plugin_get_resident() and thunarx_provider_plugin_set_resident() for more details.

Owner: ThunarxProviderPlugin

Flags: Read / Write

Default value: FALSE