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

« back to all changes in this revision

Viewing changes to src/plugin-docbook.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:
163
163
/**
164
164
   Manufactures appropriate DocBook DTD, and assigns it to the given document, then adds it to the node tree (so it should show up when serialised)
165
165
 */
166
 
static xmlDtdPtr add_docbook_declaration(xmlDocPtr xml_doc, const xmlChar *root_element)
 
166
static xmlDtdPtr add_docbook_declaration(xmlDocPtr xml_doc, const gchar *root_element)
167
167
{
168
168
        xmlDtdPtr xml_dtd;
169
169
 
186
186
 * Returns:
187
187
 */
188
188
xmlDocPtr 
189
 
make_article(const xmlChar *title)
 
189
make_article(const gchar *title)
190
190
{
191
191
        xmlDocPtr xml_doc;
192
192
        xmlNodePtr root_node;
193
193
        xmlNodePtr section_node;
194
194
 
195
195
        /* Build up the document and its content: */
196
 
        xml_doc = xmlNewDoc("1.0");
 
196
        xml_doc = xmlNewDoc((const xmlChar*)"1.0");
197
197
 
198
198
        add_docbook_declaration(xml_doc, "article");
199
199
 
200
200
        root_node = xmlNewDocNode(xml_doc,
201
201
                                  NULL, /* xmlNsPtr ns, */
202
 
                                  "article",
 
202
                                  (const xmlChar*)"article",
203
203
                                  NULL);
204
204
 
205
205
        xmlDocSetRootElement(xml_doc,
208
208
        xmlAddChild(root_node,
209
209
                    xmlNewDocNode(xml_doc,
210
210
                                  NULL,
211
 
                                  "title",
212
 
                                  title)
 
211
                                  (const xmlChar*)"title",
 
212
                                  (const xmlChar*)title)
213
213
                    );
214
214
 
215
215
        section_node = xmlNewDocNode(xml_doc,
216
216
                                     NULL,
217
 
                                     "section",
218
 
                                     "");
 
217
                                     (const xmlChar*)"section",
 
218
                                     (const xmlChar*)"");
219
219
        xmlAddChild(root_node, section_node);
220
220
 
221
221
        xmlAddChild(section_node, 
222
222
                    xmlNewDocNode(xml_doc,
223
223
                                  NULL,
224
 
                                  "title",
225
 
                                  _("Untitled section"))
 
224
                                  (const xmlChar*)"title",
 
225
                                  (const xmlChar*)_("Untitled section"))
226
226
                    );
227
227
 
228
228
        xmlAddChild(section_node, 
229
229
                    xmlNewDocNode(xml_doc,
230
230
                                  NULL,
231
 
                                  "para",
232
 
                                  _("Text of the article goes here"))
 
231
                                  (const xmlChar*)"para",
 
232
                                  (const xmlChar*)_("Text of the article goes here"))
233
233
                    );
234
234
 
235
235
        return xml_doc;
262
262
 * Returns:
263
263
 */
264
264
xmlDocPtr 
265
 
make_book(const xmlChar *title)
 
265
make_book(const gchar *title)
266
266
{
267
267
        xmlDocPtr xml_doc;
268
268
        xmlNodePtr root_node;
269
269
        xmlNodePtr chapter_node;
270
270
 
271
271
        /* Build up the document and its content: */
272
 
        xml_doc = xmlNewDoc("1.0");
 
272
        xml_doc = xmlNewDoc((const xmlChar*)"1.0");
273
273
 
274
274
        add_docbook_declaration(xml_doc, "book");       
275
275
 
276
276
        root_node = xmlNewDocNode(xml_doc,
277
277
                                  NULL, /* xmlNsPtr ns, */
278
 
                                  "book",
 
278
                                  (const xmlChar*)"book",
279
279
                                  NULL);
280
280
 
281
281
        xmlDocSetRootElement(xml_doc,
284
284
        xmlAddChild(root_node,
285
285
                    xmlNewDocNode(xml_doc,
286
286
                                  NULL,
287
 
                                  "title",
288
 
                                  title)
 
287
                                  (const xmlChar*)"title",
 
288
                                  (const xmlChar*)title)
289
289
                    );
290
290
 
291
291
        chapter_node = xmlNewDocNode(xml_doc,
292
292
                                     NULL,
293
 
                                     "chapter",
294
 
                                     "");
 
293
                                     (const xmlChar*)"chapter",
 
294
                                     (const xmlChar*)"");
