Commit Graph

172 Commits

Author SHA1 Message Date
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Sébastien Wilmet
6b50045f90 Doc: various small fixes
https://bugzilla.gnome.org/show_bug.cgi?id=700007
2013-05-12 18:09:28 +02:00
Matthias Clasen
0b5f12975f Consistently allow -1 to mean 'append' in tree models
Both GtkListStore and GtkTreeStore had a few methods that allowed
-1 to mean 'append' when specified as a position, but others that
demanded positive position arguments. Make this consistent by
always allowing -1.
https://bugzilla.gnome.org/show_bug.cgi?id=667808
2012-07-12 08:42:34 -04:00
Cosimo Cecchi
a24f7564b5 treestore: fix transformation of GValues on set
There are three bugs here:
- we should check if the value type is transformable instead of being
  compatible, since that's all we care about in order to call
  g_value_transform()
- the check is only meaningful in the direction
  passed-in-type->column-type and not viceversa
- we should init the destination GValue to the column type before
  calling g_value_transform on it, or the destination type information
  will be missing and the method will fail

Thanks to Jasper St. Pierre and Colin Walters for all the help in
tracking this down.

https://bugzilla.gnome.org/show_bug.cgi?id=677649
2012-06-07 16:47:11 -04:00
Paolo Borelli
9ff75882c0 Explicitely mention -1 in the insert_with_values docs
-1 means "append". Spell it out like we do for ListStore docs.
2012-03-10 19:37:07 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Matthias Clasen
5ff8fe6971 Documentation fixes
Mostly making sure that return values and varargs don't loose
their docs.
2011-09-25 21:04:49 -04:00
Kristian Rietveld
2f5fbcd10a Make _get_iter invalidate iterators when FALSE is returned 2011-08-22 21:30:29 +02:00
Matthias Clasen
453849acf3 Add a missing include 2011-06-07 18:37:36 -04:00
Javier Jardón
db97f8660a Use faster new G_VALUE_COLLECT_INIT variant instead G_VALUE_COLLECT
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=641621
2011-02-07 13:14:47 +00:00
Pavel Holejsovsky
374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Martin Pitt
85fe2ce17f Gtk{List,Tree}Store: Fix GI array annotations 2011-01-15 15:26:12 -06:00
Szilárd Pfeiffer
8219ed3a26 Add gtk_tree_model_iter_previous() vfunc
https://bugzilla.gnome.org/show_bug.cgi?id=128058
2011-01-05 23:39:11 -05:00
Matthias Clasen
121746605b Add the private struct in class_init 2010-12-17 21:50:18 -05:00
Matthias Clasen
881ea2881d Remove sealed members from GtkTreeStore 2010-12-17 21:45:20 -05:00
Javier Jardón
8f766d36f4 gtktreestore: Move documentation to inline comments 2010-10-23 00:31:36 +02:00
Johan Dahlin
19cab17c22 Add a couple of missing annotations 2010-09-18 13:43:06 -03:00
Tor Lillqvist
801875b805 Replace gtk_debug_flags with getter and setter functions
Preferrably should be made just into a local variable for libgtk like
_gdk_debug_flags for libgdk. But for now used by
gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
2010-09-08 21:31:34 +03:00
Christian Dywan
2a12f74c8e Clarify memory management of tree models
It helps to be explicit about these things.
Bug 609264.
2010-08-09 21:35:26 -04:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Philip Withnall
0b51abbfdf Add (out) annotations to GtkTreeIter parameters 2010-07-07 18:20:37 +02:00
Colin Walters
905f988166 Revert "Add length to gtk_tree_path_get_indices"
This reverts commit eebb16eb1a.

