~ubuntu-branches/ubuntu/quantal/thunar/quantal-proposed

1.2.3 by Lionel Le Folgoc
Import upstream version 1.0.2
1
/* $Id$ */
1 by Yves-Alexis Perez
Import upstream version 0.1.4svn+r18850
2
/*-
3
 * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Library General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2 of the License, or (at your option) any later version.
9
 *
10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Library General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Library General Public
16
 * License along with this library; if not, write to the
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
 * Boston, MA 02111-1307, USA.
19
 */
20
21
#ifndef __THUNARX_H__
22
#define __THUNARX_H__
23
24
#define THUNARX_INSIDE_THUNARX_H
25
26
#include <thunarx/thunarx-config.h>
27
#include <thunarx/thunarx-file-info.h>
28
#include <thunarx/thunarx-menu-provider.h>
1.1.1 by Jani Monoses
Import upstream version 0.2.1svn+r19908
29
#include <thunarx/thunarx-preferences-provider.h>
1 by Yves-Alexis Perez
Import upstream version 0.1.4svn+r18850
30
#include <thunarx/thunarx-property-page.h>
31
#include <thunarx/thunarx-property-page-provider.h>
1.1.1 by Jani Monoses
Import upstream version 0.2.1svn+r19908
32
#include <thunarx/thunarx-provider-factory.h>
33
#include <thunarx/thunarx-provider-plugin.h>
1.1.6 by Jani Monoses
Import upstream version 0.2.2svn+r20580
34
#include <thunarx/thunarx-renamer.h>
35
#include <thunarx/thunarx-renamer-provider.h>
1 by Yves-Alexis Perez
Import upstream version 0.1.4svn+r18850
36
37
#undef THUNARX_INSIDE_THUNARX_H
38
1.1.1 by Jani Monoses
Import upstream version 0.2.1svn+r19908
39
#define THUNARX_DEFINE_TYPE(TN, t_n, T_P)                         THUNARX_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
40
#define THUNARX_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)          THUNARX_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, _C_)
41
#define THUNARX_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P)                THUNARX_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, {})
42
#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_)
43
44
#define THUNARX_DEFINE_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE) \
45
static gpointer type_name##_parent_class = NULL; \
46
static GType    type_name##_type = G_TYPE_INVALID; \
47
\
48
static void     type_name##_init              (TypeName        *self); \
49
static void     type_name##_class_init        (TypeName##Class *klass); \
50
static void     type_name##_class_intern_init (TypeName##Class *klass) \
51
{ \
52
  type_name##_parent_class = g_type_class_peek_parent (klass); \
53
  type_name##_class_init (klass); \
54
} \
55
\
56
GType \
57
type_name##_get_type (void) \
58
{ \
59
  return type_name##_type; \
60
} \
61
\
62
void \
63
type_name##_register_type (ThunarxProviderPlugin *thunarx_define_type_plugin) \
64
{ \
65
  GType thunarx_define_type_id; \
66
  static const GTypeInfo thunarx_define_type_info = \
67
  { \
68
    sizeof (TypeName##Class), \
69
    NULL, \
70
    NULL, \
71
    (GClassInitFunc) type_name##_class_intern_init, \
72
    NULL, \
73
    NULL, \
74
    sizeof (TypeName), \
75
    0, \
76
    (GInstanceInitFunc) type_name##_init, \
77
    NULL, \
78
  }; \
79
  thunarx_define_type_id = thunarx_provider_plugin_register_type (thunarx_define_type_plugin, TYPE_PARENT, \
80
                                                                  #TypeName, &thunarx_define_type_info, flags); \
81
  { CODE ; } \
82
  type_name##_type = thunarx_define_type_id; \
83
}
84
85
#define THUNARX_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \
86
{ \
87
  static const GInterfaceInfo thunarx_implement_interface_info = \
88
  { \
89
    (GInterfaceInitFunc) iface_init \
90
  }; \
91
  thunarx_provider_plugin_add_interface (thunarx_define_type_plugin, thunarx_define_type_id, TYPE_IFACE, &thunarx_implement_interface_info); \
92
}
93
1 by Yves-Alexis Perez
Import upstream version 0.1.4svn+r18850
94
#endif /* !__THUNARX_H__ */