Commit Graph

333 Commits

Author SHA1 Message Date
Christian Hergert
3c775eb2b8 treeviewcolumn: use g_clear_object when freeing cursor
There is the chance that the cursor returned NULL on systems
with missing cursors. This defensively handles that by checking
for a NULL cursor.
2016-09-27 12:41:55 -07: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
Alberto Ruiz
496f0892fc introspection: This patch fixes nullable return values fixes for the following symbols in gtk
gtk_accel_group_query
  gtk_accel_group_from_accel_closure
  gtk_accel_label_get_accel_widget
  gtk_accessible_get_widget
  gtk_actionable_get_action_name
  gtk_app_chooser_get_app_info
  gtk_app_chooser_button_get_heading
  gtk_app_chooser_dialog_get_heading
  gtk_application_get_window_by_id
  gtk_assistant_get_nth_page
  gtk_binding_set_find
  gtk_builder_get_object
  gtk_builder_lookup_callback_symbol
  gtk_builder_get_application
  gtk_button_get_image
  gtk_cell_area_get_focus_from_sibling
  gtk_cell_renderer_start_editing
  gtk_cell_view_get_model
  gtk_cell_view_get_displayed_row
  gtk_clipboard_get_owner
  gtk_container_get_focus_child
  gtk_container_get_focus_vadjustment
  gtk_container_get_focus_hadjustment
  gtk_dialog_get_widget_for_response
  gtk_drag_get_source_widget
  gtk_drag_dest_get_target_list
  gtk_drag_source_get_target_list
  gtk_entry_completion_get_model
  gtk_entry_completion_compute_prefix
  gtk_expander_get_label_widget
  gtk_file_chooser_get_filename
  gtk_file_chooser_get_current_folder
  gtk_file_chooser_get_uri
  gtk_file_chooser_get_current_folder_uri
  gtk_file_chooser_get_preview_widget
  gtk_file_chooser_get_preview_file
  gtk_file_chooser_get_preview_filename
  gtk_file_chooser_get_preview_uri
  gtk_file_chooser_get_extra_widget
  gtk_file_chooser_get_filter
  gtk_file_chooser_native_get_accept_label
  gtk_file_chooser_native_get_cancel_label
  gtk_file_filter_get_name
  gtk_font_chooser_get_font_family
  gtk_font_chooser_get_font_face
  gtk_font_chooser_get_font
  gtk_font_chooser_get_font_desc
  gtk_font_chooser_get_font_map
  gtk_frame_get_label
  gtk_gesture_get_device
  gtk_gesture_get_window
  gtk_gl_area_get_error
  gtk_header_bar_get_title
  gtk_header_bar_get_subtitle
  gtk_header_bar_get_custom_title
  gtk_icon_info_get_filename
  gtk_icon_view_get_path_at_pos
  gtk_icon_view_get_model
  gtk_image_get_pixbuf
  gtk_image_get_animation
  gtk_label_get_mnemonic_widget
  gtk_label_get_attributes
  gtk_check_version
  gtk_menu_button_get_popup
  gtk_menu_button_get_menu_model
  gtk_menu_button_get_align_widget
  gtk_menu_button_get_popover
  gtk_menu_item_get_submenu
  gtk_menu_item_get_accel_path
  gtk_native_dialog_get_title
  gtk_native_dialog_get_transient_for
  gtk_notebook_get_nth_page
  gtk_notebook_get_tab_label_text
  gtk_notebook_get_menu_label
  gtk_notebook_get_menu_label_text
  gtk_notebook_get_group_name
  gtk_notebook_get_action_widget
  gtk_offscreen_window_get_surface
  gtk_offscreen_window_get_pixbuf
  gtk_paned_get_child1
  gtk_paned_get_child2
  gtk_places_sidebar_get_location
  gtk_places_sidebar_get_nth_bookmark
  gtk_plug_get_socket_window
  gtk_popover_get_default_widget
  gtk_progress_bar_get_text
  gtk_recent_filter_get_name
  gtk_recent_manager_lookup_item
  gtk_settings_get_default
  gtk_socket_get_plug_window
  gtk_stack_sidebar_get_stack
  gtk_stack_switcher_get_stack
  gtk_style_context_get_section
  gtk_style_context_get_parent
  gtk_style_context_get_frame_clock
  gtk_test_find_widget
  gtk_text_buffer_get_mark
  gtk_text_tag_table_lookup
  gtk_text_view_get_tabs
  gtk_text_view_toggle_cursor_visible
  gtk_text_view_get_window
  gtk_toolbar_get_nth_item
  gtk_tool_button_get_label
  gtk_tool_button_get_icon_name
  gtk_tool_button_get_label_widget
  gtk_tool_button_get_icon_widget
  gtk_tool_palette_get_drop_item
  gtk_tool_palette_get_drop_group
  gtk_tree_model_filter_convert_child_path_to_path
  gtk_tree_model_filter_convert_path_to_child_path
  gtk_tree_model_sort_convert_child_path_to_path
  gtk_tree_model_sort_convert_path_to_child_path
  gtk_tree_view_get_column
  gtk_tree_view_get_bin_window
  gtk_tree_view_column_get_widget
  gtk_tree_view_column_get_tree_view
  gtk_widget_get_frame_clock
  gtk_window_group_get_current_device_grab
  GtkTextBufferSerializeFunc
