From 7f3171c814f60845dab5019b25b23f9dd2570fb0 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Fri, 29 Oct 2004 20:33:07 +0000 Subject: [PATCH] merge to HEAD of jeroen and friends' work on the 2-4 branch. HEAD is now tracking Gnome 2.6. svn path=/trunk/gtk-sharp/; revision=35479 --- ChangeLog | 558 +- Makefile.am | 8 +- art/.cvsignore | 2 +- art/Makefile.am | 8 +- art/art-sharp-2.0.pc.in | 2 +- art/art-sharp.pc.in | 9 - atk/Makefile.am | 2 +- atk/atk-api.raw | 74 + atk/atk-sharp.dll.config.in | 1 + atk/glue/Makefile.am | 12 +- atk/glue/makefile.win32 | 8 +- configure.in | 73 +- gconf/GConf.PropertyEditors/EditorShell.cs | 4 +- gconf/GConf.PropertyEditors/Makefile.am | 2 +- gconf/GConf/.cvsignore | 2 +- gconf/GConf/Makefile.am | 6 +- ...conf-sharp.pc.in => gconf-sharp-2.0.pc.in} | 2 +- gconf/tools/.cvsignore | 2 +- gconf/tools/Makefile.am | 8 +- gconf/tools/gconfsharp-schemagen.in | 2 - gconf/tools/gconfsharp2-schemagen.in | 2 + gda/.cvsignore | 2 +- gda/Makefile.am | 8 +- gda/{gda-sharp.pc.in => gda-sharp-2.0.pc.in} | 2 +- gda/gda-sharp.dll.config.in | 1 + gdk/Device.custom | 18 +- gdk/DragContext.custom | 18 +- gdk/Event.cs | 6 +- gdk/EventButton.cs | 18 +- gdk/EventClient.cs | 8 +- gdk/EventConfigure.cs | 8 +- gdk/EventCrossing.cs | 20 +- gdk/EventDND.cs | 8 +- gdk/EventExpose.cs | 6 +- gdk/EventFocus.cs | 2 +- gdk/EventKey.cs | 10 +- gdk/EventMotion.cs | 18 +- gdk/EventProperty.cs | 6 +- gdk/EventProximity.cs | 4 +- gdk/EventScroll.cs | 16 +- gdk/EventSelection.cs | 10 +- gdk/EventSetting.cs | 4 +- gdk/EventVisibility.cs | 2 +- gdk/EventWindowState.cs | 4 +- gdk/Gdk.metadata | 3 +- gdk/Global.custom | 12 +- gdk/Makefile.am | 2 +- gdk/Pixbuf.custom | 65 +- gdk/Selection.custom | 6 +- gdk/gdk-api.raw | 790 ++- gdk/glue/Makefile.am | 12 +- gdk/glue/makefile.win32 | 8 +- generator/.cvsignore | 2 +- generator/BoxedGen.cs | 4 +- generator/ClassBase.cs | 21 +- generator/ClassGen.cs | 4 +- generator/Makefile.am | 6 +- generator/Method.cs | 33 +- generator/ObjectGen.cs | 6 +- generator/Parser.cs | 3 +- generator/gapi-codegen.in | 2 - generator/gapi2-codegen.in | 2 + glade/.cvsignore | 2 +- glade/Makefile.am | 8 +- glade/XML.custom | 2 +- glade/glade-api.raw | 2 +- ...lade-sharp.pc.in => glade-sharp-2.0.pc.in} | 4 +- glade/glue/Makefile.am | 12 +- glade/glue/makefile.win32 | 8 +- glib/GException.cs | 2 +- glib/List.cs | 4 +- glib/Marshaller.cs | 4 +- glib/Object.cs | 14 +- glib/ObjectManager.cs | 8 +- glib/SList.cs | 4 +- glib/Value.cs | 9 +- glib/ValueArray.cs | 4 +- glib/glue/Makefile.am | 12 +- glib/glue/makefile.win32 | 8 +- glib/glue/value.c | 14 - gnome/.cvsignore | 2 +- gnome/Canvas.custom | 2 +- gnome/CanvasItem.custom | 22 +- gnome/CanvasPoints.custom | 2 +- gnome/Gnome.metadata | 5 +- gnome/IconData.cs | 56 + gnome/IconTheme.cs | 68 + gnome/Makefile.am | 11 +- gnome/PrintContext.custom | 272 + gnome/Program.custom | 2 +- gnome/glue/Makefile.am | 12 +- gnome/gnome-api.raw | 1219 ++++- ...nome-sharp.pc.in => gnome-sharp-2.0.pc.in} | 4 +- gnomedb/.cvsignore | 2 +- gnomedb/Makefile.am | 8 +- ...db-sharp.pc.in => gnomedb-sharp-2.0.pc.in} | 2 +- gnomedb/gnomedb-sharp.dll.config.in | 1 + gnomevfs/.cvsignore | 10 + gnomevfs/AssemblyInfo.cs.in | 6 + gnomevfs/Async.cs | 99 + gnomevfs/AsyncCallback.cs | 12 + gnomevfs/AsyncCallbackNative.cs | 31 + gnomevfs/AsyncReadCallback.cs | 14 + gnomevfs/AsyncReadCallbackNative.cs | 34 + gnomevfs/AsyncWriteCallback.cs | 12 + gnomevfs/AsyncWriteCallbackNative.cs | 34 + gnomevfs/FileInfo.cs | 318 ++ gnomevfs/Gnomevfs.metadata | 113 + gnomevfs/Handle.cs | 27 + gnomevfs/Makefile.am | 88 + gnomevfs/Mime.cs | 85 + gnomevfs/MimeActionType.cs | 16 + gnomevfs/MimeType.cs | 133 + gnomevfs/Monitor.cs | 104 + gnomevfs/OpenMode.cs | 17 + gnomevfs/Result.cs | 60 + gnomevfs/SeekPosition.cs | 16 + gnomevfs/Sync.cs | 143 + gnomevfs/Uri.custom | 29 + gnomevfs/Vfs.cs | 134 + gnomevfs/VfsStream.cs | 630 +++ gnomevfs/VfsStreamAsyncResult.cs | 81 + gnomevfs/VolumeMonitor.custom | 21 + gnomevfs/Xfer.cs | 93 + gnomevfs/XferProgressCallback.cs | 12 + gnomevfs/XferProgressCallbackNative.cs | 31 + gnomevfs/gnome-vfs-sharp-2.0.pc.in | 9 + gnomevfs/gnome-vfs-sharp.dll.config.in | 3 + gnomevfs/gnomevfs-api.raw | 1320 +++++ gnomevfs/gnomevfs-symbols.xml | 5 + gtk-sharp.pub | Bin 160 -> 0 bytes gtk/Accel.custom | 88 + gtk/Action.custom | 25 + gtk/Adjustment.custom | 80 +- gtk/Button.custom | 4 +- gtk/CellRenderer.custom | 12 +- gtk/Clipboard.custom | 8 +- gtk/ColorSelectionDialog.custom | 8 +- gtk/Combo.custom | 4 +- gtk/ComboBox.custom | 26 + gtk/Container.custom | 10 +- gtk/Dialog.custom | 4 +- gtk/FileChooserDialog.custom | 15 + gtk/FileSelection.custom | 34 +- gtk/FileSystemModel.custom | 59 + gtk/Gtk.metadata | 38 +- gtk/IconTheme.custom | 52 + gtk/InputDialog.custom | 4 +- gtk/Layout.custom | 2 +- gtk/Makefile.am | 10 +- gtk/NodeStore.cs | 14 +- gtk/Object.custom | 4 +- gtk/SelectionData.custom | 12 +- gtk/Style.custom | 54 +- gtk/TextBuffer.custom | 1 + gtk/TextIter.custom | 2 +- gtk/TreeModelFilter.custom | 59 + gtk/{Paned.custom => UIManager.custom} | 32 +- gtk/Widget.custom | 18 +- gtk/glue/Makefile.am | 12 +- gtk/glue/adjustment.c | 88 - gtk/glue/makefile.win32 | 8 +- gtk/glue/widget.c | 3 + gtk/gtk-api.raw | 4604 ++++++++++++++++- gtkhtml/.cvsignore | 2 +- gtkhtml/Makefile.am | 8 +- ...ml-sharp.pc.in => gtkhtml-sharp-2.0.pc.in} | 4 +- gtkhtml/gtkhtml-sharp.dll.config.in | 1 + panelapplet/.cvsignore | 10 + panelapplet/AppletFactory.cs | 36 + panelapplet/AssemblyInfo.cs.in | 6 + panelapplet/BonoboUIVerb.cs | 25 + panelapplet/Makefile.am | 72 + panelapplet/PanelApplet.cs | 8 + panelapplet/PanelApplet.custom | 20 + panelapplet/PanelApplet.metadata | 7 + panelapplet/glue/.cvsignore | 8 + panelapplet/glue/Makefile.am | 18 + panelapplet/glue/panelapplet.c | 29 + panelapplet/panelapplet-api.raw | 290 ++ panelapplet/panelapplet-sharp-2.0.pc.in | 10 + panelapplet/panelapplet-sharp.dll.config.in | 5 + pango/LayoutLine.custom | 6 +- pango/Makefile.am | 2 +- pango/glue/Makefile.am | 12 +- pango/glue/makefile.win32 | 8 +- pango/pango-api.raw | 251 +- pango/pango-sharp.dll.config.in | 1 + parser/.cvsignore | 3 +- parser/Makefile.am | 17 +- parser/{gapi.pc.in => gapi-2.0.pc.in} | 0 parser/gapi-fixup.in | 2 - parser/gapi.pl | 62 - parser/gapi2-fixup.in | 2 + parser/gapi2-parser.in | 3 + parser/gapi2xml.pl | 64 +- parser/{gapi-parser => gapi_parser.pl} | 0 parser/gapi_pp.pl | 30 +- rsvg/.cvsignore | 2 +- rsvg/Makefile.am | 8 +- rsvg/Rsvg.metadata | 2 +- rsvg/rsvg-api.raw | 67 +- ...{rsvg-sharp.pc.in => rsvg-sharp-2.0.pc.in} | 3 +- sample/Actions.cs | 104 + sample/CustomNotebook.cs | 643 +++ sample/GtkDemo/DemoSizeGroup.cs | 1 + sample/Makefile.am | 20 +- sample/PrintSample.cs | 8 +- sample/TestDnd.cs | 2 +- sample/TestVfs.cs | 114 + sample/gnomevfs/.cvsignore | 3 + sample/gnomevfs/Makefile.am | 69 + sample/gnomevfs/TestAsync.cs | 72 + sample/gnomevfs/TestAsyncStream.cs | 54 + sample/gnomevfs/TestInfo.cs | 27 + sample/gnomevfs/TestMime.cs | 25 + sample/gnomevfs/TestMonitor.cs | 51 + sample/gnomevfs/TestSync.cs | 44 + sample/gnomevfs/TestSyncCreate.cs | 47 + sample/gnomevfs/TestSyncStream.cs | 36 + sample/gnomevfs/TestSyncWrite.cs | 42 + sample/gnomevfs/TestUnlink.cs | 23 + sample/gnomevfs/TestVolumes.cs | 93 + sample/gnomevfs/TestXfer.cs | 164 + .../CSharpTestApplet_Factory.server | 26 + sample/panelapplet/monodoc.png | Bin 0 -> 3634 bytes sample/panelapplet/testapplet.cs | 42 + sample/test/ChangeLog | 23 + sample/test/Makefile.am | 3 - sample/test/TestSizeGroup.cs | 18 +- sample/test/WidgetViewer.cs | 6 +- sources/Makefile.am | 35 +- sources/atkhyperlink.patch | 4 + sources/gtk-sharp-sources.xml | 95 +- sources/gtk_tree_model_signal_fix.patch | 58 + vte/.cvsignore | 2 +- vte/Makefile.am | 8 +- vte/{vte-sharp.pc.in => vte-sharp-2.0.pc.in} | 4 +- vte/vte-sharp.dll.config.in | 1 + 239 files changed, 14573 insertions(+), 1410 deletions(-) delete mode 100644 art/art-sharp.pc.in rename gconf/GConf/{gconf-sharp.pc.in => gconf-sharp-2.0.pc.in} (90%) delete mode 100644 gconf/tools/gconfsharp-schemagen.in create mode 100644 gconf/tools/gconfsharp2-schemagen.in rename gda/{gda-sharp.pc.in => gda-sharp-2.0.pc.in} (70%) delete mode 100755 generator/gapi-codegen.in create mode 100755 generator/gapi2-codegen.in rename glade/{glade-sharp.pc.in => glade-sharp-2.0.pc.in} (62%) create mode 100644 gnome/IconData.cs create mode 100644 gnome/IconTheme.cs create mode 100644 gnome/PrintContext.custom rename gnome/{gnome-sharp.pc.in => gnome-sharp-2.0.pc.in} (59%) rename gnomedb/{gnomedb-sharp.pc.in => gnomedb-sharp-2.0.pc.in} (70%) create mode 100644 gnomevfs/.cvsignore create mode 100644 gnomevfs/AssemblyInfo.cs.in create mode 100644 gnomevfs/Async.cs create mode 100644 gnomevfs/AsyncCallback.cs create mode 100644 gnomevfs/AsyncCallbackNative.cs create mode 100644 gnomevfs/AsyncReadCallback.cs create mode 100644 gnomevfs/AsyncReadCallbackNative.cs create mode 100644 gnomevfs/AsyncWriteCallback.cs create mode 100644 gnomevfs/AsyncWriteCallbackNative.cs create mode 100644 gnomevfs/FileInfo.cs create mode 100644 gnomevfs/Gnomevfs.metadata create mode 100644 gnomevfs/Handle.cs create mode 100644 gnomevfs/Makefile.am create mode 100644 gnomevfs/Mime.cs create mode 100644 gnomevfs/MimeActionType.cs create mode 100644 gnomevfs/MimeType.cs create mode 100644 gnomevfs/Monitor.cs create mode 100644 gnomevfs/OpenMode.cs create mode 100644 gnomevfs/Result.cs create mode 100644 gnomevfs/SeekPosition.cs create mode 100644 gnomevfs/Sync.cs create mode 100644 gnomevfs/Uri.custom create mode 100644 gnomevfs/Vfs.cs create mode 100644 gnomevfs/VfsStream.cs create mode 100644 gnomevfs/VfsStreamAsyncResult.cs create mode 100644 gnomevfs/VolumeMonitor.custom create mode 100644 gnomevfs/Xfer.cs create mode 100644 gnomevfs/XferProgressCallback.cs create mode 100644 gnomevfs/XferProgressCallbackNative.cs create mode 100644 gnomevfs/gnome-vfs-sharp-2.0.pc.in create mode 100644 gnomevfs/gnome-vfs-sharp.dll.config.in create mode 100644 gnomevfs/gnomevfs-api.raw create mode 100644 gnomevfs/gnomevfs-symbols.xml delete mode 100644 gtk-sharp.pub create mode 100644 gtk/Action.custom create mode 100644 gtk/ComboBox.custom create mode 100644 gtk/FileChooserDialog.custom create mode 100644 gtk/FileSystemModel.custom create mode 100644 gtk/IconTheme.custom create mode 100644 gtk/TreeModelFilter.custom rename gtk/{Paned.custom => UIManager.custom} (56%) rename gtkhtml/{gtkhtml-sharp.pc.in => gtkhtml-sharp-2.0.pc.in} (62%) create mode 100644 panelapplet/.cvsignore create mode 100644 panelapplet/AppletFactory.cs create mode 100644 panelapplet/AssemblyInfo.cs.in create mode 100644 panelapplet/BonoboUIVerb.cs create mode 100644 panelapplet/Makefile.am create mode 100644 panelapplet/PanelApplet.cs create mode 100644 panelapplet/PanelApplet.custom create mode 100644 panelapplet/PanelApplet.metadata create mode 100644 panelapplet/glue/.cvsignore create mode 100644 panelapplet/glue/Makefile.am create mode 100644 panelapplet/glue/panelapplet.c create mode 100644 panelapplet/panelapplet-api.raw create mode 100644 panelapplet/panelapplet-sharp-2.0.pc.in create mode 100644 panelapplet/panelapplet-sharp.dll.config.in rename parser/{gapi.pc.in => gapi-2.0.pc.in} (100%) delete mode 100755 parser/gapi-fixup.in delete mode 100755 parser/gapi.pl create mode 100755 parser/gapi2-fixup.in create mode 100755 parser/gapi2-parser.in rename parser/{gapi-parser => gapi_parser.pl} (100%) rename rsvg/{rsvg-sharp.pc.in => rsvg-sharp-2.0.pc.in} (63%) create mode 100644 sample/Actions.cs create mode 100644 sample/CustomNotebook.cs create mode 100644 sample/TestVfs.cs create mode 100644 sample/gnomevfs/.cvsignore create mode 100644 sample/gnomevfs/Makefile.am create mode 100644 sample/gnomevfs/TestAsync.cs create mode 100644 sample/gnomevfs/TestAsyncStream.cs create mode 100644 sample/gnomevfs/TestInfo.cs create mode 100644 sample/gnomevfs/TestMime.cs create mode 100644 sample/gnomevfs/TestMonitor.cs create mode 100644 sample/gnomevfs/TestSync.cs create mode 100644 sample/gnomevfs/TestSyncCreate.cs create mode 100644 sample/gnomevfs/TestSyncStream.cs create mode 100644 sample/gnomevfs/TestSyncWrite.cs create mode 100644 sample/gnomevfs/TestUnlink.cs create mode 100644 sample/gnomevfs/TestVolumes.cs create mode 100644 sample/gnomevfs/TestXfer.cs create mode 100644 sample/panelapplet/CSharpTestApplet_Factory.server create mode 100644 sample/panelapplet/monodoc.png create mode 100644 sample/panelapplet/testapplet.cs create mode 100644 sources/atkhyperlink.patch create mode 100644 sources/gtk_tree_model_signal_fix.patch rename vte/{vte-sharp.pc.in => vte-sharp-2.0.pc.in} (62%) diff --git a/ChangeLog b/ChangeLog index a9a966679..426610cea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -48,6 +48,27 @@ * gdk/Pixmap.custom : add overloads for *CreateFromXPM* methods which default transparency mask and color. +2004-10-07 Todd Berman + + * gtk/Gtk.metadata: Mark ComboBox.GetActiveIter as an out param. + +2004-10-06 John Luke + + * gtk/Action.custom: add overload for string, string, null, null + * gtk/UIManager.custom: add overload to get the UI from a resource + * gtk/Makefile.am: add the 2 new custom files + * sample/Action.cs: remove using GtkSharp, make ui_info const, quit on Quit + +2004-10-05 Todd Berman + + * gtk/ComboBox.custom: Add SetCellDataFunc to allow you to set a + CellLayoutDataFunc on a ComboBox. + +2004-10-05 Todd Berman + + * gtk/ComboBox.custom: new file, to allow get/set access to 'model'. + * gtk/Makefile.am: add ComboBox.custom. + 2004-10-05 Mike Kestner * gtk/Gtk.metadata : hide Selection.GetTargets. @@ -55,6 +76,15 @@ Target, and Type field accessors. * gtk/glue/selectiondata.c : field accessor glue. +2004-10-04 Todd Berman + + * Merge forward patch from Miguel to fix delegate marshalling in + 1.1.1. Original Changelog follows + +2004-10-04 Todd Berman + + * */*.pc.in: Fix the Requires to use -2.0 + 2004-09-29 Mike Kestner * gtk/Gtk.metadata : hide some ellipsis methods, add pass_as attrs. @@ -101,18 +131,13 @@ * glib/Source.cs: Add new base class to hold the method to be called, and the proxy handler we use to keep references to them and avoid a collection. - Exposes a new variables that references all the active Timeouts and Idle handlers to avoid collection/ - * glib/Timeout.cs: Implement TimeoutProxy that acts as a filter to remove the proxy when the timeout is removed. - Register a TimeoutProxy when we create a timeout. - * glib/Idle.cs: Implement IdleProxy that acts as a filter to remove the proxy when the idle handler is removed. - Register an IdleProxy when we create a timeout. 2004-09-17 Mike Kestner @@ -171,6 +196,22 @@ gchar* to const-gchar*, so we do not try to modify it (call gfree). [Fixes #64421] +2004-08-27 Jeroen Zwartepoorte + + * gnomevfs/Async.cs: Add Priority enum. Add methods which take an Uri + object (similar to Sync methods). + * gnomevfs/Vfs.cs: Add Truncate bindings. + * gnomevfs/VfsStream.cs: Major fixes. Don't use the AsyncWaitHandle for + blocking until an operation has finished. Fix (a)sync reading & writing. + You either use sync/async throughout the code. Can't mix sync and async + gnome-vfs method calls (different Handle objects). + * gnomevfs/VfsStreamAsyncResult.cs: Throw NotSupportedException when + AsyncWaitHandle property is accessed. + * sample/gnomevfs/Makefile.am: New test programs. + * sample/gnomevfs/TestAsync.cs: + * sample/gnomevfs/TestAsyncStream.cs: + * sample/gnomevfs/TestSyncStream.cs: + 2004-08-26 Manuel V. Santos * gdk/Device.custom : glue to expose object fields. @@ -225,7 +266,6 @@ * gdk/PixbufLoader.custom: add Write () overload [Fixes #62681] - 2004-08-24 Larry Ewing * gdk/Pixbuf.custom : add RenderThresholdAlpha overload which defaults @@ -238,6 +278,22 @@ and mark the old int filled overload Obsolete. [Fixes #60702] +2004-08-23 Todd Berman + + * panelapplet/BonoboUIVerb.cs: + * panelapplet/ContextMenuItem.cs: + * panelapplet/Makefile.am: + * panelapplet/PanelApplet.custom: Remove the ContextMenuItem and the + need for the glue. Add BonoboUIVerb to directly call the setup_menu + function. Leave the glue library for now, as I think getting the + proper orientation stuff setup will require some glue work. + * sample/panelapplet/testapplet.cs: Update sample to reflect new + api. Need to make this installable. + +2004-08-22 Jeroen Zwartepoorte + + * gnomevfs/Makefile.am: Remove ADDITIONAL_API variable. + 2004-08-20 Mike Kestner * atk/Atk.metadata : mark an array param on Relation ctor. @@ -248,6 +304,15 @@ * gtk/TextBuffer.custom : pass -1 for the text length to some more methods. +2004-08-19 Jeroen Zwartepoorte + + * gnomevfs/Makefile.am: Add Monitor.cs. + * gnomevfs/Monitor.cs: New custom class wrapping the gnome_vfs_monitor_* + methods. + * sample/gnomevfs/Makefile.am: Added TestMonitor.cs. + * sample/gnomevfs/TestMonitor.cs: Test case for using the new Monitor + class. + 2004-08-18 John Luke * AUTHORS: fix my name @@ -276,6 +341,11 @@ * glib/Marshaller.cs : some gunichar marshal-fu. * glib/glue/unichar.c : a new glue method. +2004-08-14 Todd Berman + + * gnomevfs/VfsStream.cs: if ErrorEof is returned in Read, return 0 + instead of throwing an exception. + 2004-08-13 John Luke * gtk/Gtk.metadata: mark Gtk.StockManager.Lookup param as ref @@ -289,6 +359,44 @@ Adapted from a patch by borsanza@yahoo.es (Borja Sanchez Zamorano). [Fixes #62985] +2004-08-10 Todd Berman + + * gnomevfs/AssemblyInfo.cs.in: use the .snk, not the .pub. + +2004-08-10 Jeroen Zwartepoorte + + * glib/MainLoop.cs: + * gnomevfs/.cvsignore: + * gnomevfs/Async.cs: + * gnomevfs/FileInfo.cs: + * gnomevfs/Gnomevfs.metadata: + * gnomevfs/Makefile.am: + * gnomevfs/MimeType.cs: + * gnomevfs/Sync.cs: + * gnomevfs/Uri.custom: + * gnomevfs/VfsStream.cs: + * gnomevfs/VfsStreamAsyncResult.cs: + * gnomevfs/VolumeMonitor.custom: + * gnomevfs/Xfer.cs: + * gnomevfs/XferProgressCallback.cs: + * gnomevfs/XferProgressCallbackNative.cs: + * gnomevfs/filesize.diff: + * gnomevfs/gnomevfs-api.raw: + * sample/gnomevfs/.cvsignore: + * sample/gnomevfs/Makefile.am: + * sample/gnomevfs/TestInfo.cs: + * sample/gnomevfs/TestMime.cs: + * sample/gnomevfs/TestSync.cs: + * sample/gnomevfs/TestSyncCreate.cs: + * sample/gnomevfs/TestSyncWrite.cs: + * sample/gnomevfs/TestUnlink.cs: + * sample/gnomevfs/TestVolumes.cs: + * sample/gnomevfs/TestXfer.cs: + + Commit new gnomevfs files and samples. Also the GLib.MainLoop addition + for programs which don't want to use Gtk.Application.Run (), but still + use the GLib main loop. + 2004-08-04 Raja R Harinath * configure.in (GTKHTML): Use SOVERSION=11 for GtkHTML 3.1.18. @@ -298,6 +406,10 @@ * parser/gapi2xml.pl : char const * fixes for clahey's gsf binding. +2004-07-28 Jeroen Zwartepoorte + + * */*: merge from HEAD again. + 2004-07-24 Mike Kestner * gdk/Gdk.metadata : hide Window.Destroy. @@ -308,6 +420,11 @@ * glib/Value.cs : allow null for ctor(GLib.Object). +2004-07-18 Todd Berman + + * panelapplet/Makefile.am: We dont actually use gnome-sharp.dll, remove + it. + 2004-07-16 John Luke * gtk/Gtk.metadata: @@ -323,10 +440,133 @@ Remove unnessesary disabledefaultconstructor * gnome/PrintJob.custom: Change ctor to an overload ctor +2004-07-11 Todd Berman + + * panelapplet/ContextMenuItem.cs: New struct to hold context menu + item information. + * panelapplet/Makefile.am: added new file. + * panelapplet/PanelApplet.custom: add glue accessor to set the context + menu. + * panelapplet/glue/panelapplet.c: new glue functionality to setup a + context menu. + * sample/panelapplet/testapplet.cs: expand sample to show context menu + code. + +2004-07-10 Todd Berman + + * panelapplet/panelapplet-sharp-2.0.pc.in: fix path. + 2004-07-09 Mike Kestner * gdk/Gdk.metadata : mark gc param of Drawable.DrawPixbuf null_ok. +2004-07-09 Todd Berman + + * Makefile.am: + * configure.in: + Add panelapplet stuff to configure.in and the subdirs. + * generator/ClassBase.cs: + * generator/ObjectGen.cs: + Add a new attribute 'abstract' to allow a class to be defined to be + abstract. PanelApplet.PanelApplet uses this. + * panelapplet/.cvsignore: + * panelapplet/AppletFactory.cs: + * panelapplet/AssemblyInfo.cs.in: + * panelapplet/Makefile.am: + * panelapplet/PanelApplet.cs: + * panelapplet/PanelApplet.custom: + * panelapplet/PanelApplet.metadata: + * panelapplet/panelapplet-api.raw: + * panelapplet/panelapplet-sharp-2.0.pc.in: + * panelapplet/panelapplet-sharp.dll.config.in: + * panelapplet/glue/.cvsignore: + * panelapplet/glue/Makefile.am: + * panelapplet/glue/panelapplet.c: + Initial import of the panelapplet code. This code is largely + untested, and will need a good amount of glue. For sure glue code is + needed for the context menu items. + * sample/panelapplet/CSharpTestApplet_Factory.server: + * sample/panelapplet/monodoc.png: + * sample/panelapplet/testapplet.cs: + A small testcase for the panelapplet. There is no makefile yet, and + the server needs some help as it uses an absolute path that will only + work on my box. When I get back to Toronto (so some point this weekend) + I will fix this code to build/install properly and add a README file + to help with any potential issues. + * sources/Makefile.am: + * sources/gtk-sharp-sources.xml: + Add the panelapplet-sharp stuff to the build here. + +2004-07-06 Todd Berman + + * sources/gtk_tree_model_signal_fix.patch: duh, this is the real patch. + +2004-07-06 Todd Berman + + * sources/Makefile.am: + * sources/gtk_tree_model_signal_fix.patch: a new hacky patch to fix + the signal generation on the tree model structs. + * */*-api.raw: regen. + * glib/Object.cs: merge forward a small patch. + +2004-07-06 Todd Berman + + * Makefile.am: + * configure.in: + * gtk-sharp-2.0.pc.in: + * gtk-sharp.pc.in: + * art/.cvsignore: + * art/Makefile.am: + * art/art-sharp-2.0.pc.in: + * art/art-sharp.pc.in: + * gconf/GConf/.cvsignore: + * gconf/GConf/Makefile.am: + * gconf/GConf/gconf-sharp-2.0.pc.in: + * gconf/GConf/gconf-sharp.pc.in: + * gda/.cvsignore: + * gda/Makefile.am: + * gda/gda-sharp-2.0.pc.in: + * gda/gda-sharp.pc.in: + * glade/.cvsignore: + * glade/Makefile.am: + * glade/glade-sharp-2.0.pc.in: + * glade/glade-sharp.pc.in: + * gnome/.cvsignore: + * gnome/Makefile.am: + * gnome/gnome-sharp-2.0.pc.in: + * gnome/gnome-sharp.pc.in: + * gnomedb/.cvsignore: + * gnomedb/Makefile.am: + * gnomedb/gnomedb-sharp-2.0.pc.in: + * gnomedb/gnomedb-sharp.pc.in: + * gnomevfs/.cvsignore: + * gnomevfs/gnome-vfs-sharp-2.0.pc.in: + * gnomevfs/gnome-vfs-sharp.pc.in: + * gtkhtml/.cvsignore: + * gtkhtml/Makefile.am: + * gtkhtml/gtkhtml-sharp-2.0.pc.in: + * gtkhtml/gtkhtml-sharp.pc.in: + * rsvg/.cvsignore: + * rsvg/Makefile.am: + * rsvg/rsvg-sharp-2.0.pc.in: + * rsvg/rsvg-sharp.pc.in: + * sample/rsvg/Makefile.am: + * vte/.cvsignore: + * vte/Makefile.am: + * vte/vte-sharp-2.0.pc.in: + * vte/vte-sharp.pc.in: + Make gtk-sharp-2.0 parallel installable with gtk-sharp. Now you can + install both and do -pkg:gtk-sharp-2.0 or similar to compile against + the gtk-sharp-2.0 assemblies. + + Basically this change comprised some small configure.in changes to + change the $(PACKAGE) to gtk-sharp-2.0, and check for the appropriate + versions of the gnome 2.6 based libraries. + + Also, every .pc file was renamed -2.0.pc to allow for the parallel + install, and the .cvsignore and Makefile.am rules were updated to + reflect this change. + 2004-07-05 John Luke * sample/VteTest.cs: improve the scrolling in the sample @@ -366,26 +606,32 @@ * configure.in : tag and bump version to 0.99. -2004-06-22 Mike Kestner - - * configure.in : GLIB check for gobject, not glib. - 2004-06-23 Todd Berman * doc/*/*.xml: s/GtkSharp.SignalArgs/GLib.SignalArgs/; +2004-06-22 Mike Kestner + + * configure.in : GLIB check for gobject, not glib. + +2004-06-20 Jeroen Zwartepoorte + + * gdk/Gdk.metadata: Fix merging errors. + * gnome/CanvasItem.custom: Idem. + * gtk/Widget.custom: Idem. + +2004-06-20 Jeroen Zwartepoorte + + * *: Merge with HEAD. + 2004-06-17 Larry Ewing * gdk/Makefile.am (sources): add Pixdata.custom - * gdk/Pixdata.custom: add new file to fix Serialize. - * gnome/CanvasItem.custom: remove the incorrect custom bindings. - * gnome/Gnome.metadata: stop hiding the AffineRelative and AffineAbsolute the generator gets them right they are not out params. - * gdk/Gdk.metadata: mark the Pixdata byte stream as and array hide the broken serialize method. @@ -531,6 +777,16 @@ * configure.in (MONODOC_REQUIRED_VERSION): Fix missing 'test' in shell if statement. +2004-06-07 Jeroen Zwartepoorte + + * gtk/Widget.custom: Add the AddAccelerator method back which got + removed by accident during the last merge. + * sample/CustomNotebook.cs: New sample showing of a custom Notebook. + +2004-06-07 Jeroen Zwartepoorte + + * *: Merge with HEAD. + 2004-06-04 Todd Berman * glib/Object.cs: ConnectDefaultHandlers needs to look at public api @@ -568,10 +824,9 @@ * generator/Field.cs : add field hiding, for manual impl. * generator/StructBase.cs : support disable_new, for manual impl. -2004-06-01 Jeroen Zwartepoorte +2004-06-01 Jeroen Zwartepoorte - * sample/CustomWidget.cs: Add custom widget sample. - * sample/Makefile.am: Idem. + * sample/CustomWidget.cs: remove custom GType stuff. 2004-06-01 Mike Kestner @@ -580,11 +835,26 @@ * gtk/CellRenderer.custom : remove ctor (). * gtkhtml/Gtk.metadata : add a disable_void_ctor rule for HTML. +2004-06-01 Jeroen Zwartepoorte + + * configure.in: Merge with HEAD again. + * gdk/Gdk.metadata: + * gnome/CanvasItem.custom: + * gtk/Gtk.metadata: + * sample/.cvsignore: + * sample/CustomWidget.cs: Inherit from Gtk.Bin and make it a better + suited sample. + 2004-06-01 Mike Kestner * gtk/Gtk.metadata : mark SizeRequest requisition as out, not ref. [Fixes #59388] +2004-06-01 Jeroen Zwartepoorte + + * sample/CustomWidget.cs: Fixed Widget.SizeRequest usage. Works properly + now. + 2004-05-31 Mike Kestner * configure.in : Bump version to 0.93 and tag. @@ -598,14 +868,45 @@ 2004-05-31 Jeroen Zwartepoorte - * gdk/Gdk.metadata: fix membler names in WindowClass. + * gdk/Gdk.metadata: fix member names in WindowClass. [Fixes #59336] 2004-05-31 Jeroen Zwartepoorte - * gdk/Gdk.metadata: mark dest rects as out for Isect and Union. + * gdk/Gdk.metadata: mark dest rects as out for Intersect and Union. [Fixes #59341] +2004-05-31 Jeroen Zwartepoorte + + * gtk/Gtk.metadata: Unhide the GtkWidgetFlags enum. + * gtk/Makefile.am: Remove WidgetFlags.cs. + * gtk/WidgetFlags.cs: Obsolete. + +2004-05-31 Jeroen Zwartepoorte + + * sample/CustomWidget.cs: The Gtk.Requisition is passed by reference in + the OnSizeRequested handler. + +2004-05-31 Jeroen Zwartepoorte + + * *: Merge changes from HEAD again. + +2004-05-31 Jeroen Zwartepoorte + + * gtk/Container.custom: Merged fix for Container.Forall handler. + * gtk/Makefile.am: Added WidgetFlags.cs. + * gtk/Widget.custom: Added Flags property and setter to GdkWindow. + * gtk/WidgetFlags.cs: Enumeration of widget flags (from widget.h). + * gtk/glue/container.c: (gtksharp_container_invoke_gtk_callback): Fixes + for Container.Forall handler. + * gtk/glue/widget.c: (gtksharp_gtk_widget_set_window), + (gtksharp_gtk_widget_get_state), (gtksharp_gtk_widget_get_flags), + (gtksharp_gtk_widget_set_flags): Added new API which is needed to write + custom gtk widgets. + * parser/gapi_pp.pl: Match #if !defined (*_DISABLE_DEPRECATED) properly. + * sample/CustomWidget.cs: new sample for creating a custom Gtk widget. + * sample/Makefile.am: Added CustomWidget.cs sample. + 2004-05-29 Mike Kestner * gnome/CanvasItem.custom : for OnUpdate, Art.SVP can be NULL @@ -657,10 +958,13 @@ * gtkhtml/Gtk.metadata : hide Gtk.HTML the ctors. * gtkhtml/HTML.custom : new manual impl for ctors. * gtkhtml/Makefile.am : add new custom [Fixes #59148] - -2004-05-26 Mike Kestner - * */Makefile.am : rm -f generated/* in case it doesn't exist yet. +2004-05-25 Jeroen Zwartepoorte + + * gnome/Gnome.metadata: Don't hide the GtkEntry and GnomeEntry + properties. + * gtk/Accel.custom: Add custom methods for backwards compatibility of + the gtk_accel_map_* methods. [Fixes #58954] 2004-05-25 Dan Winship @@ -688,6 +992,22 @@ * generator/SignalHandler.cs : put back the ObjectGen hack for param wrapping. [Fixes #58876] +2004-05-23 Jeroen Zwartepoorte + + * atk/atk-api.xml: Removed. + * gdk/gdk-api.xml: Idem. + * glade/glade-api.xml: Idem. + * gnome/IconTheme.cs: s/GLibSharp/GLib/ + * gnome/gnome-api.xml: Removed. + * gtk/Adjustment.custom: Obsolete custom property code. + * gtk/glue/adjustment.c: (gtksharp_gtk_adjustment_set_bounds): Idem. + * gtk/gtk-api.xml: Removed. + * pango/pango-api.xml: Idem. + +2004-05-23 Jeroen Zwartepoorte + + Merge changes from HEAD since yesterday. + 2004-05-22 Mike Kestner * configure.in : require mono-0.91.99. Sorry, but we need to @@ -700,6 +1020,10 @@ its new internal nature. This fixes MD, gnunit, and all gnome# programs that were blowing up for no reason. +2004-05-23 Jeroen Zwartepoorte + + * *: Merge changes from HEAD again. + 2004-05-22 Radek Doulik * gtk/TreeView.custom(GetPathAtPos): change Gtk.TreeViewColumn @@ -829,6 +1153,60 @@ * gtk/ItemFactory.custom : implement ctor for subclassing. * gtk/Plug.custom : implement ctors for subclassing. +2004-05-09 Jeroen Zwartepoorte + + * gdk/Gdk.metadata: Misc fixes for getting Muine to build & run. + * gtk/FileSelection.custom: Add this back. + * gtk/Gtk.metadata: Misc fixes for getting Muine to build & run. + +2004-05-08 Jeroen Zwartepoorte + + * gconf/GConf.PropertyEditors/Makefile.am: Reinclude the OptionMenu + property editor. + * gdk/Gdk.metadata: + * gdk/Pixbuf.custom: Add backwards compatible implementations of + GetFromDrawable, RenderPixmapAndMask and a couple of others which are + now static in gtk+ 2.4. These methods have the same API as the ones + generate for gtk+ 2.2. + * gdk/gdk-api.raw: + * generator/ClassBase.cs: Generate an [Obsolete] tag for deprecated + code. + * generator/ClassGen.cs: Idem. + * generator/Method.cs: Idem. + * generator/ObjectGen.cs: Idem. + * gnome/Gnome.metadata: + * gnome/IconData.cs: + * gnome/IconTheme.cs: GnomeIconTheme inherits directly from GtkIconTheme + in libgnomeui-2.6. This breaks the parser, so it won't generate the + proper code. This is a manual class implementation for backward + compatibility with gtk+ 2.2 version of gtk#. + * gnome/IconTheme.custom: Removed + * gnome/Makefile.am: + * gnome/gnome-api.raw: + * gtk/Gtk.metadata: + * gtk/IconTheme.custom: Added custom methods previously found in + ../gnome/IconTheme.custom. + * gtk/gtk-api.raw: + * pango/pango-api.raw: + * parser/gapi2xml.pl: Check for "deprecated" prefixes and add a + deprecated attribute to the appropriate elements when found. + * parser/gapi_pp.pl: Prefix everything that's in a #ifndef + *_DISABLE_DEPRECATED block with "deprecated". + * sample/GtkDemo/DemoMain.cs: s/File/System.IO.File/ since there's now + also a Gtk.File class. + * sample/GtkDemo/DemoSizeGroup.cs: Use the original OptioMenu code. + * sample/GtkDemo/DemoTextView.cs: s/File/System.IO.File/. + * sample/Makefile.am: + * sources/gtk-sharp-sources.xml: Add a bunch of s to the Gtk + namespace so it won't generate API for _really_ old deprecated widgets + like GtkCList, GtkCTree etc. + + This commit adds support for deprecated widgets to gtk#. This is + necessary since some widgets have been deprecated from gtk+ 2.2->2.4, + but are still in use (any program that uses Gtk.OptionMenu, Gtk.Combo + and methods in Gtk.Toolbar to name a few). This is done in C# by using + the [Obsolete] metadata tag. + 2004-05-07 Todd Berman * gnome/Makefile.am: add DruidPageEdge.custom @@ -989,6 +1367,32 @@ * configure.in : bump version for cvs. +2004-05-06 Jeroen Zwartepoorte + + * Makefile.in: + * configure.in: + * gconf/GConf.PropertyEditors/Makefile.in: + * glade/Makefile.in: + * gnomevfs/.cvsignore: + * gnomevfs/AssemblyInfo.cs.in: + * gnomevfs/Makefile.am: + * gnomevfs/Makefile.in: + * gnomevfs/gnome-vfs-sharp.dll.config.in: + * gnomevfs/gnome-vfs-sharp.pc.in: + * sample/Actions.cs: Remove System.Drawing.Size usage. + * sample/Makefile.am: Added actions.exe. + * sample/Makefile.in: + + Remove obsolete Makefile.in files from the repository. Auto*ify the + gnomevfs assembly. + +2004-05-06 Jeroen Zwartepoorte + + Merge changes from HEAD to the jeroen-gtk-2-4 branch. The correct + gnome 2.6.0 & gtk+-2.4.1 sources are now also downloaded when you run + "make get-source-code". Some samples are disabled for now since they + use deprecated API and fail to build. + 2004-05-05 Mike Kestner * generator/BoxedGen.cs : remove g_value_init DllImport and change @@ -1018,11 +1422,11 @@ gnome/CanvasProxy.cs : ditto gnome/void*Signal.cs : ditto -2004-05-04 Mike Kestner +2004-05-05 Mike Kestner * sample/gconf/Makefile.am : fix some whitespace. I love you, auto*. -2004-05-04 Mike Kestner +2004-05-05 Mike Kestner * configure.in : fix gtkhtml versioning *again*. * sample/gconf/Makefile.am : conditional build on ENABLE_GNOME. @@ -1386,6 +1790,14 @@ * sample/Makefile.am: small resource build fix for glade-test.exe +2004-03-27 Jeroen Zwartepoorte + + * gnomevfs/Mime.cs: + * gnomevfs/MimeActionType.cs: + * gnomevfs/Vfs.cs: + + Implemented more gnome-vfs methods. + 2004-03-25 Mike Kestner * gtk/Gtk.metadata : Widget.Events is a Gdk.EventMask, not int @@ -1479,6 +1891,28 @@ * parser/gapi-fixup.in: * generator/gapi-codegen.in: s/@MONO@/@RUNTIME@ +2004-03-14 Jeroen Zwartepoorte + + * Makefile.in: + * configure.in: + * gnomevfs/AsyncCallback.cs: + * gnomevfs/AsyncCallbackNative.cs: + * gnomevfs/AsyncReadCallback.cs: + * gnomevfs/AsyncReadCallbackNative.cs: + * gnomevfs/AsyncWriteCallback.cs: + * gnomevfs/AsyncWriteCallbackNative.cs: + * gnomevfs/Handle.cs: + * gnomevfs/Makefile.in: + * gnomevfs/OpenMode.cs: + * gnomevfs/Result.cs: + * gnomevfs/SeekPosition.cs: + * gnomevfs/Vfs.cs: + * sample/Makefile.in: + * sample/TestVfs.cs: + + Added partial gnome-vfs bindings. Necessary now that can Gtk.FileChooser + return gnome-vfs uris. + 2004-03-12 Mike Kestner * */Makefile.am : automakify the build @@ -1503,7 +1937,6 @@ * glue/Makefile.am: * glue/makefile.win32: * glue/thread-notify.c: dropped. - * gtk/ThreadNotify.cs: use just Idle.Add, which is what the deprecated gda_input_add does. No more P/Invoke here. @@ -1511,13 +1944,43 @@ * glue/Makefile.am: * glue/makefile.win32: added thread-notify.o - * glue/thread-notify.c: handles pipe creation/read/write/close for ThreadNotify. - * gtk/ThreadNotify.cs: P/Invoke the thread-notify code instead of libc functions. +2004-02-29 Jeroen Zwartepoorte + + * gtk/FileChooserDialog.custom: Implement the + gtk_file_chooser_dialog_new constructor by hand. + +2004-02-28 Jeroen Zwartepoorte + + * gtk/Gtk.metadata: Rename some AddAction* methods to just Add*. + +2004-02-28 Jeroen Zwartepoorte + + * glib/Value.cs: Work around a GLib.Value having a null string (#54979). + * sample/Actions.cs: Updated. + * sample/Makefile.in: Added the action sample. + +2004-02-28 Jeroen Zwartepoorte + + * gdk/gdk-api.xml: Updated to latest CVS. + * gnome/gnome-api.xml: Idem. + * gtk/gtk-api.xml: Idem. + * pango/pango-api.xml: Idem. + * sample/Makefile.in: Don't build the gconf sample for now. + +2004-02-28 Jeroen Zwartepoorte + + * gnome/PrintContext.custom: Added gnome_print_context_* methods. + * gtk/gtk-api.xml: Hide GtkActionEntry C-specific struct and methods. + * sample/Actions.cs: Updated. + * sample/Makefile.in: Reinclude print sample. + * sample/PrintSample.cs: Updated. + * sample/TestDnd.cs: Updated. + 2004-02-26 Mike Kestner * configure.in : tagged 0.17 and bumped cvs version. @@ -1747,12 +2210,6 @@ * gdk/*.custom : manually wrap GList api using typed arrays * gdk/gdk-api.xml : regen. -2004-02-12 Mike Kestner - - * gdk/Gdk.metadata : hide the GSList API - * gdk/*.custom : manually wrap GSList api using typed arrays - * gdk/gdk-api.xml : regen. - 2004-02-12 Mike Kestner * gtk/Accel.custom : s/List/SList @@ -1764,6 +2221,35 @@ * glib/time_t_CustomMarshaler.cs: Update after custom marshaling changes. +2004-02-12 Jeroen Zwartepoorte + + * gtk/Gtk.metadata: Hide the various *ActionEntry classes since + they're only meant to be used in C code. + +2004-02-11 Jeroen Zwartepoorte + + * atk/atk-api.xml: + * gconf/GConf.PropertyEditors/Makefile.in: + * gdk/Gdk.metadata: + * gdk/gdk-api.xml: + * generator/CallbackGen.cs: Set a GError pointer to IntPtr.Zero. + * gnome/Gnome.metadata: + * gnome/gnome-api.xml: + * gtk/Adjustment.custom: + * gtk/FileSelection.custom: Deprecated, removed. + * gtk/FileSystemModel.custom: + * gtk/Gtk.metadata: + * gtk/IconTheme.custom: Custom SearchPath property (fixes #51599). + * gtk/Paned.custom: Deprecated, removed. + * gtk/TreeModelFilter.custom: New class in 2.4. + * gtk/gtk-api.xml: + * pango/pango-api.xml: + * sample/Actions.cs: Added new Action API sample. + * sample/Makefile.in: Don't build some samples for now. + + Updated everything to use gtk 2.3/2.4. Some samples commented out + because they use deprecated/changed API. More work to follow. + 2004-02-11 Mike Kestner * gtk/Gtk.metadata : hide the GSList API @@ -1778,12 +2264,6 @@ * gtk/*.custom : return 0 length arrays, not null. -2004-02-11 Mike Kestner - - * gtk/Gtk.metadata : hide the GList API - * gtk/*.custom : manually wrap GList api using typed arrays - * gtk/gtk-api.xml : regen. - 2004-02-10 Mike Kestner * gconf/GConf.PropertyEditors/PropertyEditorColorPicker.cs : diff --git a/Makefile.am b/Makefile.am index e38145c6a..fbb1a4873 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,10 @@ -SUBDIRS = sources generator parser glib pango atk gdk gtk glade art gnome gda gnomedb gtkhtml gconf rsvg vte sample doc +SUBDIRS = sources generator parser glib pango atk gdk gtk glade art gnomevfs gnome gda gnomedb gtkhtml gconf rsvg vte panelapplet sample doc pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gtk-sharp.pc +pkgconfig_DATA = gtk-sharp-2.0.pc EXTRA_DIST = \ - gtk-sharp.pc.in \ + gtk-sharp-2.0.pc.in \ gtk-sharp.snk \ makefile.win32 \ ChangeLog \ @@ -12,5 +12,5 @@ EXTRA_DIST = \ README \ README.generator -DISTCLEANFILES = gtk-sharp.pc +DISTCLEANFILES = gtk-sharp-2.0.pc diff --git a/art/.cvsignore b/art/.cvsignore index c4d65272e..f6c52116e 100755 --- a/art/.cvsignore +++ b/art/.cvsignore @@ -1,4 +1,4 @@ -art-sharp.pc +*.pc AssemblyInfo.cs *.dll *.dll.config diff --git a/art/Makefile.am b/art/Makefile.am index 42921021a..1354b1b15 100644 --- a/art/Makefile.am +++ b/art/Makefile.am @@ -2,7 +2,7 @@ if ENABLE_LIBART TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) $(ADDITIONAL_API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = art-sharp.pc +pkgconfig_DATA = art-sharp-2.0.pc else TARGET = APIS = @@ -16,12 +16,12 @@ ASSEMBLY_NAME = art-sharp references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -apidir = $(datadir)/gapi +apidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) api_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = art-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = art-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = @@ -41,7 +41,7 @@ EXTRA_DIST = \ $(METADATA) \ $(dist_customs) \ $(dist_sources) \ - art-sharp.pc.in + art-sharp-2.0.pc.in $(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/art/art-sharp-2.0.pc.in b/art/art-sharp-2.0.pc.in index bdb1a2744..08ad44ca5 100644 --- a/art/art-sharp-2.0.pc.in +++ b/art/art-sharp-2.0.pc.in @@ -6,4 +6,4 @@ libdir=${exec_prefix}/lib Name: Art# Description: Art# - libart .NET Binding Version: @VERSION@ -Libs: -r:${libdir}/mono/@PACKAGE@/art-sharp.dll +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/art-sharp.dll diff --git a/art/art-sharp.pc.in b/art/art-sharp.pc.in deleted file mode 100644 index bdb1a2744..000000000 --- a/art/art-sharp.pc.in +++ /dev/null @@ -1,9 +0,0 @@ -prefix=@prefix@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib - - -Name: Art# -Description: Art# - libart .NET Binding -Version: @VERSION@ -Libs: -r:${libdir}/mono/@PACKAGE@/art-sharp.dll diff --git a/atk/Makefile.am b/atk/Makefile.am index 9268e70d6..fd97b3ec3 100644 --- a/atk/Makefile.am +++ b/atk/Makefile.am @@ -8,7 +8,7 @@ references = /r:../glib/glib-sharp.dll TARGET = $(ASSEMBLY) ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(ASSEMBLY) $(ASSEMBLY).config gapi_DATA = $(API) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) glue/generated.c gtk-sharp.snk diff --git a/atk/atk-api.raw b/atk/atk-api.raw index a3dfed8a9..a0515c5f7 100644 --- a/atk/atk-api.raw +++ b/atk/atk-api.raw @@ -42,6 +42,7 @@ + @@ -119,6 +120,8 @@ + + @@ -152,6 +155,7 @@ + @@ -194,6 +198,12 @@ + + + + + + @@ -433,6 +443,13 @@ + + + + + + + @@ -839,6 +856,21 @@ + + + + + + + + + + + + + + + @@ -876,6 +908,15 @@ + + + + + + + + + @@ -994,6 +1035,16 @@ + + + + + + + + + + @@ -1049,6 +1100,9 @@ + + + @@ -1062,6 +1116,7 @@ + @@ -1099,6 +1154,8 @@ + + @@ -1351,6 +1408,8 @@ + + @@ -1536,6 +1595,18 @@ + + + + + + + + + + + + @@ -1560,6 +1631,9 @@ + + + diff --git a/atk/atk-sharp.dll.config.in b/atk/atk-sharp.dll.config.in index 9488c8629..32f431fee 100644 --- a/atk/atk-sharp.dll.config.in +++ b/atk/atk-sharp.dll.config.in @@ -1,3 +1,4 @@ + diff --git a/atk/glue/Makefile.am b/atk/glue/Makefile.am index 0293957e8..fdf65430e 100644 --- a/atk/glue/Makefile.am +++ b/atk/glue/Makefile.am @@ -1,20 +1,20 @@ -lib_LTLIBRARIES = libatksharpglue.la +lib_LTLIBRARIES = libatksharpglue-2.0.la -libatksharpglue_la_LDFLAGS = -module -avoid-version -no-undefined +libatksharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined -libatksharpglue_la_SOURCES = \ +libatksharpglue_2_0_la_SOURCES = \ generated.c \ vmglueheaders.h # Adding a new glue file? # Please remember to update makefile.win32 -libatksharpglue_la_LIBADD = $(BASE_DEPENDENCIES_LIBS) +libatksharpglue_2_0_la_LIBADD = $(BASE_DEPENDENCIES_LIBS) INCLUDES = $(BASE_DEPENDENCIES_CFLAGS) -I$(top_srcdir) -libatksharpglue.dll: $(libatksharpglue_la_OBJECTS) libatksharpglue.rc libatksharpglue.def - ./build-dll libatksharpglue $(VERSION) +libatksharpglue.dll: $(libatksharpglue_2_0_la_OBJECTS) libatksharpglue.rc libatksharpglue.def + ./build-dll libatksharpglue-2.0 $(VERSION) CLEANFILES = lib*.a lib*.dll diff --git a/atk/glue/makefile.win32 b/atk/glue/makefile.win32 index 7f4ca4da2..61b57ac0e 100755 --- a/atk/glue/makefile.win32 +++ b/atk/glue/makefile.win32 @@ -7,16 +7,16 @@ GLUE_OBJS = \ generated.o \ win32dll.o -all: atksharpglue.dll +all: atksharpglue-2.0.dll %.o: %.c $(CC) -c $(CFLAGS) $(GTK_CFLAGS) -o $@ $^ -atksharpglue.dll: $(GLUE_OBJS) - $(DLLWRAP) --output-lib=libatksharpglue.a --dllname=atksharpglue.dll --driver-name=gcc --output-def=atksharpglue.def $(GLUE_OBJS) $(GTK_LIBS) +atksharpglue-2.0.dll: $(GLUE_OBJS) + $(DLLWRAP) --output-lib=libatksharpglue-2.0.a --dllname=atksharpglue-2.0.dll --driver-name=gcc --output-def=atksharpglue.def $(GLUE_OBJS) $(GTK_LIBS) clean: - rm -f atksharpglue.dll *.o libatksharpglue.a + rm -f atksharpglue-2.0.dll *.o libatksharpglue-2.0.a diff --git a/configure.in b/configure.in index 73bced273..0209b57ca 100644 --- a/configure.in +++ b/configure.in @@ -2,12 +2,15 @@ AC_INIT(README) AC_CANONICAL_SYSTEM AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(gtk-sharp, 1.0.2) +AM_INIT_AUTOMAKE(gtk-sharp, 1.9.0) AM_MAINTAINER_MODE -API_VERSION=1.0.0.0 +API_VERSION=2.0.0.0 AC_SUBST(API_VERSION) +PACKAGE_VERSION=gtk-sharp-2.0 +AC_SUBST(PACKAGE_VERSION) + AC_CHECK_TOOL(CC, gcc, gcc) AC_PROG_CC AM_PROG_CC_STDC @@ -60,11 +63,11 @@ AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir], fi ) -MONO_REQUIRED_VERSION=0.96 +MONO_REQUIRED_VERSION=1.0 PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false) if test "x$has_mono" = "xtrue"; then -GACUTIL_FLAGS='/package $(PACKAGE) /gacdir $(libdir)' +GACUTIL_FLAGS='/package $(PACKAGE_VERSION) /gacdir $(DESTDIR)$(libdir)' GENERATED_SOURCES=generated/*.cs AC_PATH_PROG(RUNTIME, mono, no) AC_PATH_PROG(CSC, mcs, no) @@ -107,15 +110,15 @@ AC_SUBST(LIB_PREFIX) AC_SUBST(LIB_SUFFIX) AC_SUBST(GENERATED_SOURCES) -PKG_CHECK_MODULES(GLIB, gobject-2.0) +PKG_CHECK_MODULES(GLIB, gobject-2.0 >= 2.4) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) -PKG_CHECK_MODULES(PANGO, pango) +PKG_CHECK_MODULES(PANGO, pango >= 1.4) AC_SUBST(PANGO_CFLAGS) AC_SUBST(PANGO_LIBS) -PKG_CHECK_MODULES(GTK, gtk+-2.0) +PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) @@ -124,10 +127,11 @@ AC_SUBST(XML_CFLAGS) AC_SUBST(XML_LIBS) ## Versions of dependencies -GNOME_REQUIRED_VERSION=2.2.0 -GTK_REQUIRED_VERSION=2.2.0 +GNOME_REQUIRED_VERSION=2.6.0 +GTK_REQUIRED_VERSION=2.4.0 +ART_REQUIRED_VERSION=2.3.16 -PKG_CHECK_MODULES(LIBART, libart-2.0 >= $GNOME_REQUIRED_VERSION, enable_libart=yes, enable_libart=no) +PKG_CHECK_MODULES(LIBART, libart-2.0 >= $ART_REQUIRED_VERSION, enable_libart=yes, enable_libart=no) AC_SUBST(LIBART_CFLAGS) AC_SUBST(LIBART_LIBS) @@ -135,7 +139,7 @@ PKG_CHECK_MODULES(GNOME, libgnomecanvas-2.0 >= $GNOME_REQUIRED_VERSION libgnomeu AC_SUBST(GNOME_CFLAGS) AC_SUBST(GNOME_LIBS) -GLADE_REQUIRED_VERSION=2.0.0 +GLADE_REQUIRED_VERSION=2.3.6 PKG_CHECK_MODULES(GLADE, libglade-2.0 >= $GLADE_REQUIRED_VERSION, enable_glade=yes, enable_glade=no) AC_SUBST(GLADE_CFLAGS) AC_SUBST(GLADE_LIBS) @@ -175,6 +179,11 @@ AC_SUBST(GTKHTML_SOVERSION) VTE_REQUIRED_VERSION=0.11.10 PKG_CHECK_MODULES(VTE_DEPENDENCIES, vte >= $VTE_REQUIRED_VERSION, enable_vte=yes, enable_vte=no) +LIBPANEL_REQUIRED_VERSION=2.6 +PKG_CHECK_MODULES(LIBPANEL, libpanelapplet-2.0 >= $LIBPANEL_REQUIRED_VERSION, enable_panel=yes, enable_panel=no) +AC_SUBST(LIBPANEL_CFLAGS) +AC_SUBST(LIBPANEL_LIBS) + AM_CONDITIONAL(ENABLE_LIBART, test "x$enable_libart" = "xyes") AM_CONDITIONAL(ENABLE_GNOME, test "x$enable_gnome" = "xyes") AM_CONDITIONAL(ENABLE_GLADE, test "x$enable_glade" = "xyes") @@ -183,6 +192,8 @@ AM_CONDITIONAL(ENABLE_GNOMEDB, test "x$enable_gnomedb" = "xyes") AM_CONDITIONAL(ENABLE_RSVG, test "x$enable_rsvg" = "xyes") AM_CONDITIONAL(ENABLE_GTKHTML, test "x$enable_gtkhtml" = "xyes") AM_CONDITIONAL(ENABLE_VTE, test "x$enable_vte" = "xyes") +AM_CONDITIONAL(ENABLE_PANEL, test "x$enable_panel" = "xyes") +AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_monodoc" = "xyes") AC_SUBST(CFLAGS) @@ -190,8 +201,11 @@ AC_SUBST(CFLAGS) AC_OUTPUT([ sources/Makefile parser/Makefile +parser/gapi-2.0.pc +parser/gapi2-fixup +parser/gapi2-parser generator/Makefile -generator/gapi-codegen +generator/gapi2-codegen glib/Makefile glib/AssemblyInfo.cs glib/glib-sharp.dll.config @@ -206,7 +220,7 @@ atk/atk-sharp.dll.config art/Makefile art/AssemblyInfo.cs art/art-sharp.dll.config -art/art-sharp.pc +art/art-sharp-2.0.pc gdk/Makefile gdk/AssemblyInfo.cs gdk/gdk-sharp.dll.config @@ -218,56 +232,64 @@ gtk/glue/Makefile glade/Makefile glade/AssemblyInfo.cs glade/glade-sharp.dll.config -glade/glade-sharp.pc +glade/glade-sharp-2.0.pc glade/glue/Makefile gnome/Makefile gnome/AssemblyInfo.cs gnome/gnome-sharp.dll.config -gnome/gnome-sharp.pc +gnome/gnome-sharp-2.0.pc gnome/glue/Makefile +gnomevfs/Makefile +gnomevfs/AssemblyInfo.cs +gnomevfs/gnome-vfs-sharp.dll.config +gnomevfs/gnome-vfs-sharp-2.0.pc gda/Makefile gda/AssemblyInfo.cs gda/gda-sharp.dll.config -gda/gda-sharp.pc +gda/gda-sharp-2.0.pc gnomedb/Makefile gnomedb/AssemblyInfo.cs gnomedb/gnomedb-sharp.dll.config -gnomedb/gnomedb-sharp.pc +gnomedb/gnomedb-sharp-2.0.pc gconf/Makefile gconf/doc/Makefile gconf/GConf/Makefile gconf/GConf/AssemblyInfo.cs gconf/GConf/gconf-sharp.dll.config -gconf/GConf/gconf-sharp.pc +gconf/GConf/gconf-sharp-2.0.pc gconf/GConf.PropertyEditors/Makefile gconf/GConf.PropertyEditors/AssemblyInfo.cs gconf/tools/Makefile -gconf/tools/gconfsharp-schemagen +gconf/tools/gconfsharp2-schemagen gtkhtml/Makefile gtkhtml/AssemblyInfo.cs gtkhtml/gtkhtml-sharp.dll.config -gtkhtml/gtkhtml-sharp.pc +gtkhtml/gtkhtml-sharp-2.0.pc rsvg/Makefile rsvg/AssemblyInfo.cs rsvg/rsvg-sharp.dll.config -rsvg/rsvg-sharp.pc +rsvg/rsvg-sharp-2.0.pc vte/Makefile vte/AssemblyInfo.cs vte/vte-sharp.dll.config -vte/vte-sharp.pc +vte/vte-sharp-2.0.pc +panelapplet/Makefile +panelapplet/AssemblyInfo.cs +panelapplet/panelapplet-sharp.dll.config +panelapplet/panelapplet-sharp-2.0.pc +panelapplet/glue/Makefile doc/Makefile doc/updater/Makefile sample/GtkDemo/Makefile sample/Makefile sample/gconf/Makefile +sample/gnomevfs/Makefile sample/pixmaps/Makefile sample/rsvg/Makefile sample/test/Makefile sample/drawing-sample.exe.config sample/cairo-sample.exe.config -gtk-sharp.pc -parser/gapi.pc -parser/gapi-fixup +gtk-sharp-2.0.pc Makefile ]) @@ -287,6 +309,7 @@ echo " * gnomedb-sharp.dll: $enable_gnomedb" echo " * rsvg-sharp.dll: $enable_rsvg " echo " * gtkhtml-sharp.dll: $enable_gtkhtml " echo " * vte-sharp.dll: $enable_vte " +echo " * panelapplet-sharp.dll: $enable_panel " echo "" echo " NOTE: if any of the above say 'no' you may install the" echo " corresponding development packages for them, rerun" diff --git a/gconf/GConf.PropertyEditors/EditorShell.cs b/gconf/GConf.PropertyEditors/EditorShell.cs index 941f8941e..a5457cc96 100644 --- a/gconf/GConf.PropertyEditors/EditorShell.cs +++ b/gconf/GConf.PropertyEditors/EditorShell.cs @@ -84,8 +84,8 @@ namespace GConf.PropertyEditors editor = new PropertyEditorToggleButton (key, (Gtk.ToggleButton) control); else if (control is Gtk.Entry) editor = new PropertyEditorEntry (key, (Gtk.Entry) control); - else if (control is Gtk.OptionMenu) - editor = new PropertyEditorOptionMenu (key, (Gtk.OptionMenu) control, enum_type, enum_values); + /*else if (control is Gtk.OptionMenu) + editor = new PropertyEditorOptionMenu (key, (Gtk.OptionMenu) control, enum_type, enum_values);*/ else throw new EditorNotSupportedException (); diff --git a/gconf/GConf.PropertyEditors/Makefile.am b/gconf/GConf.PropertyEditors/Makefile.am index 6a22813a8..9db391f04 100644 --- a/gconf/GConf.PropertyEditors/Makefile.am +++ b/gconf/GConf.PropertyEditors/Makefile.am @@ -24,7 +24,7 @@ sources = \ PropertyEditorEnum.cs \ PropertyEditorEntry.cs \ PropertyEditorFileEntry.cs \ - PropertyEditorOptionMenu.cs \ + PropertyEditorOptionMenu.cs \ PropertyEditorRadioButton.cs \ PropertyEditorSpinButton.cs \ PropertyEditorToggleButton.cs \ diff --git a/gconf/GConf/.cvsignore b/gconf/GConf/.cvsignore index 52502d94b..cb732923f 100644 --- a/gconf/GConf/.cvsignore +++ b/gconf/GConf/.cvsignore @@ -1,4 +1,4 @@ -gconf-sharp.pc +*.pc AssemblyInfo.cs Makefile Makefile.in diff --git a/gconf/GConf/Makefile.am b/gconf/GConf/Makefile.am index fc84ddfcb..8d071dbcc 100644 --- a/gconf/GConf/Makefile.am +++ b/gconf/GConf/Makefile.am @@ -1,13 +1,13 @@ if ENABLE_GNOME TARGET = $(ASSEMBLY) $(ASSEMBLY).config pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gconf-sharp.pc +pkgconfig_DATA = gconf-sharp-2.0.pc else TARGET = endif noinst_DATA = $(TARGET) CLEANFILES = $(ASSEMBLY) gtk-sharp.snk -DISTCLEANFILES = gconf-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = gconf-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs ASSEMBLY = $(ASSEMBLY_NAME).dll ASSEMBLY_NAME = gconf-sharp @@ -16,7 +16,7 @@ EXTRA_DIST = \ $(sources) \ $(ASSEMBLY).config.in \ AssemblyInfo.cs.in \ - gconf-sharp.pc.in + gconf-sharp-2.0.pc.in references = \ /r:../../glib/glib-sharp.dll diff --git a/gconf/GConf/gconf-sharp.pc.in b/gconf/GConf/gconf-sharp-2.0.pc.in similarity index 90% rename from gconf/GConf/gconf-sharp.pc.in rename to gconf/GConf/gconf-sharp-2.0.pc.in index 62803efd9..57e24cdd0 100644 --- a/gconf/GConf/gconf-sharp.pc.in +++ b/gconf/GConf/gconf-sharp-2.0.pc.in @@ -6,5 +6,5 @@ libdir=${exec_prefix}/lib Name: GConf# Description: GConf# - GConf .NET Binding Version: @VERSION@ -Requires: gnome-sharp +Requires: gnome-sharp-2.0 Libs: -r:${libdir}/mono/@PACKAGE@/gconf-sharp.dll -r:${libdir}/mono/@PACKAGE@/gconf-sharp-peditors.dll diff --git a/gconf/tools/.cvsignore b/gconf/tools/.cvsignore index f6f14de8b..8a72065c8 100644 --- a/gconf/tools/.cvsignore +++ b/gconf/tools/.cvsignore @@ -1,4 +1,4 @@ Makefile Makefile.in -gconfsharp-schemagen +gconfsharp2-schemagen *.exe diff --git a/gconf/tools/Makefile.am b/gconf/tools/Makefile.am index 335537e0d..421c78696 100644 --- a/gconf/tools/Makefile.am +++ b/gconf/tools/Makefile.am @@ -1,12 +1,12 @@ -assemblydir = $(bindir) +assemblydir = $(libdir)/gtk-sharp-2.0 assembly_DATA = gconfsharp-schemagen.exe -bin_SCRIPTS = gconfsharp-schemagen +bin_SCRIPTS = gconfsharp2-schemagen CLEANFILES = gconfsharp-schemagen.exe -DISTCLEANFILES = gconfsharp-schemagen +DISTCLEANFILES = gconfsharp2-schemagen EXTRA_DIST = \ schemagen.cs \ - gconfsharp-schemagen.in + gconfsharp2-schemagen.in gconfsharp-schemagen.exe: $(srcdir)/schemagen.cs $(CSC) /out:gconfsharp-schemagen.exe $(srcdir)/schemagen.cs diff --git a/gconf/tools/gconfsharp-schemagen.in b/gconf/tools/gconfsharp-schemagen.in deleted file mode 100644 index dcd1e5ec3..000000000 --- a/gconf/tools/gconfsharp-schemagen.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -@RUNTIME@ @prefix@/bin/gconfsharp-schemagen.exe "$@" diff --git a/gconf/tools/gconfsharp2-schemagen.in b/gconf/tools/gconfsharp2-schemagen.in new file mode 100644 index 000000000..978c407fe --- /dev/null +++ b/gconf/tools/gconfsharp2-schemagen.in @@ -0,0 +1,2 @@ +#!/bin/sh +@RUNTIME@ @prefix@/lib/gtk-sharp-2.0/gconfsharp-schemagen.exe "$@" diff --git a/gda/.cvsignore b/gda/.cvsignore index a0216b9e5..f6c52116e 100755 --- a/gda/.cvsignore +++ b/gda/.cvsignore @@ -1,4 +1,4 @@ -gda-sharp.pc +*.pc AssemblyInfo.cs *.dll *.dll.config diff --git a/gda/Makefile.am b/gda/Makefile.am index e81acb5f3..bba90c760 100644 --- a/gda/Makefile.am +++ b/gda/Makefile.am @@ -2,7 +2,7 @@ if ENABLE_GDA TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gda-sharp.pc +pkgconfig_DATA = gda-sharp-2.0.pc else TARGET = APIS = @@ -15,12 +15,12 @@ ASSEMBLY_NAME = gda-sharp references = /r:../glib/glib-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) gapi_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = gda-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = gda-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = \ Application.cs @@ -38,7 +38,7 @@ EXTRA_DIST = \ $(METADATA) \ $(customs) \ $(sources) \ - gda-sharp.pc.in + gda-sharp-2.0.pc.in $(API): $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/gda/gda-sharp.pc.in b/gda/gda-sharp-2.0.pc.in similarity index 70% rename from gda/gda-sharp.pc.in rename to gda/gda-sharp-2.0.pc.in index 58fb0265b..fbd42c70d 100644 --- a/gda/gda-sharp.pc.in +++ b/gda/gda-sharp-2.0.pc.in @@ -6,4 +6,4 @@ libdir=${exec_prefix}/lib Name: Gda# Description: Gda# - Gda .NET Binding Version: @VERSION@ -Libs: -r:${libdir}/mono/@PACKAGE@/gda-sharp.dll +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/gda-sharp.dll diff --git a/gda/gda-sharp.dll.config.in b/gda/gda-sharp.dll.config.in index fc3e22b19..02f1b6fb5 100644 --- a/gda/gda-sharp.dll.config.in +++ b/gda/gda-sharp.dll.config.in @@ -1,3 +1,4 @@ + diff --git a/gdk/Device.custom b/gdk/Device.custom index e397dbf66..747d7fb9e 100644 --- a/gdk/Device.custom +++ b/gdk/Device.custom @@ -1,4 +1,4 @@ -// Display.custom - customizations to Gdk.Display +// Device.custom - customizations to Gdk.Device // // Authors: Manuel V. Santos // @@ -19,28 +19,28 @@ // Boston, MA 02111-1307, USA. - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_device_get_name (IntPtr device); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern InputSource gtksharp_gdk_device_get_source (IntPtr device); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern InputMode gtksharp_gdk_device_get_mode (IntPtr device); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern bool gtksharp_gdk_device_has_cursor (IntPtr device); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern int gtksharp_gdk_device_get_num_axes (IntPtr device); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern int gtksharp_gdk_device_get_num_keys (IntPtr device); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern DeviceAxis gtksharp_gdk_device_get_device_axis (IntPtr device, uint axis); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern DeviceKey gtksharp_gdk_device_get_device_key (IntPtr device, uint axis); [DllImport("libgdk-win32-2.0-0.dll")] diff --git a/gdk/DragContext.custom b/gdk/DragContext.custom index efb9ef5d7..5349bc5eb 100644 --- a/gdk/DragContext.custom +++ b/gdk/DragContext.custom @@ -20,7 +20,7 @@ // Boston, MA 02111-1307, USA. -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern DragProtocol gtksharp_drag_context_get_protocol (IntPtr ptr); public unsafe DragProtocol DragProtocol { @@ -30,7 +30,7 @@ public unsafe DragProtocol DragProtocol { } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern bool gtksharp_drag_context_get_is_source (IntPtr ptr); public bool IsSource { @@ -40,7 +40,7 @@ public bool IsSource { } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_drag_context_get_source_window (IntPtr ptr); public Gdk.Window SourceWindow { @@ -50,7 +50,7 @@ public Gdk.Window SourceWindow { } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_drag_context_get_dest_window (IntPtr ptr); public Gdk.Window DestWindow { @@ -60,7 +60,7 @@ public Gdk.Window DestWindow { } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_drag_context_get_targets (IntPtr ptr); public Atom [] Targets { @@ -78,7 +78,7 @@ public Atom [] Targets { } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern DragAction gtksharp_drag_context_get_actions (IntPtr ptr); public DragAction Actions { @@ -87,7 +87,7 @@ public DragAction Actions { } } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern DragAction gtksharp_drag_context_get_suggested_action (IntPtr ptr); public DragAction SuggestedAction { @@ -97,7 +97,7 @@ public DragAction SuggestedAction { } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern DragAction gtksharp_drag_context_get_action (IntPtr ptr); public DragAction Action { @@ -107,7 +107,7 @@ public DragAction Action { } -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern uint gtksharp_drag_context_get_start_time (IntPtr ptr); public uint StartTime { diff --git a/gdk/Event.cs b/gdk/Event.cs index 148a66bf6..2928f0371 100644 --- a/gdk/Event.cs +++ b/gdk/Event.cs @@ -28,13 +28,13 @@ namespace Gdk { public class Event : GLib.IWrapper { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern EventType gtksharp_gdk_event_get_event_type (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_get_window (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern sbyte gtksharp_gdk_event_get_send_event (IntPtr evt); [DllImport("libgdk-win32-2.0-0.dll")] diff --git a/gdk/EventButton.cs b/gdk/EventButton.cs index 6f3c1a965..4f081efda 100644 --- a/gdk/EventButton.cs +++ b/gdk/EventButton.cs @@ -25,31 +25,31 @@ namespace Gdk { public class EventButton : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_button_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_button_get_x (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_button_get_y (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_button_get_x_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_button_get_y_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_button_get_state (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_button_get_button (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_button_get_device (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_button_get_axes (IntPtr evt); public EventButton (IntPtr raw) : base (raw) {} diff --git a/gdk/EventClient.cs b/gdk/EventClient.cs index ccf95ab58..012170fca 100644 --- a/gdk/EventClient.cs +++ b/gdk/EventClient.cs @@ -26,16 +26,16 @@ namespace Gdk { public class EventClient : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_client_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_client_get_message_type (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern ushort gtksharp_gdk_event_client_get_data_format (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_client_get_data (IntPtr evt); public EventClient (IntPtr raw) : base (raw) {} diff --git a/gdk/EventConfigure.cs b/gdk/EventConfigure.cs index 1b22e735f..80bec4b2a 100644 --- a/gdk/EventConfigure.cs +++ b/gdk/EventConfigure.cs @@ -26,16 +26,16 @@ namespace Gdk { public class EventConfigure : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern int gtksharp_gdk_event_configure_get_x (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern int gtksharp_gdk_event_configure_get_y (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern int gtksharp_gdk_event_configure_get_width (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern int gtksharp_gdk_event_configure_get_height (IntPtr evt); public EventConfigure (IntPtr raw) : base (raw) {} diff --git a/gdk/EventCrossing.cs b/gdk/EventCrossing.cs index 841a4fd52..9883fca5a 100644 --- a/gdk/EventCrossing.cs +++ b/gdk/EventCrossing.cs @@ -26,34 +26,34 @@ namespace Gdk { public class EventCrossing : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_crossing_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_crossing_get_x (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_crossing_get_y (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_crossing_get_x_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_crossing_get_y_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_crossing_get_state (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_crossing_get_subwindow (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern CrossingMode gtksharp_gdk_event_crossing_get_mode (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern NotifyType gtksharp_gdk_event_crossing_get_detail (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern bool gtksharp_gdk_event_crossing_get_focus (IntPtr evt); public EventCrossing (IntPtr raw) : base (raw) {} diff --git a/gdk/EventDND.cs b/gdk/EventDND.cs index 5a0d8699e..2c5436b0a 100644 --- a/gdk/EventDND.cs +++ b/gdk/EventDND.cs @@ -26,16 +26,16 @@ namespace Gdk { public class EventDND : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_dnd_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_dnd_get_context (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern short gtksharp_gdk_event_dnd_get_x_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern short gtksharp_gdk_event_dnd_get_y_root (IntPtr evt); public EventDND (IntPtr raw) : base (raw) {} diff --git a/gdk/EventExpose.cs b/gdk/EventExpose.cs index 6d517ab32..dfb4c6a08 100644 --- a/gdk/EventExpose.cs +++ b/gdk/EventExpose.cs @@ -26,13 +26,13 @@ namespace Gdk { public class EventExpose : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern Rectangle gtksharp_gdk_event_expose_get_area (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_expose_get_region (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern int gtksharp_gdk_event_expose_get_count (IntPtr evt); public EventExpose (IntPtr raw) : base (raw) {} diff --git a/gdk/EventFocus.cs b/gdk/EventFocus.cs index 321f8245d..7a991c4e0 100644 --- a/gdk/EventFocus.cs +++ b/gdk/EventFocus.cs @@ -26,7 +26,7 @@ namespace Gdk { public class EventFocus : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern short gtksharp_gdk_event_focus_get_in (IntPtr evt); public EventFocus (IntPtr raw) : base (raw) {} diff --git a/gdk/EventKey.cs b/gdk/EventKey.cs index ba34e92fb..a83287527 100644 --- a/gdk/EventKey.cs +++ b/gdk/EventKey.cs @@ -26,19 +26,19 @@ namespace Gdk { public class EventKey : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_key_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_key_get_state (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_key_get_keyval (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern ushort gtksharp_gdk_event_key_get_hardware_keycode (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern byte gtksharp_gdk_event_key_get_group (IntPtr evt); public EventKey (IntPtr raw) : base (raw) {} diff --git a/gdk/EventMotion.cs b/gdk/EventMotion.cs index 938de53e7..18acb556d 100644 --- a/gdk/EventMotion.cs +++ b/gdk/EventMotion.cs @@ -26,31 +26,31 @@ namespace Gdk { public class EventMotion : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_motion_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_motion_get_x (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_motion_get_y (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_motion_get_x_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_motion_get_y_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_motion_get_state (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern ushort gtksharp_gdk_event_motion_get_is_hint (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_motion_get_device (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_motion_get_axes (IntPtr evt); public EventMotion (IntPtr raw) : base (raw) {} diff --git a/gdk/EventProperty.cs b/gdk/EventProperty.cs index 97cf838c5..f66fc19f0 100644 --- a/gdk/EventProperty.cs +++ b/gdk/EventProperty.cs @@ -26,13 +26,13 @@ namespace Gdk { public class EventProperty : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_property_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_property_get_atom (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern PropertyState gtksharp_gdk_event_property_get_state (IntPtr evt); public EventProperty (IntPtr raw) : base (raw) {} diff --git a/gdk/EventProximity.cs b/gdk/EventProximity.cs index 665e5e651..8b59f397d 100644 --- a/gdk/EventProximity.cs +++ b/gdk/EventProximity.cs @@ -26,10 +26,10 @@ namespace Gdk { public class EventProximity : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_proximity_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_proximity_get_device (IntPtr evt); public EventProximity (IntPtr raw) : base (raw) {} diff --git a/gdk/EventScroll.cs b/gdk/EventScroll.cs index 915f7acd5..2455aaa6e 100644 --- a/gdk/EventScroll.cs +++ b/gdk/EventScroll.cs @@ -26,28 +26,28 @@ namespace Gdk { public class EventScroll : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_scroll_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_scroll_get_x (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_scroll_get_y (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_scroll_get_x_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern double gtksharp_gdk_event_scroll_get_y_root (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_scroll_get_state (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern ScrollDirection gtksharp_gdk_event_scroll_get_direction (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_scroll_get_device (IntPtr evt); public EventScroll (IntPtr raw) : base (raw) {} diff --git a/gdk/EventSelection.cs b/gdk/EventSelection.cs index 2b6c3844f..1df9fe64b 100644 --- a/gdk/EventSelection.cs +++ b/gdk/EventSelection.cs @@ -26,19 +26,19 @@ namespace Gdk { public class EventSelection : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_selection_get_time (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_selection_get_selection (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_selection_get_target (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_selection_get_property (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern uint gtksharp_gdk_event_selection_get_requestor (IntPtr evt); public EventSelection (IntPtr raw) : base (raw) {} diff --git a/gdk/EventSetting.cs b/gdk/EventSetting.cs index d6bebaca4..adc0ad441 100644 --- a/gdk/EventSetting.cs +++ b/gdk/EventSetting.cs @@ -26,10 +26,10 @@ namespace Gdk { public class EventSetting : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern SettingAction gtksharp_gdk_event_setting_get_action (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_gdk_event_setting_get_name (IntPtr evt); public EventSetting (IntPtr raw) : base (raw) {} diff --git a/gdk/EventVisibility.cs b/gdk/EventVisibility.cs index 663d7ec49..6da96ee65 100644 --- a/gdk/EventVisibility.cs +++ b/gdk/EventVisibility.cs @@ -26,7 +26,7 @@ namespace Gdk { public class EventVisibility : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern VisibilityState gtksharp_gdk_event_visibility_get_state (IntPtr evt); public EventVisibility (IntPtr raw) : base (raw) {} diff --git a/gdk/EventWindowState.cs b/gdk/EventWindowState.cs index 124c767c2..23a9ebbbc 100644 --- a/gdk/EventWindowState.cs +++ b/gdk/EventWindowState.cs @@ -26,10 +26,10 @@ namespace Gdk { public class EventWindowState : Event { - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern WindowState gtksharp_gdk_event_window_state_get_changed_mask (IntPtr evt); - [DllImport("gdksharpglue")] + [DllImport("gdksharpglue-2.0")] static extern WindowState gtksharp_gdk_event_window_state_get_new_window_state (IntPtr evt); public EventWindowState (IntPtr raw) : base (raw) {} diff --git a/gdk/Gdk.metadata b/gdk/Gdk.metadata index bb4e7a34d..23856b0bf 100644 --- a/gdk/Gdk.metadata +++ b/gdk/Gdk.metadata @@ -83,6 +83,7 @@ 1 1 1 + 1 1 1 GdkDrawable @@ -115,6 +116,7 @@ 1 1 1 + GetName 1 1 1 @@ -144,6 +146,5 @@ n_points 128 1 - GetName diff --git a/gdk/Global.custom b/gdk/Global.custom index 306ffea60..24ad9a6b9 100644 --- a/gdk/Global.custom +++ b/gdk/Global.custom @@ -49,7 +49,7 @@ return result; } - [DllImport ("gdksharpglue")] + [DllImport ("gdksharpglue-2.0")] static extern IntPtr gtksharp_get_gdk_net_supported (); public static Gdk.Atom[] SupportedWindowManagerHints { @@ -66,7 +66,7 @@ } } - [DllImport ("gdksharpglue")] + [DllImport ("gdksharpglue-2.0")] static extern IntPtr gtksharp_get_gdk_net_client_list (out int count); public static Gdk.Window[] WindowManagerClientWindows { @@ -87,7 +87,7 @@ } } - [DllImport ("gdksharpglue")] + [DllImport ("gdksharpglue-2.0")] static extern int gtksharp_get_gdk_net_number_of_desktops (); public static int NumberOfDesktops { @@ -96,7 +96,7 @@ } } - [DllImport ("gdksharpglue")] + [DllImport ("gdksharpglue-2.0")] static extern int gtksharp_get_gdk_net_current_desktop (); public static int CurrentDesktop { @@ -105,7 +105,7 @@ } } - [DllImport ("gdksharpglue")] + [DllImport ("gdksharpglue-2.0")] static extern uint gtksharp_get_gdk_net_active_window (); public static Gdk.Window ActiveWindow { @@ -119,7 +119,7 @@ } } - [DllImport ("gdksharpglue")] + [DllImport ("gdksharpglue-2.0")] static extern IntPtr gtksharp_get_gdk_net_workarea (); public static Gdk.Rectangle[] DesktopWorkareas { diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 72ee6163b..9d7b39b9e 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -10,7 +10,7 @@ references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll TARGET = $(ASSEMBLY) ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(ASSEMBLY) $(ASSEMBLY).config gapi_DATA = $(API) $(ADDITIONAL_API) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) glue/generated.c gtk-sharp.snk diff --git a/gdk/Pixbuf.custom b/gdk/Pixbuf.custom index 526313003..6cec90154 100644 --- a/gdk/Pixbuf.custom +++ b/gdk/Pixbuf.custom @@ -31,6 +31,67 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_pixbuf_get_from_drawable(IntPtr raw, IntPtr src, IntPtr cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height); + + public Gdk.Pixbuf GetFromDrawable(Gdk.Drawable src, Gdk.Colormap cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) { + IntPtr raw_ret = gdk_pixbuf_get_from_drawable(Handle, src.Handle, cmap.Handle, src_x, src_y, dest_x, dest_y, width, height); + Gdk.Pixbuf ret; + if (raw_ret == IntPtr.Zero) + ret = null; + else + ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret); + return ret; + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern IntPtr gdk_pixbuf_get_from_image(IntPtr raw, IntPtr src, IntPtr cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height); + + public Gdk.Pixbuf GetFromImage(Gdk.Image src, Gdk.Colormap cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) { + IntPtr raw_ret = gdk_pixbuf_get_from_image(Handle, src.Handle, cmap.Handle, src_x, src_y, dest_x, dest_y, width, height); + Gdk.Pixbuf ret; + if (raw_ret == IntPtr.Zero) + ret = null; + else + ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret); + return ret; + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern void gdk_pixbuf_render_pixmap_and_mask(IntPtr raw, IntPtr pixmap_return, IntPtr mask_return, int alpha_threshold); + + public void RenderPixmapAndMask(Gdk.Pixmap pixmap_return, Gdk.Bitmap mask_return, int alpha_threshold) { + gdk_pixbuf_render_pixmap_and_mask(Handle, pixmap_return.Handle, mask_return.Handle, alpha_threshold); + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern void gdk_pixbuf_render_pixmap_and_mask_for_colormap(IntPtr raw, IntPtr colormap, IntPtr pixmap_return, IntPtr mask_return, int alpha_threshold); + + public void RenderPixmapAndMaskForColormap(Gdk.Colormap colormap, Gdk.Pixmap pixmap_return, Gdk.Bitmap mask_return, int alpha_threshold) { + gdk_pixbuf_render_pixmap_and_mask_for_colormap(Handle, colormap.Handle, pixmap_return.Handle, mask_return.Handle, alpha_threshold); + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern void gdk_pixbuf_render_threshold_alpha(IntPtr raw, IntPtr bitmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_threshold); + + public void RenderThresholdAlpha(Gdk.Bitmap bitmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_threshold) { + gdk_pixbuf_render_threshold_alpha(Handle, bitmap.Handle, src_x, src_y, dest_x, dest_y, width, height, alpha_threshold); + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern void gdk_pixbuf_render_to_drawable(IntPtr raw, IntPtr drawable, IntPtr gc, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int dither, int x_dither, int y_dither); + + public void RenderToDrawable(Gdk.Drawable drawable, Gdk.GC gc, int src_x, int src_y, int dest_x, int dest_y, int width, int height, Gdk.RgbDither dither, int x_dither, int y_dither) { + gdk_pixbuf_render_to_drawable(Handle, drawable.Handle, gc.Handle, src_x, src_y, dest_x, dest_y, width, height, (int) dither, x_dither, y_dither); + } + + [DllImport("libgdk-win32-2.0-0.dll")] + static extern void gdk_pixbuf_render_to_drawable_alpha(IntPtr raw, IntPtr drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_mode, int alpha_threshold, int dither, int x_dither, int y_dither); + + public void RenderToDrawableAlpha(Gdk.Drawable drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height, Gdk.PixbufAlphaMode alpha_mode, int alpha_threshold, Gdk.RgbDither dither, int x_dither, int y_dither) { + gdk_pixbuf_render_to_drawable_alpha(Handle, drawable.Handle, src_x, src_y, dest_x, dest_y, width, height, (int) alpha_mode, alpha_threshold, (int) dither, x_dither, y_dither); + } + [DllImport("libgobject-2.0-0.dll")] static extern void g_object_ref (IntPtr handle); @@ -191,7 +252,3 @@ return ret; } - public void RenderThresholdAlpha (Bitmap bitmap, int src_x, int src_y, int dest_x, int dest_y, int alpha_threshold) - { - RenderThresholdAlpha (bitmap, src_x, src_y, dest_x, dest_y, -1, -1, alpha_threshold); - } diff --git a/gdk/Selection.custom b/gdk/Selection.custom index 56313f763..18d5fb19b 100644 --- a/gdk/Selection.custom +++ b/gdk/Selection.custom @@ -20,17 +20,17 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_get_gdk_selection_primary (); public static Gdk.Atom Primary = new Gdk.Atom (gtksharp_get_gdk_selection_primary()); -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_get_gdk_selection_secondary (); public static Gdk.Atom Secondary = new Gdk.Atom (gtksharp_get_gdk_selection_secondary()); -[DllImport("gdksharpglue")] +[DllImport("gdksharpglue-2.0")] static extern IntPtr gtksharp_get_gdk_selection_clipboard (); public static Gdk.Atom Clipboard = new Gdk.Atom (gtksharp_get_gdk_selection_clipboard()); diff --git a/gdk/gdk-api.raw b/gdk/gdk-api.raw index f52947aaa..88fee1bc4 100644 --- a/gdk/gdk-api.raw +++ b/gdk/gdk-api.raw @@ -211,6 +211,10 @@ + + + + @@ -436,6 +440,8 @@ + + @@ -514,6 +520,12 @@ + + + + + + @@ -527,6 +539,9 @@ + + + @@ -546,6 +561,12 @@ + + + + + + @@ -633,6 +654,9 @@ + + + @@ -666,18 +690,34 @@ + + + + + + + + + + + + + + + + @@ -745,6 +785,12 @@ + + + + + + @@ -757,6 +803,12 @@ + + + + + + @@ -804,6 +856,12 @@ + + + + + + @@ -1027,8 +1085,8 @@ - - + + @@ -1038,8 +1096,8 @@ - - + + @@ -1176,12 +1234,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1216,12 +1324,26 @@ + + + + + + + + + + + + + + @@ -1285,10 +1407,13 @@ + + + - + @@ -1342,10 +1467,16 @@ + + + + + + - + @@ -1366,13 +1497,13 @@ - + - + @@ -1407,6 +1538,9 @@ + + + @@ -1421,6 +1555,16 @@ + + + + + + + + + + @@ -1450,12 +1594,18 @@ + + + + + + @@ -1529,7 +1679,7 @@ - + @@ -1539,7 +1689,7 @@ - + @@ -1551,8 +1701,8 @@ - - + + @@ -1560,7 +1710,7 @@ - + @@ -1569,7 +1719,7 @@ - + @@ -1613,6 +1763,8 @@ + + @@ -1899,6 +2051,13 @@ + + + + + + + @@ -1918,6 +2077,9 @@ + + + @@ -2111,6 +2273,12 @@ + + + + + + @@ -2121,7 +2289,7 @@ - + @@ -2170,6 +2338,18 @@ + + + + + + + + + + + + @@ -2190,6 +2370,18 @@ + + + + + + + + + + + + @@ -2322,6 +2514,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -2347,6 +2560,13 @@ + + + + + + + @@ -2368,12 +2588,20 @@ + + + + + + + + - - + + @@ -2577,10 +2805,57 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2827,11 +3102,14 @@ + + + @@ -2876,6 +3154,7 @@ + @@ -2939,6 +3218,9 @@ + + + @@ -2946,14 +3228,6 @@ - - - - - - - - @@ -3000,6 +3274,12 @@ + + + + + + @@ -3007,6 +3287,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3028,6 +3334,13 @@ + + + + + + + @@ -3035,6 +3348,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3269,6 +3642,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3437,7 +3860,7 @@ - + @@ -3454,7 +3877,7 @@ - + @@ -3558,12 +3981,29 @@ + + + + + + + + + + + + + + + + + @@ -3582,6 +4022,12 @@ + + + + + + @@ -3656,7 +4102,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3699,6 +4228,22 @@ + + + + + + + + + + + + + + + + @@ -3710,6 +4255,13 @@ + + + + + + + @@ -3766,7 +4318,24 @@ + + + + + + + + + + + + + + + + + @@ -3863,35 +4432,17 @@ + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3947,6 +4498,14 @@ + + + + + + + + @@ -3969,68 +4528,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -4049,6 +4548,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4082,6 +4623,9 @@ + + + @@ -4111,6 +4655,12 @@ + + + + + + @@ -4239,6 +4789,12 @@ + + + + + + diff --git a/gdk/glue/Makefile.am b/gdk/glue/Makefile.am index 2ad38777f..3e1f66a0d 100644 --- a/gdk/glue/Makefile.am +++ b/gdk/glue/Makefile.am @@ -1,6 +1,6 @@ -lib_LTLIBRARIES = libgdksharpglue.la +lib_LTLIBRARIES = libgdksharpglue-2.0.la -libgdksharpglue_la_SOURCES = \ +libgdksharpglue_2_0_la_SOURCES = \ dragcontext.c \ device.c \ event.c \ @@ -11,14 +11,14 @@ libgdksharpglue_la_SOURCES = \ # Adding a new glue file? # Please remember to update makefile.win32 -libgdksharpglue_la_LDFLAGS = -module -avoid-version -no-undefined +libgdksharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined -libgdksharpglue_la_LIBADD = $(GTK_LIBS) +libgdksharpglue_2_0_la_LIBADD = $(GTK_LIBS) INCLUDES = $(GTK_CFLAGS) -I$(top_srcdir) -libgdksharpglue.dll: $(libgdksharpglue_la_OBJECTS) libgdksharpglue.rc libgdksharpglue.def - ./build-dll libgdksharpglue $(VERSION) +libgdksharpglue.dll: $(libgdksharpglue_2_0_la_OBJECTS) libgdksharpglue.rc libgdksharpglue.def + ./build-dll libgdksharpglue-2.0 $(VERSION) CLEANFILES = lib*.a lib*.dll diff --git a/gdk/glue/makefile.win32 b/gdk/glue/makefile.win32 index 7081f8d9a..1618a4f30 100755 --- a/gdk/glue/makefile.win32 +++ b/gdk/glue/makefile.win32 @@ -10,16 +10,16 @@ GLUE_OBJS = \ selection.o \ win32dll.o -all: gdksharpglue.dll +all: gdksharpglue-2.0.dll %.o: %.c $(CC) -c $(CFLAGS) $(GTK_CFLAGS) -o $@ $^ -gdksharpglue.dll: $(GLUE_OBJS) - $(DLLWRAP) --output-lib=libgdksharpglue.a --dllname=gdksharpglue.dll --driver-name=gcc --output-def=gdksharpglue.def $(GLUE_OBJS) $(GTK_LIBS) +gdksharpglue-2.0.dll: $(GLUE_OBJS) + $(DLLWRAP) --output-lib=libgdksharpglue-2.0.a --dllname=gdksharpglue-2.0.dll --driver-name=gcc --output-def=gdksharpglue.def $(GLUE_OBJS) $(GTK_LIBS) clean: - rm -f gdksharpglue.dll *.o libgdksharpglue.a + rm -f gdksharpglue-2.0.dll *.o libgdksharpglue-2.0.a diff --git a/generator/.cvsignore b/generator/.cvsignore index 3c2da0b76..0c12f4ed0 100644 --- a/generator/.cvsignore +++ b/generator/.cvsignore @@ -2,7 +2,7 @@ *.exe *.xml generated-stamp -gapi-codegen +gapi2-codegen Makefile Makefile.in diff --git a/generator/BoxedGen.cs b/generator/BoxedGen.cs index dd11ecf8c..18640d3f0 100644 --- a/generator/BoxedGen.cs +++ b/generator/BoxedGen.cs @@ -39,10 +39,10 @@ namespace GtkSharp.Generation { { StreamWriter sw = gen_info.Writer = gen_info.OpenStream (Name); base.Generate (gen_info); - sw.WriteLine ("\t\t[DllImport(\"glibsharpglue\")]"); + sw.WriteLine ("\t\t[DllImport(\"glibsharpglue-2.0\")]"); sw.WriteLine ("\t\tstatic extern IntPtr glibsharp_value_get_boxed (ref GLib.Value val);"); sw.WriteLine (); - sw.WriteLine ("\t\t[DllImport(\"glibsharpglue\")]"); + sw.WriteLine ("\t\t[DllImport(\"glibsharpglue-2.0\")]"); sw.WriteLine ("\t\tstatic extern void glibsharp_value_set_boxed (ref GLib.Value val, ref " + QualifiedName + " boxed);"); sw.WriteLine (); sw.WriteLine ("\t\tpublic static explicit operator GLib.Value (" + QualifiedName + " boxed)"); diff --git a/generator/ClassBase.cs b/generator/ClassBase.cs index 44720a072..f5ffcce96 100644 --- a/generator/ClassBase.cs +++ b/generator/ClassBase.cs @@ -38,6 +38,8 @@ namespace GtkSharp.Generation { private bool ctors_initted = false; private Hashtable clash_map; + private bool deprecated = false; + private bool isabstract = false; public Hashtable Methods { get { @@ -64,12 +66,17 @@ namespace GtkSharp.Generation { protected ClassBase (XmlElement ns, XmlElement elem) : base (ns, elem) { + if (elem.HasAttribute ("deprecated")) + deprecated = elem.GetAttribute ("deprecated") == "1"; + if (elem.HasAttribute ("abstract")) + isabstract = elem.GetAttribute ("abstract") == "1"; + foreach (XmlNode node in elem.ChildNodes) { if (!(node is XmlElement)) continue; XmlElement member = (XmlElement) node; if (member.HasAttribute ("hidden")) continue; - + string name; switch (node.Name) { case "method": @@ -107,6 +114,18 @@ namespace GtkSharp.Generation { } } + public bool IsDeprecated { + get { + return deprecated; + } + } + + public bool IsAbstract { + get { + return isabstract; + } + } + protected bool IsNodeNameHandled (string name) { switch (name) { diff --git a/generator/ClassGen.cs b/generator/ClassGen.cs index 51a7d24c9..ad5fcba6c 100644 --- a/generator/ClassGen.cs +++ b/generator/ClassGen.cs @@ -50,7 +50,9 @@ namespace GtkSharp.Generation { sw.WriteLine ("\tusing System.Runtime.InteropServices;"); sw.WriteLine (); - sw.WriteLine ("#region Autogenerated code"); + sw.WriteLine ("#region Autogenerated code"); + if (IsDeprecated) + sw.WriteLine ("\t[Obsolete]"); sw.Write ("\tpublic class " + Name); sw.WriteLine (" {"); sw.WriteLine (); diff --git a/generator/Makefile.am b/generator/Makefile.am index 9f359a101..a41790b47 100644 --- a/generator/Makefile.am +++ b/generator/Makefile.am @@ -1,8 +1,8 @@ -assemblydir = $(bindir) +assemblydir = $(libdir)/gtk-sharp-2.0 assembly_DATA = gapi_codegen.exe -bin_SCRIPTS = gapi-codegen +bin_SCRIPTS = gapi2-codegen CLEANFILES = gapi_codegen.exe -DISTCLEANFILES = gapi-codegen +DISTCLEANFILES = gapi2-codegen references = diff --git a/generator/Method.cs b/generator/Method.cs index c66a90d4e..4cd7a2dee 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -44,15 +44,18 @@ namespace GtkSharp.Generation { private string name, cname, safety; private string protection = "public"; private bool is_get, is_set; - private bool needs_ref = false; + private bool needs_ref = false; + private bool deprecated = false; public Method (string libname, XmlElement elem, ClassBase container_type) { this.elem = elem; if (elem["parameters"] != null) { parms = new Parameters (elem["parameters"], container_type.NS); - } - this.container_type = container_type; + } + this.container_type = container_type; + if (!container_type.IsDeprecated && elem.HasAttribute ("deprecated")) + deprecated = elem.GetAttribute ("deprecated") == "1"; this.name = elem.GetAttribute("name"); if (name == "GetType") name = "GetGType"; @@ -65,6 +68,12 @@ namespace GtkSharp.Generation { if (elem.HasAttribute ("needs_ref")) this.needs_ref = (elem.GetAttribute ("needs_ref") == "1"); } + + public bool IsDeprecated { + get { + return deprecated; + } + } public bool IsGetter { get { @@ -80,7 +89,8 @@ namespace GtkSharp.Generation { private bool IsShared { get { - return elem.HasAttribute("shared"); + return elem.HasAttribute("shared") && + (elem.GetAttribute("shared") == "true"); } } @@ -209,8 +219,9 @@ namespace GtkSharp.Generation { } private void GenerateDeclCommon (StreamWriter sw, ClassBase implementor) - { - if (elem.HasAttribute("shared")) + { + if (elem.HasAttribute("shared") && + (elem.GetAttribute("shared") == "true")) sw.Write("static "); sw.Write(safety); Method dup = null; @@ -248,7 +259,8 @@ namespace GtkSharp.Generation { if (!Initialize ()) return; - if (elem.HasAttribute("shared")) + if (elem.HasAttribute("shared") && + (elem.GetAttribute("shared") == "true")) return; if (is_get || is_set) @@ -300,7 +312,8 @@ namespace GtkSharp.Generation { if (!Initialize ()) return; - if (implementor != null && elem.HasAttribute("shared")) + if (implementor != null && elem.HasAttribute("shared") && + (elem.GetAttribute ("shared") == "true")) return; /* we are generated by the get Method, if there is one */ @@ -325,7 +338,9 @@ namespace GtkSharp.Generation { GenerateImport (gen_info.Writer); if (comp != null && s_ret == comp.parms.AccessorReturnType) comp.GenerateImport (gen_info.Writer); - + + if (IsDeprecated) + gen_info.Writer.WriteLine("\t\t[Obsolete]"); gen_info.Writer.Write("\t\t"); if (protection != "") gen_info.Writer.Write("{0} ", protection); diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index bab907b44..adf3b7302 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -121,8 +121,10 @@ namespace GtkSharp.Generation { SymbolTable table = SymbolTable.Table; - sw.WriteLine ("#region Autogenerated code"); - sw.Write ("\tpublic class " + Name); + sw.WriteLine ("#region Autogenerated code"); + if (IsDeprecated) + sw.WriteLine ("\t[Obsolete]"); + sw.Write ("\tpublic {0} class " + Name, IsAbstract ? "abstract" : ""); string cs_parent = table.GetCSType(Elem.GetAttribute("parent")); if (cs_parent != "") sw.Write (" : " + cs_parent); diff --git a/generator/Parser.cs b/generator/Parser.cs index fe1141a2c..9cc65d45a 100644 --- a/generator/Parser.cs +++ b/generator/Parser.cs @@ -30,7 +30,8 @@ namespace GtkSharp.Generation { public class Parser { private XmlDocument Load (string filename) - { + { + Console.WriteLine (filename); XmlDocument doc = new XmlDocument (); try { diff --git a/generator/gapi-codegen.in b/generator/gapi-codegen.in deleted file mode 100755 index 8d3c6e8c9..000000000 --- a/generator/gapi-codegen.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -@RUNTIME@ @prefix@/bin/gapi_codegen.exe "$@" diff --git a/generator/gapi2-codegen.in b/generator/gapi2-codegen.in new file mode 100755 index 000000000..b7a2621f6 --- /dev/null +++ b/generator/gapi2-codegen.in @@ -0,0 +1,2 @@ +#!/bin/sh +@RUNTIME@ @prefix@/lib/gtk-sharp-2.0/gapi_codegen.exe "$@" diff --git a/glade/.cvsignore b/glade/.cvsignore index d6145d00b..f6c52116e 100755 --- a/glade/.cvsignore +++ b/glade/.cvsignore @@ -1,4 +1,4 @@ -glade-sharp.pc +*.pc AssemblyInfo.cs *.dll *.dll.config diff --git a/glade/Makefile.am b/glade/Makefile.am index 28186d6b1..ad96a022b 100644 --- a/glade/Makefile.am +++ b/glade/Makefile.am @@ -4,7 +4,7 @@ if ENABLE_GLADE TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) $(ADDITIONAL_API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = glade-sharp.pc +pkgconfig_DATA = glade-sharp-2.0.pc else TARGET = APIS = @@ -18,12 +18,12 @@ ASSEMBLY_NAME = glade-sharp references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gtk/gtk-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) gapi_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = glade-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = glade-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = \ HandlerNotFoundExeception.cs \ @@ -44,7 +44,7 @@ EXTRA_DIST = \ $(METADATA) \ $(customs) \ $(sources) \ - glade-sharp.pc.in + glade-sharp-2.0.pc.in $(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/glade/XML.custom b/glade/XML.custom index a354e9ac1..acd3a3803 100644 --- a/glade/XML.custom +++ b/glade/XML.custom @@ -36,7 +36,7 @@ glade_set_custom_handler (callback_wrapper.NativeDelegate, IntPtr.Zero); } - [DllImport("gladesharpglue")] + [DllImport("gladesharpglue-2.0")] static extern IntPtr gtksharp_glade_xml_get_filename (IntPtr raw); public string Filename { diff --git a/glade/glade-api.raw b/glade/glade-api.raw index e5367a80c..06470f7ea 100644 --- a/glade/glade-api.raw +++ b/glade/glade-api.raw @@ -317,7 +317,7 @@ - + diff --git a/glade/glade-sharp.pc.in b/glade/glade-sharp-2.0.pc.in similarity index 62% rename from glade/glade-sharp.pc.in rename to glade/glade-sharp-2.0.pc.in index b51a8e651..942570717 100644 --- a/glade/glade-sharp.pc.in +++ b/glade/glade-sharp-2.0.pc.in @@ -6,5 +6,5 @@ libdir=${exec_prefix}/lib Name: Glade# Description: Glade# - Glade .NET Binding Version: @VERSION@ -Requires: gtk-sharp -Libs: -r:${libdir}/mono/@PACKAGE@/glade-sharp.dll +Requires: gtk-sharp-2.0 +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/glade-sharp.dll diff --git a/glade/glue/Makefile.am b/glade/glue/Makefile.am index 16e643559..a5ca0999f 100644 --- a/glade/glue/Makefile.am +++ b/glade/glue/Makefile.am @@ -1,22 +1,22 @@ lib_LTLIBRARIES = $(TARGET) if ENABLE_GLADE -TARGET = libgladesharpglue.la +TARGET = libgladesharpglue-2.0.la else TARGET = endif -libgladesharpglue_la_LDFLAGS = -module -avoid-version -no-undefined +libgladesharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined -libgladesharpglue_la_SOURCES = \ +libgladesharpglue_2_0_la_SOURCES = \ gladexml.c -libgladesharpglue_la_LIBADD = $(GLADE_LIBS) +libgladesharpglue_2_0_la_LIBADD = $(GLADE_LIBS) INCLUDES = $(GLADE_CFLAGS) -I$(top_srcdir) -libgladesharpglue.dll: $(libgladesharpglue_la_OBJECTS) libgladesharpglue.rc libgladesharpglue.def - ./build-dll libgladesharpglue $(VERSION) +libgladesharpglue.dll: $(libgladesharpglue_2_0_la_OBJECTS) libgladesharpglue.rc libgladesharpglue.def + ./build-dll libgladesharpglue-2.0 $(VERSION) CLEANFILES = lib*.a lib*.dll diff --git a/glade/glue/makefile.win32 b/glade/glue/makefile.win32 index 569260af2..bdd1e7c9c 100755 --- a/glade/glue/makefile.win32 +++ b/glade/glue/makefile.win32 @@ -7,16 +7,16 @@ GLUE_OBJS = \ gladexml.o \ win32dll.o -all: gladesharpglue.dll +all: gladesharpglue-2.0.dll %.o: %.c $(CC) -c $(CFLAGS) $(GTK_CFLAGS) -o $@ $^ -gladesharpglue.dll: $(GLUE_OBJS) - $(DLLWRAP) --output-lib=libgladesharpglue.a --dllname=gladesharpglue.dll --driver-name=gcc --output-def=gladesharpglue.def $(GLUE_OBJS) $(GTK_LIBS) +gladesharpglue-2.0.dll: $(GLUE_OBJS) + $(DLLWRAP) --output-lib=libgladesharpglue-2.0.a --dllname=gladesharpglue-2.0.dll --driver-name=gcc --output-def=gladesharpglue.def $(GLUE_OBJS) $(GTK_LIBS) clean: - rm -f gladesharpglue.dll *.o libgladesharpglue.a + rm -f gladesharpglue-2.0.dll *.o libgladesharpglue-2.0.a diff --git a/glib/GException.cs b/glib/GException.cs index 99b8197e0..921b06add 100644 --- a/glib/GException.cs +++ b/glib/GException.cs @@ -33,7 +33,7 @@ namespace GLib { this.errptr = errptr; } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_error_get_message (IntPtr errptr); public override string Message { get { diff --git a/glib/List.cs b/glib/List.cs index 4d45c61e3..8dd00a9dd 100644 --- a/glib/List.cs +++ b/glib/List.cs @@ -34,7 +34,7 @@ namespace GLib { return new List (g_list_copy (Handle)); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_list_get_data (IntPtr l); internal override IntPtr GetData (IntPtr current) @@ -42,7 +42,7 @@ namespace GLib { return gtksharp_list_get_data (current); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_list_get_next (IntPtr l); internal override IntPtr Next (IntPtr current) diff --git a/glib/Marshaller.cs b/glib/Marshaller.cs index 3ef1a1a60..b1e4a14e3 100644 --- a/glib/Marshaller.cs +++ b/glib/Marshaller.cs @@ -173,7 +173,7 @@ namespace GLib { return local_epoch.AddSeconds ((int)time_t + utc_offset); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_unichar_to_utf8_string (uint c); public static char GUnicharToChar (uint ucs4_char) @@ -186,7 +186,7 @@ namespace GLib { return ret [0]; } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern uint glibsharp_utf16_to_gunichar (ushort c); public static uint CharToGUnichar (char c) diff --git a/glib/Object.cs b/glib/Object.cs index 35a368b92..eefcf95cd 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -137,7 +137,7 @@ namespace GLib { } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_register_type (string name, IntPtr parent_type); protected static GType RegisterGType (System.Type t) @@ -184,7 +184,7 @@ namespace GLib { Raw = g_object_new (gtype.Val, IntPtr.Zero); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_object_newv (IntPtr gtype, int n_params, string[] names, GLib.Value[] vals); protected void CreateNativeObject (string[] names, GLib.Value[] vals) @@ -206,7 +206,7 @@ namespace GLib { } } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] private static extern IntPtr gtksharp_get_type_id (IntPtr obj); public static GLib.GType GType { @@ -215,7 +215,7 @@ namespace GLib { } } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_get_type_name (IntPtr raw); protected string TypeName { @@ -304,7 +304,7 @@ namespace GLib { g_object_set_property (Raw, name, ref val); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern void gtksharp_override_virtual_method (IntPtr gtype, string name, Delegate cb); protected static void OverrideVirtualMethod (GType gtype, string name, Delegate cb) @@ -315,7 +315,7 @@ namespace GLib { [DllImport("libgobject-2.0-0.dll")] protected static extern void g_signal_chain_from_overridden (IntPtr args, ref GLib.Value retval); - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern bool gtksharp_is_object (IntPtr obj); internal static bool IsObject (IntPtr obj) @@ -323,7 +323,7 @@ namespace GLib { return gtksharp_is_object (obj); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern int gtksharp_object_get_ref_count (IntPtr obj); protected int RefCount { diff --git a/glib/ObjectManager.cs b/glib/ObjectManager.cs index 728deda9a..08edfac3e 100644 --- a/glib/ObjectManager.cs +++ b/glib/ObjectManager.cs @@ -32,7 +32,7 @@ namespace GLib { private static Hashtable types = new Hashtable (); - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_get_type_name (IntPtr raw); public static GLib.Object CreateObject (IntPtr raw) @@ -107,13 +107,13 @@ namespace GLib { return expected_string; } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern int gtksharp_get_type_id (IntPtr raw); - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern int gtksharp_get_parent_type (int typ); - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_get_type_name_for_id (int typ); static Type LookupType (string mangled) diff --git a/glib/SList.cs b/glib/SList.cs index a2d35bd7d..028312df9 100644 --- a/glib/SList.cs +++ b/glib/SList.cs @@ -34,7 +34,7 @@ namespace GLib { return new SList (g_slist_copy (Handle)); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_slist_get_data (IntPtr l); internal override IntPtr GetData (IntPtr current) @@ -42,7 +42,7 @@ namespace GLib { return gtksharp_slist_get_data (current); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_slist_get_next (IntPtr l); internal override IntPtr Next (IntPtr current) diff --git a/glib/Value.cs b/glib/Value.cs index 0d51aa8b2..5d526c32f 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -41,10 +41,10 @@ namespace GLib { [DllImport("libgobject-2.0-0.dll")] static extern void g_value_unset (ref GLib.Value val); - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_value_create_from_property(ref GLib.Value val, IntPtr obj, string name); - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_value_create_from_type_and_property(ref GLib.Value val, IntPtr gtype, string name); public void Dispose () @@ -297,12 +297,15 @@ namespace GLib { return new EnumWrapper (g_value_get_enum (ref val), false); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_value_get_value_type (ref Value val); [DllImport("libgobject-2.0-0.dll")] static extern bool g_type_is_a (IntPtr type, IntPtr is_a_type); + [DllImport("libgobject-2.0-0.dll")] + static extern void g_value_take_boxed (ref Value val, IntPtr data); + public object Val { get { diff --git a/glib/ValueArray.cs b/glib/ValueArray.cs index 585d94150..78a6df9f5 100644 --- a/glib/ValueArray.cs +++ b/glib/ValueArray.cs @@ -72,7 +72,7 @@ namespace GLib { } } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_value_array_get_array (IntPtr raw); public IntPtr ArrayPtr { @@ -113,7 +113,7 @@ namespace GLib { g_value_array_remove (Handle, idx); } - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern int gtksharp_value_array_get_count (IntPtr raw); // ICollection diff --git a/glib/glue/Makefile.am b/glib/glue/Makefile.am index f62fcc1c5..f5d42dfe4 100644 --- a/glib/glue/Makefile.am +++ b/glib/glue/Makefile.am @@ -1,8 +1,8 @@ -lib_LTLIBRARIES = libglibsharpglue.la +lib_LTLIBRARIES = libglibsharpglue-2.0.la -libglibsharpglue_la_LDFLAGS = -module -avoid-version -no-undefined +libglibsharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined -libglibsharpglue_la_SOURCES = \ +libglibsharpglue_2_0_la_SOURCES = \ error.c \ list.c \ object.c \ @@ -15,12 +15,12 @@ libglibsharpglue_la_SOURCES = \ # Adding a new glue file? # Please remember to update makefile.win32 -libglibsharpglue_la_LIBADD = $(GLIB_LIBS) +libglibsharpglue_2_0_la_LIBADD = $(GLIB_LIBS) INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir) -libgtksharpglue.dll: $(libgtksharpglue_la_OBJECTS) libgtksharpglue.rc libgtksharpglue.def - ./build-dll libgtksharpglue $(VERSION) +libgtksharpglue.dll: $(libgtksharpglue_2_0_la_OBJECTS) libgtksharpglue.rc libgtksharpglue.def + ./build-dll libgtksharpglue-2.0 $(VERSION) CLEANFILES = lib*.a lib*.dll diff --git a/glib/glue/makefile.win32 b/glib/glue/makefile.win32 index 120617de1..58f74d099 100755 --- a/glib/glue/makefile.win32 +++ b/glib/glue/makefile.win32 @@ -14,16 +14,16 @@ GLUE_OBJS = \ valuearray.o \ win32dll.o -all: glibsharpglue.dll +all: glibsharpglue-2.0.dll %.o: %.c $(CC) -c $(CFLAGS) $(GTK_CFLAGS) -o $@ $^ -glibsharpglue.dll: $(GLUE_OBJS) - $(DLLWRAP) --output-lib=libglibsharpglue.a --dllname=glibsharpglue.dll --driver-name=gcc --output-def=glibsharpglue.def $(GLUE_OBJS) $(GTK_LIBS) +glibsharpglue-2.0.dll: $(GLUE_OBJS) + $(DLLWRAP) --output-lib=libglibsharpglue-2.0.a --dllname=glibsharpglue-2.0.dll --driver-name=gcc --output-def=glibsharpglue-2.0.def $(GLUE_OBJS) $(GTK_LIBS) clean: - rm -f glibsharpglue.dll *.o libglibsharpglue.a + rm -f glibsharpglue-2.0.dll *.o libglibsharpglue-2.0.a diff --git a/glib/glue/value.c b/glib/glue/value.c index 99b096575..f75f5c088 100644 --- a/glib/glue/value.c +++ b/glib/glue/value.c @@ -25,8 +25,6 @@ void gtksharp_value_create_from_property (GValue *value, GObject *obj, const gchar* name); void gtksharp_value_create_from_type_and_property (GValue *value, GType gtype, const gchar* name); GType gtksharp_value_get_value_type (GValue *value); -gpointer glibsharp_value_get_boxed (GValue *value); -void glibsharp_value_set_boxed (GValue *value, gpointer boxed); /* */ void @@ -51,15 +49,3 @@ gtksharp_value_get_value_type (GValue *value) return G_VALUE_TYPE (value); } -gpointer -glibsharp_value_get_boxed (GValue *value) -{ - return g_value_get_boxed (value); -} - -void -glibsharp_value_set_boxed (GValue *value, gpointer boxed) -{ - g_value_set_boxed (value, boxed); -} - diff --git a/gnome/.cvsignore b/gnome/.cvsignore index 5723fd4b4..f6c52116e 100644 --- a/gnome/.cvsignore +++ b/gnome/.cvsignore @@ -1,4 +1,4 @@ -gnome-sharp.pc +*.pc AssemblyInfo.cs *.dll *.dll.config diff --git a/gnome/Canvas.custom b/gnome/Canvas.custom index 4cf6715cf..6b7c81ee1 100644 --- a/gnome/Canvas.custom +++ b/gnome/Canvas.custom @@ -33,7 +33,7 @@ gnome_canvas_w2c_affine(Handle, affine); } - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern double gnomesharp_canvas_get_pixels_per_unit (IntPtr raw); [DllImport("gnomecanvas-2")] diff --git a/gnome/CanvasItem.custom b/gnome/CanvasItem.custom index d45f96d1e..47241d3a1 100644 --- a/gnome/CanvasItem.custom +++ b/gnome/CanvasItem.custom @@ -34,7 +34,7 @@ g_object_ref (Handle); } - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern IntPtr gtksharp_gnome_canvas_item_get_canvas (IntPtr i); public Canvas Canvas { get { return GLib.Object.GetObject (gtksharp_gnome_canvas_item_get_canvas (this.Handle), false) as Canvas; } @@ -56,10 +56,10 @@ gnome_canvas_item_i2w_affine(Handle, affine); } - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_base_realize (IntPtr handle); - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_override_realize (GLib.GType gtype, RealizeDelegate cb); delegate void RealizeDelegate (IntPtr item); @@ -85,10 +85,10 @@ gnomesharp_canvas_item_base_realize (Handle); } - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern double gnomesharp_canvas_item_base_point (IntPtr handle, double x, double y, int cx, int cy, out IntPtr actual_item_handle); - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_override_point (GLib.GType gtype, PointDelegate cb); delegate double PointDelegate (IntPtr item, double x, double y, int cx, int cy, out IntPtr actual_item_handle); @@ -120,10 +120,10 @@ return result; } - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_base_draw (IntPtr handle, IntPtr drawable, int x, int y, int width, int height); - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_override_draw (GLib.GType gtype, DrawDelegate cb); delegate void DrawDelegate (IntPtr handle, IntPtr drawable, int x, int y, int width, int height); @@ -150,10 +150,10 @@ gnomesharp_canvas_item_base_draw (Handle, drawable.Handle, x, y, width, height); } - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_base_render (IntPtr handle, ref CanvasBuf buf); - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_override_render (GLib.GType gtype, RenderDelegate cb); delegate void RenderDelegate (IntPtr handle, ref CanvasBuf buf); @@ -179,10 +179,10 @@ gnomesharp_canvas_item_base_render (Handle, ref buf); } - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_base_update (IntPtr handle, double[] affine, ref Art.SVP clip_path, int flags); - [DllImport("gnomesharpglue")] + [DllImport("gnomesharpglue-2.0")] static extern void gnomesharp_canvas_item_override_update (GLib.GType gtype, UpdateDelegate cb); delegate void UpdateDelegate (IntPtr item, IntPtr affine_ptr, IntPtr clip_path, int flags); diff --git a/gnome/CanvasPoints.custom b/gnome/CanvasPoints.custom index eaf5a1887..f0268440a 100644 --- a/gnome/CanvasPoints.custom +++ b/gnome/CanvasPoints.custom @@ -23,7 +23,7 @@ // Boston, MA 02111-1307, USA. -[DllImport("gnomesharpglue")] +[DllImport("gnomesharpglue-2.0")] static extern System.IntPtr gtksharp_gnome_canvas_points_new_from_array (uint num_points, double[] coords); diff --git a/gnome/Gnome.metadata b/gnome/Gnome.metadata index d2d7dc0c9..8612c1637 100644 --- a/gnome/Gnome.metadata +++ b/gnome/Gnome.metadata @@ -50,6 +50,8 @@ ArtVpathDash Connected Disconnected + 1 + 1 1 out 1 @@ -94,8 +96,7 @@ IconFocused IconSelected IconUnselected - 1 - 1 + 1 const-gchar* gchar* const-gchar* diff --git a/gnome/IconData.cs b/gnome/IconData.cs new file mode 100644 index 000000000..c3bf5d085 --- /dev/null +++ b/gnome/IconData.cs @@ -0,0 +1,56 @@ +// IconData.cs - Manual implementation of GnomeIconData struct in GTK+-2.4. +// +// Authors: Jeroen Zwartepoorte +// +// Copyright (c) 2004 Novell, Inc. + +namespace Gnome { + + using System; + using System.Collections; + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + public struct IconData { + + public bool HasEmbeddedRect; + public int X0; + public int Y0; + public int X1; + public int Y1; + private IntPtr _attach_points; + + public Gnome.IconDataPoint attach_points { + get { return Gnome.IconDataPoint.New (_attach_points); } + } + public int NAttachPoints; + public string DisplayName; + + public static Gnome.IconData Zero = new Gnome.IconData (); + + public static Gnome.IconData New(IntPtr raw) { + if (raw == IntPtr.Zero) { + return Gnome.IconData.Zero; + } + Gnome.IconData self = new Gnome.IconData(); + self = (Gnome.IconData) Marshal.PtrToStructure (raw, self.GetType ()); + return self; + } + + [DllImport("gnomeui-2")] + static extern void gnome_icon_data_free(ref Gnome.IconData raw); + + public void Free() { + gnome_icon_data_free(ref this); + } + + [DllImport("gnomeui-2")] + static extern IntPtr gnome_icon_data_dup(ref Gnome.IconData raw); + + public Gnome.IconData Dup() { + IntPtr raw_ret = gnome_icon_data_dup(ref this); + Gnome.IconData ret = Gnome.IconData.New (raw_ret); + return ret; + } + } +} diff --git a/gnome/IconTheme.cs b/gnome/IconTheme.cs new file mode 100644 index 000000000..0c8beafa9 --- /dev/null +++ b/gnome/IconTheme.cs @@ -0,0 +1,68 @@ +// IconTheme.cs - Manual implementation of GnomeIconTheme class in GTK+-2.4. +// +// Authors: Jeroen Zwartepoorte +// +// Copyright (c) 2004 Novell, Inc. + +namespace Gnome { + + using System; + using System.Collections; + using System.Runtime.InteropServices; + + public class IconTheme : Gtk.IconTheme { + + ~IconTheme() + { + Dispose(); + } + + protected IconTheme(GLib.GType gtype) : base(gtype) {} + public IconTheme(IntPtr raw) : base(raw) {} + + [DllImport("gnomeui-2")] + static extern IntPtr gnome_icon_theme_new(); + + public IconTheme() : base (IntPtr.Zero) + { + Raw = gnome_icon_theme_new(); + } + + [DllImport("gnomeui-2")] + static extern bool gnome_icon_theme_get_allow_svg(IntPtr raw); + + [DllImport("gnomeui-2")] + static extern void gnome_icon_theme_set_allow_svg(IntPtr raw, bool allow_svg); + + public bool AllowSvg { + get { + bool raw_ret = gnome_icon_theme_get_allow_svg(Handle); + bool ret = raw_ret; + return ret; + } + set { + gnome_icon_theme_set_allow_svg(Handle, value); + } + } + + [DllImport("gnomeui-2")] + static extern IntPtr gnome_icon_theme_lookup_icon(IntPtr raw, string icon_name, int size, ref Gnome.IconData icon_data, out int base_size); + + public string LookupIcon(string icon_name, int size, Gnome.IconData icon_data, out int base_size) { + IntPtr raw_ret = gnome_icon_theme_lookup_icon(Handle, icon_name, size, ref icon_data, out base_size); + string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); + return ret; + } + + [DllImport("gnomeui-2")] + static extern IntPtr gnome_icon_theme_get_type(); + + public static new GLib.GType GType { + get { + IntPtr raw_ret = gnome_icon_theme_get_type(); + GLib.GType ret = new GLib.GType(raw_ret); + return ret; + } + } + } +} diff --git a/gnome/Makefile.am b/gnome/Makefile.am index 28148a4ca..3621d433b 100644 --- a/gnome/Makefile.am +++ b/gnome/Makefile.am @@ -5,7 +5,7 @@ TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gnome-sharp.pc +pkgconfig_DATA = gnome-sharp-2.0.pc else TARGET = @@ -20,14 +20,16 @@ ASSEMBLY_NAME = gnome-sharp references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gtk/gtk-sharp.dll /r:../art/art-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) gapi_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = gnome-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = gnome-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = \ + IconData.cs \ + IconTheme.cs \ Modules.cs \ voidObjectAffineSVPintSignal.cs @@ -60,6 +62,7 @@ customs = \ IconTextItem.custom \ IconTheme.custom \ Print.custom \ + PrintContext.custom \ PrintDialog.custom \ PrintJob.custom \ Program.custom \ @@ -74,7 +77,7 @@ EXTRA_DIST = \ $(METADATA) \ $(customs) \ $(sources) \ - gnome-sharp.pc.in + gnome-sharp-2.0.pc.in $(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/gnome/PrintContext.custom b/gnome/PrintContext.custom new file mode 100644 index 000000000..2b8051828 --- /dev/null +++ b/gnome/PrintContext.custom @@ -0,0 +1,272 @@ + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_beginpage (IntPtr raw, string name); + + public PrintReturnCode BeginPage (string name) { + return (PrintReturnCode)gnome_print_beginpage (Handle, name); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_showpage (IntPtr raw); + + public PrintReturnCode ShowPage () { + return (PrintReturnCode)gnome_print_showpage (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_end_doc (IntPtr raw); + + public PrintReturnCode EndDoc () { + return (PrintReturnCode)gnome_print_end_doc (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_gsave (IntPtr raw); + + public PrintReturnCode SaveGraphicState () { + return (PrintReturnCode)gnome_print_gsave (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_grestore (IntPtr raw); + + public PrintReturnCode RestoreGraphicState () { + return (PrintReturnCode)gnome_print_grestore (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_newpath (IntPtr raw); + + public PrintReturnCode NewPath () { + return (PrintReturnCode)gnome_print_newpath (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_moveto (IntPtr raw, double x, double y); + + public PrintReturnCode MoveTo (double x, double y) { + return (PrintReturnCode)gnome_print_moveto (Handle, x, y); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_lineto (IntPtr raw, double x, double y); + + public PrintReturnCode LineTo (double x, double y) { + return (PrintReturnCode)gnome_print_lineto (Handle, x, y); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_curveto (IntPtr raw, double x1, double y1, double x2, double y2, double x3, double y3); + + public PrintReturnCode CurveTo (double x1, double y1, double x2, double y2, double x3, double y3) { + return (PrintReturnCode)gnome_print_curveto (Handle, x1, y1, x2, y2, x3, y3); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_closepath (IntPtr raw); + + public PrintReturnCode ClosePath () { + return (PrintReturnCode)gnome_print_closepath (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_strokepath (IntPtr raw); + + public PrintReturnCode StrokePath () { + return (PrintReturnCode)gnome_print_strokepath (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_bpath (IntPtr raw, ref Art.Bpath bpath, bool append); + + public PrintReturnCode Bpath (Art.Bpath bpath, bool append) { + return (PrintReturnCode)gnome_print_bpath (Handle, ref bpath, append); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_vpath (IntPtr raw, ref Art.Vpath vpath, bool append); + + public PrintReturnCode Vpath (Art.Vpath vpath, bool append) { + return (PrintReturnCode)gnome_print_vpath (Handle, ref vpath, append); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_arcto (IntPtr raw, double x, double y, double radius, double angle1, double angle2, int direction); + + public PrintReturnCode ArcTo (double x, double y, double radius, double angle1, double angle2, int direction) { + return (PrintReturnCode)gnome_print_arcto (Handle, x, y, radius, angle1, angle2, direction); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setrgbcolor (IntPtr raw, double r, double g, double b); + + public PrintReturnCode SetRgbColor (double r, double g, double b) { + return (PrintReturnCode)gnome_print_setrgbcolor (Handle, r, g, b); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setopacity (IntPtr raw, double opacity); + + public PrintReturnCode SetOpacity (double opacity) { + return (PrintReturnCode)gnome_print_setopacity (Handle, opacity); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setlinewidth (IntPtr raw, double width); + + public PrintReturnCode SetLineWidth (double width) { + return (PrintReturnCode)gnome_print_setlinewidth (Handle, width); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setmiterlimit (IntPtr raw, double limit); + + public PrintReturnCode SetMiterLimit (double limit) { + return (PrintReturnCode)gnome_print_setmiterlimit (Handle, limit); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setlinejoin (IntPtr raw, int jointype); + + public PrintReturnCode SetLineJoin (int jointype) { + return (PrintReturnCode)gnome_print_setlinejoin (Handle, jointype); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setlinecap (IntPtr raw, int captype); + + public PrintReturnCode SetLineCap (int captype) { + return (PrintReturnCode)gnome_print_setlinecap (Handle, captype); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setdash (IntPtr raw, int n_values, IntPtr value, double offset); + + // FIXME! + /*public PrintReturnCode SetDash (double values[], double offset) { + return (PrintReturnCode)gnome_print_setdash (Handle, values.Length, values, offset); + }*/ + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_setfont (IntPtr raw, ref Font font); + + public PrintReturnCode SetFont (Font font) { + return (PrintReturnCode)gnome_print_setfont (Handle, ref font); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_clip (IntPtr raw); + + public PrintReturnCode Clip () { + return (PrintReturnCode)gnome_print_clip (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_eoclip (IntPtr raw); + + public PrintReturnCode EvenOddClip () { + return (PrintReturnCode)gnome_print_eoclip (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_concat (IntPtr raw, IntPtr matrix); + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_scale (IntPtr raw, double sx, double sy); + + public PrintReturnCode Scale (double sx, double sy) { + return (PrintReturnCode)gnome_print_scale (Handle, sx, sy); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_rotate (IntPtr raw, double theta); + + public PrintReturnCode Rotate (double theta) { + return (PrintReturnCode)gnome_print_rotate (Handle, theta); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_translate (IntPtr raw, double x, double y); + + public PrintReturnCode Translate (double x, double y) { + return (PrintReturnCode)gnome_print_translate (Handle, x, y); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_fill (IntPtr raw); + + public PrintReturnCode Fill () { + return (PrintReturnCode)gnome_print_fill (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_eofill (IntPtr raw); + + public PrintReturnCode EvenOddFill () { + return (PrintReturnCode)gnome_print_eofill (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_stroke (IntPtr raw); + + public PrintReturnCode Stroke () { + return (PrintReturnCode)gnome_print_stroke (Handle); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_show (IntPtr raw, string text); + + public PrintReturnCode Show (string text) { + return (PrintReturnCode)gnome_print_show (Handle, text); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_show_sized (IntPtr raw, string text, int bytes); + + public PrintReturnCode ShowSized (string text, int bytes) { + return (PrintReturnCode)gnome_print_show_sized (Handle, text, bytes); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_glyphlist (IntPtr raw, IntPtr glyphlist); + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_grayimage (IntPtr raw, string data, int width, int height, int rowstride); + + public PrintReturnCode GrayImage (string data, int width, int height, int rowstride) { + return (PrintReturnCode)gnome_print_grayimage (Handle, data, width, height, rowstride); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_rgbimage (IntPtr raw, string data, int width, int height, int rowstride); + + public PrintReturnCode RgbImage (string data, int width, int height, int rowstride) { + return (PrintReturnCode)gnome_print_rgbimage (Handle, data, width, height, rowstride); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_rgbaimage (IntPtr raw, string data, int width, int height, int rowstride); + + public PrintReturnCode RgbaImage (string data, int width, int height, int rowstride) { + return (PrintReturnCode)gnome_print_rgbaimage (Handle, data, width, height, rowstride); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_line_stroked (IntPtr raw, double x0, double y0, double x1, double y1); + + public PrintReturnCode LineStroked (double x0, double y0, double x1, double y1) { + return (PrintReturnCode)gnome_print_line_stroked (Handle, x0, y0, x1, y1); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_rect_stroked (IntPtr raw, double x, double y, double width, double height); + + public PrintReturnCode RectStroked (double x, double y, double width, double height) { + return (PrintReturnCode)gnome_print_rect_stroked (Handle, x, y, width, height); + } + + [DllImport("gnomeprint-2-2")] + static extern int gnome_print_rect_filled (IntPtr raw, double x, double y, double width, double height); + + public PrintReturnCode RectFilled (double x, double y, double width, double height) { + return (PrintReturnCode)gnome_print_rect_filled (Handle, x, y, width, height); + } diff --git a/gnome/Program.custom b/gnome/Program.custom index d14d11007..1b791844c 100644 --- a/gnome/Program.custom +++ b/gnome/Program.custom @@ -32,7 +32,7 @@ struct PropertyArg { public GLib.Value value; } -[DllImport("gnomesharpglue")] +[DllImport("gnomesharpglue-2.0")] static extern System.IntPtr gtksharp_gnome_program_init (string app_id, string app_version, ref ModuleInfo module, int argc, string[] argv, int nargs, PropertyArg[] args); diff --git a/gnome/glue/Makefile.am b/gnome/glue/Makefile.am index 697e15342..30a66c254 100644 --- a/gnome/glue/Makefile.am +++ b/gnome/glue/Makefile.am @@ -1,14 +1,14 @@ lib_LTLIBRARIES = $(TARGET) if ENABLE_GNOME -TARGET = libgnomesharpglue.la +TARGET = libgnomesharpglue-2.0.la else TARGET = endif -libgnomesharpglue_la_LDFLAGS = -module -avoid-version -no-undefined +libgnomesharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined -libgnomesharpglue_la_SOURCES = \ +libgnomesharpglue_2_0_la_SOURCES = \ canvas.c \ canvasitem.c \ canvaspoints.c \ @@ -19,12 +19,12 @@ libgnomesharpglue_la_SOURCES = \ program.c \ # -libgnomesharpglue_la_LIBADD = $(GNOME_LIBS) +libgnomesharpglue_2_0_la_LIBADD = $(GNOME_LIBS) INCLUDES = $(GNOME_CFLAGS) -I$(top_srcdir) -libgnomesharpglue.dll: $(libgnomesharpglue_la_OBJECTS) libgnomesharpglue.rc libgnomesharpglue.def - ./build-dll libgnomesharpglue $(VERSION) +libgnomesharpglue.dll: $(libgnomesharpglue_2_0_la_OBJECTS) libgnomesharpglue.rc libgnomesharpglue.def + ./build-dll libgnomesharpglue-2.0 $(VERSION) CLEANFILES = lib*.a lib*.dll diff --git a/gnome/gnome-api.raw b/gnome/gnome-api.raw index 1b913fa8d..e71494082 100644 --- a/gnome/gnome-api.raw +++ b/gnome/gnome-api.raw @@ -34,6 +34,11 @@ + + + + + @@ -1746,11 +1751,11 @@ - - - - - + + + + + @@ -1761,6 +1766,7 @@ + @@ -1771,6 +1777,11 @@ + + + + + @@ -1849,6 +1860,18 @@ + + + + + + + + + + + + @@ -2071,6 +2094,12 @@ + + + + + + @@ -2137,6 +2166,12 @@ + + + + + + @@ -2208,12 +2243,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2229,6 +2326,22 @@ + + + + + + + + + + + + + + + + @@ -2241,6 +2354,13 @@ + + + + + + + @@ -2273,6 +2393,12 @@ + + + + + + @@ -2434,6 +2560,9 @@ + + + @@ -2599,7 +2728,7 @@ - + @@ -2618,7 +2747,7 @@ - + @@ -2627,10 +2756,10 @@ - + - + @@ -2639,7 +2768,7 @@ - + @@ -2648,17 +2777,17 @@ - + - + - + - - + + @@ -2667,13 +2796,13 @@ - + - + @@ -2682,7 +2811,7 @@ - + @@ -2691,13 +2820,13 @@ - + - + @@ -2730,6 +2859,9 @@ + + + @@ -2775,6 +2907,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3121,7 +3412,7 @@ - + @@ -3134,53 +3425,53 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -3211,6 +3502,8 @@ + + @@ -3254,6 +3547,12 @@ + + + + + + @@ -3279,7 +3578,7 @@ - + @@ -3296,63 +3595,66 @@ - + - + - + + + + - + - + - + - + - - + + - + - + - + - + - + @@ -3370,6 +3672,9 @@ + + + @@ -3385,6 +3690,12 @@ + + + + + + @@ -3472,6 +3783,12 @@ + + + + + + @@ -3914,86 +4231,76 @@ - - + - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - + - + + + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4012,6 +4319,15 @@ + + + + + + + + + @@ -4045,6 +4361,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4197,27 +4561,17 @@ + - - - - - - - - - - - - - - - - + + + + + @@ -4308,9 +4662,24 @@ + + + + + + + + + + + + + + + @@ -4321,12 +4690,32 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -4355,7 +4744,7 @@ - + @@ -4364,11 +4753,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -4381,7 +4811,7 @@ - + @@ -4390,15 +4820,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -4406,7 +5000,7 @@ - + @@ -4417,7 +5011,7 @@ - + @@ -4428,19 +5022,19 @@ - + - + - + @@ -4448,6 +5042,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4486,6 +5164,21 @@ + + + + + + + + + + + + + + + @@ -4522,7 +5215,7 @@ - + @@ -4535,6 +5228,7 @@ + @@ -5053,6 +5747,14 @@ + + + + + + + + @@ -5060,9 +5762,31 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -5139,6 +5863,7 @@ + @@ -5197,6 +5922,12 @@ + + + + + + @@ -5336,6 +6067,13 @@ + + + + + + + @@ -5356,6 +6094,12 @@ + + + + + + @@ -5445,7 +6189,8 @@ - + + @@ -5746,6 +6491,11 @@ + + + + + @@ -5848,7 +6598,7 @@ - + @@ -6107,6 +6857,12 @@ + + + + + + @@ -6186,6 +6942,13 @@ + + + + + + + @@ -6378,6 +7141,9 @@ + + + @@ -6505,6 +7271,10 @@ + + + + @@ -6518,12 +7288,32 @@ + + + + + + + + + + + + + + + + + + + + @@ -6586,7 +7376,7 @@ - + @@ -6609,6 +7399,9 @@ + + + @@ -6618,6 +7411,8 @@ + + @@ -6690,6 +7485,25 @@ + + + + + + + + + + + + + + + + + + + @@ -6708,6 +7522,17 @@ + + + + + + + + + + + @@ -6727,6 +7552,15 @@ + + + + + + + + + @@ -6743,6 +7577,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -6753,15 +7608,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + @@ -6790,6 +7704,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gnome/gnome-sharp.pc.in b/gnome/gnome-sharp-2.0.pc.in similarity index 59% rename from gnome/gnome-sharp.pc.in rename to gnome/gnome-sharp-2.0.pc.in index 24144cd22..d42bb286a 100644 --- a/gnome/gnome-sharp.pc.in +++ b/gnome/gnome-sharp-2.0.pc.in @@ -6,5 +6,5 @@ libdir=${exec_prefix}/lib Name: Gnome# Description: Gnome# - GNOME .NET Binding Version: @VERSION@ -Requires: gtk-sharp art-sharp -Libs: -r:${libdir}/mono/@PACKAGE@/gnome-sharp.dll +Requires: gtk-sharp-2.0 art-sharp-2.0 +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/gnome-sharp.dll diff --git a/gnomedb/.cvsignore b/gnomedb/.cvsignore index c678b7efc..f6c52116e 100755 --- a/gnomedb/.cvsignore +++ b/gnomedb/.cvsignore @@ -1,4 +1,4 @@ -gnomedb-sharp.pc +*.pc AssemblyInfo.cs *.dll *.dll.config diff --git a/gnomedb/Makefile.am b/gnomedb/Makefile.am index 0612bba9d..c40d893a8 100644 --- a/gnomedb/Makefile.am +++ b/gnomedb/Makefile.am @@ -2,7 +2,7 @@ if ENABLE_GNOMEDB TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gnomedb-sharp.pc +pkgconfig_DATA = gnomedb-sharp-2.0.pc else TARGET = APIS = @@ -15,12 +15,12 @@ ASSEMBLY_NAME = gnomedb-sharp references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gtk/gtk-sharp.dll /r:../art/art-sharp.dll /r:../gnome/gnome-sharp.dll /r:../gda/gda-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) gapi_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = gnomedb-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = gnomedb-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = \ Application.cs @@ -38,7 +38,7 @@ EXTRA_DIST = \ $(METADATA) \ $(customs) \ $(sources) \ - gnomedb-sharp.pc.in + gnomedb-sharp-2.0.pc.in $(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/gnomedb/gnomedb-sharp.pc.in b/gnomedb/gnomedb-sharp-2.0.pc.in similarity index 70% rename from gnomedb/gnomedb-sharp.pc.in rename to gnomedb/gnomedb-sharp-2.0.pc.in index 52f30a30d..8dbff27c4 100644 --- a/gnomedb/gnomedb-sharp.pc.in +++ b/gnomedb/gnomedb-sharp-2.0.pc.in @@ -6,4 +6,4 @@ libdir=${exec_prefix}/lib Name: GnomeDB# Description: GnomeDB# - GNOMEDB .NET Binding Version: @VERSION@ -Libs: -r:${libdir}/mono/@PACKAGE@/gnomedb-sharp.dll +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/gnomedb-sharp.dll diff --git a/gnomedb/gnomedb-sharp.dll.config.in b/gnomedb/gnomedb-sharp.dll.config.in index a543b1ac7..38d6eb598 100644 --- a/gnomedb/gnomedb-sharp.dll.config.in +++ b/gnomedb/gnomedb-sharp.dll.config.in @@ -1,3 +1,4 @@ + diff --git a/gnomevfs/.cvsignore b/gnomevfs/.cvsignore new file mode 100644 index 000000000..02836d153 --- /dev/null +++ b/gnomevfs/.cvsignore @@ -0,0 +1,10 @@ +*.dll +*.dll.config +AssemblyInfo.cs +generated +generated-stamp +Makefile +Makefile.in +*-api.xml +*.pc +gtk-sharp.snk diff --git a/gnomevfs/AssemblyInfo.cs.in b/gnomevfs/AssemblyInfo.cs.in new file mode 100644 index 000000000..427e3925d --- /dev/null +++ b/gnomevfs/AssemblyInfo.cs.in @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly:AssemblyVersion("@API_VERSION@")] +[assembly:AssemblyDelaySign(true)] +[assembly:AssemblyKeyFile("gtk-sharp.snk")] diff --git a/gnomevfs/Async.cs b/gnomevfs/Async.cs new file mode 100644 index 000000000..0c29b3f36 --- /dev/null +++ b/gnomevfs/Async.cs @@ -0,0 +1,99 @@ +// +// Async.cs: Bindings for gnome-vfs asynchronized functions calls. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public class Async { + public enum Priority { + Min = -10, + Default = 0, + Max = 10 + } + + [DllImport ("gnomevfs-2")] + private static extern void gnome_vfs_async_cancel (IntPtr handle); + + public static void Cancel (Handle handle) + { + gnome_vfs_async_cancel (handle.Raw); + } + + [DllImport ("gnomevfs-2")] + private static extern void gnome_vfs_async_close (IntPtr handle, AsyncCallbackNative callback, IntPtr data); + + public static void Close (Handle handle, AsyncCallback callback) + { + AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null); + gnome_vfs_async_close (handle.Raw, wrapper.NativeDelegate, IntPtr.Zero); + } + + [DllImport ("gnomevfs-2")] + private static extern void gnome_vfs_async_create (out IntPtr handle, string uri, OpenMode mode, bool exclusive, uint perm, int priority, AsyncCallbackNative callback, IntPtr data); + + public static Handle Create (string uri, OpenMode mode, bool exclusive, FilePermissions perm, int priority, AsyncCallback callback) + { + IntPtr handle = IntPtr.Zero; + AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null); + gnome_vfs_async_create (out handle, uri, mode, exclusive, (uint)perm, priority, wrapper.NativeDelegate, IntPtr.Zero); + return new Handle (handle); + } + + public static Handle Create (Uri uri, OpenMode mode, bool exclusive, FilePermissions perm, int priority, AsyncCallback callback) + { + return Create (uri.ToString (), mode, exclusive, perm, priority, callback); + } + + [DllImport ("gnomevfs-2")] + private static extern void gnome_vfs_async_open (out IntPtr handle, string uri, OpenMode mode, int priority, AsyncCallbackNative callback, IntPtr data); + + public static Handle Open (string uri, OpenMode mode, int priority, AsyncCallback callback) + { + IntPtr handle = IntPtr.Zero; + AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null); + gnome_vfs_async_open (out handle, uri, mode, priority, wrapper.NativeDelegate, IntPtr.Zero); + return new Handle (handle); + } + + public static Handle Open (Uri uri, OpenMode mode, int priority, AsyncCallback callback) + { + return Open (uri.ToString (), mode, priority, callback); + } + + [DllImport ("gnomevfs-2")] + private static extern void gnome_vfs_async_read (IntPtr handle, out byte buffer, uint bytes, AsyncReadCallbackNative callback, IntPtr data); + + public static void Read (Handle handle, out byte buffer, uint bytes, AsyncReadCallback callback) + { + AsyncReadCallbackWrapper wrapper = new AsyncReadCallbackWrapper (callback, null); + gnome_vfs_async_read (handle.Raw, out buffer, bytes, wrapper.NativeDelegate, IntPtr.Zero); + } + + [DllImport ("gnomevfs-2")] + private static extern void gnome_vfs_async_seek (IntPtr handle, SeekPosition whence, long offset, AsyncCallbackNative callback, IntPtr data); + + public static void Seek (Handle handle, SeekPosition whence, long offset, AsyncCallback callback) + { + AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null); + gnome_vfs_async_seek (handle.Raw, whence, offset, wrapper.NativeDelegate, IntPtr.Zero); + } + + [DllImport ("gnomevfs-2")] + private static extern void gnome_vfs_async_write (IntPtr handle, out byte buffer, uint bytes, AsyncWriteCallbackNative callback, IntPtr data); + + public static void Write (Handle handle, out byte buffer, uint bytes, AsyncWriteCallback callback) + { + AsyncWriteCallbackWrapper wrapper = new AsyncWriteCallbackWrapper (callback, null); + gnome_vfs_async_write (handle.Raw, out buffer, bytes, wrapper.NativeDelegate, IntPtr.Zero); + } + + } +} diff --git a/gnomevfs/AsyncCallback.cs b/gnomevfs/AsyncCallback.cs new file mode 100644 index 000000000..4c085cb57 --- /dev/null +++ b/gnomevfs/AsyncCallback.cs @@ -0,0 +1,12 @@ +// +// AsyncCallback.cs: GnomeVFSAsyncCallback delegate. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +namespace Gnome.Vfs { + public delegate void AsyncCallback (Handle handle, Result result); +} diff --git a/gnomevfs/AsyncCallbackNative.cs b/gnomevfs/AsyncCallbackNative.cs new file mode 100644 index 000000000..1f4b50e2c --- /dev/null +++ b/gnomevfs/AsyncCallbackNative.cs @@ -0,0 +1,31 @@ +// +// AsyncCallbackNative.cs: Native wrapper for GnomeVFSAsyncCallback. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; + +namespace Gnome.Vfs { + internal delegate void AsyncCallbackNative (IntPtr handle, Result result, IntPtr data); + + internal class AsyncCallbackWrapper : GLib.DelegateWrapper { + + public void NativeCallback (IntPtr handle, Result result, IntPtr data) + { + _managed (new Handle (handle), result); + } + + internal AsyncCallbackNative NativeDelegate; + protected AsyncCallback _managed; + + public AsyncCallbackWrapper (AsyncCallback managed, object o) : base (o) + { + NativeDelegate = new AsyncCallbackNative (NativeCallback); + _managed = managed; + } + } +} diff --git a/gnomevfs/AsyncReadCallback.cs b/gnomevfs/AsyncReadCallback.cs new file mode 100644 index 000000000..a0dd48aa5 --- /dev/null +++ b/gnomevfs/AsyncReadCallback.cs @@ -0,0 +1,14 @@ +// +// VfsAsyncReadCallback.cs: GnomeVFSAsyncReadCallback delegate. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; + +namespace Gnome.Vfs { + public delegate void AsyncReadCallback (Handle handle, Result result, byte[] buffer, ulong bytes_requested, ulong bytes_read); +} diff --git a/gnomevfs/AsyncReadCallbackNative.cs b/gnomevfs/AsyncReadCallbackNative.cs new file mode 100644 index 000000000..bd450df78 --- /dev/null +++ b/gnomevfs/AsyncReadCallbackNative.cs @@ -0,0 +1,34 @@ +// +// VfsAsyncReadCallbackNative.cs: Utility class for accessing gnome-vfs methods. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + internal delegate void AsyncReadCallbackNative (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_read, IntPtr data); + + internal class AsyncReadCallbackWrapper : GLib.DelegateWrapper { + + public void NativeCallback (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_read, IntPtr data) + { + byte[] bytes = new byte[bytes_read]; + Marshal.Copy (buffer, bytes, 0, (int)bytes_read); + _managed (new Handle (handle), result, bytes, bytes_requested, bytes_read); + } + + internal AsyncReadCallbackNative NativeDelegate; + protected AsyncReadCallback _managed; + + public AsyncReadCallbackWrapper (AsyncReadCallback managed, object o) : base (o) + { + NativeDelegate = new AsyncReadCallbackNative (NativeCallback); + _managed = managed; + } + } +} diff --git a/gnomevfs/AsyncWriteCallback.cs b/gnomevfs/AsyncWriteCallback.cs new file mode 100644 index 000000000..9be105845 --- /dev/null +++ b/gnomevfs/AsyncWriteCallback.cs @@ -0,0 +1,12 @@ +// +// VfsAsyncWriteCallback.cs: GnomeVFSAsyncWriteCallback delegate. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +namespace Gnome.Vfs { + public delegate void AsyncWriteCallback (Handle handle, Result result, byte[] buffer, ulong bytes_requested, ulong bytes_written); +} diff --git a/gnomevfs/AsyncWriteCallbackNative.cs b/gnomevfs/AsyncWriteCallbackNative.cs new file mode 100644 index 000000000..5016b7136 --- /dev/null +++ b/gnomevfs/AsyncWriteCallbackNative.cs @@ -0,0 +1,34 @@ +// +// AsyncWriteCallbackNative.cs: Native wrapper for GnomeVFSAsyncWriteCallback. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + internal delegate void AsyncWriteCallbackNative (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_written, IntPtr data); + + internal class AsyncWriteCallbackWrapper : GLib.DelegateWrapper { + + public void NativeCallback (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_written, IntPtr data) + { + byte[] bytes = new byte[bytes_written]; + Marshal.Copy (buffer, bytes, 0, (int)bytes_written); + _managed (new Handle (handle), result, bytes, bytes_requested, bytes_written); + } + + internal AsyncWriteCallbackNative NativeDelegate; + protected AsyncWriteCallback _managed; + + public AsyncWriteCallbackWrapper (AsyncWriteCallback managed, object o) : base (o) + { + NativeDelegate = new AsyncWriteCallbackNative (NativeCallback); + _managed = managed; + } + } +} diff --git a/gnomevfs/FileInfo.cs b/gnomevfs/FileInfo.cs new file mode 100644 index 000000000..816b49fb5 --- /dev/null +++ b/gnomevfs/FileInfo.cs @@ -0,0 +1,318 @@ +// +// FileInfo.cs: Class wrapping the GnomeVFSFileInfo struct. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public class FileInfo { + [StructLayout(LayoutKind.Sequential)] + internal struct FileInfoNative { + public IntPtr name; + public FileInfoFields valid_fields; + public FileType type; + public FilePermissions permissions; + public FileFlags flags; + public long dev_t; + public long inode; + public uint link_count; + public uint uid; + public uint gid; + public long size; + public long block_count; + public uint io_block_size; + public IntPtr atime; + public IntPtr mtime; + public IntPtr ctime; + public IntPtr symlink_name; + public IntPtr mime_type; + public uint refcount; + public IntPtr reserved1; + public IntPtr reserved2; + public IntPtr reserved3; + public IntPtr reserved4; + public IntPtr reserved5; + } + + private FileInfoNative info; + private Uri uri; + private FileInfoOptions options; + + [DllImport ("gnomevfs-2")] + extern static FileInfoNative gnome_vfs_file_info_new (); + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_get_file_info_uri (IntPtr uri, ref FileInfoNative info, FileInfoOptions options); + + [DllImport ("gnomevfs-2")] + extern static void gnome_vfs_file_info_unref (ref FileInfoNative info); + + public FileInfo (string uri) : this (uri, FileInfoOptions.Default) {} + + public FileInfo (string uri, FileInfoOptions options) : this (new Uri (uri), options) {} + + public FileInfo (Uri uri) : this (uri, FileInfoOptions.Default) {} + + public FileInfo (Uri uri, FileInfoOptions options) + { + this.uri = uri; + this.options = options; + info = gnome_vfs_file_info_new (); + + Result result = gnome_vfs_get_file_info_uri (uri.Handle, ref info, options); + Vfs.ThrowException (uri, result); + } + + public string Name { + get { + if (info.name != IntPtr.Zero) + return Marshal.PtrToStringAnsi (info.name); + else + return null; + } + } + + public FileInfoFields ValidFields { + get { + return info.valid_fields; + } + } + + public FileType Type { + get { + if ((ValidFields & FileInfoFields.Type) != 0) + return info.type; + else + throw new ArgumentException ("Type is not set"); + } + } + + public FilePermissions Permissions { + get { + if ((ValidFields & FileInfoFields.Permissions) != 0) + return info.permissions; + else + throw new ArgumentException ("Permissions is not set"); + } + } + + public FileFlags Flags { + get { + if ((ValidFields & FileInfoFields.Flags) != 0) + return info.flags; + else + throw new ArgumentException ("Flags is not set"); + } + } + + public long Device { + get { + if ((ValidFields & FileInfoFields.Device) != 0) + return info.dev_t; + else + throw new ArgumentException ("Device is not set"); + } + } + + public long Inode { + get { + if ((ValidFields & FileInfoFields.Inode) != 0) + return info.inode; + else + throw new ArgumentException ("Inode is not set"); + } + } + + public uint LinkCount { + get { + if ((ValidFields & FileInfoFields.LinkCount) != 0) + return info.link_count; + else + throw new ArgumentException ("LinkCount is not set"); + } + } + + public uint Uid { + get { + return info.uid; + } + } + + public uint Gid { + get { + return info.gid; + } + } + + public long Size { + get { + if ((ValidFields & FileInfoFields.Size) != 0) + return info.size; + else + throw new ArgumentException ("Size is not set"); + } + } + + public long BlockCount { + get { + if ((ValidFields & FileInfoFields.BlockCount) != 0) + return info.block_count; + else + throw new ArgumentException ("BlockCount is not set"); + } + } + + public uint IoBlockSize { + get { + if ((ValidFields & FileInfoFields.IoBlockSize) != 0) + return info.io_block_size; + else + throw new ArgumentException ("IoBlockSize is not set"); + } + } + + public System.DateTime Atime { + get { + if ((ValidFields & FileInfoFields.Atime) != 0) + return GLib.Marshaller.time_tToDateTime (info.atime); + else + throw new ArgumentException ("Atime is not set"); + } + } + + public System.DateTime Mtime { + get { + if ((ValidFields & FileInfoFields.Mtime) != 0) + return GLib.Marshaller.time_tToDateTime (info.mtime); + else + throw new ArgumentException ("Mtime is not set"); + } + } + + public System.DateTime Ctime { + get { + if ((ValidFields & FileInfoFields.Ctime) != 0) + return GLib.Marshaller.time_tToDateTime (info.ctime); + else + throw new ArgumentException ("Ctime is not set"); + } + } + + public string SymlinkName { + get { + if ((ValidFields & FileInfoFields.SymlinkName) != 0 && + info.symlink_name != IntPtr.Zero) + return Marshal.PtrToStringAnsi (info.symlink_name); + else + throw new ArgumentException ("SymlinkName is not set"); + } + } + + public string MimeType { + get { + if ((ValidFields & FileInfoFields.MimeType) != 0 && + info.mime_type != IntPtr.Zero) + return Marshal.PtrToStringAnsi (info.mime_type); + else + throw new ArgumentException ("MimeType is not set"); + } + } + + public bool IsSymlink { + get { + FileFlags flags = Flags; + return (flags & FileFlags.Symlink) != 0; + } + } + + public bool IsLocal { + get { + FileFlags flags = Flags; + return (flags & FileFlags.Local) != 0; + } + } + + public bool HasSuid { + get { + FilePermissions perms = Permissions; + return (perms & FilePermissions.Suid) != 0; + } + } + + public bool HasSgid { + get { + FilePermissions perms = Permissions; + return (perms & FilePermissions.Sgid) != 0; + } + } + + public bool IsSticky { + get { + FilePermissions perms = Permissions; + return (perms & FilePermissions.Sticky) != 0; + } + } + + public void Update () + { + Result result = gnome_vfs_get_file_info_uri (uri.Handle, ref info, options); + Vfs.ThrowException (uri, result); + } + + public override String ToString () + { + string result = "Name = " + Name + "\n" + + "ValidFields = " + info.valid_fields + "\n"; + if ((ValidFields & FileInfoFields.Type) != 0) + result += "Type = " + info.type + "\n"; + if ((ValidFields & FileInfoFields.Permissions) != 0) + result += "Permissions = " + info.permissions + "\n"; + if ((ValidFields & FileInfoFields.Flags) != 0) { + result += "Flags = "; + bool flag = false; + if ((Flags & FileFlags.None) != 0) { + result += "None"; + flag = true; + } + if ((Flags & FileFlags.Symlink) != 0) { + result += flag ? ", Symlink" : "Symlink"; + flag = true; + } + if ((Flags & FileFlags.Local) != 0) + result += flag ? ", Local" : "Local"; + result += "\n"; + } + if ((ValidFields & FileInfoFields.Device) != 0) + result += "Device = " + info.dev_t + "\n"; + if ((ValidFields & FileInfoFields.Inode) != 0) + result += "Inode = " + info.inode + "\n"; + if ((ValidFields & FileInfoFields.LinkCount) != 0) + result += "LinkCount = " + info.link_count + "\n"; + result += "Uid = " + info.uid + "\n"; + result += "Gid = " + info.gid + "\n"; + if ((ValidFields & FileInfoFields.Size) != 0) + result += "Size = " + info.size + "\n"; + if ((ValidFields & FileInfoFields.BlockCount) != 0) + result += "BlockCount = " + info.block_count + "\n"; + if ((ValidFields & FileInfoFields.IoBlockSize) != 0) + result += "IoBlockSize = " + info.io_block_size + "\n"; + if ((ValidFields & FileInfoFields.Atime) != 0) + result += "Atime = " + Atime + "\n"; + if ((ValidFields & FileInfoFields.Mtime) != 0) + result += "Mtime = " + Mtime + "\n"; + if ((ValidFields & FileInfoFields.Ctime) != 0) + result += "Ctime = " + Ctime + "\n"; + if ((ValidFields & FileInfoFields.SymlinkName) != 0) + result += "SymlinkName = " + SymlinkName + "\n"; + if ((ValidFields & FileInfoFields.MimeType) != 0) + result += "MimeType = " + MimeType + "\n"; + return result; + } + } +} diff --git a/gnomevfs/Gnomevfs.metadata b/gnomevfs/Gnomevfs.metadata new file mode 100644 index 000000000..b2b07d5e4 --- /dev/null +++ b/gnomevfs/Gnomevfs.metadata @@ -0,0 +1,113 @@ + + + AsyncCloseCallback + AsyncCreateAsChannelCallback + AsyncCreateCallback + AsyncOpenCallback + AsyncSeekCallback + InodeNumber + MethodHandle + 1 + 1 + 1 + 1 + DeviceType + DirectoryVisitOptions + FileFlags + FileInfoFields + FileInfoOptions + FilePermissions + 1 << 11 + 1 << 10 + 1 << 9 + 1 << 8 + 1 << 7 + 1 << 6 + UserRead | UserWrite | UserExec + 1 << 5 + 1 << 4 + 1 << 3 + GroupRead | GroupWrite | GroupExec + 1 << 2 + 1 << 1 + 1 + OtherRead | OtherWrite | OtherExec + FileType + FindDirectoryKind + MakeURIDirs + MimeActionType + MimeApplicationArgumentType + ModuleCallbackFullAuthenticationFlags + MonitorEventType + MonitorType + OpenMode + ProcessOptions + ProcessResult + ProcessRunResult + Result + SeekPosition + SetFileInfoMask + UriHideOptions + VolumeType + XferErrorAction + XferErrorMode + XferOptions + XferOverwriteAction + XferOverwriteMode + XferPhase + XferProgressStatus + 1 + 1 + 1 + MimeMonitor + Drive + Volume + GetHandlesTrash + VolumeMonitor + VolumeMonitorClient + VolumeMonitorDaemon + 1 + Cancellation + Context + 1 + 1 + FindDirectoryResult + GetFileInfoResult + 1 + InetConnection + Method + MimeAction + MimeApplication + 1 + ModuleCallbackAdditionalHeadersIn + ModuleCallbackAdditionalHeadersOut + ModuleCallbackAuthenticationIn + ModuleCallbackAuthenticationOut + 1 + ModuleCallbackFillAuthenticationIn + ModuleCallbackFillAuthenticationOut + ModuleCallbackFullAuthenticationIn + ModuleCallbackFullAuthenticationOut + ModuleCallbackReceivedHeadersIn + ModuleCallbackReceivedHeadersOut + ModuleCallbackSaveAuthenticationIn + ModuleCallbackSaveAuthenticationOut + ModuleCallbackStatusMessageIn + ModuleCallbackStatusMessageOut + 1 + Process + ProgressCallbackState + Ssl + Socket + SocketBuffer + SocketImpl + ToplevelUri + Transform + Uri + GetExists + UnixMount + UnixMountPoint + XferProgressInfo + 1 + 1 + diff --git a/gnomevfs/Handle.cs b/gnomevfs/Handle.cs new file mode 100644 index 000000000..a7294a24b --- /dev/null +++ b/gnomevfs/Handle.cs @@ -0,0 +1,27 @@ +// +// Handle.cs: Wrapper class for GnomeVFSHandle struct. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; + +namespace Gnome.Vfs { + public class Handle { + private IntPtr raw; + + internal IntPtr Raw { + get { + return raw; + } + } + + internal Handle (IntPtr raw) + { + this.raw = raw; + } + } +} diff --git a/gnomevfs/Makefile.am b/gnomevfs/Makefile.am new file mode 100644 index 000000000..b0c59710a --- /dev/null +++ b/gnomevfs/Makefile.am @@ -0,0 +1,88 @@ +SUBDIRS = . + +API = gnomevfs-api.xml +ADDITIONAL_API = gnomevfs-symbols.xml +RAW_API = gnomevfs-api.raw +INCLUDE_API = +METADATA = Gnomevfs.metadata +ASSEMBLY_NAME = gnome-vfs-sharp +references = /r:../glib/glib-sharp.dll + +TARGET = $(ASSEMBLY) +ASSEMBLY = $(ASSEMBLY_NAME).dll +gapidir = $(datadir)/gapi-2.0 +noinst_DATA = $(ASSEMBLY) $(ASSEMBLY).config +gapi_DATA = $(API) $(ADDITIONAL_API) +CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) glue/generated.c gtk-sharp.snk +DISTCLEANFILES = $(ASSEMBLY).config AssemblyInfo.cs gnome-vfs-sharp.pc + +sources = \ + Async.cs \ + AsyncCallback.cs \ + AsyncCallbackNative.cs \ + AsyncReadCallback.cs \ + AsyncReadCallbackNative.cs \ + AsyncWriteCallback.cs \ + AsyncWriteCallbackNative.cs \ + FileInfo.cs \ + Handle.cs \ + MimeType.cs \ + Monitor.cs \ + Sync.cs \ + Vfs.cs \ + VfsStream.cs \ + VfsStreamAsyncResult.cs \ + Xfer.cs \ + XferProgressCallback.cs \ + XferProgressCallbackNative.cs + +build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs + +customs = \ + Uri.custom \ + VolumeMonitor.custom + +build_customs = $(addprefix $(srcdir)/, $(customs)) + +EXTRA_DIST = \ + $(ASSEMBLY).config.in \ + AssemblyInfo.cs.in \ + $(RAW_API) \ + $(ADDITIONAL_API) \ + $(METADATA) \ + $(customs) \ + $(sources) + +$(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) + cp $(srcdir)/$(RAW_API) $(API) + chmod u+w $(API) + $(RUNTIME) ../parser/gapi-fixup.exe --api=$(API) --metadata=$(srcdir)/$(METADATA) + +generated-stamp: $(API) $(srcdir)/$(ADDITIONAL_API) ../generator/gapi_codegen.exe $(build_customs) + rm -f generated/* && \ + $(RUNTIME) ../generator/gapi_codegen.exe --generate $(API) $(srcdir)/$(ADDITIONAL_API) \ + --outdir=generated --customdir=$(srcdir) --assembly-name=$(ASSEMBLY_NAME) \ + --gluelib-name=gtksharpglue --glue-filename=glue/generated.c \ + && touch generated-stamp + +gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk + cp $(top_srcdir)/gtk-sharp.snk . + +$(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk + $(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = gnome-vfs-sharp-2.0.pc + +install-data-local: + @if test -n '$(TARGET)'; then \ + echo "$(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS)"; \ + $(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS) || exit 1; \ + fi + +uninstall-local: + @if test -n '$(TARGET)'; then \ + echo "$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \ + $(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; \ + fi + diff --git a/gnomevfs/Mime.cs b/gnomevfs/Mime.cs new file mode 100644 index 000000000..2fd700aad --- /dev/null +++ b/gnomevfs/Mime.cs @@ -0,0 +1,85 @@ +// +// Mime.cs: Mime-type method bindings. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public class Mime { + public static string UnknownMimeType { + get { + return "application/octet-stream"; + } + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_mime_add_extension (string mime_type, string extension); + + public static Result AddExtension (string mime_type, string extension) + { + return gnome_vfs_mime_add_extension (mime_type, extension); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_mime_remove_extension (string mime_type, string extension); + + public static Result RemoveExtension (string mime_type, string extension) + { + return gnome_vfs_mime_remove_extension (mime_type, extension); + } + + [DllImport ("gnomevfs-2")] + private static extern string gnome_vfs_get_mime_type (string uri); + + public static string GetMimeType (string uri) + { + return gnome_vfs_get_mime_type (uri); + } + + [DllImport ("gnomevfs-2")] + private static extern string gnome_vfs_get_mime_type_for_data (string data, int length); + + public static string GetMimeTypeForData (string data, int length) + { + return gnome_vfs_get_mime_type_for_data (data, length); + } + + [DllImport ("gnomevfs-2")] + private static extern string gnome_vfs_mime_get_icon (string mime_type); + + public static string GetIcon (string mime_type) + { + return gnome_vfs_mime_get_icon (mime_type); + } + + [DllImport ("gnomevfs-2")] + private static extern string gnome_vfs_mime_get_description (string mime_type); + + public static string GetDescription (string mime_type) + { + return gnome_vfs_mime_get_description (mime_type); + } + + [DllImport ("gnomevfs-2")] + static extern bool gnome_vfs_mime_can_be_executable (string mime_type); + + public static bool IsExecutable (string mime_type) + { + return gnome_vfs_mime_can_be_executable (mime_type); + } + + [DllImport ("gnomevfs-2")] + static extern bool gnome_vfs_mime_type_is_known (string mime_type); + + public static bool IsKnown (string mime_type) + { + return gnome_vfs_mime_type_is_known (mime_type); + } + } +} diff --git a/gnomevfs/MimeActionType.cs b/gnomevfs/MimeActionType.cs new file mode 100644 index 000000000..ac53803a3 --- /dev/null +++ b/gnomevfs/MimeActionType.cs @@ -0,0 +1,16 @@ +// +// MimeActionType.cs: GnomeVFSMimeActionType enum. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +namespace Gnome.Vfs { + public enum MimeActionType { + None, + Application, + Component + } +} diff --git a/gnomevfs/MimeType.cs b/gnomevfs/MimeType.cs new file mode 100644 index 000000000..b8537dffa --- /dev/null +++ b/gnomevfs/MimeType.cs @@ -0,0 +1,133 @@ +// +// Mime.cs: Mime-type method bindings. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public class MimeType { + public static readonly string UnknownMimeType = "application/octet-stream"; + private string mimetype; + + [DllImport ("gnomevfs-2")] + static extern string gnome_vfs_get_mime_type (string uri); + + public MimeType (Uri uri) + { + mimetype = gnome_vfs_get_mime_type (uri.ToString ()); + } + + [DllImport ("gnomevfs-2")] + static extern bool gnome_vfs_mime_type_is_known (string mime_type); + + public MimeType (string mimetype) + { + if (!gnome_vfs_mime_type_is_known (mimetype)) + throw new ArgumentException ("Unknown mimetype"); + this.mimetype = mimetype; + } + + [DllImport ("gnomevfs-2")] + static extern string gnome_vfs_get_mime_type_for_data (ref byte data, int size); + + public MimeType (byte[] buffer, int size) + { + mimetype = gnome_vfs_get_mime_type_for_data (ref buffer[0], size); + } + + [DllImport ("gnomevfs-2")] + static extern MimeActionType gnome_vfs_mime_get_default_action_type (string mime_type); + + [DllImport ("gnomevfs-2")] + static extern Result gnome_vfs_mime_set_default_action_type (string mime_type, MimeActionType action_type); + + public MimeActionType DefaultActionType { + get { + return gnome_vfs_mime_get_default_action_type (mimetype); + } + set { + Result result = gnome_vfs_mime_set_default_action_type (mimetype, value); + Vfs.ThrowException (result); + } + } + + [DllImport ("gnomevfs-2")] + static extern MimeAction gnome_vfs_mime_get_default_action (string mime_type); + + public MimeAction DefaultAction { + get { + return gnome_vfs_mime_get_default_action (mimetype); + } + } + + [DllImport ("gnomevfs-2")] + static extern string gnome_vfs_mime_get_description (string mime_type); + + [DllImport ("gnomevfs-2")] + static extern Result gnome_vfs_mime_set_description (string mime_type, string description); + + public string Description { + get { + return gnome_vfs_mime_get_description (mimetype); + } + set { + Result result = gnome_vfs_mime_set_description (mimetype, value); + Vfs.ThrowException (result); + } + } + + [DllImport ("gnomevfs-2")] + static extern string gnome_vfs_mime_get_icon (string mime_type); + + [DllImport ("gnomevfs-2")] + static extern Result gnome_vfs_mime_set_icon (string mime_type, string filename); + + public string Icon { + get { + return gnome_vfs_mime_get_icon (mimetype); + } + set { + Result result = gnome_vfs_mime_set_icon (mimetype, value); + Vfs.ThrowException (result); + } + } + + [DllImport ("gnomevfs-2")] + static extern bool gnome_vfs_mime_can_be_executable (string mime_type); + + [DllImport ("gnomevfs-2")] + static extern Result gnome_vfs_mime_set_can_be_executable (string mime_type, bool value); + + public bool CanBeExecutable { + get { + return gnome_vfs_mime_can_be_executable (mimetype); + } + set { + Result result = gnome_vfs_mime_set_can_be_executable (mimetype, value); + Vfs.ThrowException (result); + } + } + + public string Name { + get { + return mimetype; + } + } + + public override string ToString () + { + return mimetype; + } + + public static string GetMimeTypeForUri (string uri) + { + return gnome_vfs_get_mime_type (uri); + } + } +} diff --git a/gnomevfs/Monitor.cs b/gnomevfs/Monitor.cs new file mode 100644 index 000000000..e9c1a2874 --- /dev/null +++ b/gnomevfs/Monitor.cs @@ -0,0 +1,104 @@ +// +// Monitor.cs: Class wrapping the gnome_vfs_monitor_* methods. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public delegate void MonitorHandler (string monitor, string uri); + + internal delegate void MonitorCallback (string monitorUri, string uri, MonitorEventType eventType); + + internal delegate void MonitorCallbackNative (IntPtr handle, string monitorUri, string uri, MonitorEventType eventType, IntPtr data); + + internal class MonitorCallbackWrapper : GLib.DelegateWrapper { + + public void NativeCallback (IntPtr handle, string monitorUri, string uri, MonitorEventType eventType, IntPtr data) + { + _managed (monitorUri, uri, eventType); + } + + internal MonitorCallbackNative NativeDelegate; + protected MonitorCallback _managed; + + public MonitorCallbackWrapper (MonitorCallback managed, object o) : base (o) + { + NativeDelegate = new MonitorCallbackNative (NativeCallback); + _managed = managed; + } + } + + public class Monitor { + private IntPtr handle; + private MonitorCallbackWrapper wrapper; + + public event MonitorHandler Changed; + public event MonitorHandler Deleted; + public event MonitorHandler Startexecuting; + public event MonitorHandler Stopexecuting; + public event MonitorHandler Created; + public event MonitorHandler MetadataChanged; + + public Monitor () + { + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_monitor_add (out IntPtr handle, string uri, MonitorType type, MonitorCallbackNative callback, IntPtr user_data); + + public Result Add (string uri, MonitorType type) + { + handle = IntPtr.Zero; + if (wrapper == null) + wrapper = new MonitorCallbackWrapper (new MonitorCallback (OnMonitorEvent), null); + Result result = gnome_vfs_monitor_add (out handle, uri, type, wrapper.NativeDelegate, IntPtr.Zero); + return result; + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_monitor_cancel (IntPtr handle); + + public Result Cancel () + { + if (handle == IntPtr.Zero) + throw new InvalidOperationException ("Nothing to cancel"); + + return gnome_vfs_monitor_cancel (handle); + } + + private void OnMonitorEvent (string monitorUri, string uri, MonitorEventType eventType) + { + MonitorHandler handler = null; + + switch (eventType) { + case MonitorEventType.Changed: + handler = Changed; + break; + case MonitorEventType.Deleted: + handler = Deleted; + break; + case MonitorEventType.Startexecuting: + handler = Startexecuting; + break; + case MonitorEventType.Stopexecuting: + handler = Stopexecuting; + break; + case MonitorEventType.Created: + handler = Created; + break; + case MonitorEventType.MetadataChanged: + handler = MetadataChanged; + break; + } + + if (handler != null) + handler (monitorUri, uri); + } + } +} diff --git a/gnomevfs/OpenMode.cs b/gnomevfs/OpenMode.cs new file mode 100644 index 000000000..eaba29bca --- /dev/null +++ b/gnomevfs/OpenMode.cs @@ -0,0 +1,17 @@ +// +// OpenMode.cs: GnomeVFSOpenMode enum. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +namespace Gnome.Vfs { + public enum OpenMode { + None = 0, + Read = 1 << 0, + Write = 1 << 1, + Random = 1 << 2 + } +} diff --git a/gnomevfs/Result.cs b/gnomevfs/Result.cs new file mode 100644 index 000000000..6b273b8bb --- /dev/null +++ b/gnomevfs/Result.cs @@ -0,0 +1,60 @@ +// +// Result.cs: GnomeVFSResult enum. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +namespace Gnome.Vfs { + public enum Result { + Ok, + NotFound, + Generic, + Internal, + BadParameters, + NotSupported, + Io, + CorruptedData, + WrongFormat, + BadFile, + TooBig, + NoSpace, + ReadOnly, + InvalidUri, + NotOpen, + InvalidOpenMode, + AccessDenied, + TooManyOpenFiles, + Eof, + NotADirectory, + InProgress, + Interrupted, + FileExists, + Loop, + NotPermitted, + IsDirectory, + NoMemory, + HostNotFound, + InvalidHostName, + HostHasNoAddress, + LoginFailed, + Cancelled, + DirectoryBusy, + DirectoryNotEmpty, + TooManyLinks, + ReadOnlyFileSystem, + NotSameFileSystem, + NameTooLong, + ServiceNotAvailable, + ServiceObsolete, + ProtocolError, + NoMasterBrowser, + NoDefault, + NoHandler, + Parse, + Launch, + NumErrors + } +} diff --git a/gnomevfs/SeekPosition.cs b/gnomevfs/SeekPosition.cs new file mode 100644 index 000000000..09fc86e34 --- /dev/null +++ b/gnomevfs/SeekPosition.cs @@ -0,0 +1,16 @@ +// +// SeekPosition.cs: GnomeVFSSeekPosition enum. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +namespace Gnome.Vfs { + public enum SeekPosition { + Start, + Current, + End + } +} diff --git a/gnomevfs/Sync.cs b/gnomevfs/Sync.cs new file mode 100644 index 000000000..f68748159 --- /dev/null +++ b/gnomevfs/Sync.cs @@ -0,0 +1,143 @@ +// +// Sync.cs: Bindings for gnome-vfs synchronized functions calls. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public class Sync { + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_close (IntPtr handle); + + public static Result Close (Handle handle) + { + return gnome_vfs_close (handle.Raw); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_create (out IntPtr handle, string uri, OpenMode mode, bool exclusive, uint perm); + + public static Handle Create (string uri, OpenMode mode, bool exclusive, FilePermissions perm) + { + IntPtr handle = IntPtr.Zero; + Result result = gnome_vfs_create (out handle, uri, mode, exclusive, (uint)perm); + if (result != Result.Ok) { + Vfs.ThrowException (uri, result); + return null; + } else { + return new Handle (handle); + } + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_create_uri (out IntPtr handle, IntPtr uri, OpenMode mode, bool exclusive, uint perm); + + public static Handle Create (Uri uri, OpenMode mode, bool exclusive, FilePermissions perm) + { + IntPtr handle = IntPtr.Zero; + Result result = gnome_vfs_create_uri (out handle, uri.Handle, mode, exclusive, (uint)perm); + if (result != Result.Ok) { + Vfs.ThrowException (uri, result); + return null; + } else { + return new Handle (handle); + } + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_open (out IntPtr handle, string uri, OpenMode mode); + + public static Handle Open (string uri, OpenMode mode) + { + IntPtr handle = IntPtr.Zero; + Result result = gnome_vfs_open (out handle, uri, mode); + if (result != Result.Ok) { + Vfs.ThrowException (uri, result); + return null; + } else { + return new Handle (handle); + } + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_open_uri (out IntPtr handle, IntPtr uri, OpenMode mode); + + public static Handle Open (Uri uri, OpenMode mode) + { + IntPtr handle = IntPtr.Zero; + Result result = gnome_vfs_open_uri (out handle, uri.Handle, mode); + if (result != Result.Ok) { + Vfs.ThrowException (uri, result); + return null; + } else { + return new Handle (handle); + } + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_read (IntPtr handle, out byte buffer, ulong bytes, out ulong bytes_read); + + public static Result Read (Handle handle, out byte buffer, ulong bytes, out ulong bytes_read) + { + return gnome_vfs_read (handle.Raw, out buffer, bytes, out bytes_read); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_seek (IntPtr handle, SeekPosition whence, long offset); + + public static Result Seek (Handle handle, SeekPosition whence, long offset) + { + return gnome_vfs_seek (handle.Raw, whence, offset); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_write (IntPtr handle, out byte buffer, ulong bytes, out ulong bytes_written); + + public static Result Write (Handle handle, out byte buffer, ulong bytes, out ulong bytes_written) + { + return gnome_vfs_write (handle.Raw, out buffer, bytes, out bytes_written); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_tell (IntPtr handle, out ulong offset); + + public static Result Tell (Handle handle, out ulong offset) + { + return gnome_vfs_tell (handle.Raw, out offset); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_truncate (string uri, ulong length); + + public static Result Truncate (string uri, ulong length) + { + return gnome_vfs_truncate (uri, length); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_truncate_handle (IntPtr handle, ulong length); + + public static Result Truncate (Handle handle, ulong length) + { + return gnome_vfs_truncate_handle (handle.Raw, length); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_file_control (IntPtr handle, string operation, out string data); + + // TODO: data parameter only works when you want a string back, + // like in the case of a "file:test" operation. Unknown at this + // time what other possible uses/parameters this method has. + public static Result FileControl (Handle handle, string operation, out string data) + { + return gnome_vfs_file_control (handle.Raw, operation, out data); + } + } +} diff --git a/gnomevfs/Uri.custom b/gnomevfs/Uri.custom new file mode 100644 index 000000000..dce4e3bec --- /dev/null +++ b/gnomevfs/Uri.custom @@ -0,0 +1,29 @@ +// +// Gnome.Vfs.Uri.custom - Gnome Vfs Uri class customizations +// +// Author: Jeroen Zwartepoorte (jeroen@xs4all.nl) +// +// Copyright (C) 2004 Jeroen Zwartepoorte +// +// This code is inserted after the automatically generated code. +// + + public MimeType MimeType { + get { + return new MimeType (this); + } + } + + public FileInfo GetFileInfo () + { + return GetFileInfo (FileInfoOptions.Default); + } + + public FileInfo GetFileInfo (FileInfoOptions options) { + return new FileInfo (this, options); + } + + public override string ToString () + { + return ToString (UriHideOptions.None); + } diff --git a/gnomevfs/Vfs.cs b/gnomevfs/Vfs.cs new file mode 100644 index 000000000..b1096ba6b --- /dev/null +++ b/gnomevfs/Vfs.cs @@ -0,0 +1,134 @@ +// +// Vfs.cs: Bindings for gnome-vfs. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public class Vfs { + [DllImport ("gnomevfs-2")] + static extern bool gnome_vfs_init (); + + [DllImport ("gnomevfs-2")] + static extern bool gnome_vfs_initialized (); + + public static bool Initialized { + get { + return gnome_vfs_initialized (); + } + } + + static Vfs () + { + if (!gnome_vfs_initialized ()) + gnome_vfs_init (); + } + + public static bool Initialize () + { + return gnome_vfs_init (); + } + + [DllImport ("gnomevfs-2")] + static extern bool gnome_vfs_shutdown (); + + public static bool Shutdown () + { + return gnome_vfs_shutdown (); + } + + public static bool Exists (string textUri) + { + Uri uri = new Uri (textUri); + return uri.Exists; + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_move (string old_uri, string new_uri, bool force_replace); + + public static Result Move (string old_uri, string new_uri, bool force_replace) + { + return gnome_vfs_move (old_uri, new_uri, force_replace); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_make_directory (string uri, uint perm); + + public static Result MakeDirectory (string uri, uint perm) + { + return gnome_vfs_make_directory (uri, perm); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_remove_directory (string uri); + + public static Result RemoveDirectory (string uri) + { + return gnome_vfs_remove_directory (uri); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_unlink (string uri); + + public static Result Unlink (string uri) + { + return gnome_vfs_unlink (uri); + } + + [DllImport ("gnomevfs-2")] + private static extern IntPtr gnome_vfs_result_to_string (int result); + + public static string ResultToString (Result result) + { + return ResultToString ((int)result); + } + + public static string ResultToString (int result) + { + IntPtr ptr = gnome_vfs_result_to_string (result); + return Marshal.PtrToStringAnsi (ptr); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_truncate (string uri, ulong length); + + public static Result Truncate (string uri, ulong length) + { + return gnome_vfs_truncate (uri, length); + } + + public static Result Truncate (Uri uri, ulong length) + { + return Truncate (uri.ToString (), length); + } + + public static void ThrowException (Result result) + { + ThrowException ((string)null, result); + } + + public static void ThrowException (Uri uri, Result result) + { + ThrowException (uri.ToString (), result); + } + + public static void ThrowException (string uri, Result result) + { + switch (result) { + case Result.Ok: + return; + case Result.ErrorNotFound: + throw new FileNotFoundException (uri); + default: + throw new IOException (ResultToString (result)); + } + } + } +} diff --git a/gnomevfs/VfsStream.cs b/gnomevfs/VfsStream.cs new file mode 100644 index 000000000..5293e8feb --- /dev/null +++ b/gnomevfs/VfsStream.cs @@ -0,0 +1,630 @@ +// +// VfsStream.cs: System.IO.Stream wrapper around gnome-vfs. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using GLib; +using System; +using System.IO; + +namespace Gnome.Vfs { + class VfsStreamAsync { + private Handle handle; + private byte[] buffer; + private int count; + private int offset; + private int bytesRemaining; + private System.AsyncCallback cback; + private object state; + private VfsStreamAsyncResult asyncResult; + + public VfsStreamAsync (Handle handle, byte[] buffer, int offset, + int count, System.AsyncCallback cback, object state) + { + this.handle = handle; + this.buffer = buffer; + this.offset = offset; + this.count = count; + this.cback = cback; + bytesRemaining = count; + } + + public VfsStreamAsyncResult BeginRead () + { + asyncResult = new VfsStreamAsyncResult (state); + Async.Read (handle, out buffer[offset], (uint)count, new AsyncReadCallback (AsyncRead)); + return asyncResult; + } + + public VfsStreamAsyncResult BeginWrite () + { + asyncResult = new VfsStreamAsyncResult (state); + Async.Write (handle, out buffer[offset], (uint)count, new AsyncWriteCallback (AsyncWrite)); + return asyncResult; + } + + private void AsyncRead (Handle handle, Result result, byte[] buf, + ulong bytesRequested, ulong bytesRead) + { + if (result == Result.Ok) { + Array.Copy (buf, 0, buffer, offset + count - bytesRemaining, (int)bytesRead); + bytesRemaining -= (int)bytesRead; + if (bytesRemaining > 0) { + buf = new byte[bytesRemaining]; + Async.Read (handle, out buf[0], (uint)bytesRemaining, + new AsyncReadCallback (AsyncRead)); + } else if (cback != null) { + asyncResult.SetComplete (null, count); + cback (asyncResult); + } + } else if (result == Result.ErrorEof) { + Array.Copy (buf, 0, buffer, offset + count - bytesRemaining, (int)bytesRead); + bytesRemaining -= (int)bytesRead; + asyncResult.SetComplete (null, count - bytesRemaining); + + if (cback != null) + cback (asyncResult); + } else if (cback != null) { + Exception e = new IOException (Vfs.ResultToString (result)); + asyncResult.SetComplete (e, -1); + cback (asyncResult); + } + } + + private void AsyncWrite (Handle handle, Result result, byte[] buffer, + ulong bytesRequested, ulong bytesWritten) + { + if (result == Result.Ok) { + bytesRemaining -= (int)bytesWritten; + if (bytesRemaining > 0) { + Async.Write (handle, out buffer[offset + count - bytesRemaining], + (uint)bytesRemaining, new AsyncWriteCallback (AsyncWrite)); + } else if (cback != null) { + asyncResult.SetComplete (null, count); + cback (asyncResult); + } + } else if (result == Result.ErrorEof) { + bytesRemaining -= (int)bytesWritten; + asyncResult.SetComplete (null, count - bytesRemaining); + + if (cback != null) + cback (asyncResult); + } else if (cback != null) { + Exception e = new IOException (Vfs.ResultToString (result)); + asyncResult.SetComplete (e, -1); + cback (asyncResult); + } + } + } + + public class VfsStream : System.IO.Stream { + private Gnome.Vfs.Uri uri; + private Handle handle; + private FileMode mode; + private FileAccess access; + private bool async; + private bool canseek; + + // Async state variables. + private AsyncCallback callback; + private AsyncReadCallback readCallback; + private AsyncWriteCallback writeCallback; + private bool asyncCompleted = false; + private Result asyncResult; + private ulong asyncBytesRead; + private ulong asyncBytesWritten; + + public VfsStream (string uri, FileMode mode) + : this (uri, mode, false) { } + + public VfsStream (string text_uri, FileMode mode, bool async) + { + if (text_uri == null) + throw new ArgumentNullException ("uri"); + + if (text_uri == "") + throw new ArgumentNullException ("Uri is empty"); + + if (mode < FileMode.CreateNew || mode > FileMode.Append) + throw new ArgumentOutOfRangeException ("mode"); + + if (text_uri.IndexOfAny (Path.InvalidPathChars) != -1) + throw new ArgumentException ("Uri has invalid chars"); + + uri = new Gnome.Vfs.Uri (text_uri); + + if (mode == FileMode.Open && !uri.Exists) + throw new FileNotFoundException ("Could not find uri \"" + text_uri + "\"."); + + if (mode == FileMode.CreateNew) { + string dname = uri.ExtractDirname (); + if (dname != "" && !Vfs.Exists (dname)) + throw new DirectoryNotFoundException ("Could not find a part of " + + "the path \"" + dname + "\"."); + } + + if (async) { + callback = new AsyncCallback (OnAsyncCallback); + readCallback = new AsyncReadCallback (OnAsyncReadCallback); + writeCallback = new AsyncWriteCallback (OnAsyncWriteCallback); + } + + OpenMode om = OpenMode.None; + switch (mode) { + case FileMode.CreateNew: + case FileMode.Create: + case FileMode.Truncate: + case FileMode.Append: + om = OpenMode.Write; + access = FileAccess.Write; + break; + case FileMode.OpenOrCreate: + if (uri.Exists) { + om = OpenMode.Read; + access = FileAccess.Read; + } else { + om = OpenMode.Write; + access = FileAccess.Write; + } + break; + case FileMode.Open: + om = OpenMode.Read; + access = FileAccess.Read; + break; + } + + /* 644 */ + FilePermissions perms = FilePermissions.UserRead | + FilePermissions.UserWrite | + FilePermissions.GroupRead | + FilePermissions.OtherRead; + + Result result; + handle = null; + switch (mode) { + case FileMode.Append: + if (uri.Exists) { + if (async) { + handle = Async.Open (uri, om, + (int)Async.Priority.Default, + callback); + Wait (); + Async.Seek (handle, SeekPosition.End, 0, callback); + Wait (); + } else { + handle = Sync.Open (uri, om); + result = Sync.Seek (handle, SeekPosition.End, 0); + Vfs.ThrowException (uri, result); + } + } else { + if (async) { + handle = Async.Create (uri, om, true, perms, + (int)Async.Priority.Default, + callback); + Wait (); + } else { + handle = Sync.Create (uri, om, true, perms); + } + } + break; + case FileMode.Create: + if (uri.Exists) { + if (async) { + handle = Async.Open (uri, om, + (int)Async.Priority.Default, + callback); + Wait (); + } else { + handle = Sync.Open (uri, om); + result = Sync.Truncate (handle, 0); + Vfs.ThrowException (uri, result); + } + } else { + handle = Sync.Create (uri, om, true, perms); + } + break; + case FileMode.CreateNew: + if (uri.Exists) { + throw new IOException ("Uri \"" + text_uri + "\" already exists."); + } else { + if (async) { + handle = Async.Create (uri, om, true, perms, + (int)Async.Priority.Default, + callback); + Wait (); + } else { + handle = Sync.Create (uri, om, true, perms); + } + } + break; + case FileMode.Open: + if (uri.Exists) { + if (async) { + handle = Async.Open (uri, om, + (int)Async.Priority.Default, + callback); + Wait (); + } else { + handle = Sync.Open (uri, om); + } + } else { + throw new FileNotFoundException (text_uri); + } + break; + case FileMode.OpenOrCreate: + if (uri.Exists) { + if (async) { + handle = Async.Open (uri, om, + (int)Async.Priority.Default, + callback); + Wait (); + } else { + handle = Sync.Open (uri, om); + } + } else { + if (async) { + handle = Async.Create (uri, om, true, perms, + (int)Async.Priority.Default, + callback); + Wait (); + } else { + handle = Sync.Create (uri, om, true, perms); + } + } + break; + case FileMode.Truncate: + if (uri.Exists) { + result = Vfs.Truncate (uri, 0); + if (async) { + handle = Async.Open (uri, om, + (int)Async.Priority.Default, + callback); + Wait (); + } else { + handle = Sync.Open (uri, om); + Vfs.ThrowException (uri, result); + } + } else { + throw new FileNotFoundException (text_uri); + } + break; + } + + this.mode = mode; + this.access = access; + this.canseek = true; + this.async = async; + } + + public override bool CanRead { + get { + return access == FileAccess.Read || + access == FileAccess.ReadWrite; + } + } + + public override bool CanWrite { + get { + return access == FileAccess.Write || + access == FileAccess.ReadWrite; + } + } + + public override bool CanSeek { + get { + return canseek; + } + } + + public virtual bool IsAsync { + get { + return async; + } + } + + public string Uri { + get { + return uri.ToString (); + } + } + + public override long Length { + get { + FileInfo info = uri.GetFileInfo (); + return info.Size; + } + } + + public override long Position { + get { + if (IsAsync) + throw new NotSupportedException ("Cannot tell what the offset is in async mode"); + ulong pos; + Result result = Sync.Tell (handle, out pos); + Vfs.ThrowException (Uri, result); + return (long)pos; + } + set { + Seek (value, SeekOrigin.Begin); + } + } + + public override int ReadByte () + { + if (!CanRead) + throw new NotSupportedException ("The stream does not support reading"); + + byte[] buffer = new byte[1]; + ulong bytesRead; + Result result; + if (async) { + Async.Read (handle, out buffer[0], 1, readCallback); + Wait (); + result = asyncResult; + } else { + result = Sync.Read (handle, out buffer[0], 1UL, out bytesRead); + } + if (result == Result.ErrorEof) + return -1; + + Vfs.ThrowException (Uri, result); + return buffer[0]; + } + + public override void WriteByte (byte value) + { + if (!CanWrite) + throw new NotSupportedException ("The stream does not support writing"); + + byte[] buffer = new byte[1]; + buffer[0] = value; + ulong bytesWritten; + Result result; + if (async) { + Async.Write (handle, out buffer[0], 1, writeCallback); + Wait (); + result = asyncResult; + } else { + result = Sync.Write (handle, out buffer[0], 1UL, out bytesWritten); + } + Vfs.ThrowException (Uri, result); + } + + public override int Read (byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException ("buffer"); + else if (offset < 0) + throw new ArgumentOutOfRangeException ("offset", "Must be >= 0"); + else if (count < 0) + throw new ArgumentOutOfRangeException ("count", "Must be >= 0"); + else if (count > buffer.Length - offset) + throw new ArgumentException ("Buffer too small, count/offset wrong"); + else if (!CanRead) + throw new NotSupportedException ("The stream does not support reading"); + + ulong bytesRead; + Result result; + if (async) { + Async.Read (handle, out buffer[offset], (uint)count, readCallback); + Wait (); + result = asyncResult; + bytesRead = asyncBytesRead; + } else { + result = Sync.Read (handle, out buffer[offset], (ulong)count, out bytesRead); + } + if (result == Result.ErrorEof) + return 0; + + Vfs.ThrowException (Uri, result); + return (int)bytesRead; + } + + public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, + System.AsyncCallback cback, object state) + { + if (buffer == null) + throw new ArgumentNullException ("buffer"); + else if (offset < 0) + throw new ArgumentOutOfRangeException ("offset", "Must be >= 0"); + else if (count < 0) + throw new ArgumentOutOfRangeException ("count", "Must be >= 0"); + else if (count > buffer.Length - offset) + throw new ArgumentException ("Buffer too small, count/offset wrong"); + else if (!CanRead) + throw new NotSupportedException ("The stream does not support reading"); + + if (!IsAsync) + return base.BeginRead (buffer, offset, count, cback, state); + + VfsStreamAsync async = new VfsStreamAsync (handle, buffer, offset, count, cback, state); + return async.BeginRead (); + } + + public override int EndRead (IAsyncResult result) + { + if (result == null) + throw new ArgumentNullException ("result"); + + if (!IsAsync) + base.EndRead (result); + + if (!(result is VfsStreamAsyncResult)) + throw new ArgumentException ("Invalid IAsyncResult object", "result"); + + VfsStreamAsyncResult asyncResult = (VfsStreamAsyncResult)result; + if (asyncResult.Done) + throw new InvalidOperationException ("EndRead already called"); + asyncResult.Done = true; + + while (!asyncResult.IsCompleted) + MainContext.Iteration (); + + if (asyncResult.Exception != null) + throw asyncResult.Exception; + + return asyncResult.NBytes; + } + + public override void Write (byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException ("buffer"); + else if (offset < 0) + throw new ArgumentOutOfRangeException ("offset", "Must be >= 0"); + else if (count < 0) + throw new ArgumentOutOfRangeException ("count", "Must be >= 0"); + else if (count > buffer.Length - offset) + throw new ArgumentException ("Buffer too small, count/offset wrong"); + else if (!CanWrite) + throw new NotSupportedException ("The stream does not support writing"); + + ulong bytesWritten; + Result result; + if (async) { + Async.Write (handle, out buffer[offset], (uint)count, writeCallback); + Wait (); + result = asyncResult; + bytesWritten = asyncBytesWritten; + } else { + result = Sync.Write (handle, out buffer[offset], (ulong)count, out bytesWritten); + } + Vfs.ThrowException (Uri, result); + } + + public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count, + System.AsyncCallback cback, object state) + { + if (buffer == null) + throw new ArgumentNullException ("buffer"); + else if (offset < 0) + throw new ArgumentOutOfRangeException ("offset", "Must be >= 0"); + else if (count < 0) + throw new ArgumentOutOfRangeException ("count", "Must be >= 0"); + else if (count > buffer.Length - offset) + throw new ArgumentException ("Buffer too small, count/offset wrong"); + else if (!CanWrite) + throw new NotSupportedException ("The stream does not support writing"); + + if (!IsAsync) + return base.BeginRead (buffer, offset, count, cback, state); + + VfsStreamAsync async = new VfsStreamAsync (handle, buffer, offset, count, cback, state); + return async.BeginWrite (); + } + + public override void EndWrite (IAsyncResult result) + { + if (result == null) + throw new ArgumentNullException ("result"); + + if (!IsAsync) + base.EndWrite (result); + + if (!(result is VfsStreamAsyncResult)) + throw new ArgumentException ("Invalid IAsyncResult object", "result"); + + VfsStreamAsyncResult asyncResult = (VfsStreamAsyncResult)result; + if (asyncResult.Done) + throw new InvalidOperationException ("EndWrite already called"); + asyncResult.Done = true; + + while (!asyncResult.IsCompleted) + MainContext.Iteration (); + + if (asyncResult.Exception != null) + throw asyncResult.Exception; + } + + public override long Seek (long offset, SeekOrigin origin) + { + if (!CanSeek) + throw new NotSupportedException ("The stream does not support seeking"); + if (IsAsync && origin == SeekOrigin.Current) + throw new NotSupportedException ("Cannot tell what the offset is in async mode"); + + SeekPosition seekPos = SeekPosition.Start; + long newOffset = -1; + switch (origin) { + case SeekOrigin.Begin: + seekPos = SeekPosition.Start; + newOffset = offset; + break; + case SeekOrigin.Current: + seekPos = SeekPosition.Current; + break; + case SeekOrigin.End: + seekPos = SeekPosition.End; + newOffset = Length + offset; + break; + } + + Result result; + if (async) { + Async.Seek (handle, seekPos, offset, callback); + Wait (); + result = asyncResult; + } else { + result = Sync.Seek (handle, seekPos, offset); + } + Vfs.ThrowException (Uri, result); + return newOffset; + } + + public override void SetLength (long length) + { + if (!CanSeek) + throw new NotSupportedException ("The stream does not support seeking"); + else if (!CanWrite) + throw new NotSupportedException ("The stream does not support writing"); + + Result result = Sync.Truncate (handle, (ulong)length); + Vfs.ThrowException (Uri, result); + } + + public override void Flush () + { + } + + public override void Close () + { + Result result = Sync.Close (handle); + Vfs.ThrowException (Uri, result); + } + + private void OnAsyncCallback (Handle handle, Result result) + { + asyncResult = result; + asyncCompleted = true; + } + + private void OnAsyncReadCallback (Handle handle, Result result, + byte[] buffer, ulong bytes_requested, + ulong bytes_read) + { + asyncResult = result; + asyncBytesRead = bytes_read; + asyncCompleted = true; + } + + private void OnAsyncWriteCallback (Handle handle, Result result, + byte[] buffer, ulong bytes_requested, + ulong bytes_written) + { + asyncResult = result; + asyncBytesWritten = bytes_written; + asyncCompleted = true; + } + + private void Wait () + { + while (!asyncCompleted) + MainContext.Iteration (); + asyncCompleted = false; + } + } +} diff --git a/gnomevfs/VfsStreamAsyncResult.cs b/gnomevfs/VfsStreamAsyncResult.cs new file mode 100644 index 000000000..23d57ed7c --- /dev/null +++ b/gnomevfs/VfsStreamAsyncResult.cs @@ -0,0 +1,81 @@ +using System; +using System.Threading; + +namespace Gnome.Vfs { + public class VfsStreamAsyncResult : IAsyncResult { + private object state; + private bool completed = false; + private bool done = false; + private Exception exception = null; + private int nbytes = -1; + + public VfsStreamAsyncResult (object state) + { + this.state = state; + } + + public object AsyncState { + get { + return state; + } + } + + public WaitHandle AsyncWaitHandle { + get { + throw new NotSupportedException ( + "Do NOT use the AsyncWaitHandle to " + + "wait until a Begin[Read,Write] call " + + "has finished since it will also block " + + "the gnome-vfs callback which unlocks " + + "the WaitHandle, causing a deadlock. " + + "Instead, use \"while (!asyncResult.IsCompleted) " + + "GLib.MainContext.Iteration ();\""); + } + } + + public bool CompletedSynchronously { + get { + return true; + } + } + + public bool Done { + get { + return done; + } + set { + done = value; + } + } + + public Exception Exception { + get { + return exception; + } + } + + public bool IsCompleted { + get { + return completed; + } + } + + public int NBytes { + get { + return nbytes; + } + } + + public void SetComplete (Exception e) + { + exception = e; + completed = true; + } + + public void SetComplete (Exception e, int nbytes) + { + this.nbytes = nbytes; + SetComplete (e); + } + } +} diff --git a/gnomevfs/VolumeMonitor.custom b/gnomevfs/VolumeMonitor.custom new file mode 100644 index 000000000..53ec4844e --- /dev/null +++ b/gnomevfs/VolumeMonitor.custom @@ -0,0 +1,21 @@ +// +// Gnome.Vfs.VolumeMonitor.custom - Gnome Vfs VolumeMonitor class customizations +// +// Author: Jeroen Zwartepoorte (jeroen@xs4all.nl) +// +// Copyright (C) 2004 Jeroen Zwartepoorte +// +// This code is inserted after the automatically generated code. +// + + [DllImport("gnomevfs-2")] + static extern IntPtr gnome_vfs_get_volume_monitor (); + + public static VolumeMonitor Get () + { + IntPtr raw_ret = gnome_vfs_get_volume_monitor (); + if (raw_ret == IntPtr.Zero) + return null; + else + return (VolumeMonitor) GLib.Object.GetObject (raw_ret); + } diff --git a/gnomevfs/Xfer.cs b/gnomevfs/Xfer.cs new file mode 100644 index 000000000..5cbddfbc3 --- /dev/null +++ b/gnomevfs/Xfer.cs @@ -0,0 +1,93 @@ +// +// Xfer.cs: Bindings for gnome_vfs_xfer_* methods. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace Gnome.Vfs { + public class Xfer { + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_xfer_uri_list (IntPtr source_uri_list, + IntPtr target_uri_list, + XferOptions xfer_options, + XferErrorMode error_mode, + XferOverwriteMode overwrite_mode, + XferProgressCallbackNative progress_callback, + IntPtr data); + + public static Result XferUriList (Uri[] sources, + Uri[] targets, + XferOptions options, + XferErrorMode errorMode, + XferOverwriteMode overwriteMode, + XferProgressCallback callback) + { + XferProgressCallbackWrapper wrapper = new XferProgressCallbackWrapper (callback, null); + GLib.List sourcesList = new GLib.List (typeof (Uri)); + foreach (Uri uri in sources) + sourcesList.Append (uri.Handle); + + GLib.List targetsList = new GLib.List (typeof (Uri)); + foreach (Uri uri in targets) + targetsList.Append (uri.Handle); + + return gnome_vfs_xfer_uri_list (sourcesList.Handle, + targetsList.Handle, + options, errorMode, + overwriteMode, + wrapper.NativeDelegate, + IntPtr.Zero); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_xfer_uri (IntPtr source_uri, + IntPtr target_uri, + XferOptions xfer_options, + XferErrorMode error_mode, + XferOverwriteMode overwrite_mode, + XferProgressCallbackNative progress_callback, + IntPtr data); + + public static Result XferUri (Uri source, Uri target, + XferOptions options, + XferErrorMode errorMode, + XferOverwriteMode overwriteMode, + XferProgressCallback callback) + { + XferProgressCallbackWrapper wrapper = new XferProgressCallbackWrapper (callback, null); + return gnome_vfs_xfer_uri (source.Handle, target.Handle, + options, errorMode, overwriteMode, + wrapper.NativeDelegate, IntPtr.Zero); + } + + [DllImport ("gnomevfs-2")] + private static extern Result gnome_vfs_xfer_delete_list (IntPtr source_uri_list, + XferErrorMode error_mode, + XferOptions xfer_options, + XferProgressCallbackNative progress_callback, + IntPtr data); + + public static Result XferDeleteList (Uri[] sources, + XferErrorMode errorMode, + XferOptions options, + XferProgressCallback callback) + { + XferProgressCallbackWrapper wrapper = new XferProgressCallbackWrapper (callback, null); + GLib.List sourcesList = new GLib.List (typeof (Uri)); + foreach (Uri uri in sources) + sourcesList.Append (uri.Handle); + + return gnome_vfs_xfer_delete_list (sourcesList.Handle, + errorMode, options, + wrapper.NativeDelegate, + IntPtr.Zero); + } + } +} diff --git a/gnomevfs/XferProgressCallback.cs b/gnomevfs/XferProgressCallback.cs new file mode 100644 index 000000000..65d76d4ca --- /dev/null +++ b/gnomevfs/XferProgressCallback.cs @@ -0,0 +1,12 @@ +// +// XferProgressCallback.cs: GnomeVFSXferProgressCallback delegate. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +namespace Gnome.Vfs { + public delegate int XferProgressCallback (XferProgressInfo info); +} diff --git a/gnomevfs/XferProgressCallbackNative.cs b/gnomevfs/XferProgressCallbackNative.cs new file mode 100644 index 000000000..fcf2187b8 --- /dev/null +++ b/gnomevfs/XferProgressCallbackNative.cs @@ -0,0 +1,31 @@ +// +// XferProgressCallbackNative.cs: Native wrapper for GnomeVFSXferProgressCallback. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; + +namespace Gnome.Vfs { + internal delegate int XferProgressCallbackNative (ref XferProgressInfo info, IntPtr data); + + internal class XferProgressCallbackWrapper : GLib.DelegateWrapper { + + public int NativeCallback (ref XferProgressInfo info, IntPtr data) + { + return _managed (info); + } + + internal XferProgressCallbackNative NativeDelegate; + protected XferProgressCallback _managed; + + public XferProgressCallbackWrapper (XferProgressCallback managed, object o) : base (o) + { + NativeDelegate = new XferProgressCallbackNative (NativeCallback); + _managed = managed; + } + } +} diff --git a/gnomevfs/gnome-vfs-sharp-2.0.pc.in b/gnomevfs/gnome-vfs-sharp-2.0.pc.in new file mode 100644 index 000000000..ac3794336 --- /dev/null +++ b/gnomevfs/gnome-vfs-sharp-2.0.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib + + +Name: GnomeVfs# +Description: GnomeVfs# - GNOME-VFS .NET Binding +Version: @VERSION@ +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/gnome-vfs-sharp.dll diff --git a/gnomevfs/gnome-vfs-sharp.dll.config.in b/gnomevfs/gnome-vfs-sharp.dll.config.in new file mode 100644 index 000000000..88ad091dc --- /dev/null +++ b/gnomevfs/gnome-vfs-sharp.dll.config.in @@ -0,0 +1,3 @@ + + + diff --git a/gnomevfs/gnomevfs-api.raw b/gnomevfs/gnomevfs-api.raw new file mode 100644 index 000000000..c600742b6 --- /dev/null +++ b/gnomevfs/gnomevfs-api.raw @@ -0,0 +1,1320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gnomevfs/gnomevfs-symbols.xml b/gnomevfs/gnomevfs-symbols.xml new file mode 100644 index 000000000..a1b58b593 --- /dev/null +++ b/gnomevfs/gnomevfs-symbols.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/gtk-sharp.pub b/gtk-sharp.pub deleted file mode 100644 index 968d366a24873d132e2ac485b9a3010e1d7abe88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmV;R0AK$ABme*efB*oL000060ssI2Bme+XQ$aBR1ONa50097T>ugnZQk=hXME9oZ z1!9Ex>fk%i^2`$~oJk6^3F@%5YtBTS^#j?!s2)-Uh0VTj;`@+8ORNO?Vj`#jn75&) zv#*&NK_eu)LnZdOWxHhS_R+!y)pIT1yl|&Dp5;CaByKW!bQ;hF1LT-O;hXb&8H+$6 OCd)R7!s=v}q +// +// Copyright (C) 2004 Novell, Inc. +// +// This code is inserted after the automatically generated code. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the Lesser GNU General +// Public License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + + public Action (string name, string label) : this (name, label, null, null) + { + } diff --git a/gtk/Adjustment.custom b/gtk/Adjustment.custom index 8eedb5e87..fa11e702d 100644 --- a/gtk/Adjustment.custom +++ b/gtk/Adjustment.custom @@ -16,7 +16,6 @@ // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. - // [DllImport("libgtk-win32-2.0-0.dll")] @@ -38,88 +37,11 @@ public Adjustment (double value, double lower, double upper, double step_increme Raw = gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_gtk_adjustment_set_bounds (IntPtr i, double lower, double upper, double step_increment, double page_increment, double page_size); -/// Sets the Adjustment boundaries -/// -/// This method is used to change the lower, upper, step_increment, page_increment and -/// page_size parameters of the Adjustment object after it has been created -/// public void SetBounds (double lower, double upper, double step_increment, double page_increment, double page_size) { gtksharp_gtk_adjustment_set_bounds (this.Handle, lower, upper, step_increment, page_increment, page_size); } -[DllImport ("gtksharpglue")] -static extern double gtksharp_gtk_adjustment_get_lower (IntPtr i); - -[DllImport ("gtksharpglue")] -static extern void gtksharp_gtk_adjustment_set_lower (IntPtr i, double lower); - -public double Lower { - get { - return gtksharp_gtk_adjustment_get_lower (this.Handle); - } - set { - gtksharp_gtk_adjustment_set_lower (Handle, value); - } -} - -[DllImport ("gtksharpglue")] -static extern double gtksharp_gtk_adjustment_get_upper (IntPtr i); - -[DllImport ("gtksharpglue")] -static extern void gtksharp_gtk_adjustment_set_upper (IntPtr i, double upper); - -public double Upper { - get { - return gtksharp_gtk_adjustment_get_upper (this.Handle); - } - set { - gtksharp_gtk_adjustment_set_upper (Handle, value); - } -} - -[DllImport ("gtksharpglue")] -static extern double gtksharp_gtk_adjustment_get_step_increment (IntPtr i); -[DllImport ("gtksharpglue")] -static extern void gtksharp_gtk_adjustment_set_step_increment (IntPtr i, double step_increment); -public double StepIncrement { - get { - return gtksharp_gtk_adjustment_get_step_increment (this.Handle); - } - - set { - gtksharp_gtk_adjustment_set_step_increment (Handle, value); - } -} - -[DllImport ("gtksharpglue")] -static extern double gtksharp_gtk_adjustment_get_page_increment (IntPtr i); -[DllImport ("gtksharpglue")] -static extern void gtksharp_gtk_adjustment_set_page_increment (IntPtr i, double page_increment); -public double PageIncrement { - get { - return gtksharp_gtk_adjustment_get_page_increment (this.Handle); - } - - set { - gtksharp_gtk_adjustment_set_page_increment (Handle, value); - } -} - -[DllImport ("gtksharpglue")] -static extern double gtksharp_gtk_adjustment_get_page_size (IntPtr i); -[DllImport ("gtksharpglue")] -static extern void gtksharp_gtk_adjustment_set_page_size (IntPtr i, double page_size); -public double PageSize { - get { - return gtksharp_gtk_adjustment_get_page_size (this.Handle); - } - - set { - gtksharp_gtk_adjustment_set_page_size (Handle, value); - } -} - diff --git a/gtk/Button.custom b/gtk/Button.custom index 6cc046ec6..10eaf55b3 100644 --- a/gtk/Button.custom +++ b/gtk/Button.custom @@ -39,9 +39,9 @@ public Button (string stock_id) : base (IntPtr.Zero) Raw = gtk_button_new_from_stock(stock_id); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern int gtksharp_button_get_in_button (IntPtr button); -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_button_set_in_button (IntPtr button, int b); public bool InButton { diff --git a/gtk/CellRenderer.custom b/gtk/CellRenderer.custom index 585129043..7744a6c75 100644 --- a/gtk/CellRenderer.custom +++ b/gtk/CellRenderer.custom @@ -23,10 +23,10 @@ // Boston, MA 02111-1307, USA. - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_cellrenderer_base_get_size (IntPtr handle, IntPtr widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_cellrenderer_override_get_size (GLib.GType gtype, GetSizeDelegate cb); delegate void GetSizeDelegate (IntPtr item, IntPtr widget, IntPtr cell_area_ptr, IntPtr x_offset, IntPtr y_offset, IntPtr width, IntPtr height); @@ -64,10 +64,10 @@ } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_cellrenderer_base_render (IntPtr handle, IntPtr window, IntPtr widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_cellrenderer_override_render (GLib.GType gtype, RenderDelegate cb); delegate void RenderDelegate (IntPtr item, IntPtr window, IntPtr widget, ref Gdk.Rectangle background_area, ref Gdk.Rectangle cell_area, ref Gdk.Rectangle expose_area, Gtk.CellRendererState flags); @@ -95,7 +95,7 @@ gtksharp_cellrenderer_base_render (Handle, window.Handle, widget.Handle, background_area, cell_area, expose_area, flags); } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_cellrenderer_override_start_editing (GLib.GType gtype, StartEditingDelegate cb); delegate IntPtr StartEditingDelegate (IntPtr raw, IntPtr evnt, IntPtr widget, string path, ref Gdk.Rectangle background_area, ref Gdk.Rectangle cell_area, Gtk.CellRendererState flags); @@ -120,7 +120,7 @@ gtksharp_cellrenderer_override_start_editing (gtype, StartEditingCallback); } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_cellrenderer_base_start_editing(IntPtr raw, IntPtr evnt, IntPtr widget, string path, ref Gdk.Rectangle background_area, ref Gdk.Rectangle cell_area, int flags); [GLib.DefaultSignalHandler (Type=typeof(Gtk.CellRenderer), ConnectionMethod="OverrideStartEditing")] diff --git a/gtk/Clipboard.custom b/gtk/Clipboard.custom index acf10a747..89e000dd3 100644 --- a/gtk/Clipboard.custom +++ b/gtk/Clipboard.custom @@ -21,16 +21,16 @@ [DllImport("libgtk-win32-2.0-0.dll")] static extern bool gtk_clipboard_set_with_data(IntPtr raw, IntPtr targets, int n_targets, GtkSharp.GtkClipboardGetFuncNative get_func, GtkSharp.GtkClipboardClearFuncNative clear_func, uint id); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_clipboard_target_list_add (IntPtr list, string name, uint flags, uint info); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_clipboard_target_list_to_array (IntPtr list); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_clipboard_target_array_free (IntPtr targets); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_clipboard_target_list_free (IntPtr list); GtkSharp.GtkClipboardGetFuncWrapper get_func_wrapper; diff --git a/gtk/ColorSelectionDialog.custom b/gtk/ColorSelectionDialog.custom index 815885ad8..2af5de5c3 100644 --- a/gtk/ColorSelectionDialog.custom +++ b/gtk/ColorSelectionDialog.custom @@ -35,25 +35,25 @@ public class ColorSelectionButton : Gtk.Button { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_color_selection_dialog_get_colorsel (IntPtr i); public Gtk.ColorSelection ColorSelection { get { return new ColorSelection (gtksharp_color_selection_dialog_get_colorsel (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_color_selection_dialog_get_ok_button (IntPtr i); public Gtk.Button OkButton { get { return new ColorSelectionButton (this, gtksharp_color_selection_dialog_get_ok_button (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_color_selection_dialog_get_cancel_button (IntPtr i); public Gtk.Button CancelButton { get { return new ColorSelectionButton (this, gtksharp_color_selection_dialog_get_cancel_button (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_color_selection_dialog_get_help_button (IntPtr i); public Gtk.Button HelpButton { get { return new ColorSelectionButton (this, gtksharp_color_selection_dialog_get_help_button (this.Handle)); } diff --git a/gtk/Combo.custom b/gtk/Combo.custom index 6ab081dce..dc7529666 100644 --- a/gtk/Combo.custom +++ b/gtk/Combo.custom @@ -26,7 +26,7 @@ public string[] PopdownStrings { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_combo_get_entry(IntPtr i); public Gtk.Entry Entry { @@ -35,7 +35,7 @@ public Gtk.Entry Entry { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_combo_get_button(IntPtr i); public Gtk.Button Button { diff --git a/gtk/ComboBox.custom b/gtk/ComboBox.custom new file mode 100644 index 000000000..550a54cf3 --- /dev/null +++ b/gtk/ComboBox.custom @@ -0,0 +1,26 @@ +[DllImport("libgtk-win32-2.0-0.dll")] +static extern IntPtr gtk_combo_box_get_model (IntPtr raw); + +[DllImport("libgtk-win32-2.0-0.dll")] +static extern IntPtr gtk_combo_box_set_model (IntPtr raw, IntPtr raw_model); + +public Gtk.TreeModel Model { + get { + IntPtr raw_ret = gtk_combo_box_get_model (Handle); + Gtk.TreeModel ret = (Gtk.TreeModel) GLib.Object.GetObject (raw_ret, false); + return ret; + } + set { + gtk_combo_box_set_model (Handle, value.Handle); + } +} + +[DllImport("libgtk-win32-2.0-0.dll")] +static extern IntPtr gtk_cell_layout_set_cell_data_func (IntPtr raw, IntPtr raw_renderer, GtkSharp.CellLayoutDataFuncNative func, IntPtr func_data, IntPtr destroy_notify); + +public void SetCellDataFunc (Gtk.CellRenderer renderer, Gtk.CellLayoutDataFunc func) +{ + GtkSharp.CellLayoutDataFuncWrapper func_wrapper = null; + func_wrapper = new GtkSharp.CellLayoutDataFuncWrapper (func, this); + gtk_cell_layout_set_cell_data_func (Handle, renderer.Handle, func_wrapper.NativeDelegate, IntPtr.Zero, IntPtr.Zero); +} diff --git a/gtk/Container.custom b/gtk/Container.custom index 0ef448e51..bd4c766eb 100644 --- a/gtk/Container.custom +++ b/gtk/Container.custom @@ -64,13 +64,13 @@ public Widget[] FocusChain { } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, IntPtr cb, IntPtr data); -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_container_override_forall (GLib.GType gtype, ForallDelegate cb); -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_container_invoke_gtk_callback (IntPtr cb, IntPtr handle, IntPtr data); delegate void ForallDelegate (IntPtr container, bool include_internals, IntPtr cb, IntPtr data); @@ -125,10 +125,10 @@ protected virtual void ForAll (bool include_internals, CallbackInvoker invoker) gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_container_base_child_type(IntPtr raw); -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_container_override_child_type (GLib.GType type, ChildTypeDelegate cb); delegate IntPtr ChildTypeDelegate (IntPtr raw); diff --git a/gtk/Dialog.custom b/gtk/Dialog.custom index 7a7357578..55e5ae6b7 100644 --- a/gtk/Dialog.custom +++ b/gtk/Dialog.custom @@ -48,13 +48,13 @@ public Dialog (string title, Gtk.Window parent, Gtk.DialogFlags flags) : base(In Raw = gtk_dialog_new_with_buttons (title, parent.Handle, (int) flags, IntPtr.Zero); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_dialog_get_vbox (IntPtr i); public Gtk.VBox VBox { get { return GLib.Object.GetObject (gtksharp_dialog_get_vbox (this.Handle), false) as VBox; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_dialog_get_action_area (IntPtr i); public Gtk.HButtonBox ActionArea { get { return GLib.Object.GetObject (gtksharp_dialog_get_action_area (this.Handle), false) as HButtonBox; } diff --git a/gtk/FileChooserDialog.custom b/gtk/FileChooserDialog.custom new file mode 100644 index 000000000..59fe31b2c --- /dev/null +++ b/gtk/FileChooserDialog.custom @@ -0,0 +1,15 @@ + [DllImport("libgtk-win32-2.0-0.dll")] + static extern IntPtr gtk_file_chooser_dialog_new(string title, IntPtr parent, int action, IntPtr nil); + + public FileChooserDialog (string title, Window parent, FileChooserAction action) + { + Raw = gtk_file_chooser_dialog_new (title, parent.Handle, (int)action, IntPtr.Zero); + } + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern IntPtr gtk_file_chooser_dialog_new_with_backend(string title, IntPtr parent, int action, string backend, IntPtr nil); + + public FileChooserDialog (string title, Window parent, FileChooserAction action, string backend) + { + Raw = gtk_file_chooser_dialog_new_with_backend (title, parent.Handle, (int)action, backend, IntPtr.Zero); + } diff --git a/gtk/FileSelection.custom b/gtk/FileSelection.custom index 5ef92ccc7..1fd2b4e29 100644 --- a/gtk/FileSelection.custom +++ b/gtk/FileSelection.custom @@ -36,73 +36,73 @@ public class FSButton : Gtk.Button { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_dir_list (IntPtr i); public Gtk.TreeView DirList { get { return GLib.Object.GetObject (gtksharp_file_selection_get_dir_list (this.Handle), false) as Gtk.TreeView; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_file_list (IntPtr i); public Gtk.TreeView FileList { get { return GLib.Object.GetObject (gtksharp_file_selection_get_file_list (this.Handle), false) as Gtk.TreeView; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_selection_entry (IntPtr i); public Gtk.Entry SelectionEntry { get { return GLib.Object.GetObject (gtksharp_file_selection_get_selection_entry (this.Handle), false) as Gtk.Entry; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_selection_text (IntPtr i); public Gtk.Label SelectionText { get { return GLib.Object.GetObject (gtksharp_file_selection_get_selection_text (this.Handle), false) as Gtk.Label; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_ok_button (IntPtr i); public Gtk.Button OkButton { get { return new FSButton (this, gtksharp_file_selection_get_ok_button (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_cancel_button (IntPtr i); public Gtk.Button CancelButton { get { return new FSButton (this, gtksharp_file_selection_get_cancel_button (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_help_button (IntPtr i); public Gtk.Button HelpButton { get { return new FSButton (this, gtksharp_file_selection_get_help_button (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_history_pulldown (IntPtr i); public Gtk.OptionMenu HistoryPulldown { get { return GLib.Object.GetObject (gtksharp_file_selection_get_history_pulldown (this.Handle), false) as Gtk.OptionMenu; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_history_menu (IntPtr i); public Gtk.Menu HistoryMenu { get { return GLib.Object.GetObject (gtksharp_file_selection_get_history_menu (this.Handle), false) as Gtk.Menu; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_fileop_dialog (IntPtr i); public Gtk.MessageDialog FileopDialog { get { return GLib.Object.GetObject (gtksharp_file_selection_get_fileop_dialog (this.Handle), false) as Gtk.MessageDialog; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_fileop_entry (IntPtr i); public Gtk.Entry FileopEntry { get { return GLib.Object.GetObject (gtksharp_file_selection_get_fileop_entry (this.Handle), false) as Gtk.Entry; } } -[DllImport("gtksharpglue", CallingConvention=CallingConvention.Cdecl)] +[DllImport("gtksharpglue-2.0", CallingConvention=CallingConvention.Cdecl)] static extern IntPtr gtksharp_file_selection_get_fileop_file (IntPtr i); public string FileopFile { get { @@ -110,31 +110,31 @@ public string FileopFile { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_fileop_c_dir (IntPtr i); public Gtk.Button FileopCDir { get { return new FSButton (this, gtksharp_file_selection_get_fileop_c_dir(this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_fileop_del_file (IntPtr i); public Gtk.Button FileopDelFile { get { return new FSButton (this, gtksharp_file_selection_get_fileop_del_file (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_fileop_ren_file (IntPtr i); public Gtk.Button FileopRenFile { get { return new FSButton (this, gtksharp_file_selection_get_fileop_ren_file (this.Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_button_area (IntPtr i); public Gtk.HButtonBox ButtonArea { get { return GLib.Object.GetObject (gtksharp_file_selection_get_button_area (this.Handle), false) as Gtk.HButtonBox; } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_file_selection_get_action_area (IntPtr i); public new Gtk.HButtonBox ActionArea { get { return GLib.Object.GetObject (gtksharp_file_selection_get_action_area (this.Handle), false) as Gtk.HButtonBox; } diff --git a/gtk/FileSystemModel.custom b/gtk/FileSystemModel.custom new file mode 100644 index 000000000..390fe6cb6 --- /dev/null +++ b/gtk/FileSystemModel.custom @@ -0,0 +1,59 @@ + [DllImport("libgtk-win32-2.0-0.dll")] + static extern bool gtk_tree_model_iter_children (IntPtr raw, out Gtk.TreeIter iter, IntPtr parent); + public bool IterChildren (out Gtk.TreeIter iter) { + bool raw_ret = gtk_tree_model_iter_children (Handle, out iter, IntPtr.Zero); + bool ret = raw_ret; + return ret; + } + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern int gtk_tree_model_iter_n_children (IntPtr raw, IntPtr iter); + public int IterNChildren () { + int raw_ret = gtk_tree_model_iter_n_children (Handle, IntPtr.Zero); + int ret = raw_ret; + return ret; + } + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern bool gtk_tree_model_iter_nth_child (IntPtr raw, out Gtk.TreeIter iter, IntPtr parent, int n); + public bool IterNthChild (out Gtk.TreeIter iter, int n) { + bool raw_ret = gtk_tree_model_iter_nth_child (Handle, out iter, IntPtr.Zero, n); + bool ret = raw_ret; + return ret; + } + + public void SetValue (Gtk.TreeIter iter, int column, bool value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, double value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, int value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, string value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, float value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, uint value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, object value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public object GetValue (Gtk.TreeIter iter, int column) { + GLib.Value val = new GLib.Value (); + GetValue (iter, column, val); + object ret = val.Val; + val.Dispose (); + return ret; + } diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index fe91d0927..cad3d9de8 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -4,6 +4,10 @@ key GdkModifierType GtkAccelFlags + 1 + 1 + 1 + 1 1 1 1 @@ -24,11 +28,13 @@ ref 1 GdkModifierType + BindingsActivate 1 1 1 1 1 + 1 gboolean GetEventsPending const-gchar* @@ -43,6 +49,7 @@ ref out out + 1 1 1 1 @@ -73,6 +80,16 @@ EmitRowsReordered ChangeSortColumn label + Activated + Add + 1 + 1 + Add + 1 + 1 + 1 + 1 + Remove 1 Change ChangeValue @@ -88,6 +105,7 @@ Entered Left SetDisplayOptions + CancelEditing 1 1 1 @@ -103,6 +121,7 @@ 1 1 1 + out 1 1 1 @@ -116,17 +135,23 @@ GtkResponseType GtkResponseType GtkResponseType + 1 + 1 Activated ClipboardCopied ClipboardCut ClipboardPasted 1 + GObject + Activated 1 1 1 1 1 1 + 1 + 1 1 1 pixbuf_animation @@ -175,6 +200,7 @@ 1 1 1 + Canceled Deactivated 1 1 @@ -248,9 +274,11 @@ out out ScrollAdjustmentsSet + Toggle 1 Toggle 1 + TooltipSet model out out @@ -265,8 +293,12 @@ out ref 1 - 1 + 1 + 1 + 1 Click + 1 + 1 1 1 1 @@ -320,6 +352,7 @@ 1 out 1 + AccelCanActivate ChildNotified WidgetEvent Focused @@ -341,6 +374,8 @@ 1 out out + 1 + 1 1 1 1 @@ -379,6 +414,7 @@ 1 1 1 + /api/namespace/class[@cname='GtkGlobal'] /api/namespace/object[@cname='GtkStyle'] /api/namespace/object[@cname='GtkStyle'] /api/namespace/object[@cname='GtkStyle'] diff --git a/gtk/IconTheme.custom b/gtk/IconTheme.custom new file mode 100644 index 000000000..a0314625c --- /dev/null +++ b/gtk/IconTheme.custom @@ -0,0 +1,52 @@ +// IconTheme.custom - customizations to Gtk.IconTheme +// +// Authors: Mike Kestner +// Jeroen Zwartepoorte +// +// Copyright (c) 2004 Novell, Inc. + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern IntPtr gtk_icon_theme_list_icons (IntPtr raw, string context); + + public string[] ListIcons (string context) + { + IntPtr list_ptr = gtk_icon_theme_list_icons (Handle, context); + if (list_ptr == IntPtr.Zero) + return new string [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (string)); + string[] result = new string [list.Count]; + int i = 0; + foreach (string val in list) + result [i++] = val; + return result; + } + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern void gtk_icon_theme_get_search_path(IntPtr raw, out IntPtr path, out int n_elements); + + [DllImport("libglib-2.0-0.dll")] + static extern void g_strfreev (IntPtr mem); + + public string[] SearchPath { + get { + string[] retval; + + unsafe { + int length; + IntPtr raw_ret; + gtk_icon_theme_get_search_path (Handle, out raw_ret, out length); + int size = Marshal.SizeOf (typeof (IntPtr)); + retval = new string[length]; + for (int i = 0, j = 0; i < length; i++, j += size) { + IntPtr string_ptr = Marshal.ReadIntPtr (new IntPtr (raw_ret.ToInt32 () + j)); + retval[i] = Marshal.PtrToStringAnsi (string_ptr); + } + + g_strfreev (raw_ret); + } + + return retval; + } + } + diff --git a/gtk/InputDialog.custom b/gtk/InputDialog.custom index 5542eb605..dc84cf32f 100644 --- a/gtk/InputDialog.custom +++ b/gtk/InputDialog.custom @@ -21,7 +21,7 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_input_dialog_get_save_button (IntPtr i); public Gtk.Button SaveButton { @@ -31,7 +31,7 @@ } } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_input_dialog_get_close_button (IntPtr i); public Gtk.Button CloseButton { diff --git a/gtk/Layout.custom b/gtk/Layout.custom index 1fa502543..f0b02e74b 100644 --- a/gtk/Layout.custom +++ b/gtk/Layout.custom @@ -24,7 +24,7 @@ // Boston, MA 02111-1307, USA. -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_layout_get_bin_window (IntPtr layout); public Gdk.Window BinWindow { diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 791f2340b..b8d6f2194 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -10,7 +10,7 @@ references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk TARGET = $(ASSEMBLY) ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(ASSEMBLY) $(ASSEMBLY).config gapi_DATA = $(API) $(ADDITIONAL_API) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) glue/generated.c gtk-sharp.snk @@ -30,6 +30,7 @@ build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs customs = \ Accel.custom \ AccelKey.custom \ + Action.custom \ Adjustment.custom \ Bin.custom \ Button.custom \ @@ -40,15 +41,19 @@ customs = \ ColorSelection.custom \ ColorSelectionDialog.custom \ Combo.custom \ + ComboBox.custom \ Container.custom \ Dialog.custom \ Entry.custom \ + FileChooserDialog.custom \ FileSelection.custom \ + FileSystemModel.custom \ Frame.custom \ HBox.custom \ HScale.custom \ IconFactory.custom \ IconSet.custom \ + IconTheme.custom \ ImageMenuItem.custom \ Init.custom \ InputDialog.custom \ @@ -61,7 +66,6 @@ customs = \ MenuItem.custom \ Notebook.custom \ Object.custom \ - Paned.custom \ Plug.custom \ RadioButton.custom \ RadioMenuItem.custom \ @@ -81,12 +85,14 @@ customs = \ TextView.custom \ TreeIter.custom \ TreeModel.custom \ + TreeModelFilter.custom \ TreeModelSort.custom \ TreePath.custom \ TreeSelection.custom \ TreeStore.custom \ TreeViewColumn.custom \ TreeView.custom \ + UIManager.custom \ VBox.custom \ VScale.custom \ Viewport.custom \ diff --git a/gtk/NodeStore.cs b/gtk/NodeStore.cs index 6ee2a3dd7..62d01e31e 100644 --- a/gtk/NodeStore.cs +++ b/gtk/NodeStore.cs @@ -260,7 +260,7 @@ namespace Gtk { return true; } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_node_store_set_tree_model_callbacks (IntPtr raw, ref TreeModelIfaceDelegates cbs); private void BuildTreeModelIface () @@ -281,7 +281,7 @@ namespace Gtk { gtksharp_node_store_set_tree_model_callbacks (Handle, ref tree_model_iface); } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_node_store_new (); public NodeStore (Type node_type) : base (IntPtr.Zero) @@ -339,7 +339,7 @@ namespace Gtk { } } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_node_store_emit_row_changed (IntPtr handle, IntPtr path, int node_idx); private void changed_cb (object o, EventArgs args) @@ -350,7 +350,7 @@ namespace Gtk { gtksharp_node_store_emit_row_changed (Handle, get_path_cb (node.ID), node.ID); } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_node_store_emit_row_inserted (IntPtr handle, IntPtr path, int node_idx); private void child_added_cb (object o, ITreeNode child) @@ -360,10 +360,10 @@ namespace Gtk { gtksharp_node_store_emit_row_inserted (Handle, get_path_cb (child.ID), child.ID); } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_node_store_emit_row_deleted (IntPtr handle, IntPtr path); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_node_store_emit_row_has_child_toggled (IntPtr handle, IntPtr path, int node_idx); private void child_deleted_cb (object o, int idx) @@ -439,7 +439,7 @@ namespace Gtk { return GetNodeAtPath (path); } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_node_store_get_type (); public static new GLib.GType GType { diff --git a/gtk/Object.custom b/gtk/Object.custom index b975819c9..9a3640d84 100755 --- a/gtk/Object.custom +++ b/gtk/Object.custom @@ -21,10 +21,10 @@ // Boston, MA 02111-1307, USA. - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern bool gtksharp_object_is_floating (IntPtr raw); - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern bool gtksharp_object_set_floating (IntPtr raw, bool val); [DllImport("libgobject-2.0-0.dll")] diff --git a/gtk/SelectionData.custom b/gtk/SelectionData.custom index a846ec112..f78f92aa0 100644 --- a/gtk/SelectionData.custom +++ b/gtk/SelectionData.custom @@ -18,7 +18,7 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern int gtksharp_gtk_selection_data_get_format (IntPtr selection_data); public int Format { @@ -27,7 +27,7 @@ } } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern int gtksharp_gtk_selection_data_get_length (IntPtr selection_data); public int Length { @@ -54,7 +54,7 @@ } } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern IntPtr gtksharp_gtk_selection_data_get_data_pointer (IntPtr selection_data); public byte[] Data { @@ -70,7 +70,7 @@ Set(type, format, data, data.Length); } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern IntPtr gtksharp_gtk_selection_data_get_selection (IntPtr selection_data); public Gdk.Atom Selection { @@ -79,7 +79,7 @@ } } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern IntPtr gtksharp_gtk_selection_data_get_target (IntPtr selection_data); public Gdk.Atom Target { @@ -111,7 +111,7 @@ } } - [DllImport("gtksharpglue")] + [DllImport("gtksharpglue-2.0")] private static extern IntPtr gtksharp_gtk_selection_data_get_type (IntPtr selection_data); public Gdk.Atom Type { diff --git a/gtk/Style.custom b/gtk/Style.custom index ddae36a79..938530f49 100644 --- a/gtk/Style.custom +++ b/gtk/Style.custom @@ -33,21 +33,21 @@ static Gdk.GC EnsureGC (IntPtr raw) { return ret; } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_white_gc (IntPtr style); public Gdk.GC WhiteGC { get { return EnsureGC (gtksharp_gtk_style_get_white_gc (Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_black_gc (IntPtr style); public Gdk.GC BlackGC { get { return EnsureGC (gtksharp_gtk_style_get_black_gc (Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_fg_gc (IntPtr style, int i); public Gdk.GC ForegroundGC (StateType state) @@ -56,7 +56,7 @@ public Gdk.GC ForegroundGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_fg_gc (IntPtr style, int i, IntPtr gc); public void SetForegroundGC (StateType state, Gdk.GC gc) @@ -75,7 +75,7 @@ public Gdk.GC[] ForegroundGCs { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_bg_gc (IntPtr style, int i); public Gdk.GC BackgroundGC (StateType state) @@ -84,7 +84,7 @@ public Gdk.GC BackgroundGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_bg_gc (IntPtr style, int i, IntPtr gc); public void SetBackgroundGC (StateType state, Gdk.GC gc) @@ -103,7 +103,7 @@ public Gdk.GC[] BackgroundGCs { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_base_gc (IntPtr style, int i); public Gdk.GC BaseGC (StateType state) @@ -112,7 +112,7 @@ public Gdk.GC BaseGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_base_gc (IntPtr style, int i, IntPtr gc); public void SetBaseGC (StateType state, Gdk.GC gc) @@ -120,7 +120,7 @@ public void SetBaseGC (StateType state, Gdk.GC gc) gtksharp_gtk_style_set_base_gc (Handle, (int) state, gc.Handle); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_text_gc (IntPtr style, int i); public Gdk.GC TextGC (StateType state) @@ -129,7 +129,7 @@ public Gdk.GC TextGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_text_gc (IntPtr style, int i, IntPtr gc); public void SetTextGC (StateType state, Gdk.GC gc) @@ -137,7 +137,7 @@ public void SetTextGC (StateType state, Gdk.GC gc) gtksharp_gtk_style_set_text_gc (Handle, (int) state, gc.Handle); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_text_aa_gc (IntPtr style, int i); public Gdk.GC TextAAGC (StateType state) @@ -146,7 +146,7 @@ public Gdk.GC TextAAGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_text_aa_gc (IntPtr style, int i, IntPtr gc); public void SetTextAAGC (StateType state, Gdk.GC gc) @@ -154,7 +154,7 @@ public void SetTextAAGC (StateType state, Gdk.GC gc) gtksharp_gtk_style_set_text_aa_gc (Handle, (int) state, gc.Handle); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_light_gc (IntPtr style, int i); public Gdk.GC LightGC (StateType state) @@ -163,7 +163,7 @@ public Gdk.GC LightGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_light_gc (IntPtr style, int i, IntPtr gc); public void SetLightGC (StateType state, Gdk.GC gc) @@ -171,7 +171,7 @@ public void SetLightGC (StateType state, Gdk.GC gc) gtksharp_gtk_style_set_light_gc (Handle, (int) state, gc.Handle); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_dark_gc (IntPtr style, int i); public Gdk.GC DarkGC (StateType state) @@ -180,7 +180,7 @@ public Gdk.GC DarkGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_dark_gc (IntPtr style, int i, IntPtr gc); public void SetDarkGC (StateType state, Gdk.GC gc) @@ -188,7 +188,7 @@ public void SetDarkGC (StateType state, Gdk.GC gc) gtksharp_gtk_style_set_dark_gc (Handle, (int) state, gc.Handle); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_mid_gc (IntPtr style, int i); public Gdk.GC MidGC (StateType state) @@ -197,7 +197,7 @@ public Gdk.GC MidGC (StateType state) return EnsureGC (raw); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_set_mid_gc (IntPtr style, int i, IntPtr gc); public void SetMidGC (StateType state, Gdk.GC gc) @@ -205,21 +205,21 @@ public void SetMidGC (StateType state, Gdk.GC gc) gtksharp_gtk_style_set_mid_gc (Handle, (int) state, gc.Handle); } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_white (IntPtr style); public Gdk.Color White { get { return Gdk.Color.New (gtksharp_gtk_style_get_white (Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_black (IntPtr style); public Gdk.Color Black { get { return Gdk.Color.New (gtksharp_gtk_style_get_black (Handle)); } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_bg (IntPtr style, int i); public Gdk.Color Background (StateType state) @@ -239,7 +239,7 @@ public Gdk.Color[] Backgrounds { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_fg (IntPtr style, int i); public Gdk.Color Foreground (StateType state) @@ -259,7 +259,7 @@ public Gdk.Color[] Foregrounds { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_text (IntPtr style, int i); public Gdk.Color Text (StateType state) @@ -279,7 +279,7 @@ public Gdk.Color[] TextColors { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_base (IntPtr style, int i); public Gdk.Color Base (StateType state) @@ -299,9 +299,9 @@ public Gdk.Color[] BaseColors { } } -[DllImport ("gtksharpglue")] +[DllImport ("gtksharpglue-2.0")] static extern int gtksharp_gtk_style_get_thickness (IntPtr style, int x_axis); -[DllImport ("gtksharpglue")] +[DllImport ("gtksharpglue-2.0")] static extern void gtksharp_gtk_style_set_thickness (IntPtr style, int value); public int XThickness { @@ -324,7 +324,7 @@ public int YThickness { } } -[DllImport ("gtksharpglue")] +[DllImport ("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_style_get_font_description (IntPtr style); public Pango.FontDescription FontDescription { diff --git a/gtk/TextBuffer.custom b/gtk/TextBuffer.custom index ae83fd285..e649956fa 100644 --- a/gtk/TextBuffer.custom +++ b/gtk/TextBuffer.custom @@ -94,3 +94,4 @@ public void InsertAtCursor(string text) { gtk_text_buffer_insert_at_cursor(Handle, text, -1); } + diff --git a/gtk/TextIter.custom b/gtk/TextIter.custom index b12b7b999..ecd568f14 100755 --- a/gtk/TextIter.custom +++ b/gtk/TextIter.custom @@ -19,7 +19,7 @@ // Boston, MA 02111-1307, USA. - [DllImport("glibsharpglue")] + [DllImport("glibsharpglue-2.0")] static extern IntPtr gtksharp_unichar_to_utf8_string (int raw); [DllImport("libgtk-win32-2.0-0.dll")] diff --git a/gtk/TreeModelFilter.custom b/gtk/TreeModelFilter.custom new file mode 100644 index 000000000..50241e850 --- /dev/null +++ b/gtk/TreeModelFilter.custom @@ -0,0 +1,59 @@ + [DllImport("libgtk-win32-2.0-0.dll")] + static extern bool gtk_tree_model_iter_children (IntPtr raw, out Gtk.TreeIter iter, IntPtr parent); + public bool IterChildren (out Gtk.TreeIter iter) { + bool raw_ret = gtk_tree_model_iter_children (Handle, out iter, IntPtr.Zero); + bool ret = raw_ret; + return ret; + } + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern int gtk_tree_model_iter_n_children (IntPtr raw, IntPtr iter); + public int IterNChildren () { + int raw_ret = gtk_tree_model_iter_n_children (Handle, IntPtr.Zero); + int ret = raw_ret; + return ret; + } + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern bool gtk_tree_model_iter_nth_child (IntPtr raw, out Gtk.TreeIter iter, IntPtr parent, int n); + public bool IterNthChild (out Gtk.TreeIter iter, int n) { + bool raw_ret = gtk_tree_model_iter_nth_child (Handle, out iter, IntPtr.Zero, n); + bool ret = raw_ret; + return ret; + } + + public void SetValue (Gtk.TreeIter iter, int column, bool value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, double value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, int value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, string value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, float value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, uint value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public void SetValue (Gtk.TreeIter iter, int column, object value) { + SetValue (iter, column, new GLib.Value (value)); + } + + public object GetValue (Gtk.TreeIter iter, int column) { + GLib.Value val = GLib.Value.Empty; + GetValue (iter, column, ref val); + object ret = val.Val; + val.Dispose (); + return ret; + } diff --git a/gtk/Paned.custom b/gtk/UIManager.custom similarity index 56% rename from gtk/Paned.custom rename to gtk/UIManager.custom index 172d770cc..343da12fb 100644 --- a/gtk/Paned.custom +++ b/gtk/UIManager.custom @@ -1,15 +1,13 @@ +// Gtk.UiManager.custom - Gtk UiManager class customizations // -// Gtk.Paned.custom - Gtk Paned class customizations +// Author: John Luke // -// Author: Duncan Mak (duncan@ximian.com) -// -// Copyright (C) 2002 Ximian, Inc. +// Copyright (C) 2004 Novell, Inc. // // This code is inserted after the automatically generated code. // -// // This program is free software; you can redistribute it and/or -// modify it under the terms of version 2 of the Lesser GNU General +// modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, @@ -22,17 +20,15 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. + public uint AddUiFromResource (string resource) + { + if (resource == null) + throw new ArgumentNullException ("resource"); + + System.IO.Stream s = System.Reflection.Assembly.GetCallingAssembly ().GetManifestResourceStream (resource); + if (s == null) + throw new ArgumentException ("resource must be a valid resource name of 'assembly'."); -[DllImport ("gtksharpglue")] -static extern IntPtr gtksharp_paned_get_child1 (IntPtr i); + return AddUiFromString (new System.IO.StreamReader (s).ReadToEnd ()); + } -public Gtk.Widget Child1 { - get { return GLib.Object.GetObject (gtksharp_paned_get_child1 (this.Handle), false) as Widget; } -} - -[DllImport ("gtksharpglue")] -static extern IntPtr gtksharp_paned_get_child2 (IntPtr i); - -public Gtk.Widget Child2 { - get { return GLib.Object.GetObject (gtksharp_paned_get_child2 (this.Handle), false) as Widget; } -} diff --git a/gtk/Widget.custom b/gtk/Widget.custom index 06a75ccb4..14f9a09d4 100644 --- a/gtk/Widget.custom +++ b/gtk/Widget.custom @@ -23,10 +23,10 @@ // Boston, MA 02111-1307, USA. -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_widget_get_allocation (IntPtr style); -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_gtk_widget_set_allocation (IntPtr raw, Gdk.Rectangle rect); public Gdk.Rectangle Allocation { @@ -35,9 +35,9 @@ public Gdk.Rectangle Allocation { } -[DllImport ("gtksharpglue")] +[DllImport ("gtksharpglue-2.0")] static extern IntPtr gtksharp_gtk_widget_get_window (IntPtr widget); -[DllImport ("gtksharpglue")] +[DllImport ("gtksharpglue-2.0")] static extern void gtksharp_gtk_widget_set_window (IntPtr widget, IntPtr window); public Gdk.Window GdkWindow { get { @@ -64,7 +64,7 @@ public void AddAccelerator (string accel_signal, AccelGroup accel_group, AccelKe [DllImport("libgtk-win32-2.0-0.dll")] static extern void gtk_widget_set_state (IntPtr raw, int state); -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern int gtksharp_gtk_widget_get_state (IntPtr raw); public Gtk.StateType State { @@ -76,10 +76,10 @@ public Gtk.StateType State { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern int gtksharp_gtk_widget_get_flags (IntPtr raw); -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern void gtksharp_gtk_widget_set_flags (IntPtr raw, int flags); public int Flags { @@ -156,7 +156,7 @@ public bool IsDrawable { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern int gtksharp_gtk_widget_style_get_int (IntPtr raw, string name); public int FocusLineWidth { @@ -165,7 +165,7 @@ public int FocusLineWidth { } } -[DllImport("gtksharpglue")] +[DllImport("gtksharpglue-2.0")] static extern int gtksharp_widget_connect_set_scroll_adjustments_signal (IntPtr gtype, SetScrollAdjustmentsDelegate cb); delegate void SetScrollAdjustmentsDelegate (IntPtr widget, IntPtr hadj, IntPtr vadj); diff --git a/gtk/glue/Makefile.am b/gtk/glue/Makefile.am index 7dfe67471..219dd3f7e 100644 --- a/gtk/glue/Makefile.am +++ b/gtk/glue/Makefile.am @@ -1,6 +1,6 @@ -lib_LTLIBRARIES = libgtksharpglue.la +lib_LTLIBRARIES = libgtksharpglue-2.0.la -libgtksharpglue_la_SOURCES = \ +libgtksharpglue_2_0_la_SOURCES = \ adjustment.c \ button.c \ cellrenderer.c \ @@ -23,14 +23,14 @@ libgtksharpglue_la_SOURCES = \ # Adding a new glue file? # Please remember to update makefile.win32 -libgtksharpglue_la_LDFLAGS = -module -avoid-version -no-undefined +libgtksharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined -libgtksharpglue_la_LIBADD = $(GTK_LIBS) +libgtksharpglue_2_0_la_LIBADD = $(GTK_LIBS) INCLUDES = $(GTK_CFLAGS) -I$(top_srcdir) -libgtksharpglue.dll: $(libgtksharpglue_la_OBJECTS) libgtksharpglue.rc libgtksharpglue.def - ./build-dll libgtksharpglue $(VERSION) +libgtksharpglue.dll: $(libgtksharpglue_2_0_la_OBJECTS) libgtksharpglue.rc libgtksharpglue.def + ./build-dll libgtksharpglue-2.0 $(VERSION) CLEANFILES = lib*.a lib*.dll diff --git a/gtk/glue/adjustment.c b/gtk/glue/adjustment.c index 54cec4531..742d667e6 100644 --- a/gtk/glue/adjustment.c +++ b/gtk/glue/adjustment.c @@ -28,25 +28,6 @@ void gtksharp_gtk_adjustment_set_bounds (GtkAdjustment *adj, gdouble page_increment, gdouble page_size); -gdouble gtksharp_gtk_adjustment_get_lower (GtkAdjustment *adj); -void gtksharp_gtk_adjustment_set_lower (GtkAdjustment *adj, gdouble lower); - -gdouble gtksharp_gtk_adjustment_get_upper (GtkAdjustment *adj); -void gtksharp_gtk_adjustment_set_upper (GtkAdjustment *adj, gdouble upper); - -gdouble gtksharp_gtk_adjustment_get_step_increment (GtkAdjustment *adj); - -void gtksharp_gtk_adjustment_set_step_increment (GtkAdjustment *adj, - gdouble step_increment); - -gdouble gtksharp_gtk_adjustment_get_page_increment (GtkAdjustment *adj); - -void gtksharp_gtk_adjustment_set_page_increment (GtkAdjustment *adj, - gdouble page_increment); - -gdouble gtksharp_gtk_adjustment_get_page_size (GtkAdjustment *adj); - -void gtksharp_gtk_adjustment_set_page_size (GtkAdjustment *adj, gdouble page_size); /* */ void @@ -64,72 +45,3 @@ gtksharp_gtk_adjustment_set_bounds (GtkAdjustment *adj, gtk_adjustment_changed (adj); } -gdouble -gtksharp_gtk_adjustment_get_lower (GtkAdjustment *adj) -{ - return adj->lower; -} - -void -gtksharp_gtk_adjustment_set_lower (GtkAdjustment *adj, gdouble lower) -{ - adj->lower = lower; - - gtk_adjustment_changed (adj); -} - -gdouble -gtksharp_gtk_adjustment_get_upper (GtkAdjustment *adj) -{ - return adj->upper; -} - -void -gtksharp_gtk_adjustment_set_upper (GtkAdjustment *adj, gdouble upper) -{ - adj->upper = upper; - - gtk_adjustment_changed (adj); -} - -gdouble -gtksharp_gtk_adjustment_get_step_increment (GtkAdjustment *adj) -{ - return adj->step_increment; -} - -void -gtksharp_gtk_adjustment_set_step_increment (GtkAdjustment *adj, gdouble step_increment) -{ - adj->step_increment = step_increment; - - gtk_adjustment_changed (adj); -} - -gdouble -gtksharp_gtk_adjustment_get_page_increment (GtkAdjustment *adj) -{ - return adj->page_increment; -} - -void -gtksharp_gtk_adjustment_set_page_increment (GtkAdjustment *adj, gdouble page_increment) -{ - adj->page_increment = page_increment; - - gtk_adjustment_changed (adj); -} - -gdouble -gtksharp_gtk_adjustment_get_page_size (GtkAdjustment *adj) -{ - return adj->page_size; -} - -void -gtksharp_gtk_adjustment_set_page_size (GtkAdjustment *adj, gdouble page_size) -{ - adj->page_size = page_size; - - gtk_adjustment_changed (adj); -} diff --git a/gtk/glue/makefile.win32 b/gtk/glue/makefile.win32 index 8936a106b..330170219 100755 --- a/gtk/glue/makefile.win32 +++ b/gtk/glue/makefile.win32 @@ -22,16 +22,16 @@ GLUE_OBJS = \ widget.o \ win32dll.o -all: gtksharpglue.dll +all: gtksharpglue-2.0.dll %.o: %.c $(CC) -c $(CFLAGS) $(GTK_CFLAGS) -o $@ $^ -gtksharpglue.dll: $(GLUE_OBJS) - $(DLLWRAP) --output-lib=libgtksharpglue.a --dllname=gtksharpglue.dll --driver-name=gcc --output-def=gtksharpglue.def $(GLUE_OBJS) $(GTK_LIBS) +gtksharpglue-2.0.dll: $(GLUE_OBJS) + $(DLLWRAP) --output-lib=libgtksharpglue-2.0.a --dllname=gtksharpglue-2.0.dll --driver-name=gcc --output-def=gtksharpglue-2.0.def $(GLUE_OBJS) $(GTK_LIBS) clean: - rm -f gtksharpglue.dll *.o libgtksharpglue.a + rm -f gtksharpglue-2.0.dll *.o libgtksharpglue-2.0.a diff --git a/gtk/glue/widget.c b/gtk/glue/widget.c index e187b3607..8b2dda6cb 100644 --- a/gtk/glue/widget.c +++ b/gtk/glue/widget.c @@ -32,6 +32,9 @@ void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags); int gtksharp_gtk_widget_style_get_int (GtkWidget *widget, const char *name); void gtksharp_widget_connect_set_scroll_adjustments_signal (GType gtype, gpointer callback); void _gtksharp_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); +int gtksharp_gtk_widget_get_flags (GtkWidget *widget); +void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags); +int gtksharp_gtk_widget_style_get_int (GtkWidget *widget, const char *name); /* */ GdkRectangle* diff --git a/gtk/gtk-api.raw b/gtk/gtk-api.raw index 8d89cd2e6..d994e4bcc 100644 --- a/gtk/gtk-api.raw +++ b/gtk/gtk-api.raw @@ -31,6 +31,13 @@ + + + + + + + @@ -87,15 +94,6 @@ - - - - - - - - - @@ -131,13 +129,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -148,6 +200,15 @@ + + + + + + + + + @@ -163,6 +224,14 @@ + + + + + + + + @@ -190,6 +259,7 @@ + @@ -233,6 +303,10 @@ + + + + @@ -325,6 +399,14 @@ + + + + + + + + @@ -357,6 +439,20 @@ + + + + + + + + + + + + + + @@ -387,6 +483,14 @@ + + + + + + + + @@ -396,9 +500,9 @@ - - - + + + @@ -409,12 +513,12 @@ - - - - - - + + + + + + @@ -441,6 +545,18 @@ + + + + + + + + + + + + @@ -470,6 +586,7 @@ + @@ -490,6 +607,23 @@ + + + + + + + + + + + + + + + + + @@ -534,6 +668,16 @@ + + + + + + + + + + @@ -558,6 +702,15 @@ + + + + + + + + + @@ -587,12 +740,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -604,6 +791,9 @@ + + + @@ -612,6 +802,13 @@ + + + + + + + @@ -760,6 +957,24 @@ + + + + + + + + + + + + + + + + + + @@ -855,6 +1070,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -949,6 +1223,433 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1001,7 +1702,7 @@ - + @@ -1017,14 +1718,14 @@ - + - + @@ -1269,6 +1970,15 @@ + + + + + + + + + @@ -1370,6 +2080,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1385,6 +2198,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1392,6 +2494,12 @@ + + + + + + @@ -1449,6 +2557,19 @@ + + + + + + + + + + + + + @@ -1469,6 +2590,15 @@ + + + + + + + + + @@ -1630,10 +2760,14 @@ + + + + @@ -1679,6 +2813,16 @@ + + + + + + + + + + @@ -1719,6 +2863,19 @@ + + + + + + + + + + + + + @@ -1751,12 +2908,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1764,6 +2948,13 @@ + + + + + + + @@ -1815,6 +3006,13 @@ + + + + + + + @@ -1860,7 +3058,7 @@ - + @@ -1877,6 +3075,9 @@ + + + @@ -1900,6 +3101,12 @@ + + + + + + @@ -1922,6 +3129,12 @@ + + + + + + @@ -1969,6 +3182,9 @@ + + + @@ -2028,13 +3244,14 @@ - + + @@ -2058,6 +3275,7 @@ + @@ -2076,6 +3294,7 @@ + @@ -2133,6 +3352,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2160,8 +3477,10 @@ + + @@ -2178,6 +3497,9 @@ + + + @@ -2201,12 +3523,24 @@ + + + + + + + + + + + + @@ -2245,6 +3579,13 @@ + + + + + + + @@ -2285,6 +3626,13 @@ + + + + + + + @@ -2292,6 +3640,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2304,6 +3713,12 @@ + + + + + + @@ -2350,7 +3765,7 @@ - + @@ -2362,6 +3777,12 @@ + + + + + + @@ -2371,7 +3792,7 @@ - + @@ -2395,7 +3816,13 @@ - + + + + + + + @@ -2413,7 +3840,7 @@ - + @@ -2433,45 +3860,45 @@ - + - + - - + + - + - + - + - + - + @@ -2479,6 +3906,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2646,6 +4203,15 @@ + + + + + + + + + @@ -2891,6 +4457,13 @@ + + + + + + + @@ -2915,6 +4488,9 @@ + + + @@ -2941,6 +4517,7 @@ + @@ -3006,9 +4583,21 @@ + + + + + + + + + + + + @@ -3041,12 +4630,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3065,6 +4690,12 @@ + + + + + + @@ -3084,11 +4715,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3158,6 +5086,24 @@ + + + + + + + + + + + + + + + + + + @@ -3190,6 +5136,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3208,6 +5232,9 @@ + + + @@ -3240,6 +5267,9 @@ + + + @@ -3425,10 +5455,28 @@ + + + + + + + + + + + + + + + + + + @@ -3571,6 +5619,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3592,6 +5746,13 @@ + + + + + + + @@ -3672,6 +5833,13 @@ + + + + + + + @@ -3916,7 +6084,7 @@ - + @@ -4003,6 +6171,13 @@ + + + + + + + @@ -4013,7 +6188,7 @@ - + @@ -4021,7 +6196,7 @@ - + @@ -4031,7 +6206,7 @@ - + @@ -4039,7 +6214,7 @@ - + @@ -4047,7 +6222,7 @@ - + @@ -4055,72 +6230,94 @@ - + + + + + + + + + + + + + + + + + - + - + - + + + + + + + - + - + - + - + - + - + - + - + @@ -4129,16 +6326,16 @@ - + - + - + @@ -4149,7 +6346,7 @@ - + @@ -4206,6 +6403,12 @@ + + + + + + @@ -4266,6 +6469,12 @@ + + + + + + @@ -4375,6 +6584,9 @@ + + + @@ -4432,6 +6644,9 @@ + + + @@ -4603,6 +6818,16 @@ + + + + + + + + + + @@ -4674,6 +6899,12 @@ + + + + + + @@ -4870,6 +7101,9 @@ + + + @@ -4924,6 +7158,23 @@ + + + + + + + + + + + + + + + + + @@ -4981,13 +7232,17 @@ - - + + + + + + @@ -5035,14 +7290,14 @@ - + - + @@ -5101,7 +7356,7 @@ - + @@ -5109,7 +7364,7 @@ - + @@ -5128,14 +7383,14 @@ - + - + @@ -5173,6 +7428,12 @@ + + + + + + @@ -5205,6 +7466,18 @@ + + + + + + + + + + + + @@ -5234,6 +7507,12 @@ + + + + + + @@ -5252,24 +7531,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -5281,26 +7678,26 @@ - + - + - + - - + + - + - + @@ -5334,6 +7731,8 @@ + + @@ -5385,7 +7784,7 @@ - + @@ -5393,6 +7792,12 @@ + + + + + + @@ -5422,6 +7827,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5500,9 +7935,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5527,10 +7991,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5580,6 +8092,12 @@ + + + + + + @@ -5591,18 +8109,35 @@ + + + + + + + + + + + + + + + + + @@ -5610,6 +8145,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5845,6 +8417,16 @@ + + + + + + + + + + @@ -5983,6 +8565,23 @@ + + + + + + + + + + + + + + + + + @@ -6123,6 +8722,12 @@ + + + + + + @@ -6316,6 +8921,7 @@ + @@ -6406,12 +9012,18 @@ - + - + + + + + + + @@ -6622,6 +9234,9 @@ + + + @@ -6632,6 +9247,9 @@ + + + @@ -6650,6 +9268,15 @@ + + + + + + + + + @@ -7221,6 +9848,13 @@ + + + + + + + @@ -7451,8 +10085,8 @@ - - + + @@ -7492,6 +10126,9 @@ + + + @@ -7626,6 +10263,9 @@ + + + @@ -7684,6 +10324,9 @@ + + + @@ -7779,6 +10422,12 @@ + + + + + + @@ -7822,6 +10471,12 @@ + + + + + + @@ -7889,6 +10544,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7947,6 +10644,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7960,23 +10684,33 @@ - + - + + + + + + + + + + - + + @@ -7989,7 +10723,7 @@ - + @@ -8000,10 +10734,10 @@ - + - + @@ -8011,12 +10745,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -8026,7 +10788,14 @@ - + + + + + + + + @@ -8040,7 +10809,7 @@ - + @@ -8052,13 +10821,13 @@ - + - + @@ -8069,7 +10838,7 @@ - + @@ -8079,7 +10848,7 @@ - + @@ -8092,7 +10861,7 @@ - + @@ -8103,10 +10872,10 @@ - + - + @@ -8114,13 +10883,20 @@ - + - + + + + + + + + @@ -8132,6 +10908,12 @@ + + + + + + @@ -8144,7 +10926,7 @@ - + @@ -8171,10 +10953,24 @@ + + + + + + + + + + + + + + @@ -8184,6 +10980,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -8205,6 +11272,7 @@ + @@ -8544,6 +11612,7 @@ + @@ -9073,6 +12142,7 @@ + @@ -9087,12 +12157,16 @@ + + + + @@ -9158,6 +12232,9 @@ + + + @@ -9253,6 +12330,12 @@ + + + + + + @@ -9332,6 +12415,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9344,10 +12568,28 @@ + + + + + + + + + + + + + + + + + + @@ -9475,6 +12717,7 @@ + @@ -9904,6 +13147,13 @@ + + + + + + + @@ -9940,6 +13190,18 @@ + + + + + + + + + + + + @@ -10007,6 +13269,12 @@ + + + + + + @@ -10079,6 +13347,9 @@ + + + @@ -10160,6 +13431,9 @@ + + + @@ -10173,21 +13447,21 @@ - + - + - + @@ -10206,7 +13480,7 @@ - + @@ -10239,6 +13513,18 @@ + + + + + + + + + + + + @@ -10254,6 +13540,9 @@ + + + @@ -10274,6 +13563,12 @@ + + + + + + @@ -10300,6 +13595,13 @@ + + + + + + + @@ -10373,6 +13675,12 @@ + + + + + + @@ -10423,6 +13731,20 @@ + + + + + + + + + + + + + + @@ -10540,6 +13862,7 @@ + @@ -10555,6 +13878,9 @@ + + + @@ -10600,6 +13926,12 @@ + + + + + + @@ -10644,6 +13976,9 @@ + + + @@ -10731,9 +14066,15 @@ + + + + + + @@ -10768,6 +14109,12 @@ + + + + + + @@ -10797,6 +14144,12 @@ + + + + + + @@ -10815,6 +14168,12 @@ + + + + + + @@ -10895,6 +14254,18 @@ + + + + + + + + + + + + @@ -10907,6 +14278,14 @@ + + + + + + + + @@ -11010,11 +14389,19 @@ + + + + + + + + - - - - + + + + @@ -11139,11 +14526,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11151,6 +14667,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11211,6 +14775,9 @@ + + + @@ -11248,6 +14815,12 @@ + + + + + + @@ -11279,6 +14852,7 @@ + @@ -11299,7 +14873,7 @@ - + @@ -11307,12 +14881,19 @@ - + + + + + + + + @@ -11322,62 +14903,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -11395,6 +14921,14 @@ + + + + + + + + @@ -11516,6 +15050,7 @@ + @@ -11747,6 +15282,24 @@ + + + + + + + + + + + + + + + + + + @@ -11870,6 +15423,24 @@ + + + + + + + + + + + + + + + + + + @@ -12087,7 +15658,16 @@ - + + + + + + + + + + @@ -12263,6 +15843,18 @@ + + + + + + + + + + + + @@ -12292,80 +15884,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -12407,14 +15925,6 @@ - - - - - - - - @@ -12429,11 +15939,14 @@ + + + - + @@ -12459,9 +15972,6 @@ - - - @@ -12754,6 +16264,20 @@ + + + + + + + + + + + + + + @@ -12784,9 +16308,6 @@ - - - @@ -12811,16 +16332,21 @@ - - - - - - - - + + + + - + + + + + + + + + + @@ -12966,6 +16492,16 @@ + + + + + + + + + + @@ -13010,6 +16546,12 @@ + + + + + + @@ -13043,6 +16585,13 @@ + + + + + + + @@ -13056,6 +16605,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -13137,14 +16992,14 @@ - + - + @@ -13154,7 +17009,7 @@ - + @@ -13162,13 +17017,13 @@ - + - + @@ -13212,7 +17067,7 @@ - + @@ -13223,7 +17078,7 @@ - + @@ -13308,12 +17163,33 @@ + + + + + + + + + + + + + + + + + + + + + @@ -13401,6 +17277,12 @@ + + + + + + @@ -13430,7 +17312,7 @@ - + @@ -13477,6 +17359,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -13503,14 +17494,6 @@ - - - - - - - - @@ -13536,7 +17519,7 @@ - + @@ -13544,7 +17527,7 @@ - + @@ -13554,7 +17537,7 @@ - + @@ -13579,6 +17562,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -13610,8 +17646,10 @@ + + @@ -13620,6 +17658,7 @@ + @@ -13646,6 +17685,7 @@ + diff --git a/gtkhtml/.cvsignore b/gtkhtml/.cvsignore index 2980ae778..4d7c1a533 100755 --- a/gtkhtml/.cvsignore +++ b/gtkhtml/.cvsignore @@ -1,4 +1,4 @@ -gtkhtml-sharp.pc +*.pc AssemblyInfo.cs *.dll *.dll.config diff --git a/gtkhtml/Makefile.am b/gtkhtml/Makefile.am index 3fe69b01b..00c19de69 100644 --- a/gtkhtml/Makefile.am +++ b/gtkhtml/Makefile.am @@ -2,7 +2,7 @@ if ENABLE_GTKHTML TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gtkhtml-sharp.pc +pkgconfig_DATA = gtkhtml-sharp-2.0.pc else TARGET = APIS = @@ -15,12 +15,12 @@ ASSEMBLY_NAME = gtkhtml-sharp references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gtk/gtk-sharp.dll /r:../art/art-sharp.dll /r:../gnome/gnome-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) gapi_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = gtkhtml-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = gtkhtml-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = @@ -39,7 +39,7 @@ EXTRA_DIST = \ $(METADATA) \ $(customs) \ $(sources) \ - gtkhtml-sharp.pc.in + gtkhtml-sharp-2.0.pc.in $(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/gtkhtml/gtkhtml-sharp.pc.in b/gtkhtml/gtkhtml-sharp-2.0.pc.in similarity index 62% rename from gtkhtml/gtkhtml-sharp.pc.in rename to gtkhtml/gtkhtml-sharp-2.0.pc.in index 3e0f49686..6f9bf661a 100644 --- a/gtkhtml/gtkhtml-sharp.pc.in +++ b/gtkhtml/gtkhtml-sharp-2.0.pc.in @@ -6,5 +6,5 @@ libdir=${exec_prefix}/lib Name: Gtkhtml# Description: Gtkhtml# - Gtkhtml .NET Binding Version: @VERSION@ -Requires: gnome-sharp -Libs: -r:${libdir}/mono/@PACKAGE@/gtkhtml-sharp.dll +Requires: gnome-sharp-2.0 +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/gtkhtml-sharp.dll diff --git a/gtkhtml/gtkhtml-sharp.dll.config.in b/gtkhtml/gtkhtml-sharp.dll.config.in index 6282da4e4..f0404814a 100644 --- a/gtkhtml/gtkhtml-sharp.dll.config.in +++ b/gtkhtml/gtkhtml-sharp.dll.config.in @@ -1,3 +1,4 @@ + diff --git a/panelapplet/.cvsignore b/panelapplet/.cvsignore new file mode 100644 index 000000000..06938f08e --- /dev/null +++ b/panelapplet/.cvsignore @@ -0,0 +1,10 @@ +Makefile.in +Makefile +*.dll +generated +generated-stamp +panelapplet-api.xml +AssemblyInfo.cs +panelapplet-sharp.dll.config +*.pc +gtk-sharp.snk diff --git a/panelapplet/AppletFactory.cs b/panelapplet/AppletFactory.cs new file mode 100644 index 000000000..8b3fc4669 --- /dev/null +++ b/panelapplet/AppletFactory.cs @@ -0,0 +1,36 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace PanelApplet +{ + public class AppletFactory + { + private AppletFactory () { } + + private static string _IID; + private static string _factoryIID; + private static PanelAppletSharp.FactoryCallbackWrapper cb_wrapper; + + public static void Register (Type applet_type) + { + PanelApplet applet = (PanelApplet) Activator.CreateInstance (applet_type, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, new object[] {IntPtr.Zero}, null); + + cb_wrapper = new PanelAppletSharp.FactoryCallbackWrapper (new FactoryCallback (Creation), null); + _IID = applet.IID; + _factoryIID = applet.FactoryIID; + panel_applet_factory_main(_factoryIID, GLib.Object.LookupGType (applet_type).Val, cb_wrapper.NativeDelegate, IntPtr.Zero); + } + + private static bool Creation (PanelApplet applet, string iid) + { + if (_IID != iid) + return false; + applet.Creation (); + return true; + } + + [DllImport("panel-applet-2")] + static extern int panel_applet_factory_main(string iid, IntPtr applet_type, PanelAppletSharp.FactoryCallbackNative cb, IntPtr data); + } +} diff --git a/panelapplet/AssemblyInfo.cs.in b/panelapplet/AssemblyInfo.cs.in new file mode 100644 index 000000000..727ae19f7 --- /dev/null +++ b/panelapplet/AssemblyInfo.cs.in @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly:AssemblyVersion("@API_VERSION@")] +[assembly:AssemblyDelaySign(false)] +[assembly:AssemblyKeyFile("gtk-sharp.snk")] diff --git a/panelapplet/BonoboUIVerb.cs b/panelapplet/BonoboUIVerb.cs new file mode 100644 index 000000000..b1515a70e --- /dev/null +++ b/panelapplet/BonoboUIVerb.cs @@ -0,0 +1,25 @@ +using System; +using System.Runtime.InteropServices; + +namespace PanelApplet +{ + + public delegate void ContextMenuItemCallback (); + + [StructLayout (LayoutKind.Sequential)] + public struct BonoboUIVerb + { + string verb; + ContextMenuItemCallback callback; + IntPtr user_data; + IntPtr dummy; + + public BonoboUIVerb (string name, ContextMenuItemCallback cb) + { + verb = name; + callback = cb; + user_data = IntPtr.Zero; + dummy = IntPtr.Zero; + } + } +} diff --git a/panelapplet/Makefile.am b/panelapplet/Makefile.am new file mode 100644 index 000000000..d94d1cee0 --- /dev/null +++ b/panelapplet/Makefile.am @@ -0,0 +1,72 @@ +SUBDIRS = glue + +if ENABLE_PANEL +TARGET = $(ASSEMBLY) $(ASSEMBLY).config +APIS = $(API) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = panelapplet-sharp-2.0.pc +else +TARGET = +APIS = +endif +API = panelapplet-api.xml +RAW_API = panelapplet-api.raw +INCLUDE_API = ../pango/pango-api.xml ../atk/atk-api.xml ../gdk/gdk-api.xml $(top_srcdir)/gdk/gdk-symbols.xml ../gtk/gtk-api.xml $(top_srcdir)/gtk/gtk-symbols.xml +METADATA = PanelApplet.metadata +ASSEMBLY_NAME = panelapplet-sharp +references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gtk/gtk-sharp.dll + +ASSEMBLY = $(ASSEMBLY_NAME).dll +gapidir = $(datadir)/gapi-2.0 +noinst_DATA = $(TARGET) +gapi_DATA = $(APIS) +CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk + +DISTCLEANFILES = panelapplet-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs + +sources = AppletFactory.cs PanelApplet.cs BonoboUIVerb.cs + +build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs + +customs = PanelApplet.custom + +build_customs = $(addprefix $(srcdir)/, $(customs)) + +EXTRA_DIST = \ + $(RAW_API) \ + $(ASSEMBLY).config.in \ + AssemblyInfo.cs.in \ + $(METADATA) \ + $(customs) \ + $(sources) \ + panelapplet-sharp-2.0.pc.in + +$(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) + cp $(srcdir)/$(RAW_API) $(API) + chmod u+w $(API) + $(RUNTIME) ../parser/gapi-fixup.exe --api=$(API) --metadata=$(srcdir)/$(METADATA) + +generated-stamp: $(API) ../generator/gapi_codegen.exe $(build_customs) + rm -f generated/* && \ + $(RUNTIME) ../generator/gapi_codegen.exe --generate $(API) \ + --include $(INCLUDE_API) --outdir=generated --customdir=$(srcdir) --assembly-name=$(ASSEMBLY_NAME) \ + && touch generated-stamp + +gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk + cp $(top_srcdir)/gtk-sharp.snk . + +$(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.snk + $(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) $(GENERATED_SOURCES) + +install-data-local: + @if test -n '$(TARGET)'; then \ + echo "$(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS)"; \ + $(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS) || exit 1; \ + fi + +uninstall-local: + @if test -n '$(TARGET)'; then \ + echo "$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \ + $(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; \ + fi + diff --git a/panelapplet/PanelApplet.cs b/panelapplet/PanelApplet.cs new file mode 100644 index 000000000..711feef7a --- /dev/null +++ b/panelapplet/PanelApplet.cs @@ -0,0 +1,8 @@ +namespace PanelApplet { + public class PanelAppletManager { + public static void Init() + { + GtkSharp.PanelappletSharp.ObjectManager.Initialize(); + } + } +} diff --git a/panelapplet/PanelApplet.custom b/panelapplet/PanelApplet.custom new file mode 100644 index 000000000..5016e9434 --- /dev/null +++ b/panelapplet/PanelApplet.custom @@ -0,0 +1,20 @@ +[DllImport ("panel-applet-2")] +static extern void panel_applet_setup_menu (IntPtr handle, string xml, BonoboUIVerb[] items, IntPtr user_data); + +public void SetupMenu (string xml, BonoboUIVerb[] items) +{ + BonoboUIVerb[] nulled_items = new BonoboUIVerb[items.Length + 1]; + Array.Copy (items, nulled_items, items.Length); + nulled_items[items.Length] = new BonoboUIVerb (null, null); + panel_applet_setup_menu (Handle, xml, nulled_items, IntPtr.Zero); +} + +public abstract void Creation (); + +public abstract string IID { + get; +} + +public abstract string FactoryIID { + get; +} diff --git a/panelapplet/PanelApplet.metadata b/panelapplet/PanelApplet.metadata new file mode 100644 index 000000000..dd5c2c996 --- /dev/null +++ b/panelapplet/PanelApplet.metadata @@ -0,0 +1,7 @@ + + + 1 + 1 + 1 + 1 + diff --git a/panelapplet/glue/.cvsignore b/panelapplet/glue/.cvsignore new file mode 100644 index 000000000..4e348378a --- /dev/null +++ b/panelapplet/glue/.cvsignore @@ -0,0 +1,8 @@ +generated.c +Makefile +Makefile.in +*.la +*.lo +*.o +.deps +.libs diff --git a/panelapplet/glue/Makefile.am b/panelapplet/glue/Makefile.am new file mode 100644 index 000000000..e5f4645f8 --- /dev/null +++ b/panelapplet/glue/Makefile.am @@ -0,0 +1,18 @@ +lib_LTLIBRARIES = $(TARGET) + +if ENABLE_PANEL +TARGET = libpanelappletsharpglue-2.0.la +else +TARGET = +endif + +libpanelappletsharpglue_2_0_la_SOURCES = \ + panelapplet.c + +libpanelappletsharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined + +libpanelappletsharpglue_2_0_la_LIBADD = $(LIBPANEL_LIBS) + +INCLUDES = $(LIBPANEL_CFLAGS) -I$(top_srcdir) + +CLEANFILES = lib*.a diff --git a/panelapplet/glue/panelapplet.c b/panelapplet/glue/panelapplet.c new file mode 100644 index 000000000..b802c5e0b --- /dev/null +++ b/panelapplet/glue/panelapplet.c @@ -0,0 +1,29 @@ +#include + +typedef struct _ContextMenuItem +{ + const gchar *verb; + gpointer callback; +} ContextMenuItem; + +void panelapplet_setup_menu (PanelApplet *applet, const gchar *xml, ContextMenuItem *menuitems, gint cnt); + +void +panelapplet_setup_menu (PanelApplet *applet, const gchar *xml, ContextMenuItem *menuitems, gint cnt) +{ + int i; + BonoboUIVerb *menu_verbs = NULL; + + menu_verbs = g_new0 (BonoboUIVerb, cnt + 1); + + for (i = 0; i < cnt; i++) { + menu_verbs[i].cname = menuitems[i].verb; + menu_verbs[i].cb = menuitems[i].callback; + menu_verbs[i].user_data = NULL; + } + menu_verbs[cnt].cname = NULL; + menu_verbs[cnt].cb = NULL; + menu_verbs[cnt].user_data = NULL; + panel_applet_setup_menu (applet, xml, menu_verbs, NULL); + g_free (menu_verbs); +} diff --git a/panelapplet/panelapplet-api.raw b/panelapplet/panelapplet-api.raw new file mode 100644 index 000000000..632e5f21f --- /dev/null +++ b/panelapplet/panelapplet-api.raw @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/panelapplet/panelapplet-sharp-2.0.pc.in b/panelapplet/panelapplet-sharp-2.0.pc.in new file mode 100644 index 000000000..cd0805893 --- /dev/null +++ b/panelapplet/panelapplet-sharp-2.0.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib + + +Name: PanelApplet# +Description: PanelApplet# - libpanelapplet .NET Binding +Requires: gnome-sharp-2.0 +Version: @VERSION@ +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/panelapplet-sharp.dll diff --git a/panelapplet/panelapplet-sharp.dll.config.in b/panelapplet/panelapplet-sharp.dll.config.in new file mode 100644 index 000000000..f8ad2beb4 --- /dev/null +++ b/panelapplet/panelapplet-sharp.dll.config.in @@ -0,0 +1,5 @@ + + + + + diff --git a/pango/LayoutLine.custom b/pango/LayoutLine.custom index 5bd816122..0167014f3 100644 --- a/pango/LayoutLine.custom +++ b/pango/LayoutLine.custom @@ -21,7 +21,7 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. -[DllImport("pangosharpglue")] +[DllImport("pangosharpglue-2.0")] static extern IntPtr pangosharp_pango_layout_line_get_layout (IntPtr line); public Layout Layout { @@ -36,7 +36,7 @@ public Layout Layout { } } -[DllImport("pangosharpglue")] +[DllImport("pangosharpglue-2.0")] static extern int pangosharp_pango_layout_line_get_start_index (IntPtr line); public int StartIndex { @@ -45,7 +45,7 @@ public int StartIndex { } } -[DllImport("pangosharpglue")] +[DllImport("pangosharpglue-2.0")] static extern int pangosharp_pango_layout_line_get_length (IntPtr line); public int Length { diff --git a/pango/Makefile.am b/pango/Makefile.am index 4205c0c48..ba77b76e2 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -8,7 +8,7 @@ references = /r:../glib/glib-sharp.dll TARGET = $(ASSEMBLY) ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(ASSEMBLY) $(ASSEMBLY).config gapi_DATA = $(API) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk diff --git a/pango/glue/Makefile.am b/pango/glue/Makefile.am index 71397114d..c096523c4 100644 --- a/pango/glue/Makefile.am +++ b/pango/glue/Makefile.am @@ -1,19 +1,19 @@ -lib_LTLIBRARIES = libpangosharpglue.la +lib_LTLIBRARIES = libpangosharpglue-2.0.la -libpangosharpglue_la_SOURCES = \ +libpangosharpglue_2_0_la_SOURCES = \ layoutline.c # Adding a new glue file? # Please remember to update makefile.win32 -libpangosharpglue_la_LDFLAGS = -module -avoid-version -no-undefined +libpangosharpglue_2_0_la_LDFLAGS = -module -avoid-version -no-undefined -libpangosharpglue_la_LIBADD = $(PANGO_LIBS) +libpangosharpglue_2_0_la_LIBADD = $(PANGO_LIBS) INCLUDES = $(PANGO_CFLAGS) -I$(top_srcdir) -libpangosharpglue.dll: $(libpangosharpglue_la_OBJECTS) libpangosharpglue.rc libpangosharpglue.def - ./build-dll libpangosharpglue $(VERSION) +libpangosharpglue.dll: $(libpangosharpglue_2_0_la_OBJECTS) libpangosharpglue.rc libpangosharpglue.def + ./build-dll libpangosharpglue-2.0 $(VERSION) CLEANFILES = lib*.a lib*.dll diff --git a/pango/glue/makefile.win32 b/pango/glue/makefile.win32 index 6455d6dc8..559d8a1ac 100644 --- a/pango/glue/makefile.win32 +++ b/pango/glue/makefile.win32 @@ -7,16 +7,16 @@ GLUE_OBJS = \ layoutline.o \ win32dll.o -all: pangosharpglue.dll +all: pangosharpglue-2.0.dll %.o: %.c $(CC) -c $(CFLAGS) $(PANGO_CFLAGS) -o $@ $^ -gtksharpglue.dll: $(GLUE_OBJS) - $(DLLWRAP) --output-lib=libpangosharpglue.a --dllname=pangosharpglue.dll --driver-name=gcc --output-def=pangosharpglue.def $(GLUE_OBJS) $(PANGO_LIBS) +gtksharpglue-2.0.dll: $(GLUE_OBJS) + $(DLLWRAP) --output-lib=libpangosharpglue-2.0.a --dllname=pangosharpglue-2.0.dll --driver-name=gcc --output-def=pangosharpglue-2.0.def $(GLUE_OBJS) $(PANGO_LIBS) clean: - rm -f pangosharpglue.dll *.o libpangosharpglue.a + rm -f pangosharpglue-2.0.dll *.o libpangosharpglue-2.0.a diff --git a/pango/pango-api.raw b/pango/pango-api.raw index e61771744..ce5069c8b 100644 --- a/pango/pango-api.raw +++ b/pango/pango-api.raw @@ -29,6 +29,7 @@ + @@ -41,6 +42,9 @@ + + + @@ -50,6 +54,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -74,6 +135,7 @@ + @@ -106,6 +168,14 @@ + + + + + + + + @@ -165,6 +235,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -208,6 +323,13 @@ + + + + + + + @@ -231,6 +353,13 @@ + + + + + + + @@ -239,6 +368,9 @@ + + + @@ -274,11 +406,11 @@ - + - + @@ -317,6 +449,9 @@ + + + @@ -440,6 +575,12 @@ + + + + + + @@ -1018,34 +1159,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1079,6 +1192,12 @@ + + + + + + @@ -1164,6 +1283,8 @@ + + @@ -1225,6 +1346,7 @@ + @@ -1232,6 +1354,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1320,6 +1468,12 @@ + + + + + + @@ -1396,6 +1550,13 @@ + + + + + + + @@ -1423,6 +1584,18 @@ + + + + + + + + + + + + @@ -1501,6 +1674,18 @@ + + + + + + + + + + + + @@ -1519,6 +1704,12 @@ + + + + + + diff --git a/pango/pango-sharp.dll.config.in b/pango/pango-sharp.dll.config.in index 12368fdbc..c22bab71c 100644 --- a/pango/pango-sharp.dll.config.in +++ b/pango/pango-sharp.dll.config.in @@ -1,4 +1,5 @@ + diff --git a/parser/.cvsignore b/parser/.cvsignore index b190dad3f..824a6b07a 100755 --- a/parser/.cvsignore +++ b/parser/.cvsignore @@ -1,7 +1,8 @@ Makefile Makefile.in gapi_format_xml -gapi-fixup +gapi2-fixup +gapi2-parser *.pc .* diff --git a/parser/Makefile.am b/parser/Makefile.am index bc6405f34..613f331f7 100644 --- a/parser/Makefile.am +++ b/parser/Makefile.am @@ -1,10 +1,11 @@ -assemblydir = $(bindir) +assemblydir = $(libdir)/gtk-sharp-2.0 pkgconfigdir = $(libdir)/pkgconfig assembly_DATA = gapi-fixup.exe -pkgconfig_DATA = gapi.pc -bin_SCRIPTS = gapi.pl gapi_pp.pl gapi2xml.pl gapi-fixup gapi-parser +pkgconfig_DATA = gapi-2.0.pc +bin_SCRIPTS = gapi2-fixup gapi2-parser +assembly_SCRIPTS = gapi_parser.pl gapi_pp.pl gapi2xml.pl CLEANFILES = gapi-fixup.exe -DISTCLEANFILES = gapi-fixup gapi.pc +DISTCLEANFILES = gapi2-fixup gapi2-parser gapi-2.0.pc sources = \ gapi-fixup.cs @@ -14,18 +15,18 @@ build_sources = $(addprefix $(srcdir)/, $(sources)) EXTRA_DIST = \ makefile.win32 \ $(sources) \ - gapi-parser \ - gapi.pl \ + gapi2-parser.in \ + gapi_parser.pl \ gapi_pp.pl \ gapi2xml.pl \ - gapi.pc.in + gapi-2.0.pc.in gapi-fixup.exe: $(build_sources) $(CSC) /out:gapi-fixup.exe $(build_sources) INCLUDES = $(GLIB_CFLAGS) $(XML_CFLAGS) -bin_PROGRAMS = gapi_format_xml +assembly_PROGRAMS = gapi_format_xml gapi_format_xml_SOURCES = formatXml.c diff --git a/parser/gapi.pc.in b/parser/gapi-2.0.pc.in similarity index 100% rename from parser/gapi.pc.in rename to parser/gapi-2.0.pc.in diff --git a/parser/gapi-fixup.in b/parser/gapi-fixup.in deleted file mode 100755 index f1358dafe..000000000 --- a/parser/gapi-fixup.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -@RUNTIME@ @prefix@/bin/gapi-fixup.exe "$@" diff --git a/parser/gapi.pl b/parser/gapi.pl deleted file mode 100755 index 6453d1328..000000000 --- a/parser/gapi.pl +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/perl -w -# -# gapi.pl - frontend script for old style non-xml sources files. -# -# Author: Mike Kestner -# -# Copyright (c) 2001-2003 Mike Kestner -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of version 2 of the GNU General Public -# License as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -if ($ARGV[0] && $ARGV[1]) { - open INFILE, $ARGV[0]; - $outdir = $ARGV[1]; -} else { - print "Usage: gapi.pl \n"; - exit 0; -} - -@srcs = (); -%files = (); - -while () -{ - chomp; - my @entry = split /\s+/; - push @srcs, \@entry; - - $ns = $entry[1]; - if (not $files{$ns}) { - $files{$ns} = lc ($ns) . "-api.xml"; - } -} - -foreach $ns (keys (%files)) { - unlink $files{$ns}; -} - -foreach $entry (@srcs) { - ($dir, $ns, $lib) = @$entry; - print "hi $ns\n"; - $file = $files{$ns}; - system ("gapi_pp.pl $dir | gapi2xml.pl $ns $file $lib"); -} - -foreach $ns (keys (%files)) { - $file = $files{$ns}; - system ("gapi_format_xml $file $outdir/$file"); - unlink $file; -} - diff --git a/parser/gapi2-fixup.in b/parser/gapi2-fixup.in new file mode 100755 index 000000000..906ddf611 --- /dev/null +++ b/parser/gapi2-fixup.in @@ -0,0 +1,2 @@ +#!/bin/sh +@RUNTIME@ @prefix@/lib/gtk-sharp-2.0/gapi-fixup.exe "$@" diff --git a/parser/gapi2-parser.in b/parser/gapi2-parser.in new file mode 100755 index 000000000..842bf028c --- /dev/null +++ b/parser/gapi2-parser.in @@ -0,0 +1,3 @@ +#!/bin/sh +export PATH=@prefix@/lib/gtk-sharp-2.0:$PATH +@prefix@/lib/gtk-sharp-2.0/gapi_parser.pl "$@" diff --git a/parser/gapi2xml.pl b/parser/gapi2xml.pl index 3c98193c7..8959080ca 100755 --- a/parser/gapi2xml.pl +++ b/parser/gapi2xml.pl @@ -84,18 +84,18 @@ while ($line = ) { $types{$3} = $1 . $2; } elsif ($line =~ /typedef\s+enum\s+(\w+)\s+(\w+);/) { $etypes{$1} = $2; - } elsif ($line =~ /^(typedef\s+)?\benum\b/) { + } elsif ($line =~ /^((deprecated)?typedef\s+)?\benum\b/) { $edef = $line; while ($line = ) { $edef .= $line; - last if ($line =~ /^}\s*(\w+)?;/); + last if ($line =~ /^(deprecated)?}\s*(\w+)?;/); } $edef =~ s/\n\s*//g; $edef =~ s|/\*.*?\*/||g; if ($edef =~ /typedef.*}\s*(\w+);/) { $ename = $1; - } elsif ($edef =~ /^enum\s+(\w+)\s*{/) { - $ename = $1; + } elsif ($edef =~ /^(deprecated)?enum\s+(\w+)\s*{/) { + $ename = $2; } else { print "Unexpected enum format\n$edef"; next; @@ -111,13 +111,13 @@ while ($line = ) { $fdef .= $line; $fdef =~ s/\n\s+//g; $fpdefs{$fname} = $fdef; - } elsif ($line =~ /^(private)?struct\s+(\w+)/) { + } elsif ($line =~ /^(private|deprecated)?struct\s+(\w+)/) { next if ($line =~ /;/); $sname = $2; $sdef = $line; while ($line = ) { $sdef .= $line; - last if ($line =~ /^}/); + last if ($line =~ /^(deprecated)?}/); } $sdef =~ s!/\*.*?(\*/|\n)!!g; $sdef =~ s/\n\s*//g; @@ -149,8 +149,8 @@ while ($line = ) { last if ($line =~ /^}/); } $typefuncs{lc($class)} = $pedef; - } elsif ($line =~ /^(const|G_CONST_RETURN)?\s*\w+\s*\**\s*(\w+)\s*\(/) { - $fname = $2; + } elsif ($line =~ /^(deprecated)?(const|G_CONST_RETURN)?\s*\w+\s*\**\s*(\w+)\s*\(/) { + $fname = $3; $fdef = ""; while ($line !~ /;/) { $fdef .= $line; @@ -186,9 +186,11 @@ while ($line = ) { $boxdefs{$1} = $line; } elsif ($line =~ /^BUILTIN\s*\{\s*\"(\w+)\".*GTK_TYPE_(ENUM|FLAGS)/) { # ignoring these for now. - } elsif ($line =~ /^\#define/) { + } elsif ($line =~ /^(deprecated)?\#define/) { my $test_ns = uc ($ns); - if ($line =~ /\#define\s+(\w+)\s+\"(.*)\"/) { + if ($line =~ /^deprecated\#define\s+(\w+)\s+\"(.*)\"/) { + $defines{"deprecated$1"} = $2; + } elsif ($line =~ /\#define\s+(\w+)\s+\"(.*)\"/) { $defines{$1} = $2; } } else { @@ -207,6 +209,10 @@ foreach $cname (sort(keys(%edefs))) { $cname = $etypes{$cname} if (exists($etypes{$cname})); $enums{lc($cname)} = $cname; $enum_elem = addNameElem($ns_elem, 'enum', $cname, $ns); + if ($def =~ /^deprecated/) { + $enum_elem->setAttribute("deprecated", "1"); + $def =~ s/deprecated//g; + } if ($def =~ /=\s*1\s*<<\s*\d+/) { $enum_elem->setAttribute('type', "flags"); } else { @@ -312,6 +318,7 @@ foreach $type (sort(keys(%objects))) { $instdef = $classdef = ""; $instdef = $sdefs{$1} if ($insttype =~ /struct\s+(\w+)/); $classdef = $sdefs{$1} if ($classtype =~ /struct\s+(\w+)/); + $classdef =~ s/deprecated//g; $instdef =~ s/\s+(\*+)/\1 /g; warn "Strange Class $inst\n" if (!$instdef && $debug); @@ -320,6 +327,12 @@ foreach $type (sort(keys(%objects))) { $elem_table{lc($inst)} = $obj_el; + # Check if the object is deprecated + if ($instdef =~ /^deprecatedstruct/) { + $obj_el->setAttribute("deprecated", "1"); + $instdef =~ s/deprecated//g; + } + # Extract parent and fields from the struct if ($instdef =~ /^struct/) { $instdef =~ /\{(.*)\}/; @@ -388,6 +401,11 @@ foreach $key (sort (keys (%types))) { $struct_el = addNameElem($ns_elem, 'struct', $key, $ns); } + if ($def =~ /^deprecated/) { + $struct_el->setAttribute("deprecated", "1"); + $def =~ s/deprecated//g; + } + $elem_table{lc($key)} = $struct_el; $def =~ s/\s+/ /g; @@ -461,7 +479,7 @@ sub addFieldElems $field =~ s/struct /struct\-/g; $field =~ s/.*\*\///g; next if ($field !~ /\S/); - + if ($field =~ /(\S+\s+\*?)\(\*\s*(.+)\)\s*\((.*)\)/) { $elem = addNameElem($parent, 'callback', $2); addReturnElem($elem, $1); @@ -518,12 +536,20 @@ sub addFuncElems next if (!$obj_el); $mdef = delete $fdefs{$mname}; - + if ($mname =~ /$prefix(new)/) { - $el = addNameElem($obj_el, 'constructor', $mname); + $el = addNameElem($obj_el, 'constructor', $mname); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $drop_1st = 0; } else { $el = addNameElem($obj_el, 'method', $mname, $prefix, $prepend); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $mdef =~ /(.*?)\w+\s*\(/; addReturnElem($el, $1); $mdef =~ /\(\s*(const)?\s*(\w+)/; @@ -619,7 +645,7 @@ sub addStaticFuncElems } if ($cnt == 1) { $mdef = delete $fdefs{$mname}; - + if (!$global_el) { $global_el = $doc->createElement('class'); $global_el->setAttribute('name', "Global"); @@ -627,6 +653,10 @@ sub addStaticFuncElems $ns_elem->appendChild($global_el); } $el = addNameElem($global_el, 'method', $mname, $ns_prefix); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $mdef =~ /(.*?)\w+\s*\(/; addReturnElem($el, $1); $el->setAttribute("shared", "true"); @@ -640,8 +670,12 @@ sub addStaticFuncElems for ($j = 0; $j < $cnt; $j++) { $mdef = delete $fdefs{$mnames[$i+$j]}; - + $el = addNameElem($class_el, 'method', $mnames[$i+$j], $prefix); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $mdef =~ /(.*?)\w+\s*\(/; addReturnElem($el, $1); $el->setAttribute("shared", "true"); diff --git a/parser/gapi-parser b/parser/gapi_parser.pl similarity index 100% rename from parser/gapi-parser rename to parser/gapi_parser.pl diff --git a/parser/gapi_pp.pl b/parser/gapi_pp.pl index 776e67de3..5c412ffc9 100755 --- a/parser/gapi_pp.pl +++ b/parser/gapi_pp.pl @@ -25,8 +25,8 @@ # Boston, MA 02111-1307, USA. $private_regex = "^#if.*(ENABLE_BACKEND|ENABLE_ENGINE)"; -$eatit_regex = "^#if.*(__cplusplus|DEBUG|DISABLE_(DEPRECATED|COMPAT)|ENABLE_BROKEN|COMPILATION)"; -$ignoreit_regex = '^\s+\*|#ident|#\s*include|#\s*else|#\s*endif|#\s*undef|G_(BEGIN|END)_DECLS|extern|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN'; +$eatit_regex = "^#if.*(__cplusplus|DEBUG|DISABLE_COMPAT|ENABLE_BROKEN)"; +$ignoreit_regex = '^\s+\*|#ident|#\s*include|#\s*else|#\s*undef|G_(BEGIN|END)_DECLS|extern|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN'; foreach $arg (@ARGV) { if (-d $arg && -e $arg) { @@ -50,6 +50,8 @@ foreach $fname (@hdrs) { open(INFILE, $fname) || die "Could open $fname\n"; $braces = 0; + $deprecated = -1; + $ifdeflevel = 0; $prepend = ""; while ($line = ) { $braces++ if ($line =~ /{/ and $line !~ /}/); @@ -58,7 +60,7 @@ foreach $fname (@hdrs) { next if ($line =~ /$ignoreit_regex/); $line =~ s/\/\*.*?\*\///g; - + next if ($line !~ /\S/); $line = $prepend . $line; @@ -77,8 +79,6 @@ foreach $fname (@hdrs) { } } elsif ($line =~ /^\s*\/\*/) { while ($line !~ /\*\//) {$line = ;} - } elsif ($line =~ /^#ifndef\s+\w+_H_*\b/) { - while ($line !~ /#define/) {$line = ;} } elsif ($line =~ /$private_regex/) { $nested = 0; while ($line = ) { @@ -107,7 +107,19 @@ foreach $fname (@hdrs) { } } } elsif ($line =~ /^#\s*ifn?\s*\!?def/) { - #warn "Ignored #if:\n$line"; + $ifdeflevel++; + #print "#ifn?def ($ifdeflevel): $line\n"; + if ($line =~ /#ifndef.*DISABLE_DEPRECATED/) { + $deprecated = $ifdeflevel; + } elsif ($line =~ /#if !defined.*DISABLE_DEPRECATED/) { + $deprecated = $ifdeflevel; + } + } elsif ($line =~ /^#\s*endif/) { + #print "#endif ($ifdeflevel): $line\n"; + if ($deprecated == $ifdeflevel) { + $deprecated = -1; + } + $ifdeflevel--; } elsif ($line =~ /typedef struct\s*\{/) { my $first_line = $line; my @lines = (); @@ -142,7 +154,11 @@ foreach $fname (@hdrs) { } } else { if ($braces or $line =~ /;/) { - print $line; + if ($deprecated == -1) { + print $line; + } else { + print "deprecated$line"; + } } else { $prepend = $line; $prepend =~ s/\n/ /g; diff --git a/rsvg/.cvsignore b/rsvg/.cvsignore index 3a84c4246..f6c52116e 100755 --- a/rsvg/.cvsignore +++ b/rsvg/.cvsignore @@ -1,4 +1,4 @@ -rsvg-sharp.pc +*.pc AssemblyInfo.cs *.dll *.dll.config diff --git a/rsvg/Makefile.am b/rsvg/Makefile.am index 4f232f0e3..bd6593d7d 100644 --- a/rsvg/Makefile.am +++ b/rsvg/Makefile.am @@ -2,7 +2,7 @@ if ENABLE_RSVG TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = rsvg-sharp.pc +pkgconfig_DATA = rsvg-sharp-2.0.pc else TARGET = APIS = @@ -16,12 +16,12 @@ ASSEMBLY_NAME = rsvg-sharp references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gtk/gtk-sharp.dll /r:../art/art-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) gapi_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = rsvg-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = rsvg-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = \ Tool.cs @@ -39,7 +39,7 @@ EXTRA_DIST = \ $(METADATA) \ $(customs) \ $(sources) \ - rsvg-sharp.pc.in + rsvg-sharp-2.0.pc.in $(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/rsvg/Rsvg.metadata b/rsvg/Rsvg.metadata index 2fc4806b0..d4bd572e6 100644 --- a/rsvg/Rsvg.metadata +++ b/rsvg/Rsvg.metadata @@ -1,5 +1,5 @@ - + 1 1 diff --git a/rsvg/rsvg-api.raw b/rsvg/rsvg-api.raw index d34eff27d..99176d0b3 100644 --- a/rsvg/rsvg-api.raw +++ b/rsvg/rsvg-api.raw @@ -11,10 +11,16 @@ + + + + + + @@ -115,11 +121,24 @@ + + + + + + + + + + + + + @@ -155,7 +174,11 @@ - + + + + + @@ -189,6 +212,7 @@ + @@ -197,11 +221,14 @@ + + + @@ -214,6 +241,12 @@ + + + + + + @@ -315,6 +348,13 @@ + + + + + + + @@ -324,6 +364,14 @@ + + + + + + + + @@ -383,6 +431,7 @@ + @@ -424,6 +473,15 @@ + + + + + + + + + @@ -617,6 +675,13 @@ + + + + + + + diff --git a/rsvg/rsvg-sharp.pc.in b/rsvg/rsvg-sharp-2.0.pc.in similarity index 63% rename from rsvg/rsvg-sharp.pc.in rename to rsvg/rsvg-sharp-2.0.pc.in index c5043bed7..8e6ac4aba 100644 --- a/rsvg/rsvg-sharp.pc.in +++ b/rsvg/rsvg-sharp-2.0.pc.in @@ -6,5 +6,4 @@ libdir=${exec_prefix}/lib Name: Rsvg# Description: Rsvg# - librsvg .NET Binding Version: @VERSION@ -Requires: gtk-sharp art-sharp -Libs: -r:${libdir}/mono/@PACKAGE@/rsvg-sharp.dll +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/rsvg-sharp.dll diff --git a/sample/Actions.cs b/sample/Actions.cs new file mode 100644 index 000000000..d39844026 --- /dev/null +++ b/sample/Actions.cs @@ -0,0 +1,104 @@ +// Actions.cs - Gtk.Action class Test implementation +// +// Author: Jeroen Zwartepoorte " + + " " + + " " + + " " + + "" + + "" + + " " + + ""; + + public static int Main (string[] args) + { + Application.Init (); + Window win = new Window ("Action Demo"); + win.DefaultSize = new Gdk.Size (200, 150); + win.DeleteEvent += new DeleteEventHandler (OnWindowDelete); + + box = new VBox (false, 0); + win.Add (box); + + ActionGroup group = new ActionGroup ("TestGroup"); + Action action = new Action ("quit", null, "Quit the program", Stock.Quit); + action.Activated += new EventHandler (OnQuit); + group.Add (action, "Q"); + + action = new Action ("Menu1Action", "_File", null, null); + group.Add (action); + + UIManager uim = new UIManager (); + uim.AddWidget += new AddWidgetHandler (OnWidgetAdd); + uim.ConnectProxy += new ConnectProxyHandler (OnProxyConnect); + uim.InsertActionGroup (group, 0); + uim.AddUiFromString (ui_info); + + statusbar = new Statusbar (); + box.PackEnd (statusbar, false, true, 0); + + Button button = new Button ("Blah"); + box.PackEnd (button, true, true, 0); + + win.ShowAll (); + Application.Run (); + return 0; + } + + static void OnWindowDelete (object obj, DeleteEventArgs args) + { + Application.Quit (); + args.RetVal = true; + } + + static void OnWidgetAdd (object obj, AddWidgetArgs args) + { + Console.WriteLine ("OnWidgetAdd {0}", args.Widget.Name); + args.Widget.Show (); + box.PackStart (args.Widget, false, true, 0); + } + + static void OnSelect (object obj, EventArgs args) + { + Action action = ((GLib.Object)obj).Data["action"] as Action; + if (action.Tooltip != null) + statusbar.Push (0, action.Tooltip); + } + + static void OnDeselect (object obj, EventArgs args) + { + statusbar.Pop (0); + } + + static void OnProxyConnect (object obj, ConnectProxyArgs args) + { + Console.WriteLine ("ProxyConnect {0}, {1}", args.Action, args.Proxy.Name); + if (args.Proxy is MenuItem) { + ((GLib.Object)args.Proxy).Data ["action"] = args.Action; + ((Item)args.Proxy).Selected += new EventHandler (OnSelect); + ((Item)args.Proxy).Deselected += new EventHandler (OnDeselect); + } + } + + static void OnQuit (object obj, EventArgs args) + { + Console.WriteLine ("quit"); + Application.Quit (); + } + } +} diff --git a/sample/CustomNotebook.cs b/sample/CustomNotebook.cs new file mode 100644 index 000000000..dde92e34e --- /dev/null +++ b/sample/CustomNotebook.cs @@ -0,0 +1,643 @@ +using GLib; +using Gtk; +using System; +using System.Collections; + +class CustomNotebookTest { + static CustomNotebook cn; + static Notebook nb; + static int tabCount; + + public static int Main (string[] args) + { + Application.Init (); + Window win = new Window ("Custom Notebook Test"); + win.DeleteEvent += new DeleteEventHandler (OnQuit); + + VBox box = new VBox (false, 5); + Button addButton = new Button ("Add Tab"); + //addButton.Clicked += OnAddTab; + Button rmButton = new Button ("Remove Tab"); + rmButton.Clicked += OnRemoveTab; + box.PackStart (addButton, false, false, 0); + box.PackStart (rmButton, false, false, 0); + HPaned paned = new HPaned (); + + cn = new CustomNotebook (); + cn.BorderWidth = 5; + cn.Scrollable = false; + Gdk.Pixbuf icon = cn.RenderIcon (Stock.Execute, IconSize.Menu, ""); + //for (tabCount = 0; tabCount < 3; tabCount++) + cn.AppendPage (new Label ("Custom Notebook"), Stock.Execute, "extended tab" + tabCount); + cn.AppendPage (new Label ("Custom Notebook"), Stock.Execute, "tab" + (tabCount + 1)); + cn.AppendPage (new Label ("Custom Notebook"), Stock.Execute, "extended tab" + (tabCount + 2)); + paned.Pack1 (cn, true, false); + + nb = new Notebook (); + nb.BorderWidth = 5; + nb.Scrollable = false; + for (tabCount = 0; tabCount < 3; tabCount++) + nb.AppendPage (new Label ("Regular Notebook"), new Label ("tab" + tabCount)); + paned.Pack2 (nb, true, false); + box.PackEnd (paned, true, true, 0); + + win.Add (box); + win.ShowAll (); + Application.Run (); + return 0; + } + + /*static void OnAddTab (object sender, EventArgs args) + { + cn.AppendPage (new Label ("Custom Notebook"), Stock.Execute, "tab" + tabCount + 1); + cn.ShowAll (); + nb.AppendPage (new Label ("Regular Notebook"), new Label ("tab" + tabCount + 1)); + nb.ShowAll (); + tabCount++; + }*/ + + static void OnRemoveTab (object sender, EventArgs args) + { + } + + static void OnQuit (object sender, DeleteEventArgs args) + { + Application.Quit (); + } +} + +class CustomNotebookPage { + private Gdk.Rectangle allocation; + private Widget child = null; + private Gdk.Pixbuf icon = null; + private bool ellipsize = false; + private string label = null; + private Pango.Layout layout = null; + private int layoutWidth = -1; + private int layoutHeight = -1; + private Requisition requisition; + private string stockid = null; + + public Gdk.Rectangle Allocation { + get { + return allocation; + } + set { + allocation = value; + } + } + + public Widget Child { + get { + return child; + } + set { + child = value; + } + } + + public bool Ellipsize { + get { + return ellipsize; + } + set { + ellipsize = value; + } + } + + public Gdk.Pixbuf Icon { + get { + if (icon == null && StockId != null) { + icon = child.RenderIcon (StockId, IconSize.Menu, ""); + } + + return icon; + } + set { + icon = value; + } + } + + public string Label { + get { + return label; + } + set { + label = value; + layout = null; + layoutWidth = -1; + layoutHeight = -1; + } + } + + public Pango.Layout Layout { + get { + if (layout == null && Label != null) { + layout = child.CreatePangoLayout (label); + layout.GetPixelSize (out layoutWidth, out layoutHeight); + } + + return layout; + } + } + + public int LayoutWidth { + get { + if (Layout != null) + return layoutWidth; + else + return -1; + } + } + + public int LayoutHeight { + get { + if (Layout != null) + return layoutHeight; + else + return -1; + } + } + + public Requisition Requisition { + get { + return requisition; + } + set { + requisition = value; + } + } + + public string StockId { + get { + return stockid; + } + set { + stockid = value; + icon = null; + } + } + + public CustomNotebookPage (Widget child, string label) + { + Child = child; + Label = label; + } + + public CustomNotebookPage (Widget child, Gdk.Pixbuf icon, string label) + { + Child = child; + Icon = icon; + Label = label; + } + + public CustomNotebookPage (Widget child, string stockid, string label) + { + Child = child; + Label = label; + StockId = stockid; + } +} + +class CustomNotebook : Container { + private readonly int tabCurvature = 1; + private readonly int tabOverlap = 2; + private ArrayList pages = new ArrayList (); + private bool closable; + private bool scrollable; + private PositionType tabPosition; + private int tabHBorder; + private int tabVBorder; + + public bool Closable { + get { + return closable; + } + set { + closable = value; + } + } + + private CustomNotebookPage CurrentPage { + get { + return (CustomNotebookPage)pages[0]; + } + } + + public bool Scrollable { + get { + return scrollable; + } + set { + scrollable = value; + } + } + + public Gtk.PositionType TabPosition { + get { + return tabPosition; + } + set { + switch (value) { + case PositionType.Left: + case PositionType.Right: + Console.WriteLine ("PositionType.Left or Right is not supported by this widget"); + break; + default: + tabPosition = value; + break; + } + } + } + + /*static CustomNotebook () + { + Container.OverrideForall (CustomNotebook.GType); + }*/ + + public CustomNotebook () : base () + { + closable = true; + scrollable = false; + tabPosition = PositionType.Top; + tabHBorder = 2; + tabVBorder = 2; + + Flags |= (int)WidgetFlags.NoWindow; + } + + public void AppendPage (Widget child, string label) + { + pages.Add (new CustomNotebookPage (child, label)); + child.Parent = this; + } + + public void AppendPage (Widget child, string stockid, string label) + { + pages.Add (new CustomNotebookPage (child, stockid, label)); + child.Parent = this; + } + + public void AppendPage (Widget child, Gdk.Pixbuf icon, string label) + { + pages.Add (new CustomNotebookPage (child, icon, label)); + child.Parent = this; + } + + private void EllipsizeLayout (Pango.Layout layout, int width) + { + if (width <= 0) { + layout.SetText (""); + return; + } + + int layoutWidth, layoutHeight; + layout.GetPixelSize (out layoutWidth, out layoutHeight); + if (layoutWidth <= width) + return; + + // Calculate ellipsis width. + Pango.Layout ell = layout.Copy (); + ell.SetText ("..."); + int ellWidth, ellHeight; + ell.GetPixelSize (out ellWidth, out ellHeight); + + if (width < ellWidth) { + // Not even ellipsis fits, so hide text. + layout.SetText (""); + return; + } + + // Shrink total available width by the width of the ellipsis. + width -= ellWidth; + string text = layout.Text; + Console.WriteLine ("layout text = {0}", text); + Console.WriteLine ("line count: {0}", layout.LineCount); + Pango.LayoutLine line = layout.Lines[0]; + //Console.WriteLine ("layout = {0}", line.layout.Text); + //Console.WriteLine ("line = {0}", line.Length); + int idx = 0, trailing = 0; + if (line.XToIndex (width * 1024, out idx, out trailing)) { + text = text.Substring (0, idx - 1); + text += "..."; + layout.SetText (text); + } + } + + protected override bool OnExposeEvent (Gdk.EventExpose args) + { + int x, y, width, height, gapX, gapWidth; + int bw = (int)BorderWidth; + + x = Allocation.X + bw; + y = Allocation.Y + bw; + width = Allocation.Width - 2 * bw; + height = Allocation.Height - 2 * bw; + + switch (TabPosition) { + case PositionType.Top: + y += CurrentPage.Allocation.Height; + height -= CurrentPage.Allocation.Height; + break; + case PositionType.Bottom: + height -= CurrentPage.Allocation.Height; + break; + case PositionType.Left: + case PositionType.Right: + break; + } + + gapX = gapWidth = 0; + switch (TabPosition) { + case PositionType.Top: + case PositionType.Bottom: + gapX = CurrentPage.Allocation.X - Allocation.X - bw; + gapWidth = CurrentPage.Allocation.Width; + break; + case PositionType.Left: + case PositionType.Right: + break; + } + + Style.PaintBoxGap (Style, GdkWindow, StateType.Normal, + ShadowType.Out, args.Area, this, + "notebook", x, y, width, height, + TabPosition, gapX, gapWidth); + + for (int i = pages.Count - 1; i >= 0; i--) { + CustomNotebookPage page = (CustomNotebookPage)pages[i]; + Gdk.Rectangle pageAlloc = page.Allocation; + + StateType state = page == CurrentPage ? StateType.Normal : StateType.Active; + Style.PaintExtension (Style, GdkWindow, state, + ShadowType.Out, args.Area, this, + "tab", pageAlloc.X, pageAlloc.Y, + pageAlloc.Width, pageAlloc.Height, + PositionType.Bottom); + + // FIXME: Only add YThickness when TabPosition = Top; + y = pageAlloc.Y + Style.YThickness + FocusLineWidth + tabVBorder; + height = pageAlloc.Height - Style.YThickness - 2 * (tabVBorder + FocusLineWidth); + if (page.Icon != null) { + x = pageAlloc.X + (pageAlloc.Width + 1 - + page.Icon.Width - + page.LayoutWidth) / 2; + int iconY = y + (height - page.Icon.Height) / 2; + + GdkWindow.DrawPixbuf (Style.BackgroundGC (State), + page.Icon, 0, 0, x, iconY, + page.Icon.Width, + page.Icon.Height, + Gdk.RgbDither.None, 0, 0); + x += page.Icon.Width + 1; + } else { + x = pageAlloc.X + (pageAlloc.Width - page.LayoutWidth) / 2; + } + + y += (height - page.LayoutHeight) / 2; + if (page.Ellipsize) { + width = pageAlloc.Width - (page.Icon.Width + 1); + Pango.Layout layout = page.Layout; + EllipsizeLayout (layout, width); + Console.WriteLine ("ellLayout = {0}", layout.Text); + Style.PaintLayout (Style, GdkWindow, State, + true, args.Area, this, null, + x, y, layout); + } else { + Style.PaintLayout (Style, GdkWindow, State, + true, args.Area, this, null, + x, y, page.Layout); + } + } + + return base.OnExposeEvent (args); + } + + protected override void ForAll (bool include_internals, CallbackInvoker invoker) + { + foreach (CustomNotebookPage page in pages) { + invoker.Invoke (page.Child); + } + } + + protected override void OnRealized () + { + Flags |= (int)WidgetFlags.Realized; + + GdkWindow = ParentWindow; + Style = Style.Attach (GdkWindow); + } + + protected override void OnSizeAllocated (Gdk.Rectangle allocation) + { + base.OnSizeAllocated (allocation); + + if (pages.Count == 0) + return; + + int bw = (int)BorderWidth; + + Gdk.Rectangle childAlloc; + childAlloc.X = allocation.X + bw + Style.XThickness; + childAlloc.Y = allocation.Y + bw + Style.YThickness; + childAlloc.Width = Math.Max (1, allocation.Width - 2 * bw - + 2 * Style.XThickness); + childAlloc.Height = Math.Max (1, allocation.Height - 2 * bw - + 2 * Style.YThickness); + + switch (TabPosition) { + case PositionType.Top: + childAlloc.Y += CurrentPage.Requisition.Height; + childAlloc.Height = Math.Max (1, childAlloc.Height - + CurrentPage.Requisition.Height); + break; + case PositionType.Bottom: + childAlloc.Height = Math.Max (1, childAlloc.Height - + CurrentPage.Requisition.Height); + break; + case PositionType.Left: + case PositionType.Right: + break; + } + + foreach (CustomNotebookPage page in pages) { + page.Child.SizeAllocate (childAlloc); + } + + // gtk_notebook_pages_allocate. + childAlloc.X = allocation.X + bw; + childAlloc.Y = allocation.Y + bw; + + switch (TabPosition) { + case PositionType.Top: + childAlloc.Height = CurrentPage.Requisition.Height; + break; + case PositionType.Bottom: + childAlloc.Y = (allocation.Y + allocation.Height - + CurrentPage.Requisition.Height - bw); + childAlloc.Height = CurrentPage.Requisition.Height; + break; + case PositionType.Left: + case PositionType.Right: + break; + } + + bool ellipsize = false; + int avgWidth = 0; + int tabX = childAlloc.X; + if (!scrollable) { + int tabWidth = 0; + foreach (CustomNotebookPage page in pages) { + tabWidth += page.Requisition.Width; + } + + Console.WriteLine ("total tabwidth: {0}", tabWidth); + Console.WriteLine ("allocated width: {0}", childAlloc.Width); + + if (tabWidth > childAlloc.Width) { + ellipsize = true; + avgWidth = childAlloc.Width / pages.Count; + tabWidth = childAlloc.Width; + Console.WriteLine ("average tabwidth: {0}", avgWidth); + + int count = pages.Count; + foreach (CustomNotebookPage page in pages) { + Gdk.Rectangle pageAlloc = page.Allocation; + if (page.Requisition.Width <= avgWidth) { + count--; + tabWidth -= page.Requisition.Width; + } + } + + Console.WriteLine ("number of pages exceeding that: {0}", count); + Console.WriteLine ("space per page available: {0}", tabWidth / count); + + // FIXME: check for TabPosition. + int maxWidth = tabWidth / count; + foreach (CustomNotebookPage page in pages) { + Gdk.Rectangle pageAlloc = page.Allocation; + pageAlloc.X = tabX; + pageAlloc.Y = childAlloc.Y; + + if (page.Requisition.Width > maxWidth) { + pageAlloc.Width = maxWidth + tabOverlap; + page.Ellipsize = true; + } else { + pageAlloc.Width = page.Requisition.Width + tabOverlap; + } + + pageAlloc.Height = childAlloc.Height; + tabX += pageAlloc.Width - tabOverlap; + + if (page != CurrentPage) { + pageAlloc.Y += Style.YThickness; + pageAlloc.Height -= Style.YThickness; + } + + page.Allocation = pageAlloc; + } + } + } else { + switch (TabPosition) { + case PositionType.Top: + case PositionType.Bottom: + foreach (CustomNotebookPage page in pages) { + Gdk.Rectangle pageAlloc = page.Allocation; + pageAlloc.X = tabX; + pageAlloc.Y = childAlloc.Y; + pageAlloc.Width = page.Requisition.Width + tabOverlap; + pageAlloc.Height = childAlloc.Height; + tabX += pageAlloc.Width - tabOverlap; + + if (page != CurrentPage) { + pageAlloc.Y += Style.YThickness; + pageAlloc.Height -= Style.YThickness; + } + + page.Allocation = pageAlloc; + } + break; + case PositionType.Left: + case PositionType.Right: + break; + } + } + } + + protected override void OnSizeRequested (ref Requisition requisition) + { + requisition.Width = requisition.Height = 0; + + foreach (CustomNotebookPage page in pages) { + if (!page.Child.Visible) + continue; + + Requisition childReq = page.Child.SizeRequest (); + requisition.Width = Math.Max (requisition.Width, childReq.Width); + requisition.Height = Math.Max (requisition.Height, childReq.Height); + } + + requisition.Width += 2 * Style.XThickness; + requisition.Height += 2 * Style.YThickness; + + int tabWidth = 0; + int tabHeight = 0; + int tabMax = 0; + int padding; + foreach (CustomNotebookPage page in pages) { + Requisition pageReq; + if (page.Icon != null) { + pageReq.Width = page.Icon.Width + page.LayoutWidth + + Style.XThickness * 2; + pageReq.Height = Math.Max (page.Icon.Height, page.LayoutHeight) + + Style.YThickness * 2; + } else { + pageReq.Width = page.LayoutWidth + Style.XThickness * 2; + pageReq.Height = page.LayoutHeight + Style.YThickness * 2; + } + + switch (TabPosition) { + case PositionType.Top: + case PositionType.Bottom: + pageReq.Height += (tabVBorder + FocusLineWidth) * 2; + tabHeight = Math.Max (tabHeight, pageReq.Height); + tabMax = Math.Max (tabMax, pageReq.Width); + break; + case PositionType.Left: + case PositionType.Right: + break; + } + + page.Requisition = pageReq; + } + + switch (TabPosition) { + case PositionType.Top: + case PositionType.Bottom: + padding = 2 * (tabCurvature + FocusLineWidth + + tabHBorder) - tabOverlap; + tabMax += padding; + + Requisition pageReq; + foreach (CustomNotebookPage page in pages) { + pageReq = page.Requisition; + pageReq.Width += padding; + tabWidth += pageReq.Width; + pageReq.Height = tabHeight; + page.Requisition = pageReq; + } + + /*if (!Scrollable) + requisition.Width = Math.Max (requisition.Width, + tabWidth + tabOverlap);*/ + requisition.Height += tabHeight; + break; + case PositionType.Left: + case PositionType.Right: + break; + } + + requisition.Width += (int)BorderWidth * 2; + requisition.Height += (int)BorderWidth * 2; + } +} diff --git a/sample/GtkDemo/DemoSizeGroup.cs b/sample/GtkDemo/DemoSizeGroup.cs index 191717352..9c3b3c549 100644 --- a/sample/GtkDemo/DemoSizeGroup.cs +++ b/sample/GtkDemo/DemoSizeGroup.cs @@ -150,5 +150,6 @@ namespace GtkDemo this.Destroy (); } } + } } diff --git a/sample/Makefile.am b/sample/Makefile.am index 53e912db4..8329a7ac2 100755 --- a/sample/Makefile.am +++ b/sample/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = gconf rsvg test GtkDemo pixmaps +SUBDIRS = gconf rsvg test GtkDemo pixmaps gnomevfs if ENABLE_GNOME GNOME_TARGETS=gnome-hello-world.exe canvas-example.exe fifteen.exe print.exe @@ -24,9 +24,9 @@ VTE_TARGETS= VTE_ASSEMBLY= endif -TARGETS = custom-cellrenderer.exe gtk-hello-world.exe button.exe calendar.exe subclass.exe menu.exe size.exe scribble.exe scribble-xinput.exe treeviewdemo.exe managedtreeviewdemo.exe testdnd.exe custom-widget.exe $(GNOME_TARGETS) $(GLADE_TARGETS) $(VTE_TARGETS) +TARGETS = custom-notebook.exe drawing-sample.exe custom-widget.exe custom-cellrenderer.exe gtk-hello-world.exe button.exe calendar.exe subclass.exe menu.exe size.exe scribble.exe scribble-xinput.exe treeviewdemo.exe managedtreeviewdemo.exe testdnd.exe actions.exe $(GNOME_TARGETS) $(GLADE_TARGETS) $(VTE_TARGETS) -assemblies=../glib/glib-sharp.dll ../pango/pango-sharp.dll ../atk/atk-sharp.dll ../gdk/gdk-sharp.dll ../gtk/gtk-sharp.dll $(GNOME_ASSEMBLY) $(GLADE_ASSEMBLY) $(VTE_ASSEMBLY) +assemblies=../glib/glib-sharp.dll ../pango/pango-sharp.dll ../atk/atk-sharp.dll ../gdk/gdk-sharp.dll ../gtk/gtk-sharp.dll ../gnomevfs/gnome-vfs-sharp.dll $(GNOME_ASSEMBLY) $(GLADE_ASSEMBLY) $(VTE_ASSEMBLY) references=$(addprefix /r:, $(assemblies)) noinst_SCRIPTS = $(TARGETS) @@ -98,6 +98,15 @@ drawing-sample.exe: $(srcdir)/DrawingSample.cs $(srcdir)/sysdraw.cs $(assemblies custom-widget.exe: $(srcdir)/CustomWidget.cs $(assemblies) $(CSC) /debug /out:custom-widget.exe $(references) $(srcdir)/CustomWidget.cs +actions.exe: $(srcdir)/Actions.cs + $(CSC) /debug /unsafe /out:actions.exe $(references) $(srcdir)/Actions.cs + +custom-notebook.exe: $(srcdir)/CustomNotebook.cs $(assemblies) + $(CSC) /debug /out:custom-notebook.exe $(references) $(srcdir)/CustomNotebook.cs + +testvfs.exe: $(srcdir)/TestVfs.cs + $(CSC) /debug /out:testvfs.exe $(references) $(srcdir)/TestVfs.cs + EXTRA_DIST = \ HelloWorld.cs \ GnomeHelloWorld.cs \ @@ -124,4 +133,7 @@ EXTRA_DIST = \ sysdraw.cs \ drawing-sample.exe.config \ cairo-sample.exe.config \ - CustomWidget.cs + CustomWidget.cs \ + Actions.cs \ + CustomNotebook.cs \ + TestVfs.cs diff --git a/sample/PrintSample.cs b/sample/PrintSample.cs index 10aa2eb6a..349f6e323 100644 --- a/sample/PrintSample.cs +++ b/sample/PrintSample.cs @@ -35,10 +35,10 @@ class PrintSample void MyPrint (PrintContext gpc) { - Print.Beginpage (gpc, "demo"); - Print.Moveto (gpc, 1, 700); - Print.Show (gpc, tv.Buffer.Text); - Print.Showpage (gpc); + gpc.BeginPage ("demo"); + gpc.MoveTo (1, 700); + gpc.Show (tv.Buffer.Text); + gpc.ShowPage (); } void OnPrintClicked (object o, EventArgs args) diff --git a/sample/TestDnd.cs b/sample/TestDnd.cs index 07bce5797..f571355ca 100644 --- a/sample/TestDnd.cs +++ b/sample/TestDnd.cs @@ -455,7 +455,7 @@ public class TestDnd { private static void HandlePopsiteLeave (object sender, DragLeaveArgs args) { if (popup_timer != 0) { - Gtk.Timeout.Remove (popup_timer); + GLib.Source.Remove (popup_timer); popup_timer = 0; } } diff --git a/sample/TestVfs.cs b/sample/TestVfs.cs new file mode 100644 index 000000000..4fb4bc44c --- /dev/null +++ b/sample/TestVfs.cs @@ -0,0 +1,114 @@ +// +// TestVfs.cs: Test gnome-vfs bindings. +// +// Author: +// Jeroen Zwartepoorte +// +// (C) Copyright Jeroen Zwartepoorte 2004 +// + +using System; +using System.Text; +using GLib; +using Gtk; +using Gnome.Vfs; + +public class TestVfs { + static void Main (string[] args) + { + Application.Init (); + + FileChooserDialog fcd = new FileChooserDialog ("Open File", + new Window ("test"), + FileChooserAction.Open, + "gnome-vfs"); + fcd.LocalOnly = false; + fcd.AddButton (Stock.Cancel, ResponseType.Cancel); + fcd.AddButton (Stock.Open, ResponseType.Ok); + fcd.DefaultResponse = ResponseType.Ok; + int resp = fcd.Run (); + fcd.Hide (); + + if (resp != (int)ResponseType.Ok) + return; + + Console.WriteLine ("Selected uri = {0}", fcd.Uri); + string mimetype = Mime.GetMimeType (fcd.Uri); + Console.WriteLine ("Mimetype = {0}", mimetype); + + FileInfoOptions options = FileInfoOptions.Default; + Gnome.Vfs.FileInfo info = new Gnome.Vfs.FileInfo (fcd.Uri, options); + Console.WriteLine ("isLocal = " + info.IsLocal); + +#if false + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (fcd.Uri); + Console.WriteLine (uri.ToString ()); + + VfsStream vs = new VfsStream (fcd.Uri, FileMode.OpenOrCreate); + UTF8Encoding utf8 = new UTF8Encoding (); + byte[] buf = utf8.GetBytes ("Testing 1 2 3, asdjfaskjdhfkajshdf"); + vs.Write (buf, 0, buf.Length); + /*for (int i = 0; i < 200; i++) { + int c = vs.ReadByte (); + if (c == -1) { + Console.WriteLine ("EOF"); + break; + } + Console.Write ((char)c); + }*/ + vs.Close (); + + //Handle handle = Vfs.Open (fcd.Uri, OpenMode.Read); + + //Vfs.OpenAsync (fcd.Uri, OpenMode.Read, 0, new Gnome.Vfs.AsyncCallback (open_cb)); + + /*FilePermission perms = FilePermission.UserRead | + FilePermission.UserWrite | + FilePermission.GroupRead | + FilePermission.OtherRead; + Vfs.CreateAsync ("file:///home/jeroen/test.txt", OpenMode.Write, + false, perms, 0, new Gnome.Vfs.AsyncCallback (create_cb));*/ +#endif + Application.Run (); + } + + static void open_cb (Handle handle, Result result) + { + Console.WriteLine ("OpenAsync result = {0} ({1})", Vfs.ResultToString (result), result); + + byte[] buffer = new byte[128]; + Vfs.ReadAsync (handle, out buffer[0], 128, new AsyncReadCallback (read_cb)); + } + + static void read_cb (Handle handle, Result result, byte[] buffer, ulong bytes_requested, ulong bytes_read) + { + Console.WriteLine ("ReadAsync result = {0} ({1})", Vfs.ResultToString (result), result); + + if (result == Result.Ok) { + Console.WriteLine ("bytes_requested = {0}", bytes_requested); + Console.WriteLine ("bytes_read = {0}", bytes_read); + /*Console.WriteLine ("bytes = "); + for (int i = 0; i < (int)bytes_read; i++) + Console.Write ("" + (char)buffer[i]);*/ + + byte[] buf = new byte[128]; + Vfs.ReadAsync (handle, out buf[0], 128, new AsyncReadCallback (read_cb)); + } + } + + static void create_cb (Handle handle, Result result) + { + Console.WriteLine ("CreateAsync result = {0} ({1})", Vfs.ResultToString (result), result); + + if (result == Result.Ok) { + UTF8Encoding utf8 = new UTF8Encoding (); + byte[] buffer = utf8.GetBytes ("Testing 1 2 3 asdlfjalsjdfksjdf \nGustavo Giráldez\n"); + Vfs.WriteAsync (handle, out buffer[0], (uint)buffer.Length, new AsyncWriteCallback (write_cb)); + } + } + + static void write_cb (Handle handle, Result result, byte[] buffer, ulong bytes_requested, ulong bytes_written) + { + Console.WriteLine ("WriteAsync result = {0} ({1})", Vfs.ResultToString (result), result); + } +} diff --git a/sample/gnomevfs/.cvsignore b/sample/gnomevfs/.cvsignore new file mode 100644 index 000000000..bad024721 --- /dev/null +++ b/sample/gnomevfs/.cvsignore @@ -0,0 +1,3 @@ +Makefile +Makefile.in +*.exe diff --git a/sample/gnomevfs/Makefile.am b/sample/gnomevfs/Makefile.am new file mode 100644 index 000000000..e00bdf34a --- /dev/null +++ b/sample/gnomevfs/Makefile.am @@ -0,0 +1,69 @@ +TARGETS = \ + TestAsync.exe \ + TestAsyncStream.exe \ + TestInfo.exe \ + TestMime.exe \ + TestMonitor.exe \ + TestSync.exe \ + TestSyncCreate.exe \ + TestSyncStream.exe \ + TestSyncWrite.exe \ + TestUnlink.exe \ + TestVolumes.exe \ + TestXfer.exe + +assemblies=../../glib/glib-sharp.dll ../../gnomevfs/gnome-vfs-sharp.dll +references = $(addprefix /r:, $(assemblies)) /r:Mono.GetOptions + +noinst_SCRIPTS = $(TARGETS) +CLEANFILES = $(TARGETS) + +EXTRA_DIST = \ + TestAsync.cs \ + TestAsyncStream.cs \ + TestInfo.cs \ + TestMime.cs \ + TestMonitor.cs \ + TestSync.cs \ + TestSyncCreate.cs \ + TestSyncStream.cs \ + TestSyncWrite.cs \ + TestUnlink.cs \ + TestVolumes.cs \ + TestXfer.cs + +TestAsync.exe: $(srcdir)/TestAsync.cs $(assemblies) + $(CSC) /out:TestAsync.exe $(references) $(srcdir)/TestAsync.cs + +TestAsyncStream.exe: $(srcdir)/TestAsyncStream.cs $(assemblies) + $(CSC) /out:TestAsyncStream.exe $(references) $(srcdir)/TestAsyncStream.cs + +TestInfo.exe: $(srcdir)/TestInfo.cs $(assemblies) + $(CSC) /out:TestInfo.exe $(references) $(srcdir)/TestInfo.cs + +TestMime.exe: $(srcdir)/TestMime.cs $(assemblies) + $(CSC) /out:TestMime.exe $(references) $(srcdir)/TestMime.cs + +TestMonitor.exe: $(srcdir)/TestMonitor.cs $(assemblies) + $(CSC) /out:TestMonitor.exe $(references) $(srcdir)/TestMonitor.cs + +TestSyncStream.exe: $(srcdir)/TestSyncStream.cs $(assemblies) + $(CSC) /out:TestSyncStream.exe $(references) $(srcdir)/TestSyncStream.cs + +TestSync.exe: $(srcdir)/TestSync.cs $(assemblies) + $(CSC) /out:TestSync.exe $(references) $(srcdir)/TestSync.cs + +TestSyncCreate.exe: $(srcdir)/TestSyncCreate.cs $(assemblies) + $(CSC) /out:TestSyncCreate.exe $(references) $(srcdir)/TestSyncCreate.cs + +TestSyncWrite.exe: $(srcdir)/TestSyncWrite.cs $(assemblies) + $(CSC) /out:TestSyncWrite.exe $(references) $(srcdir)/TestSyncWrite.cs + +TestUnlink.exe: $(srcdir)/TestUnlink.cs $(assemblies) + $(CSC) /out:TestUnlink.exe $(references) $(srcdir)/TestUnlink.cs + +TestVolumes.exe: $(srcdir)/TestVolumes.cs $(assemblies) + $(CSC) /out:TestVolumes.exe $(references) $(srcdir)/TestVolumes.cs + +TestXfer.exe: $(srcdir)/TestXfer.cs $(assemblies) + $(CSC) /out:TestXfer.exe $(references) $(srcdir)/TestXfer.cs diff --git a/sample/gnomevfs/TestAsync.cs b/sample/gnomevfs/TestAsync.cs new file mode 100644 index 000000000..d0940a089 --- /dev/null +++ b/sample/gnomevfs/TestAsync.cs @@ -0,0 +1,72 @@ +using GLib; +using Gnome.Vfs; +using System; +using System.Text; +using System.Threading; + +namespace Test.Gnome.Vfs { + public class TestAsync { + private static MainLoop loop; + private static Handle handle; + + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestAsync "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]); + handle = Async.Open (uri, OpenMode.Read, + (int)Async.Priority.Default, + new Gnome.Vfs.AsyncCallback (OnOpen)); + + loop = new MainLoop (); + loop.Run (); + + Gnome.Vfs.Vfs.Shutdown (); + } + + + private static void OnOpen (Handle handle, Result result) + { + Console.WriteLine ("Uri opened: {0}", result); + if (result != Result.Ok) { + loop.Quit (); + return; + } + + byte[] buffer = new byte[1024]; + Async.Read (handle, out buffer[0], (uint)buffer.Length, + new AsyncReadCallback (OnRead)); + } + + private static void OnRead (Handle handle, Result result, byte[] buffer, + ulong bytes_requested, ulong bytes_read) + { + Console.WriteLine ("Read: {0}", result); + if (result != Result.Ok && result != Result.ErrorEof) { + loop.Quit (); + return; + } + + UTF8Encoding utf8 = new UTF8Encoding (); + Console.WriteLine ("read ({0} bytes) : '{1}'", bytes_read, + utf8.GetString (buffer, 0, (int)bytes_read)); + + if (bytes_read != 0) + Async.Read (handle, out buffer[0], (uint)buffer.Length, + new AsyncReadCallback (OnRead)); + else + Async.Close (handle, new Gnome.Vfs.AsyncCallback (OnClose)); + } + + private static void OnClose (Handle handle, Result result) + { + Console.WriteLine ("Close: {0}", result); + loop.Quit (); + } + } +} diff --git a/sample/gnomevfs/TestAsyncStream.cs b/sample/gnomevfs/TestAsyncStream.cs new file mode 100644 index 000000000..6f39cf698 --- /dev/null +++ b/sample/gnomevfs/TestAsyncStream.cs @@ -0,0 +1,54 @@ +using GLib; +using Gnome.Vfs; +using System; +using System.IO; +using System.Text; + +namespace Test.Gnome.Vfs { + public class TestAsyncStream { + private static MainLoop loop; + private static byte[] buffer; + + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestAsyncStream "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + VfsStream stream = new VfsStream (args[0], FileMode.Open, true); + + UTF8Encoding utf8 = new UTF8Encoding (); + buffer = new byte[1024]; + int read; + while ((read = stream.Read (buffer, 0, buffer.Length)) != 0) { + Console.WriteLine ("read ({0} bytes) : '{1}'", + read, utf8.GetString (buffer, 0, read)); + } + + long offset = stream.Seek (0, SeekOrigin.Begin); + Console.WriteLine ("Offset after seek is {0}", offset); + + buffer = new byte[1024]; + IAsyncResult result = stream.BeginRead (buffer, 0, buffer.Length, + new System.AsyncCallback (OnReadComplete), + stream); + + loop = new MainLoop (); + loop.Run (); + + Gnome.Vfs.Vfs.Shutdown (); + } + + private static void OnReadComplete (IAsyncResult result) + { + VfsStreamAsyncResult asyncResult = result as VfsStreamAsyncResult; + Console.WriteLine ("Read completed: {0}, {1}", asyncResult.IsCompleted, asyncResult.NBytes); + UTF8Encoding utf8 = new UTF8Encoding (); + Console.WriteLine (utf8.GetString (buffer, 0, buffer.Length)); + loop.Quit (); + } + } +} diff --git a/sample/gnomevfs/TestInfo.cs b/sample/gnomevfs/TestInfo.cs new file mode 100644 index 000000000..881a8024f --- /dev/null +++ b/sample/gnomevfs/TestInfo.cs @@ -0,0 +1,27 @@ +using Gnome.Vfs; +using System; +using System.Text; + +namespace Test.Gnome.Vfs { + public class TestInfo { + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestInfo "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]); + + FileInfoOptions options = FileInfoOptions.GetMimeType | + FileInfoOptions.FollowLinks | + FileInfoOptions.GetAccessRights; + FileInfo info = uri.GetFileInfo (options); + Console.WriteLine (info.ToString ()); + + Gnome.Vfs.Vfs.Shutdown (); + } + } +} diff --git a/sample/gnomevfs/TestMime.cs b/sample/gnomevfs/TestMime.cs new file mode 100644 index 000000000..94651f2c9 --- /dev/null +++ b/sample/gnomevfs/TestMime.cs @@ -0,0 +1,25 @@ +using Gnome.Vfs; +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace Test.Gnome.Vfs { + public class TestMime { + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestSync "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]); + + MimeType mimetype = uri.MimeType; + Console.WriteLine ("Uri `{0}' looks like ", uri, mimetype.Name); + + Gnome.Vfs.Vfs.Shutdown (); + } + } +} diff --git a/sample/gnomevfs/TestMonitor.cs b/sample/gnomevfs/TestMonitor.cs new file mode 100644 index 000000000..937e89f62 --- /dev/null +++ b/sample/gnomevfs/TestMonitor.cs @@ -0,0 +1,51 @@ +using GLib; +using Gnome.Vfs; +using System; +using System.Text; + +namespace Test.Gnome.Vfs { + public class TestMonitor { + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestMonitor "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Monitor monitor = new Monitor (); + monitor.Changed += OnChanged; + monitor.Deleted += OnDeleted; + monitor.Created += OnCreated; + monitor.MetadataChanged += OnMetadataChanged; + + monitor.Add (args[0], MonitorType.Directory); + monitor.Add ("/tmp", MonitorType.Directory); + + new MainLoop ().Run (); + + Gnome.Vfs.Vfs.Shutdown (); + } + + public static void OnChanged (string monitor, string uri) + { + Console.WriteLine ("Uri changed: {0}", uri); + } + + public static void OnDeleted (string monitor, string uri) + { + Console.WriteLine ("Uri deleted: {0}", uri); + } + + public static void OnCreated (string monitor, string uri) + { + Console.WriteLine ("Uri created: {0}", uri); + } + + public static void OnMetadataChanged (string monitor, string uri) + { + Console.WriteLine ("Uri metadata changed: {0}", uri); + } + } +} diff --git a/sample/gnomevfs/TestSync.cs b/sample/gnomevfs/TestSync.cs new file mode 100644 index 000000000..f18be5b54 --- /dev/null +++ b/sample/gnomevfs/TestSync.cs @@ -0,0 +1,44 @@ +using Gnome.Vfs; +using System; +using System.Text; + +namespace Test.Gnome.Vfs { + public class TestSync { + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestSync "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]); + Handle handle = Sync.Open (uri, OpenMode.Read); + + UTF8Encoding utf8 = new UTF8Encoding (); + byte[] buffer = new byte[1024]; + Result result = Result.Ok; + while (result == Result.Ok) { + ulong bytesRead; + result = Sync.Read (handle, out buffer[0], + (ulong)buffer.Length, out bytesRead); + Console.WriteLine ("result read '{0}' = {1}", uri, result); + if (bytesRead == 0) + break; + Console.WriteLine ("read ({0} bytes) : '{1}'", + bytesRead, utf8.GetString (buffer, 0, (int)bytesRead)); + } + + string test; + result = Sync.FileControl (handle, "file:test", out test); + Console.WriteLine ("result filecontrol '{0}' = {1}", uri, result); + Console.WriteLine ("result file:test = {0}", test); + + result = Sync.Close (handle); + Console.WriteLine ("result close '{0}' = {1}", uri, result); + + Gnome.Vfs.Vfs.Shutdown (); + } + } +} diff --git a/sample/gnomevfs/TestSyncCreate.cs b/sample/gnomevfs/TestSyncCreate.cs new file mode 100644 index 000000000..09365624e --- /dev/null +++ b/sample/gnomevfs/TestSyncCreate.cs @@ -0,0 +1,47 @@ +using Gnome.Vfs; +using System; +using System.Text; + +namespace Test.Gnome.Vfs { + public class TestSyncCreate { + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestSyncCreate "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]); + + FilePermissions perms = FilePermissions.UserRead | + FilePermissions.UserWrite | + FilePermissions.GroupRead | + FilePermissions.OtherRead; + Console.WriteLine (perms); + Handle handle = Sync.Create (uri, OpenMode.Write, false, perms); + + UTF8Encoding utf8 = new UTF8Encoding (); + Result result = Result.Ok; + Console.WriteLine ("Enter text and end with Ctrl-D"); + while (result == Result.Ok) { + string line = Console.ReadLine (); + if (line == null) + break; + byte[] buffer = utf8.GetBytes (line); + + ulong bytesWritten; + result = Sync.Write (handle, out buffer[0], + (ulong)buffer.Length, out bytesWritten); + Console.WriteLine ("result write '{0}' = {1}", uri, result); + Console.WriteLine ("{0} bytes written", bytesWritten); + } + + result = Sync.Close (handle); + Console.WriteLine ("result close '{0}' = {1}", uri, result); + + Gnome.Vfs.Vfs.Shutdown (); + } + } +} diff --git a/sample/gnomevfs/TestSyncStream.cs b/sample/gnomevfs/TestSyncStream.cs new file mode 100644 index 000000000..775542f75 --- /dev/null +++ b/sample/gnomevfs/TestSyncStream.cs @@ -0,0 +1,36 @@ +using GLib; +using Gnome.Vfs; +using System; +using System.IO; +using System.Text; + +namespace Test.Gnome.Vfs { + public class TestSyncStream { + private static MainLoop loop; + + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestSyncStream "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + VfsStream stream = new VfsStream (args[0], FileMode.Open); + + UTF8Encoding utf8 = new UTF8Encoding (); + byte[] buffer = new byte[1024]; + int read; + while ((read = stream.Read (buffer, 0, buffer.Length)) != 0) { + Console.WriteLine ("read ({0} bytes) : '{1}'", + read, utf8.GetString (buffer, 0, read)); + } + + long offset = stream.Seek (0, SeekOrigin.Begin); + Console.WriteLine ("Offset after seek is {0}", offset); + + Gnome.Vfs.Vfs.Shutdown (); + } + } +} diff --git a/sample/gnomevfs/TestSyncWrite.cs b/sample/gnomevfs/TestSyncWrite.cs new file mode 100644 index 000000000..a416a2208 --- /dev/null +++ b/sample/gnomevfs/TestSyncWrite.cs @@ -0,0 +1,42 @@ +using Gnome.Vfs; +using System; +using System.Text; + +namespace Test.Gnome.Vfs { + public class TestSyncWrite { + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestSyncWrite "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]); + + Handle handle = Sync.Open (uri, OpenMode.Write); + + UTF8Encoding utf8 = new UTF8Encoding (); + Result result = Result.Ok; + Console.WriteLine ("Enter text and end with Ctrl-D"); + while (result == Result.Ok) { + string line = Console.ReadLine (); + if (line == null) + break; + byte[] buffer = utf8.GetBytes (line); + + ulong bytesWritten; + result = Sync.Write (handle, out buffer[0], + (ulong)buffer.Length, out bytesWritten); + Console.WriteLine ("result write '{0}' = {1}", uri, result); + Console.WriteLine ("{0} bytes written", bytesWritten); + } + + result = Sync.Close (handle); + Console.WriteLine ("result close '{0}' = {1}", uri, result); + + Gnome.Vfs.Vfs.Shutdown (); + } + } +} diff --git a/sample/gnomevfs/TestUnlink.cs b/sample/gnomevfs/TestUnlink.cs new file mode 100644 index 000000000..1b3f9b234 --- /dev/null +++ b/sample/gnomevfs/TestUnlink.cs @@ -0,0 +1,23 @@ +using Gnome.Vfs; +using System; + +namespace Test.Gnome.Vfs { + public class TestUnlink { + static void Main (string[] args) + { + if (args.Length != 1) { + Console.WriteLine ("Usage: TestUnlink "); + return; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]); + Result result = Gnome.Vfs.Vfs.Unlink (uri.ToString ()); + + Console.WriteLine ("result unlink ('{0}') = {1}", uri, result); + + Gnome.Vfs.Vfs.Shutdown (); + } + } +} diff --git a/sample/gnomevfs/TestVolumes.cs b/sample/gnomevfs/TestVolumes.cs new file mode 100644 index 000000000..327eac402 --- /dev/null +++ b/sample/gnomevfs/TestVolumes.cs @@ -0,0 +1,93 @@ +using Gnome.Vfs; +using System; + +namespace Test.Gnome.Vfs { + public class TestVolumes { + public TestVolumes () + { + Gnome.Vfs.Vfs.Initialize (); + + VolumeMonitor monitor = VolumeMonitor.Get (); + monitor.DriveConnected += OnDriveConnected; + monitor.DriveDisconnected += OnDriveDisconnected; + monitor.VolumeMounted += OnVolumeMounted; + monitor.VolumeUnmounted += OnVolumeUnmounted; + + GLib.List vols = monitor.MountedVolumes; + Console.WriteLine ("Mounted volumes:"); + foreach (Volume v in vols) + PrintVolume (v); + + GLib.List drives = monitor.ConnectedDrives; + Console.WriteLine ("\nConnected drives:"); + foreach (Drive d in drives) + PrintDrive (d); + + Console.WriteLine ("\nWaiting for volume events..."); + GLib.MainLoop loop = new GLib.MainLoop (); + loop.Run (); + + Gnome.Vfs.Vfs.Shutdown (); + } + + public void PrintDrive (Drive d) + { + Console.WriteLine ("Drive:"); + Console.WriteLine (" ActivationUri: {0}", d.ActivationUri); + Console.WriteLine (" DevicePath: {0}", d.DevicePath); + Console.WriteLine (" DeviceType: {0}", d.DeviceType); + Console.WriteLine (" DisplayName: {0}", d.DisplayName); + Console.WriteLine (" Icon: {0}", d.Icon); + Console.WriteLine (" Id: {0}", d.Id); + Console.WriteLine (" IsConnected: {0}", d.IsConnected); + Console.WriteLine (" IsMounted: {0}", d.IsMounted); + Console.WriteLine (" IsUserVisible: {0}", d.IsUserVisible); + } + + public void PrintVolume (Volume v) + { + Console.WriteLine ("Volume:"); + Console.WriteLine (" ActivationUri: {0}", v.ActivationUri); + Console.WriteLine (" DevicePath: {0}", v.DevicePath); + Console.WriteLine (" DeviceType: {0}", v.DeviceType); + Console.WriteLine (" DisplayName: {0}", v.DisplayName); + Console.WriteLine (" FilesystemType: {0}", v.FilesystemType); + Console.WriteLine (" HandlesTrash: {0}", v.HandlesTrash); + Console.WriteLine (" Icon: {0}", v.Icon); + Console.WriteLine (" Id: {0}", v.Id); + Console.WriteLine (" IsMounted: {0}", v.IsMounted); + Console.WriteLine (" IsReadOnly: {0}", v.IsReadOnly); + Console.WriteLine (" IsUserVisible: {0}", v.IsUserVisible); + Console.WriteLine (" VolumeType: {0}", v.VolumeType); + } + + static void Main (string[] args) + { + new TestVolumes (); + } + + public void OnDriveConnected (object o, DriveConnectedArgs args) + { + Console.WriteLine ("Drive connected:"); + PrintDrive (args.Drive); + } + + public void OnDriveDisconnected (object o, DriveDisconnectedArgs args) + { + Console.WriteLine ("Drive disconnected:"); + PrintDrive (args.Drive); + } + + public void OnVolumeMounted (object o, VolumeMountedArgs args) + { + Console.WriteLine ("Volume mounted:"); + PrintVolume (args.Volume); + } + + public void OnVolumeUnmounted (object o, VolumeUnmountedArgs args) + { + Console.WriteLine ("Volume unmounted:"); + PrintVolume (args.Volume); + } + } +} diff --git a/sample/gnomevfs/TestXfer.cs b/sample/gnomevfs/TestXfer.cs new file mode 100644 index 000000000..70c744119 --- /dev/null +++ b/sample/gnomevfs/TestXfer.cs @@ -0,0 +1,164 @@ +using Gnome.Vfs; +using Mono.GetOptions; +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("TestXfer")] +[assembly: AssemblyDescription("Test case for the Gnome.Vfs.Xfer class")] +[assembly: AssemblyCopyright("(C) 2004 Jeroen Zwartepoorte")] +[assembly: Mono.About("Distributed under the GPL")] +[assembly: Mono.UsageComplement(" ")] +[assembly: Mono.Author("Jeroen Zwartepoorte")] +[assembly: AssemblyVersion("1.0.*")] + +namespace Test.Gnome.Vfs { + class TestXferOptions : Options { + [Option("Copy directories recursively", 'r')] + public bool recursive = false; + + [Option("Follow symlinks", 'L', "follow-symlinks")] + public bool followSymlinks = false; + + [Option("Follow symlinks recursively", 'Z', "recursive-symlinks")] + public bool recursiveSymlinks = false; + + [Option("Replace files automatically", 'R')] + public bool replace = false; + + [Option("Delete source files", 'd', "delete-source")] + public bool deleteSource = false; + + public TestXferOptions () + { + ParsingMode = OptionsParsingMode.Both; + } + + public override WhatToDoNext DoHelp () + { + base.DoHelp(); + return WhatToDoNext.AbandonProgram; + } + + [Option("Show usage syntax", 'u', "usage")] + public override WhatToDoNext DoUsage() + { + base.DoUsage(); + return WhatToDoNext.AbandonProgram; + } + } + + public class TestXfer { + static void Main (string[] args) + { + TestXferOptions opt = new TestXferOptions (); + opt.ProcessArgs (args); + + if (opt.RemainingArguments.Length < 2) { + opt.DoUsage (); + return; + } + + XferOptions options = XferOptions.Default; + XferOverwriteMode overwriteMode = XferOverwriteMode.Query; + if (opt.recursive) { + Console.WriteLine ("Warning: Recursive xfer of directories."); + options |= XferOptions.Recursive; + } + if (opt.followSymlinks) { + Console.WriteLine ("Warning: Following symlinks."); + options |= XferOptions.FollowLinks; + } + if (opt.recursiveSymlinks) { + Console.WriteLine ("Warning: Following symlinks recursively."); + options |= XferOptions.FollowLinksRecursive; + } + if (opt.replace) { + Console.WriteLine ("Warning: Using replace overwrite mode."); + overwriteMode = XferOverwriteMode.Replace; + } + if (opt.deleteSource) { + Console.WriteLine ("Warning: Removing source files."); + options |= XferOptions.Removesource; + } + + Gnome.Vfs.Vfs.Initialize (); + + Gnome.Vfs.Uri source = new Gnome.Vfs.Uri (opt.RemainingArguments[0]); + Console.WriteLine ("Source: `{0}'", source); + Gnome.Vfs.Uri target = new Gnome.Vfs.Uri (opt.RemainingArguments[1]); + Console.WriteLine ("Target: `{0}'", target); + + Result result = Xfer.XferUri (source, target, options, + XferErrorMode.Query, + overwriteMode, + new XferProgressCallback (OnProgress)); + Console.WriteLine ("Result: {0}", Gnome.Vfs.Vfs.ResultToString (result)); + + Gnome.Vfs.Vfs.Shutdown (); + } + + public static int OnProgress (XferProgressInfo info) + { + switch (info.Status) { + case XferProgressStatus.Vfserror: + Console.WriteLine ("Vfs error: {0}", + Gnome.Vfs.Vfs.ResultToString (info.VfsStatus)); + break; + case XferProgressStatus.Overwrite: + Console.WriteLine ("Overwriting `{0}' with `{1}'", + info.TargetName, info.SourceName); + break; + case XferProgressStatus.Ok: + Console.WriteLine ("Status: Ok"); + switch (info.Phase) { + case XferPhase.PhaseInitial: + Console.WriteLine ("Initial phase"); + return 1; + case XferPhase.PhaseCollecting: + Console.WriteLine ("Collecting file list"); + return 1; + case XferPhase.PhaseReadytogo: + Console.WriteLine ("Ready to go!"); + return 1; + case XferPhase.PhaseOpensource: + Console.WriteLine ("Opening source"); + return 1; + case XferPhase.PhaseOpentarget: + Console.WriteLine ("Opening target"); + return 1; + case XferPhase.PhaseCopying: + Console.WriteLine ("Transferring `{0}' to `{1}' " + + "(file {2}/{3}, byte {4}/{5} in file, " + + "{6}/{7} total", info.SourceName, + info.TargetName, info.FileIndex, + info.FilesTotal, (long)info.BytesCopied, + (long)info.FileSize, info.TotalBytesCopied, + info.BytesTotal); + break; + case XferPhase.PhaseClosesource: + Console.WriteLine ("Closing source"); + return 1; + case XferPhase.PhaseClosetarget: + Console.WriteLine ("Closing target"); + return 1; + case XferPhase.PhaseFilecompleted: + Console.WriteLine ("Done with `{0}' -> `{1}', going next", + info.SourceName, info.TargetName); + return 1; + case XferPhase.PhaseCompleted: + Console.WriteLine ("All done."); + return 1; + default: + Console.WriteLine ("Unexpected phase: {0}", info.Phase); + return 1; // Keep going anyway. + } + break; + case XferProgressStatus.Duplicate: + break; + } + + return 0; + } + } +} diff --git a/sample/panelapplet/CSharpTestApplet_Factory.server b/sample/panelapplet/CSharpTestApplet_Factory.server new file mode 100644 index 000000000..8a7ad67c5 --- /dev/null +++ b/sample/panelapplet/CSharpTestApplet_Factory.server @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/panelapplet/monodoc.png b/sample/panelapplet/monodoc.png new file mode 100644 index 0000000000000000000000000000000000000000..bffe53674e535a5ec4a231279e766e09519edcb4 GIT binary patch literal 3634 zcmV-24$bk2P)@2HQ*UHxaBpO3pY$&$0000EbVXQnL3MO! zZ*l-tZfkCDcW#U!4DtW~03Lc&Sad{Xb7OL8aCB*JZU6vyoJ&+F$V@INElLFd5MKj+ z>hujP000evNkl+(E>?832^xl*!$gOGavyb;A=qj$HI9qc?OWQTCJqf zs3l|~rNDqc7FPSj6R1!qL@9pr$I@q?#Yz49_iZ3y1Q!1uAQTVr+#$gCl~?|Q;lqQl zwX-EWd^Ca}lAV1)0K$POz#ib^|j0ReyieheJwPkMS5 zdi~w5z&zkA|4$pdBLu>Lts0F+h~2afg;IggWPq!yj);gc+_+IfVPTO9cnRnM9DGQ; z&E!D|xBx#2g5bDx>HBo+<_=gEz@i8OHa0edh6dy8>_mEcmS8fO0)W?mZ-B}_iohNq zC^9mFC!dULeUya>c>8!UB6t`%Ik{9;RyhGt$T{O&M*ugK2O$sz%2 z8`hw;)dC<%65k&@!r{Y536BUPFZUv!f4-CA;u1Q$bjHEK!Lk^ls30&f0Iyy>NlVM1 zuFlX4cnkO^P}ETZP4{0*Vhf}KecpIu4&mWr05BSjBqVIZ%exmJeY6^tN>0G__4Onr z{XlGNJQ}rzY15xUr*p9~SYBREOmrOC*|{KR@Q;A^Izpg5EAS~WJ|JKaGyn7w0Cfff z(Hml!_(UYjmM=mfik88mDAK#PFE79RB03irRq|$%*-tGdc6*q3*-P79tDA3z+q7o)hkvm!^PPdB#4hsU_#_L=FFLe zBw?*sYx40E%$)HW2%u0XaCdh{sZ?5#bkVsGHg*gpB_$LV7Ab*gfIo7$l{!j52^3TRQ-vqoY~9W;KHc4{o0o%dO^KU^E)plJGx# z@x@MF`}3=G@7~=)9Kc|xXXh7Rl9ZIx@JI?U7SK1f)zpRDfPV;rVE@+Kx%BAK6A7rS zu44DD-Q?!wF>U(vX1*@88I7B}mmr7)4IN78s8Cj}T!o{fBVD_8wLBq;B7*}4(aWnB znHibX)zx_*7lo&Q-x^zQ>yV z!-W#C2lfN1>C;}o&8>@hhN0qi1v*zZA}362Ga@&;B{aY2?>~Ud>XJ-Q(2R1aet_0!%Ppwu<5|3h^?H!^XoDZ!1M&f5!~FOH zM*we?O2w?%uQPl^u*L9^!-qJZdY1nF1E{X5A|oRmgQ1SU&3})XGhaoaP&6R00I_D! z8enTVckV1JS1!ZTvjVOvKpKh7FJg^aB_+Yy`7szk$j| z&Xjt64W&0r(AwIvZEFI1_U*^j)vZ-^eU@%rJvftcnz&6H zL3W*SX28{E@TP`mm5uDw0i%E`f*?4gr2Il&UM}zc*Fqk9tUFq*EuKAkQC?m~r%uke zxVT|5n-PU}#Gw|3T)S4lf3I3WK|ujeJv|jKZyx||mE9uY(|8mL5u?%M0Q?0=0Mt!w zG|j|!k^9xBJUkwwwDcy&j{S&IsiL=U9{^6BI>GP}Ap`^j-iO#iCE83IRjs9^rF^h* z83~)?2o4G5si&U7+1UjUFqurO`d~Q~6%{OBv6!AcJxNQ;2m}g|{ayi7wMGDBHyUR! z7(AbS?geskvdGTPBqKAOz@a1fKJi=Tzq<%~dk5O;1@2d>_vOx=YBt7v%!jL%)8Bsp z&pj`P?Z&cq&zGD(e~t+gBKXrQGYAh4qwH20+1VFHB6o(>W~~G3Qo=H!!0WZOck9c` z%h?dU8MiL(p2?FYP@}J5!J_2^1&shi zBuTJnZf-6~Nr&jt#f^97zl~a@p?ml4e3}r)=+U7z$W^H)@)?uZ+6n;N1f23OUkrKn zxfgkU+KZGF-ylE#BIV^}h@yg_LxT|n(H!X8)>9{w*|B{qQFG_htEac6>TE1EH8p&= zY6(W8k&T;T=;G#vmv=8T8V$9zwG15SPjd2c&F$M2!N8Bmp|rZKj_edLGd=B`W7J#k zGGs^)E-pIK(#~@H_%VJtbCQvvVc6N(H}A|Eseph^=gRgSTL~L8?mn?5#G^N?p}6=u zQBiLa5;B5r-MV3GXUDaIYh-0*vuoF0&ZVBG?p~b}a<_N_sBDWs9Z*nNSustiR1x|3 z6x_RZC1~hyE?meWD>I$1zut|HcW=DBe4Ed_8K49xRVtE`|4AojXB-@znr-l-M-P$w zub&7S8bs7vQP|npqg1IldEz9ov7fMJ^*T~z@MXYOAP%SpH2+sqe*qYtcK)32lar>> zv!^#2wU&{gW2mjIB_lnR#KirS-!3CKWE7%8VL4i~76GMF$%zv`)2B~=E24$h3W$%7 z!O_uy=;&zF8ZBvQX{=ejmW>-@`8DrXj7H;iGw9{q-^ka2qV}8%c>&oWBgbg|{`dVL zKuO6BZk68T?Ac$~7_*kDs!Du)`?4u+JKjFlg-%09cJE#-lP86-VByO9OKiBuq6KeL zQE{8t*f=UGZnJmaUb3^Y8irg(?oo~+C$DPcFmE|qZO^&TZ9u$s?dn)B@80=U?APPK1Rc)_VDmz)26lb^BX|)h7XY>6OtsEfMdW? zV22rS5pWeb97#<4 zh6_3AAeZm+fePfrd4&#qOM6fPcYvCkH*ZYT>D=%i5Ma3>iXzU=ovG2+P#wJp1jM@ut$AFxpfUK#GH-(~u)aQqbvK zEqO~{bBDcqx3g_)9Hpf<8^)Id*O0$4fb1SGnSa9!{&q*eKa30mjFYEKlP=_yOUF-K zkY>%ED>*tkHBPWaz#1SJ`P5^c8R!!8bs*sLus}Mp0u8bm_|I|UC-JYJf52d8kXq!~@6g8mqeMXd&fE{#l^%)wFPrg90mnMM!T"; + this.SetupMenu (xml, new BonoboUIVerb [] { new BonoboUIVerb ("LabelChange", new ContextMenuItemCallback (LabelChangeCB)) }); + } + + int i = 0; + void LabelChangeCB () + { + testLabel.Text = String.Format ("Changed {0} time(s).", ++i); + } + + public override string IID { + get { return "OAFIID:CSharpTestApplet"; } + } + + public override string FactoryIID { + get { return "OAFIID:CSharpTestApplet_Factory"; } + } + } +} diff --git a/sample/test/ChangeLog b/sample/test/ChangeLog index b3eba0012..c2999225d 100644 --- a/sample/test/ChangeLog +++ b/sample/test/ChangeLog @@ -1,3 +1,26 @@ +2004-05-31 Jeroen Zwartepoorte + + reviewed by: + + * TestCombo.cs: + +2004-05-06 Jeroen Zwartepoorte + + reviewed by: + + * .cvsignore: + * Makefile: + * Makefile.am: + * TestCombo.cs: + * TestSizeGroup.cs: + * WidgetViewer.cs: + +2004-03-03 Jeroen Zwartepoorte + + reviewed by: + + * TestCombo.cs: + 2003-03-05 Duncan Mak * TestCombo.cs: New file, to show basic usage of a ComboBox. It's diff --git a/sample/test/Makefile.am b/sample/test/Makefile.am index 78a461a6e..6b3b2b8f0 100644 --- a/sample/test/Makefile.am +++ b/sample/test/Makefile.am @@ -11,14 +11,11 @@ EXTRA_DIST = $(sources) ChangeLog sources = \ TestCheckButton.cs \ TestColorSelection.cs \ - TestFileSelection.cs \ TestRadioButton.cs \ TestRange.cs \ TestStatusbar.cs \ - TestToolbar.cs \ TestDialog.cs \ TestFlipping.cs \ - TestMenus.cs \ TestSizeGroup.cs \ TestCombo.cs \ WidgetViewer.cs diff --git a/sample/test/TestSizeGroup.cs b/sample/test/TestSizeGroup.cs index f920154e5..486643294 100644 --- a/sample/test/TestSizeGroup.cs +++ b/sample/test/TestSizeGroup.cs @@ -69,9 +69,9 @@ namespace WidgetViewer { return window; } - static OptionMenu Create_OptionMenu (string [] strings) + static ComboBox Create_ComboBox (string [] strings) { - Menu menu = new Menu (); + /*Menu menu = new Menu (); MenuItem menu_item = null; @@ -84,7 +84,13 @@ namespace WidgetViewer { OptionMenu option_menu = new OptionMenu (); option_menu.Menu = menu; - return option_menu; + return option_menu;*/ + ComboBox combo_box = new ComboBox (); + foreach (string str in strings) { + combo_box.AppendText (str); + } + + return combo_box; } static void Add_Row (Table table, uint row, SizeGroup size_group, @@ -98,10 +104,10 @@ namespace WidgetViewer { AttachOptions.Expand, AttachOptions.Fill, 0, 0); - OptionMenu option_menu = Create_OptionMenu (options); + ComboBox combo_box = Create_ComboBox (options); - size_group.AddWidget (option_menu); - table.Attach (option_menu, + size_group.AddWidget (combo_box); + table.Attach (combo_box, 1, 2, row, row + 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0); diff --git a/sample/test/WidgetViewer.cs b/sample/test/WidgetViewer.cs index 675d4a7f0..b1224ac14 100644 --- a/sample/test/WidgetViewer.cs +++ b/sample/test/WidgetViewer.cs @@ -108,7 +108,7 @@ namespace WidgetViewer { static void File_Selection (object o, EventArgs args) { - AddWindow (TestFileSelection.Create ()); + //AddWindow (TestFileSelection.Create ()); } static void Radio_Buttons (object o, EventArgs args) @@ -128,7 +128,7 @@ namespace WidgetViewer { static void Toolbar (object o, EventArgs args) { - AddWindow (TestToolbar.Create ()); + //AddWindow (TestToolbar.Create ()); } static void Dialog (object o, EventArgs args) @@ -143,7 +143,7 @@ namespace WidgetViewer { static void Menus (object o, EventArgs args) { - AddWindow (TestMenus.Create ()); + //AddWindow (TestMenus.Create ()); } static void Size_Groups (object o, EventArgs args) diff --git a/sources/Makefile.am b/sources/Makefile.am index 9770fac04..ae9e344ca 100644 --- a/sources/Makefile.am +++ b/sources/Makefile.am @@ -5,20 +5,22 @@ EXTRA_DIST = \ DOWNLOADS = \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/pango-1.2.3.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/atk-1.2.4.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/gtk+-2.2.2.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/libgnome-2.2.3.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/libgnomecanvas-2.2.1.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/libgnomeui-2.2.2.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/libgnomeprint-2.2.1.3.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/libgnomeprintui-2.2.1.3.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.0/2.0.0/sources/libglade-2.0.0.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.0/2.0.3/sources/libart_lgpl-2.3.10.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/librsvg-2.2.5.tar.gz \ + ftp://ftp.gtk.org/pub/gtk/v2.4/pango-1.4.0.tar.gz \ + ftp://ftp.gtk.org/pub/gtk/v2.4/atk-1.6.0.tar.gz \ + ftp://ftp.gtk.org/pub/gtk/v2.4/gtk+-2.4.1.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/gnome-vfs-2.6.0.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/libgnome-2.6.0.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/libgnomecanvas-2.6.0.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/libgnomeui-2.6.0.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/libgnomeprint-2.6.0.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/libgnomeprintui-2.6.0.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/libglade-2.3.6.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/libart_lgpl-2.3.16.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/librsvg-2.6.4.tar.gz \ http://ftp.gnome.org/pub/GNOME/sources/libgda/1.0/libgda-1.0.0.tar.gz \ http://ftp.gnome.org/pub/GNOME/sources/libgnomedb/1.0/libgnomedb-1.0.0.tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.4/2.4.0/sources/vte-0.11.10.tar.gz + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/vte-0.11.10.tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.0/sources/gnome-panel-2.6.0.tar.gz GTKHTML_SOURCEFILES = \ gtkhtml-3.0.10/src/gtkhtml.c \ @@ -31,7 +33,7 @@ GTKHTML_SOURCEFILES = \ gtkhtml-3.0.10/src/gtkhtml-stream.h api: - PERLLIB=../parser PATH=../parser:$$PATH ../parser/gapi-parser gtk-sharp-sources.xml + PATH=../parser:$$PATH ../parser/gapi_parser.pl gtk-sharp-sources.xml get-gtkhtml-code: wget http://ftp.gnome.org/pub/GNOME/sources/gtkhtml/3.0/gtkhtml-3.0.10.tar.gz --output-document=- | tar -xz $(GTKHTML_SOURCEFILES) @@ -42,7 +44,6 @@ get-source-code: get-gtkhtml-code wget $$i --output-document=- | tar -xz ; \ done; - ln -f -s ../gdk/gdkpixbuf-drawable.c gtk+-2.2.2/gdk-pixbuf/gdkpixbuf-drawable.c - ln -f -s ../gdk/gdkpixbuf.h gtk+-2.2.2/gdk-pixbuf/gdkpixbuf.h - ln -f -s ../gdk/gdkpixbuf-render.c gtk+-2.2.2/gdk-pixbuf/gdkpixbuf-render.c - + ln -f -s gtkfilechooserprivate.h gtk+-2.4.1/gtk/gtkfilechooserpriv.h + patch -p0 atk-1.6.0/atk/atkhyperlink.h < atkhyperlink.patch + patch -p0 gtk+-2.4.1/gtk/gtktreemodel.c < gtk_tree_model_signal_fix.patch diff --git a/sources/atkhyperlink.patch b/sources/atkhyperlink.patch new file mode 100644 index 000000000..1cdd8d1a4 --- /dev/null +++ b/sources/atkhyperlink.patch @@ -0,0 +1,4 @@ +77c77 +< void ( *link_activated) (AtkHyperlink *link_); +--- +> void (* link_activated) (AtkHyperlink *link_); diff --git a/sources/gtk-sharp-sources.xml b/sources/gtk-sharp-sources.xml index 5b6deff6e..af7a5b18b 100644 --- a/sources/gtk-sharp-sources.xml +++ b/sources/gtk-sharp-sources.xml @@ -2,70 +2,112 @@ - atk-1.2.4/atk + atk-1.6.0/atk - pango-1.2.3/pango - pango-1.2.3/pango/pangox-fontcache.c - pango-1.2.3/pango/pangox-fontmap.c - pango-1.2.3/pango/pangox-private.h - pango-1.2.3/pango/pangox.h - pango-1.2.3/pango/pangox.c - pango-1.2.3/pango/pangoxft.h - pango-1.2.3/pango/pangoxft-font.h - pango-1.2.3/pango/pangoxft-fontmap.h - pango-1.2.3/pango/pangoxft-private.h + pango-1.4.0/pango + pango-1.4.0/pango/pangox-fontcache.c + pango-1.4.0/pango/pangox-fontmap.c + pango-1.4.0/pango/pangox-private.h + pango-1.4.0/pango/pangox.h + pango-1.4.0/pango/pangox.c + pango-1.4.0/pango/pangoxft.h + pango-1.4.0/pango/pangoxft-font.h + pango-1.4.0/pango/pangoxft-fontmap.h + pango-1.4.0/pango/pangoxft-private.h - gtk+-2.2.2/gdk + gtk+-2.4.1/gdk - gtk+-2.2.2/gdk-pixbuf + gtk+-2.4.1/gdk-pixbuf - gtk+-2.2.2/gtk + gtk+-2.4.1/gtk + + gtk+-2.4.1/gtk/gtkfilesystemmodel.c + gtk+-2.4.1/gtk/gtkfilesystemmodel.h + + gtk+-2.4.1/gtk/gtkclist.c + gtk+-2.4.1/gtk/gtkclist.h + gtk+-2.4.1/gtk/gtkctree.c + gtk+-2.4.1/gtk/gtkctree.h + gtk+-2.4.1/gtk/gtklist.c + gtk+-2.4.1/gtk/gtklist.h + gtk+-2.4.1/gtk/gtklistitem.c + gtk+-2.4.1/gtk/gtklistitem.h + gtk+-2.4.1/gtk/gtkoldeditable.c + gtk+-2.4.1/gtk/gtkoldeditable.h + gtk+-2.4.1/gtk/gtkpixmap.c + gtk+-2.4.1/gtk/gtkpixmap.h + gtk+-2.4.1/gtk/gtkpreview.c + gtk+-2.4.1/gtk/gtkpreview.h + gtk+-2.4.1/gtk/gtkprogress.c + gtk+-2.4.1/gtk/gtkprogress.h + gtk+-2.4.1/gtk/gtktext.c + gtk+-2.4.1/gtk/gtktext.h + gtk+-2.4.1/gtk/gtktipsquery.c + gtk+-2.4.1/gtk/gtktipsquery.h + gtk+-2.4.1/gtk/gtktree.c + gtk+-2.4.1/gtk/gtktree.h + gtk+-2.4.1/gtk/gtktreeitem.c + gtk+-2.4.1/gtk/gtktreeitem.h + + + --> + + + + gnome-vfs-2.6.0/libgnomevfs + + gnome-vfs-2.6.0/libgnomevfs/GNOME_VFS_Daemon-common.c + gnome-vfs-2.6.0/libgnomevfs/GNOME_VFS_Daemon.h + gnome-vfs-2.6.0/libgnomevfs/GNOME_VFS_Daemon-skels.c + gnome-vfs-2.6.0/libgnomevfs/GNOME_VFS_Daemon-stubs.c + gnome-vfs-2.6.0/libgnomevfs/gnome-vfs-job.c + gnome-vfs-2.6.0/libgnomevfs/gnome-vfs-job.h - libgnome-2.2.3/libgnome + libgnome-2.6.0/libgnome - libgnomecanvas-2.2.1/libgnomecanvas + libgnomecanvas-2.6.0/libgnomecanvas - libgnomeui-2.2.2/libgnomeui + libgnomeui-2.6.0/libgnomeui - libgnomeprint-2.2.1.3/libgnomeprint + libgnomeprint-2.6.0/libgnomeprint - libgnomeprintui-2.2.1.3/libgnomeprintui - libgnomeprintui-2.2.1.3/libgnomeprintui/gpaui + libgnomeprintui-2.6.0/libgnomeprintui + libgnomeprintui-2.6.0/libgnomeprintui/gpaui @@ -79,14 +121,14 @@ - libglade-2.0.0/glade + libglade-2.3.6/glade - libart_lgpl-2.3.10 + libart_lgpl-2.3.16 @@ -107,7 +149,7 @@ - librsvg-2.2.5 + librsvg-2.6.4 @@ -118,4 +160,11 @@ + + + + gnome-panel-2.6.0/libpanel-applet + + + diff --git a/sources/gtk_tree_model_signal_fix.patch b/sources/gtk_tree_model_signal_fix.patch new file mode 100644 index 000000000..2350379dd --- /dev/null +++ b/sources/gtk_tree_model_signal_fix.patch @@ -0,0 +1,58 @@ +173,180c173,181 +< g_signal_newv ("row_inserted", +< GTK_TYPE_TREE_MODEL, +< G_SIGNAL_RUN_FIRST, +< closure, +< NULL, NULL, +< _gtk_marshal_VOID__BOXED_BOXED, +< G_TYPE_NONE, 2, +< row_inserted_params); +--- +> g_signal_new ("row_inserted", +> GTK_TYPE_TREE_MODEL, +> G_SIGNAL_RUN_FIRST, +> G_STRUCT_OFFSET (GtkTreeModelIface, row_inserted), +> NULL, NULL, +> _gtk_marshal_VOID__BOXED_BOXED, +> G_TYPE_NONE, 2, +> GTK_TYPE_TREE_PATH, +> GTK_TYPE_TREE_ITER); +196,203c197,204 +< g_signal_newv ("row_deleted", +< GTK_TYPE_TREE_MODEL, +< G_SIGNAL_RUN_FIRST, +< closure, +< NULL, NULL, +< _gtk_marshal_VOID__BOXED, +< G_TYPE_NONE, 1, +< row_deleted_params); +--- +> g_signal_new ("row_deleted", +> GTK_TYPE_TREE_MODEL, +> G_SIGNAL_RUN_FIRST, +> G_STRUCT_OFFSET (GtkTreeModelIface, row_deleted), +> NULL, NULL, +> _gtk_marshal_VOID__BOXED, +> G_TYPE_NONE, 1, +> GTK_TYPE_TREE_PATH); +208,215c209,219 +< g_signal_newv ("rows_reordered", +< GTK_TYPE_TREE_MODEL, +< G_SIGNAL_RUN_FIRST, +< closure, +< NULL, NULL, +< _gtk_marshal_VOID__BOXED_BOXED_POINTER, +< G_TYPE_NONE, 3, +< rows_reordered_params); +--- +> g_signal_new ("rows_reordered", +> GTK_TYPE_TREE_MODEL, +> G_SIGNAL_RUN_FIRST, +> G_STRUCT_OFFSET (GtkTreeModelIface, rows_reordered), +> NULL, NULL, +> _gtk_marshal_VOID__BOXED_BOXED_POINTER, +> G_TYPE_NONE, 3, +> GTK_TYPE_TREE_PATH, +> GTK_TYPE_TREE_ITER, +> G_TYPE_POINTER); +> diff --git a/vte/.cvsignore b/vte/.cvsignore index 8cb03aac5..8b64b9528 100644 --- a/vte/.cvsignore +++ b/vte/.cvsignore @@ -1,4 +1,4 @@ -vte-sharp.pc +*.pc AssemblyInfo.cs vte-sharp.dll vte-sharp.dll.config diff --git a/vte/Makefile.am b/vte/Makefile.am index 15a19459b..ee9811029 100644 --- a/vte/Makefile.am +++ b/vte/Makefile.am @@ -2,7 +2,7 @@ if ENABLE_VTE TARGET = $(ASSEMBLY) $(ASSEMBLY).config APIS = $(API) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = vte-sharp.pc +pkgconfig_DATA = vte-sharp-2.0.pc else TARGET = APIS = @@ -15,12 +15,12 @@ ASSEMBLY_NAME = vte-sharp references = /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gtk/gtk-sharp.dll ASSEMBLY = $(ASSEMBLY_NAME).dll -gapidir = $(datadir)/gapi +gapidir = $(datadir)/gapi-2.0 noinst_DATA = $(TARGET) gapi_DATA = $(APIS) CLEANFILES = $(ASSEMBLY) generated-stamp generated/*.cs $(API) gtk-sharp.snk -DISTCLEANFILES = vte-sharp.pc $(ASSEMBLY).config AssemblyInfo.cs +DISTCLEANFILES = vte-sharp-2.0.pc $(ASSEMBLY).config AssemblyInfo.cs sources = @@ -37,7 +37,7 @@ EXTRA_DIST = \ $(METADATA) \ $(customs) \ $(sources) \ - vte-sharp.pc.in + vte-sharp-2.0.pc.in $(API): $(srcdir)/$(RAW_API) $(srcdir)/$(METADATA) cp $(srcdir)/$(RAW_API) $(API) diff --git a/vte/vte-sharp.pc.in b/vte/vte-sharp-2.0.pc.in similarity index 62% rename from vte/vte-sharp.pc.in rename to vte/vte-sharp-2.0.pc.in index a261627e3..d7e4777f0 100644 --- a/vte/vte-sharp.pc.in +++ b/vte/vte-sharp-2.0.pc.in @@ -6,5 +6,5 @@ libdir=${exec_prefix}/lib Name: Vte# Description: Vte# - libvte .NET Binding Version: @VERSION@ -Requires: gnome-sharp -Libs: -r:${libdir}/mono/@PACKAGE@/vte-sharp.dll +Requires: gnome-sharp-2.0 +Libs: -r:${libdir}/mono/@PACKAGE_VERSION@/vte-sharp.dll diff --git a/vte/vte-sharp.dll.config.in b/vte/vte-sharp.dll.config.in index 362762f58..a06e9ad3e 100644 --- a/vte/vte-sharp.dll.config.in +++ b/vte/vte-sharp.dll.config.in @@ -1,4 +1,5 @@ +