diff --git a/ChangeLog b/ChangeLog index ce3da8e414..bbc7ab4681 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2002-05-27 Daniel Elstner + + [ merge from stable ] + + Fixes for #83190 + + * gtk/gtktreedatalist.h (_GtkTreeDataList::data): Add missing + fields to anonymous union: glong, gulong, gint64 and guint64. + This is an internal header file, so it should not affect ABI + or API compatibility. + + * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): + Implement missing support for glong, gulong, gint64 and guint64 + fundamental types. Use data.v_uint instead of data.v_int for + G_TYPE_FLAGS, as GValue does. + (_gtk_tree_data_list_value_to_node): ditto + (_gtk_tree_data_list_node_copy): Add case labels for missing + fundamental types, and reorder them to match the other functions. + (gtk_tree_data_list_compare_func): Implement comparison for + glong, gulong, gint64 and guint64. Use g_value_get_enum() + for G_TYPE_ENUM and g_value_get_flags() for G_TYPE_FLAGS, rather + than accessing them as gint/guint. The G_VALUE_HOLDS() check + probably won't like this. + 2002-05-24 Dave Camp * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ce3da8e414..bbc7ab4681 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,27 @@ +2002-05-27 Daniel Elstner + + [ merge from stable ] + + Fixes for #83190 + + * gtk/gtktreedatalist.h (_GtkTreeDataList::data): Add missing + fields to anonymous union: glong, gulong, gint64 and guint64. + This is an internal header file, so it should not affect ABI + or API compatibility. + + * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): + Implement missing support for glong, gulong, gint64 and guint64 + fundamental types. Use data.v_uint instead of data.v_int for + G_TYPE_FLAGS, as GValue does. + (_gtk_tree_data_list_value_to_node): ditto + (_gtk_tree_data_list_node_copy): Add case labels for missing + fundamental types, and reorder them to match the other functions. + (gtk_tree_data_list_compare_func): Implement comparison for + glong, gulong, gint64 and guint64. Use g_value_get_enum() + for G_TYPE_ENUM and g_value_get_flags() for G_TYPE_FLAGS, rather + than accessing them as gint/guint. The G_VALUE_HOLDS() check + probably won't like this. + 2002-05-24 Dave Camp * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index ce3da8e414..bbc7ab4681 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,27 @@ +2002-05-27 Daniel Elstner + + [ merge from stable ] + + Fixes for #83190 + + * gtk/gtktreedatalist.h (_GtkTreeDataList::data): Add missing + fields to anonymous union: glong, gulong, gint64 and guint64. + This is an internal header file, so it should not affect ABI + or API compatibility. + + * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): + Implement missing support for glong, gulong, gint64 and guint64 + fundamental types. Use data.v_uint instead of data.v_int for + G_TYPE_FLAGS, as GValue does. + (_gtk_tree_data_list_value_to_node): ditto + (_gtk_tree_data_list_node_copy): Add case labels for missing + fundamental types, and reorder them to match the other functions. + (gtk_tree_data_list_compare_func): Implement comparison for + glong, gulong, gint64 and guint64. Use g_value_get_enum() + for G_TYPE_ENUM and g_value_get_flags() for G_TYPE_FLAGS, rather + than accessing them as gint/guint. The G_VALUE_HOLDS() check + probably won't like this. + 2002-05-24 Dave Camp * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ce3da8e414..bbc7ab4681 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,27 @@ +2002-05-27 Daniel Elstner + + [ merge from stable ] + + Fixes for #83190 + + * gtk/gtktreedatalist.h (_GtkTreeDataList::data): Add missing + fields to anonymous union: glong, gulong, gint64 and guint64. + This is an internal header file, so it should not affect ABI + or API compatibility. + + * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): + Implement missing support for glong, gulong, gint64 and guint64 + fundamental types. Use data.v_uint instead of data.v_int for + G_TYPE_FLAGS, as GValue does. + (_gtk_tree_data_list_value_to_node): ditto + (_gtk_tree_data_list_node_copy): Add case labels for missing + fundamental types, and reorder them to match the other functions. + (gtk_tree_data_list_compare_func): Implement comparison for + glong, gulong, gint64 and guint64. Use g_value_get_enum() + for G_TYPE_ENUM and g_value_get_flags() for G_TYPE_FLAGS, rather + than accessing them as gint/guint. The G_VALUE_HOLDS() check + probably won't like this. + 2002-05-24 Dave Camp * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ce3da8e414..bbc7ab4681 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,27 @@ +2002-05-27 Daniel Elstner + + [ merge from stable ] + + Fixes for #83190 + + * gtk/gtktreedatalist.h (_GtkTreeDataList::data): Add missing + fields to anonymous union: glong, gulong, gint64 and guint64. + This is an internal header file, so it should not affect ABI + or API compatibility. + + * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): + Implement missing support for glong, gulong, gint64 and guint64 + fundamental types. Use data.v_uint instead of data.v_int for + G_TYPE_FLAGS, as GValue does. + (_gtk_tree_data_list_value_to_node): ditto + (_gtk_tree_data_list_node_copy): Add case labels for missing + fundamental types, and reorder them to match the other functions. + (gtk_tree_data_list_compare_func): Implement comparison for + glong, gulong, gint64 and guint64. Use g_value_get_enum() + for G_TYPE_ENUM and g_value_get_flags() for G_TYPE_FLAGS, rather + than accessing them as gint/guint. The G_VALUE_HOLDS() check + probably won't like this. + 2002-05-24 Dave Camp * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ce3da8e414..bbc7ab4681 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,27 @@ +2002-05-27 Daniel Elstner + + [ merge from stable ] + + Fixes for #83190 + + * gtk/gtktreedatalist.h (_GtkTreeDataList::data): Add missing + fields to anonymous union: glong, gulong, gint64 and guint64. + This is an internal header file, so it should not affect ABI + or API compatibility. + + * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): + Implement missing support for glong, gulong, gint64 and guint64 + fundamental types. Use data.v_uint instead of data.v_int for + G_TYPE_FLAGS, as GValue does. + (_gtk_tree_data_list_value_to_node): ditto + (_gtk_tree_data_list_node_copy): Add case labels for missing + fundamental types, and reorder them to match the other functions. + (gtk_tree_data_list_compare_func): Implement comparison for + glong, gulong, gint64 and guint64. Use g_value_get_enum() + for G_TYPE_ENUM and g_value_get_flags() for G_TYPE_FLAGS, rather + than accessing them as gint/guint. The G_VALUE_HOLDS() check + probably won't like this. + 2002-05-24 Dave Camp * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): diff --git a/gtk/gtktreedatalist.c b/gtk/gtktreedatalist.c index 137de3e27a..301022ebc9 100644 --- a/gtk/gtktreedatalist.c +++ b/gtk/gtktreedatalist.c @@ -133,11 +133,23 @@ _gtk_tree_data_list_node_to_value (GtkTreeDataList *list, case G_TYPE_UINT: g_value_set_uint (value, (guint) list->data.v_uint); break; + case G_TYPE_LONG: + g_value_set_long (value, list->data.v_long); + break; + case G_TYPE_ULONG: + g_value_set_ulong (value, list->data.v_ulong); + break; + case G_TYPE_INT64: + g_value_set_int64 (value, list->data.v_int64); + break; + case G_TYPE_UINT64: + g_value_set_uint64 (value, list->data.v_uint64); + break; case G_TYPE_ENUM: g_value_set_enum (value, list->data.v_int); break; case G_TYPE_FLAGS: - g_value_set_flags (value, (int) list->data.v_int); + g_value_set_flags (value, list->data.v_uint); break; case G_TYPE_FLOAT: g_value_set_float (value, (gfloat) list->data.v_float); @@ -181,14 +193,26 @@ _gtk_tree_data_list_value_to_node (GtkTreeDataList *list, case G_TYPE_INT: list->data.v_int = g_value_get_int (value); break; + case G_TYPE_UINT: + list->data.v_uint = g_value_get_uint (value); + break; + case G_TYPE_LONG: + list->data.v_long = g_value_get_long (value); + break; + case G_TYPE_ULONG: + list->data.v_ulong = g_value_get_ulong (value); + break; + case G_TYPE_INT64: + list->data.v_int64 = g_value_get_int64 (value); + break; + case G_TYPE_UINT64: + list->data.v_uint64 = g_value_get_uint64 (value); + break; case G_TYPE_ENUM: list->data.v_int = g_value_get_enum (value); break; case G_TYPE_FLAGS: - list->data.v_int = g_value_get_flags (value); - break; - case G_TYPE_UINT: - list->data.v_uint = g_value_get_uint (value); + list->data.v_uint = g_value_get_flags (value); break; case G_TYPE_POINTER: list->data.v_pointer = g_value_get_pointer (value); @@ -233,11 +257,17 @@ _gtk_tree_data_list_node_copy (GtkTreeDataList *list, switch (G_TYPE_FUNDAMENTAL (type)) { - case G_TYPE_UINT: - case G_TYPE_INT: - case G_TYPE_UCHAR: - case G_TYPE_CHAR: case G_TYPE_BOOLEAN: + case G_TYPE_CHAR: + case G_TYPE_UCHAR: + case G_TYPE_INT: + case G_TYPE_UINT: + case G_TYPE_LONG: + case G_TYPE_ULONG: + case G_TYPE_INT64: + case G_TYPE_UINT64: + case G_TYPE_ENUM: + case G_TYPE_FLAGS: case G_TYPE_POINTER: case G_TYPE_FLOAT: case G_TYPE_DOUBLE: @@ -323,20 +353,52 @@ gtk_tree_data_list_compare_func (GtkTreeModel *model, else retval = 1; break; + case G_TYPE_LONG: + if (g_value_get_long (&a_value) < g_value_get_long (&b_value)) + retval = -1; + else if (g_value_get_long (&a_value) == g_value_get_long (&b_value)) + retval = 0; + else + retval = 1; + break; + case G_TYPE_ULONG: + if (g_value_get_ulong (&a_value) < g_value_get_ulong (&b_value)) + retval = -1; + else if (g_value_get_ulong (&a_value) == g_value_get_ulong (&b_value)) + retval = 0; + else + retval = 1; + break; + case G_TYPE_INT64: + if (g_value_get_int64 (&a_value) < g_value_get_int64 (&b_value)) + retval = -1; + else if (g_value_get_int64 (&a_value) == g_value_get_int64 (&b_value)) + retval = 0; + else + retval = 1; + break; + case G_TYPE_UINT64: + if (g_value_get_uint64 (&a_value) < g_value_get_uint64 (&b_value)) + retval = -1; + else if (g_value_get_uint64 (&a_value) == g_value_get_uint64 (&b_value)) + retval = 0; + else + retval = 1; + break; case G_TYPE_ENUM: /* this is somewhat bogus. */ - if (g_value_get_int (&a_value) < g_value_get_int (&b_value)) + if (g_value_get_enum (&a_value) < g_value_get_enum (&b_value)) retval = -1; - else if (g_value_get_int (&a_value) == g_value_get_int (&b_value)) + else if (g_value_get_enum (&a_value) == g_value_get_enum (&b_value)) retval = 0; else retval = 1; break; case G_TYPE_FLAGS: /* this is even more bogus. */ - if (g_value_get_uint (&a_value) < g_value_get_uint (&b_value)) + if (g_value_get_flags (&a_value) < g_value_get_flags (&b_value)) retval = -1; - else if (g_value_get_uint (&a_value) == g_value_get_uint (&b_value)) + else if (g_value_get_flags (&a_value) == g_value_get_flags (&b_value)) retval = 0; else retval = 1; diff --git a/gtk/gtktreedatalist.h b/gtk/gtktreedatalist.h index 16997d4856..d5708f06d2 100644 --- a/gtk/gtktreedatalist.h +++ b/gtk/gtktreedatalist.h @@ -35,6 +35,10 @@ struct _GtkTreeDataList gint8 v_char; guint8 v_uchar; guint v_uint; + glong v_long; + gulong v_ulong; + gint64 v_int64; + guint64 v_uint64; gfloat v_float; gdouble v_double; gpointer v_pointer;