2016-01-08 12:18:23 +00:00
Benjamin Otte
983de6f4a0 treeview: Use a cssnode instead of regions
This makes Treeview headers work again like before region support was
removed.
2015-10-22 16:42:47 +02:00
Benjamin Otte
20ce0588b1 treeviewcolumn: Create button on init
This way, the button is always available and the code doesn't have to
special case this condition.
2015-10-22 16:42:46 +02:00
Matthias Clasen
c60362ab10 tree view column: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:37 -04:00
Matthias Clasen
5c2759af3c Use standard cursor names
This changes GTK+ to use gdk_cursor_new_from_name() with the
'standard' css names, instead of GdkCursorType.

https://bugzilla.gnome.org/show_bug.cgi?id=652085
2015-07-26 01:45:06 -04:00
Matthias Clasen
fa3ff773be GtkTreeViewColumn: Fix a documentation typo 2015-07-04 00:29:26 -04:00
Matthias Clasen
eea16f03f5 Stop using GDK_POINTER_MOTION_HINT_MASK in widgets
It is deprecated and no longer needed, and,as observed in
https://bugzilla.gnome.org/show_bug.cgi?id=746253 it
interferes with turning off event compression.
2015-03-22 17:33:38 -04:00
Matthias Clasen
bce5a0f1a1 GtkTreeViewColumn: a better way to avoid overlap
The overlap was caused by using pack-end for the arrow, which
causes it to be allocated from the other end. Avoid the problem
by using pack-start for both the title and the arrow, and
reordering them according to xalign.
2014-07-10 15:21:17 -04:00
Matthias Clasen
4aa649e9cd GtkTreeView: Avoid overlapping sort indicator
Hide the sort indicator when it would overlap the column title.
2014-07-10 14:22:59 -04:00
Jasper St. Pierre
9c37b3de74 gtk: Don't use GObjectClass.constructor
Use the newer constructed instead, which has a fast path in GObject.
2014-06-26 19:06:43 -04:00
Carlos Garnacho
b8886436b3 treeviewcolumn: Avoid a device position query
This happens in an event handler, and the button event should be
expected to have the right coordinates on the event window already.
2014-06-11 17:36:03 +02:00
Matthias Clasen
785e4d376e GtkTreeViewColumn: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:13 -04:00
Matthias Clasen
a3cd0ee7d8 Revert "Use minimum/natural size semantics"
This reverts commit 6d53c2339f.

