[gtkmm-documentation] Mark examples as being for gtkmm 3, not gtkmm 2.



commit 62f164a52554edc481988174a391c139b0123478
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Oct 28 11:50:24 2010 +0200

    Mark examples as being for gtkmm 3, not gtkmm 2.
    
    	* examples/others/base/: Move this to examples/book/ because it is really
    	used in the book, in the Basics section.
    	* docs/tutorial/insert_example_code.pl: Append the branch parameter
    	(an entity in the .xml file) to the git.gnome.org URL so people see the
    	correct version of the source code, though this is blank for now so that
    	we use master for this branch. Also add a comment that this is for
    	gtkmm 2, not gtkmm 3.

 ChangeLog                              |   12 ++++++++++++
 docs/tutorial/C/gtkmm-tutorial-in.xml  |    6 +++---
 docs/tutorial/insert_example_code.pl   |   15 +++++++++++----
 examples/Makefile.am                   |    8 ++++----
 examples/{others => book}/base/base.cc |    0
 5 files changed, 30 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a5ade7a..1fafd5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2010-10-28  Murray Cumming  <murrayc murrayc com>
 
+	Mark examples as being for gtkmm 3, not gtkmm 2.
+
+	* examples/others/base/: Move this to examples/book/ because it is really
+	used in the book, in the Basics section.
+	* docs/tutorial/insert_example_code.pl: Append the branch parameter
+	(an entity in the .xml file) to the git.gnome.org URL so people see the
+	correct version of the source code, though this is blank for now so that
+	we use master for this branch. Also add a comment that this is for
+	gtkmm 2, not gtkmm 3.
+
+2010-10-28  Murray Cumming  <murrayc murrayc com>
+
 	Tutorial: Deal with some TODOs and hide others.
 
 	* docs/tutorial/C/gtkmm-tutorial-in.xml: Label section: Describe the use of
diff --git a/docs/tutorial/C/gtkmm-tutorial-in.xml b/docs/tutorial/C/gtkmm-tutorial-in.xml
index a600a80..4c3b942 100644
--- a/docs/tutorial/C/gtkmm-tutorial-in.xml
+++ b/docs/tutorial/C/gtkmm-tutorial-in.xml
@@ -7,8 +7,8 @@
   <!ENTITY url_refdocs_base_gtk "&url_refdocs_base_gtk_html;classGtk_1_1">
   <!ENTITY url_refdocs_base_gtk_namespace "&url_refdocs_base_gtk_html;namespaceGtk_1_1">
   <!ENTITY url_figures_base "figures/">
-  <!ENTITY url_examples_others_base "http://git.gnome.org/cgit/gtkmm-documentation/tree/examples/others/";>
-  <!ENTITY url_examples_base "http://git.gnome.org/cgit/gtkmm-documentation/tree/examples/book/";>
+  <!ENTITY url_examples_base "http://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/";>
+  <!ENTITY url_examples_branchsuffix "">
   <!ENTITY gtkmm "<application>gtkmm</application>">
   <!ENTITY uuml "&#252;" >
   <!ENTITY szlig "&#223;" >
@@ -312,7 +312,7 @@ To begin our introduction to &gtkmm;, we'll start with the simplest
 program possible. This program will create an empty 200 x 200 pixel window.
 </para>
 
-<para><ulink url="&url_examples_others_base;base">Source Code</ulink></para>
+<para><ulink url="&url_examples_base;base">Source Code</ulink></para>
 
 <para>We will now explain each line of the example</para>
 <programlisting>#include &lt;gtkmm.h&gt;</programlisting>
diff --git a/docs/tutorial/insert_example_code.pl b/docs/tutorial/insert_example_code.pl
index 358ed93..139bc7b 100755
--- a/docs/tutorial/insert_example_code.pl
+++ b/docs/tutorial/insert_example_code.pl
@@ -12,14 +12,17 @@
 
     while(<FILE>)
     {
-      print $_;
-
       #Beginning of comment:
       # Look for
       # <para><ulink url="&url_examples_base;helloworld">Source Code</ulink></para>
 
       if(/<para><ulink url=\"&url_examples_base;([\/\w]+)\">Source Code<\/ulink><\/para>/)
       {
+        #Modify the line to add the branch, so people see the correct version.
+        #This is particularly important during major API changes every few years,
+        #when the API might no longer even exist in the new version.
+        print "<para><ulink url=\"&url_examples_base;${1}?h=&url_examples_branchsuffix;\">Source Code<\/ulink><\/para>\n";
+
         #List all the source files in that directory:
         my $directory = $examples_base . $1;
 
@@ -34,7 +37,7 @@
 
         foreach $source_file (@header_files, @source_files)
         {
-           print "<para>File: <filename>${source_file}</filename>\n";
+           print "<para>File: <filename>${source_file}</filename> (For use with gtkmm 3, not gtkmm 2)\n";
            print "</para>\n";
            print "<programlisting>\n";
 
@@ -45,6 +48,11 @@
 
         print "<!-- end inserted example code -->\n";
       }
+      else
+      {
+        # Just print the line without changes:
+        print $_;
+      }
     }
 
     close(FILE);
@@ -79,4 +87,3 @@ sub process_source_file($)
 
   close(SOURCE_FILE);
 }
-
diff --git a/examples/Makefile.am b/examples/Makefile.am
index c3c5b08..acfc048 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -10,6 +10,7 @@ check_PROGRAMS =					\
 	book/alignment/example				\
 	book/aspectframe/example			\
 	book/assistant/example				\
+	book/base/base				\
 	book/box/example				\
 	book/builder/basic/example			\
 	book/builder/derived/example			\
@@ -97,7 +98,6 @@ check_PROGRAMS =					\
 	book/update_ui/example				\
 	others/arrow/arrow				\
 	others/arrow/direction				\
-	others/base/base				\
 	others/calendar/calendar			\
 	others/cellrenderercustom/cellrenderertoggle	\
 	others/cellrenderercustom/testpopup		\
@@ -145,6 +145,9 @@ book_assistant_example_SOURCES =		\
 	book/assistant/examplewindow.h		\
 	book/assistant/main.cc
 
+book_base_base_SOURCES = \
+	book/base/base.cc
+
 book_box_example_SOURCES =			\
 	book/box/examplewindow.cc		\
 	book/box/examplewindow.h		\
@@ -586,9 +589,6 @@ others_arrow_arrow_SOURCES = \
 others_arrow_direction_SOURCES = \
 	others/arrow/direction.cc
 
-others_base_base_SOURCES = \
-	others/base/base.cc
-
 others_calendar_calendar_SOURCES = \
 	others/calendar/calendar.cc
 
diff --git a/examples/others/base/base.cc b/examples/book/base/base.cc
similarity index 100%
rename from examples/others/base/base.cc
rename to examples/book/base/base.cc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]