Compare commits

..

3 Commits

Author SHA1 Message Date
Matthias Clasen b8d7777cc4 xim: Stop using gdk_surface_get_user_data
Use gtk_root_get_for_surface instead.
2019-02-23 22:01:58 -05:00
Matthias Clasen c4edc28542 ime: Stop using gdk_surface_get_user_data
Use gtk_root_get_for_surface instead.
2019-02-23 22:01:50 -05:00
Matthias Clasen b4e0bae7dc Add gtk_root_get_for_surface
This is a replacement for gdk_surface_get_user_data.
2019-02-23 21:56:47 -05:00
193 changed files with 1577 additions and 2693 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
## Version information
<!--
- Which version of GTK you are using
- Which version of GTK+ you are using
- What operating system and version
- For Linux, which distribution
- If you built GTK+ yourself, the list of options used to configure the build
+1 -1
View File
@@ -13,7 +13,7 @@
## Version information
<!--
- Which version of GTK you are using
- Which version of GTK+ you are using
- What operating system and version
- for Linux, which distribution
- If you built GTK+ yourself, the list of options used to configure the build
+7 -5
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
import os
import sys
@@ -7,8 +7,8 @@ import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
gtk_libdir = sys.argv[3]
gtk_datadir = sys.argv[4]
gtk_libdir = sys.argv[3].replace('/', os.sep)
gtk_datadir = sys.argv[4].replace('/', os.sep)
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
@@ -23,9 +23,11 @@ if 'DESTDIR' not in os.environ:
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
if not os.path.isdir(gtk_printmodule_dir):
os.mkdir(gtk_printmodule_dir)
subprocess.call(['gio-querymodules', gtk_printmodule_dir])
print('Updating module cache for input methods...')
os.makedirs(gtk_immodule_dir, exist_ok=True)
if not os.path.isdir(gtk_immodule_dir):
os.mkdir(gtk_immodule_dir)
subprocess.call(['gio-querymodules', gtk_immodule_dir])
+1 -1
View File
@@ -80,7 +80,7 @@ on_entry_changed (GtkWidget *widget, gpointer data)
page_number = gtk_assistant_get_current_page (assistant);
current_page = gtk_assistant_get_nth_page (assistant, page_number);
text = gtk_editable_get_text (GTK_EDITABLE (widget));
text = gtk_entry_get_text (GTK_ENTRY (widget));
if (text && *text)
gtk_assistant_set_page_complete (assistant, current_page, TRUE);
+11 -3
View File
@@ -71,12 +71,20 @@ find_toplevel_at_pointer (GdkDisplay *display)
GdkSurface *pointer_window;
GtkWidget *widget = NULL;
pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (), NULL, NULL);
pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (),
NULL, NULL);
/* The user data field of a GdkSurface is used to store a pointer
* to the widget that created it.
*/
if (pointer_window)
widget = GTK_WIDGET (gtk_root_get_for_surface (pointer_window));
{
gpointer widget_ptr;
gdk_surface_get_user_data (pointer_window, &widget_ptr);
widget = widget_ptr;
}
return widget;
return widget ? gtk_widget_get_toplevel (widget) : NULL;
}
static void
+2 -2
View File
@@ -28,7 +28,7 @@ copy_button_clicked (GtkWidget *button,
clipboard = gtk_widget_get_clipboard (entry);
/* Set clipboard text */
gdk_clipboard_set_text (clipboard, gtk_editable_get_text (GTK_EDITABLE (entry)));
gdk_clipboard_set_text (clipboard, gtk_entry_get_text (GTK_ENTRY (entry)));
}
void
@@ -50,7 +50,7 @@ paste_received (GObject *source_object,
if (text)
{
/* Set the entry text */
gtk_editable_set_text (GTK_EDITABLE (entry), text);
gtk_entry_set_text (GTK_ENTRY (entry), text);
g_free (text);
}
else
+1 -1
View File
@@ -256,7 +256,7 @@ mask_entry_set_background (MaskEntry *entry)
{
if (entry->mask)
{
if (!g_regex_match_simple (entry->mask, gtk_editable_get_text (GTK_EDITABLE (entry)), 0, 0))
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
{
PangoAttrList *attrs;
+4 -4
View File
@@ -69,7 +69,7 @@ interactive_dialog_clicked (GtkButton *button,
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
local_entry1 = gtk_entry_new ();
gtk_editable_set_text (GTK_EDITABLE (local_entry1), gtk_editable_get_text (GTK_EDITABLE (entry1)));
gtk_entry_set_text (GTK_ENTRY (local_entry1), gtk_entry_get_text (GTK_ENTRY (entry1)));
gtk_grid_attach (GTK_GRID (table), local_entry1, 1, 0, 1, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), local_entry1);
@@ -77,7 +77,7 @@ interactive_dialog_clicked (GtkButton *button,
gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
local_entry2 = gtk_entry_new ();
gtk_editable_set_text (GTK_EDITABLE (local_entry2), gtk_editable_get_text (GTK_EDITABLE (entry2)));
gtk_entry_set_text (GTK_ENTRY (local_entry2), gtk_entry_get_text (GTK_ENTRY (entry2)));
gtk_grid_attach (GTK_GRID (table), local_entry2, 1, 1, 1, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), local_entry2);
@@ -85,8 +85,8 @@ interactive_dialog_clicked (GtkButton *button,
if (response == GTK_RESPONSE_OK)
{
gtk_editable_set_text (GTK_EDITABLE (entry1), gtk_editable_get_text (GTK_EDITABLE (local_entry1)));
gtk_editable_set_text (GTK_EDITABLE (entry2), gtk_editable_get_text (GTK_EDITABLE (local_entry2)));
gtk_entry_set_text (GTK_ENTRY (entry1), gtk_entry_get_text (GTK_ENTRY (local_entry1)));
gtk_entry_set_text (GTK_ENTRY (entry2), gtk_entry_get_text (GTK_ENTRY (local_entry2)));
}
gtk_widget_destroy (dialog);
+2 -2
View File
@@ -199,7 +199,7 @@ edit_label_done (GtkWidget *entry, gpointer data)
gtk_container_child_get (GTK_CONTAINER (fixed), entry, "x", &x, "y", &y, NULL);
label = GTK_WIDGET (g_object_get_data (G_OBJECT (entry), "label"));
gtk_label_set_text (GTK_LABEL (label), gtk_editable_get_text (GTK_EDITABLE (entry)));
gtk_label_set_text (GTK_LABEL (label), gtk_entry_get_text (GTK_ENTRY (entry)));
gtk_widget_destroy (entry);
}
@@ -218,7 +218,7 @@ edit_cb (GtkWidget *child)
g_object_set_data (G_OBJECT (entry), "label", child);
gtk_editable_set_text (GTK_EDITABLE (entry), gtk_label_get_text (GTK_LABEL (child)));
gtk_entry_set_text (GTK_ENTRY (entry), gtk_label_get_text (GTK_LABEL (child)));
g_signal_connect (entry, "activate", G_CALLBACK (edit_label_done), NULL);
gtk_fixed_put (GTK_FIXED (fixed), entry, x, y);
gtk_widget_grab_focus (entry);
+6 -6
View File
@@ -305,7 +305,7 @@ update_display (void)
char *font_desc;
char *features;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (GTK_ENTRY (entry));
if (gtk_label_get_selection_bounds (GTK_LABEL (label), &ins, &bound))
{
@@ -728,7 +728,7 @@ adjustment_changed (GtkAdjustment *adjustment,
char *str;
str = g_strdup_printf ("%g", gtk_adjustment_get_value (adjustment));
gtk_editable_set_text (GTK_EDITABLE (entry), str);
gtk_entry_set_text (GTK_ENTRY (entry), str);
g_free (str);
update_display ();
@@ -741,7 +741,7 @@ entry_activated (GtkEntry *entry,
gdouble value;
gchar *err = NULL;
value = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
value = g_strtod (gtk_entry_get_text (entry), &err);
if (err != NULL)
gtk_adjustment_set_value (adjustment, value);
}
@@ -821,7 +821,7 @@ add_axis (FT_Var_Axis *ax, FT_Fixed value, int i)
gtk_grid_attach (GTK_GRID (variations_grid), axis_scale, 1, i, 1, 1);
axis_entry = gtk_entry_new ();
gtk_widget_set_valign (axis_entry, GTK_ALIGN_BASELINE);
gtk_editable_set_width_chars (GTK_EDITABLE (axis_entry), 4);
gtk_entry_set_width_chars (GTK_ENTRY (axis_entry), 4);
gtk_grid_attach (GTK_GRID (variations_grid), axis_entry, 2, i, 1, 1);
axis = g_new (Axis, 1);
@@ -1639,7 +1639,7 @@ static char *text;
static void
switch_to_entry (void)
{
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
gtk_stack_set_visible_child_name (GTK_STACK (stack), "entry");
gtk_widget_grab_focus (entry);
}
@@ -1677,7 +1677,7 @@ entry_key_press (GtkEventController *controller,
{
if (keyval == GDK_KEY_Escape)
{
gtk_editable_set_text (GTK_EDITABLE (entry), text);
gtk_entry_set_text (GTK_ENTRY (entry), text);
stop_edit ();
return GDK_EVENT_STOP;
}
+1 -1
View File
@@ -12,7 +12,7 @@
static void
do_number (GtkButton *button, GtkEntry *entry)
{
gtk_editable_set_text (GTK_EDITABLE (entry), gtk_button_get_label (button));
gtk_entry_set_text (entry, gtk_button_get_label (button));
}
GtkWidget *
+1 -1
View File
@@ -85,7 +85,7 @@ stop_search (GtkButton *button,
static void
clear_entry (GtkEntry *entry)
{
gtk_editable_set_text (GTK_EDITABLE (entry), "");
gtk_entry_set_text (entry, "");
}
static void
+9 -9
View File
@@ -19,7 +19,7 @@ hex_spin_input (GtkSpinButton *spin_button,
gchar *err;
gdouble res;
buf = gtk_editable_get_text (GTK_EDITABLE (spin_button));
buf = gtk_spin_button_get_text (spin_button);
res = strtol (buf, &err, 16);
*new_val = res;
if (*err)
@@ -41,8 +41,8 @@ hex_spin_output (GtkSpinButton *spin_button)
buf = g_strdup ("0x00");
else
buf = g_strdup_printf ("0x%.2X", (gint) val);
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);
g_free (buf);
return TRUE;
@@ -60,7 +60,7 @@ time_spin_input (GtkSpinButton *spin_button,
gchar *endh;
gchar *endm;
text = gtk_editable_get_text (GTK_EDITABLE (spin_button));
text = gtk_spin_button_get_text (spin_button);
str = g_strsplit (text, ":", 2);
if (g_strv_length (str) == 2)
@@ -99,8 +99,8 @@ time_spin_output (GtkSpinButton *spin_button)
hours = gtk_adjustment_get_value (adjustment) / 60.0;
minutes = (hours - floor (hours)) * 60.0;
buf = g_strdup_printf ("%02.0f:%02.0f", floor (hours), floor (minutes + 0.5));
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);
g_free (buf);
return TRUE;
@@ -132,7 +132,7 @@ month_spin_input (GtkSpinButton *spin_button,
for (i = 1; i <= 12; i++)
{
tmp1 = g_ascii_strup (month[i - 1], -1);
tmp2 = g_ascii_strup (gtk_editable_get_text (GTK_EDITABLE (spin_button)), -1);
tmp2 = g_ascii_strup (gtk_spin_button_get_text (spin_button), -1);
if (strstr (tmp1, tmp2) == tmp1)
found = TRUE;
g_free (tmp1);
@@ -162,8 +162,8 @@ month_spin_output (GtkSpinButton *spin_button)
for (i = 1; i <= 12; i++)
if (fabs (value - (double)i) < 1e-5)
{
if (strcmp (month[i-1], gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), month[i-1]);
if (strcmp (month[i-1], gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, month[i-1]);
}
return TRUE;
+2 -2
View File
@@ -68,7 +68,7 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
{
const gchar *text;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (entry);
if (text[0] == '\0')
return;
@@ -322,7 +322,7 @@ icon_visible_func (GtkTreeModel *model,
gboolean visible;
search = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (win->search));
search_text = gtk_editable_get_text (GTK_EDITABLE (win->searchentry));
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
if (win->symbolic)
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
+1 -1
View File
@@ -1406,7 +1406,7 @@ open_popover_text_changed (GtkEntry *entry, GParamSpec *pspec, GtkWidget *button
{
const gchar *text;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (entry);
gtk_widget_set_sensitive (button, strlen (text) > 0);
}
+4 -5
View File
@@ -213,7 +213,6 @@ gdk_surface_get_pass_through
gdk_surface_move
gdk_surface_resize
gdk_surface_move_resize
gdk_surface_move_to_rect
gdk_surface_has_native
gdk_surface_raise
gdk_surface_lower
@@ -241,6 +240,7 @@ gdk_surface_thaw_updates
gdk_surface_get_frame_clock
<SUBSECTION>
gdk_surface_set_user_data
gdk_surface_set_accept_focus
gdk_surface_get_accept_focus
gdk_surface_set_focus_on_map
@@ -252,6 +252,7 @@ gdk_surface_set_title
GDK_PARENT_RELATIVE
gdk_surface_set_cursor
gdk_surface_get_cursor
gdk_surface_get_user_data
gdk_surface_get_geometry
gdk_surface_set_geometry_hints
gdk_surface_get_width
@@ -277,6 +278,7 @@ GdkModifierIntent
gdk_surface_get_parent
gdk_surface_get_toplevel
gdk_surface_get_children
gdk_surface_get_children_with_user_data
gdk_surface_peek_children
gdk_surface_set_icon_name
gdk_surface_set_transient_for
@@ -375,7 +377,6 @@ gdk_content_formats_builder_to_formats
GDK_TYPE_FILE_LIST
gdk_file_list_get_type
gdk_content_formats_get_type
gdk_content_formats_builder_get_type
</SECTION>
<SECTION>
@@ -441,7 +442,6 @@ gdk_keymap_get_modifier_state
gdk_keymap_add_virtual_modifiers
gdk_keymap_map_virtual_modifiers
gdk_keymap_get_modifier_mask
gdk_keymap_get_display
<SUBSECTION>
gdk_keyval_name
@@ -622,7 +622,6 @@ GDK_BUTTON_SECONDARY
gdk_event_new
gdk_event_copy
gdk_event_get_axes
gdk_event_get_axis
gdk_event_get_button
gdk_event_get_click_count
gdk_event_get_coords
@@ -685,7 +684,6 @@ GDK_TYPE_SCROLL_DIRECTION
GDK_TYPE_NOTIFY_TYPE
GDK_IS_EVENT
gdk_event_get_type
gdk_event_sequence_get_type
</SECTION>
<SECTION>
@@ -781,6 +779,7 @@ GDK_ACTION_ALL
gdk_drag_get_display
gdk_drag_get_actions
gdk_drag_get_suggested_action
gdk_drag_get_selected_action
gdk_drag_get_formats
gdk_drag_get_device
-2
View File
@@ -15,9 +15,7 @@ private_headers = [
'gdkdisplaymanagerprivate.h',
'gdkdisplayprivate.h',
'gdkdndprivate.h',
'gdkdragprivate.h',
'gdkdrawcontextprivate.h',
'gdkdropprivate.h',
'gdkeventsprivate.h',
'gdkframeclockidleprivate.h',
'gdkframeclockprivate.h',
+12 -10
View File
@@ -45,7 +45,7 @@
windows gets raised to the top, then the application has to
repaint it, so the previously obscured area can be shown.
When the windowing system asks an application to redraw
a window, it sends a <firstterm>frame event</firstterm>
a window, it sends an <firstterm>frame event</firstterm>
(<firstterm>expose event</firstterm> in X11 terminology)
for that window.
</para>
@@ -64,14 +64,16 @@
tell the underlying surface that it needs to repaint itself. The
drawing cycle can also be initiated when a widget itself decides
that it needs to update its display. For example, when the user
types a character in an entry widget, the entry asks GTK to queue
a redraw operation for itself.
types a character in a <link
linkend="GtkEntry"><classname>GtkEntry</classname></link>
widget, the entry asks GTK to queue a redraw operation for
itself.
</para>
<para>
The windowing system generates frame events for surfaces. The GDK
interface to the windowing system translates such events into
emissions of the ::render signal on the affected surfaces.
emissions of the #GtkSurface::render signal on the affected surfaces.
The GTK toplevel window connects to that signal, and reacts appropriately.
</para>
@@ -203,21 +205,21 @@
<title>Hierarchical drawing</title>
<para>
During the Paint phase GTK receives a single ::render signal on the toplevel
During the Paint phase we will send a single ::render signal the toplevel
window. The signal handler will create a snapshot object (which is a
helper for creating a scene graph) and emit a GtkWidget::snapshot() signal,
which will propagate down the widget hierarchy. This lets each widget
which will propagate down the entire widget hierarchy. This lets each widget
snapshot its content at the right place and time, correctly handling things
like partial transparencies and overlapping widgets.
</para>
<para>
To avoid excessive work when generating scene graphs, GTK caches render nodes.
Each widget keeps a reference to its render node (which in turn, will refer to
GtkWidget keeps a reference to its render node (which in turn, will refer to
the render nodes of children, and grandchildren, and so on), and will reuse
that node during the Paint phase. Invalidating a widget (by calling
gtk_widget_queue_draw()) discards the cached render node, forcing the widget
to regenerate it the next time it needs to handle a ::snapshot.
that node during the Paint phase. Invalidating a widget (e.g. by calling
gtk_widget_queue_draw) discards the cached render node, forcing GTK to
regenerate it the next time it needs to snapshot the widget.
</para>
</refsect2>
+1 -1
View File
@@ -827,7 +827,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (entry);
if (text[0] == '\0')
return;
-1
View File
@@ -68,7 +68,6 @@
<chapter id="WindowWidgets">
<title>Windows</title>
<xi:include href="xml/gtkroot.xml" />
<xi:include href="xml/gtkwindow.xml" />
<xi:include href="xml/gtkdialog.xml" />
<xi:include href="xml/gtkmessagedialog.xml" />
+39 -16
View File
@@ -675,6 +675,12 @@ gtk_combo_box_new
gtk_combo_box_new_with_entry
gtk_combo_box_new_with_model
gtk_combo_box_new_with_model_and_entry
gtk_combo_box_get_wrap_width
gtk_combo_box_set_wrap_width
gtk_combo_box_get_row_span_column
gtk_combo_box_set_row_span_column
gtk_combo_box_get_column_span_column
gtk_combo_box_set_column_span_column
gtk_combo_box_get_active
gtk_combo_box_set_active
gtk_combo_box_get_active_iter
@@ -689,7 +695,6 @@ gtk_combo_box_popdown
gtk_combo_box_get_popup_accessible
gtk_combo_box_get_row_separator_func
gtk_combo_box_set_row_separator_func
GtkSensitivityType
gtk_combo_box_set_button_sensitivity
gtk_combo_box_get_button_sensitivity
gtk_combo_box_get_has_entry
@@ -918,6 +923,8 @@ gtk_entry_new
gtk_entry_new_with_buffer
gtk_entry_get_buffer
gtk_entry_set_buffer
gtk_entry_set_text
gtk_entry_get_text
gtk_entry_get_text_length
gtk_entry_set_visibility
gtk_entry_get_visibility
@@ -930,6 +937,10 @@ gtk_entry_set_activates_default
gtk_entry_get_activates_default
gtk_entry_set_has_frame
gtk_entry_get_has_frame
gtk_entry_set_width_chars
gtk_entry_get_width_chars
gtk_entry_set_max_width_chars
gtk_entry_get_max_width_chars
gtk_entry_set_alignment
gtk_entry_get_alignment
gtk_entry_set_placeholder_text
@@ -1808,6 +1819,7 @@ gtk_menu_new
gtk_menu_new_from_model
gtk_menu_set_display
gtk_menu_reorder_child
gtk_menu_attach
gtk_menu_popup_at_rect
gtk_menu_popup_at_widget
gtk_menu_popup_at_pointer
@@ -1829,6 +1841,7 @@ gtk_menu_attach_to_widget
gtk_menu_detach
gtk_menu_get_attach_widget
gtk_menu_get_for_attach_widget
GtkMenuPositionFunc
GtkMenuDetachFunc
<SUBSECTION Standard>
GTK_MENU
@@ -2268,6 +2281,11 @@ gtk_range_set_increments
gtk_range_set_range
gtk_range_get_round_digits
gtk_range_set_round_digits
GtkSensitivityType
gtk_range_set_lower_stepper_sensitivity
gtk_range_get_lower_stepper_sensitivity
gtk_range_set_upper_stepper_sensitivity
gtk_range_get_upper_stepper_sensitivity
gtk_range_get_flippable
gtk_range_set_flippable
gtk_range_get_range_rect
@@ -2700,6 +2718,12 @@ gtk_spin_button_get_snap_to_ticks
gtk_spin_button_get_update_policy
gtk_spin_button_get_value
gtk_spin_button_get_wrap
gtk_spin_button_set_text
gtk_spin_button_get_text
gtk_spin_button_set_max_width_chars
gtk_spin_button_get_max_width_chars
gtk_spin_button_set_width_chars
gtk_spin_button_get_width_chars
GTK_INPUT_ERROR
<SUBSECTION Standard>
GTK_SPIN_BUTTON
@@ -4376,7 +4400,6 @@ gtk_snapshot_push_clip
gtk_snapshot_push_rounded_clip
gtk_snapshot_push_cross_fade
gtk_snapshot_push_blend
gtk_snapshot_push_debug
gtk_snapshot_pop
gtk_snapshot_save
gtk_snapshot_restore
@@ -4470,7 +4493,6 @@ gtk_widget_set_parent
gtk_widget_set_parent_surface
gtk_widget_get_parent_surface
gtk_widget_get_toplevel
gtk_widget_get_root
gtk_widget_get_ancestor
gtk_widget_is_ancestor
gtk_widget_translate_coordinates
@@ -4531,6 +4553,7 @@ gtk_widget_get_allocated_width
gtk_widget_get_allocated_height
gtk_widget_get_allocation
gtk_widget_get_allocated_baseline
gtk_widget_get_allocated_size
gtk_widget_get_width
gtk_widget_get_height
gtk_widget_compute_bounds
@@ -4735,9 +4758,12 @@ gtk_window_set_startup_id
gtk_window_set_role
gtk_window_get_decorated
gtk_window_get_deletable
gtk_window_get_default_icon_list
gtk_window_get_default_icon_name
gtk_window_get_default_size
gtk_window_get_destroy_with_parent
gtk_window_get_icon
gtk_window_get_icon_list
gtk_window_get_icon_name
gtk_window_get_mnemonic_modifier
gtk_window_get_modal
@@ -4758,7 +4784,13 @@ gtk_window_has_group
gtk_window_get_window_type
gtk_window_move
gtk_window_resize
gtk_window_set_default_icon_list
gtk_window_set_default_icon
gtk_window_set_default_icon_from_file
gtk_window_set_default_icon_name
gtk_window_set_icon
gtk_window_set_icon_list
gtk_window_set_icon_from_file
gtk_window_set_icon_name
gtk_window_set_auto_startup_notification
gtk_window_get_mnemonics_visible
@@ -5870,8 +5902,8 @@ GtkMountOperationPrivate
<SECTION>
<FILE>gtktransform</FILE>
<TITLE>3D transformations</TITLE>
GtkTransformType
GtkTransform
GtkTransformType;
GtkTransform;
gtk_transform_ref
gtk_transform_unref
<SUBSECTION>
@@ -6671,8 +6703,8 @@ gtk_gesture_single_get_type
<SECTION>
<FILE>gtkeventcontrollerlegacy</FILE>
<TITLE>GtkEventControllerLegacy</TITLE>
GtkEventControllerLegacy
<TITLE>GtkEventControllerlegacy</TITLE>
GtkEventControllerlegacy
gtk_event_controller_legacy_new
<SUBSECTION Standard>
@@ -7164,12 +7196,3 @@ gtk_media_stream_error_valist
GTK_TYPE_MEDIA_STREAM
gtk_media_stream_get_type
</SECTION>
<SECTION>
<FILE>gtkroot</FILE>
<TITLE>GtkRoot</TITLE>
GtkRoot
gtk_root_get_for_surface
<SUBSECTION Private>
gtk_root_get_type
</SECTION>
-1
View File
@@ -137,7 +137,6 @@ gtk_radio_tool_button_get_type
gtk_range_get_type
gtk_recent_manager_get_type
gtk_revealer_get_type
gtk_root_get_type
gtk_scale_button_get_type
gtk_scale_get_type
gtk_scrollable_get_type
+2 -3
View File
@@ -608,7 +608,7 @@
</section>
<section>
<title>Adapt to changes in the API of GtkEntry, GtkSearchEntry adn GtkSpinButton</title>
<title>Adapt to changes in the API of GtkEntry and GtkSearchEntry</title>
<para>
The GtkEditable has been made more useful, and the core functionality of
GtkEntry has been broken out as a GtkText widget. GtkEntry, GtkSearchEntry,
@@ -620,8 +620,7 @@
<para>
Use GtkEditable API for editable functionality, and widget-specific APIs for
things that go beyond the common interface. For password entries, use
GtkPasswordEntry. As an example, gtk_spin_button_set_max_width_chars()
has been removed in favor of gtk_editable_set_max_width_chars().
GtkPasswordEntry.
</para>
</section>
+3 -3
View File
@@ -226,7 +226,7 @@ create_entry (void)
widget = gtk_entry_new ();
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_editable_set_text (GTK_EDITABLE (widget), "Entry");
gtk_entry_set_text (GTK_ENTRY (widget), "Entry");
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
return new_widget_info ("entry", widget, SMALL);
@@ -320,7 +320,7 @@ create_combo_box_entry (void)
g_object_unref (model);
child = gtk_bin_get_child (GTK_BIN (widget));
gtk_editable_set_text (GTK_EDITABLE (child), "Combo Box Entry");
gtk_entry_set_text (GTK_ENTRY (child), "Combo Box Entry");
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
@@ -399,7 +399,7 @@ create_search_bar (void)
widget = gtk_search_bar_new ();
entry = gtk_search_entry_new ();
gtk_editable_set_text (GTK_EDITABLE (entry), "Search Bar");
gtk_entry_set_text (GTK_ENTRY (entry), "Search Bar");
gtk_container_add (GTK_CONTAINER (widget), entry);
gtk_widget_show (entry);
+2 -2
View File
@@ -31,7 +31,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (entry);
if (text[0] == '\0')
return;
@@ -58,7 +58,7 @@ find_word (GtkButton *button,
const gchar *word;
word = gtk_button_get_label (button);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
}
static void
+1 -1
View File
@@ -25,7 +25,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (entry);
if (text[0] == '\0')
return;
+2 -2
View File
@@ -29,7 +29,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (entry);
if (text[0] == '\0')
return;
@@ -56,7 +56,7 @@ find_word (GtkButton *button,
const gchar *word;
word = gtk_button_get_label (button);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
}
static void
+2 -2
View File
@@ -31,7 +31,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
text = gtk_entry_get_text (entry);
if (text[0] == '\0')
return;
@@ -58,7 +58,7 @@ find_word (GtkButton *button,
const gchar *word;
word = gtk_button_get_label (button);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
}
static void
+2 -2
View File
@@ -364,7 +364,7 @@ combo_changed (GtkComboBox *combo,
str = g_strjoinv (",", accels);
g_strfreev (accels);
gtk_editable_set_text (GTK_EDITABLE (entry), str);
gtk_entry_set_text (entry, str);
}
static void
@@ -389,7 +389,7 @@ response (GtkDialog *dialog,
if (!action)
return;
str = gtk_editable_get_text (GTK_EDITABLE (entry));
str = gtk_entry_get_text (entry);
accels = g_strsplit (str, ",", 0);
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const gchar **) accels);
-4
View File
@@ -40,8 +40,4 @@ PangoDirection gdk_unichar_direction (gunichar ch);
PangoDirection gdk_find_base_dir (const char *text,
int len);
void gdk_surface_set_widget (GdkSurface *surface,
gpointer widget);
gpointer gdk_surface_get_widget (GdkSurface *surface);
#endif /* __GDK__PRIVATE_H__ */
+4 -4
View File
@@ -51,12 +51,12 @@
* This section describes the GDK initialization functions and miscellaneous
* utility functions, as well as deprecation facilities.
*
* The GDK and GTK headers annotate deprecated APIs in a way that produces
* The GDK and GTK+ headers annotate deprecated APIs in a way that produces
* compiler warnings if these deprecated APIs are used. The warnings
* can be turned off by defining the macro %GDK_DISABLE_DEPRECATION_WARNINGS
* before including the glib.h header.
*
* GDK and GTK also provide support for building applications against
* GDK and GTK+ also provide support for building applications against
* defined subsets of deprecated or new APIs. Define the macro
* %GDK_VERSION_MIN_REQUIRED to specify up to what version
* you want to receive warnings about deprecated APIs. Define the
@@ -299,11 +299,11 @@ gdk_should_use_portal (void)
* locked for performance reasons. So e.g. you must coordinate
* accesses to the same #GHashTable from multiple threads.
*
* GTK, however, is not thread safe. You should only use GTK and GDK
* GTK+, however, is not thread safe. You should only use GTK+ and GDK
* from the thread gtk_init() and gtk_main() were called on.
* This is usually referred to as the “main thread”.
*
* Signals on GTK and GDK types, as well as non-signal callbacks, are
* Signals on GTK+ and GDK types, as well as non-signal callbacks, are
* emitted in the main thread.
*
* You can schedule work in the main thread safely from other threads
+1 -1
View File
@@ -30,7 +30,7 @@
*
* [Cairo](http://cairographics.org) is a graphics
* library that supports vector graphics and image compositing that
* can be used with GDK and GTK.
* can be used with GDK. GTK+ does all of its drawing using cairo.
*
* GDK does not wrap the cairo API, instead it allows to create cairo
* contexts which can be used to draw on #GdkSurfaces. Additional
+1 -1
View File
@@ -70,7 +70,7 @@
*
* You can use gdk_display_manager_get() to obtain the #GdkDisplayManager
* singleton, but that should be rarely necessary. Typically, initializing
* GTK opens a display that you can work with without ever accessing the
* GTK+ opens a display that you can work with without ever accessing the
* #GdkDisplayManager.
*
* The GDK library can be built with support for multiple backends.
+4 -4
View File
@@ -179,7 +179,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
* This signal is emitted as the second step of toolkit and
* application processing of the frame. Any work to update
* sizes and positions of application elements should be
* performed. GTK normally handles this internally.
* performed. GTK+ normally handles this internally.
*/
signals[LAYOUT] =
g_signal_new (g_intern_static_string ("layout"),
@@ -197,7 +197,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
* This signal is emitted as the third step of toolkit and
* application processing of the frame. The frame is
* repainted. GDK normally handles this internally and
* produces expose events, which are turned into GTK
* produces expose events, which are turned into GTK+
* #GtkWidget::draw signals.
*/
signals[PAINT] =
@@ -230,7 +230,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
* @clock: the frame clock emitting the signal
*
* This signal is emitted after processing of the frame is
* finished, and is handled internally by GTK to resume normal
* finished, and is handled internally by GTK+ to resume normal
* event processing. Applications should not handle this signal.
*/
signals[RESUME_EVENTS] =
@@ -289,7 +289,7 @@ gdk_frame_clock_get_frame_time (GdkFrameClock *frame_clock)
* content and want to continually request the
* %GDK_FRAME_CLOCK_PHASE_UPDATE phase for a period of time,
* you should use gdk_frame_clock_begin_updating() instead, since
* this allows GTK to adjust system parameters to get maximally
* this allows GTK+ to adjust system parameters to get maximally
* smooth animations.
*/
void
+1 -1
View File
@@ -298,7 +298,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
* @width: The width of the region to draw
* @height: The height of the region to draw
*
* This is the main way to draw GL content in GTK. It takes a render buffer ID
* This is the main way to draw GL content in GTK+. It takes a render buffer ID
* (@source_type == #GL_RENDERBUFFER) or a texture id (@source_type == #GL_TEXTURE)
* and draws it onto @cr with an OVER operation, respecting the current clip.
* The top left corner of the rectangle specified by @x, @y, @width and @height
+1 -1
View File
@@ -145,7 +145,7 @@ struct _GdkSurface
GdkSurface *parent;
GdkSurface *transient_for;
gpointer widget;
gpointer user_data;
gint x;
gint y;
+4 -4
View File
@@ -264,7 +264,7 @@ gdk_seat_get_capabilities (GdkSeat *seat)
* commonly.
*
* Grabs are used for operations which need complete control over the
* events corresponding to the given capabilities. For example in GTK this
* events corresponding to the given capabilities. For example in GTK+ this
* is used for Drag and Drop operations, popup menus and such.
*
* Note that if the event mask of a #GdkSurface has selected both button press
@@ -350,7 +350,7 @@ gdk_seat_get_slaves (GdkSeat *seat,
* Returns the master device that routes pointer events.
*
* Returns: (transfer none) (nullable): a master #GdkDevice with pointer
* capabilities. This object is owned by GTK and must not be freed.
* capabilities. This object is owned by GTK+ and must not be freed.
**/
GdkDevice *
gdk_seat_get_pointer (GdkSeat *seat)
@@ -370,7 +370,7 @@ gdk_seat_get_pointer (GdkSeat *seat)
* Returns the master device that routes keyboard events.
*
* Returns: (transfer none) (nullable): a master #GdkDevice with keyboard
* capabilities. This object is owned by GTK and must not be freed.
* capabilities. This object is owned by GTK+ and must not be freed.
**/
GdkDevice *
gdk_seat_get_keyboard (GdkSeat *seat)
@@ -405,7 +405,7 @@ gdk_seat_device_removed (GdkSeat *seat,
*
* Returns the #GdkDisplay this seat belongs to.
*
* Returns: (transfer none): a #GdkDisplay. This object is owned by GTK
* Returns: (transfer none): a #GdkDisplay. This object is owned by GTK+
* and must not be freed.
**/
GdkDisplay *
+87 -18
View File
@@ -61,7 +61,7 @@
*
* A #GdkSurface is a (usually) rectangular region on the screen.
* Its a low-level object, used to implement high-level objects such as
* #GtkWidget and #GtkWindow on the GTK level. A #GtkWindow is a toplevel
* #GtkWidget and #GtkWindow on the GTK+ level. A #GtkWindow is a toplevel
* surface, the thing a user might think of as a window with a titlebar
* and so on; a #GtkWindow may contain many sub-GdkSurfaces.
*/
@@ -1042,17 +1042,43 @@ gdk_surface_destroy (GdkSurface *surface)
g_object_unref (surface);
}
/**
* gdk_surface_set_user_data:
* @surface: a #GdkSurface
* @user_data: (allow-none) (type GObject.Object): user data
*
* For most purposes this function is deprecated in favor of
* g_object_set_data(). However, for historical reasons GTK+ stores
* the #GtkWidget that owns a #GdkSurface as user data on the
* #GdkSurface. So, custom widget implementations should use
* this function for that. If GTK+ receives an event for a #GdkSurface,
* and the user data for the surface is non-%NULL, GTK+ will assume the
* user data is a #GtkWidget, and forward the event to that widget.
*
**/
void
gdk_surface_set_widget (GdkSurface *surface,
gpointer widget)
gdk_surface_set_user_data (GdkSurface *surface,
gpointer user_data)
{
surface->widget = widget;
g_return_if_fail (GDK_IS_SURFACE (surface));
surface->user_data = user_data;
}
gpointer
gdk_surface_get_widget (GdkSurface *surface)
/**
* gdk_surface_get_user_data:
* @surface: a #GdkSurface
* @data: (out): return location for user data
*
* Retrieves the user data for @surface, which is normally the widget
* that @surface belongs to. See gdk_surface_set_user_data().
*
**/
void
gdk_surface_get_user_data (GdkSurface *surface,
gpointer *data)
{
return surface->widget;
*data = surface->user_data;
}
/**
@@ -1239,6 +1265,49 @@ gdk_surface_peek_children (GdkSurface *surface)
return surface->children;
}
/**
* gdk_surface_get_children_with_user_data:
* @surface: a #GdkSurface
* @user_data: user data to look for
*
* Gets the list of children of @surface known to GDK with a
* particular @user_data set on it.
*
* The returned list must be freed, but the elements in the
* list need not be.
*
* The list is returned in (relative) stacking order, i.e. the
* lowest surface is first.
*
* Returns: (transfer container) (element-type GdkSurface):
* list of child surfaces inside @surface
**/
GList *
gdk_surface_get_children_with_user_data (GdkSurface *surface,
gpointer user_data)
{
GdkSurface *child;
GList *res, *l;
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
if (GDK_SURFACE_DESTROYED (surface))
return NULL;
res = NULL;
for (l = surface->children; l != NULL; l = l->next)
{
child = l->data;
if (child->user_data == user_data)
res = g_list_prepend (res, child);
}
return res;
}
/**
* gdk_surface_is_visible:
* @surface: a #GdkSurface
@@ -2692,7 +2761,7 @@ gdk_surface_move (GdkSurface *surface,
* @height: new height of the surface
*
* Resizes @surface; for toplevel surfaces, asks the window manager to resize
* the surface. The window manager may not allow the resize. When using GTK,
* the surface. The window manager may not allow the resize. When using GTK+,
* use gtk_window_resize() instead of this low-level GDK function.
*
* Surfaces may not be resized below 1x1.
@@ -4098,7 +4167,7 @@ gdk_surface_create_similar_surface (GdkSurface * surface,
* @surface: a #GdkSurface
* @timestamp: timestamp of the event triggering the surface focus
*
* Sets keyboard focus to @surface. In most cases, gtk_window_present_with_time()
* Sets keyboard focus to @surface. In most cases, gtk_window_present()
* should be used on a #GtkWindow, rather than calling this function.
*
**/
@@ -4264,7 +4333,7 @@ gdk_surface_set_geometry_hints (GdkSurface *surface,
* If you havent explicitly set the icon name for the surface
* (using gdk_surface_set_icon_name()), the icon name will be set to
* @title as well. @title must be in UTF-8 encoding (as with all
* user-readable strings in GDK and GTK). @title may not be %NULL.
* user-readable strings in GDK/GTK+). @title may not be %NULL.
**/
void
gdk_surface_set_title (GdkSurface *surface,
@@ -4278,7 +4347,7 @@ gdk_surface_set_title (GdkSurface *surface,
* @surface: a toplevel #GdkSurface
* @role: a string indicating its role
*
* When using GTK, typically you should use gtk_window_set_role() instead
* When using GTK+, typically you should use gtk_window_set_role() instead
* of this low-level function.
*
* The window manager and session manager use a surfaces role to
@@ -4304,7 +4373,7 @@ gdk_surface_set_role (GdkSurface *surface,
* @surface: a toplevel #GdkSurface
* @startup_id: a string with startup-notification identifier
*
* When using GTK, typically you should use gtk_window_set_startup_id()
* When using GTK+, typically you should use gtk_window_set_startup_id()
* instead of this low-level function.
**/
void
@@ -4489,9 +4558,9 @@ gdk_surface_iconify (GdkSurface *surface)
* @surface: a toplevel #GdkSurface
*
* Attempt to deiconify (unminimize) @surface. On X11 the window manager may
* choose to ignore the request to deiconify. When using GTK,
* choose to ignore the request to deiconify. When using GTK+,
* use gtk_window_deiconify() instead of the #GdkSurface variant. Or better yet,
* you probably want to use gtk_window_present_with_time(), which raises the surface, focuses it,
* you probably want to use gtk_window_present(), which raises the surface, focuses it,
* unminimizes it, and puts it on the current desktop.
*
**/
@@ -5262,7 +5331,7 @@ gdk_surface_get_unscaled_size (GdkSurface *surface,
*
* This function only works for toplevel surfaces.
*
* GTK will update this property automatically if
* GTK+ will update this property automatically if
* the @surface background is opaque, as we know where the opaque regions
* are. If your surface background is not opaque, please update this
* property in your #GtkWidget::style-updated handler.
@@ -5298,14 +5367,14 @@ gdk_surface_set_opaque_region (GdkSurface *surface,
* @top: The top extent
* @bottom: The bottom extent
*
* Newer GTK windows using client-side decorations use extra geometry
* Newer GTK+ windows using client-side decorations use extra geometry
* around their frames for effects like shadows and invisible borders.
* Window managers that want to maximize windows or snap to edges need
* to know where the extents of the actual frame lie, so that users
* dont feel like windows are snapping against random invisible edges.
*
* Note that this property is automatically updated by GTK, so this
* function should only be used by applications which do not use GTK
* Note that this property is automatically updated by GTK+, so this
* function should only be used by applications which do not use GTK+
* to create toplevel surfaces.
*/
void
+9
View File
@@ -491,6 +491,9 @@ GDK_AVAILABLE_IN_ALL
void gdk_surface_focus (GdkSurface *surface,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_user_data (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
gboolean gdk_surface_get_accept_focus (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_accept_focus (GdkSurface *surface,
@@ -592,6 +595,9 @@ GDK_AVAILABLE_IN_ALL
GdkCursor *gdk_surface_get_device_cursor (GdkSurface *surface,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
void gdk_surface_get_user_data (GdkSurface *surface,
gpointer *data);
GDK_AVAILABLE_IN_ALL
void gdk_surface_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
@@ -660,6 +666,9 @@ GDK_AVAILABLE_IN_ALL
GList * gdk_surface_get_children (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GList * gdk_surface_peek_children (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GList * gdk_surface_get_children_with_user_data (GdkSurface *surface,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
void gdk_surface_set_icon_list (GdkSurface *surface,
+3 -3
View File
@@ -200,7 +200,7 @@ typedef enum
* @GDK_HYPER_MASK: the Hyper modifier
* @GDK_META_MASK: the Meta modifier
* @GDK_MODIFIER_RESERVED_29_MASK: A reserved bit flag; do not use in your own code
* @GDK_RELEASE_MASK: not used in GDK itself. GTK uses it to differentiate
* @GDK_RELEASE_MASK: not used in GDK itself. GTK+ uses it to differentiate
* between (keyval, modifiers) pairs from key press and release events.
* @GDK_MODIFIER_MASK: a mask covering all modifier types.
*
@@ -454,7 +454,7 @@ typedef enum {
* GdkSurfaceTypeHint:
* @GDK_SURFACE_TYPE_HINT_NORMAL: Normal toplevel window.
* @GDK_SURFACE_TYPE_HINT_DIALOG: Dialog window.
* @GDK_SURFACE_TYPE_HINT_MENU: Window used to implement a menu; GTK uses
* @GDK_SURFACE_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses
* this hint only for torn-off menus, see #GtkTearoffMenuItem.
* @GDK_SURFACE_TYPE_HINT_TOOLBAR: Window used to implement toolbars.
* @GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: Window used to display a splash
@@ -514,7 +514,7 @@ typedef enum
*
* An enumeration describing the way in which a device
* axis (valuator) maps onto the predefined valuator
* types that GTK understands.
* types that GTK+ understands.
*
* Note that the X and Y axes are not really needed; pointer devices
* report their location via the x/y members of events regardless. Whether
+1 -9
View File
@@ -37,7 +37,7 @@
*
* A macro that should be defined before including the gdk.h header.
* If it is defined, no compiler warnings will be produced for uses
* of deprecated GDK and GTK APIs.
* of deprecated GDK and GTK+ APIs.
*/
#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
@@ -54,7 +54,6 @@
#define GDK_VERSION_3_92 (G_ENCODE_VERSION (3, 92))
#define GDK_VERSION_3_94 (G_ENCODE_VERSION (3, 94))
/**
* GDK_VERSION_4_0:
*
@@ -138,13 +137,6 @@
# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_92
# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
#endif
#endif /* __GDK_VERSION_MACROS_H__ */
+1 -1
View File
@@ -1008,7 +1008,7 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
.pNext = NULL,
.pApplicationName = g_get_application_name (),
.applicationVersion = 0,
.pEngineName = "GTK",
.pEngineName = "GTK+",
.engineVersion = VK_MAKE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION, GDK_MICRO_VERSION),
.apiVersion = VK_API_VERSION_1_0
},
+79 -195
View File
@@ -141,30 +141,6 @@ dump_framebuffer (const char *filename, int w, int h)
g_free (data);
}
static void G_GNUC_UNUSED
dump_node (GskRenderNode *node,
const char *filename)
{
const int surface_width = ceilf (node->bounds.size.width);
const int surface_height = ceilf (node->bounds.size.height);
cairo_surface_t *surface;
cairo_t *cr;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
surface_width,
surface_height);
cr = cairo_create (surface);
cairo_save (cr);
cairo_translate (cr, -node->bounds.origin.x, -node->bounds.origin.y);
gsk_render_node_draw (node, cr);
cairo_restore (cr);
cairo_destroy (cr);
cairo_surface_write_to_png (surface, filename);
cairo_surface_destroy (surface);
}
static gboolean
font_has_color_glyphs (const PangoFont *font)
{
@@ -273,11 +249,6 @@ node_supports_transform (GskRenderNode *node)
case GSK_OPACITY_NODE:
case GSK_COLOR_MATRIX_NODE:
case GSK_TEXTURE_NODE:
case GSK_TRANSFORM_NODE:
case GSK_CROSS_FADE_NODE:
case GSK_LINEAR_GRADIENT_NODE:
case GSK_DEBUG_NODE:
case GSK_TEXT_NODE:
return TRUE;
default:
@@ -798,6 +769,7 @@ render_transform_node (GskGLRenderer *self,
const graphene_matrix_t *node_transform = gsk_transform_node_peek_transform (node);
GskRenderNode *child = gsk_transform_node_get_child (node);
switch (category)
{
case GSK_MATRIX_CATEGORY_IDENTITY:
@@ -817,9 +789,23 @@ render_transform_node (GskGLRenderer *self,
case GSK_MATRIX_CATEGORY_2D_AFFINE:
{
ops_push_modelview (builder, node_transform, category);
const float scale = ops_get_scale (builder);
graphene_matrix_t transform, transformed_mv;
const float dx = builder->dx;
const float dy = builder->dy;
graphene_matrix_init_from_matrix (&transform, node_transform);
graphene_matrix_multiply (&transform, builder->current_modelview, &transformed_mv);
graphene_matrix_translate (&transformed_mv,
&(graphene_point3d_t) { builder->dx * scale, builder->dy * scale, 0});
builder->dx = 0;
builder->dy = 0;
ops_push_modelview (builder, &transformed_mv);
gsk_gl_renderer_add_render_ops (self, child, builder);
ops_pop_modelview (builder);
builder->dx = dx;
builder->dy = dy;
}
break;
@@ -828,6 +814,8 @@ render_transform_node (GskGLRenderer *self,
case GSK_MATRIX_CATEGORY_INVERTIBLE:
default:
{
const float scale = ops_get_scale (builder);
graphene_matrix_t transform, transformed_mv;
const float min_x = child->bounds.origin.x;
const float min_y = child->bounds.origin.y;
const float max_x = min_x + child->bounds.size.width;
@@ -835,56 +823,53 @@ render_transform_node (GskGLRenderer *self,
int texture_id;
gboolean is_offscreen;
ops_push_modelview (builder, node_transform, category);
graphene_matrix_init_from_matrix (&transform, node_transform);
graphene_matrix_multiply (&transform, builder->current_modelview, &transformed_mv);
graphene_matrix_translate (&transformed_mv,
&(graphene_point3d_t) { builder->dx * scale, builder->dy * scale, 0});
if (node_supports_transform (child))
ops_push_modelview (builder, &transformed_mv);
/* For non-trivial transforms, we draw everything on a texture and then
* draw the texture transformed. */
/* TODO: We should compute a modelview containing only the "non-trivial"
* part (e.g. the rotation) and use that. We want to keep the scale
* for the texture.
*/
add_offscreen_ops (self, builder,
&child->bounds,
child,
&texture_id, &is_offscreen,
RESET_CLIP | RESET_OPACITY);
ops_set_texture (builder, texture_id);
ops_set_program (builder, &self->blit_program);
if (is_offscreen)
{
gsk_gl_renderer_add_render_ops (self, child, builder);
const GskQuadVertex offscreen_vertex_data[GL_N_VERTICES] = {
{ { min_x, min_y }, { 0, 1 }, },
{ { min_x, max_y }, { 0, 0 }, },
{ { max_x, min_y }, { 1, 1 }, },
{ { max_x, max_y }, { 1, 0 }, },
{ { min_x, max_y }, { 0, 0 }, },
{ { max_x, min_y }, { 1, 1 }, },
};
ops_draw (builder, offscreen_vertex_data);
}
else
{
/* For non-trivial transforms, we draw everything on a texture and then
* draw the texture transformed. */
/* TODO: We should compute a modelview containing only the "non-trivial"
* part (e.g. the rotation) and use that. We want to keep the scale
* for the texture.
*/
add_offscreen_ops (self, builder,
&child->bounds,
child,
&texture_id, &is_offscreen,
RESET_CLIP | RESET_OPACITY);
ops_set_texture (builder, texture_id);
ops_set_program (builder, &self->blit_program);
const GskQuadVertex onscreen_vertex_data[GL_N_VERTICES] = {
{ { min_x, min_y }, { 0, 0 }, },
{ { min_x, max_y }, { 0, 1 }, },
{ { max_x, min_y }, { 1, 0 }, },
if (is_offscreen)
{
const GskQuadVertex offscreen_vertex_data[GL_N_VERTICES] = {
{ { min_x, min_y }, { 0, 1 }, },
{ { min_x, max_y }, { 0, 0 }, },
{ { max_x, min_y }, { 1, 1 }, },
{ { max_x, max_y }, { 1, 1 }, },
{ { min_x, max_y }, { 0, 1 }, },
{ { max_x, min_y }, { 1, 0 }, },
};
{ { max_x, max_y }, { 1, 0 }, },
{ { min_x, max_y }, { 0, 0 }, },
{ { max_x, min_y }, { 1, 1 }, },
};
ops_draw (builder, offscreen_vertex_data);
}
else
{
const GskQuadVertex onscreen_vertex_data[GL_N_VERTICES] = {
{ { min_x, min_y }, { 0, 0 }, },
{ { min_x, max_y }, { 0, 1 }, },
{ { max_x, min_y }, { 1, 0 }, },
{ { max_x, max_y }, { 1, 1 }, },
{ { min_x, max_y }, { 0, 1 }, },
{ { max_x, min_y }, { 1, 0 }, },
};
ops_draw (builder, onscreen_vertex_data);
}
ops_draw (builder, onscreen_vertex_data);
}
ops_pop_modelview (builder);
@@ -969,126 +954,31 @@ render_clip_node (GskGLRenderer *self,
ops_pop_clip (builder);
}
static inline void
get_inner_rect (const GskRoundedRect *rect,
graphene_rect_t *out)
{
const float left = MAX (rect->corner[GSK_CORNER_TOP_LEFT].width,
rect->corner[GSK_CORNER_BOTTOM_LEFT].width);
const float top = MAX (rect->corner[GSK_CORNER_TOP_LEFT].height,
rect->corner[GSK_CORNER_TOP_RIGHT].height);
out->origin.x = rect->bounds.origin.x + left;
out->origin.y = rect->bounds.origin.y + top;
out->size.width = rect->bounds.size.width - left -
MAX (rect->corner[GSK_CORNER_TOP_RIGHT].width,
rect->corner[GSK_CORNER_BOTTOM_RIGHT].width);
out->size.height = rect->bounds.size.height - top -
MAX (rect->corner[GSK_CORNER_BOTTOM_LEFT].height,
rect->corner[GSK_CORNER_BOTTOM_RIGHT].height);
}
/* Best effort intersection of two rounded rectangles */
static gboolean
gsk_rounded_rect_intersection (const GskRoundedRect *outer,
const GskRoundedRect *inner,
gsk_rounded_rect_intersection (const GskRoundedRect *self,
const GskRoundedRect *other,
GskRoundedRect *out_intersection)
{
const graphene_rect_t *outer_bounds = &outer->bounds;
const graphene_rect_t *inner_bounds = &inner->bounds;
graphene_rect_t outer_inner;
graphene_rect_t inner_inner;
gboolean contained_x;
gboolean contained_y;
const graphene_rect_t *self_bounds = &self->bounds;
const graphene_rect_t *other_bounds = &other->bounds;
if (graphene_rect_contains_rect (outer_bounds, inner_bounds))
if (graphene_rect_contains_rect (self_bounds, other_bounds))
{
*out_intersection = *inner;
*out_intersection = *other;
return TRUE;
}
get_inner_rect (outer, &outer_inner);
get_inner_rect (inner, &inner_inner);
/* TODO: There are a few cases here that we can express using a single
* rounded rectangle, which are even interesting in every day usage.
* For example, a partially scrolled-away rounded rectangle
* might just work.
*/
contained_x = outer_inner.origin.x <= inner_inner.origin.x &&
(outer_inner.origin.x + outer_inner.size.width) > (inner_inner.origin.x +
inner_inner.size.width);
contained_y = outer_inner.origin.y <= inner_inner.origin.y &&
(outer_inner.origin.y + outer_inner.size.height) > (inner_inner.origin.y +
inner_inner.size.height);
if (contained_x && !contained_y)
{
/* The intersection is @inner, but cut-off and with the cut-off corners
* set to size 0 */
*out_intersection = *inner;
if (inner_bounds->origin.y < outer_bounds->origin.y)
{
/* Set top corners to 0 */
graphene_rect_intersection (outer_bounds, inner_bounds, &out_intersection->bounds);
graphene_size_init (&out_intersection->corner[GSK_CORNER_TOP_LEFT], 0, 0);
graphene_size_init (&out_intersection->corner[GSK_CORNER_TOP_RIGHT], 0, 0);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_BOTTOM_LEFT],
&inner->corner[GSK_CORNER_BOTTOM_LEFT]);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_BOTTOM_RIGHT],
&inner->corner[GSK_CORNER_BOTTOM_RIGHT]);
return TRUE;
}
else if (inner_bounds->origin.y + inner_bounds->size.height >
outer_bounds->origin.y + outer_bounds->size.height)
{
/* Set bottom corners to 0 */
graphene_rect_intersection (outer_bounds, inner_bounds, &out_intersection->bounds);
graphene_size_init (&out_intersection->corner[GSK_CORNER_BOTTOM_LEFT], 0, 0);
graphene_size_init (&out_intersection->corner[GSK_CORNER_BOTTOM_RIGHT], 0, 0);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_TOP_LEFT],
&inner->corner[GSK_CORNER_TOP_LEFT]);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_TOP_RIGHT],
&inner->corner[GSK_CORNER_TOP_RIGHT]);
return TRUE;
}
}
else if (!contained_x && contained_y)
{
/* The intersection is @inner, but cut-off and with the cut-off corners
* set to size 0 */
*out_intersection = *inner;
if (inner_bounds->origin.x < outer_bounds->origin.x)
{
/* Set left corners to 0 */
graphene_rect_intersection (outer_bounds, inner_bounds, &out_intersection->bounds);
graphene_size_init (&out_intersection->corner[GSK_CORNER_TOP_LEFT], 0, 0);
graphene_size_init (&out_intersection->corner[GSK_CORNER_BOTTOM_LEFT], 0, 0);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_TOP_RIGHT],
&inner->corner[GSK_CORNER_TOP_RIGHT]);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_BOTTOM_RIGHT],
&inner->corner[GSK_CORNER_BOTTOM_RIGHT]);
return TRUE;
}
else if (inner_bounds->origin.x + inner_bounds->size.width >
outer_bounds->origin.x + outer_bounds->size.width)
{
/* Set right corners to 0 */
graphene_rect_intersection (outer_bounds, inner_bounds, &out_intersection->bounds);
graphene_size_init (&out_intersection->corner[GSK_CORNER_TOP_RIGHT], 0, 0);
graphene_size_init (&out_intersection->corner[GSK_CORNER_BOTTOM_RIGHT], 0, 0);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_TOP_LEFT],
&inner->corner[GSK_CORNER_TOP_LEFT]);
graphene_size_init_from_size (&out_intersection->corner[GSK_CORNER_BOTTOM_LEFT],
&inner->corner[GSK_CORNER_BOTTOM_LEFT]);
return TRUE;
}
}
/* Actually not possible or just too much work. */
return FALSE;
}
static inline void
render_rounded_clip_node (GskGLRenderer *self,
GskRenderNode *node,
@@ -1416,7 +1306,7 @@ render_outset_shadow_node (GskGLRenderer *self,
op.op = OP_CLEAR;
ops_add (builder, &op);
prev_projection = ops_set_projection (builder, &item_proj);
ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
ops_push_modelview (builder, &identity);
prev_viewport = ops_set_viewport (builder, &GRAPHENE_RECT_INIT (0, 0, texture_width, texture_height));
/* Draw outline */
@@ -2442,8 +2332,7 @@ gsk_gl_renderer_add_render_ops (GskGLRenderer *self,
/* This can still happen, even if the render nodes are created using
* GtkSnapshot, so let's juse be safe. */
if (node->bounds.size.width == 0.0f || node->bounds.size.height == 0.0f ||
isnan (node->bounds.size.width) || isnan (node->bounds.size.height))
if (node->bounds.size.width == 0.0f || node->bounds.size.height == 0.0f)
return;
/* Check whether the render node is entirely out of the current
@@ -2479,7 +2368,7 @@ gsk_gl_renderer_add_render_ops (GskGLRenderer *self,
break;
case GSK_DEBUG_NODE:
gsk_gl_renderer_add_render_ops (self,
gsk_gl_renderer_add_render_ops (self,
gsk_debug_node_get_child (node),
builder);
break;
@@ -2634,7 +2523,7 @@ add_offscreen_ops (GskGLRenderer *self,
op.op = OP_CLEAR;
ops_add (builder, &op);
prev_projection = ops_set_projection (builder, &item_proj);
ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
ops_push_modelview (builder, &identity);
prev_viewport = ops_set_viewport (builder,
&GRAPHENE_RECT_INIT (bounds->origin.x * scale,
bounds->origin.y * scale,
@@ -2894,13 +2783,12 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
render_op_builder.current_viewport = *viewport;
render_op_builder.current_opacity = 1.0f;
render_op_builder.render_ops = self->render_ops;
ops_set_modelview (&render_op_builder, &modelview,
scale_factor == 1 ? GSK_MATRIX_CATEGORY_IDENTITY : GSK_MATRIX_CATEGORY_2D_AFFINE);
ops_push_modelview (&render_op_builder, &modelview);
/* Initial clip is self->render_region! */
if (self->render_region != NULL)
{
graphene_rect_t transformed_render_region;
GskRoundedRect transformed_render_region = { 0, };
cairo_rectangle_int_t render_extents;
cairo_region_get_extents (self->render_region, &render_extents);
@@ -2910,12 +2798,8 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
render_extents.y,
render_extents.width,
render_extents.height),
&transformed_render_region);
ops_push_clip (&render_op_builder,
&GSK_ROUNDED_RECT_INIT (transformed_render_region.origin.x,
transformed_render_region.origin.y,
transformed_render_region.size.width,
transformed_render_region.size.height));
&transformed_render_region.bounds);
ops_push_clip (&render_op_builder, &transformed_render_region);
}
else
{
+78 -132
View File
@@ -63,54 +63,89 @@ static void
extract_matrix_metadata (const graphene_matrix_t *m,
OpsMatrixMetadata *md)
{
switch (md->category)
{
case GSK_MATRIX_CATEGORY_IDENTITY:
md->scale_x = 1;
md->scale_y = 1;
break;
graphene_vec3_t col1;
graphene_vec3_t col2;
case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
md->translate_x = graphene_matrix_get_value (m, 3, 0);
md->translate_y = graphene_matrix_get_value (m, 3, 1);
md->scale_x = 1;
md->scale_y = 1;
break;
/* Translate */
md->translate_x = graphene_matrix_get_value (m, 3, 0);
md->translate_y = graphene_matrix_get_value (m, 3, 1);
case GSK_MATRIX_CATEGORY_UNKNOWN:
case GSK_MATRIX_CATEGORY_ANY:
case GSK_MATRIX_CATEGORY_INVERTIBLE:
case GSK_MATRIX_CATEGORY_2D_AFFINE:
{
graphene_vec3_t col1;
graphene_vec3_t col2;
/* Scale */
graphene_vec3_init (&col1,
graphene_matrix_get_value (m, 0, 0),
graphene_matrix_get_value (m, 1, 0),
graphene_matrix_get_value (m, 2, 0));
md->translate_x = graphene_matrix_get_value (m, 3, 0);
md->translate_y = graphene_matrix_get_value (m, 3, 1);
graphene_vec3_init (&col2,
graphene_matrix_get_value (m, 0, 1),
graphene_matrix_get_value (m, 1, 1),
graphene_matrix_get_value (m, 2, 1));
graphene_vec3_init (&col1,
graphene_matrix_get_value (m, 0, 0),
graphene_matrix_get_value (m, 1, 0),
graphene_matrix_get_value (m, 2, 0));
md->scale_x = graphene_vec3_length (&col1);
md->scale_y = graphene_vec3_length (&col2);
graphene_vec3_init (&col2,
graphene_matrix_get_value (m, 0, 1),
graphene_matrix_get_value (m, 1, 1),
graphene_matrix_get_value (m, 2, 1));
/* A simple matrix (in our case) is one that doesn't do anything but scale
* and/or translate.
*
* For orher matrices, we fall back to offscreen drawing.
*/
md->simple = TRUE;
{
static const guchar check_zero[4][4] = {
{ 0, 1, 0, 1 }, /* If any of the values marked as '1' here is non-zero, */
{ 1, 0, 0, 1 }, /* We have to resort to offscreen drawing later on. */
{ 1, 1, 0, 1 },
{ 0, 0, 0, 0 },
};
int x, y;
md->scale_x = graphene_vec3_length (&col1);
md->scale_y = graphene_vec3_length (&col2);
}
break;
default:
{}
}
for (x = 0; x < 4; x ++)
for (y = 0; y < 4; y ++)
if (check_zero[y][x] &&
graphene_matrix_get_value (m, y, x) != 0.0f)
{
md->simple = FALSE;
goto out;
}
}
out:
md->only_translation = (md->simple && md->scale_x == 1 && md->scale_y == 1);
}
void
ops_transform_bounds_modelview (const RenderOpBuilder *builder,
const graphene_rect_t *src,
graphene_rect_t *dst)
{
const float scale = ops_get_scale (builder);
const MatrixStackEntry *head;
g_assert (builder->mv_stack != NULL);
g_assert (builder->mv_stack->len >= 1);
head = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
if (head->metadata.only_translation)
{
*dst = *src;
graphene_rect_offset (dst,
head->metadata.translate_x,
head->metadata.translate_y);
}
else
{
graphene_matrix_transform_bounds (builder->current_modelview,
src,
dst);
}
graphene_rect_offset (dst, builder->dx * scale, builder->dy * scale);
}
gboolean
ops_modelview_is_simple (const RenderOpBuilder *builder)
{
const MatrixStackEntry *head;
@@ -119,32 +154,7 @@ ops_transform_bounds_modelview (const RenderOpBuilder *builder,
head = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
switch (head->metadata.category)
{
case GSK_MATRIX_CATEGORY_IDENTITY:
*dst = *src;
break;
case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
*dst = *src;
dst->origin.x += head->metadata.translate_x;
dst->origin.y += head->metadata.translate_y;
break;
/* TODO: Handle scale */
case GSK_MATRIX_CATEGORY_2D_AFFINE:
case GSK_MATRIX_CATEGORY_UNKNOWN:
case GSK_MATRIX_CATEGORY_ANY:
case GSK_MATRIX_CATEGORY_INVERTIBLE:
default:
graphene_matrix_transform_bounds (builder->current_modelview,
src,
dst);
}
dst->origin.x += builder->dx * head->metadata.scale_x;
dst->origin.y += builder->dy * head->metadata.scale_y;
return head->metadata.simple;
}
void
@@ -293,8 +303,8 @@ ops_has_clip (RenderOpBuilder *self)
}
static void
ops_set_modelview_internal (RenderOpBuilder *builder,
const graphene_matrix_t *modelview)
ops_set_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *modelview)
{
RenderOp op;
@@ -328,12 +338,9 @@ ops_set_modelview_internal (RenderOpBuilder *builder,
builder->current_program_state->modelview = *modelview;
}
/* This sets the modelview to the given one without looking at the
* one that's currently set */
void
ops_set_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
GskMatrixCategory mv_category)
ops_push_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv)
{
MatrixStackEntry *entry;
@@ -346,64 +353,10 @@ ops_set_modelview (RenderOpBuilder *builder,
entry = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
entry->matrix = *mv;
entry->metadata.category = mv_category;
entry->metadata.dx_before = builder->dx;
entry->metadata.dy_before = builder->dy;
extract_matrix_metadata (mv, &entry->metadata);
builder->dx = 0;
builder->dy = 0;
builder->current_modelview = &entry->matrix;
ops_set_modelview_internal (builder, &entry->matrix);
}
/* This sets the given modelview to the one we get when multiplying
* the given modelview with the current one. */
void
ops_push_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
GskMatrixCategory mv_category)
{
float scale = ops_get_scale (builder);
MatrixStackEntry *entry;
if (G_UNLIKELY (builder->mv_stack == NULL))
builder->mv_stack = g_array_new (FALSE, TRUE, sizeof (MatrixStackEntry));
g_assert (builder->mv_stack != NULL);
g_array_set_size (builder->mv_stack, builder->mv_stack->len + 1);
entry = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
if (G_LIKELY (builder->mv_stack->len >= 2))
{
const MatrixStackEntry *cur;
cur = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 2);
/* Multiply given matrix with current modelview */
graphene_matrix_multiply (mv, &cur->matrix, &entry->matrix);
graphene_matrix_translate (&entry->matrix,
&(graphene_point3d_t) { builder->dx * scale, builder->dy * scale, 0});
entry->metadata.category = MIN (mv_category, cur->metadata.category);
}
else
{
entry->matrix = *mv;
entry->metadata.category = mv_category;
}
entry->metadata.dx_before = builder->dx;
entry->metadata.dy_before = builder->dy;
extract_matrix_metadata (mv, &entry->metadata);
builder->dx = 0;
builder->dy = 0;
builder->current_modelview = &entry->matrix;
ops_set_modelview_internal (builder, &entry->matrix);
ops_set_modelview (builder, mv);
}
void
@@ -415,10 +368,6 @@ ops_pop_modelview (RenderOpBuilder *builder)
g_assert (builder->mv_stack);
g_assert (builder->mv_stack->len >= 1);
head = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
builder->dx = head->metadata.dx_before;
builder->dy = head->metadata.dy_before;
builder->mv_stack->len --;
head = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
m = &head->matrix;
@@ -426,7 +375,7 @@ ops_pop_modelview (RenderOpBuilder *builder)
if (builder->mv_stack->len >= 1)
{
builder->current_modelview = m;
ops_set_modelview_internal (builder, m);
ops_set_modelview (builder, m);
}
else
{
@@ -735,9 +684,6 @@ ops_draw (RenderOpBuilder *builder,
builder->buffer_size += sizeof (GskQuadVertex) * GL_N_VERTICES;
}
/* The offset is only valid for the current modelview.
* Setting a new modelview will add the offset to that matrix
* and reset the internal offset to 0. */
void
ops_offset (RenderOpBuilder *builder,
float x,
+4 -10
View File
@@ -8,7 +8,6 @@
#include "gskgldriverprivate.h"
#include "gskroundedrectprivate.h"
#include "gskglrendererprivate.h"
#include "gskrendernodeprivate.h"
#define GL_N_VERTICES 6
#define GL_N_PROGRAMS 11
@@ -22,10 +21,8 @@ typedef struct
float scale_x;
float scale_y;
float dx_before;
float dy_before;
GskMatrixCategory category;
guint simple : 1;
guint only_translation : 1;
} OpsMatrixMetadata;
typedef struct
@@ -280,12 +277,9 @@ void ops_dump_framebuffer (RenderOpBuilder *builder,
void ops_finish (RenderOpBuilder *builder);
void ops_push_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
GskMatrixCategory mv_category);
void ops_set_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
GskMatrixCategory mv_category);
const graphene_matrix_t *mv);
void ops_pop_modelview (RenderOpBuilder *builder);
gboolean ops_modelview_is_simple (const RenderOpBuilder *builder);
float ops_get_scale (const RenderOpBuilder *builder);
void ops_set_program (RenderOpBuilder *builder,
+5 -7
View File
@@ -1,8 +1,6 @@
#include "gskglshadowcacheprivate.h"
#define MAX_UNUSED_FRAMES (16 * 5) /* 5 seconds? */
typedef struct
{
GskRoundedRect outline;
@@ -15,7 +13,7 @@ typedef struct
float blur_radius;
int texture_id;
int unused_frames;
guint used : 1;
} CacheItem;
static gboolean
@@ -69,7 +67,7 @@ gsk_gl_shadow_cache_begin_frame (GskGLShadowCache *self,
{
CacheItem *item = &g_array_index (self->textures, CacheItem, i);
if (item->unused_frames > MAX_UNUSED_FRAMES)
if (!item->used)
{
gsk_gl_driver_destroy_texture (gl_driver, item->texture_id);
g_array_remove_index_fast (self->textures, i);
@@ -78,7 +76,7 @@ gsk_gl_shadow_cache_begin_frame (GskGLShadowCache *self,
}
else
{
item->unused_frames ++;
item->used = FALSE;
}
}
}
@@ -115,7 +113,7 @@ gsk_gl_shadow_cache_get_texture_id (GskGLShadowCache *self,
if (item == NULL)
return 0;
item->unused_frames = 0;
item->used = TRUE;
g_assert (item->texture_id != 0);
@@ -139,6 +137,6 @@ gsk_gl_shadow_cache_commit (GskGLShadowCache *self,
item->outline = *shadow_rect;
item->blur_radius = blur_radius;
item->unused_frames = 0;
item->used = TRUE;
item->texture_id = texture_id;
}
+39 -5
View File
@@ -42,7 +42,6 @@
#include "gskdebugprivate.h"
#include "gskrendererprivate.h"
#include "gskrendernodeparserprivate.h"
#include <graphene-gobject.h>
@@ -329,11 +328,19 @@ gsk_render_node_diff (GskRenderNode *node1,
GBytes *
gsk_render_node_serialize (GskRenderNode *node)
{
GVariant *node_variant, *variant;
GBytes *result;
char *str;
str = gsk_render_node_serialize_to_string (node);
result = g_bytes_new_take (str, strlen (str));
node_variant = gsk_render_node_serialize_node (node);
variant = g_variant_new ("(suuv)",
GSK_RENDER_NODE_SERIALIZATION_ID,
(guint32) GSK_RENDER_NODE_SERIALIZATION_VERSION,
(guint32) gsk_render_node_get_node_type (node),
node_variant);
result = g_variant_get_data_as_bytes (variant);
g_variant_unref (variant);
return result;
}
@@ -390,9 +397,36 @@ GskRenderNode *
gsk_render_node_deserialize (GBytes *bytes,
GError **error)
{
char *id_string;
guint32 version, node_type;
GVariant *variant, *node_variant;
GskRenderNode *node = NULL;
node = gsk_render_node_deserialize_from_string ((const char *)g_bytes_get_data (bytes, NULL));
variant = g_variant_new_from_bytes (G_VARIANT_TYPE ("(suuv)"), bytes, FALSE);
g_variant_get (variant, "(suuv)", &id_string, &version, &node_type, &node_variant);
if (!g_str_equal (id_string, GSK_RENDER_NODE_SERIALIZATION_ID))
{
g_set_error (error, GSK_SERIALIZATION_ERROR, GSK_SERIALIZATION_UNSUPPORTED_FORMAT,
"Data not in GskRenderNode serialization format.");
goto out;
}
if (version != GSK_RENDER_NODE_SERIALIZATION_VERSION)
{
g_set_error (error, GSK_SERIALIZATION_ERROR, GSK_SERIALIZATION_UNSUPPORTED_VERSION,
"Format version %u not supported.", version);
goto out;
}
node = gsk_render_node_deserialize_node (node_type, node_variant, error);
out:
g_free (id_string);
g_variant_unref (node_variant);
g_variant_unref (variant);
return node;
}
+3 -24
View File
@@ -2547,30 +2547,9 @@ gsk_transform_node_new_with_category (GskRenderNode *child,
graphene_matrix_init_from_matrix (&self->transform, transform);
self->category = category;
switch (category)
{
case GSK_MATRIX_CATEGORY_IDENTITY:
graphene_rect_init_from_rect (&self->render_node.bounds, &child->bounds);
break;
case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
{
graphene_rect_init_from_rect (&self->render_node.bounds, &child->bounds);
self->render_node.bounds.origin.x += graphene_matrix_get_value (transform, 3, 0);
self->render_node.bounds.origin.y += graphene_matrix_get_value (transform, 3, 1);
}
break;
case GSK_MATRIX_CATEGORY_2D_AFFINE:
case GSK_MATRIX_CATEGORY_ANY:
case GSK_MATRIX_CATEGORY_UNKNOWN:
case GSK_MATRIX_CATEGORY_INVERTIBLE:
default:
graphene_matrix_transform_bounds (&self->transform,
&child->bounds,
&self->render_node.bounds);
}
graphene_matrix_transform_bounds (&self->transform,
&child->bounds,
&self->render_node.bounds);
return &self->render_node;
}
File diff suppressed because it is too large Load Diff
-10
View File
@@ -1,10 +0,0 @@
#ifndef __GSK_RENDER_NODE_PARSER_PRIVATE_H__
#define __GSK_RENDER_NODE_PARSER_PRIVATE_H__
#include "gskrendernode.h"
GskRenderNode * gsk_render_node_deserialize_from_string (const char *string);
char * gsk_render_node_serialize_to_string (GskRenderNode *root);
#endif
-21
View File
@@ -535,24 +535,3 @@ gsk_rounded_rect_equal (gconstpointer rect1,
&& graphene_size_equal (&self1->corner[2], &self2->corner[2])
&& graphene_size_equal (&self1->corner[3], &self2->corner[3]);
}
char *
gsk_rounded_rect_to_string (const GskRoundedRect *self)
{
return g_strdup_printf ("GskRoundedRect %p: Bounds: (%f, %f, %f, %f)"
" Corners: (%f, %f) (%f, %f) (%f, %f) (%f, %f)",
self,
self->bounds.origin.x,
self->bounds.origin.y,
self->bounds.size.width,
self->bounds.size.height,
self->corner[0].width,
self->corner[0].height,
self->corner[1].width,
self->corner[1].height,
self->corner[2].width,
self->corner[2].height,
self->corner[3].width,
self->corner[3].height);
}
-2
View File
@@ -16,8 +16,6 @@ void gsk_rounded_rect_to_float (const GskRounde
gboolean gsk_rounded_rect_equal (gconstpointer rect1,
gconstpointer rect2);
char * gsk_rounded_rect_to_string (const GskRoundedRect *self);
G_END_DECLS
-1
View File
@@ -33,7 +33,6 @@ gsk_private_sources = files([
'gskdebug.c',
'gskprivate.c',
'gskprofiler.c',
'gskrendernodeparser.c',
'gl/gskshaderbuilder.c',
'gl/gskglprofiler.c',
'gl/gskglrenderer.c',
+1 -5
View File
@@ -626,11 +626,7 @@ gtk_icon_view_item_accessible_grab_focus (AtkComponent *component)
_gtk_icon_view_set_cursor_item (GTK_ICON_VIEW (item->widget), item->item, NULL);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item->widget));
if (gtk_widget_is_toplevel (toplevel))
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (toplevel));
G_GNUC_END_IGNORE_DEPRECATIONS
}
gtk_window_present (GTK_WINDOW (toplevel));
return TRUE;
}
+1 -5
View File
@@ -1179,11 +1179,7 @@ gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent,
gdk_x11_get_server_time (gtk_widget_get_surface (widget)));
else
#endif
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (toplevel));
G_GNUC_END_IGNORE_DEPRECATIONS
}
gtk_window_present (GTK_WINDOW (toplevel));
}
return TRUE;
-3
View File
@@ -608,12 +608,9 @@ gtk_widget_accessible_grab_focus (AtkComponent *component)
gtk_window_present_with_time (GTK_WINDOW (toplevel),
gdk_x11_get_server_time (gtk_widget_get_surface (widget)));
#else
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (toplevel));
G_GNUC_END_IGNORE_DEPRECATIONS
#endif
}
return TRUE;
}
-1
View File
@@ -71,7 +71,6 @@
#include <gtk/a11y/gtkstackaccessible.h>
#include <gtk/a11y/gtkstatusbaraccessible.h>
#include <gtk/a11y/gtkswitchaccessible.h>
#include <gtk/a11y/gtktextaccessible.h>
#include <gtk/a11y/gtktextcellaccessible.h>
#include <gtk/a11y/gtktextviewaccessible.h>
#include <gtk/a11y/gtktogglebuttonaccessible.h>
-4
View File
@@ -1002,9 +1002,7 @@ gtk_about_dialog_activate_link (GtkAboutDialog *about,
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
return TRUE;
@@ -2411,9 +2409,7 @@ gtk_show_about_dialog (GtkWindow *parent,
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
/**
+2 -4
View File
@@ -1076,11 +1076,9 @@ gtk_accel_label_set_use_underline (GtkAccelLabel *accel_label,
* gtk_accel_label_get_use_underline:
* @accel_label: a #GtkAccelLabel
*
* Returns whether the accel label interprets underscores in it's
* label property as mnemonic indicators.
* Returns: Whether the accel label interprets underscores in it's
* GtkAccelLabel:label property as mnemonic indicators.
* See gtk_accel_label_set_use_underline() and gtk_label_set_use_underline();
*
* Returns: whether the accel label uses mnemonic underlines
*/
gboolean
gtk_accel_label_get_use_underline (GtkAccelLabel *accel_label)
+3 -2
View File
@@ -364,7 +364,7 @@ gtk_cell_renderer_combo_editing_done (GtkCellEditable *combo,
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (combo)))
{
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
new_text = g_strdup (gtk_entry_get_text (entry));
}
else
{
@@ -466,7 +466,8 @@ gtk_cell_renderer_combo_start_editing (GtkCellRenderer *cell,
g_object_get (cell_text, "text", &text, NULL);
if (text)
gtk_editable_set_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo))), text);
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo))),
text);
g_free (text);
}
else
+1 -1
View File
@@ -273,7 +273,7 @@ gtk_cell_renderer_spin_focus_changed (GtkWidget *widget,
{
path = g_object_get_data (G_OBJECT (widget), GTK_CELL_RENDERER_SPIN_PATH);
new_text = gtk_editable_get_text (GTK_EDITABLE (widget));
new_text = gtk_entry_get_text (GTK_ENTRY (widget));
g_signal_emit_by_name (data, "edited", path, new_text);
}
}
+3 -3
View File
@@ -1798,7 +1798,7 @@ gtk_cell_renderer_text_editing_done (GtkCellEditable *entry,
return;
path = g_object_get_data (G_OBJECT (entry), GTK_CELL_RENDERER_TEXT_PATH);
new_text = gtk_editable_get_text (GTK_EDITABLE (entry));
new_text = gtk_entry_get_text (GTK_ENTRY (entry));
g_signal_emit (data, text_cell_renderer_signals[EDITED], 0, path, new_text);
}
@@ -1905,10 +1905,10 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
gtk_entry_set_has_frame (GTK_ENTRY (priv->entry), FALSE);
gtk_entry_set_alignment (GTK_ENTRY (priv->entry), xalign);
gtk_editable_set_width_chars (GTK_EDITABLE (priv->entry), 5);
gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), 5);
if (priv->text)
gtk_editable_set_text (GTK_EDITABLE (priv->entry), priv->text);
gtk_entry_set_text (GTK_ENTRY (priv->entry), priv->text);
g_object_set_data_full (G_OBJECT (priv->entry), I_(GTK_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);
+2 -3
View File
@@ -557,9 +557,8 @@ gtk_check_button_set_inconsistent (GtkCheckButton *check_button,
* gtk_check_button_get_inconsistent:
* @check_button: a #GtkCheckButton
*
* Returns whether the check button is in an inconsistent state.
*
* Returns: %TRUE if @check_button is currently in an 'in between' state, %FALSE otherwise.
* Returns: %TRUE if @check_button is currently in an 'in between' state,
* %FALSE otherwise.
*/
gboolean
gtk_check_button_get_inconsistent (GtkCheckButton *check_button)
-2
View File
@@ -555,9 +555,7 @@ gtk_color_button_clicked (GtkButton *b,
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (priv->cs_dialog), &priv->rgba);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (priv->cs_dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
+1 -1
View File
@@ -105,7 +105,7 @@ entry_set_rgba (GtkColorEditor *editor,
scale_round (color->red, 255),
scale_round (color->green, 255),
scale_round (color->blue, 255));
gtk_editable_set_text (GTK_EDITABLE (editor->priv->entry), text);
gtk_entry_set_text (GTK_ENTRY (editor->priv->entry), text);
editor->priv->text_changed = FALSE;
g_free (text);
}
+1 -1
View File
@@ -2424,7 +2424,7 @@ gtk_combo_box_entry_active_changed (GtkComboBox *combo_box,
g_signal_emit (combo_box, combo_box_signals[FORMAT_ENTRY_TEXT], 0,
path_str, &text);
gtk_editable_set_text (GTK_EDITABLE (entry), text);
gtk_entry_set_text (entry, text);
g_signal_handlers_unblock_by_func (entry,
gtk_combo_box_entry_contents_changed,
+1 -1
View File
@@ -583,7 +583,7 @@ gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box)
GtkWidget *entry;
entry = gtk_bin_get_child (GTK_BIN (combo_box));
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
}
else if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo_box), &iter))
{
+11 -1
View File
@@ -128,6 +128,7 @@ struct _GtkContainerPrivate
enum {
ADD,
REMOVE,
SET_FOCUS_CHILD,
LAST_SIGNAL
};
@@ -303,6 +304,15 @@ gtk_container_class_init (GtkContainerClass *class)
NULL,
G_TYPE_NONE, 1,
GTK_TYPE_WIDGET);
container_signals[SET_FOCUS_CHILD] =
g_signal_new (I_("set-focus-child"),
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkContainerClass, set_focus_child),
NULL, NULL,
NULL,
G_TYPE_NONE, 1,
GTK_TYPE_WIDGET);
if (GtkContainer_private_offset != 0)
g_type_class_adjust_private_offset (class, &GtkContainer_private_offset);
@@ -1559,7 +1569,7 @@ gtk_container_set_focus_child (GtkContainer *container,
if (child)
g_return_if_fail (GTK_IS_WIDGET (child));
GTK_CONTAINER_GET_CLASS (container)->set_focus_child (container, child);
g_signal_emit (container, container_signals[SET_FOCUS_CHILD], 0, child);
}
/**
+2 -3
View File
@@ -516,7 +516,6 @@ gtk_editable_get_text (GtkEditable *editable)
/**
* gtk_editable_set_text:
* @editable: a #GtkEditable
* @text: the text to set
*
* Sets the text in the editable to the given value,
* replacing the current contents.
@@ -912,7 +911,7 @@ gtk_editable_finish_delegate (GtkEditable *editable)
}
/**
* gtk_editable_delegate_set_property:
* gtk_editable_set_property:
* @object: a #GObject
* @prop_id: a property ID
* @value: value to set
@@ -970,7 +969,7 @@ gtk_editable_delegate_set_property (GObject *object,
}
/**
* gtk_editable_delegate_get_property:
* gtk_editable_get_property:
* @object: a #GObject
* @prop_id: a property ID
* @value: value to set
+128 -18
View File
@@ -1113,7 +1113,7 @@ gtk_entry_get_property (GObject *object,
break;
case PROP_TEXT_LENGTH:
g_value_set_uint (value, gtk_entry_get_text_length (entry));
g_value_set_uint (value, gtk_entry_buffer_get_length (get_buffer (entry)));
break;
case PROP_PROGRESS_FRACTION:
@@ -1835,7 +1835,6 @@ GtkWidget*
gtk_entry_new_with_buffer (GtkEntryBuffer *buffer)
{
g_return_val_if_fail (GTK_IS_ENTRY_BUFFER (buffer), NULL);
return g_object_new (GTK_TYPE_ENTRY, "buffer", buffer, NULL);
}
@@ -1883,6 +1882,25 @@ gtk_entry_set_buffer (GtkEntry *entry,
gtk_text_set_buffer (GTK_TEXT (priv->text), buffer);
}
/**
* gtk_entry_set_text:
* @entry: a #GtkEntry
* @text: the new text
*
* Sets the text in the widget to the given
* value, replacing the current contents.
*
* See gtk_entry_buffer_set_text().
*/
void
gtk_entry_set_text (GtkEntry *entry,
const gchar *text)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
gtk_editable_set_text (GTK_EDITABLE (priv->text), text);
}
/**
* gtk_entry_set_visibility:
* @entry: a #GtkEntry
@@ -2032,6 +2050,29 @@ gtk_entry_get_overwrite_mode (GtkEntry *entry)
}
/**
* gtk_entry_get_text:
* @entry: a #GtkEntry
*
* Retrieves the contents of the entry widget.
* See also gtk_editable_get_chars().
*
* This is equivalent to getting @entry's #GtkEntryBuffer and calling
* gtk_entry_buffer_get_text() on it.
*
* Returns: a pointer to the contents of the widget as a
* string. This string points to internally allocated
* storage in the widget and must not be freed, modified or
* stored.
**/
const gchar*
gtk_entry_get_text (GtkEntry *entry)
{
g_return_val_if_fail (GTK_IS_ENTRY (entry), NULL);
return gtk_entry_buffer_get_text (get_buffer (entry));
}
/**
* gtk_entry_set_max_length:
* @entry: a #GtkEntry
@@ -2051,11 +2092,8 @@ void
gtk_entry_set_max_length (GtkEntry *entry,
gint max)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_if_fail (GTK_IS_ENTRY (entry));
gtk_text_set_max_length (GTK_TEXT (priv->text), max);
gtk_entry_buffer_set_max_length (get_buffer (entry), max);
}
/**
@@ -2074,11 +2112,9 @@ gtk_entry_set_max_length (GtkEntry *entry,
gint
gtk_entry_get_max_length (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
return gtk_text_get_max_length (GTK_TEXT (priv->text));
return gtk_entry_buffer_get_max_length (get_buffer (entry));
}
/**
@@ -2098,11 +2134,9 @@ gtk_entry_get_max_length (GtkEntry *entry)
guint16
gtk_entry_get_text_length (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
return gtk_text_get_text_length (GTK_TEXT (priv->text));
return gtk_entry_buffer_get_length (get_buffer (entry));
}
/**
@@ -2148,6 +2182,83 @@ gtk_entry_get_activates_default (GtkEntry *entry)
return gtk_text_get_activates_default (GTK_TEXT (priv->text));
}
/**
* gtk_entry_set_width_chars:
* @entry: a #GtkEntry
* @n_chars: width in chars
*
* Changes the size request of the entry to be about the right size
* for @n_chars characters. Note that it changes the size
* request, the size can still be affected by
* how you pack the widget into containers. If @n_chars is -1, the
* size reverts to the default entry size.
**/
void
gtk_entry_set_width_chars (GtkEntry *entry,
gint n_chars)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_if_fail (GTK_IS_ENTRY (entry));
gtk_editable_set_width_chars (GTK_EDITABLE (priv->text), n_chars);
}
/**
* gtk_entry_get_width_chars:
* @entry: a #GtkEntry
*
* Gets the value set by gtk_entry_set_width_chars().
*
* Returns: number of chars to request space for, or negative if unset
**/
gint
gtk_entry_get_width_chars (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
return gtk_editable_get_width_chars (GTK_EDITABLE (priv->text));
}
/**
* gtk_entry_set_max_width_chars:
* @entry: a #GtkEntry
* @n_chars: the new desired maximum width, in characters
*
* Sets the desired maximum width in characters of @entry.
*/
void
gtk_entry_set_max_width_chars (GtkEntry *entry,
gint n_chars)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_if_fail (GTK_IS_ENTRY (entry));
gtk_editable_set_max_width_chars (GTK_EDITABLE (priv->text), n_chars);
}
/**
* gtk_entry_get_max_width_chars:
* @entry: a #GtkEntry
*
* Retrieves the desired maximum width of @entry, in characters.
* See gtk_entry_set_max_width_chars().
*
* Returns: the maximum width of the entry, in characters
*/
gint
gtk_entry_get_max_width_chars (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
return gtk_editable_get_max_width_chars (GTK_EDITABLE (priv->text));
}
/**
* gtk_entry_set_has_frame:
* @entry: a #GtkEntry
@@ -3252,11 +3363,11 @@ void
gtk_entry_set_placeholder_text (GtkEntry *entry,
const gchar *text)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_if_fail (GTK_IS_ENTRY (entry));
gtk_text_set_placeholder_text (GTK_TEXT (priv->text), text);
//FIXME
g_object_notify_by_pspec (G_OBJECT (entry), entry_props[PROP_PLACEHOLDER_TEXT]);
}
/**
@@ -3273,11 +3384,10 @@ gtk_entry_set_placeholder_text (GtkEntry *entry,
const gchar *
gtk_entry_get_placeholder_text (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), NULL);
return gtk_text_get_placeholder_text (GTK_TEXT (priv->text));
//FIXME
return NULL;
}
/**
+21
View File
@@ -184,6 +184,27 @@ void gtk_entry_set_activates_default (GtkEntry *entry,
GDK_AVAILABLE_IN_ALL
gboolean gtk_entry_get_activates_default (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_width_chars (GtkEntry *entry,
gint n_chars);
GDK_AVAILABLE_IN_ALL
gint gtk_entry_get_width_chars (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_max_width_chars (GtkEntry *entry,
gint n_chars);
GDK_AVAILABLE_IN_ALL
gint gtk_entry_get_max_width_chars (GtkEntry *entry);
/* Somewhat more convenient than the GtkEditable generic functions
*/
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_text (GtkEntry *entry,
const gchar *text);
/* returns a reference to the text */
GDK_AVAILABLE_IN_ALL
const gchar* gtk_entry_get_text (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_alignment (GtkEntry *entry,
gfloat xalign);
+13 -13
View File
@@ -1184,7 +1184,7 @@ gtk_entry_completion_complete (GtkEntryCompletion *completion)
g_free (completion->priv->case_normalized_key);
tmp = g_utf8_normalize (gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry)),
tmp = g_utf8_normalize (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)),
-1, G_NORMALIZE_ALL);
completion->priv->case_normalized_key = g_utf8_casefold (tmp, -1);
g_free (tmp);
@@ -1565,7 +1565,7 @@ gtk_entry_completion_match_selected (GtkEntryCompletion *completion,
gchar *str = NULL;
gtk_tree_model_get (model, iter, completion->priv->text_column, &str, -1);
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry), str ? str : "");
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), str ? str : "");
/* move cursor to the end */
gtk_editable_set_position (GTK_EDITABLE (completion->priv->entry), -1);
@@ -1673,7 +1673,7 @@ gtk_entry_completion_real_insert_prefix (GtkEntryCompletion *completion,
prefix_len = g_utf8_strlen (prefix, -1);
key = gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry));
key = gtk_entry_get_text (GTK_ENTRY (completion->priv->entry));
key_len = g_utf8_strlen (key, -1);
if (prefix_len > key_len)
@@ -2005,7 +2005,7 @@ gtk_entry_completion_timeout (gpointer data)
completion->priv->completion_timeout = 0;
if (completion->priv->filter_model &&
g_utf8_strlen (gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry)), -1)
g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)), -1)
>= completion->priv->minimum_key_length)
{
gint matches;
@@ -2160,8 +2160,8 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
if (completion->priv->inline_selection &&
completion->priv->completion_prefix)
{
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry),
completion->priv->completion_prefix);
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry),
completion->priv->completion_prefix);
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
}
}
@@ -2189,7 +2189,7 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
if (completion->priv->completion_prefix == NULL)
completion->priv->completion_prefix = g_strdup (gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry)));
completion->priv->completion_prefix = g_strdup (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)));
g_signal_emit_by_name (completion, "cursor-on-match", model,
&child_iter, &entry_set);
@@ -2206,8 +2206,8 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
if (completion->priv->inline_selection &&
completion->priv->completion_prefix)
{
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry),
completion->priv->completion_prefix);
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry),
completion->priv->completion_prefix);
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
}
}
@@ -2238,10 +2238,10 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
if (keyval == GDK_KEY_Escape)
{
if (completion->priv->completion_prefix)
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry),
completion->priv->completion_prefix);
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry),
completion->priv->completion_prefix);
else
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry), "");
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), "");
}
/* Move the cursor to the end for Right/Esc */
@@ -2312,7 +2312,7 @@ keypress_completion_out:
completion->priv->text_column, &str,
-1);
gtk_editable_set_text (GTK_EDITABLE (widget), str);
gtk_entry_set_text (GTK_ENTRY (widget), str);
/* move the cursor to the end */
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
+1 -1
View File
@@ -54,7 +54,7 @@ typedef struct _GtkEntryCompletionPrivate GtkEntryCompletionPrivate;
* Note that @key is normalized and case-folded (see g_utf8_normalize()
* and g_utf8_casefold()). If this is not appropriate, match functions
* have access to the unmodified key via
* `gtk_editable_get_text (GTK_EDITABLE (gtk_entry_completion_get_entry ()))`.
* `gtk_entry_get_text (GTK_ENTRY (gtk_entry_completion_get_entry ()))`.
*
* Returns: %TRUE if @iter should be displayed as a possible completion
* for @key
+3 -22
View File
@@ -17,20 +17,7 @@
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
/**
* SECTION:gtkeventcontrollerlegacy
* @Short_description: Event controller for miscellaneous events
* @Title: GtkEventControllerLegacy
* @See_also: #GtkEventController
*
* #GtkEventControllerLegacy is an event controller that gives you
* direct access to the event stream. It should only be used as a
* last resort if none of the other event controllers or gestures
* do the job.
**/
#include "config.h"
#include "gtkeventcontrollerlegacy.h"
#include "gtkeventcontrollerprivate.h"
#include "gtkmarshalers.h"
@@ -80,10 +67,11 @@ gtk_event_controller_legacy_class_init (GtkEventControllerLegacyClass *klass)
* @controller: the object which received the signal.
* @event: the #GdkEvent which triggered this signal
*
* Emitted for each GDK event delivered to @controller.
* The GTK+ main loop will emit this signal for each GDK event delivered
* to @controller.
*
* Returns: %TRUE to stop other handlers from being invoked for the event
* and the emission of this signal. %FALSE to propagate the event further.
* and the emission of this signal. %FALSE to propagate the event further.
*/
signals[EVENT] =
g_signal_new (I_("event"),
@@ -103,13 +91,6 @@ gtk_event_controller_legacy_init (GtkEventControllerLegacy *controller)
{
}
/**
* gtk_event_controller_legacy_new:
*
* Creates a new legacy event controller.
*
* Returns: the newly created event controller.
*/
GtkEventController *
gtk_event_controller_legacy_new (void)
{
+1 -5
View File
@@ -2705,11 +2705,7 @@ open_dialog (GtkFileChooserButton *button)
gtk_widget_set_sensitive (priv->combo_box, FALSE);
if (priv->dialog)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (priv->dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
gtk_window_present (GTK_WINDOW (priv->dialog));
else
gtk_native_dialog_show (GTK_NATIVE_DIALOG (priv->native));
}
+5 -5
View File
@@ -806,7 +806,7 @@ insert_text_callback (GtkFileChooserEntry *chooser_entry,
(new_text_length > 0 &&
*position <= 1 &&
gtk_entry_get_text_length (GTK_ENTRY (chooser_entry)) >= 2 &&
gtk_editable_get_text (GTK_EDITABLE (chooser_entry))[1] == ':'))
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':'))
{
gtk_widget_error_bell (GTK_WIDGET (chooser_entry));
g_signal_stop_emission_by_name (chooser_entry, "insert_text");
@@ -825,7 +825,7 @@ delete_text_callback (GtkFileChooserEntry *chooser_entry,
/* If deleting a drive letter, delete the colon, too */
if (start_pos == 0 && end_pos == 1 &&
gtk_entry_get_text_length (GTK_ENTRY (chooser_entry)) >= 2 &&
gtk_editable_get_text (GTK_EDITABLE (chooser_entry))[1] == ':')
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':')
{
g_signal_handlers_block_by_func (chooser_entry,
G_CALLBACK (delete_text_callback),
@@ -913,7 +913,7 @@ _gtk_file_chooser_entry_get_current_folder (GtkFileChooserEntry *chooser_entry)
g_return_val_if_fail (GTK_IS_FILE_CHOOSER_ENTRY (chooser_entry), NULL);
return gtk_file_chooser_get_directory_for_text (chooser_entry,
gtk_editable_get_text (GTK_EDITABLE (chooser_entry)));
gtk_entry_get_text (GTK_ENTRY (chooser_entry)));
}
/**
@@ -935,7 +935,7 @@ _gtk_file_chooser_entry_get_file_part (GtkFileChooserEntry *chooser_entry)
g_return_val_if_fail (GTK_IS_FILE_CHOOSER_ENTRY (chooser_entry), NULL);
text = gtk_editable_get_text (GTK_EDITABLE (chooser_entry));
text = gtk_entry_get_text (GTK_ENTRY (chooser_entry));
last_slash = strrchr (text, G_DIR_SEPARATOR);
if (last_slash)
return last_slash + 1;
@@ -1044,7 +1044,7 @@ _gtk_file_chooser_entry_select_filename (GtkFileChooserEntry *chooser_entry)
if (chooser_entry->action == GTK_FILE_CHOOSER_ACTION_SAVE)
{
str = gtk_editable_get_text (GTK_EDITABLE (chooser_entry));
str = gtk_entry_get_text (GTK_ENTRY (chooser_entry));
ext = g_strrstr (str, ".");
if (ext)
-2
View File
@@ -623,9 +623,7 @@ show_dialog (GtkFileChooserNative *self)
G_CALLBACK (dialog_update_preview_cb),
self);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (self->dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
+17 -17
View File
@@ -969,7 +969,7 @@ new_folder_popover_active (GtkWidget *button,
{
GtkFileChooserWidgetPrivate *priv = impl->priv;
gtk_editable_set_text (GTK_EDITABLE (priv->new_folder_name_entry), "");
gtk_entry_set_text (GTK_ENTRY (priv->new_folder_name_entry), "");
gtk_widget_set_sensitive (priv->new_folder_create_button, FALSE);
gtk_file_chooser_error_stack_set_error (GTK_FILE_CHOOSER_ERROR_STACK (priv->new_folder_error_stack),
FALSE,
@@ -1098,14 +1098,14 @@ check_valid_child_name (GtkFileChooserWidget *impl,
}
static void
new_folder_name_changed (GtkEditable *editable,
new_folder_name_changed (GtkEntry *entry,
GtkFileChooserWidget *impl)
{
GtkFileChooserWidgetPrivate *priv = impl->priv;
check_valid_child_name (impl,
priv->current_folder,
gtk_editable_get_text (editable),
gtk_entry_get_text (entry),
TRUE,
NULL,
priv->new_folder_error_stack,
@@ -1121,7 +1121,7 @@ new_folder_create_clicked (GtkButton *button,
GFile *file;
const gchar *name;
name = gtk_editable_get_text (GTK_EDITABLE (priv->new_folder_name_entry));
name = gtk_entry_get_text (GTK_ENTRY (priv->new_folder_name_entry));
file = g_file_get_child_for_display_name (priv->current_folder, name, &error);
gtk_popover_popdown (GTK_POPOVER (priv->new_folder_popover));
@@ -1570,7 +1570,7 @@ rename_file_name_changed (GtkEntry *entry,
check_valid_child_name (impl,
priv->current_folder,
gtk_editable_get_text (GTK_EDITABLE (entry)),
gtk_entry_get_text (entry),
file_type == G_FILE_TYPE_DIRECTORY,
priv->rename_file_source_file,
priv->rename_file_error_stack,
@@ -1594,7 +1594,7 @@ rename_file_rename_clicked (GtkButton *button,
gtk_popover_popdown (GTK_POPOVER (priv->rename_file_popover));
new_name = gtk_editable_get_text (GTK_EDITABLE (priv->rename_file_name_entry));
new_name = gtk_entry_get_text (GTK_ENTRY (priv->rename_file_name_entry));
dest = g_file_get_parent (priv->rename_file_source_file);
if (dest)
@@ -1638,7 +1638,7 @@ rename_selected_cb (GtkTreeModel *model,
rect.x, rect.y, &rect.x, &rect.y);
filename = g_file_get_basename (priv->rename_file_source_file);
gtk_editable_set_text (GTK_EDITABLE (priv->rename_file_name_entry), filename);
gtk_entry_set_text (GTK_ENTRY(priv->rename_file_name_entry), filename);
g_free (filename);
gtk_popover_set_pointing_to (GTK_POPOVER (priv->rename_file_popover), &rect);
@@ -2507,7 +2507,7 @@ location_entry_setup (GtkFileChooserWidget *impl)
_gtk_file_chooser_entry_set_action (GTK_FILE_CHOOSER_ENTRY (priv->location_entry), priv->action);
_gtk_file_chooser_entry_set_file_filter (GTK_FILE_CHOOSER_ENTRY (priv->location_entry),
priv->current_filter);
gtk_editable_set_width_chars (GTK_EDITABLE (priv->location_entry), 45);
gtk_entry_set_width_chars (GTK_ENTRY (priv->location_entry), 45);
gtk_entry_set_activates_default (GTK_ENTRY (priv->location_entry), TRUE);
gtk_widget_set_hexpand (priv->location_entry, TRUE);
}
@@ -5127,7 +5127,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
if (change_entry && !priv->auto_selecting_first_row)
{
g_signal_handlers_block_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), priv->browse_files_last_selected_name);
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), priv->browse_files_last_selected_name);
g_signal_handlers_unblock_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
@@ -5161,7 +5161,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
priv->browse_files_last_selected_name = NULL;
g_signal_handlers_block_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), "");
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), "");
g_signal_handlers_unblock_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
return;
}
@@ -5175,7 +5175,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
int len;
gboolean clear_entry;
entry_text = gtk_editable_get_text (GTK_EDITABLE (priv->location_entry));
entry_text = gtk_entry_get_text (GTK_ENTRY (priv->location_entry));
len = strlen (entry_text);
if (len != 0)
{
@@ -5199,7 +5199,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
if (clear_entry)
{
g_signal_handlers_block_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), "");
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), "");
g_signal_handlers_unblock_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
}
}
@@ -5389,7 +5389,7 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
priv->current_folder);
if (data->clear_entry)
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), "");
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), "");
}
/* Create a new list model. This is slightly evil; we store the result value
@@ -5498,7 +5498,7 @@ gtk_file_chooser_widget_set_current_name (GtkFileChooser *chooser,
priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
pending_select_files_free (impl);
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), name);
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), name);
}
static gchar *
@@ -5511,7 +5511,7 @@ gtk_file_chooser_widget_get_current_name (GtkFileChooser *chooser)
priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
NULL);
return g_strdup (gtk_editable_get_text (GTK_EDITABLE (priv->location_entry)));
return g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->location_entry)));
}
static gboolean
@@ -5692,7 +5692,7 @@ check_save_entry (GtkFileChooserWidget *impl,
chooser_entry = GTK_FILE_CHOOSER_ENTRY (priv->location_entry);
if (strlen (gtk_editable_get_text (GTK_EDITABLE (chooser_entry))) == 0)
if (strlen (gtk_entry_get_text (GTK_ENTRY (chooser_entry))) == 0)
{
*file_ret = NULL;
*is_well_formed_ret = TRUE;
@@ -7797,7 +7797,7 @@ location_set_user_text (GtkFileChooserWidget *impl,
{
GtkFileChooserWidgetPrivate *priv = impl->priv;
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), path);
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), path);
gtk_editable_set_position (GTK_EDITABLE (priv->location_entry), -1);
}
+1 -1
View File
@@ -28,7 +28,7 @@
/**
* SECTION:gtkfilterlistmodel
* @title: GtkFilterListModel
* @short_description: A list model that filters its items
* @short_description: a #GListModel that filters its items
* @see_also: #GListModel
*
* #GtkFilterListModel is a list model that filters a given other
+1 -1
View File
@@ -28,7 +28,7 @@
/**
* SECTION:gtkflattenlistmodel
* @title: GtkFlattenListModel
* @short_description: A list model that flattens a list of lists
* @short_description: a #GListModel that flattens a given listmodel
* @see_also: #GListModel
*
* #GtkFlattenListModel is a list model that takes a list model containing
-2
View File
@@ -995,9 +995,7 @@ gtk_font_button_clicked (GtkButton *button,
gtk_font_chooser_set_font_desc (font_dialog, priv->font_desc);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (priv->font_dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
+3 -3
View File
@@ -420,7 +420,7 @@ output_cb (GtkSpinButton *spin,
adjustment = gtk_spin_button_get_adjustment (spin);
value = gtk_adjustment_get_value (adjustment);
text = g_strdup_printf ("%2.4g", value);
gtk_editable_set_text (GTK_EDITABLE (spin), text);
gtk_spin_button_set_text (spin, text);
g_free (text);
return TRUE;
@@ -844,7 +844,7 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
priv->language = pango_language_get_default ();
/* Set default preview text */
gtk_editable_set_text (GTK_EDITABLE (priv->preview), priv->preview_text);
gtk_entry_set_text (GTK_ENTRY (priv->preview), priv->preview_text);
gtk_font_chooser_widget_update_preview_attributes (fontchooser);
@@ -2366,7 +2366,7 @@ gtk_font_chooser_widget_set_preview_text (GtkFontChooserWidget *fontchooser,
g_free (priv->preview_text);
priv->preview_text = g_strdup (text);
gtk_editable_set_text (GTK_EDITABLE (priv->preview), text);
gtk_entry_set_text (GTK_ENTRY (priv->preview), text);
g_object_notify (G_OBJECT (fontchooser), "preview-text");
+1 -1
View File
@@ -1476,7 +1476,7 @@ gtk_im_context_simple_add_table (GtkIMContextSimple *context_simple,
G_UNLOCK (global_tables);
}
/**
/*
* gtk_im_context_simple_add_compose_file:
* @context_simple: A #GtkIMContextSimple
* @compose_file: The path of compose file
+1 -4
View File
@@ -1533,10 +1533,7 @@ on_client_widget_hierarchy_changed (GtkWidget *widget,
static void
update_client_widget (GtkIMContextXIM *context_xim)
{
GtkWidget *new_client_widget = NULL;
if (context_xim->client_surface)
new_client_widget = gtk_root_get_for_surface (context_xim->client_surface);
GtkWidget *new_client_widget = gtk_root_get_for_surface (context_xim->client_surface);
if (new_client_widget != context_xim->client_widget)
{
+1 -3
View File
@@ -1151,9 +1151,7 @@ gtk_info_bar_set_revealed (GtkInfoBar *info_bar,
* gtk_info_bar_get_revealed:
* @info_bar: a #GtkInfoBar
*
* Returns whether the info bar is currently revealed.
*
* Returns: the current value of the #GtkInfoBar:revealed property
* Returns: the current value of the #GtkInfoBar:revealed property.
*/
gboolean
gtk_info_bar_get_revealed (GtkInfoBar *info_bar)
+295
View File
@@ -0,0 +1,295 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gtkinvisibleprivate.h"
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkroot.h"
#include "gtkwidgetprivate.h"
/**
* SECTION:gtkinvisible
* @Short_description: A widget which is not displayed
* @Title: GtkInvisible
*
* The #GtkInvisible widget is used internally in GTK+, and is probably not
* very useful for application developers.
*
* It is used for reliable pointer grabs and selection handling in the code
* for drag-and-drop.
*/
struct _GtkInvisiblePrivate
{
GdkDisplay *display;
gboolean has_user_ref_count;
};
enum {
PROP_0,
PROP_DISPLAY,
LAST_ARG
};
static void gtk_invisible_destroy (GtkWidget *widget);
static void gtk_invisible_realize (GtkWidget *widget);
static void gtk_invisible_style_updated (GtkWidget *widget);
static void gtk_invisible_show (GtkWidget *widget);
static void gtk_invisible_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_invisible_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_invisible_constructed (GObject *object);
static GdkDisplay *
gtk_invisible_root_get_display (GtkRoot *root)
{
GtkInvisible *invisible = GTK_INVISIBLE (root);
return invisible->priv->display;
}
static void
gtk_invisible_root_interface_init (GtkRootInterface *iface)
{
iface->get_display = gtk_invisible_root_get_display;
}
G_DEFINE_TYPE_WITH_CODE (GtkInvisible, gtk_invisible, GTK_TYPE_WIDGET,
G_ADD_PRIVATE (GtkInvisible)
G_IMPLEMENT_INTERFACE (GTK_TYPE_ROOT,
gtk_invisible_root_interface_init))
static void
gtk_invisible_class_init (GtkInvisibleClass *class)
{
GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
widget_class = (GtkWidgetClass*) class;
gobject_class = (GObjectClass*) class;
widget_class->realize = gtk_invisible_realize;
widget_class->style_updated = gtk_invisible_style_updated;
widget_class->show = gtk_invisible_show;
widget_class->destroy = gtk_invisible_destroy;
gobject_class->set_property = gtk_invisible_set_property;
gobject_class->get_property = gtk_invisible_get_property;
gobject_class->constructed = gtk_invisible_constructed;
g_object_class_install_property (gobject_class,
PROP_DISPLAY,
g_param_spec_object ("display",
P_("Display"),
P_("The display where this window will be displayed"),
GDK_TYPE_DISPLAY,
GTK_PARAM_READWRITE));
}
static void
gtk_invisible_init (GtkInvisible *invisible)
{
GtkInvisiblePrivate *priv;
invisible->priv = gtk_invisible_get_instance_private (invisible);
priv = invisible->priv;
gtk_widget_set_has_surface (GTK_WIDGET (invisible), TRUE);
g_object_ref_sink (invisible);
priv->has_user_ref_count = TRUE;
priv->display = gdk_display_get_default ();
}
static void
gtk_invisible_destroy (GtkWidget *widget)
{
GtkInvisible *invisible = GTK_INVISIBLE (widget);
GtkInvisiblePrivate *priv = invisible->priv;
if (priv->has_user_ref_count)
{
priv->has_user_ref_count = FALSE;
g_object_unref (invisible);
}
GTK_WIDGET_CLASS (gtk_invisible_parent_class)->destroy (widget);
}
/**
* gtk_invisible_new_for_display:
* @display: a #GdkDisplay which identifies on which
* the new #GtkInvisible will be created.
*
* Creates a new #GtkInvisible object for a specified display.
*
* Returns: a newly created #GtkInvisible object
**/
GtkWidget*
gtk_invisible_new_for_display (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
return g_object_new (GTK_TYPE_INVISIBLE, "display", display, NULL);
}
/**
* gtk_invisible_new:
*
* Creates a new #GtkInvisible.
*
* Returns: a new #GtkInvisible.
**/
GtkWidget*
gtk_invisible_new (void)
{
return g_object_new (GTK_TYPE_INVISIBLE, NULL);
}
/**
* gtk_invisible_set_display:
* @invisible: a #GtkInvisible.
* @display: a #GdkDisplay.
*
* Sets the #GdkDisplay where the #GtkInvisible object will be displayed.
**/
void
gtk_invisible_set_display (GtkInvisible *invisible,
GdkDisplay *display)
{
GtkInvisiblePrivate *priv;
GtkWidget *widget;
GdkDisplay *previous_display;
gboolean was_realized;
g_return_if_fail (GTK_IS_INVISIBLE (invisible));
g_return_if_fail (GDK_IS_DISPLAY (display));
priv = invisible->priv;
if (display == priv->display)
return;
widget = GTK_WIDGET (invisible);
previous_display = priv->display;
was_realized = gtk_widget_get_realized (widget);
if (was_realized)
gtk_widget_unrealize (widget);
priv->display = display;
if (display != previous_display)
_gtk_widget_propagate_display_changed (widget, previous_display);
g_object_notify (G_OBJECT (invisible), "display");
if (was_realized)
gtk_widget_realize (widget);
}
static void
gtk_invisible_realize (GtkWidget *widget)
{
GdkSurface *surface;
surface = gdk_surface_new_temp (gtk_widget_get_display (widget));
gtk_widget_set_surface (widget, surface);
gtk_widget_register_surface (widget, surface);
GTK_WIDGET_CLASS (gtk_invisible_parent_class)->realize (widget);
}
static void
gtk_invisible_style_updated (GtkWidget *widget)
{
/* Don't chain up to parent implementation */
}
static void
gtk_invisible_show (GtkWidget *widget)
{
_gtk_widget_set_visible_flag (widget, TRUE);
gtk_widget_map (widget);
}
static void
gtk_invisible_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkInvisible *invisible = GTK_INVISIBLE (object);
switch (prop_id)
{
case PROP_DISPLAY:
gtk_invisible_set_display (invisible, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_invisible_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkInvisible *invisible = GTK_INVISIBLE (object);
GtkInvisiblePrivate *priv = invisible->priv;
switch (prop_id)
{
case PROP_DISPLAY:
g_value_set_object (value, priv->display);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/* We use a constructor here so that we can realize the invisible on
* the correct display after the display property has been set
*/
static void
gtk_invisible_constructed (GObject *object)
{
G_OBJECT_CLASS (gtk_invisible_parent_class)->constructed (object);
gtk_widget_realize (GTK_WIDGET (object));
}
+80
View File
@@ -0,0 +1,80 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GTK_INVISIBLE_H__
#define __GTK_INVISIBLE_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gtk/gtkwidget.h>
G_BEGIN_DECLS
#define GTK_TYPE_INVISIBLE (gtk_invisible_get_type ())
#define GTK_INVISIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_INVISIBLE, GtkInvisible))
#define GTK_INVISIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_INVISIBLE, GtkInvisibleClass))
#define GTK_IS_INVISIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_INVISIBLE))
#define GTK_IS_INVISIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_INVISIBLE))
#define GTK_INVISIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_INVISIBLE, GtkInvisibleClass))
typedef struct _GtkInvisible GtkInvisible;
typedef struct _GtkInvisiblePrivate GtkInvisiblePrivate;
typedef struct _GtkInvisibleClass GtkInvisibleClass;
struct _GtkInvisible
{
GtkWidget widget;
/*< private >*/
GtkInvisiblePrivate *priv;
};
struct _GtkInvisibleClass
{
GtkWidgetClass parent_class;
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
GDK_AVAILABLE_IN_ALL
GType gtk_invisible_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_invisible_new (void);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_invisible_new_for_display(GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gtk_invisible_set_display (GtkInvisible *invisible,
GdkDisplay *display);
G_END_DECLS
#endif /* __GTK_INVISIBLE_H__ */
+8 -7
View File
@@ -131,10 +131,8 @@
#include "gtkwindowgroup.h"
#include "gtkprintbackend.h"
#include "gtkimmodule.h"
#include "gtkroot.h"
#include "a11y/gtkaccessibility.h"
#include "inspector/window.h"
static GtkWindowGroup *gtk_main_get_window_group (GtkWidget *widget);
@@ -1295,6 +1293,7 @@ rewrite_event_for_grabs (GdkEvent *event)
{
GdkSurface *grab_surface;
GtkWidget *event_widget, *grab_widget;
gpointer grab_widget_ptr;
gboolean owner_events;
GdkDisplay *display;
GdkDevice *device;
@@ -1327,7 +1326,8 @@ rewrite_event_for_grabs (GdkEvent *event)
}
event_widget = gtk_get_event_widget (event);
grab_widget = gtk_root_get_for_surface (grab_surface);
gdk_surface_get_user_data (grab_surface, &grab_widget_ptr);
grab_widget = grab_widget_ptr;
if (grab_widget &&
gtk_main_get_window_group (grab_widget) != gtk_main_get_window_group (event_widget))
@@ -1731,9 +1731,6 @@ gtk_main_do_event (GdkEvent *event)
GdkDevice *device;
GList *tmp_list;
if (gtk_inspector_handle_event (event))
return;
/* Find the widget which got the event. We store the widget
* in the user_data field of GdkSurface's. Ignore the event
* if we don't have a widget for it.
@@ -2376,11 +2373,15 @@ GtkWidget*
gtk_get_event_widget (const GdkEvent *event)
{
GtkWidget *widget;
gpointer widget_ptr;
widget = NULL;
if (event && event->any.surface &&
(event->any.type == GDK_DESTROY || !gdk_surface_is_destroyed (event->any.surface)))
widget = gtk_root_get_for_surface (event->any.surface);
{
gdk_surface_get_user_data (event->any.surface, &widget_ptr);
widget = widget_ptr;
}
return widget;
}
+2 -1
View File
@@ -28,7 +28,8 @@
/**
* SECTION:gtkmaplistmodel
* @title: GtkMapListModel
* @short_description: A list model that transforms its items
* @short_description: a #GListModel that maps items from a child list model to
* a different item
* @see_also: #GListModel
*
* #GtkMapListModel is a list model that takes a list model and maps the items
+1 -1
View File
@@ -614,7 +614,7 @@ gtk_media_stream_set_playing (GtkMediaStream *self,
}
/**
* gtk_media_stream_get_ended:
* gtk_medai_stream_get_ended:
* @self: a #GtkMediaStream
*
* Returns whether the streams playback is finished.
+5 -5
View File
@@ -333,19 +333,19 @@ pw_dialog_got_response (GtkDialog *dialog,
if (priv->username_entry)
{
text = gtk_editable_get_text (GTK_EDITABLE (priv->username_entry));
text = gtk_entry_get_text (GTK_ENTRY (priv->username_entry));
g_mount_operation_set_username (op, text);
}
if (priv->domain_entry)
{
text = gtk_editable_get_text (GTK_EDITABLE (priv->domain_entry));
text = gtk_entry_get_text (GTK_ENTRY (priv->domain_entry));
g_mount_operation_set_domain (op, text);
}
if (priv->password_entry)
{
text = gtk_editable_get_text (GTK_EDITABLE (priv->password_entry));
text = gtk_entry_get_text (GTK_ENTRY (priv->password_entry));
g_mount_operation_set_password (op, text);
}
@@ -371,7 +371,7 @@ entry_has_input (GtkWidget *entry_widget)
if (entry_widget == NULL)
return TRUE;
text = gtk_editable_get_text (GTK_EDITABLE (entry_widget));
text = gtk_entry_get_text (GTK_ENTRY (entry_widget));
return text != NULL && text[0] != '\0';
}
@@ -478,7 +478,7 @@ table_add_entry (GtkMountOperation *operation,
gtk_widget_set_hexpand (entry, TRUE);
if (value)
gtk_editable_set_text (GTK_EDITABLE (entry), value);
gtk_entry_set_text (GTK_ENTRY (entry), value);
gtk_grid_attach (GTK_GRID (operation->priv->grid), label, 0, row, 1, 1);
gtk_grid_attach (GTK_GRID (operation->priv->grid), entry, 1, row, 1, 1);
-26
View File
@@ -7193,15 +7193,6 @@ gtk_notebook_set_action_widget (GtkNotebook *notebook,
gtk_widget_queue_resize (GTK_WIDGET (notebook));
}
/**
* gtk_notebook_get_page:
* @notebook: a #GtkNotebook
* @child: a child of @notebook
*
* Returns the #GtkNotebookPage for @child.
*
* Returns: (transfer none): the #GtkNotebookPage for @child
*/
GtkNotebookPage *
gtk_notebook_get_page (GtkNotebook *notebook,
GtkWidget *child)
@@ -7219,14 +7210,6 @@ gtk_notebook_get_page (GtkNotebook *notebook,
return page;
}
/**
* gtk_notebook_page_get_child:
* @page: a #GtkNotebookPage
*
* Returns the notebook child to which @page belongs.
*
* Returns: (transfer none): the child to which @page belongs
*/
GtkWidget *
gtk_notebook_page_get_child (GtkNotebookPage *page)
{
@@ -7305,15 +7288,6 @@ gtk_notebook_pages_new (GtkNotebook *notebook)
return pages;
}
/**
* gtk_notebook_get_pages:
* @notebook: a #GtkNotebook
*
* Returns a #GListModel that contains the pages of the notebook,
* and can be used to keep an up-to-date view.
*
* Returns: (transfer full): a #GListModel for the notebook's children
*/
GListModel *
gtk_notebook_get_pages (GtkNotebook *notebook)
{
+1 -1
View File
@@ -771,7 +771,7 @@ gtk_overlay_set_clip_overlay (GtkOverlay *overlay,
}
/**
* gtk_overlay_get_clip_overlay:
* gtk_overlay_get_overlay_clip_overlay:
* @overlay: a #GtkOverlay
* @widget: an overlay child of #GtkOverlay
*
-2
View File
@@ -787,9 +787,7 @@ paper_size_changed (GtkComboBox *combo_box,
/* And show the custom paper dialog */
custom_paper_dialog = _gtk_custom_paper_unix_dialog_new (GTK_WINDOW (dialog), NULL);
g_signal_connect (custom_paper_dialog, "response", G_CALLBACK (custom_paper_dialog_response_cb), dialog);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (custom_paper_dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
return;
}
+2 -7
View File
@@ -36,17 +36,12 @@
#include "a11y/gtkentryaccessible.h"
/**
* SECTION:gtkpasswordentry
* SECTION:gtkpasswordhentry
* @Short_description: An entry for secrets
* @Title: GtkPasswordEntry
*
* #GtkPasswordEntry is entry that has been tailored for
* entering secrets. It does not show its contents in clear text,
* does not allow to copy it to the clipboard, and it shows a
* warning when Caps-Lock is engaged.
*
* GtkPasswordEntry provides no API of its own and should be used
* with the #GtkEditable API.
* entering secrets.
*/
typedef struct {
+3 -3
View File
@@ -2575,7 +2575,7 @@ rename_entry_changed (GtkEntry *entry,
GList *rows;
GList *l;
new_name = gtk_editable_get_text (GTK_EDITABLE (sidebar->rename_entry));
new_name = gtk_entry_get_text (GTK_ENTRY (sidebar->rename_entry));
if (strcmp (new_name, "") == 0)
{
@@ -2615,7 +2615,7 @@ do_rename (GtkButton *button,
gchar *new_text;
GFile *file;
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (sidebar->rename_entry)));
new_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (sidebar->rename_entry)));
file = g_file_new_for_uri (sidebar->rename_uri);
if (!_gtk_bookmarks_manager_has_bookmark (sidebar->bookmarks_manager, file))
@@ -2764,7 +2764,7 @@ show_rename_popover (GtkSidebarRow *row)
g_free (sidebar->rename_uri);
sidebar->rename_uri = g_strdup (uri);
gtk_editable_set_text (GTK_EDITABLE (sidebar->rename_entry), name);
gtk_entry_set_text (GTK_ENTRY (sidebar->rename_entry), name);
gtk_popover_set_relative_to (GTK_POPOVER (sidebar->rename_popover), GTK_WIDGET (row));
setup_popover_shadowing (sidebar->rename_popover);
+5 -5
View File
@@ -1238,7 +1238,7 @@ server_mount_ready_cb (GObject *source_file,
* Otherwise, the user would lost the typed address even if it fails
* to connect.
*/
gtk_editable_set_text (GTK_EDITABLE (priv->address_entry), "");
gtk_entry_set_text (GTK_ENTRY (priv->address_entry), "");
if (priv->should_open_location)
emit_open_location (view, location, priv->open_flags);
@@ -1814,7 +1814,7 @@ on_connect_button_clicked (GtkPlacesView *view)
if (!gtk_widget_get_sensitive (priv->connect_button))
return;
uri = gtk_editable_get_text (GTK_EDITABLE (priv->address_entry));
uri = gtk_entry_get_text (GTK_ENTRY (priv->address_entry));
if (uri != NULL && uri[0] != '\0')
file = g_file_new_for_commandline_arg (uri);
@@ -1842,7 +1842,7 @@ on_address_entry_text_changed (GtkPlacesView *view)
priv = gtk_places_view_get_instance_private (view);
supported = FALSE;
supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
address = g_strdup (gtk_editable_get_text (GTK_EDITABLE (priv->address_entry)));
address = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->address_entry)));
scheme = g_uri_parse_scheme (address);
if (!supported_protocols)
@@ -1897,7 +1897,7 @@ on_recent_servers_listbox_row_activated (GtkPlacesView *view,
priv = gtk_places_view_get_instance_private (view);
uri = g_object_get_data (G_OBJECT (row), "uri");
gtk_editable_set_text (GTK_EDITABLE (priv->address_entry), uri);
gtk_entry_set_text (GTK_ENTRY (priv->address_entry), uri);
gtk_widget_hide (priv->recent_servers_popover);
}
@@ -2196,7 +2196,7 @@ gtk_places_view_map (GtkWidget *widget)
priv = gtk_places_view_get_instance_private (GTK_PLACES_VIEW (widget));
gtk_editable_set_text (GTK_EDITABLE (priv->address_entry), "");
gtk_entry_set_text (GTK_ENTRY (priv->address_entry), "");
GTK_WIDGET_CLASS (gtk_places_view_parent_class)->map (widget);
}
+2 -2
View File
@@ -591,7 +591,7 @@ store_entry (GtkEntry *entry,
g_free (*data);
}
*data = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
*data = g_strdup (gtk_entry_get_text (entry));
}
static void
@@ -710,7 +710,7 @@ request_password (GtkPrintBackend *backend,
focus = entry;
if (ai_default[i] != NULL)
gtk_editable_set_text (GTK_EDITABLE (entry), ai_default[i]);
gtk_entry_set_text (GTK_ENTRY (entry), ai_default[i]);
gtk_entry_set_visibility (GTK_ENTRY (entry), ai_visible[i]);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
+5 -7
View File
@@ -393,7 +393,7 @@ combo_box_get (GtkWidget *combo, gboolean *custom)
{
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (combo)))
{
value = g_strdup (gtk_editable_get_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo)))));
value = g_strdup (gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)))));
*custom = TRUE;
}
@@ -573,9 +573,7 @@ filesave_choose_cb (GtkWidget *button,
g_signal_connect (dialog, "response",
G_CALLBACK (dialog_response_callback), widget);
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
static gchar *
@@ -673,7 +671,7 @@ combo_changed_cb (GtkWidget *combo,
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
gtk_editable_set_text (GTK_EDITABLE (entry), filtered_val);
gtk_entry_set_text (entry, filtered_val);
}
value = filtered_val;
}
@@ -693,7 +691,7 @@ entry_changed_cb (GtkWidget *entry,
const gchar *value;
g_signal_handler_block (priv->source, priv->source_changed_handler);
value = gtk_editable_get_text (GTK_EDITABLE (entry));
value = gtk_entry_get_text (GTK_ENTRY (entry));
if (value)
gtk_printer_option_set (priv->source, value);
g_signal_handler_unblock (priv->source, priv->source_changed_handler);
@@ -970,7 +968,7 @@ update_widgets (GtkPrinterOptionWidget *widget)
alternative_set (priv->box, source->value);
break;
case GTK_PRINTER_OPTION_TYPE_STRING:
gtk_editable_set_text (GTK_EDITABLE (priv->entry), source->value);
gtk_entry_set_text (GTK_ENTRY (priv->entry), source->value);
break;
case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD:
case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSCODE:
@@ -984,7 +982,7 @@ update_widgets (GtkPrinterOptionWidget *widget)
if (gtk_printer_option_has_choice (source, source->value))
combo_box_set (priv->combo, source->value);
else
gtk_editable_set_text (GTK_EDITABLE (entry), source->value);
gtk_entry_set_text (entry, source->value);
break;
}
+2 -6
View File
@@ -729,10 +729,8 @@ gtk_print_operation_unix_run_dialog_async (GtkPrintOperation *op,
g_signal_connect (pd, "response",
G_CALLBACK (handle_print_response), rdata);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (pd));
G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
@@ -1027,10 +1025,8 @@ gtk_print_run_page_setup_dialog_async (GtkWindow *parent,
g_signal_connect (dialog, "response",
G_CALLBACK (handle_page_setup_response), rdata);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_window_present (GTK_WINDOW (dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
}
struct _PrinterFinder

Some files were not shown because too many files have changed in this diff Show More