[gbrainy] Initial GTK+ 3.0 porting



commit 220815d0e7682b35fd97d3dd67bb2beeeea7d036
Author: Jordi Mas <jmas softcatala org>
Date:   Sun Dec 14 08:00:14 2014 -0500

    Initial GTK+ 3.0 porting

 configure.ac                                       |   18 +-
 src/Clients/Classical/Builder/Builder.cs           |  621 --------------------
 .../Classical/Builder/BuilderConnectFunc.cs        |   10 -
 .../GtkBeansSharp.BuilderConnectFuncNative.cs      |   96 ---
 src/Clients/Classical/Builder/ObjectManager.cs     |   19 -
 src/Clients/Classical/Builder/README               |    3 -
 src/Clients/Classical/Dialogs/BuilderDialog.cs     |    7 +-
 src/Clients/Classical/Dialogs/CustomGameDialog.cs  |   12 +-
 src/Clients/Classical/Dialogs/HigMessageDialog.cs  |    6 +-
 src/Clients/Classical/Dialogs/PdfExportDialog.cs   |   22 +-
 .../Classical/Dialogs/PlayerHistoryDialog.cs       |   23 +-
 src/Clients/Classical/Dialogs/PreferencesDialog.cs |   26 +-
 .../Classical/Dialogs/ui/PreferencesDialog.ui      |   67 ++-
 src/Clients/Classical/Makefile.am                  |    5 -
 src/Clients/Classical/Widgets/GameDrawingArea.cs   |   14 +-
 src/Clients/Classical/Widgets/Toolbar.cs           |    6 +-
 src/Clients/Classical/gbrainy.cs                   |   49 +-
 src/Core/Makefile.am                               |    1 -
 src/Games/Makefile.am                              |    2 +-
 19 files changed, 126 insertions(+), 881 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1df9d55..e91ccca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ fi
 
 dnl -- check for various mono assemblies that we need.
 
-needed_assemblies="Mono.Posix Mono.Cairo Mono.CSharp"
+needed_assemblies="Mono.Posix Mono.CSharp"
 for i in $needed_assemblies; do
   AC_MSG_CHECKING([for $i.dll])
   if test ! \( -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/4.5/$i.dll -o -e `$PKG_CONFIG 
--variable=prefix mono`/lib64/mono/4.5/$i.dll \); then
@@ -73,14 +73,14 @@ done
 
 dnl --- Required libraries
 
-GTKSHARP_REQUIRED=2.10
-MONO_REQUIRED=3.0.0
-MONO_ADDINS=0.3
+GTKSHARP_REQUIRED=2.99.1
+MONO_REQUIRED=1.1.7
+MONO_ADDINS=0.2.0
 CANBERRA_GTK_REQUIRED=0.26
 
 PKG_CHECK_MODULES(GBRAINY_CORE, mono >= $MONO_REQUIRED)
 
-PKG_CHECK_MODULES(GBRAINY, gtk-sharp-2.0 >= $GTKSHARP_REQUIRED)
+PKG_CHECK_MODULES(GBRAINY, gtk-sharp-3.0 >= $GTKSHARP_REQUIRED)
 PKG_CHECK_MODULES(GBRAINY, libcanberra-gtk  >= $CANBERRA_GTK_REQUIRED)
 AC_SUBST(GBRAINY_LIBS)
 