295
295
        xmlAddChild(root_node, chapter_node);
296
296
 
297
297
        xmlAddChild(chapter_node, 
298
298
                    xmlNewDocNode(xml_doc,
299
299
                                  NULL,
300
 
                                  "title",
301
 
                                  _("Untitled chapter"))
 
300
                                  (const xmlChar*)"title",
 
301
                                  (const xmlChar*)_("Untitled chapter"))
302
302
                    );
303
303
 
304
304
        xmlAddChild(chapter_node, 
305
305
                    xmlNewDocNode(xml_doc,
306
306
                                  NULL,
307
 
                                  "para",
308
 
                                  _("Text of the first chapter goes here"))
 
307
                                  (const xmlChar*)"para",
 
308
                                  (const xmlChar*)_("Text of the first chapter goes here"))
309
309
                    );
310
310
 
311
311
        return xml_doc;
338
338
 * Returns:
339
339
 */
340
340
xmlDocPtr 
341
 
make_set(const xmlChar *title)
 
341
make_set(const gchar *title)
342
342
{
343
343
        xmlDocPtr xml_doc;
344
344
        xmlNodePtr root_node;
345
345
        xmlNodePtr book_node;
346
346
 
347
347
        /* Build up the document and its content: */
348
 
        xml_doc = xmlNewDoc("1.0");
 
348
        xml_doc = xmlNewDoc((const xmlChar*)"1.0");
349
349
 
350
350
        add_docbook_declaration(xml_doc, "set");        
351
351
 
352
352
        root_node = xmlNewDocNode(xml_doc,
353
353
                                  NULL, /* xmlNsPtr ns, */
354
 
                                  "set",
 
354
                                  (const xmlChar*)"set",
355
355
                                  NULL);
356
356
 
357
357
        xmlDocSetRootElement(xml_doc,
360
360
        xmlAddChild(root_node,
361
361
                    xmlNewDocNode(xml_doc,
362
362
                                  NULL,
363
 
                                  "title",
364
 
                                  title)
 
363
                                  (const xmlChar*)"title",
 
364
                                  (const xmlChar*)title)
365
365
                    );
366
366
 
367
367
        book_node = xmlNewDocNode(xml_doc,
368
368
                                     NULL,
369
 
                                     "book",
370
 
                                     "");
 
369
                                     (const xmlChar*)"book",
 
370
                                     (const xmlChar*)"");
371
371
 
372
372
        xmlAddChild(root_node, book_node);
373
373
 
374
374
        xmlAddChild(book_node, 
375
375
                    xmlNewDocNode(xml_doc,
376
376
                                  NULL,
377
 
                                  "title",
378
 
                                  _("Untitled book"))
 
377
                                  (const xmlChar*)"title",
 
378
                                  (const xmlChar*)_("Untitled book"))
379
379
                    );
380
380
 
381
381
        return xml_doc;
941
941
                g_assert(buffer);
942
942
 
943
943
                /* Build up the document and its content: */
944
 
                xml_doc = xmlNewDoc("1.0");
 
944
                xml_doc = xmlNewDoc((const xmlChar*)"1.0");
945
945
 
946
946
                add_docbook_declaration(xml_doc, "article");
947
947
                        
948
948
                root_node = xmlNewDocNode(xml_doc,
949
949
                                          NULL, /* xmlNsPtr ns, */
950
 
                                          "article",
951
 
                                          NULL);
 
950
                                          (const xmlChar*)"article",
 
951
                                          (const xmlChar*)NULL);
952
952
 
953
953
                xmlDocSetRootElement(xml_doc,
954
954
                                     root_node);
1018
1018
                g_assert(buffer);
1019
1019
 
1020
1020
                /* Build up the document and its content: */
1021
 
                xml_doc = xmlNewDoc("1.0");
 
1021
                xml_doc = xmlNewDoc((const xmlChar*)"1.0");
1022
1022
                        
1023
1023
                root_node = xmlNewDocNode(xml_doc,
1024
1024
                                          NULL, /* xmlNsPtr ns, */
1025
 
                                          "article",
 
1025
                                          (const xmlChar*)"article",
1026
1026
                                          NULL);
1027
1027
 
1028
1028
                xmlDocSetRootElement(xml_doc,
1031
1031
                xmlAddChild(root_node,
1032
1032
                            xmlNewDocNode(xml_doc,
1033
1033
                                          NULL,
1034
 
                                          "title",
1035
 
                                          uri)
 
1034
                                          (const xmlChar*)"title",
 
1035
                                          (const xmlChar*)uri)
1036
1036
                            );
