[glade3/offscreen-gtk3: 78/78] * plugins/gtk+/glade-gtk.c: Removing some combobox entry stuff, reenabling the fixed_layout stuf



commit 2a8c0ad8c699faee2b669899fefead6017ff01ce
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Dec 22 18:35:21 2010 +0900

    	* plugins/gtk+/glade-gtk.c: Removing some combobox entry stuff, reenabling
    	  the fixed_layout stuff
    
    	* plugins/gtk+/gtk+.xml.in: Removing Ruler classes, added GtkBox, GtkPaned, GtkButtonBox
    	  base classes that are now instantiatable

 ChangeLog                |    6 ++++
 plugins/gtk+/glade-gtk.c |   61 ++++++++++++--------------------------
 plugins/gtk+/gtk+.xml.in |   73 +++++++++++----------------------------------
 3 files changed, 43 insertions(+), 97 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b531c4b..e40b3c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,12 @@
 	* Making offscreen-gtk3 branch compile again after merging master,
 	  also making libgladeui library libgladeui-2.
 
+	* plugins/gtk+/glade-gtk.c: Removing some combobox entry stuff, reenabling
+	  the fixed_layout stuff
+
+	* plugins/gtk+/gtk+.xml.in: Removing Ruler classes, added GtkBox, GtkPaned, GtkButtonBox
+	  base classes that are now instantiatable
+
 2010-12-22  Tristan Van Berkom <tristanvb openismus com>
 
 	* gladeui/glade-project.[ch]: Removed dialog and added "load-progress" signal
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 64e8db1..16efc29 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -4959,17 +4959,19 @@ glade_gtk_entry_read_widget (GladeWidgetAdaptor *adaptor,
 	glade_property_sync (property);
 }
 
-#if 0
 /* ----------------------------- GtkFixed/GtkLayout ------------------------------ */
+#if 0
 static void
 glade_gtk_fixed_layout_finalize(GdkPixmap *backing)
 {
 	g_object_unref(backing);
 }
+#endif
 
 static void
 glade_gtk_fixed_layout_realize (GtkWidget *widget)
 {
+#if _FIXME_FIXME_CAIRO_
 	GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (fixed_bg_xpm);
 	GdkPixmap *backing;
 
@@ -4981,11 +4983,11 @@ glade_gtk_fixed_layout_realize (GtkWidget *widget)
 	else
 		gdk_window_set_back_pixmap (gtk_widget_get_window (widget), backing, FALSE);
 
-
 	/* For cleanup later
 	 */
 	g_object_weak_ref(G_OBJECT(widget), 
 			  (GWeakNotify)glade_gtk_fixed_layout_finalize, backing);
+#endif
 }
 
 static void
@@ -5056,7 +5058,6 @@ glade_gtk_fixed_layout_remove_child (GladeWidgetAdaptor  *adaptor,
 
 	gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
 }
-#endif
 
 /* ----------------------------- GtkWindow ------------------------------ */
 static void
@@ -8858,6 +8859,11 @@ glade_gtk_combo_box_post_create (GladeWidgetAdaptor *adaptor,
 		gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), cell,
 						"text", 0, NULL);
 	}
+
+	if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (object)))
+		glade_widget_adaptor_create_internal
+			(widget, G_OBJECT (gtk_bin_get_child (GTK_BIN (object))),
+			 "entry", "comboboxentry", FALSE, reason);
 }
 
 static void
@@ -8901,6 +8907,12 @@ glade_gtk_combo_box_set_property (GladeWidgetAdaptor *adaptor,
 									  object,
 									  id, value);
 	}
+	else if (!strcmp (id, "text-column"))
+	{
+		if (g_value_get_int (value) >= 0)
+			gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (object), 
+							     g_value_get_int (value));
+	}
 	else
 		GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
 								  object,
@@ -8927,55 +8939,20 @@ glade_gtk_combo_box_get_children (GladeWidgetAdaptor *adaptor, GtkComboBox *comb
 	return list;
 }
 
-/* ----------------------------- GtkComboBoxEntry ------------------------------ */
-void
-glade_gtk_combo_box_entry_post_create (GladeWidgetAdaptor *adaptor,
-				       GObject            *object, 
-				       GladeCreateReason   reason)
-{
-	GladeWidget *gcombo = glade_widget_get_from_gobject (object);
-
-	/* Chain up */
-	GWA_GET_CLASS (GTK_TYPE_CONTAINER)->post_create (adaptor, object, reason);
-
-	glade_widget_adaptor_create_internal
-		(gcombo, G_OBJECT (gtk_bin_get_child (GTK_BIN (object))),
-		 "entry", "comboboxentry", FALSE, reason);
-}
-
 GObject *
