OSDN Git Service

* Added <marquee> tag for au XHTML converter.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Mon, 14 Apr 2008 12:27:04 +0000 (12:27 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Mon, 14 Apr 2008 12:27:04 +0000 (12:27 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_11_0@2266 1a406e8e-add9-4483-a2c8-d8cac5b7c224

src/chxj_chtml30.c
src/chxj_xhtml_mobile_1_0.c

index 7115e42..7a8bcef 100644 (file)
@@ -1889,7 +1889,6 @@ s_chtml30_start_select_tag(void* pdoc, Node* child)
        attr = qs_get_next_attr(doc,attr)) {
     char* nm  = qs_get_attr_name(doc,attr);
     char* val = qs_get_attr_value(doc,attr);
-
     if (STRCASEEQ('s','S',"size", nm)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0 version 2.0                                                */
@@ -3108,7 +3107,7 @@ s_chtml30_end_dl_tag(void *pdoc, Node *UNUSED(child))
 
 
 /**
- * It is a handter who processes the DT tag.
+ * It is a handler who processes the DT tag.
  *
  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
  *                     destination is specified.
@@ -3128,7 +3127,7 @@ s_chtml30_start_dt_tag(void *pdoc, Node *UNUSED(child))
 
 
 /**
- * It is a handter who processes the DT tag.
+ * It is a handler who processes the DT tag.
  *
  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
  *                     destination is specified.
@@ -3145,7 +3144,7 @@ s_chtml30_end_dt_tag(void *pdoc, Node *UNUSED(child))
 
 
 /**
- * It is a handder who processes the DD tag.
+ * It is a handler who processes the DD tag.
  *
  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
  *                     destination is specified.
@@ -3163,7 +3162,7 @@ s_chtml30_start_dd_tag(void *pdoc, Node *UNUSED(child))
 
 
 /**
- * It is a handder who processes the DD tag.
+ * It is a handler who processes the DD tag.
  *
  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
  *                     destination is specified.
@@ -3179,7 +3178,7 @@ s_chtml30_end_dd_tag(void *pdoc, Node *UNUSED(child))
 
 
 /**
- * It is a hanmarqueeer who processes the MARQUEE tag.
+ * It is a handler who processes the MARQUEE tag.
  *
  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
  *                     destination is specified.
@@ -3229,7 +3228,7 @@ s_chtml30_start_marquee_tag(void *pdoc, Node *node)
 
 
 /**
- * It is a hanmarqueeer who processes the MARQUEE tag.
+ * It is a handler who processes the MARQUEE tag.
  *
  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
  *                     destination is specified.
index e281d8f..bfc170b 100644 (file)
@@ -111,6 +111,8 @@ static char *s_xhtml_1_0_start_plaintext_tag_inner (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_plaintext_tag         (void *pdoc, Node *node);
 static char *s_xhtml_1_0_start_blink_tag     (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_blink_tag       (void *pdoc, Node *node);
+static char *s_xhtml_1_0_start_marquee_tag   (void *pdoc, Node *node);
+static char *s_xhtml_1_0_end_marquee_tag     (void *pdoc, Node *node);
 
 static void  s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
 static int   s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
@@ -380,8 +382,8 @@ tag_handler xhtml_handler[] = {
   },
   /* tagMARQUEE */
   {
-    NULL,
-    NULL,
+    s_xhtml_1_0_start_marquee_tag,
+    s_xhtml_1_0_end_marquee_tag,
   },
 };
  
@@ -3038,6 +3040,74 @@ s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
   W_L("</blink>");
   return xhtml->out;
 }
+
+
+/**
+ * It is a handler who processes the MARQUEE tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The MARQUEE tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
+{
+  xhtml_t *xhtml = GET_XHTML(pdoc);
+  Doc     *doc = xhtml->doc;
+  Attr *attr;
+  W_L("<marquee");
+  /*--------------------------------------------------------------------------*/
+  /* Get Attributes                                                           */
+  /*--------------------------------------------------------------------------*/
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char *name   = qs_get_attr_name(doc,attr);
+    char *value  = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('d','D',"direction", name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
+        W_L(" direction=\"");
+        W_V(value);
+        W_L("\"");
+      }
+    }
+    else if (STRCASEEQ('b','B',"behavior",name)) {
+      if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
+        W_L(" behavior=\""); 
+        W_V(value);
+        W_L("\"");
+      }
+    }
+    else if (STRCASEEQ('l','L',"loop",name)) {
+      if (value && *value) {
+        W_L(" loop=\"");
+        W_V(value);
+        W_L("\"");
+      }
+    }
+  }
+  W_L(">");
+  return xhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the MARQUEE tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The MARQUEE tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
+{
+  xhtml_t *xhtml = GET_XHTML(pdoc);
+  Doc     *doc = xhtml->doc;
+  W_L("</marquee>");
+  return xhtml->out;
+}
 /*
  * vim:ts=2 et
  */