https://bugzilla.gnome.org/show_bug.cgi?id=731054 showed some
major regressions caused by this commit.
2014-06-01 10:20:08 -04:00
Evan Nemerson
9db729f5a6 gtk: fix several out argument annotations
These mostly just switch from allow-none to optional, nullable, or
both, as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:33 -07:00
Evan Nemerson
e568903360 gtk: fix many callback annotations to include closure information
Without this information introspection-based consumers don't realize
they can include context information, but instead think that they
receive an extra gpointer argument (which they don't know how to
handle).

https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:32 -07:00
Matthias Clasen
04703689b8 Deprecate GtkAligment
This has been dangling ever since 3.0.

https://bugzilla.gnome.org/show_bug.cgi?id=645781
2014-05-23 20:31:25 -04:00
Matthias Clasen
4f830fb117 treeview: Don't show missing images
When a model is sortable, but the the column is not currently used
for sorting, we want to reserve the space for showing the sort
indicator. But we currently set the icon to 'missing-image', which
is not great to show all over the place. So, just set the opacity
to 0.
2014-05-17 15:32:54 -04:00
Matthias Clasen
57feff4e14 Drop GtkArrow use in GtkTreeViewColumn
This is in preparation for GtkArrow getting deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=729564
2014-05-13 23:50:12 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
a4b5929e81 docs: use apostrophe in *'re 2014-02-07 13:37:09 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -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
Claudio Saavedra
7faf5ee765 GtkTreeViewColumn: fix critical warning
Do not call _column_autosize() if there is no treeview set yet.

https://bugzilla.gnome.org/show_bug.cgi?id=723637
2014-02-06 19:41:02 +02:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -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
2d003553e8 docs: don't use <emphasis>
It is a little heavy handed. The text can speak for itself.
2014-01-28 02:02:05 -05:00
William Jon McCann
a8a080fc06 docs: fix dnd docs links 2014-01-21 22:40:55 -05:00
Ryan Lortie
e3b9ea5ab6 GtkTreeViewColumn: start padding at 0
If we start with a padding of -1 then it can leak out of the size
allocation request for the column when the treeview is empty.  The
GtkTreeView will then collect these -1 values and add them together,
returning -n where 'n' is the number of columns.

This is usually not a problem because treeviews tend to be used with a
scrollbar and the width of the scrollbar will be added to this number
bringing it into positive territory again.  On Ubuntu, with overlay
scrollbars, this is not the case, however.

https://bugzilla.gnome.org/show_bug.cgi?id=703062
2013-09-30 09:23:00 -04:00
Matthias Clasen
e5317f0f9a Improve struct packing in various places 2013-09-21 23:50:55 -04: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
Tristan Van Berkom
c6ab515735 Deprecate gtk_widget_push_composite_child & friends
Deprecate gtk_widget_push_composite_child, gtk_widget_pop_composite_child,
gtk_widget_set_composite_name, gtk_widget_get_composite_name.

This API is just bloat and was never useful, this patch deprecates
it and removes all internal calls to the composite child APIs
2013-04-08 21:19:27 +09:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
John Lindgren
11e78d9d9f docs: Update docs for recent treeviewcolumn changes 2013-01-17 02:24:15 +01:00
Benjamin Otte
104be175fc docs: Don't mark up numbers 2013-01-17 02:12:44 +01:00
Carl-Anton Ingmarsson
b5887bd26e treeviewcolumn: always hide button widget if the header is not shown
Fixes the following warning from appearing:
Gtk-WARNING **: GtkTreeView 0xb44010 is mapped but visible child
GtkButton 0xad9320 is not mapped
2013-01-17 00:45:33 +01:00
John Lindgren
6d53c2339f Use minimum/natural size semantics
Rewrites gtk_tree_view_column_request_width() and
gtk_tree_view_size_allocate_columns() to respect the minimum and natural
sizes that are already being returned by
gtk_cell_area_context_get_preferred_width().

