codex 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. data/History.txt +8 -0
  2. data/LICENSE.txt +29 -0
  3. data/Manifest.txt +95 -0
  4. data/PostInstall.txt +5 -0
  5. data/README.txt +31 -0
  6. data/Rakefile +4 -0
  7. data/app_generators/codex/USAGE +5 -0
  8. data/app_generators/codex/codex_generator.rb +106 -0
  9. data/app_generators/codex/templates/Rakefile +54 -0
  10. data/app_generators/codex/templates/bin/build_all.rb +47 -0
  11. data/app_generators/codex/templates/bin/postprocess_all.rb +5 -0
  12. data/app_generators/codex/templates/bin/pressie.rb +7 -0
  13. data/app_generators/codex/templates/code/control/basic_continuation.rb +11 -0
  14. data/app_generators/codex/templates/code/control/cc_throw_catch.rb +59 -0
  15. data/app_generators/codex/templates/code/control/closure_continuation.rb +8 -0
  16. data/app_generators/codex/templates/code/control/closure_continuation_2.rb +12 -0
  17. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSS.html +115 -0
  18. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSharp.html +134 -0
  19. data/app_generators/codex/templates/dp.SyntaxHighlighter/CollapseCode.html +90 -0
  20. data/app_generators/codex/templates/dp.SyntaxHighlighter/Cpp.html +190 -0
  21. data/app_generators/codex/templates/dp.SyntaxHighlighter/CrashTest.html +108 -0
  22. data/app_generators/codex/templates/dp.SyntaxHighlighter/Delphi.html +112 -0
  23. data/app_generators/codex/templates/dp.SyntaxHighlighter/FirstLine.html +90 -0
  24. data/app_generators/codex/templates/dp.SyntaxHighlighter/Index.html +80 -0
  25. data/app_generators/codex/templates/dp.SyntaxHighlighter/Java.html +122 -0
  26. data/app_generators/codex/templates/dp.SyntaxHighlighter/JavaScript.html +112 -0
  27. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoControls.html +89 -0
  28. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoGutter.html +89 -0
  29. data/app_generators/codex/templates/dp.SyntaxHighlighter/PHP.html +102 -0
  30. data/app_generators/codex/templates/dp.SyntaxHighlighter/Python.html +121 -0
  31. data/app_generators/codex/templates/dp.SyntaxHighlighter/Ruby.html +131 -0
  32. data/app_generators/codex/templates/dp.SyntaxHighlighter/SQL.html +98 -0
  33. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/clipboard.swf +0 -0
  34. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCSharp.js +32 -0
  35. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCpp.js +73 -0
  36. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCss.js +52 -0
  37. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushDelphi.js +34 -0
  38. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJScript.js +22 -0
  39. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJava.js +28 -0
  40. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPhp.js +60 -0
  41. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPython.js +30 -0
  42. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushRuby.js +28 -0
  43. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushSql.js +42 -0
  44. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushVb.js +29 -0
  45. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushXml.js +70 -0
  46. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.js +414 -0
  47. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.uncompressed.js +674 -0
  48. data/app_generators/codex/templates/dp.SyntaxHighlighter/ShowColumns.html +89 -0
  49. data/app_generators/codex/templates/dp.SyntaxHighlighter/SmartTabs.html +88 -0
  50. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css +158 -0
  51. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/TestPages.css +63 -0
  52. data/app_generators/codex/templates/dp.SyntaxHighlighter/Templates/Test.dwt +80 -0
  53. data/app_generators/codex/templates/dp.SyntaxHighlighter/VB.html +115 -0
  54. data/app_generators/codex/templates/dp.SyntaxHighlighter/XML.html +136 -0
  55. data/app_generators/codex/templates/html/all.html +0 -0
  56. data/app_generators/codex/templates/readme.txt +4 -0
  57. data/app_generators/codex/templates/slides/basics.slides +37 -0
  58. data/app_generators/codex/templates/slides/building.slides +27 -0
  59. data/app_generators/codex/templates/slides/example.slides +80 -0
  60. data/app_generators/codex/templates/slides/including_code.slides +80 -0
  61. data/app_generators/codex/templates/slides/metadata.yml +4 -0
  62. data/app_generators/codex/templates/slides/table_of_contents.slides +14 -0
  63. data/app_generators/codex/templates/ui/default/blank.gif +0 -0
  64. data/app_generators/codex/templates/ui/default/bodybg.gif +0 -0
  65. data/app_generators/codex/templates/ui/default/framing.css +23 -0
  66. data/app_generators/codex/templates/ui/default/iepngfix.htc +42 -0
  67. data/app_generators/codex/templates/ui/default/opera.css +7 -0
  68. data/app_generators/codex/templates/ui/default/outline.css +15 -0
  69. data/app_generators/codex/templates/ui/default/pretty.css +86 -0
  70. data/app_generators/codex/templates/ui/default/print.css +1 -0
  71. data/app_generators/codex/templates/ui/default/s5-core.css +9 -0
  72. data/app_generators/codex/templates/ui/default/slides.css +3 -0
  73. data/app_generators/codex/templates/ui/default/slides.js +553 -0
  74. data/bin/codex +17 -0
  75. data/codex.gemspec +30 -0
  76. data/config/hoe.rb +75 -0
  77. data/config/requirements.rb +15 -0
  78. data/lib/codex.rb +7 -0
  79. data/lib/codex/content.rb +160 -0
  80. data/lib/codex/pressie.rb +108 -0
  81. data/lib/codex/version.rb +9 -0
  82. data/lib/stylesheets/pressie.css +196 -0
  83. data/lib/stylesheets/print.css +149 -0
  84. data/lib/stylesheets/ruby.png +0 -0
  85. data/script/console +10 -0
  86. data/script/destroy +14 -0
  87. data/script/generate +14 -0
  88. data/setup.rb +1585 -0
  89. data/tasks/deployment.rake +34 -0
  90. data/tasks/environment.rake +7 -0
  91. data/tasks/website.rake +9 -0
  92. data/test/test_codex.rb +11 -0
  93. data/test/test_codex_generator.rb +78 -0
  94. data/test/test_generator_helper.rb +29 -0
  95. data/test/test_helper.rb +2 -0
  96. metadata +163 -0
