1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2026-04-10 17:03:35 +02:00

GTK3 version bump

This commit is contained in:
2017-04-28 15:41:23 +02:00
parent 61036211eb
commit 1888ae07c8
5 changed files with 585 additions and 0 deletions

View File

@@ -0,0 +1,206 @@
diff -ur gtk+-3.22.12/gtk/gtkentry.c gtk+-3.22.12_patched/gtk/gtkentry.c
--- gtk+-3.22.12/gtk/gtkentry.c 2017-02-21 22:50:09.000000000 +0100
+++ gtk+-3.22.12_patched/gtk/gtkentry.c 2017-04-28 15:01:30.384981454 +0200
@@ -317,6 +317,7 @@
CUT_CLIPBOARD,
COPY_CLIPBOARD,
PASTE_CLIPBOARD,
+ PASTE_SELECTION,
TOGGLE_OVERWRITE,
ICON_PRESS,
ICON_RELEASE,
@@ -543,6 +544,8 @@
static void gtk_entry_cut_clipboard (GtkEntry *entry);
static void gtk_entry_copy_clipboard (GtkEntry *entry);
static void gtk_entry_paste_clipboard (GtkEntry *entry);
+static void gtk_entry_paste_selection (GtkEntry *entry,
+ const gchar *which);
static void gtk_entry_toggle_overwrite (GtkEntry *entry);
static void gtk_entry_select_all (GtkEntry *entry);
static void gtk_entry_real_activate (GtkEntry *entry);
@@ -807,6 +810,7 @@
class->cut_clipboard = gtk_entry_cut_clipboard;
class->copy_clipboard = gtk_entry_copy_clipboard;
class->paste_clipboard = gtk_entry_paste_clipboard;
+ class->paste_selection = gtk_entry_paste_selection;
class->toggle_overwrite = gtk_entry_toggle_overwrite;
class->activate = gtk_entry_real_activate;
class->get_text_area_size = gtk_entry_get_text_area_size;
@@ -1797,6 +1801,24 @@
G_TYPE_NONE, 0);
/**
+ * GtkEntry::paste-selection:
+ * @entry: the object which received the signal
+ *
+ * The ::paste-selection signal is a
+ * <link linkend="keybinding-signals">keybinding signal</link>
+ * which gets emitted to paste the contents of the given selection
+ * into the entry.
+ */
+ signals[PASTE_SELECTION] =
+ g_signal_new (I_("paste-selection"),
+ G_OBJECT_CLASS_TYPE (gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GtkEntryClass, paste_selection),
+ NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 0);
+
+ /**
* GtkEntry::toggle-overwrite:
* @entry: the object which received the signal
*
@@ -5904,6 +5926,27 @@
}
static void
+gtk_entry_paste_selection (GtkEntry *entry,
+ const gchar *which)
+{
+ GtkEntryPrivate *priv = entry->priv;
+
+ if (priv->editable)
+ {
+ if (g_str_equal(which, "primary"))
+ gtk_entry_paste (entry, GDK_SELECTION_PRIMARY);
+ else if (g_str_equal(which, "secondary"))
+ gtk_entry_paste (entry, GDK_SELECTION_SECONDARY);
+ else if (g_str_equal(which, "clipboard"))
+ gtk_entry_paste (entry, GDK_SELECTION_CLIPBOARD);
+ else
+ gtk_widget_error_bell (GTK_WIDGET (entry));
+ }
+ else
+ gtk_widget_error_bell (GTK_WIDGET (entry));
+}
+
+static void
gtk_entry_delete_cb (GtkEntry *entry)
{
GtkEntryPrivate *priv = entry->priv;
diff -ur gtk+-3.22.12/gtk/gtkentry.h gtk+-3.22.12_patched/gtk/gtkentry.h
--- gtk+-3.22.12/gtk/gtkentry.h 2016-12-30 15:55:56.000000000 +0100
+++ gtk+-3.22.12_patched/gtk/gtkentry.h 2017-04-28 15:02:11.232982874 +0200
@@ -145,6 +145,8 @@
void (* cut_clipboard) (GtkEntry *entry);
void (* copy_clipboard) (GtkEntry *entry);
void (* paste_clipboard) (GtkEntry *entry);
+ void (* paste_selection) (GtkEntry *entry,
+ const gchar *which);
void (* toggle_overwrite) (GtkEntry *entry);
/* hooks to add other objects beside the entry (like in GtkSpinButton) */
@@ -168,7 +170,6 @@
void (*_gtk_reserved4) (void);
void (*_gtk_reserved5) (void);
void (*_gtk_reserved6) (void);
- void (*_gtk_reserved7) (void);
};
GDK_AVAILABLE_IN_ALL
diff -ur gtk+-3.22.12/gtk/gtktextview.c gtk+-3.22.12_patched/gtk/gtktextview.c
--- gtk+-3.22.12/gtk/gtktextview.c 2017-04-01 22:49:49.000000000 +0200
+++ gtk+-3.22.12_patched/gtk/gtktextview.c 2017-04-28 15:04:51.144988431 +0200
@@ -326,6 +326,7 @@
CUT_CLIPBOARD,
COPY_CLIPBOARD,
PASTE_CLIPBOARD,
+ PASTE_SELECTION,
TOGGLE_OVERWRITE,
MOVE_VIEWPORT,
SELECT_ALL,
@@ -495,6 +496,8 @@
static void gtk_text_view_cut_clipboard (GtkTextView *text_view);
static void gtk_text_view_copy_clipboard (GtkTextView *text_view);
static void gtk_text_view_paste_clipboard (GtkTextView *text_view);
+static void gtk_text_view_paste_selection (GtkTextView *text_view,
+ const gchar *which);
static void gtk_text_view_toggle_overwrite (GtkTextView *text_view);
static void gtk_text_view_toggle_cursor_visible (GtkTextView *text_view);
@@ -782,6 +785,7 @@
klass->cut_clipboard = gtk_text_view_cut_clipboard;
klass->copy_clipboard = gtk_text_view_copy_clipboard;
klass->paste_clipboard = gtk_text_view_paste_clipboard;
+ klass->paste_selection = gtk_text_view_paste_selection;
klass->toggle_overwrite = gtk_text_view_toggle_overwrite;
klass->create_buffer = gtk_text_view_create_buffer;
klass->extend_selection = gtk_text_view_extend_selection;
@@ -1302,6 +1306,24 @@
G_TYPE_NONE, 0);
/**
+ * GtkTextView::paste-selection:
+ * @text_view: the object which received the signal
+ *
+ * The ::paste-selection signal is a
+ * <link linkend="keybinding-signals">keybinding signal</link>
+ * which gets emitted to paste the contents of the given selection
+ * into the text view.
+ */
+ signals[PASTE_SELECTION] =
+ g_signal_new (I_("paste-selection"),
+ G_OBJECT_CLASS_TYPE (gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GtkTextViewClass, paste_selection),
+ NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 0);
+
+ /**
* GtkTextView::toggle-overwrite:
* @text_view: the object which received the signal
*
@@ -7185,6 +7207,31 @@
}
static void
+gtk_text_view_paste_selection (GtkTextView *text_view,
+ const gchar *which)
+{
+ GtkClipboard *clipboard = NULL;
+
+ if (g_str_equal (which, "primary"))
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view),
+ GDK_SELECTION_PRIMARY);
+ else if (g_str_equal (which, "secondary"))
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view),
+ GDK_SELECTION_SECONDARY);
+ else if (g_str_equal (which, "clipboard"))
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view),
+ GDK_SELECTION_CLIPBOARD);
+
+ if (clipboard)
+ gtk_text_buffer_paste_clipboard (get_buffer (text_view),
+ clipboard,
+ NULL,
+ text_view->priv->editable);
+ else
+ gtk_widget_error_bell (GTK_WIDGET (text_view));
+}
+
+static void
gtk_text_view_paste_done_handler (GtkTextBuffer *buffer,
GtkClipboard *clipboard,
gpointer data)
diff -ur gtk+-3.22.12/gtk/gtktextview.h gtk+-3.22.12_patched/gtk/gtktextview.h
--- gtk+-3.22.12/gtk/gtktextview.h 2016-12-30 15:55:56.000000000 +0100
+++ gtk+-3.22.12_patched/gtk/gtktextview.h 2017-04-28 15:05:22.208989510 +0200
@@ -182,6 +182,8 @@
void (* cut_clipboard) (GtkTextView *text_view);
void (* copy_clipboard) (GtkTextView *text_view);
void (* paste_clipboard) (GtkTextView *text_view);
+ void (* paste_selection) (GtkTextView *text_view,
+ const gchar *which);
void (* toggle_overwrite) (GtkTextView *text_view);
GtkTextBuffer * (* create_buffer) (GtkTextView *text_view);
void (* draw_layer) (GtkTextView *text_view,
@@ -200,7 +202,6 @@
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
- void (*_gtk_reserved5) (void);
};
GDK_AVAILABLE_IN_ALL

View File

@@ -0,0 +1,138 @@
From 101b43f4a38904ee21070a3e2eb5ba03dfe17647 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Tue, 1 Nov 2016 15:24:22 +0100
Subject: [PATCH] Always use external gtk-update-icon-cache
Check for gtk-update-icon-cache to install demos, otherwise it is not
used when building.
---
configure.ac | 2 ++
demos/gtk-demo/Makefile.am | 2 +-
demos/widget-factory/Makefile.am | 2 +-
docs/reference/gtk/Makefile.am | 1 -
gtk/Makefile.am | 44 ----------------------------------------
5 files changed, 4 insertions(+), 47 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4f9f183..ecf99dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -999,6 +999,8 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
+AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, [gtk-update-icon-cache], [no])
+
########################################
# Windowing system checks
########################################
diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am
index 8c15e16..5d774d2 100644
--- a/demos/gtk-demo/Makefile.am
+++ b/demos/gtk-demo/Makefile.am
@@ -171,7 +171,7 @@ dist_appsicon32_DATA = data/32x32/gtk3-demo.png data/32x32/gtk3-demo-symbolic.sy
dist_appsicon48_DATA = data/48x48/gtk3-demo.png data/48x48/gtk3-demo-symbolic.symbolic.png
dist_appsicon256_DATA = data/256x256/gtk3-demo.png data/256x256/gtk3-demo-symbolic.symbolic.png
-update_icon_cache = $(top_builddir)/gtk/gtk-update-icon-cache$(EXEEXT) --ignore-theme-index --force
+update_icon_cache = $(GTK_UPDATE_ICON_CACHE) --ignore-theme-index --force
install-data-hook: install-update-icon-cache
uninstall-hook: uninstall-update-icon-cache
diff --git a/demos/widget-factory/Makefile.am b/demos/widget-factory/Makefile.am
index a6bfbdc..28a3be2 100644
--- a/demos/widget-factory/Makefile.am
+++ b/demos/widget-factory/Makefile.am
@@ -47,7 +47,7 @@ dist_appsicon32_DATA = data/32x32/gtk3-widget-factory.png data/32x32/gtk3-widget
dist_appsicon48_DATA = data/48x48/gtk3-widget-factory.png data/48x48/gtk3-widget-factory-symbolic.symbolic.png
dist_appsicon256_DATA = data/256x256/gtk3-widget-factory.png data/256x256/gtk3-widget-factory-symbolic.symbolic.png
-update_icon_cache = $(top_builddir)/gtk/gtk-update-icon-cache$(EXEEXT) --ignore-theme-index --force
+update_icon_cache = $(GTK_UPDATE_ICON_CACHE) --ignore-theme-index --force
install-data-hook: install-update-icon-cache
uninstall-hook: uninstall-update-icon-cache
diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am
index 5a88a12..b51f3ac 100644
--- a/docs/reference/gtk/Makefile.am
+++ b/docs/reference/gtk/Makefile.am
@@ -504,7 +504,6 @@ EXTRA_DIST += version.xml.in gtk3.types.in
man_MANS = \
gtk-query-immodules-3.0.1 \
- gtk-update-icon-cache.1 \
gtk-encode-symbolic-svg.1 \
gtk-launch.1 \
gtk3-demo.1 \
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 3b76b82..d4c5681 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1581,7 +1581,6 @@ endif
#
bin_PROGRAMS = \
gtk-query-immodules-3.0 \
- gtk-update-icon-cache \
gtk-encode-symbolic-svg \
gtk-builder-tool \
gtk-query-settings \
@@ -1594,9 +1593,6 @@ gtk_query_immodules_3_0_LDADD = \
$(GMODULE_LIBS) \
$(GTK_DEP_LIBS)
-gtk_update_icon_cache_SOURCES = updateiconcache.c
-gtk_update_icon_cache_LDADD = $(GDK_PIXBUF_LIBS)
-
gtk_encode_symbolic_svg_SOURCES = encodesymbolic.c
gtk_encode_symbolic_svg_LDADD = \
$(GDK_PIXBUF_LIBS) \
@@ -1621,46 +1617,6 @@ gtk_launch_LDADD = \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS)
-if OS_WIN32
-
-# Workaround for UAC silliness: programs with "update" in their name
-# are believed to be installers and require elevated privileges to be
-# used... Embed a manifest file into executable to tell Windows that
-# gtk-update-icon-cache.exe doesn't require any special privileges.
-
-GTK_UPDATE_ICON_CACHE_MANIFEST = gtk-update-icon-cache.exe.manifest
-GTK_UPDATE_ICON_CACHE_RC = gtk-update-icon-cache.rc
-GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT = gtk-update-icon-cache_manifest.o
-
-$(GTK_UPDATE_ICON_CACHE_MANIFEST):
- (echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' ; \
- echo '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">' ; \
- echo ' <assemblyIdentity version="1.0.0.0"' ; \
- echo ' processorArchitecture="'$(EXE_MANIFEST_ARCHITECTURE)'"' ; \
- echo ' name="gtk-update-icon-cache.exe"' ; \
- echo ' type="win32"/>' ; \
- echo ' <!-- Identify the application security requirements. -->' ; \
- echo ' <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">' ; \
- echo ' <security>' ; \
- echo ' <requestedPrivileges>' ; \
- echo ' <requestedExecutionLevel' ; \
- echo ' level="asInvoker"' ; \
- echo ' uiAccess="false"/>' ; \
- echo ' </requestedPrivileges>' ; \
- echo ' </security>' ; \
- echo ' </trustInfo>' ; \
- echo '</assembly>' ) >$@
-
-$(GTK_UPDATE_ICON_CACHE_RC):
- (echo 'CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST '$(GTK_UPDATE_ICON_CACHE_MANIFEST)) >$@
-
-$(GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT): $(GTK_UPDATE_ICON_CACHE_RC) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
- $(WINDRES) --input $< --output $@ --output-format=coff
-
-gtk_update_icon_cache_LDADD += $(GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT)
-
-endif
-
.PHONY: files
files:
--
2.10.1

View File

@@ -0,0 +1,4 @@
[Settings]
gtk-theme-name = Adwaita
gtk-icon-theme-name = gnome
gtk-cursor-theme-name = Adwaita