Commit graph

3680 commits

Author SHA1 Message Date
Bertrand Lorentz
654b81c9f4 Merge pull request #64 from knocte/master
generator: fix possible unhandled KeyNotFoundException (regression)
2013-08-25 10:32:50 -07:00
Andrés G. Aragoneses
6f16031661 glib: fix NRE regression after interface naming changed
ListBase was throwing a NullReferenceException in DataMarshal() due
to the fact that Reflection was being used to find the adapter name
of the interface generated by the bindings, which has recently
changed [1].

[1] 6cb03440c1
2013-08-24 00:11:05 +02:00
Andrés G. Aragoneses
74b6340d86 MSBuild: update some project files to account for recent changes 2013-08-23 23:56:23 +02:00
Andrés G. Aragoneses
9327d7d085 generator: fix possible unhandled KeyNotFoundException (regression)
This regression surfaced after 82a957bc9d [1],
when many collections were migrated to generic collections. HashTables
simply return null when queried for certain key, while Dictionary objects
throw KeyNotFoundException.

The regression could be noticed, more particularly, when trying to
compile the gtk3 branch of the gudevsharp project [2].

[1] 82a957bc9d
[2] https://github.com/mono/gudev-sharp/commits/gtk3
2013-08-23 22:09:06 +02:00
Andrés G. Aragoneses
4046a4c4bd generator: avoid double lookup in dictionary when DeAlias is called
We can avoid a double lookup in the types dictionary here because the
method TryGetValue() was just called before.
2013-08-23 22:09:06 +02:00
Mike Krüger
6e0efb08f2 cairo: Added SetSourceColor method to Cairo.Context.
Cherry-picked from the gtk-sharp-2.12 branch.
2013-08-18 18:38:54 +02:00
Bertrand Lorentz
6352e7d2db build: Update and remove some obsolete automake macro calls 2013-08-18 18:32:21 +02:00
Jeffrey Stedfast
d3c1826c37 gtk: Handle a null Gdk.Event passed to CellRenderer.StartEditing()
Cherry-picked from the gtk-sharp-2.12 branch.
2013-08-18 18:32:21 +02:00
Alan McGovern
100696b5c1 gdk: It is valid to pass a null gdk_event sometimes
For example gtk_drag_start allows a null Gdk.Event so we need to marshal
it to IntPtr.Zero instead of throwing a NullReferenceException

Cherry-picked from the gtk-sharp-2.12 branch.
2013-08-18 18:32:05 +02:00
Bertrand Lorentz
01520a9859 cairo: Don't disable the deprecation warnings during compilation
This makes the "#pragma warning disable 612" in Pattern.cs that were
removed previously actually useful, so we add it back.
2013-07-26 18:46:43 -05:00
Bertrand Lorentz
07dc9f6176 cairo: Remove superfluous #pragma in Pattern.cs 2013-07-26 17:43:27 -05:00
Bertrand Lorentz
ebc5c048b4 Update Cairo samples for the latest API changes 2013-07-26 17:43:27 -05:00
Wolfgang Steffens
796cd1e8a1 cairo: Fix text API calls
The native functions require a NULL-terminated string of text encoded in
UTF-8.

This change is merged from Mono.Cairo in mono 3.2.
2013-07-26 17:43:27 -05:00
Bertrand Lorentz
21ce761271 cairo: Fix some whitespace and code formatting issues 2013-07-26 17:43:26 -05:00
Michael Hutchinson
c77fa9d048 cairo: Don't log warnings during VM shutdown
Else it can explode pretty badly if the Console streams are
finalized before the Cairo objects.
2013-07-26 17:43:26 -05:00
Michael Hutchinson
0fd72adae0 cairo: Destroy should suppress finalizer 2013-07-26 17:43:26 -05:00
Bertrand Lorentz
36e2a12bfc cairo: Use getter methods for returning IDisposables
This makes it a bit clearer that the caller is responsible for
disposing IDisposable objects returned from any method.
2013-07-26 17:43:26 -05:00
Michael Hutchinson
bdc2cfdf1d cairo: Clean up Region's Dispose/ctor 2013-07-26 17:43:26 -05:00
Michael Hutchinson
50ee23f0f2 cairo: Make debug more robust 2013-07-26 17:43:26 -05:00
Michael Hutchinson
6e7527cb92 cairo: Put some classes in separate files 2013-07-26 17:43:26 -05:00
Michael Hutchinson
38d1a3f13e cairo: Introduce the concept of reference ownership
Also:
  * improving naming consistency
  * obsolete old/broken stuff
  * clean up tabs/space mix

NOTE: this removes the wrapper caches for Pattern and Surface as
there was no reliable way to clear them.

