~ubuntu-branches/ubuntu/maverick/conglomerate/maverick

« back to all changes in this revision

Viewing changes to src/cong-plugin.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2005-11-08 05:07:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051108050706-bcg60nwqf1z3w0d6
Tags: 0.9.1-1ubuntu1
* Resynchronise with Debian (Closes: #4397).
  - Thanks, Jordan Mantha.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
        CongPluginCallbackConfigure configure_callback;
45
45
 
46
 
#if 1
47
46
        GList *list_of_service; /* ptrs of type CongService */
48
 
#else
49
 
        GList *list_of_document_factory; /* ptrs of type CongServiceDocumentFactory */
50
 
        GList *list_of_importer; /* ptrs of type CongServiceImporter */
51
 
        GList *list_of_exporter; /* ptrs of type CongServiceExporter */
52
 
#if ENABLE_PRINTING
53
 
        GList *list_of_print_method; /* ptrs of type CongServicePrintMethod */
54
 
#endif
55
 
        GList *list_of_thumbnailer; /* ptrs of type CongThumnbailer */
56
 
        GList *list_of_editor_element; /* ptrs of type CongPluginEditorElement */
57
 
        GList *list_of_editor_node_factory; /* ptrs of type CongServiceEditorNodeFactory */
58
 
        GList *list_of_doc_tool; /* ptrs of type CongServiceDocTool */
59
 
        GList *list_of_node_tool; /* ptrs of type CongServiceNodeTool */
60
 
        GList *list_of_property_dialog; /* ptrs of type CongServiceNodePropertyDialog */
61
 
#endif
62
47
};
63
48
 
64
49
CONG_DEFINE_CLASS (CongPlugin, cong_plugin, CONG_PLUGIN, GObject, G_TYPE_OBJECT)
237
222
        g_return_if_fail (IS_CONG_PLUGIN (plugin));
238
223
        g_return_if_fail (callback);
239
224
 
240
 
#if 1
241
 
        cong_plugin_for_each_service_of_type (plugin, 
 
225
        cong_plugin_for_each_service_of_type (plugin,
242
226
                                              CONG_SERVICE_DOCUMENT_FACTORY_TYPE,
243
227
                                              (CongServiceCallback*)callback,
244
228
                                              user_data);
245
 
#else
246
 
        g_list_foreach(PRIVATE(plugin)->list_of_document_factory, (GFunc)callback, user_data);
247
 
#endif
248
229
}
249
230
 
250
231
/**
261
242
        g_return_if_fail (IS_CONG_PLUGIN (plugin));
262
243
        g_return_if_fail (callback);
263
244
 
264
 
#if 1
265
245
        cong_plugin_for_each_service_of_type (plugin, 
266
246
                                              CONG_SERVICE_IMPORTER_TYPE,
267
247
                                              (CongServiceCallback*)callback,
268
248
                                              user_data);
269
 
#else
270
 
        g_list_foreach(PRIVATE (plugin)->list_of_importer, (GFunc)callback, user_data);
271
 
#endif
272
249
}
273
250
 
274
251
/**
285
262
        g_return_if_fail (IS_CONG_PLUGIN (plugin));
286
263
        g_return_if_fail (callback);
287
264
 
288
 
#if 1
289
265
        cong_plugin_for_each_service_of_type (plugin, 
290
266
                                              CONG_SERVICE_EXPORTER_TYPE,
291
267
                                              (CongServiceCallback*)callback,
292
268
                                              user_data);
293
 
#else
294
 
        g_list_foreach(PRIVATE (plugin)->list_of_exporter, (GFunc)callback, user_data);
295
 
#endif
296
269
}
297
270
 
298
271
#if ENABLE_PRINTING
310
283
        g_return_if_fail (IS_CONG_PLUGIN (plugin));
311
284
        g_return_if_fail (callback);
312
285
 
313
 
#if 1
314
286
        cong_plugin_for_each_service_of_type (plugin, 
315
287
                                              CONG_SERVICE_PRINT_METHOD_TYPE,
316
288
                                              (CongServiceCallback*)callback,
317
289
                                              user_data);
318
 
#else
319
 
        g_list_foreach(PRIVATE (plugin)->list_of_print_method, (GFunc)callback, user_data);
320
 
#endif
321
290
}
322
291
#endif
323
292
 
335
304
        g_return_if_fail (IS_CONG_PLUGIN (plugin));
336
305
        g_return_if_fail (callback);
337
306
 
338
 
#if 1
339
307
        cong_plugin_for_each_service_of_type (plugin, 
340
308
                                              CONG_SERVICE_DOC_TOOL_TYPE,
341
309
                                              (CongServiceCallback*)callback,
342
310
                                              user_data);
343
 
#else
344
 
        g_list_foreach(PRIVATE (plugin)->list_of_doc_tool, (GFunc)callback, user_data);
345
 
#endif
346
311
}
347
312
 
348
313
/**
359
324
        g_return_if_fail (IS_CONG_PLUGIN (plugin));
360
325
        g_return_if_fail (callback);
361
326
 
362
 
#if 1
363
327
        cong_plugin_for_each_service_of_type (plugin, 
364
328
                                              CONG_SERVICE_NODE_TOOL_TYPE,
365
329
                                              (CongServiceCallback*)callback,
366
330
                                              user_data);
367
 
#else
368
 
        g_list_foreach(PRIVATE (plugin)->list_of_node_tool, (GFunc)callback, user_data);
369
 
#endif
370
331
}
371
332
 
372
333
 
1057
1018
        return property_dialog;
1058
1019
}
1059
1020
 
 
1021
/**
 
1022
 * cong_plugin_register_custom_property_page:
 
1023
 * @plugin:
 
1024
 * @name:
 
1025
 * @description:
 
1026
 * @service_id:
 
1027
 * @factory_method:
 
1028
 * @user_data:
 
1029
 *
 
1030
 * TODO: Write me
 
1031
 * Returns:
 
1032
 */
 
