Commit Graph

134 Commits

Author SHA1 Message Date
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Matthias Clasen
bbd94b5a9f gtk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Matthias Clasen
121c195521 tree view: Fix compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
2015-06-02 09:08:16 -04:00
Philip Withnall
52858f709c gtktreeselection: Fix an abort on selecting an invalid range
gtk_tree_selection_real_modify_range() has a g_return_if_fail() if the
start or end paths passed to it do not correspond to real tree nodes.
However, GtkTreePaths inherently do not have to be valid, so it should
be acceptable to call gtk_tree_selection_select_range() with
non-existent paths. Replace the g_return_if_fail() by a silent return,
and add a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Philip Withnall
8e3b499699 gtktreeselection: Fix a potential use of uninitialised variables
Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
968780d8da gtktreeselection: Fix potential NULL pointer dereferences
_gtk_rbtree_first() can potentially return NULL if the RB tree is empty,
which would result in NULL pointer dereferences in the GtkTreeSelection
code. Gracefully handle them.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Matthias Clasen
d169f409b0 GtkTreeSelection: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:13 -04:00
Christoph Reiter
f0e6eb3ce0 treeselection docs: spelling fix
https://bugzilla.gnome.org/show_bug.cgi?id=725205
2014-03-03 17:35:10 -05:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
1d7d6997e8 docs: fix typo 2014-01-21 18:57:37 -05:00
William Jon McCann
98a5d3234d docs: fix link to DND info 2014-01-21 18:57:37 -05:00
Philip Withnall
380150361b gtktreeselection: Eliminate a dead assignment
This is technically a dead assignment, but is nice to retain for
clarity. Moving it to the variable definition shuts scan-build up.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
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
Matthias Clasen
e4b5e94eb9 Make accessible implementations public
This commit exposes the get_type() functions and standard
headers for accessible implementations. This makes it possible
to derive from the GTK accessible implementations without
GType magic tricks. This is necessary, because we require the
a11y type hierarchy to be parallel to the widget type hierarchy.
So, if you derive a widget and need to adjust its a11y implementation,
you have to be able to derive its accessible implementation.

This commit probably exposes more than is absolutely necessary,
it also exposes accessibles of widgets that are unlikely candidates
for deriving from.
2012-12-27 11:23:22 -05:00
Matthias Clasen
ea479e6bb9 Trivial whitespace fix 2012-12-11 21:30:40 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
3112679a5e treeview: Signal selection changes to the accessible
And another signal gone.
2011-12-16 04:53:15 +01:00
Benjamin Otte
4dbedb7481 docs: Update code demo for newer glib 2011-12-10 08:00:26 +01:00
Benjamin Otte
806dca0677 treeview: Rename function
_gtk_tree_view_find_path() was not a name that not really described what
the function does. And I kept forgetting it. Also, it took the tree view
as an argument and that was completely unnecessary.
2011-11-29 20:44:57 +01:00
Benjamin Otte
c3056951db rbtree: Introduce _gtk_rbtree_first()
... and use it.
2011-11-22 03:32:56 +01:00
Juan Pablo Ugarte
d80d834be8 * gtk/gtktreeselection.c:
Added missing GtkTreeSelection:mode property.
   Closes bug #645960 "GtkTreeSelection has no property to set mode"
2011-03-31 19:17:17 -03:00
Javier Jardón
66e7915dc4 gtktreeselection: Move public members to a private structure 2010-12-19 05:01:22 +00:00
Tristan Van Berkom
4038cd76b3 Removed GtkTreeViewPrivate from gtktreeprivate.h and added a few more accessors.
This actually much simplifies interaction with GtkTreeSelection
(at least reduces code size where dealing width the treeview anchor path).
2010-12-05 22:11:37 +09:00
Javier Jardón
8d3b36d534 gtktreeselection: Move documentation to inline comments 2010-10-23 00:31:37 +02:00
Johan Dahlin
19cab17c22 Add a couple of missing annotations 2010-09-18 13:43:06 -03:00
Matthias Clasen
316b9da873 Allow to unset the tree selection function
This is not causing problems, and seems natural. Bug 626276.
2010-08-10 07:35:54 -04:00
Philip Withnall
3a34295b9c Add (transfer none) annotation to gtk_tree_selection_get_selected_rows()
Closes: bgo#625650
2010-08-05 00:53:43 +01: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
Ignacio Casal Quinteiro
fa752d156b Fix annotation. 2010-06-30 20:37:22 +02:00
Benjamin Otte
cd266cb8de Make declaration return a boolean when the function does that 2010-06-28 14:19:18 +02:00
John (J5) Palmieri
c707e445ca gtk_tree_selection_get_selected: added transfer none annotation to model out arg 2010-05-27 18:36:04 -04:00
Javier Jardón
7e11475298 [docs] Cast to GFunc in gtk_tree_selection_get_selected_rows() example code
Reported by Diego Escalante Urrelo here:
https://bugzilla.gnome.org/show_bug.cgi?id=502266
2009-12-19 02:09:18 +01: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
Sven Neumann
e3c01cf601 gtk/gtktext.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
2008-08-08  Sven Neumann  <sven@gimp.org>

	* gtk/gtktext.c
	* gtk/gtktextbuffer.c
	* gtk/gtktextlayout.c
	* gtk/gtktexttagtable.c
	* gtk/gtktextview.c
	* gtk/gtktipsquery.c
	* gtk/gtktoolbar.c
	* gtk/gtktoolitem.c
	* gtk/gtktreeitem.c
	* gtk/gtktreemodelfilter.c
	* gtk/gtktreemodelsort.c
	* gtk/gtktreeviewcolumn.c: use canonical signal names.


svn path=/trunk/; revision=21045
2008-08-08 14:23:32 +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
Johan Dahlin
e46eeab2a9 Add missing Since: gtk-doc markup for newly added GSEAL API. Change all
2008-06-20  Johan Dahlin  <jdahlin@async.com.br>

    * gtk/gtkaccelgroup.c:
    * gtk/gtkcolorseldialog.c:
    * gtk/gtkcontainer.c:
    * gtk/gtkdialog.c:
    * gtk/gtkentry.c (gtk_entry_class_init):
    * gtk/gtkfontsel.c:
    * gtk/gtkhandlebox.c:
    * gtk/gtklayout.c:
    * gtk/gtkmenu.c (gtk_menu_class_init):
    * gtk/gtkmenuitem.c (gtk_menu_item_class_init):
    * gtk/gtkplug.c (gtk_plug_class_init):
    * gtk/gtkselection.c:
    * gtk/gtksocket.c:
    * gtk/gtktreeselection.c:
    * gtk/gtkwidget.c (gtk_widget_class_init):
    * gtk/gtkwindow.c:
    Add missing Since: gtk-doc markup for newly added GSEAL API.
    Change all Since: GSEAL-branch to Since: 2.14.


svn path=/trunk/; revision=20639
2008-06-20 13:54:31 +00:00
Tim Janik
1ba7f437bc Add gtk_tree_selection_get_select_function().
* gtk/gtktreeselection.[ch] (gtk_tree_selection_get_select_function): new
function.
* gtk/gtk.symbols: add new function.

svn path=/trunk/; revision=20527
2008-06-20 11:01:18 +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
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
c247b1bc4a Set model in all cases. (#357791, Andreas Köhler)
2006-10-01  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):
	Set model in all cases.  (#357791, Andreas Köhler)
2006-10-02 01:29:24 +00:00
Kristian Rietveld
a70e666423 Separate sensitive/selectable properties.
2006-06-02  Kristian Rietveld  <kris@imendio.com>

	Separate sensitive/selectable properties.

	* gtk/gtktreeselection.c (tree_column_is_sensitive): remove,
	(_gtk_tree_selection_row_is_selectable): remove checks to see if at
	least one column is sensitive,
	(gtk_tree_selection_real_select_node): remove code which enables
	insensitive rows to always be unselected.

	* gtk/gtktreeview.c (gtk_tree_view_row_changed): remove code
	that unselects a node if it just became insensitive.

	* gtk/gtkcombobox.c (gtkcombo_box_list_select_func): new function,
	based on the at least one column sensitive check from
	_gtk_tree_selection_row_is_selectable(),
	(gtk_combo_box_list_setup): set selection function on tree selection.
2006-06-02 18:55:59 +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