This is a merge from changes in Mono.Cairo in mono 3.2.
2013-07-26 17:43:11 -05:00
Michael Hutchinson
5a78a5d177 cairo: Add mechanism to debug missing Dispose calls
Enabled by setting a new MONO_CAIRO_DEBUG_DISPOSE environment variable.
2013-07-26 10:34:45 -05:00
Michael Hutchinson
116d9fcc95 cairo: Clean up dispose implementations 2013-07-26 10:10:01 -05:00
Andres G. Aragoneses
99e4257a9f samples: Track API changes (I- interface prefixes)
This includes changes to fix the build.
2013-07-23 12:05:24 -05:00
Andres G. Aragoneses
2e56a23e9f gtk: Track API changes (I- interface prefixes)
This includes changes to fix the build, and changes to custom code that
gets added to the generated code. I.e. TreeModel now becomes ITreeModel
2013-07-23 12:05:24 -05:00
Andres G. Aragoneses
321181b761 gio: Track API changes (I- interface prefixes)
This includes changes to fix the build, and changes to custom code that
gets added to the generated code. I.e. File.cs now becomes IFile.cs
2013-07-23 12:05:24 -05:00
Andres G. Aragoneses
6cb03440c1 generator: generate all interfaces with the "I" prefix (.NET convention)
To be able to do this, Name property of GenBase class is now virtual, so
that it can be overriden in InterfaceGen with the new name.

