changeset 1087:1f3e4f17a41a

[mq]: replace-DW2TB-with-HT2TB
author Jeremy Henty <onepoint@starurchin.org>
date Sat, 09 May 2009 09:19:17 +0100
parents 23edfb792c5e
children 8c7cf8e29325
files src/form.cc src/html.cc src/html_common.hh src/table.cc
diffstat 4 files changed, 64 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/src/form.cc	Fri May 08 17:00:04 2009 -0400
+++ b/src/form.cc	Sat May 09 09:19:17 2009 +0100
@@ -298,7 +298,7 @@
    char *charset, *first;
    const char *attrbuf;
 
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 
    if (html->InFlags & IN_FORM) {
       BUG_MSG("nested forms\n");
@@ -547,7 +547,7 @@
 //          gtk_entry_set_max_length(GTK_ENTRY(widget),
 //                                   strtol(attrbuf, NULL, 10));
       }
-      DW2TB(html->dw)->addWidget (embed, html->styleEngine->backgroundStyle());
+      HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle());
    }
    dFree(type);
    dFree(name);
@@ -580,17 +580,17 @@
                  html->charset);
    html->InFlags |= IN_FORM;
 
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "prompt")))
-      DW2TB(html->dw)->addText(attrbuf, html->styleEngine->wordStyle ());
+      HT2TB(html)->addText(attrbuf, html->styleEngine->wordStyle ());
 
    ResourceFactory *factory = HT2LT(html)->getResourceFactory();
    EntryResource *entryResource = factory->createEntryResource (20,false,NULL);
    embed = new Embed (entryResource);
    Html_add_input(html, DILLO_HTML_INPUT_INDEX, embed, NULL, NULL, FALSE);
 
-   DW2TB(html->dw)->addWidget (embed, html->styleEngine->backgroundStyle ());
+   HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
 
    a_Url_free(action);
    html->InFlags &= ~IN_FORM;
@@ -658,7 +658,7 @@
       textres->setEditable(false);
    Html_add_input(html, DILLO_HTML_INPUT_TEXTAREA, embed, name, NULL, false);
 
-   DW2TB(html->dw)->addWidget (embed, html->styleEngine->backgroundStyle ());
+   HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
    dFree(name);
 }
 
@@ -742,7 +742,7 @@
    }
    Embed *embed = new Embed(res);
 
-   DW2TB(html->dw)->addWidget (embed, html->styleEngine->backgroundStyle ());
+   HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
 
    Html_add_input(html, type, embed, name, NULL, false);
    a_Html_stash_init(html);
@@ -847,9 +847,9 @@
       embed = new Embed(resource);
 // a_Dw_button_set_sensitive (DW_BUTTON (button), FALSE);
 
-      DW2TB(html->dw)->addParbreak (5, html->styleEngine->wordStyle ());
-      DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
-      DW2TB(html->dw)->addParbreak (5, html->styleEngine->wordStyle ());
+      HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
+      HT2TB(html)->addWidget (embed, html->styleEngine->style ());
+      HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
 
       S_TOP(html)->textblock = html->dw = page;
       /* right button press for menus for button contents */
@@ -1908,7 +1908,7 @@
          ComplexButtonResource *complex_b_r =
             factory->createComplexButtonResource(IM2DW(Image), false);
          button = new Embed(complex_b_r);
-         DW2TB(html->dw)->addWidget (button, html->styleEngine->style ());
+         HT2TB(html)->addWidget (button, html->styleEngine->style ());
 //       gtk_widget_set_sensitive(widget, FALSE); /* Until end of FORM! */
 
          /* a right button press brings up the image menu */