1037
1037
 
1038
1038
                xmlAddChild(root_node,
1039
1039
                            xmlNewDocNode(xml_doc,
1040
1040
                                          NULL,
1041
 
                                          "programlisting",
1042
 
                                          buffer)
 
1041
                                          (const xmlChar*)"programlisting",
 
1042
                                          (const xmlChar*)buffer)
1043
1043
                            );
1044
1044
 
1045
1045
                /* Finished building content: */
1433
1433
}
1434
1434
#endif /* #if ENABLE_PRINTING */
1435
1435
 
1436
 
/**
1437
 
 * docbook_generic_node_factory_method:
1438
 
 * @custom_property_dialog:
1439
 
 * @doc:
1440
 
 * @node:
1441
 
 *
1442
 
 * TODO: Write me
1443
 
 * Returns:
1444
 
 */
1445
 
GtkWidget* 
1446
 
docbook_generic_node_factory_method(CongServiceNodePropertyDialog *custom_property_dialog, CongDocument *doc, CongNodePtr node)
1447
 
{
1448
 
        gchar* glade_filename;
1449
 
        GladeXML *xml;
1450
 
        GtkWidget *notebook1;
1451
 
 
1452
 
        g_message("docbook_generic_node_factory_method");
1453
 
 
1454
 
        g_return_val_if_fail(custom_property_dialog, NULL);
1455
 
        g_return_val_if_fail(doc, NULL);
1456
 
        g_return_val_if_fail(node, NULL);
1457
 
 
1458
 
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
1459
 
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
1460
 
                                                    "conglomerate/glade/docbook-common-properties.glade",
1461
 
                                                    FALSE,
1462
 
                                                    NULL);
1463
 
 
1464
 
        global_glade_doc_ptr = doc;
1465
 
        global_glade_node_ptr = node;
1466
 
 
1467
 
        xml = glade_xml_new(glade_filename, NULL, NULL);
1468
 
        glade_xml_signal_autoconnect(xml);
1469
 
 
1470
 
        global_glade_doc_ptr = NULL;
1471
 
        global_glade_node_ptr = NULL;
1472
 
 
1473
 
        /* FIXME: wire stuff up! */
1474
 
        
1475
 
        g_free(glade_filename);
1476
 
 
1477
 
        /* Add the advanced properties tab: */
1478
 
        notebook1 = glade_xml_get_widget(xml, "notebook1");
1479
 
        cong_ui_append_advanced_node_properties_page(GTK_NOTEBOOK(notebook1),
1480
 
                                                     doc, 
1481
 
                                                     node);
1482
 
        
1483
 
        return glade_xml_get_widget(xml, "common_dialog");
1484
 
}
1485
 
 
1486
 
/**
1487
 
 * docbook_orderedlist_properties_factory_method:
1488
 
 * @custom_property_dialog:
1489
 
 * @doc:
1490
 
 * @node:
1491
 
 *
1492
 
 * TODO: Write me
1493
 
 * Returns:
1494
 
 */
1495
 
GtkWidget* 
1496
 
docbook_orderedlist_properties_factory_method(CongServiceNodePropertyDialog *custom_property_dialog,
1497
 
                                              CongDocument *doc,
1498
 
                                              CongNodePtr node)
1499
 
{
1500
 
        gchar* glade_filename;
1501
 
        GladeXML *xml;
1502
 
        GtkWidget *notebook1;
1503
 
 
1504
 
        g_message("docbook_orderedlist_properties_factory_method");
1505
 
 
1506
 
        g_return_val_if_fail(custom_property_dialog, NULL);
1507
 
        g_return_val_if_fail(doc, NULL);
1508
 
        g_return_val_if_fail(node, NULL);
1509
 
 
1510
 
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
1511
 
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
1512
 
                                                    "conglomerate/glade/docbook-orderedlist-properties.glade",
1513
 
                                                    FALSE,
1514
 
                                                    NULL);
1515
 
 
1516
 
        global_glade_doc_ptr = doc;
1517
 
        global_glade_node_ptr = node;
1518
 
 
1519
 
        xml = glade_xml_new(glade_filename, NULL, NULL);
1520
 
        glade_xml_signal_autoconnect(xml);
1521
 
 
1522
 
        global_glade_doc_ptr = NULL;