-glade_gtk_combo_box_entry_get_internal_child (GladeWidgetAdaptor *adaptor,
-					      GObject *object, 
-					      const gchar *name)
+glade_gtk_combo_box_get_internal_child (GladeWidgetAdaptor *adaptor,
+					GObject *object, 
+					const gchar *name)
 {
 	GObject *child = NULL;
 	g_return_val_if_fail (GTK_IS_COMBO_BOX (object), NULL);
 	
-	if (strcmp ("entry", name) == 0)
+	if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (object)) && strcmp ("entry", name) == 0)
 		child = G_OBJECT (gtk_bin_get_child (GTK_BIN (object)));
 
 	return child;
 }
 
-
-void
-glade_gtk_combo_box_entry_set_property (GladeWidgetAdaptor *adaptor,
-					GObject            *object, 
-					const gchar        *id,
-					const GValue       *value)
-{
-	if (!strcmp (id, "text-column"))
-	{
-		if (g_value_get_int (value) >= 0)
-			gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (object), 
-							     g_value_get_int (value));
-	}
-	else
-		GWA_GET_CLASS (GTK_TYPE_COMBO_BOX)->set_property (adaptor,
-								  object,
-								  id, value);
-}
-
 /* ----------------------------- GtkSpinButton ------------------------------ */
 static void
 glade_gtk_spin_button_set_adjustment (GObject *object, const GValue *value)
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index f6cbee4..c874890 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -293,7 +293,7 @@ embedded in another object</_tooltip>
       </properties>
     </glade-widget-class>
     
-    <glade-widget-class name="GtkBox" _title="Box" fixed="True">
+    <glade-widget-class name="GtkBox" generic-name="box" _title="Box" fixed="True">
       <post-create-function>glade_gtk_box_post_create</post-create-function>
       <get-internal-child-function>glade_gtk_box_get_internal_child</get-internal-child-function>
       <get-children-function>glade_gtk_box_get_children</get-children-function>
@@ -336,6 +336,17 @@ embedded in another object</_tooltip>
         </property>
       </packing-properties>
     </glade-widget-class>
+
+    <glade-widget-class name="GtkHBox" generic-name="hbox" _title="Horizontal Box">
+      <properties>
+	<property id="orientation" disabled="True"/>
+      </properties>
+    </glade-widget-class>
+    <glade-widget-class name="GtkVBox" generic-name="vbox" _title="Vertical Box">
+      <properties>
+	<property id="orientation" disabled="True"/>
+      </properties>
+    </glade-widget-class>
     
     <glade-widget-class name="GtkWindow" generic-name="window" _title="Window" toplevel="True" default-width="440" default-height="250">
       <read-widget-function>glade_gtk_window_read_widget</read-widget-function>
@@ -1107,6 +1118,7 @@ embedded in another object</_tooltip>
       <add-child-function>glade_gtk_cell_layout_add_child</add-child-function>
       <remove-child-function>glade_gtk_cell_layout_remove_child</remove-child-function> 
       <get-children-function>glade_gtk_combo_box_get_children</get-children-function>
+      <get-internal-child-function>glade_gtk_combo_box_get_internal_child</get-internal-child-function>
       <read-child-function>glade_gtk_cell_layout_read_child</read-child-function>
       <write-child-function>glade_gtk_cell_layout_write_child</write-child-function>
       <action-activate-function>glade_gtk_cell_layout_action_activate_as_widget</action-activate-function>
@@ -1156,12 +1168,6 @@ embedded in another object</_tooltip>
       </properties>
     </glade-widget-class>
 
-    <glade-widget-class name="GtkComboBoxEntry" generic-name="comboboxentry" _title="Combo Box Entry">
-      <post-create-function>glade_gtk_combo_box_entry_post_create</post-create-function>
-      <get-internal-child-function>glade_gtk_combo_box_entry_get_internal_child</get-internal-child-function>
-      <set-property-function>glade_gtk_combo_box_entry_set_property</set-property-function>
-    </glade-widget-class>
-
     <glade-widget-class name="GtkProgressBar" generic-name="progressbar" _title="Progress Bar">
       <properties>
         <property id="text" translatable="True"/>
@@ -1240,17 +1246,6 @@ embedded in another object</_tooltip>
 
     </glade-widget-class>
 
-    <glade-widget-class name="GtkHBox" generic-name="hbox" _title="Horizontal Box">
-      <properties>
-	<property id="orientation" disabled="True"/>
-      </properties>
-    </glade-widget-class>
-    <glade-widget-class name="GtkVBox" generic-name="vbox" _title="Vertical Box">
-      <properties>
-	<property id="orientation" disabled="True"/>
-      </properties>
-    </glade-widget-class>
-
     <glade-widget-class name="GtkTable" generic-name="table" _title="Table" fixed="True">
       <post-create-function>glade_gtk_table_post_create</post-create-function>
       <child-set-property-function>glade_gtk_table_set_child_property</child-set-property-function>