@@ -88,10 +88,10 @@ AC_ARG_ENABLE(addins, AC_HELP_STRING([--disable-addins], [Disable mono-addins su
 
 enable_addins_sharp="${enable_addins}"
 
-PKG_CHECK_MODULES(MONO_ADDINS,
-       mono-addins >= $MONO_ADDINS
-       mono-addins-setup >= $MONO_ADDINS
-       mono-addins-gui >= $MONO_ADDINS,
+ PKG_CHECK_MODULES(MONO_ADDINS,
+       mono-addins0.2 >= $MONO_ADDINS
+       mono-addins0.2-setup >= $MONO_ADDINS
+       mono-addins0.2-gui >= $MONO_ADDINS,
        enable_addins_sharp="$enable_addins_sharp", enable_addins_sharp=no)
 
 if test "x$enable_addins" = "xyes" -a "x$enable_addins_sharp" = "xno"; then
diff --git a/src/Clients/Classical/Dialogs/BuilderDialog.cs b/src/Clients/Classical/Dialogs/BuilderDialog.cs
index 5be137a..7770643 100644
--- a/src/Clients/Classical/Dialogs/BuilderDialog.cs
+++ b/src/Clients/Classical/Dialogs/BuilderDialog.cs
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+using Gtk;
 using gbrainy.Core.Services;
 
 namespace gbrainy.Clients.Classical.Dialogs
@@ -26,17 +27,17 @@ namespace gbrainy.Clients.Classical.Dialogs
                protected ITranslations Translations { get; private set;}
 
                public BuilderDialog (ITranslations translations, string resourceName, string dialogName) : 
-                       this ((System.Reflection.Assembly) null, resourceName, dialogName)
+                       this (new Builder (resourceName, null),dialogName)
                {
                        Translations = translations;
                }
 
                public BuilderDialog (System.Reflection.Assembly assembly, string resourceName, string 
dialogName) : 
-                       this (new GtkBeans.Builder (assembly, resourceName, null),dialogName)
+                       this (new Builder (assembly, resourceName, null),dialogName)
                {
                }
 
-               public BuilderDialog (GtkBeans.Builder builder, string dialogName) : base 
(builder.GetRawObject (dialogName))
+               public BuilderDialog (Builder builder, string dialogName) : base (builder.GetRawObject 
(dialogName))
                {
                        builder.Autoconnect (this);
                        IconName = "gbrainy";
diff --git a/src/Clients/Classical/Dialogs/CustomGameDialog.cs 
b/src/Clients/Classical/Dialogs/CustomGameDialog.cs
index 1566b50..eadb99c 100644
--- a/src/Clients/Classical/Dialogs/CustomGameDialog.cs
+++ b/src/Clients/Classical/Dialogs/CustomGameDialog.cs
@@ -32,8 +32,8 @@ namespace gbrainy.Clients.Classical.Dialogs
        {
                // This is static to allow to preserve the selection in different instances
                static ListStore games_store;
-               [GtkBeans.Builder.Object] Gtk.TreeView treeview;
-               [GtkBeans.Builder.Object] Box preview_vbox;
+               [Builder.Object] Gtk.TreeView treeview;
+               [Builder.Object] Box preview_vbox;
                GameDrawingArea drawing_area;
                GameSession session;
                GameLocator [] games;
@@ -175,7 +175,7 @@ namespace gbrainy.Clients.Classical.Dialogs
                        games_store = null;
                }
 
-               int GameSort (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
+               int GameSort (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
                {
                        string name_a, name_b;
                        int sort_column_id;
@@ -224,7 +224,7 @@ namespace gbrainy.Clients.Classical.Dialogs
 
                void OnSelectAll (object sender, EventArgs args)
                {
-                       games_store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  {
+                       games_store.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter)  {
                                games_store.SetValue (iter, COL_ENABLED, true);
                                return false;
                        });
@@ -232,7 +232,7 @@ namespace gbrainy.Clients.Classical.Dialogs
 
                void OnUnSelectAll (object sender, EventArgs args)
                {
-                       games_store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  {
+                       games_store.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter)  {
                                games_store.SetValue (iter, COL_ENABLED, false);
                                return false;
                        });
@@ -244,7 +244,7 @@ namespace gbrainy.Clients.Classical.Dialogs
 
                        play_list = new List <int> ();
 
-                       games_store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  {
+                       games_store.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter)  {
                                bool enabled = (bool) games_store.GetValue (iter, COL_ENABLED);
 
                                if (enabled == true) {
diff --git a/src/Clients/Classical/Dialogs/HigMessageDialog.cs 
b/src/Clients/Classical/Dialogs/HigMessageDialog.cs
index a5cf5e6..19d2f30 100644
--- a/src/Clients/Classical/Dialogs/HigMessageDialog.cs
+++ b/src/Clients/Classical/Dialogs/HigMessageDialog.cs
@@ -37,12 +37,12 @@ namespace gbrainy.Clients.Classical.Dialogs
                                         string          header,
                                         string          msg) : base ()
                {
-                       HasSeparator = false;
+                       //HasSeparator = false;
                        BorderWidth = 5;
                        Resizable = false;
                        Title = string.Empty;
 
-                       VBox.Spacing = 12;
+                       //VBox.Spacing = 12;
                        ActionArea.Layout = Gtk.ButtonBoxStyle.End;
 
                        accel_group = new Gtk.AccelGroup ();
@@ -51,7 +51,7 @@ namespace gbrainy.Clients.Classical.Dialogs
                        Gtk.HBox hbox = new Gtk.HBox (false, 12);
                        hbox.BorderWidth = 5;
                        hbox.Show ();
-                       VBox.PackStart (hbox, false, false, 0);
+                       //VBox.PackStart (hbox, false, false, 0);
 
                        switch (type) {
                        case Gtk.MessageType.Error:
diff --git a/src/Clients/Classical/Dialogs/PdfExportDialog.cs 
b/src/Clients/Classical/Dialogs/PdfExportDialog.cs
index 5f54d56..0af1eef 100644
--- a/src/Clients/Classical/Dialogs/PdfExportDialog.cs
+++ b/src/Clients/Classical/Dialogs/PdfExportDialog.cs
@@ -29,16 +29,16 @@ namespace gbrainy.Clients.Classical.Dialogs
 {
        public class PdfExportDialog : BuilderDialog
        {
-               [GtkBeans.Builder.Object] Gtk.HBox hbox_file;
-               [GtkBeans.Builder.Object] Gtk.SpinButton games_spinbutton;
-               [GtkBeans.Builder.Object] Gtk.CheckButton colorblindcheckbutton;
-               [GtkBeans.Builder.Object] Gtk.RadioButton rb_easy;
-               [GtkBeans.Builder.Object] Gtk.RadioButton rb_medium;
-               [GtkBeans.Builder.Object] Gtk.RadioButton rb_master;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbox_logic;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbox_calculation;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbox_verbal;
-               [GtkBeans.Builder.Object] Gtk.ComboBox layout_combo;
+               [Builder.Object] Gtk.HBox hbox_file;
+               [Builder.Object] Gtk.SpinButton games_spinbutton;
+               [Builder.Object] Gtk.CheckButton colorblindcheckbutton;
+               [Builder.Object] Gtk.RadioButton rb_easy;
+               [Builder.Object] Gtk.RadioButton rb_medium;
+               [Builder.Object] Gtk.RadioButton rb_master;
+               [Builder.Object] Gtk.CheckButton checkbox_logic;
+               [Builder.Object] Gtk.CheckButton checkbox_calculation;
+               [Builder.Object] Gtk.CheckButton checkbox_verbal;
+               [Builder.Object] Gtk.ComboBox layout_combo;
 
                BrowseFile file;
                GameManager manager;
@@ -182,7 +182,7 @@ namespace gbrainy.Clients.Classical.Dialogs
                        md.Destroy ();
                }
 
-               static public void ComboBoxCellFunc (CellLayout cell_layout, CellRenderer cell, TreeModel 
tree_model, TreeIter iter)
+               static public void ComboBoxCellFunc (ICellLayout cell_layout, CellRenderer cell, ITreeModel 
tree_model, TreeIter iter)
                {
                        string name = (string)tree_model.GetValue (iter, 0);
                        (cell as CellRendererText).Text = name;
diff --git a/src/Clients/Classical/Dialogs/PlayerHistoryDialog.cs 
b/src/Clients/Classical/Dialogs/PlayerHistoryDialog.cs
index 7524f72..af6611f 100644
--- a/src/Clients/Classical/Dialogs/PlayerHistoryDialog.cs
+++ b/src/Clients/Classical/Dialogs/PlayerHistoryDialog.cs
@@ -29,13 +29,13 @@ namespace gbrainy.Clients.Classical.Dialogs
 {
        public class PlayerHistoryDialog : BuilderDialog
        {
-               [GtkBeans.Builder.Object] Box history_preview;
-               [GtkBeans.Builder.Object] Label label_playerhistory;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbutton_total;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbutton_memory;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbutton_logic;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbutton_calculation;
-               [GtkBeans.Builder.Object] Gtk.CheckButton checkbutton_verbal;
+               [Builder.Object] Box history_preview;
+               [Builder.Object] Label label_playerhistory;
+               [Builder.Object] Gtk.CheckButton checkbutton_total;
+               [Builder.Object] Gtk.CheckButton checkbutton_memory;
+               [Builder.Object] Gtk.CheckButton checkbutton_logic;
+               [Builder.Object] Gtk.CheckButton checkbutton_calculation;
+               [Builder.Object] Gtk.CheckButton checkbutton_verbal;
 
                CairoPreview drawing_area;
 
@@ -116,7 +116,7 @@ namespace gbrainy.Clients.Classical.Dialogs
                                get { return view; }
                        }
 
-                       protected override bool OnExposeEvent (Gdk.EventExpose args)
+                       protected override bool OnDrawn (Cairo.Context cc)
                        {
                                if(!IsRealized)
                                        return false;
@@ -124,10 +124,10 @@ namespace gbrainy.Clients.Classical.Dialogs
                                int w, h, nw, nh;
                                double x = 0, y = 0;
 
-                               Cairo.Context cc = Gdk.CairoHelper.Create (args.Window);
                                CairoContextEx cr = new CairoContextEx (cc.Handle);
                                cr.PangoFontDescription = PangoContext.FontDescription;
-                               args.Window.GetSize (out w, out h);
+                    w = Window.Width;
+                h = Window.Height;
 
                                nh = nw = Math.Min (w, h);
 
@@ -144,9 +144,8 @@ namespace gbrainy.Clients.Classical.Dialogs
 
                                view.Draw (cr, nw, nh, Direction == Gtk.TextDirection.Rtl);
 
-                               ((IDisposable)cc).Dispose();
                                ((IDisposable)cr).Dispose();
-                               return base.OnExposeEvent(args);
+                               return true;
                        }
                }
        }
diff --git a/src/Clients/Classical/Dialogs/PreferencesDialog.cs 
b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
index 58ddf03..c9f197d 100644
--- a/src/Clients/Classical/Dialogs/PreferencesDialog.cs
+++ b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
@@ -28,18 +28,18 @@ namespace gbrainy.Clients.Classical.Dialogs
 {
        public class PreferencesDialog : BuilderDialog
        {
-               [GtkBeans.Builder.Object] Gtk.SpinButton prefspinbutton;
-               [GtkBeans.Builder.Object] Gtk.SpinButton maxstoredspinbutton;
-               [GtkBeans.Builder.Object] Gtk.SpinButton minplayedspinbutton;
-               [GtkBeans.Builder.Object] Gtk.CheckButton prefcheckbutton;
-               [GtkBeans.Builder.Object] Gtk.CheckButton colorblindcheckbutton;
-               [GtkBeans.Builder.Object] Gtk.RadioButton rb_easy;
-               [GtkBeans.Builder.Object] Gtk.RadioButton rb_medium;
-               [GtkBeans.Builder.Object] Gtk.RadioButton rb_master;
-               [GtkBeans.Builder.Object] Gtk.ComboBox themes_combobox;
-               [GtkBeans.Builder.Object] Gtk.CheckButton englishcheckbutton;
-               [GtkBeans.Builder.Object] Gtk.CheckButton loadextensionscheckbutton;
-               [GtkBeans.Builder.Object] Gtk.CheckButton usesoundscheckbutton;
+               [Builder.Object] Gtk.SpinButton prefspinbutton;
+               [Builder.Object] Gtk.SpinButton maxstoredspinbutton;
+               [Builder.Object] Gtk.SpinButton minplayedspinbutton;
+               [Builder.Object] Gtk.CheckButton prefcheckbutton;
+               [Builder.Object] Gtk.CheckButton colorblindcheckbutton;
+               [Builder.Object] Gtk.RadioButton rb_easy;
+               [Builder.Object] Gtk.RadioButton rb_medium;
+               [Builder.Object] Gtk.RadioButton rb_master;
+               [Builder.Object] Gtk.ComboBox themes_combobox;
+               [Builder.Object] Gtk.CheckButton englishcheckbutton;
+               [Builder.Object] Gtk.CheckButton loadextensionscheckbutton;
+               [Builder.Object] Gtk.CheckButton usesoundscheckbutton;
 
                const int COLUMN_VALUE = 1;
                PlayerHistory history;
@@ -147,7 +147,7 @@ namespace gbrainy.Clients.Classical.Dialogs
                        Preferences.Save ();
                }
 
-               static public void ComboBoxCellFunc (CellLayout cell_layout, CellRenderer cell, TreeModel 
tree_model, TreeIter iter)
+               static public void ComboBoxCellFunc (ICellLayout cell_layout, CellRenderer cell, ITreeModel 
tree_model, TreeIter iter)
                {
                        string name = (string)tree_model.GetValue (iter, 0);
                        (cell as CellRendererText).Text = name;
diff --git a/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui 
b/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
index a3ebbc3..bbab99b 100644
--- a/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
+++ b/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
+  <requires lib="gtk+" version="3.10"/>
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">1</property>
     <property name="upper">60</property>
@@ -27,11 +27,12 @@
     <property name="title" translatable="yes">Preferences</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
-      <object class="GtkVBox" id="preferencesbox">
+      <object class="GtkBox" id="preferencesbox">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area3">
+          <object class="GtkButtonBox" id="dialog-action_area3">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
@@ -77,9 +78,10 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox13">
+          <object class="GtkBox" id="vbox13">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkLabel" id="label33">
                 <property name="visible">True</property>
@@ -103,6 +105,7 @@
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
               </object>
               <packing>
@@ -118,6 +121,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
               </object>
               <packing>
@@ -133,6 +137,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
               </object>
               <packing>
@@ -148,6 +153,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
               </object>
               <packing>
@@ -157,7 +163,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="hbox1">
+              <object class="GtkBox" id="hbox1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
@@ -198,13 +204,15 @@
           <packing>
             <property name="expand">True</property>
             <property name="fill">True</property>
+            <property name="padding">1</property>
             <property name="position">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox11">
+          <object class="GtkBox" id="vbox11">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkLabel" id="label27">
                 <property name="height_request">25</property>
@@ -229,6 +237,7 @@
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
               </object>
               <packing>
@@ -245,6 +254,7 @@
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
                 <property name="group">rb_easy</property>
               </object>
@@ -262,6 +272,7 @@
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
                 <property name="group">rb_easy</property>
               </object>
@@ -279,9 +290,10 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox9">
+          <object class="GtkBox" id="vbox9">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkLabel" id="label26">
                 <property name="visible">True</property>
@@ -300,11 +312,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox10">
+              <object class="GtkBox" id="vbox10">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkHBox" id="hbox9">
+                  <object class="GtkBox" id="hbox9">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
@@ -326,8 +339,6 @@
                         <property name="can_focus">True</property>
                         <property name="primary_icon_activatable">False</property>
                         <property name="secondary_icon_activatable">False</property>
-                        <property name="primary_icon_sensitive">True</property>
-                        <property name="secondary_icon_sensitive">True</property>
                         <property name="adjustment">adjustment1</property>
                         <property name="climb_rate">1</property>
                       </object>
@@ -359,6 +370,7 @@
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0.5</property>
                 <property name="draw_indicator">True</property>
               </object>
               <packing>
@@ -377,9 +389,10 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox12">
+          <object class="GtkBox" id="vbox12">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkLabel" id="label29">
                 <property name="visible">True</property>
@@ -397,15 +410,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="hbox11">
+              <object class="GtkBox" id="hbox11">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkTable" id="table5">
+                  <object class="GtkGrid" id="table5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
                     <child>
                       <object class="GtkLabel" id="label31">
                         <property name="visible">True</property>
@@ -415,8 +426,8 @@
                         <property name="label" translatable="yes">Minimum number of played games to store 
the game session:</property>
                       </object>
                       <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
@@ -428,10 +439,8 @@
                         <property name="label" translatable="yes">Maximum number of records in the player's 
game session history:</property>
                       </object>
                       <packing>
+                        <property name="left_attach">0</property>
                         <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
@@ -440,17 +449,12 @@
                         <property name="can_focus">True</property>
                         <property name="primary_icon_activatable">False</property>
                         <property name="secondary_icon_activatable">False</property>
-                        <property name="primary_icon_sensitive">True</property>
-                        <property name="secondary_icon_sensitive">True</property>
                         <property name="adjustment">adjustment2</property>
                         <property name="climb_rate">1</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
                         <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
@@ -459,15 +463,12 @@
                         <property name="can_focus">True</property>
                         <property name="primary_icon_activatable">False</property>
                         <property name="secondary_icon_activatable">False</property>
-                        <property name="primary_icon_sensitive">True</property>
-                        <property name="secondary_icon_sensitive">True</property>
                         <property name="adjustment">adjustment3</property>
                         <property name="climb_rate">1</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="y_options"></property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                   </object>
@@ -485,11 +486,11 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="hbox12">
+              <object class="GtkBox" id="hbox12">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkHButtonBox" id="hbuttonbox2">
+                  <object class="GtkButtonBox" id="hbuttonbox2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">1</property>
diff --git a/src/Clients/Classical/Makefile.am b/src/Clients/Classical/Makefile.am
index f48b2d3..5055f7f 100644
--- a/src/Clients/Classical/Makefile.am
+++ b/src/Clients/Classical/Makefile.am
@@ -7,10 +7,6 @@ GBRAINY_CSDISTFILES =                                  \
        $(srcdir)/CommandLine.cs                        \
        $(srcdir)/gbrainy.cs                            \
        $(srcdir)/GtkSynchronize.cs                     \
-       $(srcdir)/Builder/Builder.cs                    \
-       $(srcdir)/Builder/BuilderConnectFunc.cs         \
-       $(srcdir)/Builder/GtkBeansSharp.BuilderConnectFuncNative.cs \
-       $(srcdir)/Builder/ObjectManager.cs              \
        $(srcdir)/Dialogs/AboutDialog.cs                \
        $(srcdir)/Dialogs/CustomGameDialog.cs           \
        $(srcdir)/Dialogs/BuilderDialog.cs              \
@@ -26,7 +22,6 @@ GBRAINY_CSDISTFILES =                                 \
 ASSEMBLIES = \
         $(GBRAINY_LIBS)                \
         $(MONO_ADDINS_LIBS)            \
-       -r:Mono.Cairo.dll               \
        -r:../../gbrainy.Core.dll       \
        -r:Mono.Posix
 
diff --git a/src/Clients/Classical/Widgets/GameDrawingArea.cs 
b/src/Clients/Classical/Widgets/GameDrawingArea.cs
index d7c6d79..1023dd5 100644
--- a/src/Clients/Classical/Widgets/GameDrawingArea.cs
+++ b/src/Clients/Classical/Widgets/GameDrawingArea.cs
@@ -19,7 +19,6 @@
 
 using System;
 using Gtk;
-using Cairo;
 using Mono.Unix;
 using gbrainy.Core.Libraries;
 
@@ -80,18 +79,18 @@ namespace gbrainy.Clients.Classical.Widgets
                        QueueDraw ();
                }
 
-               protected override bool OnExposeEvent (Gdk.EventExpose args)
+               protected override bool OnDrawn (Cairo.Context cc)
                {
                        if (!IsRealized)
                                return false;
 
                        int w, h, total_w, total_h;
 
-                       Cairo.Context cc = Gdk.CairoHelper.Create (args.Window);
                        CairoContextEx cr = new CairoContextEx (cc.Handle);
                        cr.PangoFontDescription = PangoContext.FontDescription;
 
-                       args.Window.GetSize (out total_w, out total_h);
+            total_w = Window.Width;
+            total_h = Window.Height;
 
                        h = total_h - question_high;
                        if (UseSolutionArea)
@@ -133,12 +132,11 @@ namespace gbrainy.Clients.Classical.Widgets
                                // Draw the game area
                                cr.Translate (OffsetX, OffsetY);
                                cr.SetPangoNormalFontSize ();
-                               cr.Color = new Color (1, 1, 1, 0.5);
+                               cr.Color = new Cairo.Color (1, 1, 1, 0.5);
                                Drawable.Draw (cr, DrawingSquare, DrawingSquare, Direction == 
Gtk.TextDirection.Rtl);
                                cr.Stroke ();
                        }
 
-                       ((IDisposable)cc).Dispose();
                        ((IDisposable)cr).Dispose();
                        return true;
                }
@@ -201,7 +199,7 @@ namespace gbrainy.Clients.Classical.Widgets
                        box_height_scaled = Math.Max (height_str, (double) solution_high / (double) height);
 
                        // Draw black box
-                       cr.Color = new Color (0.1, 0.1, 0.1);
+                       cr.Color = new Cairo.Color (0.1, 0.1, 0.1);
 
                        cr.Rectangle (text_margin,
                                1 - box_height_scaled - text_margin,
@@ -211,7 +209,7 @@ namespace gbrainy.Clients.Classical.Widgets
                        cr.Stroke ();
 
                        // Draw text and icon
-                       cr.Color = new Color (1, 1, 1);
+                       cr.Color = new Cairo.Color (1, 1, 1);
 
                        if (Direction == Gtk.TextDirection.Rtl)
                        {
diff --git a/src/Clients/Classical/Widgets/Toolbar.cs b/src/Clients/Classical/Widgets/Toolbar.cs
index fdd0260..54735b9 100644
--- a/src/Clients/Classical/Widgets/Toolbar.cs
+++ b/src/Clients/Classical/Widgets/Toolbar.cs
@@ -26,8 +26,8 @@ namespace gbrainy.Clients.Classical.Widgets
        // Build and manages gbrainy's client Toolbar
        public class Toolbar : Gtk.Toolbar
        {
-               Gtk.HBox main_hbox;
-               Gtk.VBox framework_vbox;
+               Gtk.Box main_hbox;
+               Gtk.Box framework_vbox;
 
                public ToolButton AllButton {get; private set; }
                public ToolButton CalculationButton {get; private set; }
@@ -38,7 +38,7 @@ namespace gbrainy.Clients.Classical.Widgets
                public ToolButton VerbalButton {get; private set; }
                public bool InitCompleted {get; private set; }
 
-               public Toolbar (Gtk.HBox main_hbox, Gtk.VBox framework_vbox)
+               public Toolbar (Gtk.Box main_hbox, Gtk.Box framework_vbox)
                {
                        this.main_hbox = main_hbox;
                        this.framework_vbox = framework_vbox;
diff --git a/src/Clients/Classical/gbrainy.cs b/src/Clients/Classical/gbrainy.cs
index 2107e35..e649e5b 100644
--- a/src/Clients/Classical/gbrainy.cs
+++ b/src/Clients/Classical/gbrainy.cs
@@ -40,29 +40,30 @@ namespace gbrainy.Clients.Classical
 {
        public class GtkClient
        {
-               [GtkBeans.Builder.Object("gbrainy")] Gtk.Window app_window;
-               [GtkBeans.Builder.Object] Gtk.CheckMenuItem showtoolbar_menuitem;
-               [GtkBeans.Builder.Object] Box drawing_vbox;
-               [GtkBeans.Builder.Object] Gtk.HBox main_hbox;
-               [GtkBeans.Builder.Object] Gtk.VBox framework_vbox;
-               [GtkBeans.Builder.Object] Gtk.Entry answer_entry;
-               [GtkBeans.Builder.Object] Gtk.Button answer_button;
-               [GtkBeans.Builder.Object] Gtk.Label answer_label;
-               [GtkBeans.Builder.Object] Gtk.Button tip_button;
-               [GtkBeans.Builder.Object] Gtk.Button next_button;
-               [GtkBeans.Builder.Object] Gtk.Statusbar statusbar;
-               [GtkBeans.Builder.Object] Gtk.MenuItem pause_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem finish_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem newgame_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem allgames_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem logic_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem calculation_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem memory_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem verbal_menuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem extensions_menuitem;
-               [GtkBeans.Builder.Object] Gtk.RadioMenuItem vertical_radiomenuitem;
-               [GtkBeans.Builder.Object] Gtk.RadioMenuItem horizontal_radiomenuitem;
-               [GtkBeans.Builder.Object] Gtk.MenuItem toolbar_orientation_menuitem;
+               [Builder.Object("gbrainy")] Gtk.Window app_window;
+               [Builder.Object] Gtk.CheckMenuItem showtoolbar_menuitem;
+               [Builder.Object] Box drawing_vbox;
+               [Builder.Object] Gtk.Box main_hbox;
+               [Builder.Object] Gtk.Box framework_vbox;
+               [Builder.Object] Gtk.Entry answer_entry;
+               [Builder.Object] Gtk.Button answer_button;
+               [Builder.Object] Gtk.Label answer_label;
+               [Builder.Object] Gtk.Button tip_button;
+               [Builder.Object] Gtk.Button next_button;
+               [Builder.Object] Gtk.Statusbar statusbar;
+               [Builder.Object] Gtk.MenuBar menubar;
+               [Builder.Object] Gtk.MenuItem pause_menuitem;
+               [Builder.Object] Gtk.MenuItem finish_menuitem;
+               [Builder.Object] Gtk.MenuItem newgame_menuitem;
+               [Builder.Object] Gtk.MenuItem allgames_menuitem;
+               [Builder.Object] Gtk.MenuItem logic_menuitem;
+               [Builder.Object] Gtk.MenuItem calculation_menuitem;
+               [Builder.Object] Gtk.MenuItem memory_menuitem;
+               [Builder.Object] Gtk.MenuItem verbal_menuitem;
+               [Builder.Object] Gtk.MenuItem extensions_menuitem;
+               [Builder.Object] Gtk.RadioMenuItem vertical_radiomenuitem;
+               [Builder.Object] Gtk.RadioMenuItem horizontal_radiomenuitem;
+               [Builder.Object] Gtk.MenuItem toolbar_orientation_menuitem;
 
                Widgets.Toolbar toolbar;
 
@@ -129,7 +130,7 @@ namespace gbrainy.Clients.Classical
                {
                        bool show_toolbar;
 
-                       GtkBeans.Builder builder = new GtkBeans.Builder ("gbrainy.ui");
+                       Builder builder = new Builder ("gbrainy.ui");
                        builder.Autoconnect (this);
 
                        show_toolbar = Preferences.Get <bool> (Preferences.ToolbarShowKey) == true;
diff --git a/src/Core/Makefile.am b/src/Core/Makefile.am
index f302208..7184755 100644
--- a/src/Core/Makefile.am
+++ b/src/Core/Makefile.am
@@ -92,7 +92,6 @@ $(srcdir)/gbrainy.addin.xml
 
 REFS =  \
        -r:System \
-       -r:Mono.Cairo.dll               \
        -r:Mono.Posix                   \
        -r:Mono.CSharp.dll              \
         $(GBRAINY_LIBS)                \
diff --git a/src/Games/Makefile.am b/src/Games/Makefile.am
index 6fecd60..43d8bfc 100644
--- a/src/Games/Makefile.am
+++ b/src/Games/Makefile.am
@@ -99,8 +99,8 @@ $(top_srcdir)/data/game-graphics/balance.svg
 
 
 REFS =  \
+    $(GBRAINY_LIBS) \
        -r:System \
-       -r:Mono.Cairo.dll               \
        -r:Mono.Posix                   \
        -r:.././gbrainy.Core.dll
 


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