--- a/src/html.cc	Fri May 08 17:00:04 2009 -0400
+++ b/src/html.cc	Sat May 09 09:19:17 2009 +0100
@@ -377,9 +377,9 @@
 {
    Textblock *textblock = new Textblock (prefs.limit_text_width);
 
-   DW2TB(html->dw)->addParbreak (space, html->styleEngine->wordStyle ());
-   DW2TB(html->dw)->addWidget (textblock, html->styleEngine->style ());
-   DW2TB(html->dw)->addParbreak (space, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (space, html->styleEngine->wordStyle ());
+   HT2TB(html)->addWidget (textblock, html->styleEngine->style ());
+   HT2TB(html)->addParbreak (space, html->styleEngine->wordStyle ());
    S_TOP(html)->textblock = html->dw = textblock;
    S_TOP(html)->hand_over_break = true;
 
@@ -1068,11 +1068,11 @@
 
             if (spaceCnt) {
                spc = dStrnfill(spaceCnt, ' ');
-               DW2TB(html->dw)->addText (spc, html->styleEngine->wordStyle ());
+               HT2TB(html)->addText (spc, html->styleEngine->wordStyle ());
                dFree(spc);
                spaceCnt = 0;
             }
-            DW2TB(html->dw)->addLinebreak (html->styleEngine->wordStyle ());
+            HT2TB(html)->addLinebreak (html->styleEngine->wordStyle ());
             html->pre_column = 0;
          }
          html->PreFirstChar = false;
@@ -1100,7 +1100,7 @@
 
       if (spaceCnt) {
          spc = dStrnfill(spaceCnt, ' ');
-         DW2TB(html->dw)->addText (spc, html->styleEngine->wordStyle ());
+         HT2TB(html)->addText (spc, html->styleEngine->wordStyle ());
          dFree(spc);
       }
 
@@ -1108,7 +1108,7 @@
       if (SGML_SPCDEL) {
          /* SGML_SPCDEL ignores white space immediately after an open tag */
       } else if (!html->PrevWasSPC) {
-         DW2TB(html->dw)->addSpace(html->styleEngine->wordStyle ());
+         HT2TB(html)->addSpace(html->styleEngine->wordStyle ());
          html->PrevWasSPC = true;
       }
 
@@ -1161,7 +1161,7 @@
             while (Pword[++i] && !isspace(Pword[i])) ;
             ch = Pword[i];
             Pword[i] = 0;
-            DW2TB(html->dw)->addText(Pword + start,
+            HT2TB(html)->addText(Pword + start,
                                      html->styleEngine->wordStyle ());
             Pword[i] = ch;
             html->pre_column += i - start;
@@ -1172,7 +1172,7 @@
    } else {
       if (!memchr(word,'&', size)) {
          /* No entities */
-         DW2TB(html->dw)->addText(word, html->styleEngine->wordStyle ());
+         HT2TB(html)->addText(word, html->styleEngine->wordStyle ());
       } else {
          /* Collapse white-space entities inside the word (except &nbsp;) */
          Pword = a_Html_parse_entities(html, word, size);
@@ -1185,7 +1185,7 @@
                   for (--i; strchr("\t\f\n\r", Pword[j+1]); ++j) ;
             }
          }
-         DW2TB(html->dw)->addText(Pword, html->styleEngine->wordStyle ());
+         HT2TB(html)->addText(Pword, html->styleEngine->wordStyle ());
          dFree(Pword);
       }
    }
@@ -1221,8 +1221,8 @@
 {
    if (html->dw != S_TOP(html)->textblock) {
       if (hand_over_break)
-         DW2TB(html->dw)->handOverBreak (html->styleEngine->style ());
-      DW2TB(html->dw)->flush ();
+         HT2TB(html)->handOverBreak (html->styleEngine->style ());
+      HT2TB(html)->flush ();
       html->dw = S_TOP(html)->textblock;
    }
 }
@@ -1697,7 +1697,7 @@
       BUG_MSG("unclosed HEAD element\n");
    }
 
-   textblock = DW2TB(html->dw);
+   textblock = HT2TB(html);
 
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
       color = a_Html_color_parse(html, attrbuf, -1);
@@ -1777,7 +1777,7 @@
       /* ignore first parbreak after an empty <LI> */
       html->WordAfterLI = true;
    } else {
-      DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+      HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
    }
 }
 
@@ -1795,7 +1795,7 @@
    Widget *bullet;
    CssPropertyList props;
 
-   textblock = DW2TB(html->dw);
+   textblock = HT2TB(html);
 
    if (!(attrbuf = a_Html_get_attr(html, tag, tagsize, "src")))
       return;