1033
CongServiceNodePropertyPage*
 
1034
cong_plugin_register_custom_property_page (CongPlugin *plugin,
 
1035
                                           const gchar *name, 
 
1036
                                           const gchar *description,
 
1037
                                           const gchar *service_id,
 
1038
                                           CongCustomPropertyPageFactoryMethod factory_method,
 
1039
                                           gpointer user_data)
 
1040
{
 
1041
        CongServiceNodePropertyPage *property_page;
 
1042
 
 
1043
        g_return_val_if_fail (IS_CONG_PLUGIN (plugin), NULL);
 
1044
        g_return_val_if_fail (name, NULL);
 
1045
        g_return_val_if_fail (description, NULL);
 
1046
        g_return_val_if_fail (service_id, NULL);
 
1047
 
 
1048
        property_page = cong_service_node_property_page_construct (g_object_new (CONG_SERVICE_NODE_PROPERTY_PAGE_TYPE, NULL),
 
1049
                                                                   name,
 
1050
                                                                   description,
 
1051
                                                                   service_id,
 
1052
                                                                   factory_method,
 
1053
                                                                   user_data);
 
1054
 
 
1055
        cong_plugin_add_service (plugin,
 
1056
                                 CONG_SERVICE (property_page));
 
1057
 
 
1058
        return property_page;
 
1059
}
 
1060
 
 
1061
/**
 
1062
 * cong_plugin_register_custom_property_page_for_element:
 
1063
 * @plugin:
 
1064
 * @element_name:
 
1065
 * @service_id:
 
1066
 * @factory_method:
 
1067
 * @user_data:
 
1068
 *
 
1069
 * TODO: Write me
 
1070
 * Returns:
 
1071
 */
 
1072
CongServiceNodePropertyPage*
 
1073
cong_plugin_register_custom_property_page_for_element (CongPlugin *plugin,
 
1074
                                                       const gchar *element_name,
 
1075
                                                       const gchar *service_id,
 
1076
                                                       CongCustomPropertyPageFactoryMethod factory_method,
 
1077
                                                       gpointer user_data)
 
1078
{
 
1079
        CongServiceNodePropertyPage *property_page;
 
1080
        gchar *name;
 
1081
        gchar *description;     
 
1082
 
 
1083
        g_return_val_if_fail (IS_CONG_PLUGIN (plugin), NULL);
 
1084
        g_return_val_if_fail (element_name, NULL);
 
1085
        g_return_val_if_fail (service_id, NULL);
 
1086
 
 
1087
        /* Generate a user-visible name for this plugin property page */
 
1088
#if 1
 
1089
        name = g_strdup (element_name);
 
1090
#else
 
1091
        name = g_strdup_printf (_("<%s> property page"), element_name);
 
1092
#endif
 
1093
 
 
1094
        /* Generate a user-visible description for this plugin */
 
1095
        description = g_strdup_printf (_("Provides a Properties page for the <%s> element"), element_name);
 
1096
 
 
1097
        property_page = cong_plugin_register_custom_property_page (plugin,
 
1098
                                                                   name, 
 
1099
                                                                   description,
 
1100
                                                                   service_id,
 
1101
                                                                   factory_method,
 
1102
                                                                   user_data);
 
1103
        g_free (name);
 
1104
        g_free (description);
 
1105
        
 
1106
        return property_page;
 
1107
}
 
1108
 
 
1109
 
1060
1110
#if ENABLE_PRINTING
1061
1111
/**
1062
1112
 * cong_plugin_register_print_method: