Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 984a9c2c09 | |||
| 0c406160e6 | |||
| f35b8a7541 | |||
| 9948ca7be2 | |||
| eaf41cc90c | |||
| 9e0c471b03 | |||
| dc282991c6 | |||
| 7931ab5f33 | |||
| 416a4cf5ea | |||
| bbd4e2f60d | |||
| 5577e30ad4 | |||
| 5caf8ca76b | |||
| fda4546de5 | |||
| fe7dcf6eec | |||
| 539e3d387b | |||
| efbb26b8cb | |||
| 69251d051a | |||
| d930c4a4d1 | |||
| f36e41600a | |||
| 78d013f8d3 | |||
| b4ae491b45 | |||
| 1469d01e2e | |||
| b0083b33bb | |||
| c5c75f338e | |||
| 572266429f | |||
| 91ad2eef5c | |||
| 14890fad47 | |||
| 5a6a7b50af | |||
| 8438880906 | |||
| df6494d73a | |||
| 9335cde8e8 | |||
| e836c575ce | |||
| 47fb1ec4c4 | |||
| f0624266dc | |||
| 74ab3cdf75 | |||
| 58c2bea959 | |||
| d3c45cb979 | |||
| df27cb7240 | |||
| 397b8ee9d5 | |||
| 6687a0892a | |||
| 77c0e68b57 | |||
| fd667bb203 | |||
| d773bc0689 | |||
| eddc823378 | |||
| eb1310effe | |||
| 8a0182e401 | |||
| edc4f954c6 | |||
| c35554cf68 | |||
| 9861887f1a | |||
| 3ae31b0e79 | |||
| 06df7e6f2c |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
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].replace('/', os.sep)
|
||||
gtk_datadir = sys.argv[4].replace('/', os.sep)
|
||||
gtk_libdir = sys.argv[3]
|
||||
gtk_datadir = sys.argv[4]
|
||||
|
||||
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
|
||||
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
|
||||
@@ -23,11 +23,9 @@ if 'DESTDIR' not in os.environ:
|
||||
os.path.join(gtk_datadir, 'icons', 'hicolor')])
|
||||
|
||||
print('Updating module cache for print backends...')
|
||||
if not os.path.isdir(gtk_printmodule_dir):
|
||||
os.mkdir(gtk_printmodule_dir)
|
||||
os.makedirs(gtk_printmodule_dir, exist_ok=True)
|
||||
subprocess.call(['gio-querymodules', gtk_printmodule_dir])
|
||||
|
||||
print('Updating module cache for input methods...')
|
||||
if not os.path.isdir(gtk_immodule_dir):
|
||||
os.mkdir(gtk_immodule_dir)
|
||||
os.makedirs(gtk_immodule_dir, exist_ok=True)
|
||||
subprocess.call(['gio-querymodules', gtk_immodule_dir])
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (widget));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (widget));
|
||||
|
||||
if (text && *text)
|
||||
gtk_assistant_set_page_complete (assistant, current_page, TRUE);
|
||||
|
||||
@@ -28,7 +28,7 @@ copy_button_clicked (GtkWidget *button,
|
||||
clipboard = gtk_widget_get_clipboard (entry);
|
||||
|
||||
/* Set clipboard text */
|
||||
gdk_clipboard_set_text (clipboard, gtk_entry_get_text (GTK_ENTRY (entry)));
|
||||
gdk_clipboard_set_text (clipboard, gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -50,7 +50,7 @@ paste_received (GObject *source_object,
|
||||
if (text)
|
||||
{
|
||||
/* Set the entry text */
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), text);
|
||||
g_free (text);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -256,7 +256,7 @@ mask_entry_set_background (MaskEntry *entry)
|
||||
{
|
||||
if (entry->mask)
|
||||
{
|
||||
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
|
||||
if (!g_regex_match_simple (entry->mask, gtk_editable_get_text (GTK_EDITABLE (entry)), 0, 0))
|
||||
{
|
||||
PangoAttrList *attrs;
|
||||
|
||||
|
||||
@@ -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_entry_set_text (GTK_ENTRY (local_entry1), gtk_entry_get_text (GTK_ENTRY (entry1)));
|
||||
gtk_editable_set_text (GTK_EDITABLE (local_entry1), gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (local_entry2), gtk_entry_get_text (GTK_ENTRY (entry2)));
|
||||
gtk_editable_set_text (GTK_EDITABLE (local_entry2), gtk_editable_get_text (GTK_EDITABLE (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_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_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_widget_destroy (dialog);
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (entry)));
|
||||
gtk_label_set_text (GTK_LABEL (label), gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
|
||||
gtk_widget_destroy (entry);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ edit_cb (GtkWidget *child)
|
||||
|
||||
g_object_set_data (G_OBJECT (entry), "label", child);
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), gtk_label_get_text (GTK_LABEL (child)));
|
||||
gtk_editable_set_text (GTK_EDITABLE (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);
|
||||
|
||||
@@ -305,7 +305,7 @@ update_display (void)
|
||||
char *font_desc;
|
||||
char *features;
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (entry), str);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), str);
|
||||
g_free (str);
|
||||
|
||||
update_display ();
|
||||
@@ -741,7 +741,7 @@ entry_activated (GtkEntry *entry,
|
||||
gdouble value;
|
||||
gchar *err = NULL;
|
||||
|
||||
value = g_strtod (gtk_entry_get_text (entry), &err);
|
||||
value = g_strtod (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_width_chars (GTK_ENTRY (axis_entry), 4);
|
||||
gtk_editable_set_width_chars (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (entry)));
|
||||
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (entry), text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), text);
|
||||
stop_edit ();
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
static void
|
||||
do_number (GtkButton *button, GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_text (entry, gtk_button_get_label (button));
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), gtk_button_get_label (button));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
||||
@@ -85,7 +85,7 @@ stop_search (GtkButton *button,
|
||||
static void
|
||||
clear_entry (GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_text (entry, "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), "");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -19,7 +19,7 @@ hex_spin_input (GtkSpinButton *spin_button,
|
||||
gchar *err;
|
||||
gdouble res;
|
||||
|
||||
buf = gtk_spin_button_get_text (spin_button);
|
||||
buf = gtk_editable_get_text (GTK_EDITABLE (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_spin_button_get_text (spin_button)))
|
||||
gtk_spin_button_set_text (spin_button, buf);
|
||||
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
|
||||
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
|
||||
g_free (buf);
|
||||
|
||||
return TRUE;
|
||||
@@ -60,7 +60,7 @@ time_spin_input (GtkSpinButton *spin_button,
|
||||
gchar *endh;
|
||||
gchar *endm;
|
||||
|
||||
text = gtk_spin_button_get_text (spin_button);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (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_spin_button_get_text (spin_button)))
|
||||
gtk_spin_button_set_text (spin_button, buf);
|
||||
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_spin_button_get_text (spin_button), -1);
|
||||
tmp2 = g_ascii_strup (gtk_editable_get_text (GTK_EDITABLE (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_spin_button_get_text (spin_button)))
|
||||
gtk_spin_button_set_text (spin_button, month[i-1]);
|
||||
if (strcmp (month[i-1], gtk_editable_get_text (GTK_EDITABLE (spin_button))))
|
||||
gtk_editable_set_text (GTK_EDITABLE (spin_button), month[i-1]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -68,7 +68,7 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
{
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_entry_get_text (entry);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (win->searchentry));
|
||||
search_text = gtk_editable_get_text (GTK_EDITABLE (win->searchentry));
|
||||
|
||||
if (win->symbolic)
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
|
||||
@@ -1406,7 +1406,7 @@ open_popover_text_changed (GtkEntry *entry, GParamSpec *pspec, GtkWidget *button
|
||||
{
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_entry_get_text (entry);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
gtk_widget_set_sensitive (button, strlen (text) > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +213,7 @@ 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
|
||||
@@ -374,6 +375,7 @@ 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>
|
||||
@@ -439,6 +441,7 @@ 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
|
||||
@@ -619,6 +622,7 @@ 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
|
||||
@@ -681,6 +685,7 @@ GDK_TYPE_SCROLL_DIRECTION
|
||||
GDK_TYPE_NOTIFY_TYPE
|
||||
GDK_IS_EVENT
|
||||
gdk_event_get_type
|
||||
gdk_event_sequence_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -776,7 +781,6 @@ 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
|
||||
|
||||
@@ -15,7 +15,9 @@ private_headers = [
|
||||
'gdkdisplaymanagerprivate.h',
|
||||
'gdkdisplayprivate.h',
|
||||
'gdkdndprivate.h',
|
||||
'gdkdragprivate.h',
|
||||
'gdkdrawcontextprivate.h',
|
||||
'gdkdropprivate.h',
|
||||
'gdkeventsprivate.h',
|
||||
'gdkframeclockidleprivate.h',
|
||||
'gdkframeclockprivate.h',
|
||||
|
||||
@@ -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 an <firstterm>frame event</firstterm>
|
||||
a window, it sends a <firstterm>frame event</firstterm>
|
||||
(<firstterm>expose event</firstterm> in X11 terminology)
|
||||
for that window.
|
||||
</para>
|
||||
@@ -64,16 +64,14 @@
|
||||
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 a <link
|
||||
linkend="GtkEntry"><classname>GtkEntry</classname></link>
|
||||
widget, the entry asks GTK to queue a redraw operation for
|
||||
itself.
|
||||
types a character in an entry 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 #GtkSurface::render signal on the affected surfaces.
|
||||
emissions of the ::render signal on the affected surfaces.
|
||||
The GTK toplevel window connects to that signal, and reacts appropriately.
|
||||
</para>
|
||||
|
||||
@@ -205,21 +203,21 @@
|
||||
<title>Hierarchical drawing</title>
|
||||
|
||||
<para>
|
||||
During the Paint phase we will send a single ::render signal the toplevel
|
||||
During the Paint phase GTK receives a single ::render signal on 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 entire widget hierarchy. This lets each widget
|
||||
which will propagate down the 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.
|
||||
GtkWidget keeps a reference to its render node (which in turn, will refer to
|
||||
Each widget 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 (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.
|
||||
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.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
|
||||
@@ -827,7 +827,7 @@ search_text_changed (GtkEntry *entry,
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, match_start, match_end;
|
||||
|
||||
text = gtk_entry_get_text (entry);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
|
||||
if (text[0] == '\0')
|
||||
return;
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
|
||||
<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" />
|
||||
|
||||
@@ -675,12 +675,6 @@ 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
|
||||
@@ -695,6 +689,7 @@ 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
|
||||
@@ -923,8 +918,6 @@ 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
|
||||
@@ -937,10 +930,6 @@ 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
|
||||
@@ -1819,7 +1808,6 @@ 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
|
||||
@@ -1841,7 +1829,6 @@ 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
|
||||
@@ -2281,11 +2268,6 @@ 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
|
||||
@@ -2718,12 +2700,6 @@ 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
|
||||
@@ -4400,6 +4376,7 @@ 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
|
||||
@@ -4493,6 +4470,7 @@ 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
|
||||
@@ -4553,7 +4531,6 @@ 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
|
||||
@@ -4758,12 +4735,9 @@ 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
|
||||
@@ -4784,13 +4758,7 @@ 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
|
||||
@@ -5902,8 +5870,8 @@ GtkMountOperationPrivate
|
||||
<SECTION>
|
||||
<FILE>gtktransform</FILE>
|
||||
<TITLE>3D transformations</TITLE>
|
||||
GtkTransformType;
|
||||
GtkTransform;
|
||||
GtkTransformType
|
||||
GtkTransform
|
||||
gtk_transform_ref
|
||||
gtk_transform_unref
|
||||
<SUBSECTION>
|
||||
@@ -6703,8 +6671,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>
|
||||
@@ -7196,3 +7164,12 @@ 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>
|
||||
|
||||
@@ -137,6 +137,7 @@ 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
|
||||
|
||||
@@ -608,7 +608,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Adapt to changes in the API of GtkEntry and GtkSearchEntry</title>
|
||||
<title>Adapt to changes in the API of GtkEntry, GtkSearchEntry adn GtkSpinButton</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,7 +620,8 @@
|
||||
<para>
|
||||
Use GtkEditable API for editable functionality, and widget-specific APIs for
|
||||
things that go beyond the common interface. For password entries, use
|
||||
GtkPasswordEntry.
|
||||
GtkPasswordEntry. As an example, gtk_spin_button_set_max_width_chars()
|
||||
has been removed in favor of gtk_editable_set_max_width_chars().
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -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_entry_set_text (GTK_ENTRY (widget), "Entry");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (child), "Combo Box Entry");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (entry), "Search Bar");
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), "Search Bar");
|
||||
gtk_container_add (GTK_CONTAINER (widget), entry);
|
||||
gtk_widget_show (entry);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ search_text_changed (GtkEntry *entry,
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, match_start, match_end;
|
||||
|
||||
text = gtk_entry_get_text (entry);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
|
||||
if (text[0] == '\0')
|
||||
return;
|
||||
@@ -58,7 +58,7 @@ find_word (GtkButton *button,
|
||||
const gchar *word;
|
||||
|
||||
word = gtk_button_get_label (button);
|
||||
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
|
||||
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -25,7 +25,7 @@ search_text_changed (GtkEntry *entry,
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, match_start, match_end;
|
||||
|
||||
text = gtk_entry_get_text (entry);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
|
||||
if (text[0] == '\0')
|
||||
return;
|
||||
|
||||
@@ -29,7 +29,7 @@ search_text_changed (GtkEntry *entry,
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, match_start, match_end;
|
||||
|
||||
text = gtk_entry_get_text (entry);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
|
||||
if (text[0] == '\0')
|
||||
return;
|
||||
@@ -56,7 +56,7 @@ find_word (GtkButton *button,
|
||||
const gchar *word;
|
||||
|
||||
word = gtk_button_get_label (button);
|
||||
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
|
||||
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -31,7 +31,7 @@ search_text_changed (GtkEntry *entry,
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, match_start, match_end;
|
||||
|
||||
text = gtk_entry_get_text (entry);
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
|
||||
if (text[0] == '\0')
|
||||
return;
|
||||
@@ -58,7 +58,7 @@ find_word (GtkButton *button,
|
||||
const gchar *word;
|
||||
|
||||
word = gtk_button_get_label (button);
|
||||
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
|
||||
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -364,7 +364,7 @@ combo_changed (GtkComboBox *combo,
|
||||
str = g_strjoinv (",", accels);
|
||||
g_strfreev (accels);
|
||||
|
||||
gtk_entry_set_text (entry, str);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), str);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -389,7 +389,7 @@ response (GtkDialog *dialog,
|
||||
if (!action)
|
||||
return;
|
||||
|
||||
str = gtk_entry_get_text (entry);
|
||||
str = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
accels = g_strsplit (str, ",", 0);
|
||||
|
||||
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const gchar **) accels);
|
||||
|
||||
@@ -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
@@ -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. GTK+ does all of its drawing using cairo.
|
||||
* can be used with GDK and GTK.
|
||||
*
|
||||
* GDK does not wrap the cairo API, instead it allows to create cairo
|
||||
* contexts which can be used to draw on #GdkSurfaces. Additional
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
+4
-4
@@ -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 *
|
||||
|
||||
+12
-12
@@ -61,7 +61,7 @@
|
||||
*
|
||||
* A #GdkSurface is a (usually) rectangular region on the screen.
|
||||
* It’s 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.
|
||||
*/
|
||||
@@ -2692,7 +2692,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 +4098,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()
|
||||
* Sets keyboard focus to @surface. In most cases, gtk_window_present_with_time()
|
||||
* should be used on a #GtkWindow, rather than calling this function.
|
||||
*
|
||||
**/
|
||||
@@ -4264,7 +4264,7 @@ gdk_surface_set_geometry_hints (GdkSurface *surface,
|
||||
* If you haven’t 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/GTK+). @title may not be %NULL.
|
||||
* user-readable strings in GDK and GTK). @title may not be %NULL.
|
||||
**/
|
||||
void
|
||||
gdk_surface_set_title (GdkSurface *surface,
|
||||
@@ -4278,7 +4278,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 surface’s role to
|
||||
@@ -4304,7 +4304,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 +4489,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(), which raises the surface, focuses it,
|
||||
* you probably want to use gtk_window_present_with_time(), which raises the surface, focuses it,
|
||||
* unminimizes it, and puts it on the current desktop.
|
||||
*
|
||||
**/
|
||||
@@ -5262,7 +5262,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 +5298,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
|
||||
* don’t 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
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
@@ -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,6 +54,7 @@
|
||||
|
||||
#define GDK_VERSION_3_92 (G_ENCODE_VERSION (3, 92))
|
||||
#define GDK_VERSION_3_94 (G_ENCODE_VERSION (3, 94))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_4_0:
|
||||
*
|
||||
@@ -137,6 +138,13 @@
|
||||
# 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__ */
|
||||
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
+195
-79
@@ -141,6 +141,30 @@ 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)
|
||||
{
|
||||
@@ -249,6 +273,11 @@ 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:
|
||||
@@ -769,7 +798,6 @@ 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:
|
||||
@@ -789,23 +817,9 @@ render_transform_node (GskGLRenderer *self,
|
||||
|
||||
case GSK_MATRIX_CATEGORY_2D_AFFINE:
|
||||
{
|
||||
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);
|
||||
ops_push_modelview (builder, node_transform, category);
|
||||
gsk_gl_renderer_add_render_ops (self, child, builder);
|
||||
ops_pop_modelview (builder);
|
||||
builder->dx = dx;
|
||||
builder->dy = dy;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -814,8 +828,6 @@ 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;
|
||||
@@ -823,53 +835,56 @@ render_transform_node (GskGLRenderer *self,
|
||||
int texture_id;
|
||||
gboolean is_offscreen;
|
||||
|
||||
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});
|
||||
ops_push_modelview (builder, node_transform, category);
|
||||
|
||||
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)
|
||||
if (node_supports_transform (child))
|
||||
{
|
||||
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);
|
||||
gsk_gl_renderer_add_render_ops (self, child, builder);
|
||||
}
|
||||
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 }, },
|
||||
/* 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);
|
||||
|
||||
{ { max_x, max_y }, { 1, 1 }, },
|
||||
{ { 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 }, },
|
||||
|
||||
ops_draw (builder, onscreen_vertex_data);
|
||||
{ { 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_pop_modelview (builder);
|
||||
@@ -954,31 +969,126 @@ 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 *self,
|
||||
const GskRoundedRect *other,
|
||||
gsk_rounded_rect_intersection (const GskRoundedRect *outer,
|
||||
const GskRoundedRect *inner,
|
||||
GskRoundedRect *out_intersection)
|
||||
{
|
||||
const graphene_rect_t *self_bounds = &self->bounds;
|
||||
const graphene_rect_t *other_bounds = &other->bounds;
|
||||
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;
|
||||
|
||||
if (graphene_rect_contains_rect (self_bounds, other_bounds))
|
||||
if (graphene_rect_contains_rect (outer_bounds, inner_bounds))
|
||||
{
|
||||
*out_intersection = *other;
|
||||
*out_intersection = *inner;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
get_inner_rect (outer, &outer_inner);
|
||||
get_inner_rect (inner, &inner_inner);
|
||||
|
||||
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,
|
||||
@@ -1306,7 +1416,7 @@ render_outset_shadow_node (GskGLRenderer *self,
|
||||
op.op = OP_CLEAR;
|
||||
ops_add (builder, &op);
|
||||
prev_projection = ops_set_projection (builder, &item_proj);
|
||||
ops_push_modelview (builder, &identity);
|
||||
ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
|
||||
prev_viewport = ops_set_viewport (builder, &GRAPHENE_RECT_INIT (0, 0, texture_width, texture_height));
|
||||
|
||||
/* Draw outline */
|
||||
@@ -2332,7 +2442,8 @@ 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)
|
||||
if (node->bounds.size.width == 0.0f || node->bounds.size.height == 0.0f ||
|
||||
isnan (node->bounds.size.width) || isnan (node->bounds.size.height))
|
||||
return;
|
||||
|
||||
/* Check whether the render node is entirely out of the current
|
||||
@@ -2368,7 +2479,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;
|
||||
@@ -2523,7 +2634,7 @@ add_offscreen_ops (GskGLRenderer *self,
|
||||
op.op = OP_CLEAR;
|
||||
ops_add (builder, &op);
|
||||
prev_projection = ops_set_projection (builder, &item_proj);
|
||||
ops_push_modelview (builder, &identity);
|
||||
ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
|
||||
prev_viewport = ops_set_viewport (builder,
|
||||
&GRAPHENE_RECT_INIT (bounds->origin.x * scale,
|
||||
bounds->origin.y * scale,
|
||||
@@ -2783,12 +2894,13 @@ 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_push_modelview (&render_op_builder, &modelview);
|
||||
ops_set_modelview (&render_op_builder, &modelview,
|
||||
scale_factor == 1 ? GSK_MATRIX_CATEGORY_IDENTITY : GSK_MATRIX_CATEGORY_2D_AFFINE);
|
||||
|
||||
/* Initial clip is self->render_region! */
|
||||
if (self->render_region != NULL)
|
||||
{
|
||||
GskRoundedRect transformed_render_region = { 0, };
|
||||
graphene_rect_t transformed_render_region;
|
||||
cairo_rectangle_int_t render_extents;
|
||||
|
||||
cairo_region_get_extents (self->render_region, &render_extents);
|
||||
@@ -2798,8 +2910,12 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
|
||||
render_extents.y,
|
||||
render_extents.width,
|
||||
render_extents.height),
|
||||
&transformed_render_region.bounds);
|
||||
ops_push_clip (&render_op_builder, &transformed_render_region);
|
||||
&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));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+125
-71
@@ -63,63 +63,55 @@ static void
|
||||
extract_matrix_metadata (const graphene_matrix_t *m,
|
||||
OpsMatrixMetadata *md)
|
||||
{
|
||||
graphene_vec3_t col1;
|
||||
graphene_vec3_t col2;
|
||||
switch (md->category)
|
||||
{
|
||||
case GSK_MATRIX_CATEGORY_IDENTITY:
|
||||
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_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;
|
||||
|
||||
/* 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));
|
||||
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;
|
||||
|
||||
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));
|
||||
md->translate_x = graphene_matrix_get_value (m, 3, 0);
|
||||
md->translate_y = graphene_matrix_get_value (m, 3, 1);
|
||||
|
||||
md->scale_x = graphene_vec3_length (&col1);
|
||||
md->scale_y = graphene_vec3_length (&col2);
|
||||
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));
|
||||
|
||||
/* 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;
|
||||
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));
|
||||
|
||||
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);
|
||||
md->scale_x = graphene_vec3_length (&col1);
|
||||
md->scale_y = graphene_vec3_length (&col2);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
@@ -127,34 +119,32 @@ ops_transform_bounds_modelview (const RenderOpBuilder *builder,
|
||||
|
||||
head = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
|
||||
|
||||
if (head->metadata.only_translation)
|
||||
switch (head->metadata.category)
|
||||
{
|
||||
case GSK_MATRIX_CATEGORY_IDENTITY:
|
||||
*dst = *src;
|
||||
graphene_rect_offset (dst,
|
||||
head->metadata.translate_x,
|
||||
head->metadata.translate_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
graphene_rect_offset (dst, builder->dx * scale, builder->dy * scale);
|
||||
}
|
||||
|
||||
gboolean
|
||||
ops_modelview_is_simple (const RenderOpBuilder *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);
|
||||
|
||||
return head->metadata.simple;
|
||||
dst->origin.x += builder->dx * head->metadata.scale_x;
|
||||
dst->origin.y += builder->dy * head->metadata.scale_y;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -303,8 +293,8 @@ ops_has_clip (RenderOpBuilder *self)
|
||||
}
|
||||
|
||||
static void
|
||||
ops_set_modelview (RenderOpBuilder *builder,
|
||||
const graphene_matrix_t *modelview)
|
||||
ops_set_modelview_internal (RenderOpBuilder *builder,
|
||||
const graphene_matrix_t *modelview)
|
||||
{
|
||||
RenderOp op;
|
||||
|
||||
@@ -338,9 +328,12 @@ ops_set_modelview (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_push_modelview (RenderOpBuilder *builder,
|
||||
const graphene_matrix_t *mv)
|
||||
ops_set_modelview (RenderOpBuilder *builder,
|
||||
const graphene_matrix_t *mv,
|
||||
GskMatrixCategory mv_category)
|
||||
{
|
||||
MatrixStackEntry *entry;
|
||||
|
||||
@@ -353,10 +346,64 @@ ops_push_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 (builder, mv);
|
||||
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);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -368,6 +415,10 @@ 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;
|
||||
@@ -375,7 +426,7 @@ ops_pop_modelview (RenderOpBuilder *builder)
|
||||
if (builder->mv_stack->len >= 1)
|
||||
{
|
||||
builder->current_modelview = m;
|
||||
ops_set_modelview (builder, m);
|
||||
ops_set_modelview_internal (builder, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -684,6 +735,9 @@ 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,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "gskgldriverprivate.h"
|
||||
#include "gskroundedrectprivate.h"
|
||||
#include "gskglrendererprivate.h"
|
||||
#include "gskrendernodeprivate.h"
|
||||
|
||||
#define GL_N_VERTICES 6
|
||||
#define GL_N_PROGRAMS 11
|
||||
@@ -21,8 +22,10 @@ typedef struct
|
||||
float scale_x;
|
||||
float scale_y;
|
||||
|
||||
guint simple : 1;
|
||||
guint only_translation : 1;
|
||||
float dx_before;
|
||||
float dy_before;
|
||||
|
||||
GskMatrixCategory category;
|
||||
} OpsMatrixMetadata;
|
||||
|
||||
typedef struct
|
||||
@@ -277,9 +280,12 @@ void ops_dump_framebuffer (RenderOpBuilder *builder,
|
||||
|
||||
void ops_finish (RenderOpBuilder *builder);
|
||||
void ops_push_modelview (RenderOpBuilder *builder,
|
||||
const graphene_matrix_t *mv);
|
||||
const graphene_matrix_t *mv,
|
||||
GskMatrixCategory mv_category);
|
||||
void ops_set_modelview (RenderOpBuilder *builder,
|
||||
const graphene_matrix_t *mv,
|
||||
GskMatrixCategory mv_category);
|
||||
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,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
#include "gskglshadowcacheprivate.h"
|
||||
|
||||
#define MAX_UNUSED_FRAMES (16 * 5) /* 5 seconds? */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GskRoundedRect outline;
|
||||
@@ -13,7 +15,7 @@ typedef struct
|
||||
float blur_radius;
|
||||
|
||||
int texture_id;
|
||||
guint used : 1;
|
||||
int unused_frames;
|
||||
} CacheItem;
|
||||
|
||||
static gboolean
|
||||
@@ -67,7 +69,7 @@ gsk_gl_shadow_cache_begin_frame (GskGLShadowCache *self,
|
||||
{
|
||||
CacheItem *item = &g_array_index (self->textures, CacheItem, i);
|
||||
|
||||
if (!item->used)
|
||||
if (item->unused_frames > MAX_UNUSED_FRAMES)
|
||||
{
|
||||
gsk_gl_driver_destroy_texture (gl_driver, item->texture_id);
|
||||
g_array_remove_index_fast (self->textures, i);
|
||||
@@ -76,7 +78,7 @@ gsk_gl_shadow_cache_begin_frame (GskGLShadowCache *self,
|
||||
}
|
||||
else
|
||||
{
|
||||
item->used = FALSE;
|
||||
item->unused_frames ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +115,7 @@ gsk_gl_shadow_cache_get_texture_id (GskGLShadowCache *self,
|
||||
if (item == NULL)
|
||||
return 0;
|
||||
|
||||
item->used = TRUE;
|
||||
item->unused_frames = 0;
|
||||
|
||||
g_assert (item->texture_id != 0);
|
||||
|
||||
@@ -137,6 +139,6 @@ gsk_gl_shadow_cache_commit (GskGLShadowCache *self,
|
||||
|
||||
item->outline = *shadow_rect;
|
||||
item->blur_radius = blur_radius;
|
||||
item->used = TRUE;
|
||||
item->unused_frames = 0;
|
||||
item->texture_id = texture_id;
|
||||
}
|
||||
|
||||
+5
-39
@@ -42,6 +42,7 @@
|
||||
|
||||
#include "gskdebugprivate.h"
|
||||
#include "gskrendererprivate.h"
|
||||
#include "gskrendernodeparserprivate.h"
|
||||
|
||||
#include <graphene-gobject.h>
|
||||
|
||||
@@ -328,19 +329,11 @@ gsk_render_node_diff (GskRenderNode *node1,
|
||||
GBytes *
|
||||
gsk_render_node_serialize (GskRenderNode *node)
|
||||
{
|
||||
GVariant *node_variant, *variant;
|
||||
GBytes *result;
|
||||
char *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);
|
||||
str = gsk_render_node_serialize_to_string (node);
|
||||
result = g_bytes_new_take (str, strlen (str));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -397,36 +390,9 @@ GskRenderNode *
|
||||
gsk_render_node_deserialize (GBytes *bytes,
|
||||
GError **error)
|
||||
{
|
||||
char *id_string;
|
||||
guint32 version, node_type;
|
||||
GVariant *variant, *node_variant;
|
||||
GskRenderNode *node = 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);
|
||||
node = gsk_render_node_deserialize_from_string ((const char *)g_bytes_get_data (bytes, NULL));
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
+24
-3
@@ -2547,9 +2547,30 @@ gsk_transform_node_new_with_category (GskRenderNode *child,
|
||||
graphene_matrix_init_from_matrix (&self->transform, transform);
|
||||
self->category = category;
|
||||
|
||||
graphene_matrix_transform_bounds (&self->transform,
|
||||
&child->bounds,
|
||||
&self->render_node.bounds);
|
||||
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);
|
||||
}
|
||||
|
||||
return &self->render_node;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
|
||||
#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
|
||||
@@ -535,3 +535,24 @@ 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);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ 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
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ gsk_private_sources = files([
|
||||
'gskdebug.c',
|
||||
'gskprivate.c',
|
||||
'gskprofiler.c',
|
||||
'gskrendernodeparser.c',
|
||||
'gl/gskshaderbuilder.c',
|
||||
'gl/gskglprofiler.c',
|
||||
'gl/gskglrenderer.c',
|
||||
|
||||
@@ -626,7 +626,11 @@ 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))
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1179,7 +1179,11 @@ gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent,
|
||||
gdk_x11_get_server_time (gtk_widget_get_surface (widget)));
|
||||
else
|
||||
#endif
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -608,9 +608,12 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
#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>
|
||||
|
||||
@@ -1002,7 +1002,9 @@ 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;
|
||||
@@ -2409,7 +2411,9 @@ gtk_show_about_dialog (GtkWindow *parent,
|
||||
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
-2
@@ -1076,9 +1076,11 @@ 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
|
||||
* GtkAccelLabel:label property as mnemonic indicators.
|
||||
* Returns whether the accel label interprets underscores in it's
|
||||
* 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)
|
||||
|
||||
@@ -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_entry_get_text (entry));
|
||||
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -466,8 +466,7 @@ gtk_cell_renderer_combo_start_editing (GtkCellRenderer *cell,
|
||||
|
||||
g_object_get (cell_text, "text", &text, NULL);
|
||||
if (text)
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo))),
|
||||
text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo))), text);
|
||||
g_free (text);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (widget));
|
||||
new_text = gtk_editable_get_text (GTK_EDITABLE (widget));
|
||||
g_signal_emit_by_name (data, "edited", path, new_text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (entry));
|
||||
new_text = gtk_editable_get_text (GTK_EDITABLE (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_entry_set_width_chars (GTK_ENTRY (priv->entry), 5);
|
||||
gtk_editable_set_width_chars (GTK_EDITABLE (priv->entry), 5);
|
||||
|
||||
if (priv->text)
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->entry), priv->text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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);
|
||||
|
||||
@@ -557,8 +557,9 @@ gtk_check_button_set_inconsistent (GtkCheckButton *check_button,
|
||||
* gtk_check_button_get_inconsistent:
|
||||
* @check_button: a #GtkCheckButton
|
||||
*
|
||||
* Returns: %TRUE if @check_button is currently in an 'in between' state,
|
||||
* %FALSE otherwise.
|
||||
* Returns whether the check button is in an inconsistent state.
|
||||
*
|
||||
* Returns: %TRUE if @check_button is currently in an 'in between' state, %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
gtk_check_button_get_inconsistent (GtkCheckButton *check_button)
|
||||
|
||||
@@ -555,7 +555,9 @@ 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
|
||||
|
||||
@@ -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_entry_set_text (GTK_ENTRY (editor->priv->entry), text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (editor->priv->entry), text);
|
||||
editor->priv->text_changed = FALSE;
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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_entry_set_text (entry, text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), text);
|
||||
|
||||
g_signal_handlers_unblock_by_func (entry,
|
||||
gtk_combo_box_entry_contents_changed,
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (entry)));
|
||||
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
else if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo_box), &iter))
|
||||
{
|
||||
|
||||
+1
-11
@@ -128,7 +128,6 @@ struct _GtkContainerPrivate
|
||||
enum {
|
||||
ADD,
|
||||
REMOVE,
|
||||
SET_FOCUS_CHILD,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@@ -304,15 +303,6 @@ 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);
|
||||
@@ -1569,7 +1559,7 @@ gtk_container_set_focus_child (GtkContainer *container,
|
||||
if (child)
|
||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||
|
||||
g_signal_emit (container, container_signals[SET_FOCUS_CHILD], 0, child);
|
||||
GTK_CONTAINER_GET_CLASS (container)->set_focus_child (container, child);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-2
@@ -516,6 +516,7 @@ 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.
|
||||
@@ -911,7 +912,7 @@ gtk_editable_finish_delegate (GtkEditable *editable)
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_editable_set_property:
|
||||
* gtk_editable_delegate_set_property:
|
||||
* @object: a #GObject
|
||||
* @prop_id: a property ID
|
||||
* @value: value to set
|
||||
@@ -969,7 +970,7 @@ gtk_editable_delegate_set_property (GObject *object,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_editable_get_property:
|
||||
* gtk_editable_delegate_get_property:
|
||||
* @object: a #GObject
|
||||
* @prop_id: a property ID
|
||||
* @value: value to set
|
||||
|
||||
+18
-128
@@ -1113,7 +1113,7 @@ gtk_entry_get_property (GObject *object,
|
||||
break;
|
||||
|
||||
case PROP_TEXT_LENGTH:
|
||||
g_value_set_uint (value, gtk_entry_buffer_get_length (get_buffer (entry)));
|
||||
g_value_set_uint (value, gtk_entry_get_text_length (entry));
|
||||
break;
|
||||
|
||||
case PROP_PROGRESS_FRACTION:
|
||||
@@ -1835,6 +1835,7 @@ 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);
|
||||
}
|
||||
|
||||
@@ -1882,25 +1883,6 @@ 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
|
||||
@@ -2050,29 +2032,6 @@ 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
|
||||
@@ -2092,8 +2051,11 @@ 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_entry_buffer_set_max_length (get_buffer (entry), max);
|
||||
|
||||
gtk_text_set_max_length (GTK_TEXT (priv->text), max);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2112,9 +2074,11 @@ 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_entry_buffer_get_max_length (get_buffer (entry));
|
||||
return gtk_text_get_max_length (GTK_TEXT (priv->text));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2134,9 +2098,11 @@ 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_entry_buffer_get_length (get_buffer (entry));
|
||||
return gtk_text_get_text_length (GTK_TEXT (priv->text));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2182,83 +2148,6 @@ 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
|
||||
@@ -3363,11 +3252,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));
|
||||
|
||||
//FIXME
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (entry), entry_props[PROP_PLACEHOLDER_TEXT]);
|
||||
gtk_text_set_placeholder_text (GTK_TEXT (priv->text), text);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3384,10 +3273,11 @@ 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);
|
||||
|
||||
//FIXME
|
||||
return NULL;
|
||||
return gtk_text_get_placeholder_text (GTK_TEXT (priv->text));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -184,27 +184,6 @@ 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
@@ -1184,7 +1184,7 @@ gtk_entry_completion_complete (GtkEntryCompletion *completion)
|
||||
|
||||
g_free (completion->priv->case_normalized_key);
|
||||
|
||||
tmp = g_utf8_normalize (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)),
|
||||
tmp = g_utf8_normalize (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (completion->priv->entry), str ? str : "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (completion->priv->entry));
|
||||
key = gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (completion->priv->entry)), -1)
|
||||
g_utf8_strlen (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (completion->priv->entry),
|
||||
completion->priv->completion_prefix);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (completion->priv->entry)));
|
||||
completion->priv->completion_prefix = g_strdup (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (completion->priv->entry),
|
||||
completion->priv->completion_prefix);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (completion->priv->entry),
|
||||
completion->priv->completion_prefix);
|
||||
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry),
|
||||
completion->priv->completion_prefix);
|
||||
else
|
||||
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (widget), str);
|
||||
gtk_editable_set_text (GTK_EDITABLE (widget), str);
|
||||
|
||||
/* move the cursor to the end */
|
||||
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (gtk_entry_completion_get_entry ()))`.
|
||||
* `gtk_editable_get_text (GTK_EDITABLE (gtk_entry_completion_get_entry ()))`.
|
||||
*
|
||||
* Returns: %TRUE if @iter should be displayed as a possible completion
|
||||
* for @key
|
||||
|
||||
@@ -17,7 +17,20 @@
|
||||
* 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"
|
||||
@@ -67,11 +80,10 @@ gtk_event_controller_legacy_class_init (GtkEventControllerLegacyClass *klass)
|
||||
* @controller: the object which received the signal.
|
||||
* @event: the #GdkEvent which triggered this signal
|
||||
*
|
||||
* The GTK+ main loop will emit this signal for each GDK event delivered
|
||||
* to @controller.
|
||||
* Emitted 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"),
|
||||
@@ -91,6 +103,13 @@ 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)
|
||||
{
|
||||
|
||||
@@ -2705,7 +2705,11 @@ open_dialog (GtkFileChooserButton *button)
|
||||
|
||||
gtk_widget_set_sensitive (priv->combo_box, FALSE);
|
||||
if (priv->dialog)
|
||||
gtk_window_present (GTK_WINDOW (priv->dialog));
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (priv->dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else
|
||||
gtk_native_dialog_show (GTK_NATIVE_DIALOG (priv->native));
|
||||
}
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':'))
|
||||
gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':')
|
||||
gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (chooser_entry)));
|
||||
gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (chooser_entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (chooser_entry));
|
||||
str = gtk_editable_get_text (GTK_EDITABLE (chooser_entry));
|
||||
ext = g_strrstr (str, ".");
|
||||
|
||||
if (ext)
|
||||
|
||||
@@ -623,7 +623,9 @@ 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
@@ -969,7 +969,7 @@ new_folder_popover_active (GtkWidget *button,
|
||||
{
|
||||
GtkFileChooserWidgetPrivate *priv = impl->priv;
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->new_folder_name_entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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 (GtkEntry *entry,
|
||||
new_folder_name_changed (GtkEditable *editable,
|
||||
GtkFileChooserWidget *impl)
|
||||
{
|
||||
GtkFileChooserWidgetPrivate *priv = impl->priv;
|
||||
|
||||
check_valid_child_name (impl,
|
||||
priv->current_folder,
|
||||
gtk_entry_get_text (entry),
|
||||
gtk_editable_get_text (editable),
|
||||
TRUE,
|
||||
NULL,
|
||||
priv->new_folder_error_stack,
|
||||
@@ -1121,7 +1121,7 @@ new_folder_create_clicked (GtkButton *button,
|
||||
GFile *file;
|
||||
const gchar *name;
|
||||
|
||||
name = gtk_entry_get_text (GTK_ENTRY (priv->new_folder_name_entry));
|
||||
name = gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (entry),
|
||||
gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (priv->rename_file_name_entry));
|
||||
new_name = gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY(priv->rename_file_name_entry), filename);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_width_chars (GTK_ENTRY (priv->location_entry), 45);
|
||||
gtk_editable_set_width_chars (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->location_entry), priv->browse_files_last_selected_name);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->location_entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (priv->location_entry));
|
||||
entry_text = gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->location_entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->location_entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->location_entry), name);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (priv->location_entry)));
|
||||
return g_strdup (gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (chooser_entry))) == 0)
|
||||
if (strlen (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->location_entry), path);
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), path);
|
||||
gtk_editable_set_position (GTK_EDITABLE (priv->location_entry), -1);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* SECTION:gtkfilterlistmodel
|
||||
* @title: GtkFilterListModel
|
||||
* @short_description: a #GListModel that filters its items
|
||||
* @short_description: A list model that filters its items
|
||||
* @see_also: #GListModel
|
||||
*
|
||||
* #GtkFilterListModel is a list model that filters a given other
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* SECTION:gtkflattenlistmodel
|
||||
* @title: GtkFlattenListModel
|
||||
* @short_description: a #GListModel that flattens a given listmodel
|
||||
* @short_description: A list model that flattens a list of lists
|
||||
* @see_also: #GListModel
|
||||
*
|
||||
* #GtkFlattenListModel is a list model that takes a list model containing
|
||||
|
||||
@@ -995,7 +995,9 @@ 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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_spin_button_set_text (spin, text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->preview), priv->preview_text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->preview), text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->preview), text);
|
||||
|
||||
g_object_notify (G_OBJECT (fontchooser), "preview-text");
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+3
-1
@@ -1151,7 +1151,9 @@ gtk_info_bar_set_revealed (GtkInfoBar *info_bar,
|
||||
* gtk_info_bar_get_revealed:
|
||||
* @info_bar: a #GtkInfoBar
|
||||
*
|
||||
* Returns: the current value of the #GtkInfoBar:revealed property.
|
||||
* Returns whether the info bar is currently revealed.
|
||||
*
|
||||
* Returns: the current value of the #GtkInfoBar:revealed property
|
||||
*/
|
||||
gboolean
|
||||
gtk_info_bar_get_revealed (GtkInfoBar *info_bar)
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
/**
|
||||
* SECTION:gtkmaplistmodel
|
||||
* @title: GtkMapListModel
|
||||
* @short_description: a #GListModel that maps items from a child list model to
|
||||
* a different item
|
||||
* @short_description: A list model that transforms its items
|
||||
* @see_also: #GListModel
|
||||
*
|
||||
* #GtkMapListModel is a list model that takes a list model and maps the items
|
||||
|
||||
@@ -614,7 +614,7 @@ gtk_media_stream_set_playing (GtkMediaStream *self,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_medai_stream_get_ended:
|
||||
* gtk_media_stream_get_ended:
|
||||
* @self: a #GtkMediaStream
|
||||
*
|
||||
* Returns whether the streams playback is finished.
|
||||
|
||||
@@ -333,19 +333,19 @@ pw_dialog_got_response (GtkDialog *dialog,
|
||||
|
||||
if (priv->username_entry)
|
||||
{
|
||||
text = gtk_entry_get_text (GTK_ENTRY (priv->username_entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (priv->username_entry));
|
||||
g_mount_operation_set_username (op, text);
|
||||
}
|
||||
|
||||
if (priv->domain_entry)
|
||||
{
|
||||
text = gtk_entry_get_text (GTK_ENTRY (priv->domain_entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (priv->domain_entry));
|
||||
g_mount_operation_set_domain (op, text);
|
||||
}
|
||||
|
||||
if (priv->password_entry)
|
||||
{
|
||||
text = gtk_entry_get_text (GTK_ENTRY (priv->password_entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (entry_widget));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (entry), value);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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);
|
||||
|
||||
@@ -7193,6 +7193,15 @@ 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)
|
||||
@@ -7210,6 +7219,14 @@ 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)
|
||||
{
|
||||
@@ -7288,6 +7305,15 @@ 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
@@ -771,7 +771,7 @@ gtk_overlay_set_clip_overlay (GtkOverlay *overlay,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_overlay_get_overlay_clip_overlay:
|
||||
* gtk_overlay_get_clip_overlay:
|
||||
* @overlay: a #GtkOverlay
|
||||
* @widget: an overlay child of #GtkOverlay
|
||||
*
|
||||
|
||||
@@ -787,7 +787,9 @@ 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;
|
||||
}
|
||||
|
||||
@@ -36,12 +36,17 @@
|
||||
#include "a11y/gtkentryaccessible.h"
|
||||
|
||||
/**
|
||||
* SECTION:gtkpasswordhentry
|
||||
* SECTION:gtkpasswordentry
|
||||
* @Short_description: An entry for secrets
|
||||
* @Title: GtkPasswordEntry
|
||||
*
|
||||
* #GtkPasswordEntry is entry that has been tailored for
|
||||
* entering secrets.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -2575,7 +2575,7 @@ rename_entry_changed (GtkEntry *entry,
|
||||
GList *rows;
|
||||
GList *l;
|
||||
|
||||
new_name = gtk_entry_get_text (GTK_ENTRY (sidebar->rename_entry));
|
||||
new_name = gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (sidebar->rename_entry)));
|
||||
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (sidebar->rename_entry), name);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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
@@ -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_entry_set_text (GTK_ENTRY (priv->address_entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (priv->address_entry));
|
||||
uri = gtk_editable_get_text (GTK_EDITABLE (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_entry_get_text (GTK_ENTRY (priv->address_entry)));
|
||||
address = g_strdup (gtk_editable_get_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->address_entry), uri);
|
||||
gtk_editable_set_text (GTK_EDITABLE (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_entry_set_text (GTK_ENTRY (priv->address_entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->address_entry), "");
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_places_view_parent_class)->map (widget);
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ store_entry (GtkEntry *entry,
|
||||
g_free (*data);
|
||||
}
|
||||
|
||||
*data = g_strdup (gtk_entry_get_text (entry));
|
||||
*data = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -710,7 +710,7 @@ request_password (GtkPrintBackend *backend,
|
||||
focus = entry;
|
||||
|
||||
if (ai_default[i] != NULL)
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), ai_default[i]);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), ai_default[i]);
|
||||
|
||||
gtk_entry_set_visibility (GTK_ENTRY (entry), ai_visible[i]);
|
||||
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
|
||||
|
||||
@@ -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_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)))));
|
||||
value = g_strdup (gtk_editable_get_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo)))));
|
||||
*custom = TRUE;
|
||||
}
|
||||
|
||||
@@ -573,7 +573,9 @@ 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 *
|
||||
@@ -671,7 +673,7 @@ combo_changed_cb (GtkWidget *combo,
|
||||
|
||||
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
|
||||
|
||||
gtk_entry_set_text (entry, filtered_val);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), filtered_val);
|
||||
}
|
||||
value = filtered_val;
|
||||
}
|
||||
@@ -691,7 +693,7 @@ entry_changed_cb (GtkWidget *entry,
|
||||
const gchar *value;
|
||||
|
||||
g_signal_handler_block (priv->source, priv->source_changed_handler);
|
||||
value = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||
value = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
if (value)
|
||||
gtk_printer_option_set (priv->source, value);
|
||||
g_signal_handler_unblock (priv->source, priv->source_changed_handler);
|
||||
@@ -968,7 +970,7 @@ update_widgets (GtkPrinterOptionWidget *widget)
|
||||
alternative_set (priv->box, source->value);
|
||||
break;
|
||||
case GTK_PRINTER_OPTION_TYPE_STRING:
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->entry), source->value);
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->entry), source->value);
|
||||
break;
|
||||
case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD:
|
||||
case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSCODE:
|
||||
@@ -982,7 +984,7 @@ update_widgets (GtkPrinterOptionWidget *widget)
|
||||
if (gtk_printer_option_has_choice (source, source->value))
|
||||
combo_box_set (priv->combo, source->value);
|
||||
else
|
||||
gtk_entry_set_text (entry, source->value);
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), source->value);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -729,8 +729,10 @@ 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
|
||||
{
|
||||
@@ -1025,8 +1027,10 @@ 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
|
||||
|
||||
@@ -2852,7 +2852,9 @@ handle_progress_response (GtkWidget *dialog,
|
||||
static gboolean
|
||||
show_progress_timeout (PrintPagesData *data)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (data->progress));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
data->op->priv->show_progress_timeout_id = 0;
|
||||
|
||||
|
||||
@@ -1467,7 +1467,7 @@ update_print_at_option (GtkPrintUnixDialog *dialog)
|
||||
{
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (priv->print_at_entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (priv->print_at_entry));
|
||||
gtk_printer_option_set (option, text);
|
||||
}
|
||||
}
|
||||
@@ -1488,7 +1488,7 @@ setup_print_at (GtkPrintUnixDialog *dialog)
|
||||
gtk_widget_set_sensitive (priv->print_at_radio, FALSE);
|
||||
gtk_widget_set_sensitive (priv->print_at_entry, FALSE);
|
||||
gtk_widget_set_sensitive (priv->print_hold_radio, FALSE);
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->print_at_entry), "");
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->print_at_entry), "");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1515,7 +1515,7 @@ setup_print_at (GtkPrintUnixDialog *dialog)
|
||||
|
||||
option = gtk_printer_option_set_lookup (priv->options, "gtk-print-time-text");
|
||||
if (option != NULL)
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->print_at_entry), option->value);
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->print_at_entry), option->value);
|
||||
|
||||
priv->updating_print_at = FALSE;
|
||||
|
||||
@@ -1653,7 +1653,7 @@ update_dialog_from_capabilities (GtkPrintUnixDialog *dialog)
|
||||
const gchar *copies;
|
||||
GtkWidget *button;
|
||||
|
||||
copies = gtk_spin_button_get_text (GTK_SPIN_BUTTON (priv->copies_spin));
|
||||
copies = gtk_editable_get_text (GTK_EDITABLE (priv->copies_spin));
|
||||
can_collate = (*copies != '\0' && atoi (copies) > 1);
|
||||
|
||||
caps = priv->manual_capabilities | priv->printer_capabilities;
|
||||
@@ -2358,7 +2358,7 @@ dialog_get_page_ranges (GtkPrintUnixDialog *dialog,
|
||||
GtkPageRange *ranges;
|
||||
gint start, end;
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (priv->page_range_entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (priv->page_range_entry));
|
||||
|
||||
if (*text == 0)
|
||||
{
|
||||
@@ -2449,7 +2449,7 @@ dialog_set_page_ranges (GtkPrintUnixDialog *dialog,
|
||||
g_string_append (s, ",");
|
||||
}
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->page_range_entry), s->str);
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->page_range_entry), s->str);
|
||||
|
||||
g_string_free (s, TRUE);
|
||||
}
|
||||
@@ -2529,7 +2529,7 @@ dialog_get_n_copies (GtkPrintUnixDialog *dialog)
|
||||
|
||||
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->copies_spin));
|
||||
|
||||
text = gtk_spin_button_get_text (GTK_SPIN_BUTTON (priv->copies_spin));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (priv->copies_spin));
|
||||
n_copies = g_ascii_strtoull (text, &endptr, 0);
|
||||
|
||||
if (gtk_widget_is_sensitive (dialog->priv->copies_spin))
|
||||
@@ -3312,7 +3312,9 @@ paper_size_changed (GtkComboBox *combo_box,
|
||||
/* And show the custom paper dialog */
|
||||
custom_paper_dialog = _gtk_custom_paper_unix_dialog_new (GTK_WINDOW (dialog), _("Manage Custom Sizes"));
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -119,17 +119,6 @@ void gtk_range_get_slider_range (GtkRange *range
|
||||
gint *slider_start,
|
||||
gint *slider_end);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_range_set_lower_stepper_sensitivity (GtkRange *range,
|
||||
GtkSensitivityType sensitivity);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange *range);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_range_set_upper_stepper_sensitivity (GtkRange *range,
|
||||
GtkSensitivityType sensitivity);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkSensitivityType gtk_range_get_upper_stepper_sensitivity (GtkRange *range);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_range_set_increments (GtkRange *range,
|
||||
gdouble step,
|
||||
|
||||
+2
-2
@@ -23,9 +23,9 @@
|
||||
#include "gdk/gdk-private.h"
|
||||
|
||||
/**
|
||||
* SECTION:root
|
||||
* SECTION:gtkroot
|
||||
* @Title: GtkRoot
|
||||
* @Short_description: Root widgets
|
||||
* @Short_description: Interface for root widgets
|
||||
* @See_also: #GtkWindow
|
||||
*
|
||||
* #GtkRoot is the interface implemented by all widgets that can act as a toplevel
|
||||
|
||||
+56
-1
@@ -41,7 +41,7 @@
|
||||
* A #GtkSelectionModel supports a single boolean per row indicating if a row is selected
|
||||
* or not. This can be queried via gtk_selection_model_is_selected(). When the selected
|
||||
* state of one or more rows changes, the model will emit the
|
||||
* GtkSelectionModel::selection-changed signal by calling the
|
||||
* #GtkSelectionModel::selection-changed signal by calling the
|
||||
* gtk_selection_model_selection_changed() function. The positions given in that signal
|
||||
* may have their selection state changed, though that is not a requirement.
|
||||
* If new items added to the model via the #GListModel::items-changed signal are selected
|
||||
@@ -57,6 +57,7 @@
|
||||
* selection functions do NOT indicate if selection or unselection happened. They are
|
||||
* only meant to indicate complete failure, like when this mode of selecting is not
|
||||
* supported by the model.
|
||||
*
|
||||
* Selections may happen asynchronously, so the only reliable way to find out when an
|
||||
* item was selected is to listen to the signals that indicate selection.
|
||||
*/
|
||||
@@ -201,6 +202,14 @@ gtk_selection_model_is_selected (GtkSelectionModel *model,
|
||||
return iface->is_selected (model, position);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_model_select_item:
|
||||
* @model: a #GtkSelectionModel
|
||||
* @position: the position of the item to select
|
||||
* @exclusive: whether previously selected items should be unselected
|
||||
*
|
||||
* Requests to select an item in the model.
|
||||
*/
|
||||
gboolean
|
||||
gtk_selection_model_select_item (GtkSelectionModel *model,
|
||||
guint position,
|
||||
@@ -214,6 +223,13 @@ gtk_selection_model_select_item (GtkSelectionModel *model,
|
||||
return iface->select_item (model, position, exclusive);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_model_unselect_item:
|
||||
* @model: a #GtkSelectionModel
|
||||
* @position: the position of the item to unselect
|
||||
*
|
||||
* Requests to unselect an item in the model.
|
||||
*/
|
||||
gboolean
|
||||
gtk_selection_model_unselect_item (GtkSelectionModel *model,
|
||||
guint position)
|
||||
@@ -226,6 +242,15 @@ gtk_selection_model_unselect_item (GtkSelectionModel *model,
|
||||
return iface->unselect_item (model, position);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_model_select_range:
|
||||
* @model: a #GtkSelectionModel
|
||||
* @position: the first item to select
|
||||
* @n_items: the number of items to select
|
||||
* @exclusive: whether previously selected items should be unselected
|
||||
*
|
||||
* Requests to select a range of items in the model.
|
||||
*/
|
||||
gboolean
|
||||
gtk_selection_model_select_range (GtkSelectionModel *model,
|
||||
guint position,
|
||||
@@ -240,6 +265,14 @@ gtk_selection_model_select_range (GtkSelectionModel *model,
|
||||
return iface->select_range (model, position, n_items, exclusive);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_model_unselect_range:
|
||||
* @model: a #GtkSelectionModel
|
||||
* @position: the first item to unselect
|
||||
* @n_items: the number of items to unselect
|
||||
*
|
||||
* Requests to unselect a range of items in the model.
|
||||
*/
|
||||
gboolean
|
||||
gtk_selection_model_unselect_range (GtkSelectionModel *model,
|
||||
guint position,
|
||||
@@ -253,6 +286,12 @@ gtk_selection_model_unselect_range (GtkSelectionModel *model,
|
||||
return iface->unselect_range (model, position, n_items);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_model_select_all:
|
||||
* @model: a #GtkSelectionModel
|
||||
*
|
||||
* Requests to select all items in the model.
|
||||
*/
|
||||
gboolean
|
||||
gtk_selection_model_select_all (GtkSelectionModel *model)
|
||||
{
|
||||
@@ -264,6 +303,12 @@ gtk_selection_model_select_all (GtkSelectionModel *model)
|
||||
return iface->select_all (model);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_model_unselect_all:
|
||||
* @model: a #GtkSelectionModel
|
||||
*
|
||||
* Requests to unselect all items in the model.
|
||||
*/
|
||||
gboolean
|
||||
gtk_selection_model_unselect_all (GtkSelectionModel *model)
|
||||
{
|
||||
@@ -315,6 +360,16 @@ gtk_selection_model_query_range (GtkSelectionModel *model,
|
||||
return iface->query_range (model, position, start_range, n_items, selected);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_selection_model_selection_changed:
|
||||
* @model: a #GtkSelectionModel
|
||||
* @position: the first changed item
|
||||
* @n_items: the number of changed items
|
||||
*
|
||||
* Helper function for implementations of #GtkSelectionModel.
|
||||
* Call this when a the selection changes to emit the ::selection-changed
|
||||
* signal.
|
||||
*/
|
||||
void
|
||||
gtk_selection_model_selection_changed (GtkSelectionModel *model,
|
||||
guint position,
|
||||
|
||||
@@ -549,7 +549,7 @@ gtk_shortcuts_window__entry__changed (GtkShortcutsWindow *self,
|
||||
gpointer value;
|
||||
gboolean has_result;
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (search_entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (search_entry));
|
||||
|
||||
if (!text || !*text)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/**
|
||||
* SECTION:gtkslicelistmodel
|
||||
* @title: GtkSliceListModel
|
||||
* @short_description: a #GListModel that presents a slice out of a larger list
|
||||
* @short_description: A list model that presents a slice out of a larger list
|
||||
* @see_also: #GListModel
|
||||
*
|
||||
* #GtkSliceListModel is a list model that takes a list model and presents a slice of
|
||||
|
||||
+72
-5
@@ -300,6 +300,16 @@ gtk_snapshot_collect_debug (GtkSnapshot *snapshot,
|
||||
return debug_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_debug:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @message: a printf-style format string
|
||||
* @...: arguments for @message
|
||||
*
|
||||
* Inserts a debug node with a message. Debug nodes don't affect
|
||||
* the rendering at all, but can be helpful in identifying parts
|
||||
* of a render node tree dump, for example in the GTK inspector.
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_debug (GtkSnapshot *snapshot,
|
||||
const char *message,
|
||||
@@ -356,6 +366,15 @@ gtk_snapshot_collect_opacity (GtkSnapshot *snapshot,
|
||||
return opacity_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_opacity:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @opacity: the opacity to use
|
||||
*
|
||||
* Modifies the opacity of an image.
|
||||
*
|
||||
* The image is recorded until the next call to gtk_snapshot_pop().
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_opacity (GtkSnapshot *snapshot,
|
||||
double opacity)
|
||||
@@ -394,6 +413,15 @@ gtk_snapshot_collect_blur (GtkSnapshot *snapshot,
|
||||
return blur_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_blur:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @radius: the blur radius to use
|
||||
*
|
||||
* Blurs an image.
|
||||
*
|
||||
* The image is recorded until the next call to gtk_snapshot_pop().
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_blur (GtkSnapshot *snapshot,
|
||||
double radius)
|
||||
@@ -458,6 +486,17 @@ gtk_snapshot_collect_color_matrix (GtkSnapshot *snapshot,
|
||||
return color_matrix_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_color_matrix:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @color_matrix: the color matrix to use
|
||||
* @color_offset: the color offset to use
|
||||
*
|
||||
* Modifies the colors of an image by applying an affine transformation
|
||||
* in RGB space.
|
||||
*
|
||||
* The image is recorded until the next call to gtk_snapshot_pop().
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_color_matrix (GtkSnapshot *snapshot,
|
||||
const graphene_matrix_t *color_matrix,
|
||||
@@ -631,6 +670,15 @@ gtk_snapshot_collect_clip (GtkSnapshot *snapshot,
|
||||
return clip_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_clip:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @bounds: the rectangle to clip to
|
||||
*
|
||||
* Clips an image to a rectangle.
|
||||
*
|
||||
* The image is recorded until the next call to gtk_snapshot_pop().
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_clip (GtkSnapshot *snapshot,
|
||||
const graphene_rect_t *bounds)
|
||||
@@ -689,6 +737,15 @@ gtk_snapshot_collect_rounded_clip (GtkSnapshot *snapshot,
|
||||
return clip_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_rounded_clip:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @bounds: the rounded rectangle to clip to
|
||||
*
|
||||
* Clips an image to a rounded rectangle.
|
||||
*
|
||||
* The image is recorded until the next call to gtk_snapshot_pop().
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_rounded_clip (GtkSnapshot *snapshot,
|
||||
const GskRoundedRect *bounds)
|
||||
@@ -729,6 +786,16 @@ gtk_snapshot_collect_shadow (GtkSnapshot *snapshot,
|
||||
return shadow_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_push_shadow:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @shadow: the first shadow specification
|
||||
* @n_shadows: number of shadow specifications
|
||||
*
|
||||
* Applies a shadow to an image.
|
||||
*
|
||||
* The image is recorded until the next call to gtk_snapshot_pop().
|
||||
*/
|
||||
void
|
||||
gtk_snapshot_push_shadow (GtkSnapshot *snapshot,
|
||||
const GskShadow *shadow,
|
||||
@@ -1171,7 +1238,7 @@ gtk_snapshot_restore (GtkSnapshot *snapshot)
|
||||
/**
|
||||
* gtk_snapshot_transform:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @tranform: (allow-none): the transform to apply
|
||||
* @transform: (allow-none): the transform to apply
|
||||
*
|
||||
* Transforms @snapshot's coordinate system with the given @transform.
|
||||
**/
|
||||
@@ -1222,7 +1289,7 @@ gtk_snapshot_transform_matrix_with_category (GtkSnapshot *snapshot,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_transform_translate:
|
||||
* gtk_snapshot_translate:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @point: the point to translate the snapshot by
|
||||
*
|
||||
@@ -1242,7 +1309,7 @@ gtk_snapshot_translate (GtkSnapshot *snapshot,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_transform_translate_3d:
|
||||
* gtk_snapshot_translate_3d:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @point: the point to translate the snapshot by
|
||||
*
|
||||
@@ -1262,7 +1329,7 @@ gtk_snapshot_translate_3d (GtkSnapshot *snapshot,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_transform_rotate:
|
||||
* gtk_snapshot_rotate:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @angle: the rotation angle, in degrees (clockwise)
|
||||
*
|
||||
@@ -1282,7 +1349,7 @@ gtk_snapshot_rotate (GtkSnapshot *snapshot,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_snapshot_transform_rotate_3d:
|
||||
* gtk_snapshot_rotate_3d:
|
||||
* @snapshot: a #GtkSnapshot
|
||||
* @angle: the rotation angle, in degrees (clockwise)
|
||||
* @axis: The rotation axis
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user