summaryrefslogtreecommitdiffstats
path: root/xparts/src/gtk/gtkpart.h
blob: e803f03e5747bec5de86828ac41d4b1e3beb8d93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef _gtkxpart_h__
#define _gtkxpart_h__

#ifdef __cplusplus
extern "C" {
#endif

#include <dcopc/dcopobject.h>
#include <dcopc/dcopc.h>
#include <dcopc/marshal.h>
#include <dcopc/util.h>

#include <gtk/gtk.h>

#include "gtkbrowserextension.h"
    
#define GTK_TYPE_XPART             (gtk_xpart_get_type())
#define GTK_XPART(obj)             GTK_CHECK_CAST((obj), GTK_TYPE_XPART, GtkXPart)
#define GTK_XPART_CLASS(klass)     GTK_CHECK_CLASS_CAST((klass), GTK_TYPE_XPART, GtkXPartClass)
#define GTK_IS_XPART(obj)          GTK_CHECK_TYPE((obj), GTK_TYPE_XPART)
#define GTK_IS_XPART_CLASS(klass)  GTK_CHECK_CLASS_TYPE((klass), GTK_TYPE_XPART)

#define GTK_XPART_WIDGET(part)  (gtk_xpart_get_widget(part))
#define GTK_XPART_DCOP(part) (gtk_xpart_get_dcop(part))

typedef struct _GtkXPart GtkXPart;
typedef struct _GtkXPartClass GtkXPartClass;

struct _GtkXPart
{
    DcopObject obj;
    void *data;
};

struct _GtkXPartClass
{
    DcopObjectClass parent_class;

    gboolean (* open_url) ( GtkXPart *part, const char * url );
    gboolean (* close_url) ( GtkXPart *part );

    /* virtual function, returns the dcop object id of the extension, or NULL if it
       doesn't exist */
    char * (*query_extension) ( GtkXPart *part, const char *name );
};

extern GtkType gtk_xpart_get_type (void);
extern GtkXPart *gtk_xpart_new (void);

/* "virtual" functions from DcopObject */
void gtk_xpart_set_dcop_client( GtkXPart *part, DcopClient *client );
gboolean gtk_xpart_register( GtkXPart *part, const gchar *host_app_id, const gchar *host_obj_id);
gboolean gtk_xpart_initialize_actions( GtkXPart *part, const char * actions );

void gtk_xpart_set_widget( GtkXPart *part, GtkWidget *widget );

#ifdef __cplusplus
}
#endif

#endif