1523
 
        global_glade_node_ptr = NULL;
1524
 
 
1525
 
        g_free(glade_filename);
1526
 
 
1527
 
        /* Wire stuff up: */
1528
 
        {
1529
 
                /* The numeration radio buttons: */
1530
 
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "arabic")),
1531
 
                                        doc,
1532
 
                                        node,
1533
 
                                        NULL,
1534
 
                                        "numeration",
1535
 
                                        "arabic");
1536
 
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "loweralpha")),
1537
 
                                        doc,
1538
 
                                        node,
1539
 
                                        NULL,
1540
 
                                        "numeration",
1541
 
                                        "loweralpha");
1542
 
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "lowerroman")),
1543
 
                                        doc,
1544
 
                                        node,
1545
 
                                        NULL,
1546
 
                                        "numeration",
1547
 
                                        "lowerroman");
1548
 
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "upperalpha")),
1549
 
                                        doc,
1550
 
                                        node,
1551
 
                                        NULL,
1552
 
                                        "numeration",
1553
 
                                        "upperalpha");
1554
 
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "upperroman")),
1555
 
                                        doc,
1556
 
                                        node,
1557
 
                                        NULL,
1558
 
                                        "numeration",
1559
 
                                        "upperroman");
1560
 
                
1561
 
                /* The checkboxes: */
1562
 
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "inheritnum")),
1563
 
                                        doc,
1564
 
                                        node,
1565
 
                                        NULL,
1566
 
                                        "inheritnum",
1567
 
                                        "ignore",
1568
 
                                        "inherit");
1569
 
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "spacing")),
1570
 
                                        doc,
1571
 
                                        node,
1572
 
                                        NULL,
1573
 
                                        "spacing",
1574
 
                                        "normal",
1575
 
                                        "compact");
1576
 
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "continuation")),
1577
 
                                        doc,
1578
 
                                        node,
1579
 
                                        NULL,
1580
 
                                        "continuation",
1581
 
                                        "restart",
1582
 
                                        "continues");
1583
 
                
1584
 
        }
1585
 
        
1586
 
        /* Add the advanced properties tab: */
1587
 
        notebook1 = glade_xml_get_widget(xml, "notebook1");
1588
 
        cong_ui_append_advanced_node_properties_page(GTK_NOTEBOOK(notebook1),
1589
 
                                                     doc, 
1590
 
                                                     node);
1591
 
        
1592
 
        return glade_xml_get_widget(xml, "common_dialog");
1593
 
}
1594
 
 
1595
1436
static void
1596
1437
open_ulink_in_browser (CongNodePtr node)
1597
1438
{
1615
1456
        open_ulink_in_browser (node);
1616
1457
}
1617
1458
 
 
1459
/* Property pages: */
 
1460
/**
 
1461
 * docbook_orderedlist_page_factory_method:
 
1462
 * @custom_property_page:
 
1463
 * @doc:
 
1464
 *
 
1465
 * TODO: Write me
 
1466
 * Returns:
 
1467
 */
 
1468
GtkWidget* 
 
1469
docbook_orderedlist_page_factory_method (CongServiceNodePropertyPage *custom_property_page,
 
1470
                                         CongDocument *doc)
 
1471
{
 
1472
        gchar* glade_filename;
 
1473
        GladeXML *xml;
 
1474
#if 0
 
1475
        GtkWidget *notebook1;
 
1476
#endif
 
1477
 
 
1478
        g_message("docbook_orderedlist_properties_page_factory_method");
 
1479
 
 
1480
        g_return_val_if_fail (custom_property_page, NULL);
 
1481
        g_return_val_if_fail (doc, NULL);
 
1482
 
 
1483
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
 
1484
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
 
1485
                                                    "conglomerate/glade/docbook-orderedlist-properties.glade",
 
1486
                                                    FALSE,
 
1487
                                                    NULL);
 
1488
 
 
1489
        global_glade_doc_ptr = doc;
 
1490
#if 0
 
1491
        global_glade_node_ptr = node;
 
1492
#endif
 
1493
 
 
1494
        xml = glade_xml_new(glade_filename, "orderedlist_page", NULL);
 
1495
        glade_xml_signal_autoconnect(xml);
 
1496
 
 
1497
        global_glade_doc_ptr = NULL;
 
1498
        global_glade_node_ptr = NULL;
 
1499
 
 
1500
        g_free(glade_filename);
 