The convoluted logic explained (not!) by this comment has been removed:
“Only update the expand value if the width of the widget has changed, or
the number of expand columns has changed, or if there are no expand
columns, or if we didn't have an size-allocation yet after the last
validated node.”  This logic seems to have been a workaround for the
“jumping” behavior fixed in 16195ad and is no longer necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:41:20 +01:00
John Lindgren
16195adc92 Use fixed width for resizing
Removes the hidden “resized-width” and “use-resized-width” properties
from GtkTreeViewColumn and instead uses the “fixed-width” property to
serve the same purpose.  “fixed-width”, if set, will now override the
auto-sized width (-1 is now a legal value meaning “not set”).

Additional “cleanups” in this commit:

1. When the user resizes the column the “expand” property is now also
set to FALSE, in order to prevent the column from suddenly jumping to a
different width when the window is resized.

2. The code that translated mouse movement to column sizes has been
simplified:
the change in column width is now calculated directly from the distance
the mouse cursor has traveled.  Weird behavior that might have happened
previously if the position of the column changed during resizing, is now
prevented.

3. There was some lengthy logic handling the keyboard shortcuts used to
resize treeview columns, which would call gtk_widget_error_bell() once
the minimum or maximum width was reached.  Instead of rewriting these
checks I simply set the “fixed-width” property to what was requested,
relying on the fact that it is already clamped between the minimum and
maximum width during size allocation.
I will greatly surprised if anyone notices the missing error bell.

https://bugzilla.gnome.org/show_bug.cgi?id=691751
2013-01-15 14:40:40 +01:00
Benjamin Otte
9be7e3e2d8 treeviewcolumn: Show button if we're visible
Previously, we were happily working with a hidden button.
2013-01-08 14:55:41 +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
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Jiří Klimeš
0a9901b1d2 docs: fix typos in functions' descriptions
gtk_tree_view_set_hover_expand()
gtk_tree_view_column_set_clickable()

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2012-02-20 09:25:29 +00:00
Carlos Garcia Campos
67c3bf7b02 gtktreeviewcolumn: Use symbolic names for button numbers 2012-01-27 09:47:44 +01:00
Benjamin Otte
a4b88c47cd treeview: Call a11y functions for culmn changes directly
This way, the a11y code knows if a column was reordered, added or
removed and can do the right things instead of trying to guess and
getting it wrong.

Also, this patch finalizes the changes so that only visible columns
exist to the accessibility interface.
2011-11-16 04:39:25 +01:00
Matthias Clasen
cafef131d6 Remove one instance of gdk_window_get_pointer 2011-11-02 08:10:42 -04:00
Kjell Ahlstedt
f920ded541 GtkTreeViewColumn: dispose: Remove from the treeview
This handles the case (with gtkmm) that the GtkTreeViewColumn is
destroyed before the GtkTreeView is destroyed.
Bug #659672
2011-10-06 11:02:02 +02:00
Cosimo Cecchi
fb488d49b2 GtkTreeViewColumn: initialize a variable
Shut up valgrind complaining about uninitialized values

==5330== Conditional jump or move depends on uninitialised value(s)
==5330==    at 0x624FF4C: gdk_window_move_resize_internal
(gdkwindow.c:6037)
==5330==    by 0x62502C3: gdk_window_move_resize (gdkwindow.c:6274)
==5330==    by 0x5E4FBB5: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2169)
==5330==    by 0x5E3846B: gtk_tree_view_size_allocate_columns
(gtktreeview.c:2631)
==5330==    by 0x5E43D76: gtk_tree_view_size_allocate
(gtktreeview.c:2686)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==    by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330==    by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330==    by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330==    by 0x5D94ADD: gtk_scrolled_window_allocate_child
(gtkscrolledwindow.c:1506)
==5330==    by 0x5D95299: gtk_scrolled_window_size_allocate
(gtkscrolledwindow.c:1704)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==    by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330==    by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330==    by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330==    by 0x5C62708: gtk_box_size_allocate (gtkbox.c:658)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==  Uninitialised value was created by a stack allocation
==5330==    at 0x5E4FA8D: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2139)
2011-09-28 20:20:20 -04:00