From 978a7b8819e5c5121ceb35b55ce15b01315f0632 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sun, 7 Sep 2003 10:56:40 +0000 Subject: [PATCH] 2003-09-07 Alp Toker * makefile.win32: New clean and release targets, and don't bother building the samples (sample/makefile.win32 is out of date anyway) * api/makefile.win32: * glue/makefile.win32: * makefile.win32: Glade# works perfectly on win32 now; include it in the default build * sample/GladeTest.cs: * sample/GladeViewer.cs: Remove Gnome dependency and clean up svn path=/trunk/gtk-sharp/; revision=17967 --- .cvsignore | 2 +- ChangeLog | 11 +++++++++++ api/makefile.win32 | 4 ++-- glue/makefile.win32 | 5 +++-- makefile.win32 | 16 +++++++++++++++- sample/GladeTest.cs | 20 +++++++++++--------- sample/GladeViewer.cs | 10 ++++------ 7 files changed, 47 insertions(+), 21 deletions(-) diff --git a/.cvsignore b/.cvsignore index 7aa460d97..99cd70b68 100755 --- a/.cvsignore +++ b/.cvsignore @@ -10,4 +10,4 @@ configure Makefile *.cache *.pc - +lib diff --git a/ChangeLog b/ChangeLog index 10f9478a7..267df09b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-09-07 Alp Toker + + * makefile.win32: New clean and release targets, and don't bother + building the samples (sample/makefile.win32 is out of date anyway) + * api/makefile.win32: + * glue/makefile.win32: + * makefile.win32: Glade# works perfectly on win32 now; include it in + the default build + * sample/GladeTest.cs: + * sample/GladeViewer.cs: Remove Gnome dependency and clean up + 2003-09-06 Alp Toker * api/gdk-api.xml: diff --git a/api/makefile.win32 b/api/makefile.win32 index 7233d2847..75c006d11 100755 --- a/api/makefile.win32 +++ b/api/makefile.win32 @@ -1,6 +1,6 @@ all: generated-stamp -generated-stamp: atk-api.xml gdk-api.xml gdk-symbols.xml gtk-api.xml gtk-symbols.xml pango-api.xml ../generator/codegen.exe - ../generator/codegen --generate atk-api.xml gdk-api.xml gdk-symbols.xml gtk-api.xml gtk-symbols.xml pango-api.xml +generated-stamp: atk-api.xml gdk-api.xml gdk-symbols.xml gtk-api.xml gtk-symbols.xml pango-api.xml glade-api.xml ../generator/codegen.exe + ../generator/codegen --generate atk-api.xml gdk-api.xml gdk-symbols.xml gtk-api.xml gtk-symbols.xml pango-api.xml glade-api.xml touch generated-stamp diff --git a/glue/makefile.win32 b/glue/makefile.win32 index df58e4b24..8807bf940 100755 --- a/glue/makefile.win32 +++ b/glue/makefile.win32 @@ -1,5 +1,5 @@ -GTK_CFLAGS=`pkg-config --cflags gtk+-win32-2.0` -GTK_LIBS=`pkg-config --libs gtk+-win32-2.0` +GTK_CFLAGS=`pkg-config --cflags gtk+-win32-2.0 libglade-2.0` +GTK_LIBS=`pkg-config --libs gtk+-win32-2.0 libglade-2.0` CC=gcc -mno-cygwin DLLWRAP=dllwrap -mno-cygwin --target i386-mingw32 --export-all-symbols @@ -22,6 +22,7 @@ GLUE_OBJS = \ type.o \ value.o \ widget.o \ + gladexml.o \ win32dll.o all: gtksharpglue.dll diff --git a/makefile.win32 b/makefile.win32 index 1e66a11f0..65dfaf37c 100755 --- a/makefile.win32 +++ b/makefile.win32 @@ -1,4 +1,4 @@ -DIRS=glue generator api glib pango atk gdk gtk sample +DIRS=glue generator api glib pango atk gdk gtk glade ROOT=/cygdrive/$(subst \,/,$(subst :\,/,$(SYSTEMROOT))) CSC=$(ROOT)/microsoft.net/framework/v1.0.3705/csc.exe /d:WIN32 @@ -9,6 +9,20 @@ windows: (cd $$i; CSC="$(CSC)" make -f makefile.win32) || exit 1;\ done; +clean: + rm -f api/generated-stamp + rm -rf lib + find -iname "*.exe" -exec rm -f \{\} \; + find -iname "*.dll" -exec rm -f \{\} \; + + for i in $(DIRS); do \ + rm -rf $$i/generated; \ + done; + +release: clean windows + mkdir lib + find $(DIRS) -iname "*.dll" -exec cp \{\} lib \; + docs: for i in $(DIRS); do \ (cd $$i; CSC="$(CSC)" make -f makefile.win32 docs) || exit 1;\ diff --git a/sample/GladeTest.cs b/sample/GladeTest.cs index b925a7c3e..8c5017153 100644 --- a/sample/GladeTest.cs +++ b/sample/GladeTest.cs @@ -8,29 +8,31 @@ namespace GladeSamples { using System; using Gtk; - using Gnome; using Glade; using GtkSharp; - using System.IO; - using System.Reflection; - public class GladeTest : Program + public class GladeTest { - [Glade.Widget("main_window")] + [Glade.Widget] Gtk.Window main_window; public static void Main (string[] args) { - new GladeTest (args).Run (); + Application.Init (); + + GladeTest gt = new GladeTest (); + + Application.Run (); } - public GladeTest (string[] args, params object[] props) - : base ("GladeTest", "0.1", Modules.UI, args, props) + + public GladeTest () { /* Note that we load the XML info from the assembly instead of using an external file. You don't have to distribute the .glade file if you don't want */ Glade.XML gxml = new Glade.XML (null, "test.glade", "main_window", null); gxml.Autoconnect (this); + if (main_window != null) Console.WriteLine ("Main Window Title: \"{0}\"", main_window.Title); else @@ -39,7 +41,7 @@ namespace GladeSamples { public void OnWindowDeleteEvent (object o, DeleteEventArgs args) { - Quit (); + Application.Quit (); args.RetVal = true; } diff --git a/sample/GladeViewer.cs b/sample/GladeViewer.cs index cf3e80682..2bd9901d3 100644 --- a/sample/GladeViewer.cs +++ b/sample/GladeViewer.cs @@ -6,10 +6,8 @@ namespace GladeSamples { using System; - using System.Runtime.InteropServices; using Gtk; - using Gnome; using Glade; public class GladeDemo { @@ -17,11 +15,11 @@ namespace GladeSamples { public static void Main (string[] args) { if (args.Length < 2) { - Console.WriteLine ("Use: mono ./glade-viewer.exe \"fname\" \"root\""); + Console.WriteLine ("Use: ./glade-viewer.exe \"fname\" \"root\""); return; } - Program viewer = new Program ("GladeViewer", "0.1", Modules.UI, args); + Application.Init (); string fname = args [0]; string root = args [1]; @@ -34,7 +32,7 @@ namespace GladeSamples { Console.WriteLine ("A relative filename: {0}", gxml.RelativeFile ("image.png")); Console.WriteLine ("The name of the root widget: {0}", Glade.XML.GetWidgetName (wid)); - Console.WriteLine ("BTW, it's {0} that it was created using from a Glade.XML object", + Console.WriteLine ("It is {0} that it was created using a Glade.XML object", Glade.XML.GetWidgetTree (wid) != null); Console.WriteLine ("\nList of created widgets:"); @@ -45,7 +43,7 @@ namespace GladeSamples { Glade.XML.GetWidgetName (w)); } - viewer.Run (); + Application.Run (); } }