[cairo-commit] cairo-demo/cairo_snippets cairo_snippets_html.c, 1.2, 1.3

OEyvind Kolaas commit at pdx.freedesktop.org
Thu May 20 08:06:40 PDT 2004


Committed by: pippin

Update of /cvs/cairo/cairo-demo/cairo_snippets
In directory pdx:/tmp/cvs-serv27857

Modified Files:
	cairo_snippets_html.c 
Log Message:
further changes for single page/snippet for web


Index: cairo_snippets_html.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/cairo_snippets_html.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/cairo_snippets_html.c	20 May 2004 14:33:23 -0000	1.2
--- b/cairo_snippets_html.c	20 May 2004 15:06:38 -0000	1.3
***************
*** 29,32 ****
--- 29,54 ----
  }
  
+ static void
+ index(FILE *file, int active)
+ {
+     int i;
+     fprintf (file, "<p>\n");
+ 
+     if (active==-1)
+        fprintf (file, "all&nbsp;&lt;---<br />\n");
+     else
+        fprintf (file, "<a href='snippets.html'>all</a><br />\n");
+ 
+     for (i=0;i<snippet_count;i++) {
+         if (i==active)
+            fprintf (file, "%s&nbsp;&lt;---<br />\n", snippet_name[i]);
+         else
+            fprintf (file, "<a href='%s.html'>%s</a><br />\n",
+                         snippet_name[i], snippet_name[i]);
+     }
+ 
+     fprintf (file, "</p>\n");
+ }
+ 
  void
  write_index(void)
***************
*** 36,54 ****
  
      embed_file (file, "header.html_template");
!     fprintf (file, "<ul>\n");
! 
!         fprintf (file, "<li><a href='snippets.html'>all</a></li>\n");
!     for (i=0;i<snippet_count;i++)
!         fprintf (file, "<li><a href='%s.html'>%s</a></li>\n",
!                         snippet_name[i], snippet_name[i]);
! 
!     fprintf (file, "</ul>\n");
! 
      embed_file (file, "footer.html_template");
      fclose (file);
  }
  
- 
- 
  void
  write_all(void)
--- 58,66 ----
  
      embed_file (file, "header.html_template");
!     index (file, -2);
      embed_file (file, "footer.html_template");
      fclose (file);
  }
  
  void
  write_all(void)
***************
*** 58,68 ****
  
      embed_file (file, "header.html_template");
!     fprintf (file, "<ul>\n");
! 
!     for (i=0;i<snippet_count;i++)
!         fprintf (file, "<li><a href='#%s'>%s</a></li>\n",
!                         snippet_name[i], snippet_name[i]);
! 
!     fprintf (file, "</ul>\n");
      fprintf (file, "<table>\n");
  
--- 70,74 ----
  
      embed_file (file, "header.html_template");
!     index (file, -1);
      fprintf (file, "<table>\n");
  
***************
*** 122,137 ****
  
      embed_file (file, "header.html_template");
-     fprintf (file, "<p><a href='index.html'>index</a>");
  
!     if (snippet_no>0)
!         fprintf (file, "&nbsp;<a href='%s.html'>prev(%s)</a>", snippet_name[snippet_no-1], snippet_name[snippet_no-1]);
!     else
!         fprintf (file, "");
  
!     if (snippet_no<snippet_count-1)
!         fprintf (file, "&nbsp;<a href='%s.html'>next(%s)</a>", snippet_name[snippet_no+1], snippet_name[snippet_no+1]);
!     else
!         fprintf (file, "");
!     fprintf (file, "</p>\n");
  
      fprintf (file, "<table>\n");
--- 128,136 ----
  
      embed_file (file, "header.html_template");
  
!     fprintf (file, "<table><tr><td rowspacing='3' valign='top'>\n"); 
!     index (file, snippet_no);
  
!     fprintf (file, "</td><td valign='top'><p>");
  
      fprintf (file, "<table>\n");
***************
*** 174,178 ****
              fprintf (file, "    <tr><td>&nbsp;</td></tr>\n");
      }
!     fprintf (file, "</table>");
      embed_file (file, "footer.html_template");
      fclose (file);
--- 173,177 ----
              fprintf (file, "    <tr><td>&nbsp;</td></tr>\n");
      }
!     fprintf (file, "</table></td></table>");
      embed_file (file, "footer.html_template");
      fclose (file);





More information about the cairo-commit mailing list