Merge pull request #7 from bl8/fix-warnings

Various fixes for warnings during codegen, compilation and in the samples
This commit is contained in:
Mike Kestner 2011-06-29 17:49:37 -07:00
commit 094e6ce29d
4 changed files with 36 additions and 15 deletions

View File

@ -41,7 +41,7 @@
GLib.Marshaller.Free (native);
}
public new void Toggle() {
public void Toggle() {
Active = !Active;
}

View File

@ -130,6 +130,7 @@
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']/return-type" name="element_type">gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFiles']/return-type" name="element_type">GFile*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetPreviewFilename']" name="win32_utf8_variant">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetPreviewFilename']/return-type" name="type">gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method/parameters/*[@name='filename']" name="type">const-gfilename*</attr>
@ -155,15 +156,31 @@
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='SetFilename']" name="win32_utf8_variant">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='UnselectFilename']" name="win32_utf8_variant">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@name='AddShortcutFolder']" name="win32_utf8_variant">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@name='GetFiles']/return-type" name="element_type">GFile*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='get_file_system']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@name='ListFilters']" name="name">GetFilters</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_filters']/return-type" name="element_type">gchar*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_filters']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_filters']/return-type" name="element_type">GtkFileFilter*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_filters']/return-type" name="elements_owned">false</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_filters']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@name='ListShortcutFolders']" name="name">GetShortcutFolders</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_shortcut_folders']/return-type" name="element_type">gchar*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_shortcut_folders']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/virtual_method[@cname='list_shortcut_folders']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/method[@name='GetItems']/return-type" name="element_type">GtkRecentInfo*</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/method[@name='GetItems']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/method[@name='GetItems']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/method[@name='ListFilters']" name="name">GetFilters</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/method[@cname='gtk_recent_chooser_list_filters']/return-type" name="element_type">GtkRecentFilter*</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/method[@cname='gtk_recent_chooser_list_filters']/return-type" name="elements_owned">false</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/method[@cname='gtk_recent_chooser_list_filters']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@name='GetItems']/return-type" name="element_type">GtkRecentInfo*</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@name='GetItems']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@name='GetItems']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@name='GetRecentManager']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@name='ListFilters']" name="name">GetFilters</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@cname='list_filters']/return-type" name="element_type">GtkRecentFilter*</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@cname='list_filters']/return-type" name="elements_owned">false</attr>
<attr path="/api/namespace/interface[@cname='GtkRecentChooser']/virtual_method[@cname='list_filters']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='Foreach']/*/*[@name='func']" name="scope">call</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/*[@name='GetIterFirst']/*/*[@name='iter']" name="pass_as">out</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='Get']" name="hidden">1</attr>
@ -226,6 +243,7 @@
<attr path="/api/namespace/object[@cname='GtkAdjustment']/constructor[@cname='gtk_adjustment_new']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkAdjustment']/method[@name='Changed']" name="name">Change</attr>
<attr path="/api/namespace/object[@cname='GtkAdjustment']/method[@name='ValueChanged']" name="name">ChangeValue</attr>
<attr path="/api/namespace/object[@cname='GtkApplication']/method[@name='GetWindows']/return-type" name="element_type">GtkWindow*</attr>
<attr path="/api/namespace/object[@cname='GtkArrow']/method[@name='Set']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkBin']/method[@name='GetChild']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkBuilder']/method[@name='AddFromFile']/*/*[@name='filename']" name="type">const-gfilename*</attr>

View File

@ -39,3 +39,9 @@
return (Compare (o as TreePath) == 0);
}
public override int GetHashCode ()
{
return ToString ().GetHashCode ();
}

View File

@ -63,7 +63,7 @@ class PolarFixed : Container {
// The default is "GLib.GType.None", which technically means that no (new)
// children can be added to the container, though Container.Add does not
// enforce this.
public override GLib.GType ChildType ()
protected override GLib.GType OnChildType ()
{
return Gtk.Widget.GType;
}
@ -128,17 +128,18 @@ class PolarFixed : Container {
void OnSizeRequested (ref Requisition req)
{
Requisition childReq;
int child_width, child_minwidth, child_height, child_minheight;
int x, y;
req.Width = req.Height = 0;
foreach (PolarFixedChild pfc in children) {
// Recursively SizeRequest each child
childReq = pfc.Child.SizeRequest ();
// Recursively request the size of each child
pfc.Child.GetPreferredWidth (out child_minwidth, out child_width);
pfc.Child.GetPreferredHeight (out child_minheight, out child_height);
// Figure out where we're going to put it
x = (int)(Math.Cos (pfc.Theta) * pfc.R) + childReq.Width / 2;
y = (int)(Math.Sin (pfc.Theta) * pfc.R) + childReq.Height / 2;
x = (int)(Math.Cos (pfc.Theta) * pfc.R) + child_width / 2;
y = (int)(Math.Sin (pfc.Theta) * pfc.R) + child_height / 2;
// Update our own size request to fit it
if (req.Width < 2 * x)
@ -159,7 +160,7 @@ class PolarFixed : Container {
// aren't allocated enough room.
protected override void OnSizeAllocated (Rectangle allocation)
{
Requisition childReq;
Requisition childReq, childMinReq;
int cx, cy, x, y;
// This sets the "Allocation" property. For widgets that
@ -171,11 +172,7 @@ class PolarFixed : Container {
cy = allocation.Y + (allocation.Height / 2);
foreach (PolarFixedChild pfc in children) {
// Use ChildRequisition rather than SizeRequest(),
// to ask for "what this child requested in the
// last SizeRequest", rather than having it
// compute it anew.
childReq = pfc.Child.ChildRequisition;
pfc.Child.GetPreferredSize (out childMinReq, out childReq);
x = (int)(Math.Cos (pfc.Theta) * pfc.R) - childReq.Width / 2;
y = (int)(Math.Sin (pfc.Theta) * pfc.R) + childReq.Height / 2;