@@ -1850,8 +1850,8 @@
 static void Html_tag_open_frameset (DilloHtml *html,
                                     const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
-   DW2TB(html->dw)->addText("--FRAME--", html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addText("--FRAME--", html->styleEngine->wordStyle ());
    Html_add_textblock(html, 5);
 }
 
@@ -1867,7 +1867,7 @@
    a_Html_tag_set_align_attr (html, &props, tag, tagsize);
    html->styleEngine->setNonCssHints (&props);
 
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 
    a_Html_stash_init(html);
    S_TOP(html)->parse_mode =
@@ -1879,7 +1879,7 @@
  */
 static void Html_tag_close_h(DilloHtml *html, int TagIdx)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -1887,7 +1887,7 @@
  */
 static void Html_tag_open_br(DilloHtml *html, const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addLinebreak (html->styleEngine->wordStyle ());
+   HT2TB(html)->addLinebreak (html->styleEngine->wordStyle ());
 }
 
 /*
@@ -1937,7 +1937,7 @@
  */
 static void Html_tag_open_center(DilloHtml *html, const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (0, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (0, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -1946,7 +1946,7 @@
 static void Html_tag_open_address(DilloHtml *html,
                                   const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -2065,8 +2065,8 @@
 
    /* Add a new image widget to this page */
    Image = a_Image_new(alt_ptr, 0);
-   if (DW2TB(html->dw)->getBgColor())
-      Image->bg_color = DW2TB(html->dw)->getBgColor()->getColor();
+   if (HT2TB(html)->getBgColor())
+      Image->bg_color = HT2TB(html)->getBgColor()->getColor();
 
    load_now = prefs.load_images ||
               (a_Capi_get_flags_with_redirection(url) & CAPI_IsCached);
@@ -2120,7 +2120,7 @@
        !(url = a_Html_url_new(html, attrbuf, NULL, 0)))
       return;
 
-   textblock = DW2TB(html->dw);
+   textblock = HT2TB(html);
 
    usemap_url = NULL;
    if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "usemap")))
@@ -2128,7 +2128,7 @@
       usemap_url = a_Html_url_new(html, attrbuf, NULL, 0);
 
    Image = a_Html_image_new(html, tag, tagsize, url);
-   DW2TB(html->dw)->addWidget((Widget*)Image->dw, html->styleEngine->style());
+   HT2TB(html)->addWidget((Widget*)Image->dw, html->styleEngine->style());
 
    /* Image maps */
    if (a_Html_get_attr(html, tag, tagsize, "ismap")) {
@@ -2324,7 +2324,7 @@
                 Html_set_new_link(html, &url));
       html->styleEngine->setNonCssHints (&props);
 
-      DW2TB(html->dw)->addText("[OBJECT]", html->styleEngine->wordStyle ());
+      HT2TB(html)->addText("[OBJECT]", html->styleEngine->wordStyle ());
    }
    a_Url_free(base_url);
 }