@@ -1295,7 +1290,7 @@ embedded in another object</_tooltip>
       </packing-properties>
     </glade-widget-class>
 
-    <glade-widget-class name="GtkPaned" _title="Paned">
+    <glade-widget-class name="GtkPaned" generic-name="paned" _title="Paned">
       <post-create-function>glade_gtk_paned_post_create</post-create-function>
       <add-child-function>glade_gtk_paned_add_child</add-child-function>
       <remove-child-function>glade_gtk_paned_remove_child</remove-child-function>
@@ -1462,7 +1457,7 @@ embedded in another object</_tooltip>
       </properties>
     </glade-widget-class>
 
-    <glade-widget-class name="GtkButtonBox" _title="Button Box">
+    <glade-widget-class name="GtkButtonBox" generic-name="buttonbox" _title="Button Box">
       <properties>
       	<property id="layout-style">
   	  <displayable-values>
@@ -1698,32 +1693,6 @@ embedded in another object</_tooltip>
       </properties>
     </glade-widget-class>
 
-    <glade-widget-class name="GtkRuler" generic-name="ruler" _title="Ruler">
-      <properties>
-	<property default="10.0" id="upper"/>
-	<property default="5.0" id="position"/>
-	<property default="10.0" id="max-size"/>
-        <property id="metric">
-  	  <displayable-values>
-	    <value id="GTK_PIXELS" _name="Pixels"/>
-	    <value id="GTK_INCHES" _name="Inches"/>
-	    <value id="GTK_CENTIMETERS" _name="Centimeters"/>
-	  </displayable-values>
-	</property>
-      </properties>
-    </glade-widget-class>
-
-    <glade-widget-class name="GtkHRuler" generic-name="hruler" _title="Horizontal Ruler">
-      <properties>
-	<property id="orientation" disabled="True"/>
-      </properties>
-    </glade-widget-class>
-    <glade-widget-class name="GtkVRuler" generic-name="vruler" _title="Vertical Ruler">
-      <properties>
-	<property id="orientation" disabled="True"/>
-      </properties>
-    </glade-widget-class>
-
     <glade-widget-class name="GtkColorSelection" generic-name="colorselection" _title="Color Selection"/>
     
     <glade-widget-class name="GtkFontSelection" generic-name="fontselection" _title="Font Selection"/>
@@ -3313,6 +3282,7 @@ embedded in another object</_tooltip>
   </glade-widget-group>
 
   <glade-widget-group name="gtk-containers" _title="Containers">
+    <glade-widget-class-ref name="GtkBox"/>
     <glade-widget-class-ref name="GtkHBox"/>
     <glade-widget-class-ref name="GtkVBox"/>
     <glade-widget-class-ref name="GtkTable"/>
@@ -3321,8 +3291,10 @@ embedded in another object</_tooltip>
     <glade-widget-class-ref name="GtkAspectFrame"/>
     <glade-widget-class-ref name="GtkMenuBar"/>
     <glade-widget-class-ref name="GtkToolbar"/>
+    <glade-widget-class-ref name="GtkPaned"/>
     <glade-widget-class-ref name="GtkHPaned"/>
     <glade-widget-class-ref name="GtkVPaned"/>
+    <glade-widget-class-ref name="GtkButtonBox"/>
     <glade-widget-class-ref name="GtkHButtonBox"/>
     <glade-widget-class-ref name="GtkVButtonBox"/>
     <glade-widget-class-ref name="GtkLayout"/>
@@ -3359,7 +3331,6 @@ embedded in another object</_tooltip>
     <glade-widget-class-ref name="GtkVScrollbar"/>
 
     <glade-widget-class-ref name="GtkComboBox"/>
-    <glade-widget-class-ref name="GtkComboBoxEntry"/>
     <glade-widget-class-ref name="GtkProgressBar"/>
     <glade-widget-class-ref name="GtkSpinner"/>
 
@@ -3425,12 +3396,4 @@ embedded in another object</_tooltip>
     <glade-widget-class-ref name="GtkFileFilter"/>
   </glade-widget-group>
 
-  <glade-widget-group name="gtk-specialized" _title="Specialized Widgets">
-
-    <default-palette-state expanded="False"/>
-
-    <glade-widget-class-ref name="GtkHRuler"/>
-    <glade-widget-class-ref name="GtkVRuler"/>
-  </glade-widget-group>
-
 </glade-catalog>



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