1501
 
 
1502
#if 0
 
1503
        /* Wire stuff up: */
 
1504
        {
 
1505
                /* The numeration radio buttons: */
 
1506
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "arabic")),
 
1507
                                        doc,
 
1508
                                        node,
 
1509
                                        NULL,
 
1510
                                        "numeration",
 
1511
                                        "arabic");
 
1512
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "loweralpha")),
 
1513
                                        doc,
 
1514
                                        node,
 
1515
                                        NULL,
 
1516
                                        "numeration",
 
1517
                                        "loweralpha");
 
1518
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "lowerroman")),
 
1519
                                        doc,
 
1520
                                        node,
 
1521
                                        NULL,
 
1522
                                        "numeration",
 
1523
                                        "lowerroman");
 
1524
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "upperalpha")),
 
1525
                                        doc,
 
1526
                                        node,
 
1527
                                        NULL,
 
1528
                                        "numeration",
 
1529
                                        "upperalpha");
 
1530
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "upperroman")),
 
1531
                                        doc,
 
1532
                                        node,
 
1533
                                        NULL,
 
1534
                                        "numeration",
 
1535
                                        "upperroman");
 
1536
                
 
1537
                /* The checkboxes: */
 
1538
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "inheritnum")),
 
1539
                                        doc,
 
1540
                                        node,
 
1541
                                        NULL,
 
1542
                                        "inheritnum",
 
1543
                                        "ignore",
 
1544
                                        "inherit");
 
1545
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "spacing")),
 
1546
                                        doc,
 
1547
                                        node,
 
1548
                                        NULL,
 
1549
                                        "spacing",
 
1550
                                        "normal",
 
1551
                                        "compact");
 
1552
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "continuation")),
 
1553
                                        doc,
 
1554
                                        node,
 
1555
                                        NULL,
 
1556
                                        "continuation",
 
1557
                                        "restart",
 
1558
                                        "continues");
 
1559
                
 
1560
        }
 
1561
        
 
1562
        /* Add the advanced properties tab: */
 
1563
        notebook1 = glade_xml_get_widget(xml, "notebook1");
 
1564
        cong_ui_append_advanced_node_properties_page(GTK_NOTEBOOK(notebook1),
 
1565
                                                     doc, 
 
1566
                                                     node);
 
1567
#endif
 
1568
        
 
1569
        return glade_xml_get_widget (xml, "orderedlist_page");
 
1570
}
 
1571
 
 
1572
/**
 
1573
 * docbook_ulink_page_factory_method:
 
1574
 * @custom_property_page:
 
1575
 * @doc:
 
1576
 *
 
1577
 * TODO: Write me
 
1578
 * Returns:
 
1579
 */
 
1580
GtkWidget* 
 
1581
docbook_ulink_page_factory_method (CongServiceNodePropertyPage *custom_property_page,
 
1582
                                   CongDocument *doc)
 
1583
{
 
1584
        gchar* glade_filename;
 
1585
        GladeXML *xml;
 
1586
 
 
1587
        g_message("docbook_ulink_properties_page_factory_method");
 
1588
 
 
1589
        g_return_val_if_fail(custom_property_page, NULL);
 
1590
        g_return_val_if_fail(doc, NULL);
 
1591
 
 
1592
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
 
1593
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
 
1594
                                                    "conglomerate/glade/docbook-ulink-properties.glade",
 
1595
                                                    FALSE,
 
1596
                                                    NULL);
 
1597
        global_glade_doc_ptr = doc;
 
1598
#if 0
 
1599
        global_glade_node_ptr = node;
 
1600
#endif
 
1601
 
 
1602
        xml = glade_xml_new(glade_filename, "ulink_page", NULL);
 
1603
        glade_xml_signal_autoconnect(xml);
 
1604
 
 
1605
#if 0
 
1606
        g_signal_connect (G_OBJECT (glade_xml_get_widget(xml, "test_link_button")),
 
1607
                          "pressed",
 
1608
                          G_CALLBACK (on_test_link_pressed),
 
1609
                          node);
 
1610
#endif
 
1611
 
 
1612
        global_glade_doc_ptr = NULL;
 
1613
        global_glade_node_ptr = NULL;
 
1614
 
 
1615
        g_free(glade_filename);
 
1616
 
 
1617
        return glade_xml_get_widget(xml, "ulink_page");
 
1618
}
 
1619
#if 1
 
1620
static GtkWidget* 
 