@@ -0,0 +1,8 @@
1
+ def create_continuation(arg)
2
+ callcc { |continuation| return continuation }
3
+ puts "Back in method: arg = #{arg}"
4
+ exit
5
+ end
6
+
7
+ cont_one = create_continuation(123)
8
+ cont_one.call #=> Back in method: arg = 123
@@ -0,0 +1,12 @@
1
+ def create_continuation(arg)
2
+ callcc { |continuation| return continuation }
3
+ puts "Back in method: arg = #{arg}"
4
+ end
5
+
6
+ cont_one = create_continuation(123)
7
+ cont_one.call
8
+
9
+ ### Results in:
10
+ #
11
+ # Back in method: arg = 123
12
+ # closure_continuation_2.rb:8: undefined method `call' for nil:NilClass
@@ -0,0 +1,115 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Test.dwt" codeOutsideHTMLIsLocked="false" -->
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
+ <title>dp.SyntaxHighlighter Tests</title>
6
+ <link type="text/css" rel="stylesheet" href="Styles/SyntaxHighlighter.css"></link>
7
+ <link href="Styles/TestPages.css" rel="stylesheet" type="text/css">
8
+ </head>
9
+
10
+ <body>
11
+
12
+ <h1>dp.SyntaxHighlighter 1.5.0 Tests and Samples</h1>
13
+ <p><a href="http://code.google.com/p/syntaxhighlighter/">http://code.google.com/p/syntaxhighlighter/</a></p>
14
+
15
+ <h2><!-- InstanceBeginEditable name="Title" -->CSS<!-- InstanceEndEditable --></h2>
16
+
17
+ <div class="layout">
18
+
19
+ <div class="column1">
20
+ <h3>Languages:</h3>
21
+ <ol>
22
+ <li><a href="CSharp.html">C#</a></li>
23
+ <li><a href="CSS.html">CSS</a></li>
24
+ <li><a href="Cpp.html">C++</a></li>
25
+ <li><a href="Delphi.html">Delphi</a></li>
26
+ <li><a href="Java.html">Java</a></li>
27
+ <li><a href="JavaScript.html">JavaScript</a></li>
28
+ <li><a href="PHP.html">PHP</a></li>
29
+ <li><a href="Python.html">Python</a></li>
30
+ <li><a href="Ruby.html">Ruby</a></li>
31
+ <li><a href="SQL.html">SQL</a></li>
32
+ <li><a href="VB.html">Visual Basic</a></li>
33
+ <li><a href="XML.html">XML / HTML</a></li>
34
+ </ol>
35
+ <h3>Features:</h3>
36
+ <ol>
37
+ <li><a href="SmartTabs.html">Smart tabs</a></li>
38
+ <li><a href="FirstLine.html">First line</a> </li>
39
+ <li><a href="CollapseCode.html">Expand code</a></li>
40
+ <li><a href="ShowColumns.html">Show columns</a></li>
41
+ <li><a href="NoGutter.html">No gutter</a></li>
42
+ <li><a href="NoControls.html">No controls</a></li>
43
+ </ol>
44
+ </div>
45
+
46
+ <div class="column2">
47
+ Text body before.
48
+ <hr/>
49
+ <!-- InstanceBeginEditable name="Code" -->
50
+ <pre name="code" class="css">
51
+ /* Main style for the table */
52
+
53
+ .dp-highlighter
54
+ {
55
+ font-family: "Courier New", Courier, mono;
56
+ font-size: 12px;
57
+ text-align: left;
58
+ border: 1px solid #2B91AF;
59
+ background-color: #fff;
60
+ width: 99%;
61
+ overflow: auto;
62
+ line-height: 100% !important;
63
+ margin: 18px 0px 18px 0px;
64
+ }
65
+
66
+ .dp-highlighter ol
67
+ {
68
+ margin: 0px 0px 0px 45px;
69
+ padding: 0px;
70
+ color: #2B91AF;
71
+ }
72
+
73
+ .dp-highlighter ol li
74
+ {
75
+ border-left: 3px solid #6CE26C;
76
+ border-bottom: 1px solid #eee;
77
+ background-color: #fff;
78
+ padding-left: 10px;
79
+ }
80
+
81
+ .dp-highlighter ol li.alt
82
+ {
83
+ background-color: #f8f8f8;
84
+ }
85
+ </pre>
86
+ <!-- InstanceEndEditable -->
87
+ <hr/>
88
+ Text body after.
89
+ </div>
90
+ </div>
91
+
92
+ <div class="footer">
93
+ Copyright 2004-2007 Alex Gorbatchev.<br/>
94
+ </div>
95
+
96
+ <script class="javascript" src="Scripts/shCore.js"></script>
97
+ <script class="javascript" src="Scripts/shBrushCSharp.js"></script>
98
+ <script class="javascript" src="Scripts/shBrushPhp.js"></script>
99
+ <script class="javascript" src="Scripts/shBrushJScript.js"></script>
100
+ <script class="javascript" src="Scripts/shBrushJava.js"></script>
101
+ <script class="javascript" src="Scripts/shBrushVb.js"></script>
102
+ <script class="javascript" src="Scripts/shBrushSql.js"></script>
103
+ <script class="javascript" src="Scripts/shBrushXml.js"></script>
104
+ <script class="javascript" src="Scripts/shBrushDelphi.js"></script>
105
+ <script class="javascript" src="Scripts/shBrushPython.js"></script>
106
+ <script class="javascript" src="Scripts/shBrushRuby.js"></script>
107
+ <script class="javascript" src="Scripts/shBrushCss.js"></script>
108
+ <script class="javascript" src="Scripts/shBrushCpp.js"></script>
109
+ <script class="javascript">
110
+ dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
111
+ dp.SyntaxHighlighter.HighlightAll('code');
112
+ </script>
113
+
114
+ </body>
115
+ <!-- InstanceEnd --></html>
@@ -0,0 +1,134 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Test.dwt" codeOutsideHTMLIsLocked="false" -->
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
+ <title>dp.SyntaxHighlighter Tests</title>
6
+ <link type="text/css" rel="stylesheet" href="Styles/SyntaxHighlighter.css"></link>
7
+ <link href="Styles/TestPages.css" rel="stylesheet" type="text/css">
8
+ </head>
9
+
10
+ <body>
11
+
12
+ <h1>dp.SyntaxHighlighter 1.5.0 Tests and Samples</h1>
13
+ <p><a href="http://code.google.com/p/syntaxhighlighter/">http://code.google.com/p/syntaxhighlighter/</a></p>
14
+
15
+ <h2><!-- InstanceBeginEditable name="Title" -->C#<!-- InstanceEndEditable --></h2>
16
+
17
+ <div class="layout">
18
+
19
+ <div class="column1">
20
+ <h3>Languages:</h3>
21
+ <ol>
22
+ <li><a href="CSharp.html">C#</a></li>
23
+ <li><a href="CSS.html">CSS</a></li>
24
+ <li><a href="Cpp.html">C++</a></li>
25
+ <li><a href="Delphi.html">Delphi</a></li>
26
+ <li><a href="Java.html">Java</a></li>
27
+ <li><a href="JavaScript.html">JavaScript</a></li>
28
+ <li><a href="PHP.html">PHP</a></li>
29
+ <li><a href="Python.html">Python</a></li>
30
+ <li><a href="Ruby.html">Ruby</a></li>
31
+ <li><a href="SQL.html">SQL</a></li>
32
+ <li><a href="VB.html">Visual Basic</a></li>
33
+ <li><a href="XML.html">XML / HTML</a></li>
34
+ </ol>
35
+ <h3>Features:</h3>
36
+ <ol>
37
+ <li><a href="SmartTabs.html">Smart tabs</a></li>
38
+ <li><a href="FirstLine.html">First line</a> </li>
39
+ <li><a href="CollapseCode.html">Expand code</a></li>
40
+ <li><a href="ShowColumns.html">Show columns</a></li>
41
+ <li><a href="NoGutter.html">No gutter</a></li>
42
+ <li><a href="NoControls.html">No controls</a></li>
43
+ </ol>
44
+ </div>
45
+
46
+ <div class="column2">
47
+ Text body before.
48
+ <hr/>
49
+ <!-- InstanceBeginEditable name="Code" -->
50
+ <pre name="code" class="c-sharp">
51
+ string url = "&lt;a href=\"" + someObj.getUrl() + "\" target=\"_blank\">";
52
+
53
+ // single line comments
54
+ // second single line
55
+ override protected void OnLoad(EventArgs e)
56
+ {
57
+ if(Attributes["class"] != null)
58
+ {
59
+ //_year.CssClass = _month.CssClass = _day.CssClass = Attributes["class"];
60
+ }
61
+ base.OnLoad(e);
62
+ }
63
+
64
+ /***********************************
65
+ ** Multiline block comments
66
+ **********************************/
67
+
68
+ /// &lt;summary>
69
+ /// Gets or sets currently selected date of birth or &lt;see cref="DateTime.MinValue"/> if selection is incomplete or invalid.
70
+ /// &lt;/summary>
71
+ public DateTime Date
72
+ {
73
+ String stringWithUrl = "http://blog.dreamprojections.com";
74
+
75
+ get
76
+ {
77
+ #region Hello world /* shouldn't be a comment */
78
+ try
79
+ {
80
+ /*
81
+ DateTime result = new DateTime(
82
+ int.Parse(_year.SelectedItem.Value),
83
+ // int.Parse(_month.SelectedItem.Value),
84
+ int.Parse(_day.SelectedItem.Value)
85
+ );
86
+
87
+ i *= 2;
88
+ */
89
+ return result;
90
+ }
91
+ catch
92
+ {
93
+ /* return _minDate; */
94
+ }
95
+ #endregion
96
+ }
97
+ set
98
+ {
99
+ Day = value.Day;
100
+ Month = value.Month;
101
+ Year = value.Year;
102
+ }
103
+ }
104
+ </pre>
105
+ <!-- InstanceEndEditable -->
106
+ <hr/>
107
+ Text body after.
108
+ </div>
109
+ </div>
110
+
111
+ <div class="footer">
112
+ Copyright 2004-2007 Alex Gorbatchev.<br/>
113
+ </div>
114
+
115
+ <script class="javascript" src="Scripts/shCore.js"></script>
116
+ <script class="javascript" src="Scripts/shBrushCSharp.js"></script>
117
+ <script class="javascript" src="Scripts/shBrushPhp.js"></script>
118
+ <script class="javascript" src="Scripts/shBrushJScript.js"></script>
119
+ <script class="javascript" src="Scripts/shBrushJava.js"></script>
120
+ <script class="javascript" src="Scripts/shBrushVb.js"></script>
121
+ <script class="javascript" src="Scripts/shBrushSql.js"></script>
122
+ <script class="javascript" src="Scripts/shBrushXml.js"></script>
123
+ <script class="javascript" src="Scripts/shBrushDelphi.js"></script>
124
+ <script class="javascript" src="Scripts/shBrushPython.js"></script>
125
+ <script class="javascript" src="Scripts/shBrushRuby.js"></script>
126
+ <script class="javascript" src="Scripts/shBrushCss.js"></script>
127
+ <script class="javascript" src="Scripts/shBrushCpp.js"></script>
128
+ <script class="javascript">
129
+ dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
130
+ dp.SyntaxHighlighter.HighlightAll('code');
131
+ </script>
132
+
133
+ </body>
134
+ <!-- InstanceEnd --></html>
@@ -0,0 +1,90 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Test.dwt" codeOutsideHTMLIsLocked="false" -->
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
+ <title>dp.SyntaxHighlighter Tests</title>
6
+ <link type="text/css" rel="stylesheet" href="Styles/SyntaxHighlighter.css"></link>
7
+ <link href="Styles/TestPages.css" rel="stylesheet" type="text/css">
8
+ </head>
9
+
10
+ <body>
11
+
12
+ <h1>dp.SyntaxHighlighter 1.5.0 Tests and Samples</h1>
13
+ <p><a href="http://code.google.com/p/syntaxhighlighter/">http://code.google.com/p/syntaxhighlighter/</a></p>
14
+
15
+ <h2><!-- InstanceBeginEditable name="Title" -->Collapse Code<!-- InstanceEndEditable --></h2>
16
+
17
+ <div class="layout">
18
+
19
+ <div class="column1">
20
+ <h3>Languages:</h3>
21
+ <ol>
22
+ <li><a href="CSharp.html">C#</a></li>
23
+ <li><a href="CSS.html">CSS</a></li>
24
+ <li><a href="Cpp.html">C++</a></li>
25
+ <li><a href="Delphi.html">Delphi</a></li>
26
+ <li><a href="Java.html">Java</a></li>
27
+ <li><a href="JavaScript.html">JavaScript</a></li>
28
+ <li><a href="PHP.html">PHP</a></li>
29
+ <li><a href="Python.html">Python</a></li>
30
+ <li><a href="Ruby.html">Ruby</a></li>
31
+ <li><a href="SQL.html">SQL</a></li>
32
+ <li><a href="VB.html">Visual Basic</a></li>
33
+ <li><a href="XML.html">XML / HTML</a></li>
34
+ </ol>
35
+ <h3>Features:</h3>
36
+ <ol>
37
+ <li><a href="SmartTabs.html">Smart tabs</a></li>
38
+ <li><a href="FirstLine.html">First line</a> </li>
39
+ <li><a href="CollapseCode.html">Expand code</a></li>
40
+ <li><a href="ShowColumns.html">Show columns</a></li>
41
+ <li><a href="NoGutter.html">No gutter</a></li>
42
+ <li><a href="NoControls.html">No controls</a></li>
43
+ </ol>
44
+ </div>
45
+
46
+ <div class="column2">
47
+ Text body before.
48
+ <hr/>
49
+ <!-- InstanceBeginEditable name="Code" -->
50
+
51
+ <p>You can have the code collapsed at first by adding <code>collapse</code>.</p>
52
+ <p><code>&lt;pre name="code" class="c-sharp:collapse" /></code></p>
53
+
54
+ <pre name="code" class="c-sharp:collapse">
55
+ 1 2 3 4 5 6 7 8 9
56
+ string path = "";
57
+ string safeReferrer = null;
58
+ FileInfo fileInfo = new FileInfo(string.Format("{0}/{1}", path, image));
59
+ int index = 0;
60
+ </pre>
61
+ <!-- InstanceEndEditable -->
62
+ <hr/>
63
+ Text body after.
64
+ </div>
65
+ </div>
66
+
67
+ <div class="footer">
68
+ Copyright 2004-2007 Alex Gorbatchev.<br/>
69
+ </div>
70
+
71
+ <script class="javascript" src="Scripts/shCore.js"></script>
72
+ <script class="javascript" src="Scripts/shBrushCSharp.js"></script>
73
+ <script class="javascript" src="Scripts/shBrushPhp.js"></script>
74
+ <script class="javascript" src="Scripts/shBrushJScript.js"></script>
75
+ <script class="javascript" src="Scripts/shBrushJava.js"></script>
76
+ <script class="javascript" src="Scripts/shBrushVb.js"></script>
77
+ <script class="javascript" src="Scripts/shBrushSql.js"></script>
78
+ <script class="javascript" src="Scripts/shBrushXml.js"></script>
79
+ <script class="javascript" src="Scripts/shBrushDelphi.js"></script>
80
+ <script class="javascript" src="Scripts/shBrushPython.js"></script>
81
+ <script class="javascript" src="Scripts/shBrushRuby.js"></script>
82
+ <script class="javascript" src="Scripts/shBrushCss.js"></script>
83
+ <script class="javascript" src="Scripts/shBrushCpp.js"></script>
84
+ <script class="javascript">
85
+ dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
86
+ dp.SyntaxHighlighter.HighlightAll('code');
87
+ </script>
88
+
89
+ </body>
90
+ <!-- InstanceEnd --></html>
@@ -0,0 +1,190 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Test.dwt" codeOutsideHTMLIsLocked="false" -->
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
+ <title>dp.SyntaxHighlighter Tests</title>
6
+ <link type="text/css" rel="stylesheet" href="Styles/SyntaxHighlighter.css"></link>
7
+ <link href="Styles/TestPages.css" rel="stylesheet" type="text/css">
8
+ </head>
9
+
10
+ <body>
11
+
12
+ <h1>dp.SyntaxHighlighter 1.5.0 Tests and Samples</h1>
13
+ <p><a href="http://code.google.com/p/syntaxhighlighter/">http://code.google.com/p/syntaxhighlighter/</a></p>
14
+
15
+ <h2><!-- InstanceBeginEditable name="Title" -->C++<!-- InstanceEndEditable --></h2>
16
+
17
+ <div class="layout">
18
+
19
+ <div class="column1">
20
+ <h3>Languages:</h3>
21
+ <ol>
22
+ <li><a href="CSharp.html">C#</a></li>
23
+ <li><a href="CSS.html">CSS</a></li>
24
+ <li><a href="Cpp.html">C++</a></li>
25
+ <li><a href="Delphi.html">Delphi</a></li>
26
+ <li><a href="Java.html">Java</a></li>
27
+ <li><a href="JavaScript.html">JavaScript</a></li>
28
+ <li><a href="PHP.html">PHP</a></li>
29
+ <li><a href="Python.html">Python</a></li>
30
+ <li><a href="Ruby.html">Ruby</a></li>
31
+ <li><a href="SQL.html">SQL</a></li>
32
+ <li><a href="VB.html">Visual Basic</a></li>
33
+ <li><a href="XML.html">XML / HTML</a></li>
34
+ </ol>
35
+ <h3>Features:</h3>
36
+ <ol>
37
+ <li><a href="SmartTabs.html">Smart tabs</a></li>
38
+ <li><a href="FirstLine.html">First line</a> </li>
39
+ <li><a href="CollapseCode.html">Expand code</a></li>
40
+ <li><a href="ShowColumns.html">Show columns</a></li>
41
+ <li><a href="NoGutter.html">No gutter</a></li>
42
+ <li><a href="NoControls.html">No controls</a></li>
43
+ </ol>
44
+ </div>
45
+
46
+ <div class="column2">
47
+ Text body before.
48
+ <hr/>
49
+ <!-- InstanceBeginEditable name="Code" -->
50
+ <pre name="code" class="c">
51
+ #include &lt;windows.h>
52
+ #include "winevent.hpp"
53
+
54
+ #include &lt;time.h>
55
+ #include &lt;stdio.h>
56
+
57
+ int nInt = 0;
58
+ int nStart = 0;
59
+ int nEnd = 0;
60
+ char buf[255];
61
+
62
+ //////////////////////////////////////////////////////////////
63
+ // Event handlers
64
+
65
+ template&lt;>
66
+ LRESULT OnMsg&lt;WM_CREATE>(HWND hWnd, WPARAM wParam, LPARAM lParam)
67
+ {
68
+ strcpy(buf, "Press any key to start test");
69
+ return DefWindowProc(hWnd, WM_CREATE, wParam, lParam);
70
+ }
71
+
72
+ template&lt;>
73
+ LRESULT OnMsg&lt;WM_KEYDOWN>(HWND hWnd, WPARAM wParam, LPARAM lParam)
74
+ {
75
+ nInt = 0;
76
+ strcpy(buf, "running test, please wait ...");
77
+ InvalidateRect(hWnd, NULL, true);
78
+ SendMessage(hWnd, WM_PAINT, 0, 0);
79
+ nStart = GetTickCount();
80
+ PostMessage(hWnd, WM_TIMER, 0, 0);
81
+ return DefWindowProc(hWnd, WM_KEYDOWN, wParam, lParam);
82
+ }
83
+
84
+ template&lt;>
85
+ LRESULT OnMsg&lt;WM_TIMER>(HWND hWnd, WPARAM wParam, LPARAM lParam)
86
+ {
87
+ if (nInt++ < 100000) {
88
+ PostMessage(hWnd, WM_TIMER, 0, 0);
89
+ } else {
90
+ nEnd = GetTickCount();
91
+ sprintf(buf, "Time elapsed = %d msec",
92
+ ((nEnd - nStart) * 1000) / CLOCKS_PER_SEC);
93
+ InvalidateRect(hWnd, NULL, true);
94
+ }
95
+ return 0;
96
+ }
97
+
98
+ template&lt;>
99
+ LRESULT OnMsg&lt;WM_DESTROY>(HWND hWnd, WPARAM wParam, LPARAM lParam)
100
+ {
101
+ PostQuitMessage(0);
102
+ return 0;
103
+ }
104
+
105
+ template&lt;>
106
+ LRESULT OnMsg&lt;WM_PAINT>(HWND hWnd, WPARAM wParam, LPARAM lParam)
107
+ {
108
+ PAINTSTRUCT ps;
109
+ HDC hdc;
110
+ hdc = BeginPaint(hWnd, &ps);
111
+ TextOut(hdc, 100, 100, buf, static_cast&lt;int>(strlen(buf)));
112
+ EndPaint(hWnd, &ps);
113
+ return DefWindowProc(hWnd, WM_PAINT, wParam, lParam);
114
+ }
115
+
116
+ /****************************************************
117
+ // Entry point for the application.
118
+ ****************************************************/
119
+
120
+ int WINAPI WinMain(HINSTANCE hInstance,
121
+ HINSTANCE hPrevInstance, LPSTR szCmdLine, int nCmdShow)
122
+ {
123
+ InitMsgHandlers&lt;NULL>();
124
+
125
+ static char szAppName[] = "demo";
126
+ HWND hwnd;
127
+ MSG msg;
128
+ WNDCLASSEX wndclass;
129
+
130
+ wndclass.cbSize = sizeof(wndclass);
131
+ wndclass.style = CS_HREDRAW | CS_VREDRAW;
132
+ wndclass.lpfnWndProc = WndProc;
133
+ wndclass.cbClsExtra = 0;
134
+ wndclass.cbWndExtra = 0;
135
+ wndclass.hInstance = hInstance;
136
+ wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
137
+ wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
138
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
139
+ wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
140
+ wndclass.lpszClassName = szAppName;
141
+ wndclass.lpszMenuName = NULL;
142
+
143
+ RegisterClassEx(&wndclass);
144
+
145
+ hwnd = CreateWindow(szAppName, "Static Dispatch Demo",
146
+ WS_OVERLAPPEDWINDOW,
147
+ CW_USEDEFAULT, CW_USEDEFAULT,
148
+ CW_USEDEFAULT, CW_USEDEFAULT,
149
+ NULL, NULL, hInstance, NULL);
150
+
151
+ ShowWindow(hwnd, nCmdShow);
152
+ UpdateWindow(hwnd);
153
+
154
+ while ( GetMessage(&msg, NULL, 0, 0) ) {
155
+ TranslateMessage(&msg);
156
+ DispatchMessage(&msg);
157
+ }
158
+ return static_cast&lt;int>(msg.wParam);
159
+ }
160
+ </pre>
161
+ <!-- InstanceEndEditable -->
162
+ <hr/>
163
+ Text body after.
164
+ </div>
165
+ </div>
166
+
167
+ <div class="footer">
168
+ Copyright 2004-2007 Alex Gorbatchev.<br/>
169
+ </div>
170
+
171
+ <script class="javascript" src="Scripts/shCore.js"></script>
172
+ <script class="javascript" src="Scripts/shBrushCSharp.js"></script>
173
+ <script class="javascript" src="Scripts/shBrushPhp.js"></script>
174
+ <script class="javascript" src="Scripts/shBrushJScript.js"></script>
175
+ <script class="javascript" src="Scripts/shBrushJava.js"></script>
176
+ <script class="javascript" src="Scripts/shBrushVb.js"></script>
177
+ <script class="javascript" src="Scripts/shBrushSql.js"></script>
178
+ <script class="javascript" src="Scripts/shBrushXml.js"></script>
179
+ <script class="javascript" src="Scripts/shBrushDelphi.js"></script>
180
+ <script class="javascript" src="Scripts/shBrushPython.js"></script>
181
+ <script class="javascript" src="Scripts/shBrushRuby.js"></script>
182
+ <script class="javascript" src="Scripts/shBrushCss.js"></script>
183
+ <script class="javascript" src="Scripts/shBrushCpp.js"></script>
184
+ <script class="javascript">
185
+ dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
186
+ dp.SyntaxHighlighter.HighlightAll('code');
187
+ </script>
188
+
189
+ </body>
190
+ <!-- InstanceEnd --></html>