]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkstyleproperty.c
label: refactor code
[~andy/gtk] / gtk / gtkstyleproperty.c
index be86c97e5aef045c20a738d8fd90ce11e0ae67a9..74245d6ce2b59bbcdeee637bed9822123643a8b6 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -133,9 +131,7 @@ _gtk_style_property_init (GtkStyleProperty *property)
 /**
  * _gtk_style_property_parse_value:
  * @property: the property
- * @value: an uninitialized value
  * @parser: the parser to parse from
- * @base: the base file for @aprser
  *
  * Tries to parse the given @property from the given @parser into
  * @value. The type that @value will be assigned is dependant on
@@ -144,26 +140,23 @@ _gtk_style_property_init (GtkStyleProperty *property)
  * left uninitialized.
  *
  * Only if @property is a #GtkCssShorthandProperty, the @value will
- * always contain a #GValueArray with the values to be used for
- * the subproperties.
+ * always be a #GtkCssValue whose values can be queried with
+ * _gtk_css_array_value_get_nth().
  *
- * Returns: %TRUE on success
+ * Returns: %NULL on failure or the parsed #GtkCssValue
  **/
-gboolean
+GtkCssValue *
 _gtk_style_property_parse_value (GtkStyleProperty *property,
-                                 GValue           *value,
-                                 GtkCssParser     *parser,
-                                 GFile            *base)
+                                 GtkCssParser     *parser)
 {
   GtkStylePropertyClass *klass;
 
-  g_return_val_if_fail (GTK_IS_STYLE_PROPERTY (property), FALSE);
-  g_return_val_if_fail (value != NULL, FALSE);
-  g_return_val_if_fail (parser != NULL, FALSE);
+  g_return_val_if_fail (GTK_IS_STYLE_PROPERTY (property), NULL);
+  g_return_val_if_fail (parser != NULL, NULL);
 
   klass = GTK_STYLE_PROPERTY_GET_CLASS (property);
 
-  return klass->parse_value (property, value, parser, base);
+  return klass->parse_value (property, parser);
 }
 
 /**
@@ -198,32 +191,30 @@ _gtk_style_property_assign (GtkStyleProperty   *property,
 /**
  * _gtk_style_property_query:
  * @property: the property
- * @props: The properties to query
- * @state: The state to query
  * @value: (out): an uninitialized #GValue to be filled with the
  *   contents of the lookup
+ * @query_func: The function to use to query properties
+ * @query_data: The data to pass to @query_func
  *
  * This function is called by gtk_style_properties_get() and in
  * turn gtk_style_context_get() and similar functions to get the
  * value to return to code using old APIs.
  **/
 void
-_gtk_style_property_query (GtkStyleProperty        *property,
-                           GtkStyleProperties      *props,
-                           GtkStateFlags            state,
-                           GValue                  *value)
+_gtk_style_property_query (GtkStyleProperty  *property,
+                           GValue            *value,
+                           GtkStyleQueryFunc  query_func,
+                           gpointer           query_data)
 {
   GtkStylePropertyClass *klass;
 
-  g_return_if_fail (property != NULL);
-  g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
   g_return_if_fail (value != NULL);
+  g_return_if_fail (GTK_IS_STYLE_PROPERTY (property));
+  g_return_if_fail (query_func != NULL);
 
   klass = GTK_STYLE_PROPERTY_GET_CLASS (property);
 
-  g_value_init (value, property->value_type);
-
-  klass->query (property, props, state, value);
+  return klass->query (property, value, query_func, query_data);
 }
 
 void