1621
docbook_node_page_factory_method_scope (CongServiceNodePropertyPage *custom_property_page, 
 
1622
                                        CongDocument *doc)
 
1623
{
 
1624
        gchar* glade_filename;
 
1625
        GladeXML *xml;
 
1626
 
 
1627
        g_return_val_if_fail (custom_property_page, NULL);
 
1628
        g_return_val_if_fail (doc, NULL);
 
1629
 
 
1630
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
 
1631
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
 
1632
                                                    "conglomerate/glade/docbook-common-properties.glade",
 
1633
                                                    FALSE,
 
1634
                                                    NULL);
 
1635
 
 
1636
        global_glade_doc_ptr = doc;
 
1637
#if 0
 
1638
        global_glade_node_ptr = node;
 
1639
#endif
 
1640
 
 
1641
        xml = glade_xml_new(glade_filename, "scope_page", NULL);
 
1642
        glade_xml_signal_autoconnect(xml);
 
1643
 
 
1644
        global_glade_doc_ptr = NULL;
 
1645
        global_glade_node_ptr = NULL;
 
1646
 
 
1647
        /* FIXME: wire stuff up! */
 
1648
        
 
1649
        g_free(glade_filename);
 
1650
        
 
1651
        return glade_xml_get_widget(xml, "scope_page");
 
1652
}
 
1653
static GtkWidget* 
 
1654
docbook_node_page_factory_method_language (CongServiceNodePropertyPage *custom_property_page, 
 
1655
                                        CongDocument *doc)
 
1656
{
 
1657
        gchar* glade_filename;
 
1658
        GladeXML *xml;
 
1659
 
 
1660
        g_return_val_if_fail (custom_property_page, NULL);
 
1661
        g_return_val_if_fail (doc, NULL);
 
1662
 
 
1663
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
 
1664
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
 
1665
                                                    "conglomerate/glade/docbook-common-properties.glade",
 
1666
                                                    FALSE,
 
1667
                                                    NULL);
 
1668
 
 
1669
        global_glade_doc_ptr = doc;
 
1670
#if 0
 
1671
        global_glade_node_ptr = node;
 
1672
#endif
 
1673
 
 
1674
        xml = glade_xml_new(glade_filename, "language_page", NULL);
 
1675
        glade_xml_signal_autoconnect(xml);
 
1676
 
 
1677
        global_glade_doc_ptr = NULL;
 
1678
        global_glade_node_ptr = NULL;
 
1679
 
 
1680
        /* FIXME: wire stuff up! */
 
1681
        
 
1682
        g_free(glade_filename);
 
1683
 
 
1684
        return glade_xml_get_widget(xml, "language_page");
 
1685
}
 
1686
static GtkWidget* 
 
1687
docbook_node_page_factory_method_revisions (CongServiceNodePropertyPage *custom_property_page, 
 
1688
                                        CongDocument *doc)
 
1689
{
 
1690
        gchar* glade_filename;
 
1691
        GladeXML *xml;
 
1692
 
 
1693
        g_return_val_if_fail (custom_property_page, NULL);
 
1694
        g_return_val_if_fail (doc, NULL);
 
1695
 
 
1696
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
 
1697
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
 
1698
                                                    "conglomerate/glade/docbook-common-properties.glade",
 
1699
                                                    FALSE,
 
1700
                                                    NULL);
 
1701
 
 
1702
        global_glade_doc_ptr = doc;
 
1703
#if 0
 
1704
        global_glade_node_ptr = node;
 
1705
#endif
 
1706
 
 
1707
        xml = glade_xml_new(glade_filename, "revisions_page", NULL);
 
1708
        glade_xml_signal_autoconnect(xml);
 
1709
 
 
1710
        global_glade_doc_ptr = NULL;
 
1711
        global_glade_node_ptr = NULL;
 
1712
 
 
1713
        /* FIXME: wire stuff up! */
 
1714
        
 
1715
        g_free(glade_filename);
 
1716
 
 
1717
        return glade_xml_get_widget(xml, "revisions_page");
 
1718
}
 
1719
#endif
 
1720
/* Property dialogs: */
 
1721
/**
 
1722
 * docbook_generic_node_properties_factory_method:
 
1723
 * @custom_property_dialog:
 
1724
 * @doc:
 
1725
 * @node:
 
1726
 *
 
1727
 * TODO: Write me
 
1728
 * Returns:
 
1729
 */
 
1730
GtkWidget* 
 
1731
docbook_generic_node_properties_factory_method (CongServiceNodePropertyDialog *custom_property_dialog, 
 
1732
                                                CongDocument *doc, 
 
1733
                                                CongNodePtr node)
 
1734
{
 
1735
        gchar* glade_filename;
 
1736
        GladeXML *xml;
 
1737
        GtkWidget *notebook1;
 
1738
 
 
1739
        g_message("docbook_generic_node_factory_method");
 
1740
 
 
1741
        g_return_val_if_fail(custom_property_dialog, NULL);
 
1742
        g_return_val_if_fail(doc, NULL);
 
1743
        g_return_val_if_fail(node, NULL);
 
1744
 
 
1745
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
 
1746
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
 
1747
                                                    "conglomerate/glade/docbook-common-properties.glade",
 
1748
                                                    FALSE,
 
1749
                                                    NULL);
 
1750
 
 
1751
        global_glade_doc_ptr = doc;
 
1752
        global_glade_node_ptr = node;
 
1753
 
 
1754
        xml = glade_xml_new(glade_filename, NULL, NULL);
 
1755
        glade_xml_signal_autoconnect(xml);
 
1756
 
 
1757
        global_glade_doc_ptr = NULL;
 
1758
        global_glade_node_ptr = NULL;
 
1759
 
 
1760
        /* FIXME: wire stuff up! */
 
1761
        
 
1762
        g_free(glade_filename);
 
1763
 
 
1764
        /* Add the advanced properties tab: */
 
1765
        notebook1 = glade_xml_get_widget(xml, "notebook1");
 
1766
        cong_ui_append_advanced_node_properties_page(GTK_NOTEBOOK(notebook1),
 
1767
                                                     doc, 
 
1768
                                                     node);
 
1769
        
 
1770
        return glade_xml_get_widget(xml, "common_dialog");
 
1771
}
 
1772
 
 
1773
/**
 
1774
 * docbook_orderedlist_properties_factory_method:
 
1775
 * @custom_property_dialog:
 
1776
 * @doc:
 
1777
 * @node:
 
1778
 *
 
1779
 * TODO: Write me
 
1780
 * Returns:
 
1781
 */
 
1782
GtkWidget* 
 
1783
docbook_orderedlist_properties_factory_method(CongServiceNodePropertyDialog *custom_property_dialog,
 
1784
                                              CongDocument *doc,
 
1785
                                              CongNodePtr node)
 
1786
{
 
1787
        gchar* glade_filename;
 
1788
        GladeXML *xml;
 
1789
        GtkWidget *notebook1;
 
1790
 
 
1791
        g_message("docbook_orderedlist_properties_factory_method");
 
1792
 
 
1793
        g_return_val_if_fail(custom_property_dialog, NULL);
 
1794
        g_return_val_if_fail(doc, NULL);
 
1795
        g_return_val_if_fail(node, NULL);
 
1796
 
 
1797
        glade_filename = gnome_program_locate_file (cong_app_get_gnome_program (cong_app_singleton()),
 
1798
                                                    GNOME_FILE_DOMAIN_APP_DATADIR,
 
1799
                                                    "conglomerate/glade/docbook-orderedlist-properties.glade",
 
1800
                                                    FALSE,
 
1801
                                                    NULL);
 
1802
 
 
1803
        global_glade_doc_ptr = doc;
 
1804
        global_glade_node_ptr = node;
 
1805
 
 
1806
        xml = glade_xml_new(glade_filename, NULL, NULL);
 
1807
        glade_xml_signal_autoconnect(xml);
 
1808
 
 
1809
        global_glade_doc_ptr = NULL;
 
1810
        global_glade_node_ptr = NULL;
 
1811
 
 
1812
        g_free(glade_filename);
 
1813
 
 
1814
        /* Wire stuff up: */
 
1815
        {
 
1816
                /* The numeration radio buttons: */
 
1817
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "arabic")),
 
1818
                                        doc,
 
1819
                                        node,
 
1820
                                        NULL,
 
1821
                                        "numeration",
 
1822
                                        "arabic");
 
1823
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "loweralpha")),
 
1824
                                        doc,
 
1825
                                        node,
 
1826
                                        NULL,
 
1827
                                        "numeration",
 
1828
                                        "loweralpha");
 
1829
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "lowerroman")),
 
1830
                                        doc,
 
1831
                                        node,
 
1832
                                        NULL,
 