Was an accidental commit.
2010-06-28 14:15:10 -04:00
Colin Walters
eebb16eb1a Add length to gtk_tree_path_get_indices
The old version wasn't introspectable as it didn't have a length
return parameter.  Also, delete gtk_tree_path_get_indices_with_depth,
since it's no longer needed.
2010-06-28 13:50:36 -04:00
Viktor Pracht
ff28ee8e6b [Annotations] Add array length for GtkTreeStore
https://bugzilla.gnome.org/show_bug.cgi?id=603923
2010-02-19 18:58:01 -02:00
Johan Dahlin
fe85272112 [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-02-19 17:57:51 -02:00
Alan Knowles
b193be9003 Add introspection annotations for gtk_tree_model_get_path+gtk_tree_store_newv 2010-02-09 12:27:05 -05:00
Colin Walters
6529c07614 [introspection] Merge in Gtk-custom.c annotations
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GTK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
2009-12-16 17:22:01 -02:00
Javier Jardón
f35c581de4 [gtk/gtktreestore] Remove useless line 2009-12-02 09:36:58 +01:00
Kristian Rietveld
ebc6a00015 Clean up code in gtk_tree_store_set_n_columns()
Clean up GtkTreeStore likewise as Benjamin Otte has done for
GtkListStore in commit 3c97f037.
2009-08-23 22:06:15 +02:00
Kristian Rietveld
d743b2fbea Bug 586374 – code does not follow documentation
Properly invalidate iterators in iter_next, iter_children,
iter_nth_child and iter_parent when FALSE is returned.  ListStore was
actually already mostly in order as the GSequence pointers are very
strictly checked, but to be a little stricter we've added stamp = 0
lines.  TreeStore did not invalidate its iterators, so stamp = 0 lines
were added where appropriate.  Unit tests have been added to check this.

Fixes bug 586374, reported by Mike Gemunde.
2009-07-30 21:23:47 +02:00
Benjamin Otte
adf8db68c7 clarify the init value for the default sort column id
The patch is basically s/-2/GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID/
2009-06-27 11:30:06 +02:00
Matthias Clasen
bd21890280 Add a missing va_end() call. Pointed out by Jiwon Lee.
* gtk/gtktreestore.c (gtk_tree_store_new): Add a missing
        va_end() call. Pointed out by Jiwon Lee.


svn path=/trunk/; revision=22021
2008-12-31 04:15:57 +00:00
Cosimo Cecchi
e3924911b5 Bug 536542 – gtk_list_store_set() documentation doesn't say whether
2008-09-11  Cosimo Cecchi  <cosimoc@gnome.org>

	Bug 536542 – gtk_list_store_set() documentation doesn't say whether
	values are copied.

	* gtk/gtkliststore.c:
	* gtk/gtktreestore.c:
	Explicitly mention in the docs that gtk_[list,tree]_store_set copies
	or keep	a reference of the values.

svn path=/trunk/; revision=21349
2008-09-11 19:31:04 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Michael Natterer
fe8a946e87 deprecate GtkDestroyNotify.
2008-06-18  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktypeutils.h: deprecate GtkDestroyNotify.

	* gtk/gtkactiongroup.[ch]
	* gtk/gtkcombobox.[ch]
	* gtk/gtkcontainer.[ch]
	* gtk/gtkliststore.[ch]
	* gtk/gtkmain.[ch]
	* gtk/gtkmenu.c
	* gtk/gtkstock.[ch]
	* gtk/gtktreedatalist.[ch]
	* gtk/gtktreemodelfilter.[ch]
	* gtk/gtktreemodelsort.[ch]
	* gtk/gtktreeprivate.h
	* gtk/gtktreeselection.[ch]
	* gtk/gtktreesortable.[ch]
	* gtk/gtktreestore.[ch]
	* gtk/gtktreeview.[ch]
	* gtk/gtktreeviewcolumn.[ch]: s/GtkDestroyNotify/GDestroyNotify/g.


svn path=/trunk/; revision=20448
2008-06-18 09:12:32 +00:00
Johan Dahlin
8568de818a Remove an unused variable
* gtk/gtktreestore.c (tree_model_end_element): 
	Remove an unused variable


svn path=/trunk/; revision=19314
2008-01-06 14:58:57 +00:00
Matthias Clasen
4896e24bb1 Require gtk-doc 1.8
2007-11-25  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Require gtk-doc 1.8

        * */*.c: Use gtk-doc abbreviations for examples in docs.


svn path=/trunk/; revision=19041
2007-11-25 06:51:19 +00:00
Matthias Clasen
e888b75e1b Fix the GtkBuildable implementation to allow setting column types.
2007-11-19  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktreestore.c: Fix the GtkBuildable implementation
        to allow setting column types.  (#496795, James Stephenson)



svn path=/trunk/; revision=19001
2007-11-19 05:47:36 +00:00
Johan Dahlin
4d638bf0c1 Add GtkBuilder, fixes #172535
2007-06-15  Johan Dahlin  <jdahlin@async.com.br>

    * demos/gtk-demo/Makefile.am:
    * demos/gtk-demo/builder.c: (quit_activate), (about_activate),
    (do_builder):
    * demos/gtk-demo/demo.ui:
    * docs/reference/gtk/gtk-docs.sgml:
    * docs/reference/gtk/gtk-sections.txt:
    * docs/reference/gtk/gtk.types:
    * docs/reference/gtk/tmpl/gtkbuildable.sgml:
    * docs/reference/gtk/tmpl/gtkbuilder.sgml:
    * gtk/Makefile.am:
    * gtk/gtk.h:
    * gtk/gtk.symbols:
    * gtk/gtkaction.c: (gtk_action_buildable_init),
    (gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
    * gtk/gtkactiongroup.c: (gtk_action_group_get_type),
    (gtk_action_group_buildable_init),
    (gtk_action_group_buildable_add),
    (gtk_action_group_buildable_set_name),
    (gtk_action_group_buildable_get_name):
    * gtk/gtkbuildable.c: (gtk_buildable_get_type),
    (gtk_buildable_set_name), (gtk_buildable_get_name),
    (gtk_buildable_add), (gtk_buildable_set_property),
    (gtk_buildable_parser_finished), (gtk_buildable_construct_child),
    (gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
    (gtk_buildable_custom_finished),
    (gtk_buildable_get_internal_child):
    * gtk/gtkbuildable.h:
    * gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
    (gtk_builder_finalize), (gtk_builder_set_property),
    (gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
    (gtk_builder_real_get_type_from_name),
    (gtk_builder_get_parameters), (gtk_builder_get_internal_child),
    (_gtk_builder_construct), (_gtk_builder_add),
    (apply_delayed_properties), (_gtk_builder_finish),
    (gtk_builder_new), (gtk_builder_add_from_file),
    (gtk_builder_add_from_string), (gtk_builder_get_object),
    (object_add_to_list), (gtk_builder_get_objects),
    (gtk_builder_set_translation_domain),
    (gtk_builder_get_translation_domain),
    (gtk_builder_connect_signals_default),
    (gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
    (gtk_builder_value_from_string),
    (gtk_builder_value_from_string_type),
    (_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
    (gtk_builder_get_type_from_name), (gtk_builder_error_quark):
    * gtk/gtkbuilder.h:
    * gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
    (error_missing_attribute), (error_invalid_attribute),
    (error_invalid_tag), (builder_construct), (parse_object),
    (free_object_info), (_get_type_by_symbol), (parse_child),
    (free_child_info), (parse_property), (free_property_info),
    (parse_signal), (_free_signal_info), (parse_interface),
    (create_subparser), (free_subparser), (subparser_start),
    (subparser_end), (parse_custom), (start_element), (end_element),
    (text), (_gtk_builder_parser_parse_buffer):
    * gtk/gtkbuilderprivate.h:
    * gtk/gtkcelllayout.c: (attributes_start_element),
    (attributes_text_element),
    (_gtk_cell_layout_buildable_custom_tag_start),
    (_gtk_cell_layout_buildable_custom_tag_end),
    (_gtk_cell_layout_buildable_add):
    * gtk/gtkcelllayout.h:
    * gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
    (gtk_cell_view_buildable_custom_tag_start),
    (gtk_cell_view_buildable_custom_tag_end):
    * gtk/gtkcolorseldialog.c:
    (gtk_color_selection_dialog_buildable_interface_init),
    (gtk_color_selection_dialog_buildable_get_internal_child):
    * gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
    (gtk_combo_box_buildable_custom_tag_start),
    (gtk_combo_box_buildable_custom_tag_end):
    * gtk/gtkcomboboxentry.c:
    (gtk_combo_box_entry_buildable_interface_init),
    (gtk_combo_box_entry_buildable_get_internal_child):
    * gtk/gtkcontainer.c: (gtk_container_get_type),
    (gtk_container_buildable_init), (gtk_container_buildable_add),
    (gtk_container_buildable_set_child_property),
    (attributes_start_element), (attributes_text_element),
    (gtk_container_buildable_custom_tag_start),
    (gtk_container_buildable_custom_tag_end):
    * gtk/gtkdebug.h:
    * gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
    (gtk_dialog_buildable_get_internal_child),
    (attributes_start_element), (attributes_text_element),
    (gtk_dialog_buildable_custom_tag_start),
    (gtk_dialog_buildable_custom_finished):
    * gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
    * gtk/gtkexpander.c: (gtk_expander_buildable_add),
    (gtk_expander_buildable_init):
    * gtk/gtkfontsel.c:
    (gtk_font_selection_dialog_buildable_interface_init),
    (gtk_font_selection_dialog_buildable_get_internal_child):
    * gtk/gtkframe.c: (gtk_frame_buildable_init),
    (gtk_frame_buildable_add):
    * gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
    (gtk_icon_view_buildable_custom_tag_start),
    (gtk_icon_view_buildable_custom_tag_end):
    * gtk/gtkliststore.c: (gtk_list_store_buildable_init),
    (list_store_start_element), (list_store_end_element),
    (list_store_text), (gtk_list_store_buildable_custom_tag_start),
    (gtk_list_store_buildable_custom_tag_end):
    * gtk/gtkmain.c:
    * gtk/gtknotebook.c: (gtk_notebook_buildable_init),
    (gtk_notebook_buildable_add):
    * gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
    (size_group_start_element),
    (gtk_size_group_buildable_custom_tag_start),
    (gtk_size_group_buildable_custom_finished):
    * gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
    (tree_model_start_element),
    (gtk_tree_store_buildable_custom_tag_start),
    (gtk_tree_store_buildable_custom_finished):
    * gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
    (gtk_tree_view_buildable_add):
    * gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
    * gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
    (gtk_ui_manager_buildable_add),
    (gtk_ui_manager_buildable_construct_child),
    (gtk_ui_manager_buildable_custom_tag_start),
    (gtk_ui_manager_buildable_custom_tag_end):
    * gtk/gtkwidget.c: (gtk_widget_get_type),
    (gtk_widget_buildable_interface_init),
    (gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
    (gtk_widget_buildable_set_property),
    (gtk_widget_buildable_parser_finshed), (accel_group_start_element),
    (gtk_widget_buildable_custom_tag_start),
    (gtk_widget_buildable_custom_finshed):
    * gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
    (gtk_window_buildable_set_property),
    (gtk_window_buildable_parser_finished):
    * tests/Makefile.am:
    * tests/buildertest.c: (builder_new_from_string), (test_parser),
    (signal_normal), (signal_after), (signal_object),
    (signal_object_after), (signal_first), (signal_second),
    (signal_extra), (signal_extra2), (test_connect_signals),
    (test_uimanager_simple), (test_domain), (test_translation),
    (test_sizegroup), (test_list_store), (test_tree_store),
    (test_types), (test_spin_button), (test_notebook),
    (test_construct_only_property), (test_children),
    (test_child_properties), (test_treeview_column), (test_icon_view),
    (test_combo_box), (test_combo_box_entry), (test_cell_view),
    (test_dialog), (test_accelerators), (test_widget), (main):

    Add GtkBuilder, fixes #172535


svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
Kristian Rietveld
21b381a2e2 Fix #399071, suggestion from Benoit Dejean.
2007-06-05  Kristian Rietveld  <kris@gtk.org>

	Fix #399071, suggestion from Benoit Dejean.

	* gtk/gtkliststore.[ch] (gtk_list_store_set_vector_internal): new
	function, factored out code iterating (columns, values) vectors from
	gtk_list_store_new_with_valuesv to here,
	(gtk_list_store_set_valuesv): new public function to set list store
	values using (columns, values) vectors,
	(gtk_list_store_new_with_valuesv): call new _set_vector_internal
	instead.

	* gtk/gtktreestore.[ch] (gtk_tree_store_set_vector_internal),
	(gtk_tree_store_set_valuesv), (gtk_tree_store_new_with_valuesv):
	likewise.

	* gtk/gtk.symbols: updated.


svn path=/trunk/; revision=18041
2007-06-04 23:48:38 +00:00
Matthias Clasen
6c98ef3356 Recognize negative column indices as invalid. (#415260, Chris Wilson)
2007-04-28  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkliststore.c (gtk_list_store_set_valist_internal):
        * gtk/gtktreestore.c (gtk_tree_store_set_valist_internal):
        Recognize negative column indices as invalid.  (#415260,
        Chris Wilson)


svn path=/trunk/; revision=17681
2007-04-28 21:29:05 +00:00
Matthias Clasen
f8794cccca Improve consistency of signal and property names 2006-07-06 05:14:03 +00:00
Kristian Rietveld
cc7f4fdeda Make the insert and set functions somewhat more convenient. (#343841,
2006-06-26  Kristian Rietveld  <kris@gtk.org>

	Make the insert and set functions somewhat more convenient.
	(#343841, David Necas).

	* gtk/gtkliststore.c (gtk_list_store_insert_with_values): allow
	a NULL iter,
	(gtk_list_store_insert_with_valuesv): likewise.

	* gtk/gtktreestore.c (gtk_tree_store_insert_with_values): ditto,
	(gtk_tree_store_insert_with_valuesv): likewise.
2006-06-26 15:49:43 +00:00
Kristian Rietveld
e7b5cdb8e0 Small refactoring. (#340428, Paolo Borelli).
2006-05-27  Kristian Rietveld  <kris@gtk.org>

	Small refactoring. (#340428, Paolo Borelli).

	* gtk/gtkliststore.c (gtk_list_store_set_valist_internal),
	(gtk_list_store_insert_with_valuesv): refactor code to determine
	iter compare func into gtk_list_store_get_compare_func().

	* gtk/gtktreestore.c (gtk_tree_store_set_valist_internal),
	(gtk_tree_store_insert_with_valuesv): likewise.
2006-05-27 21:43:10 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Matthias Clasen
f26aad1916 Boilerplate reduction 2006-05-02 23:56:43 +00:00
Kristian Rietveld
cb3824225b Fixes #324099, Tommi Komulainen.
2006-01-15  Kristian Rietveld  <kris@gtk.org>

	Fixes #324099, Tommi Komulainen.

	* gtk/gtktreestore.[ch] (gtk_tree_store_insert_with_values),
	(gtk_tree_store_insert_with_valuesv): new functions, analog to
	those found in GtkListStore.

	* gtk/gtktreestore.c (gtk_tree_store_real_set_value),
	(gtk_tree_store_set_valist), (gtk_tree_store_set_valist_internal),
	(gtk_tree_store_sort_iter_changed): refactored.

	* gtk/gtk.symbols: updated.

	* tests/treestoretest.c: added a test for this new functionality.
2006-01-15 20:12:49 +00:00
Matthias Clasen
215a384992 Always call the get_path and get_iter implementations directly, rather
2005-12-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkliststore.c:
	* gtk/gtktreestore.c: Always call the get_path and get_iter
	implementations directly, rather than the current mixture whith
	some calls going through the GtkTreeModel interface.
2005-12-30 03:29:36 +00:00
Matthias Clasen
9035ad5b33 Remove excessive g_return_if_fail() checks in static functions.
2005-12-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkliststore.c:
	* gtk/gtktreestore.c: Remove excessive g_return_if_fail() checks
	in static functions.
2005-12-29 07:14:19 +00:00