moving from GtkArg to GParamspec

I have a problem moving my application from gtk-1 to gtk-2 (please suggest alternatives to my approach if you see it suitable):

To save a file (which basically contains my GUI + data), I go though my containers and children, and I save my file a in a format that looks something like this:

 <sgp:Object Type="SGplot">
   <sgp:Arg Name="SGplot::name" Type="11" Value="SciGraphica: Test"/>
   <sgp:Arg Name="SGplot::orientation" Type="12" Value="0"/>
   <sgp:Arg Name="SGplot::page_size" Type="5" Value="0"/>
   <sgp:Arg Name="SGplot::page_width" Type="5" Value="612"/>
   <sgp:Arg Name="SGplot::page_height" Type="5" Value="792"/>
   <sgp:Arg Name="SGplot::page_units" Type="12" Value="1"/>
   <sgp:Arg Name="SGplot::scale" Type="10" Value="6.500000e-01"/>
   <sgp:Arg Name="SGplot::antialias" Type="4" Value="0"/>

Now, when I move to gtk-2 and I use GParamSpec instead of GtkArg, I get something like this:

 <sgp:Object Type="SGplot">
   <sgp:Arg Name="width-request" Type="5" Value="398"/>
   <sgp:Arg Name="height-request" Type="5" Value="515"/>
   <sgp:Arg Name="visible" Type="4" Value="1"/>
   <sgp:Arg Name="sensitive" Type="4" Value="1"/>
   <sgp:Arg Name="app-paintable" Type="4" Value="0"/>
   <sgp:Arg Name="can-focus" Type="4" Value="1"/>
   <sgp:Arg Name="has-focus" Type="4" Value="0"/>
   <sgp:Arg Name="is-focus" Type="4" Value="0"/>
   <sgp:Arg Name="can-default" Type="4" Value="0"/>
   <sgp:Arg Name="has-default" Type="4" Value="0"/>

My problems:

1) I don't know a way to distinguish between the properties coming from SGplot and those coming from GtkContainer, GtkLayer, GtkWidget, and all parent classes.

2) My backward compatibility is obviously broken.

Iuse g_object_class_lis_properties to retrieve the values.
Can you suggest a way to retain the class name toghether with the property name, i.e, preserve the arg/property name format? Is there a way to know where (what class)) the property is coming from?
Thank you!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]