1833
                                        "numeration",
 
1834
                                        "lowerroman");
 
1835
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "upperalpha")),
 
1836
                                        doc,
 
1837
                                        node,
 
1838
                                        NULL,
 
1839
                                        "numeration",
 
1840
                                        "upperalpha");
 
1841
                cong_bind_radio_button (GTK_RADIO_BUTTON (glade_xml_get_widget(xml, "upperroman")),
 
1842
                                        doc,
 
1843
                                        node,
 
1844
                                        NULL,
 
1845
                                        "numeration",
 
1846
                                        "upperroman");
 
1847
                
 
1848
                /* The checkboxes: */
 
1849
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "inheritnum")),
 
1850
                                        doc,
 
1851
                                        node,
 
1852
                                        NULL,
 
1853
                                        "inheritnum",
 
1854
                                        "ignore",
 
1855
                                        "inherit");
 
1856
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "spacing")),
 
1857
                                        doc,
 
1858
                                        node,
 
1859
                                        NULL,
 
1860
                                        "spacing",
 
1861
                                        "normal",
 
1862
                                        "compact");
 
1863
                cong_bind_check_button (GTK_CHECK_BUTTON (glade_xml_get_widget(xml, "continuation")),
 
1864
                                        doc,
 
1865
                                        node,
 
1866
                                        NULL,
 
1867
                                        "continuation",
 
1868
                                        "restart",
 
1869
                                        "continues");
 
1870
                
 
1871
        }
 
1872
        
 
1873
        /* Add the advanced properties tab: */
 
1874
        notebook1 = glade_xml_get_widget(xml, "notebook1");
 
1875
        cong_ui_append_advanced_node_properties_page(GTK_NOTEBOOK(notebook1),
 
1876
                                                     doc, 
 
1877
                                                     node);
 
1878
        
 
1879
        return glade_xml_get_widget(xml, "common_dialog");
 
1880
}
 
1881
 
1618
1882
/**
1619
1883
 * docbook_ulink_properties_factory_method:
1620
1884
 * @custom_property_dialog:
1873
2137
                                          NULL);
1874
2138
#endif
1875
2139
 
 
2140
        /* Property pages: */
 
2141
#if 1
 
2142
        cong_plugin_register_custom_property_page (plugin,
 
2143
                                                    _("Scope"), 
 
2144
                                                    _("Provides a Scope properties page for most DocBook nodes"),
 
2145
                                                    "docbook-scope-property_page",
 
2146
                                                    docbook_node_page_factory_method_scope,
 
2147
                                                    NULL);
 
2148
        cong_plugin_register_custom_property_page (plugin,
 
2149
                                                    _("Language"), 
 
2150
                                                    _("Provides a Language properties page for most DocBook nodes"),
 
2151
                                                    "docbook-language-property_page",
 
2152
                                                    docbook_node_page_factory_method_language,
 
2153
                                                    NULL);
 
2154
        cong_plugin_register_custom_property_page (plugin,
 
2155
                                                    _("Revisions"), 
 
2156
                                                    _("Provides a Revisions properties page for most DocBook nodes"),
 
2157
                                                    "docbook-revisions-property_page",
 
2158
                                                    docbook_node_page_factory_method_revisions,
 
2159
                                                    NULL);
 
2160
        cong_plugin_register_custom_property_page_for_element (plugin,
 
2161
                                                               "List",
 
2162
                                                               "docbook-orderedlist-properties",
 
2163
                                                               docbook_orderedlist_page_factory_method,
 
2164
                                                               NULL);
 
2165
#endif
 
2166
        cong_plugin_register_custom_property_page_for_element (plugin,
 
2167
                                                               "Link",
 
2168
                                                               "docbook-ulink-properties",
 
2169
                                                               docbook_ulink_page_factory_method,
 
2170
                                                               NULL);
 
2171
        /* Property dialogs: */
1876
2172
        cong_plugin_register_custom_property_dialog(plugin,
1877
2173
                                                    _("Generic DocBook property dialog"), 
1878
2174
                                                    _("Provides a Properties dialog for most DocBook nodes"),
1879
2175
                                                    "docbook-generic-node-properties",
1880
 
                                                    docbook_generic_node_factory_method,
 
2176
                                                    docbook_generic_node_properties_factory_method,
1881
2177
                                                    NULL);
1882
2178
 
1883
2179
        cong_plugin_register_custom_property_dialog_for_element (plugin,