| 1957 |
1959 |
| 1958 /************************************************************************** |
1960 /************************************************************************** |
| 1959 * GntTreeRow GBoxed API |
1961 * GntTreeRow GBoxed API |
| 1960 **************************************************************************/ |
1962 **************************************************************************/ |
| 1961 static GntTreeRow * |
1963 static GntTreeRow * |
| 1962 copy_tree_row(GntTreeRow *row) |
1964 gnt_tree_row_ref(GntTreeRow *row) |
| 1963 { |
1965 { |
| 1964 GntTreeRow *row_new; |
|
| 1965 |
|
| 1966 g_return_val_if_fail(row != NULL, NULL); |
1966 g_return_val_if_fail(row != NULL, NULL); |
| 1967 |
1967 |
| 1968 row_new = g_new(GntTreeRow, 1); |
1968 row->box_count++; |
| 1969 *row_new = *row; |
1969 |
| 1970 |
1970 return row; |
| 1971 return row_new; |
1971 } |
| |
1972 |
| |
1973 static void |
| |
1974 gnt_tree_row_unref(GntTreeRow *row) |
| |
1975 { |
| |
1976 g_return_if_fail(row != NULL); |
| |
1977 g_return_if_fail(row->box_count >= 0); |
| |
1978 |
| |
1979 if (!row->box_count--) |
| |
1980 free_tree_row(row); |
| 1972 } |
1981 } |
| 1973 |
1982 |
| 1974 GType |
1983 GType |
| 1975 gnt_tree_row_get_type(void) |
1984 gnt_tree_row_get_type(void) |
| 1976 { |
1985 { |
| 1977 static GType type = 0; |
1986 static GType type = 0; |
| 1978 |
1987 |
| 1979 if (type == 0) { |
1988 if (type == 0) { |
| 1980 type = g_boxed_type_register_static("GntTreeRow", |
1989 type = g_boxed_type_register_static("GntTreeRow", |
| 1981 (GBoxedCopyFunc)copy_tree_row, |
1990 (GBoxedCopyFunc)gnt_tree_row_ref, |
| 1982 (GBoxedFreeFunc)free_tree_row); |
1991 (GBoxedFreeFunc)gnt_tree_row_unref); |
| 1983 } |
1992 } |
| 1984 |
1993 |
| 1985 return type; |
1994 return type; |
| 1986 } |
1995 } |