1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /** |
---|
3 | * bonobo-item-handler.h: a generic ItemContainer handler for monikers. |
---|
4 | * |
---|
5 | * Author: |
---|
6 | * Miguel de Icaza (miguel@kernel.org) |
---|
7 | * |
---|
8 | * Copyright 1999, 2000 Helix Code, Inc. |
---|
9 | * Copyright 1999, 2000 Miguel de Icaza |
---|
10 | */ |
---|
11 | |
---|
12 | #ifndef _BONOBO_ITEM_HANDLER_H_ |
---|
13 | #define _BONOBO_ITEM_HANDLER_H_ |
---|
14 | |
---|
15 | #include <libgnome/gnome-defs.h> |
---|
16 | #include <gtk/gtkobject.h> |
---|
17 | #include <bonobo/bonobo-xobject.h> |
---|
18 | |
---|
19 | BEGIN_GNOME_DECLS |
---|
20 | |
---|
21 | #define BONOBO_ITEM_HANDLER_TYPE (bonobo_item_handler_get_type ()) |
---|
22 | #define BONOBO_ITEM_HANDLER(o) (GTK_CHECK_CAST ((o), BONOBO_ITEM_HANDLER_TYPE, BonoboItemHandler)) |
---|
23 | #define BONOBO_ITEM_HANDLER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), BONOBO_ITEM_HANDLER_TYPE, BonoboItemHandlerClass)) |
---|
24 | #define BONOBO_IS_ITEM_HANDLER(o) (GTK_CHECK_TYPE ((o), BONOBO_ITEM_HANDLER_TYPE)) |
---|
25 | #define BONOBO_IS_ITEM_HANDLER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_ITEM_HANDLER_TYPE)) |
---|
26 | |
---|
27 | typedef struct _BonoboItemHandlerPrivate BonoboItemHandlerPrivate; |
---|
28 | typedef struct _BonoboItemHandler BonoboItemHandler; |
---|
29 | |
---|
30 | typedef Bonobo_ItemContainer_ObjectNames *(*BonoboItemHandlerEnumObjectsFn) |
---|
31 | (BonoboItemHandler *h, gpointer data, CORBA_Environment *); |
---|
32 | |
---|
33 | typedef Bonobo_Unknown (*BonoboItemHandlerGetObjectFn) |
---|
34 | (BonoboItemHandler *h, const char *item_name, gboolean only_if_exists, |
---|
35 | gpointer data, CORBA_Environment *ev); |
---|
36 | |
---|
37 | struct _BonoboItemHandler { |
---|
38 | BonoboXObject base; |
---|
39 | |
---|
40 | POA_Bonobo_ItemContainer__epv epv; |
---|
41 | |
---|
42 | BonoboItemHandlerEnumObjectsFn enum_objects; |
---|
43 | BonoboItemHandlerGetObjectFn get_object; |
---|
44 | gpointer user_data; |
---|
45 | |
---|
46 | BonoboItemHandlerPrivate *priv; |
---|
47 | }; |
---|
48 | |
---|
49 | typedef struct { |
---|
50 | BonoboXObjectClass parent_class; |
---|
51 | |
---|
52 | POA_Bonobo_ItemContainer__epv epv; |
---|
53 | } BonoboItemHandlerClass; |
---|
54 | |
---|
55 | GtkType bonobo_item_handler_get_type (void); |
---|
56 | BonoboItemHandler *bonobo_item_handler_new (BonoboItemHandlerEnumObjectsFn enum_objects, |
---|
57 | BonoboItemHandlerGetObjectFn get_object, |
---|
58 | gpointer user_data); |
---|
59 | |
---|
60 | BonoboItemHandler *bonobo_item_handler_construct (BonoboItemHandler *handler, |
---|
61 | BonoboItemHandlerEnumObjectsFn enum_objects, |
---|
62 | BonoboItemHandlerGetObjectFn get_object, |
---|
63 | gpointer user_data); |
---|
64 | |
---|
65 | /* Utility functions that can be used by getObject routines */ |
---|
66 | typedef struct { |
---|
67 | char *key; |
---|
68 | char *value; |
---|
69 | } BonoboItemOption; |
---|
70 | |
---|
71 | GSList *bonobo_item_option_parse (const char *option_string); |
---|
72 | void bonobo_item_options_free (GSList *options); |
---|
73 | |
---|
74 | END_GNOME_DECLS |
---|
75 | |
---|
76 | #endif |
---|
77 | |
---|