Adapters, however, are still classes and then need special care as such
(cannot use the 'Name' property anymore), but this improves a bit the
readability of some parts of the code as the *Implementor and *Adapter
suffixes are now concentrated in just two new properties of GenBase and
not repeated all over the place.
2013-07-23 12:05:24 -05:00
Bertrand Lorentz
214532f684 Merge pull request #62 from knocte/automake_warnings
build: fix automake warning about preprocessor C flags
2013-07-23 09:37:18 -07:00
Bertrand Lorentz
a7c335c4c4 Merge pull request #63 from knocte/class_init
glib: avoid a delegate to be GCed which could cause a NRE (bxc#13113)
2013-07-23 08:39:45 -07:00
Andrés G. Aragoneses
6d626a24a7 glib: avoid a delegate to be GCed which caused a NRE (bxc#13113)
What seemed to be a race condition (because of not happenning 100% of
the times) ended up being an early garbage collection of a delegate that
was still referenced by an unmanaged struct without having a managed
counterpart [1].

The consequence of this was a NullReferenceException happening in a line
which didn't have a dereference of a null object. The way to reproduce it
deterministically 100% of the times was setting the env var MONO_NO_SMP.

[1] http://www.mono-project.com/Interop_with_Native_Libraries#Memory_Boundaries
2013-07-17 14:24:02 +02:00
Andrés G. Aragoneses
10d3293d3f build: fix automake warning about preprocessor C flags
With automake version 1.13.2 (which comes in debian testing/jessie),
we were starting to get these warnings by default:

...
Running automake --foreign  ...
atk/glue/Makefile.am:16: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
gio/glue/Makefile.am:11: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
gtk/glue/Makefile.am:18: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
gtk/gui-thread-check/profiler/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
pango/glue/Makefile.am:13: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
sample/opaquetest/Makefile.am:18: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
sample/valtest/Makefile.am:18: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
Running autoconf ...
...

We simply follow the warning's recommendation of using AM_CPPFLAGS instead
(CPP meaning C PreProcessor, not C Plus Plus), as explained in
http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html

The deprecation of INCLUDES has been very long there already (since 2002,
therefore Automake 1.7), and we already depend on automake 1.10.
2013-06-17 10:59:28 +02:00
Bertrand Lorentz
e8f4eca14e Merge pull request #61 from knocte/class_init
glib: install interfaces earlier, override properties in class_init
2013-05-20 08:51:03 -07:00
Bertrand Lorentz
05f67db2ee gdk: Hide Global.TextPropertyToUtf8ListForDisplay method
It is implemented manually in TextProperty.ToStringListForDisplay.
2013-04-21 16:54:48 +02:00
Bertrand Lorentz
5e3b720408 gdk: Remove invalid method and P/Invoke in TextProperty
The native functions gdk_free_text_list and
gdk_text_property_to_utf8_list are gone, and we now need to use StrFreeV
to free the native string list.
2013-04-21 16:50:37 +02:00
Bertrand Lorentz
bc0aee1328 gdk: Remove invalid Global.DevicesList method
The native function gdk_devices_list is gone, device handling is now
handled through DeviceManager.
2013-04-21 16:42:18 +02:00
Bertrand Lorentz
2d34ed8351 gtk: Remove unused P/Invoke in IconTheme
Now that it uses the Marshaller, IconTheme doesn't call g_strfreev
directly anymore.
2013-04-21 16:39:52 +02:00
Bertrand Lorentz
7160437532 gtk: Remove invalid FileChooserDialog constructor
The ..._new_with_backend native function has been removed, so the
corresponding constructor must be removed.
2013-04-21 16:19:10 +02:00
Bertrand Lorentz
f14eee3eb6 gtk: Fixup AccelMap.LookupEntry to have key as an out param (bxc#11367) 2013-04-21 14:39:18 +02:00
Bertrand Lorentz
eb5e9c7b74 gtk: Remove TreeViewColumn.CellRenderers property (bxc#8593)
The corresponding native function is gone in GTK 3, replaced by
gtk_cell_layout_get_cells.
2013-04-21 13:50:48 +02:00
Andres G. Aragoneses
cb4c7d95ea glib: move some GLib.Object private methods to ClassInitializer class
Refactoring: moving these methods from GLib.Object to ClassInitializer
brings some benefits:
* We can mark OverrideHandlers as private instead of internal.
* We reduce the number of parameters to zero by making them use fields.
* We can make the god GLib.Object class a bit smaller.
* We can make the ClassInitializer.Idx counter private instead of internal.
2013-04-07 08:17:44 +01:00
Andres G. Aragoneses
9ff7ec8b2c glib: install interfaces earlier, override properties in class_init
GObject upstream has started disabling support for installing interfaces
in GTypes after they have already been initialized (class_init) [1], so
we need to add GInterfaces a bit earlier (*before* class_init starts).

As GLib.Object.OverrideProperty() cannot to be called before class_init
(because it receives a GObjectClass, not a GType) or after (because
otherwise class_init would complain about properties of an interface not
being defined), then we need to call it during class_init.

[1] http://bugzilla.gnome.org/687659

A good side-effect of this fix is that we no longer use the hacky uint
field 'idx' to track the properties count for each class; now it gets
moved to the ClassInitializer class, and thus can be non-static, which
makes a bit more sense (we leave the old OverrideProperty overload for
backwards compatibility).

Simplest way to test this is launching the sample/treemodeldemo.exe and
sample/custom-scrollable.exe in Ubuntu 13.04 beta (which has GLib 2.36).
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=11510
2013-04-07 07:51:30 +01:00
Andres G. Aragoneses
1a1300c762 gio: Add fix-ups for GSettings.GetStrv and SetStrv values
The values handled by those two methods are null-terminated arrays of
strings, owned by the caller, so mark them as such.

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2013-04-01 11:41:43 +02:00
Bertrand Lorentz
2b03787ac0 audit: Add a README file 2013-03-29 19:17:54 +01:00
Bertrand Lorentz
7da6eb1fa4 Add audit/data to .gitignore
If you generate audit data that does not belong in source control, put
it in audit/data, it will be ignored by git.
2013-03-29 18:58:23 +01:00
Bertrand Lorentz
00aaa79ec1 build: Output a message when configure checks if we're on Windows 2013-03-29 18:30:12 +01:00
Bertrand Lorentz
f4a1672c87 audit: Use dmcs as a compiler for the audit tools
This is what works for me, but you might want to change this for your
system.
2013-03-29 18:18:28 +01:00
Bertrand Lorentz
0830c50604 Add an audit.csproj to the MonoDevelop solution 2013-03-29 17:57:34 +01:00
Bertrand Lorentz
2a7d26a8b0 audit: Add gen-apidiff-html tool to generate apidiff reports
The gen-apidiff-html tool takes all apidiff files in a directory, merges
them and then applies mono-api.xsl to produce a nice HTML page that
shows the information about the API changes.

The various resources needed by the HTML page (images, CSS, javascript)
are added in the html/ directory.

This is all adapted from an older version of the tools in Mono git
master, under mcs/tools/corcompare.
2013-03-29 17:50:07 +01:00
Bertrand Lorentz
1eb786c735 audit: Refresh utilities using code from Mono git master
Copy latest versions of mono-api-info.cs and mono-api-diff.cs from Mono
git master, along with associated classes. As a consequence,
mono-api-info.cs now depends on Mono.Cecil.

Do the necessary adaptation for our use case: we do API comparison
between version of our assemblies.
2013-03-29 17:35:07 +01:00
Andres G. Aragoneses
88bb31bfa7 glib: Use GTHREAD preprocessor flag with old versions of glib
We switch the logic from DISABLE_GTHREAD_CHECK to ENABLE_GTHREAD_INIT
to make the define clearer, and so that it is actually needed when using
older versions of glib, not newer.

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2013-03-24 11:37:22 +01:00