@@ -2358,7 +2358,7 @@
 static void Html_add_anchor(DilloHtml *html, const char *name)
 {
    _MSG("Registering ANCHOR: %s\n", name);
-   if (!DW2TB(html->dw)->addAnchor (name, html->styleEngine->style ()))
+   if (!HT2TB(html)->addAnchor (name, html->styleEngine->style ()))
       BUG_MSG("Anchor names must be unique within the document\n");
    /*
     * According to Sec. 12.2.1 of the HTML 4.01 spec, "anchor names that
@@ -2448,7 +2448,7 @@
 static void Html_tag_open_blockquote(DilloHtml *html,
                                      const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
    Html_add_textblock(html, 9);
 }
 
@@ -2463,7 +2463,7 @@
      */
     const char *U201C = "\xe2\x80\x9c";
 
-    DW2TB(html->dw)->addText (U201C, html->styleEngine->wordStyle ());
+    HT2TB(html)->addText (U201C, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -2474,7 +2474,7 @@
    /* Right Double Quotation Mark */
    const char *U201D = "\xe2\x80\x9d";
 
-   DW2TB(html->dw)->addText (U201D, html->styleEngine->wordStyle ());
+   HT2TB(html)->addText (U201D, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -2503,7 +2503,7 @@
       html->styleEngine->setNonCssHints (&props);
    }
 
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
    Html_add_textblock(html, 9);
 
    S_TOP(html)->list_type = HTML_LIST_UNORDERED;
@@ -2517,7 +2517,7 @@
  */
 static void Html_tag_open_dir(DilloHtml *html, const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 
    S_TOP(html)->list_type = HTML_LIST_UNORDERED;
    S_TOP(html)->list_number = 0;
@@ -2562,7 +2562,7 @@
       html->styleEngine->setNonCssHints (&props);
    }
 
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
    Html_add_textblock(html, 9);
 
    S_TOP(html)->list_type = HTML_LIST_ORDERED;
@@ -2599,11 +2599,11 @@
    list_number = &html->stack->getRef(html->stack->size()-2)->list_number;
    ref_list_item = &html->stack->getRef(html->stack->size()-2)->ref_list_item;
 
-   DW2TB(html->dw)->addParbreak (0, wordStyle);
+   HT2TB(html)->addParbreak (0, wordStyle);
 
    list_item = new ListItem ((ListItem*)*ref_list_item,prefs.limit_text_width);
-   DW2TB(html->dw)->addWidget (list_item, style);
-   DW2TB(html->dw)->addParbreak (0, wordStyle);
+   HT2TB(html)->addWidget (list_item, style);
+   HT2TB(html)->addParbreak (0, wordStyle);
    *ref_list_item = list_item;
    S_TOP(html)->textblock = html->dw = list_item;
    /* Handle it when the user clicks on a link */
@@ -2688,12 +2688,12 @@
 
    html->styleEngine->setNonCssHints (&props);
 
-   DW2TB(html->dw)->addParbreak (5, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
 
    hruler = new Ruler();
    hruler->setStyle (html->styleEngine->style ());
-   DW2TB(html->dw)->addWidget (hruler, html->styleEngine->style ());
-   DW2TB(html->dw)->addParbreak (5, html->styleEngine->wordStyle ());
+   HT2TB(html)->addWidget (hruler, html->styleEngine->style ());
+   HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -2702,7 +2702,7 @@
 static void Html_tag_open_dl(DilloHtml *html, const char *tag, int tagsize)
 {
    /* may want to actually do some stuff here. */
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -2710,7 +2710,7 @@
  */
 static void Html_tag_open_dt(DilloHtml *html, const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -2718,7 +2718,7 @@
  */
 static void Html_tag_open_dd(DilloHtml *html, const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
    Html_add_textblock(html, 9);
 }
 
@@ -2727,7 +2727,7 @@
  */
 static void Html_tag_open_pre(DilloHtml *html, const char *tag, int tagsize)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 
    html->InFlags |= IN_PRE;
 }
@@ -2738,7 +2738,7 @@
 static void Html_tag_close_pre(DilloHtml *html, int TagIdx)
 {
    html->InFlags &= ~IN_PRE;
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -3017,7 +3017,7 @@
  */
 static void Html_tag_close_div(DilloHtml *html, int TagIdx)
 {
-   DW2TB(html->dw)->addParbreak (0, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (0, html->styleEngine->wordStyle ());
 }
 
 /*
@@ -3032,7 +3032,7 @@
  */
 static void Html_tag_close_par(DilloHtml *html, int TagIdx)
 {
-   DW2TB(html->dw)->addParbreak (9, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
 }
 
 
@@ -3658,7 +3658,7 @@
    Textblock *textblock;
    int token_start, buf_index;
 
-   dReturn_val_if_fail ((textblock = DW2TB(html->dw)) != NULL, 0);
+   dReturn_val_if_fail ((textblock = HT2TB(html)) != NULL, 0);
 
    /* Now, 'buf' and 'bufsize' define a buffer aligned to start at a token
     * boundary. Iterate through tokens until end of buffer is reached. */
--- a/src/html_common.hh	Fri May 08 17:00:04 2009 -0400
+++ b/src/html_common.hh	Sat May 09 09:19:17 2009 +0100
@@ -19,8 +19,8 @@
  * Macros
  */
 
-// Dw to Textblock
-#define DW2TB(dw)  ((Textblock*)dw)
+// "html struct" to Textblock
+#define HT2TB(html)  ((Textblock*)(html->dw))
 // "html struct" to "Layout"
 #define HT2LT(html)  ((Layout*)html->bw->render_layout)
 // "Image" to "Dw Widget"
--- a/src/table.cc	Fri May 08 17:00:04 2009 -0400
+++ b/src/table.cc	Sat May 09 09:19:17 2009 +0100
@@ -96,7 +96,7 @@
 
    html->styleEngine->setNonCssHints (&props);
 
-   DW2TB(html->dw)->addParbreak (0, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (0, html->styleEngine->wordStyle ());
 
    /* The style for the cells */
    table_cell_props = new CssPropertyList ();
@@ -131,7 +131,7 @@
    S_TOP(html)->table_cell_props->ref ();
 
    table = new dw::Table(prefs.limit_text_width);
-   DW2TB(html->dw)->addWidget (table, html->styleEngine->style ());
+   HT2TB(html)->addWidget (table, html->styleEngine->style ());
 
    S_TOP(html)->table_mode = DILLO_HTML_TABLE_MODE_TOP;
    S_TOP(html)->cell_text_align_set = FALSE;
@@ -197,7 +197,7 @@
 
    S_TOP(html)->table_mode = DILLO_HTML_TABLE_MODE_TR;
 #else
-   DW2TB(html->dw)->addParbreak (0, html->styleEngine->wordStyle ());
+   HT2TB(html)->addParbreak (0, html->styleEngine->wordStyle ());
 #endif
 }