~ubuntu-branches/ubuntu/lucid/gtkhtml3.14/lucid

« back to all changes in this revision

Viewing changes to gtkhtml/htmlengine.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-06-02 11:18:16 UTC
  • mfrom: (1.2.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20090602111816-t7rv5r7z58i0lkb4
Tags: 1:3.27.2-0ubuntu1
* New upstream version
* debian/rules:
  - updated library version

Show diffs side-by-side

added added

removed removed

Lines of Context:
413
413
}
414
414
 
415
415
static void
416
 
push_element (HTMLEngine *e, char *name, char *class, HTMLStyle *style)
 
416
push_element (HTMLEngine *e, const char *name, const char *class, HTMLStyle *style)
417
417
{
418
418
        HTMLElement *element;
419
419
 
726
726
static void new_flow (HTMLEngine *e, HTMLObject *clue, HTMLObject *first_object, HTMLClearType clear, HTMLDirection dir);
727
727
static void close_flow (HTMLEngine *e, HTMLObject *clue);
728
728
static void finish_flow (HTMLEngine *e, HTMLObject *clue);
729
 
static void pop_element (HTMLEngine *e, char *name);
 
729
static void pop_element (HTMLEngine *e, const char *name);
730
730
 
731
731
static HTMLObject *
732
732
text_new (HTMLEngine *e, const gchar *text, GtkHTMLFontStyle style, HTMLColor *color)
1024
1024
 
1025
1025
static void
1026
1026
push_block_element (HTMLEngine *e,
1027
 
                    char *name,
 
1027
                    const char *name,
1028
1028
                    HTMLStyle *style,
1029
1029
                    HTMLDisplayType level,
1030
1030
                    BlockFunc exitFunc,
1048
1048
 
1049
1049
static void
1050
1050
push_block (HTMLEngine *e,
1051
 
            char *name,
 
1051
            const char *name,
1052
1052
            gint level,
1053
1053
            BlockFunc exitFunc,
1054
1054
            gint miscData1,
1165
1165
 
1166
1166
 
1167
1167
static void
1168
 
pop_element (HTMLEngine *e, char *name)
 
1168
pop_element (HTMLEngine *e, const char *name)
1169
1169
{
1170
1170
        HTMLElement *elem = NULL;
1171
1171
        GList *l;
2263
2263
 
2264
2264
 
2265
2265
static void
2266
 
form_begin (HTMLEngine *e, HTMLObject *clue, gchar *action, gchar *method, gboolean close_paragraph)
 
2266
form_begin (HTMLEngine *e,
 
2267
            HTMLObject *clue,
 
2268
            const gchar *action,
 
2269
            const gchar *method,
 
2270
            gboolean close_paragraph)
2267
2271
{
2268
2272
        g_return_if_fail (HTML_IS_ENGINE (e));
2269
2273
 
2426
2430
element_parse_form (HTMLEngine *e, HTMLObject *clue, const gchar *str)
2427
2431
{
2428
2432
        gchar *action = NULL;
2429
 
        gchar *method = "GET";
 
2433
        const gchar *method = "GET";
2430
2434
        gchar *target = NULL;
2431
2435
 
2432
2436
        g_return_if_fail (HTML_IS_ENGINE (e));
3848
3852
/* Parsing dispatch table.  */
3849
3853
typedef void (*HTMLParseFunc)(HTMLEngine *p, HTMLObject *clue, const gchar *str);
3850
3854
typedef struct _HTMLDispatchEntry {
3851
 
        char *name;
 
3855
        const char *name;
3852
3856
        HTMLParseFunc func;
3853
3857
} HTMLDispatchEntry;
3854
3858
 
3942
3946
        gint i = 0;
3943
3947
 
3944
3948
        while (entry[i].name) {
3945
 
                g_hash_table_insert (table, entry[i].name, &entry[i]);
 
3949
                g_hash_table_insert (
 
3950
                        table, (gpointer) entry[i].name, &entry[i]);
3946
3951
                i++;
3947
3952
        }
3948
3953
 
4640
4645
#define LOG_INPUT 1
4641
4646
 
4642
4647
GtkHTMLStream *
4643
 
html_engine_begin (HTMLEngine *e, char *content_type)
 
4648
html_engine_begin (HTMLEngine *e, const char *content_type)
4644
4649
{
4645
4650
        GtkHTMLStream *new_stream;
4646
4651
 
4702
4707
        html_object_forall (e->clue, e, html_engine_stop_forall, NULL);
4703
4708
}
4704
4709
 
4705
 
static char *engine_content_types[]= {"text/html", NULL};
 
4710
static char *engine_content_types[]= { (char *) "text/html", NULL};
4706
4711
 
4707
4712
static char **
4708
4713
html_engine_stream_types (GtkHTMLStream *handle,
6211
6216
void
6212
6217
html_engine_replace_spell_word_with (HTMLEngine *e, const gchar *word)
6213
6218
{
6214
 
        HTMLObject *replace = NULL;
 
6219
        HTMLObject *replace_text = NULL;
6215
6220
        HTMLText   *orig;
6216
6221
        g_return_if_fail (HTML_IS_ENGINE (e));
6217
6222
 
6220
6225
        orig = HTML_TEXT (e->mark->object);
6221
6226
        switch (HTML_OBJECT_TYPE (e->mark->object)) {
6222
6227
        case HTML_TYPE_TEXT:
6223
 
                replace = text_new (e, word, orig->font_style, orig->color);
 
6228
                replace_text = text_new (e, word, orig->font_style, orig->color);
6224
6229
                break;
6225
6230
                /* FIXME-link case HTML_TYPE_LINKTEXT:
6226
 
                replace = html_link_text_new (word, orig->font_style, orig->color,
6227
 
                                              HTML_LINK_TEXT (orig)->url,
6228
 
                                              HTML_LINK_TEXT (orig)->target);
6229
 
                                              break; */
 
6231
                replace_text = html_link_text_new (
 
6232
                        word, orig->font_style, orig->color,
 
6233
                        HTML_LINK_TEXT (orig)->url,
 
6234
                        HTML_LINK_TEXT (orig)->target);
 
6235
                break; */
6230
6236
        default:
6231
6237
                g_assert_not_reached ();
6232
6238
        }
6233
6239
        html_text_set_font_face (HTML_TEXT (replace), HTML_TEXT (orig)->face);
6234
6240
        html_engine_edit_selection_updater_update_now (e->selection_updater);
6235
 
        html_engine_paste_object (e, replace, html_object_get_length (replace));
 
6241
        html_engine_paste_object (e, replace_text, html_object_get_length (replace_text));
6236
6242
}
6237
6243
 
6238
6244
HTMLCursor *
6503
6509
const gchar *
6504
6510
html_engine_get_language (HTMLEngine *e)
6505
6511
{
6506
 
        gchar *language;
 
6512
        const gchar *language;
6507
6513
 
6508
6514
        g_return_val_if_fail (HTML_IS_ENGINE (e), NULL);
6509
6515