Author: danw
Date: 2005-04-28 15:24:46 -0400 (Thu, 28 Apr 2005)
New Revision: 43738
Modified:
trunk/stetic/ChangeLog
trunk/stetic/glue/custom.c
trunk/stetic/libstetic/GladeUtils.cs
trunk/stetic/libstetic/wrapper/Expander.cs
trunk/stetic/libstetic/wrapper/Frame.cs
trunk/stetic/libstetic/wrapper/Paned.cs
Log:
* libstetic/GladeUtils.cs (PropToString): switch based on the type
of value, not on prop.PropertyType, since they might not match
(eg, if UseUnderlying is set).
(GetProps): skip props that aren't visible on a given wrapper
* glue/custom.c: define the last_modification_time property to
avoid warnings on glade import
* libstetic/wrapper/Expander.cs:
* libstetic/wrapper/Frame.cs (GladeExportChild): implement
* libstetic/wrapper/Paned.cs: Remove MaxPosition/MinPosition from
the Pane Properties; they're not writable.
Modified: trunk/stetic/ChangeLog
===================================================================
--- trunk/stetic/ChangeLog 2005-04-28 18:31:21 UTC (rev 43737)
+++ trunk/stetic/ChangeLog 2005-04-28 19:24:46 UTC (rev 43738)
@@ -1,3 +1,19 @@
+2005-04-28 Dan Winship <[EMAIL PROTECTED]>
+
+ * libstetic/GladeUtils.cs (PropToString): switch based on the type
+ of value, not on prop.PropertyType, since they might not match
+ (eg, if UseUnderlying is set).
+ (GetProps): skip props that aren't visible on a given wrapper
+
+ * glue/custom.c: define the last_modification_time property to
+ avoid warnings on glade import
+
+ * libstetic/wrapper/Expander.cs:
+ * libstetic/wrapper/Frame.cs (GladeExportChild): implement
+
+ * libstetic/wrapper/Paned.cs: Remove MaxPosition/MinPosition from
+ the Pane Properties; they're not writable.
+
2005-04-26 Dan Winship <[EMAIL PROTECTED]>
* glue/Makefile.am (pkglib_LTLIBRARIES): install libsteticglue.la
Modified: trunk/stetic/glue/custom.c
===================================================================
--- trunk/stetic/glue/custom.c 2005-04-28 18:31:21 UTC (rev 43737)
+++ trunk/stetic/glue/custom.c 2005-04-28 19:24:46 UTC (rev 43738)
@@ -16,6 +16,7 @@
GType custom_get_type (void);
Custom *custom_new (void);
static void custom_realize (GtkWidget *widget);
+static void custom_set_property (GObject *object, guint prop_id, const GValue
*value, GParamSpec *pspec);
G_DEFINE_TYPE (Custom, custom, GTK_TYPE_DRAWING_AREA)
@@ -23,8 +24,15 @@
custom_class_init (CustomClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ object_class->set_property = custom_set_property;
widget_class->realize = custom_realize;
+
+ g_object_class_install_property (object_class, 1,
+ g_param_spec_string
("last_modification_time",
+ NULL, NULL, NULL,
+
G_PARAM_WRITABLE));
}
static void
@@ -39,6 +47,11 @@
return g_object_new (custom_get_type (), NULL);
}
+static void
+custom_set_property (GObject *object, guint prop_id, const GValue *value,
GParamSpec *pspec)
+{
+}
+
/* from glade */
static char * custom_bg_xpm[] = {
"8 8 4 1",
Modified: trunk/stetic/libstetic/GladeUtils.cs
===================================================================
--- trunk/stetic/libstetic/GladeUtils.cs 2005-04-28 18:31:21 UTC (rev
43737)
+++ trunk/stetic/libstetic/GladeUtils.cs 2005-04-28 19:24:46 UTC (rev
43738)
@@ -318,7 +318,7 @@
adj.Value, adj.Lower,
adj.Upper,
adj.StepIncrement,
adj.PageIncrement,
adj.PageSize);
- } else if (prop.PropertyType.IsEnum && prop.ParamSpec
!= null) {
+ } else if (value is Enum && prop.ParamSpec != null) {
IntPtr klass = g_type_class_ref
(prop.ParamSpec.ValueType);
if (prop.PropertyType.IsDefined (typeof
(FlagsAttribute), false)) {
@@ -350,7 +350,7 @@
IntPtr name = Marshal.ReadIntPtr
(enum_value, Marshal.SizeOf (typeof (IntPtr)));
return GLib.Marshaller.Utf8PtrToString
(name);
}
- } else if (prop.PropertyType == typeof (bool))
+ } else if (value is bool)
return (bool)value ? "True" : "False";
else
return value.ToString ();
@@ -378,6 +378,8 @@
PropertyDescriptor prop = item as
PropertyDescriptor;
if (prop == null || prop.GladeName ==
null)
continue;
+ if (!prop.VisibleFor (wrapper))
+ continue;
string val = PropToString (wrapper,
prop);
if (val != null)
Modified: trunk/stetic/libstetic/wrapper/Expander.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Expander.cs 2005-04-28 18:31:21 UTC (rev
43737)
+++ trunk/stetic/libstetic/wrapper/Expander.cs 2005-04-28 19:24:46 UTC (rev
43738)
@@ -41,6 +41,19 @@
return base.GladeImportChild (className, id,
props, childprops);
}
+ public override void GladeExportChild (Widget wrapper, out
string className,
+ out string internalId,
out string id,
+ out Hashtable props,
+ out Hashtable childprops)
+ {
+ base.GladeExportChild (wrapper, out className, out
internalId,
+ out id, out props, out
childprops);
+ if (wrapper.Wrapped == expander.LabelWidget) {
+ childprops = new Hashtable ();
+ childprops["type"] = "label_item";
+ }
+ }
+
Gtk.Expander expander {
get {
return (Gtk.Expander)Wrapped;
Modified: trunk/stetic/libstetic/wrapper/Frame.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Frame.cs 2005-04-28 18:31:21 UTC (rev
43737)
+++ trunk/stetic/libstetic/wrapper/Frame.cs 2005-04-28 19:24:46 UTC (rev
43738)
@@ -22,9 +22,13 @@
public override void Wrap (object obj, bool initialized)
{
base.Wrap (obj, initialized);
- if (!initialized) {
- Gtk.Frame frame = (Gtk.Frame)Wrapped;
+ if (!initialized)
frame.Label = frame.Name;
+ }
+
+ Gtk.Frame frame {
+ get {
+ return (Gtk.Frame)Wrapped;
}
}
@@ -32,11 +36,23 @@
{
if (childprops.Count == 1 &&
((string)childprops["type"]) == "label_item") {
ObjectWrapper wrapper =
Stetic.ObjectWrapper.GladeImport (stetic, className, id, props);
- Gtk.Frame frame = (Gtk.Frame)Wrapped;
frame.LabelWidget = (Gtk.Widget)wrapper.Wrapped;
return (Widget)wrapper;
} else
return base.GladeImportChild (className, id,
props, childprops);
}
+
+ public override void GladeExportChild (Widget wrapper, out
string className,
+ out string internalId,
out string id,
+ out Hashtable props,
+ out Hashtable childprops)
+ {
+ base.GladeExportChild (wrapper, out className, out
internalId,
+ out id, out props, out
childprops);
+ if (wrapper.Wrapped == frame.LabelWidget) {
+ childprops = new Hashtable ();
+ childprops["type"] = "label_item";
+ }
+ }
}
}
Modified: trunk/stetic/libstetic/wrapper/Paned.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Paned.cs 2005-04-28 18:31:21 UTC (rev
43737)
+++ trunk/stetic/libstetic/wrapper/Paned.cs 2005-04-28 19:24:46 UTC (rev
43738)
@@ -9,8 +9,6 @@
internal static new void Register (Type type)
{
AddItemGroup (type, "Pane Properties",
- "MinPosition",
- "MaxPosition",
"BorderWidth");
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches