Compare commits

...

11 Commits

Author SHA1 Message Date
gryf 9090faca5c sys-apps/renameutils - fixes for the gcc15 2026-04-22 09:27:11 +02:00
gryf 00b49d01ea app-pda/pilot-link - fixes for the gcc15 2026-04-22 09:26:02 +02:00
gryf aa457df477 media-libs/id3lib - a workaround for compiling it with easytag and gcc15 2026-04-22 09:21:59 +02:00
gryf ef6ebef163 Removed patch for MC 4.8.28, as the change was reverted in usptream 2026-04-22 09:10:39 +02:00
gryf 79086cc920 Update primary selection shortcuts in gtk3 2025-03-24 11:51:18 +01:00
gryf e052b6d302 Added fix for incompatible type in pilot-link 2025-02-18 15:08:42 +01:00
gryf 84260e6b0d Added patch for wezterm
Added new method for getting seqno field for the pane, which indicates
changes that happened on the pane, storing and comparing this field in
lua config, helps with that task for identifying tabs, which are still
active with those, where activity has stopped already.
2023-08-24 13:48:44 +02:00
gryf 282e1e8a04 Changing directory name for mc 2023-03-23 12:25:50 +01:00
gryf 677efa8e7d Patch for changing mc shortcut was restored in 4.8.29 2023-03-23 12:23:30 +01:00
gryf 2990ddda23 Updated image magic patch 2023-03-17 08:38:36 +01:00
gryf 5077f5ed43 Removed libxf bgra patch, which is not needed anymore 2023-03-17 08:24:34 +01:00
9 changed files with 2993 additions and 797 deletions
-20
View File
@@ -1,20 +0,0 @@
--- mc-4.8.28_orig/src/filemanager/filemanager.c 2022-03-20 11:02:47.000000000 +0100
+++ mc-4.8.28/src/filemanager/filemanager.c 2022-07-23 18:14:31.270726018 +0200
@@ -199,7 +199,7 @@
entries =
g_list_prepend (entries,
menu_entry_create (_("&Listing format..."), CK_SetupListingFormat));
- entries = g_list_prepend (entries, menu_entry_create (_("S&ort order..."), CK_Sort));
+ entries = g_list_prepend (entries, menu_entry_create (_("&Sort order..."), CK_Sort));
entries = g_list_prepend (entries, menu_entry_create (_("&Filter..."), CK_Filter));
#ifdef HAVE_CHARSET
entries = g_list_prepend (entries, menu_entry_create (_("&Encoding..."), CK_SelectCodepage));
@@ -212,7 +212,7 @@
entries = g_list_prepend (entries, menu_entry_create (_("S&hell link..."), CK_ConnectFish));
#endif
#ifdef ENABLE_VFS_SFTP
- entries = g_list_prepend (entries, menu_entry_create (_("&SFTP link..."), CK_ConnectSftp));
+ entries = g_list_prepend (entries, menu_entry_create (_("S&FTP link..."), CK_ConnectSftp));
#endif
entries = g_list_prepend (entries, menu_entry_create (_("Paneli&ze"), CK_Panelize));
entries = g_list_prepend (entries, menu_separator_create ());
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,14 @@
diff '--color=auto' -ur pilot-link-0.12.5_orig/src/pilot-read-todos.c pilot-link-0.12.5/src/pilot-read-todos.c
--- pilot-link-0.12.5_orig/src/pilot-read-todos.c 2009-06-04 15:32:32.000000000 +0200
+++ pilot-link-0.12.5/src/pilot-read-todos.c 2025-02-18 15:04:20.120418647 +0100
@@ -202,8 +202,8 @@
for (i = 0;; i++) {
int attr,
- category,
- len;
+ category;
+ long unsigned int len;
struct ToDo todo;
@@ -16,12 +16,3 @@ diff -ur ImageMagick-7.0.10-52-a/coders/ttf.c ImageMagick-7.0.10-52-b/coders/ttf
const TypeInfo
*type_info;
@@ -290,7 +292,7 @@
/*
Relinquish resources.
*/
- (void) RelinquishUniqueFileResource(draw_info->font);
+ (void) RelinquishUniqueFileResource(draw_info->font);
draw_info=DestroyDrawInfo(draw_info);
(void) CloseBlob(image);
return(GetFirstImageInList(image));
@@ -0,0 +1,17 @@
--- id3lib-3.8.3_orig/include/id3/globals.h 2026-04-01 11:04:30.002608338 +0200
+++ id3lib-3.8.3/include/id3/globals.h 2026-04-01 11:06:12.388848196 +0200
@@ -82,14 +82,6 @@
#define ID3_C_VAR extern
-#ifndef __cplusplus
-
-typedef int bool;
-# define false (0)
-# define true (!false)
-
-#endif /* __cplusplus */
-
ID3_C_VAR const char * const ID3LIB_NAME;
ID3_C_VAR const char * const ID3LIB_RELEASE;
ID3_C_VAR const char * const ID3LIB_FULL_NAME;
+160
View File
@@ -0,0 +1,160 @@
diff --git a/src/common/hmap.c b/src/common/hmap.c
index 9c5d657..90ca558 100644
--- a/src/common/hmap.c
+++ b/src/common/hmap.c
@@ -363,7 +363,7 @@ hmap_iterator(HMap *map, HMapIterator *it)
* function. But no other entry.
*/
void
-hmap_foreach_value(HMap *map, void (*iterator)())
+hmap_foreach_value(HMap *map, void (*iterator)(void*))
{
uint32_t c;
@@ -378,7 +378,7 @@ hmap_foreach_value(HMap *map, void (*iterator)())
}
void
-hmap_foreach_key(HMap *map, void (*iterator)())
+hmap_foreach_key(HMap *map, void (*iterator)(void*))
{
uint32_t c;
diff --git a/src/common/hmap.h b/src/common/hmap.h
index bf6684b..0ca0b56 100644
--- a/src/common/hmap.h
+++ b/src/common/hmap.h
@@ -50,8 +50,8 @@ void *hmap_put(HMap *map, void *key, void *value);
bool hmap_contains_key(HMap *map, const void *key);
void *hmap_remove(HMap *map, const void *key);
void hmap_iterator(HMap *map, HMapIterator *it);
-void hmap_foreach_key(HMap *map, void (*iterator)());
-void hmap_foreach_value(HMap *map, void (*iterator)());
+void hmap_foreach_key(HMap *map, void (*iterator)(void*));
+void hmap_foreach_value(HMap *map, void (*iterator)(void*));
void hmap_clear(HMap *map);
size_t hmap_size(HMap *map);
void hmap_set_hash_fn(HMap *map, hash_fn_t hash);
diff --git a/src/common/llist.c b/src/common/llist.c
index 01a74de..aed1eda 100644
--- a/src/common/llist.c
+++ b/src/common/llist.c
@@ -445,7 +445,7 @@ llist_is_empty(LList *list)
}
void
-llist_iterate(LList *list, void (*iterator_func)())
+llist_iterate(LList *list, void (*iterator_func)(void*))
{
LNode *entry;
for (entry = list->first; entry != NULL; entry = entry->next)
diff --git a/src/common/llist.h b/src/common/llist.h
index 11d13a3..c22cce9 100644
--- a/src/common/llist.h
+++ b/src/common/llist.h
@@ -68,7 +68,7 @@ LList *llist_clone(LList *list);
void **llist_to_array(LList *list);
void **llist_to_null_terminated_array(LList *list);
-void llist_iterate(LList *list, void (*iterator_func)());
+void llist_iterate(LList *list, void (*iterator_func)(void*));
void llist_iterator(LList *list, LListIterator *it);
void llist_reverse(LList *list);
diff --git a/src/common/tmap.c b/src/common/tmap.c
index afa2203..d1b1c09 100644
--- a/src/common/tmap.c
+++ b/src/common/tmap.c
@@ -507,7 +507,7 @@ predecessor(TMapNode *node)
#endif
static void
-tmap_foreach_nodes_key(TMapNode *node, void (*iterator)())
+tmap_foreach_nodes_key(TMapNode *node, void (*iterator)(void*))
{
if (node->left != &nil)
tmap_foreach_nodes_key(node->left, iterator);
@@ -517,7 +517,7 @@ tmap_foreach_nodes_key(TMapNode *node, void (*iterator)())
}
static void
-tmap_foreach_nodes_value(TMapNode *node, void (*iterator)())
+tmap_foreach_nodes_value(TMapNode *node, void (*iterator)(void*))
{
if (node->left != &nil)
tmap_foreach_nodes_value(node->left, iterator);
@@ -527,14 +527,14 @@ tmap_foreach_nodes_value(TMapNode *node, void (*iterator)())
}
void
-tmap_foreach_key(TMap *map, void (*iterator)())
+tmap_foreach_key(TMap *map, void (*iterator)(void*))
{
if (map->root != &nil)
tmap_foreach_nodes_key(map->root, iterator);
}
void
-tmap_foreach_value(TMap *map, void (*iterator)())
+tmap_foreach_value(TMap *map, void (*iterator)(void*))
{
if (map->root != &nil)
tmap_foreach_nodes_value(map->root, iterator);
diff --git a/src/common/tmap.h b/src/common/tmap.h
index b1368f8..7e073e7 100644
--- a/src/common/tmap.h
+++ b/src/common/tmap.h
@@ -51,8 +51,8 @@ void *tmap_remove(TMap *map, const void *key);
void tmap_iterator(TMap *map, TMapIterator *it); /* value iterator */
bool tmap_iterator_partial(TMap *map, TMapIterator *it, const void *match, comparison_fn_t comparator);
void tmap_clear(TMap *map);
-void tmap_foreach_key(TMap *map, void (*iterator)());
-void tmap_foreach_value(TMap *map, void (*iterator)());
+void tmap_foreach_key(TMap *map, void (*iterator)(void*));
+void tmap_foreach_value(TMap *map, void (*iterator)(void*));
#ifdef ENABLE_TMAP_TESTING
#include <stdio.h>
diff --git a/src/list.c b/src/list.c
index d5bac13..0012376 100644
--- a/src/list.c
+++ b/src/list.c
@@ -166,14 +166,14 @@ import_command(char **args)
hmap_free(map_files);
if (ferror(fh)) {
warn(_("%s: cannot read from file: %s\n"), quotearg(args[1]), errstr);
- llist_iterate(new_files, free_file_spec);
+ llist_iterate(new_files, (void(*)(void *))free_file_spec);
llist_free(new_files);
fclose(fh);
return;
}
fclose(fh);
- llist_iterate(work_files, free_file_spec);
+ llist_iterate(work_files, (void(*)(void *))free_file_spec);
llist_free(work_files);
work_files = new_files;
}
@@ -370,7 +370,7 @@ list_files(char **args)
free_plan(plan);
plan = NULL;
}
- llist_iterate(work_files, free_file_spec);
+ llist_iterate(work_files, (void(*)(void *))free_file_spec);
llist_clear(work_files);
if (!process_ls_output(firstdir, work_files, ls_fd)) {
diff --git a/src/qcmd.c b/src/qcmd.c
index 285fe8e..6bb3013 100644
--- a/src/qcmd.c
+++ b/src/qcmd.c
@@ -263,7 +263,7 @@ main(int argc, char **argv)
free_plan(plan);
/*dump_spec_list(work_files);*/
- llist_iterate(work_files, free_file_spec);
+ llist_iterate(work_files, (void(*)(void *))free_file_spec);
llist_free(work_files);
free(all_options);
free(editor_program);
+76 -75
View File
@@ -1,6 +1,6 @@
diff -ur gtk+-3.24.1/gtk/gtkentry.c gtk+-3.24.1_patched/gtk/gtkentry.c
--- gtk+-3.24.1/gtk/gtkentry.c 2018-06-03 15:43:28.000000000 +0200
+++ gtk+-3.24.1_patched/gtk/gtkentry.c 2019-03-24 12:26:55.484614867 +0100
diff '--color=auto' -ur gtk-3.24.48-orig/gtk/gtkentry.c gtk-3.24.48/gtk/gtkentry.c
--- gtk-3.24.48-orig/gtk/gtkentry.c 2025-01-25 14:25:12.000000000 +0100
+++ gtk-3.24.48/gtk/gtkentry.c 2025-03-24 10:55:25.453442872 +0100
@@ -323,6 +323,7 @@
CUT_CLIPBOARD,
COPY_CLIPBOARD,
@@ -9,14 +9,14 @@ diff -ur gtk+-3.24.1/gtk/gtkentry.c gtk+-3.24.1_patched/gtk/gtkentry.c
TOGGLE_OVERWRITE,
ICON_PRESS,
ICON_RELEASE,
@@ -552,6 +553,7 @@
@@ -553,6 +554,7 @@
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);
static void gtk_entry_toggle_overwrite (GtkEntry *entry);
static void gtk_entry_toggle_direction (GtkEntry *entry);
static void gtk_entry_insert_emoji (GtkEntry *entry);
static void gtk_entry_select_all (GtkEntry *entry);
@@ -816,6 +818,7 @@
class->cut_clipboard = gtk_entry_cut_clipboard;
class->copy_clipboard = gtk_entry_copy_clipboard;
@@ -25,23 +25,23 @@ diff -ur gtk+-3.24.1/gtk/gtkentry.c gtk+-3.24.1_patched/gtk/gtkentry.c
class->toggle_overwrite = gtk_entry_toggle_overwrite;
class->insert_emoji = gtk_entry_insert_emoji;
class->activate = gtk_entry_real_activate;
@@ -1828,6 +1831,15 @@
@@ -1829,6 +1832,15 @@
NULL,
G_TYPE_NONE, 0);
+ 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);
+ 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
@@ -2086,14 +2098,14 @@
@@ -2096,14 +2108,14 @@
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_CONTROL_MASK,
"copy-clipboard", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_SHIFT_MASK,
@@ -58,37 +58,37 @@ diff -ur gtk+-3.24.1/gtk/gtkentry.c gtk+-3.24.1_patched/gtk/gtkentry.c
/* Overwrite */
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, 0,
@@ -5986,6 +5998,27 @@
}
}
@@ -6000,6 +6012,27 @@
else
gtk_widget_error_bell (GTK_WIDGET (entry));
+static void
+gtk_entry_paste_selection (GtkEntry *entry)
+{
+ GtkEntryPrivate *priv = entry->priv;
+
+ if (priv->editable)
+ gtk_entry_paste (entry, GDK_SELECTION_PRIMARY);
+ else
+ gtk_widget_error_bell (GTK_WIDGET (entry));
+
+ if (priv->text_handle)
+ if (priv->text_handle)
+ {
+ GtkTextHandleMode handle_mode;
+ GtkTextHandleMode handle_mode;
+
+ handle_mode = _gtk_text_handle_get_mode (priv->text_handle);
+ handle_mode = _gtk_text_handle_get_mode (priv->text_handle);
+
+ if (handle_mode != GTK_TEXT_HANDLE_MODE_NONE)
+ gtk_entry_update_handles (entry, GTK_TEXT_HANDLE_MODE_CURSOR);
+ if (handle_mode != GTK_TEXT_HANDLE_MODE_NONE)
+ gtk_entry_update_handles (entry, GTK_TEXT_HANDLE_MODE_CURSOR);
+ }
+}
+
static void
gtk_entry_delete_cb (GtkEntry *entry)
{
diff -ur gtk+-3.24.1/gtk/gtkentry.h gtk+-3.24.1_patched/gtk/gtkentry.h
--- gtk+-3.24.1/gtk/gtkentry.h 2017-11-27 00:24:51.000000000 +0100
+++ gtk+-3.24.1_patched/gtk/gtkentry.h 2019-03-24 11:55:03.848566726 +0100
+static void
+gtk_entry_paste_selection (GtkEntry *entry)
+{
+ GtkEntryPrivate *priv = entry->priv;
+
+ if (priv->editable)
+ gtk_entry_paste (entry, GDK_SELECTION_PRIMARY);
+ else
+ gtk_widget_error_bell (GTK_WIDGET (entry));
+
if (priv->text_handle)
{
GtkTextHandleMode handle_mode;
diff '--color=auto' -ur gtk-3.24.48-orig/gtk/gtkentry.h gtk-3.24.48/gtk/gtkentry.h
--- gtk-3.24.48-orig/gtk/gtkentry.h 2025-01-25 14:25:12.000000000 +0100
+++ gtk-3.24.48/gtk/gtkentry.h 2025-03-24 10:29:15.753717742 +0100
@@ -145,6 +145,7 @@
void (* cut_clipboard) (GtkEntry *entry);
void (* copy_clipboard) (GtkEntry *entry);
@@ -97,18 +97,18 @@ diff -ur gtk+-3.24.1/gtk/gtkentry.h gtk+-3.24.1_patched/gtk/gtkentry.h
void (* toggle_overwrite) (GtkEntry *entry);
/* hooks to add other objects beside the entry (like in GtkSpinButton) */
@@ -168,7 +169,6 @@
@@ -169,7 +170,6 @@
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
void (*_gtk_reserved5) (void);
- void (*_gtk_reserved6) (void);
- void (*_gtk_reserved5) (void);
};
GDK_AVAILABLE_IN_ALL
diff -ur gtk+-3.24.1/gtk/gtktextview.c gtk+-3.24.1_patched/gtk/gtktextview.c
--- gtk+-3.24.1/gtk/gtktextview.c 2018-07-25 14:29:25.000000000 +0200
+++ gtk+-3.24.1_patched/gtk/gtktextview.c 2019-03-24 11:46:29.476553772 +0100
@@ -327,6 +327,7 @@
diff '--color=auto' -ur gtk-3.24.48-orig/gtk/gtktextview.c gtk-3.24.48/gtk/gtktextview.c
--- gtk-3.24.48-orig/gtk/gtktextview.c 2025-01-25 14:25:12.000000000 +0100
+++ gtk-3.24.48/gtk/gtktextview.c 2025-03-24 10:38:47.534703867 +0100
@@ -329,6 +329,7 @@
CUT_CLIPBOARD,
COPY_CLIPBOARD,
PASTE_CLIPBOARD,
@@ -116,7 +116,7 @@ diff -ur gtk+-3.24.1/gtk/gtktextview.c gtk+-3.24.1_patched/gtk/gtktextview.c
TOGGLE_OVERWRITE,
MOVE_VIEWPORT,
SELECT_ALL,
@@ -497,6 +498,7 @@
@@ -499,6 +500,7 @@
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);
@@ -124,7 +124,7 @@ diff -ur gtk+-3.24.1/gtk/gtktextview.c gtk+-3.24.1_patched/gtk/gtktextview.c
static void gtk_text_view_toggle_overwrite (GtkTextView *text_view);
static void gtk_text_view_toggle_cursor_visible (GtkTextView *text_view);
@@ -785,6 +787,7 @@
@@ -787,6 +789,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;
@@ -132,23 +132,23 @@ diff -ur gtk+-3.24.1/gtk/gtktextview.c gtk+-3.24.1_patched/gtk/gtktextview.c
klass->toggle_overwrite = gtk_text_view_toggle_overwrite;
klass->create_buffer = gtk_text_view_create_buffer;
klass->extend_selection = gtk_text_view_extend_selection;
@@ -1305,6 +1308,15 @@
@@ -1316,6 +1319,15 @@
NULL,
G_TYPE_NONE, 0);
+ 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);
+ 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
@@ -1652,14 +1664,14 @@
@@ -1666,14 +1678,14 @@
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Insert, GDK_CONTROL_MASK,
"copy-clipboard", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Insert, GDK_SHIFT_MASK,
@@ -165,29 +165,30 @@ diff -ur gtk+-3.24.1/gtk/gtktextview.c gtk+-3.24.1_patched/gtk/gtktextview.c
/* Overwrite */
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, 0,
@@ -7221,6 +7233,19 @@
}
@@ -7247,6 +7259,20 @@
text_view->priv->scroll_after_paste = TRUE;
static void
+gtk_text_view_paste_selection (GtkTextView *text_view)
+{
+ GtkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view),
+ GDK_SELECTION_PRIMARY);
+
+ text_view->priv->scroll_after_paste = TRUE;
+ gtk_text_buffer_paste_clipboard (get_buffer (text_view),
+ clipboard,
+ NULL,
+ text_view->priv->editable);
gtk_text_buffer_paste_clipboard (get_buffer (text_view),
+ clipboard,
+ NULL,
+ text_view->priv->editable);
+}
+
+static void
gtk_text_view_paste_done_handler (GtkTextBuffer *buffer,
GtkClipboard *clipboard,
gpointer data)
diff -ur gtk+-3.24.1/gtk/gtktextview.h gtk+-3.24.1_patched/gtk/gtktextview.h
--- gtk+-3.24.1/gtk/gtktextview.h 2017-11-26 22:31:46.000000000 +0100
+++ gtk+-3.24.1_patched/gtk/gtktextview.h 2019-03-24 11:57:41.592570698 +0100
+gtk_text_view_paste_selection (GtkTextView *text_view)
+{
+ GtkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view),
+ GDK_SELECTION_PRIMARY);
+
+ text_view->priv->scroll_after_paste = TRUE;
+
+ gtk_text_buffer_paste_clipboard (get_buffer (text_view),
clipboard,
NULL,
text_view->priv->editable);
diff '--color=auto' -ur gtk-3.24.48-orig/gtk/gtktextview.h gtk-3.24.48/gtk/gtktextview.h
--- gtk-3.24.48-orig/gtk/gtktextview.h 2025-01-25 14:25:12.000000000 +0100
+++ gtk-3.24.48/gtk/gtktextview.h 2025-03-24 10:32:51.750647605 +0100
@@ -181,6 +181,7 @@
void (* cut_clipboard) (GtkTextView *text_view);
void (* copy_clipboard) (GtkTextView *text_view);
-693
View File
@@ -1,693 +0,0 @@
diff -ur libXft-2.3.4/src/xftfreetype.c libXft-2.3.4-patched/src/xftfreetype.c
--- libXft-2.3.4/src/xftfreetype.c 2021-08-02 02:50:43.000000000 +0200
+++ libXft-2.3.4-patched/src/xftfreetype.c 2021-11-12 10:49:08.217733518 +0100
@@ -523,7 +523,7 @@
/*
* Compute glyph load flags
*/
- fi->load_flags = FT_LOAD_DEFAULT;
+ fi->load_flags = FT_LOAD_DEFAULT | FT_LOAD_COLOR;
#ifndef XFT_EMBEDDED_BITMAP
#define XFT_EMBEDDED_BITMAP "embeddedbitmap"
@@ -775,6 +775,7 @@
FcChar32 hash_value;
FcChar32 rehash_value;
FcBool antialias;
+ FcBool color;
int max_glyph_memory;
int alloc_size;
int ascent, descent, height;
@@ -831,12 +832,16 @@
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
antialias = FcFalse;
+ color = FT_HAS_COLOR(face) ? FcTrue : FcFalse;
+
/*
* Find the appropriate picture format
*/
if (fi->render)
{
- if (antialias)
+ if (color)
+ format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
+ else if (antialias)
{
switch (fi->rgba) {
case FC_RGBA_RGB:
@@ -968,6 +973,13 @@
* which doesn't happen in XftFontInfoFill
*/
font->info.antialias = antialias;
+
+ /*
+ * Set color value, which is only known once the
+ * font was loaded
+ */
+ font->info.color = color;
+
/*
* bump XftFile reference count
*/
diff -ur libXft-2.3.4/src/xftglyphs.c libXft-2.3.4-patched/src/xftglyphs.c
--- libXft-2.3.4/src/xftglyphs.c 2021-08-02 02:50:43.000000000 +0200
+++ libXft-2.3.4-patched/src/xftglyphs.c 2021-11-12 10:55:11.537742386 +0100
@@ -26,6 +26,8 @@
#include FT_SYNTHESIS_H
+#include FT_GLYPH_H
+
/*
* Validate the memory info for a font
*/
@@ -78,9 +80,11 @@
static int
_compute_xrender_bitmap_size( FT_Bitmap* target,
FT_GlyphSlot slot,
- FT_Render_Mode mode )
+ FT_Render_Mode mode,
+ FT_Matrix* matrix )
{
FT_Bitmap* ftbit;
+ FT_Vector vector;
int width, height, pitch;
if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
@@ -91,6 +95,16 @@
width = (int)ftbit->width;
height = (int)ftbit->rows;
+
+ if ( matrix && mode == FT_RENDER_MODE_NORMAL )
+ {
+ vector.x = ftbit->width;
+ vector.y = ftbit->rows;
+ FT_Vector_Transform(&vector, matrix);
+
+ width = (int)vector.x;
+ height = (int)vector.y;
+ }
pitch = (width+3) & ~3;
switch ( ftbit->pixel_mode )
@@ -112,6 +126,10 @@
}
break;
+ case FT_PIXEL_MODE_BGRA:
+ pitch = width * 4;
+ break;
+
case FT_PIXEL_MODE_LCD:
if ( mode != FT_RENDER_MODE_LCD )
return -1;
@@ -143,6 +161,105 @@
}
/* this functions converts the glyph bitmap found in a FT_GlyphSlot
+ * into a different format while scaling by applying the given matrix
+ * (see _compute_xrender_bitmap_size)
+ *
+ * you should call this function after _compute_xrender_bitmap_size
+ *
+ * target :: target bitmap descriptor. Note that its 'buffer' pointer
+ * must point to memory allocated by the caller
+ *
+ * source :: the source bitmap descriptor
+ *
+ * matrix :: the scaling matrix to apply
+ */
+static void
+_scaled_fill_xrender_bitmap( FT_Bitmap* target,
+ FT_Bitmap* source,
+ const FT_Matrix* matrix )
+{
+ unsigned char* src_buf = source->buffer;
+ unsigned char* dst_line = target->buffer;
+ int src_pitch = source->pitch;
+ int width = target->width;
+ int height = target->rows;
+ int pitch = target->pitch;
+ int h;
+ FT_Vector vector;
+ FT_Matrix inverse = *matrix;
+ int sampling_width;
+ int sampling_height;
+ int sample_count;
+
+ if ( src_pitch < 0 )
+ src_buf -= src_pitch*(source->rows-1);
+
+ FT_Matrix_Invert(&inverse);
+
+ /* compute how many source pixels a target pixel spans */
+ vector.x = 1;
+ vector.y = 1;
+ FT_Vector_Transform(&vector, &inverse);
+ sampling_width = vector.x / 2;
+ sampling_height = vector.y / 2;
+ sample_count = (2 * sampling_width + 1) * (2 * sampling_height + 1);
+
+ for ( h = height; h > 0; h--, dst_line += pitch )
+ {
+ int x;
+
+ for ( x = 0; x < width; x++ )
+ {
+ unsigned char* src;
+
+#define CLAMP(x, min, max) ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x)))
+
+ /* compute target pixel location in source space */
+ vector.x = (x * 0x10000) + 0x10000 / 2;
+ vector.y = ((height - h) * 0x10000) + 0x10000 / 2;
+ FT_Vector_Transform(&vector, &inverse);
+ vector.x = CLAMP(FT_RoundFix(vector.x) / 0x10000, 0, source->width - 1);
+ vector.y = CLAMP(FT_RoundFix(vector.y) / 0x10000, 0, source->rows - 1);
+
+ switch ( source->pixel_mode )
+ {
+ case FT_PIXEL_MODE_MONO: /* convert mono to 8-bit gray, scale using nearest pixel */
+ src = src_buf + (vector.y * src_pitch);
+ if ( src[(vector.x >> 3)] & (0x80 >> (vector.x & 7)) )
+ dst_line[x] = 0xff;
+ break;
+
+ case FT_PIXEL_MODE_GRAY: /* scale using nearest pixel */
+ src = src_buf + (vector.y * src_pitch);
+ dst_line[x] = src[vector.x];
+ break;
+
+ case FT_PIXEL_MODE_BGRA: /* scale by averaging all relevant source pixels, keep BGRA format */
+ {
+ int sample_x, sample_y;
+ int bgra[4] = {};
+ for (sample_y = - sampling_height; sample_y < sampling_height + 1; ++sample_y)
+ {
+ int src_y = CLAMP(vector.y + sample_y, 0, source->rows - 1);
+ src = src_buf + (src_y * src_pitch);
+ for (sample_x = - sampling_width; sample_x < sampling_width + 1; ++sample_x)
+ {
+ int src_x = CLAMP(vector.x + sample_x, 0, source->width - 1);
+ for (int i = 0; i < 4; ++i)
+ bgra[i] += src[src_x * 4 + i];
+ }
+ }
+
+ for (int i = 0; i < 4; ++i)
+ dst_line[4 * x + i] = bgra[i] / sample_count;
+ break;
+ }
+ }
+ }
+ }
+}
+
+/* this functions converts the glyph bitmap found in a FT_GlyphSlot
* into a different format (see _compute_xrender_bitmap_size)
*
* you should call this function after _compute_xrender_bitmap_size
@@ -244,6 +361,11 @@
}
break;
+ case FT_PIXEL_MODE_BGRA: /* Preserve BGRA format */
+ for ( h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch )
+ memcpy( dstLine, srcLine, width * 4 );
+ break;
+
case FT_PIXEL_MODE_LCD:
if ( !bgr )
{
@@ -365,6 +487,8 @@
FT_Vector vector;
FT_Face face;
FT_Render_Mode mode = FT_RENDER_MODE_MONO;
+ FcBool transform;
+ FcBool glyph_transform;
if (!info)
return;
@@ -374,6 +498,8 @@
if (!face)
return;
+ if (font->info.color)
+ mode = FT_RENDER_MODE_NORMAL;
if (font->info.antialias)
{
switch (font->info.rgba) {
@@ -390,6 +516,8 @@
}
}
+ transform = font->info.transform && mode != FT_RENDER_MODE_MONO;
+
while (nglyph--)
{
glyphindex = *glyphs++;
@@ -440,7 +568,7 @@
/*
* Compute glyph metrics from FreeType information
*/
- if(font->info.transform && glyphslot->format != FT_GLYPH_FORMAT_BITMAP)
+ if (transform)
{
/*
* calculate the true width by transforming all four corners.
@@ -487,7 +615,7 @@
* Clip charcell glyphs to the bounding box
* XXX transformed?
*/
- if (font->info.spacing >= FC_CHARCELL && !font->info.transform)
+ if (font->info.spacing >= FC_CHARCELL && !transform)
{
if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT)
{
@@ -519,18 +647,20 @@
}
}
+ glyph_transform = transform;
if ( glyphslot->format != FT_GLYPH_FORMAT_BITMAP )
{
error = FT_Render_Glyph( face->glyph, mode );
if (error)
continue;
+ glyph_transform = False;
}
FT_Library_SetLcdFilter( _XftFTlibrary, FT_LCD_FILTER_NONE );
if (font->info.spacing >= FC_MONO)
{
- if (font->info.transform)
+ if (transform)
{
if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT)
{
@@ -613,14 +743,27 @@
}
}
- size = _compute_xrender_bitmap_size( &local, glyphslot, mode );
+ size = _compute_xrender_bitmap_size( &local, glyphslot, mode, glyph_transform ? &font->info.matrix : NULL );
if ( size < 0 )
continue;
xftg->metrics.width = (unsigned short)local.width;
xftg->metrics.height = (unsigned short)local.rows;
- xftg->metrics.x = (short)(- glyphslot->bitmap_left);
- xftg->metrics.y = (short)( glyphslot->bitmap_top);
+ if (transform)
+ {
+ vector.x = - glyphslot->bitmap_left;
+ vector.y = glyphslot->bitmap_top;
+
+ FT_Vector_Transform(&vector, &font->info.matrix);
+
+ xftg->metrics.x = (short)vector.x;
+ xftg->metrics.y = (short)vector.y;
+ }
+ else
+ {
+ xftg->metrics.x = (short)(- glyphslot->bitmap_left);
+ xftg->metrics.y = (short)( glyphslot->bitmap_top);
+ }
/*
* If the glyph is relatively large (> 1% of server memory),
@@ -645,9 +788,12 @@
local.buffer = bufBitmap;
- _fill_xrender_bitmap( &local, glyphslot, mode,
- (font->info.rgba == FC_RGBA_BGR ||
- font->info.rgba == FC_RGBA_VBGR ) );
+ if (mode == FT_RENDER_MODE_NORMAL && glyph_transform)
+ _scaled_fill_xrender_bitmap(&local, &glyphslot->bitmap, &font->info.matrix);
+ else
+ _fill_xrender_bitmap( &local, glyphslot, mode,
+ (font->info.rgba == FC_RGBA_BGR ||
+ font->info.rgba == FC_RGBA_VBGR ) );
/*
* Copy or convert into local buffer.
@@ -662,6 +808,7 @@
*/
glyph = (Glyph) glyphindex;
+ xftg->picture = 0;
xftg->glyph_memory = (size_t)size + sizeof (XftGlyph);
if (font->format)
{
@@ -685,15 +832,35 @@
}
}
}
- else if ( mode != FT_RENDER_MODE_NORMAL )
+ else if (glyphslot->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA || mode != FT_RENDER_MODE_NORMAL)
{
/* invert ARGB <=> BGRA */
if (ImageByteOrder (dpy) != XftNativeByteOrder ())
XftSwapCARD32 ((CARD32 *) bufBitmap, size >> 2);
}
- XRenderAddGlyphs (dpy, font->glyphset, &glyph,
- &xftg->metrics, 1,
- (char *) bufBitmap, size);
+
+ if (glyphslot->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA)
+ {
+ Pixmap pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), local.width, local.rows, 32);
+ GC gc = XCreateGC(dpy, pixmap, 0, NULL);
+ XImage image = {
+ local.width, local.rows, 0, ZPixmap, (char *)bufBitmap,
+ dpy->byte_order, dpy->bitmap_unit, dpy->bitmap_bit_order, 32,
+ 32, local.width * 4 - local.pitch, 32,
+ 0, 0, 0
+ };
+
+ XInitImage(&image);
+ XPutImage(dpy, pixmap, gc, &image, 0, 0, 0, 0, local.width, local.rows);
+ xftg->picture = XRenderCreatePicture(dpy, pixmap, font->format, 0, NULL);
+
+ XFreeGC(dpy, gc);
+ XFreePixmap(dpy, pixmap);
+ }
+ else
+ XRenderAddGlyphs (dpy, font->glyphset, &glyph,
+ &xftg->metrics, 1,
+ (char *) bufBitmap, size);
}
else
{
@@ -744,7 +911,9 @@
{
if (font->format)
{
- if (font->glyphset)
+ if (xftg->picture)
+ XRenderFreePicture(dpy, xftg->picture);
+ else if (font->glyphset)
{
glyphBuf[nused++] = (Glyph) glyphindex;
if (nused == sizeof (glyphBuf) / sizeof (glyphBuf[0]))
diff -ur libXft-2.3.4/src/xftint.h libXft-2.3.4-patched/src/xftint.h
--- libXft-2.3.4/src/xftint.h 2021-08-02 02:50:43.000000000 +0200
+++ libXft-2.3.4-patched/src/xftint.h 2021-11-12 10:56:56.413744946 +0100
@@ -85,6 +85,7 @@
XGlyphInfo metrics;
void *bitmap;
unsigned long glyph_memory;
+ Picture picture;
} XftGlyph;
/*
@@ -134,6 +135,7 @@
FT_F26Dot6 xsize, ysize; /* pixel size */
FcBool antialias; /* doing antialiasing */
FcBool embolden; /* force emboldening */
+ FcBool color; /* contains color glyphs */
int rgba; /* subpixel order */
int lcd_filter; /* lcd filter */
FT_Matrix matrix; /* glyph transformation matrix */
diff -ur libXft-2.3.4/src/xftrender.c libXft-2.3.4-patched/src/xftrender.c
--- libXft-2.3.4/src/xftrender.c 2021-08-02 02:50:43.000000000 +0200
+++ libXft-2.3.4-patched/src/xftrender.c 2021-11-12 11:02:34.025753186 +0100
@@ -26,6 +26,35 @@
#define NUM_ELT_LOCAL 128
/*
+ * Dispatch glyph drawing to the correct XRenderCompositeString function
+ */
+static void
+_XftCompositeString (Display *dpy, int op, Picture src, Picture dst, XRenderPictFormat* format, GlyphSet glyphset, int srcx, int srcy, int dstx, int dsty, int charwidth, unsigned int* chars, int nchars)
+{
+ if (nchars == 0)
+ return;
+
+ switch (charwidth) {
+ case 1:
+ default:
+ XRenderCompositeString8 (dpy, op,
+ src, dst, format, glyphset,
+ srcx, srcy, dstx, dsty, (char*)chars, nchars);
+ break;
+ case 2:
+ XRenderCompositeString16(dpy, op,
+ src, dst, format, glyphset,
+ srcx, srcy, dstx, dsty, (unsigned short*)chars, nchars);
+ break;
+ case 4:
+ XRenderCompositeString32(dpy, op,
+ src, dst, format, glyphset,
+ srcx, srcy, dstx, dsty, (unsigned int*)chars, nchars);
+ break;
+ }
+}
+
+/*
* Use the Render extension to draw the glyphs
*/
@@ -43,12 +72,14 @@
int nglyphs)
{
XftFontInt *font = (XftFontInt *) pub;
- int i;
+ int i, j;
FT_UInt missing[XFT_NMISSING];
int nmissing;
FT_UInt g, max;
int size, width;
+ int dstx, dsty;
Glyph wire;
+ XftGlyph* glyph;
char *char8;
unsigned short *char16;
unsigned int *char32;
@@ -100,43 +131,75 @@
if (!chars)
goto bail1;
}
+ dstx = x;
+ dsty = y;
char8 = (char *) chars;
char16 = (unsigned short *) chars;
char32 = (unsigned int *) chars;
- for (i = 0; i < nglyphs; i++)
+ for (i = 0, j = 0; i < nglyphs; i++)
{
wire = (Glyph) glyphs[i];
if (wire >= font->num_glyphs || !font->glyphs[wire])
wire = 0;
- switch (width) {
- case 1: char8[i] = (char) wire; break;
- case 2: char16[i] = (unsigned short) wire; break;
- case 4: char32[i] = (unsigned int) wire; break;
+ glyph = font->glyphs[wire];
+ if (glyph->picture)
+ {
+ _XftCompositeString(dpy, op, src, dst, font->format, font->glyphset, srcx, srcy, x, y, width, chars, j);
+ XRenderComposite(dpy, PictOpOver, glyph->picture, None, dst, 0, 0, 0, 0, dstx, dsty - glyph->metrics.y, glyph->metrics.width, glyph->metrics.height);
+ x = dstx = dstx + glyph->metrics.xOff;
+ x = dsty = dsty + glyph->metrics.yOff;
+ j = 0;
+ }
+ else
+ {
+ switch (width) {
+ case 1: char8[j] = (char) wire; break;
+ case 2: char16[j] = (unsigned short) wire; break;
+ case 4: char32[j] = (unsigned int) wire; break;
+ }
+ dstx += glyph->metrics.xOff;
+ dsty += glyph->metrics.yOff;
+ ++j;
}
}
- switch (width) {
+ _XftCompositeString(dpy, op, src, dst, font->format, font->glyphset, srcx, srcy, x, y, width, chars, j);
+ if (chars != char_local)
+ free (chars);
+bail1:
+ if (glyphs_loaded)
+ _XftFontManageMemory (dpy, pub);
+}
+
+/*
+ * Dispatch glyph drawing to the correct XRenderCompositeText function
+ */
+static void
+_XftCompositeText (Display *dpy, int op, Picture src, Picture dst, XRenderPictFormat* format, int srcx, int srcy, int dstx, int dsty, int eltwidth, XGlyphElt8* elts, int nelt)
+{
+ if (nelt == 0)
+ return;
+
+ switch (eltwidth) {
case 1:
default:
- XRenderCompositeString8 (dpy, op,
- src, dst, font->format, font->glyphset,
- srcx, srcy, x, y, char8, nglyphs);
+ XRenderCompositeText8 (dpy, op,
+ src, dst, format,
+ srcx, srcy, dstx, dsty,
+ (XGlyphElt8*)elts, nelt);
break;
case 2:
- XRenderCompositeString16(dpy, op,
- src, dst, font->format, font->glyphset,
- srcx, srcy, x, y, char16, nglyphs);
+ XRenderCompositeText16(dpy, op,
+ src, dst, format,
+ srcx, srcy, dstx, dsty,
+ (XGlyphElt16*)elts, nelt);
break;
case 4:
- XRenderCompositeString32(dpy, op,
- src, dst, font->format, font->glyphset,
- srcx, srcy, x, y, char32, nglyphs);
+ XRenderCompositeText32(dpy, op,
+ src, dst, format,
+ srcx, srcy, dstx, dsty,
+ (XGlyphElt32*)elts, nelt);
break;
}
- if (chars != char_local)
- free (chars);
-bail1:
- if (glyphs_loaded)
- _XftFontManageMemory (dpy, pub);
}
_X_EXPORT void
@@ -251,9 +314,10 @@
g = 0;
/*
* check to see if the glyph is placed where it would
- * fall using the normal spacing
+ * fall using the normal spacing and if it would render
+ * as a XRender glyph
*/
- if ((glyph = font->glyphs[g]))
+ if ((glyph = font->glyphs[g]) && !glyph->picture)
{
if (x != glyphs[i].x || y != glyphs[i].y)
{
@@ -267,7 +331,7 @@
}
elts = elts_local;
- if (nelt > NUM_ELT_LOCAL)
+ if (!font->info.color && nelt > NUM_ELT_LOCAL)
{
elts = malloc ((size_t)nelt * sizeof (XGlyphElt8));
if (!elts)
@@ -275,7 +339,7 @@
}
/*
- * Generate the list of glyph elts
+ * Generate the list of glyph elts or render color glyphs
*/
nelt = 0;
x = y = 0;
@@ -289,6 +353,11 @@
g = 0;
if ((glyph = font->glyphs[g]))
{
+ if (glyph->picture)
+ {
+ XRenderComposite(dpy, PictOpOver, glyph->picture, None, dst, 0, 0, 0, 0, glyphs[i].x, glyphs[i].y - glyph->metrics.y, glyph->metrics.width, glyph->metrics.height);
+ continue;
+ }
if (!i || x != glyphs[i].x || y != glyphs[i].y)
{
if (n)
@@ -320,23 +389,9 @@
elts[nelt].nchars = n;
nelt++;
}
- switch (width) {
- case 1:
- XRenderCompositeText8 (dpy, op, src, dst, font->format,
- srcx, srcy, glyphs[0].x, glyphs[0].y,
- elts, nelt);
- break;
- case 2:
- XRenderCompositeText16 (dpy, op, src, dst, font->format,
- srcx, srcy, glyphs[0].x, glyphs[0].y,
- (XGlyphElt16 *) elts, nelt);
- break;
- case 4:
- XRenderCompositeText32 (dpy, op, src, dst, font->format,
- srcx, srcy, glyphs[0].x, glyphs[0].y,
- (XGlyphElt32 *) elts, nelt);
- break;
- }
+ _XftCompositeText(dpy, op, src, dst, font->format,
+ srcx, srcy, glyphs[0].x, glyphs[0].y,
+ width, elts, nelt);
if (elts != elts_local)
free (elts);
@@ -535,7 +590,7 @@
* check to see if the glyph is placed where it would
* fall using the normal spacing
*/
- if ((glyph = font->glyphs[g]))
+ if ((glyph = font->glyphs[g]) && !glyph->picture)
{
if (pub != prevPublic || x != glyphs[i].x || y != glyphs[i].y)
{
@@ -560,7 +615,7 @@
}
/*
- * Generate the list of glyph elts
+ * Generate the list of glyph elts and render color glyphs
*/
nelt = 0;
x = y = 0;
@@ -578,6 +633,11 @@
g = 0;
if ((glyph = font->glyphs[g]))
{
+ if (glyph->picture)
+ {
+ XRenderComposite(dpy, PictOpOver, glyph->picture, None, dst, 0, 0, 0, 0, glyphs[i].x, glyphs[i].y - glyph->metrics.y, glyph->metrics.width, glyph->metrics.height);
+ continue;
+ }
if (!i || pub != prevPublic || x != glyphs[i].x || y != glyphs[i].y)
{
if (n)
@@ -610,23 +670,9 @@
elts[nelt].nchars = n;
nelt++;
}
- switch (width) {
- case 1:
- XRenderCompositeText8 (dpy, op, src, dst, format,
- srcx, srcy, glyphs[0].x, glyphs[0].y,
- elts, nelt);
- break;
- case 2:
- XRenderCompositeText16 (dpy, op, src, dst, format,
- srcx, srcy, glyphs[0].x, glyphs[0].y,
- (XGlyphElt16 *) elts, nelt);
- break;
- case 4:
- XRenderCompositeText32 (dpy, op, src, dst, format,
- srcx, srcy, glyphs[0].x, glyphs[0].y,
- (XGlyphElt32 *) elts, nelt);
- break;
- }
+ _XftCompositeText(dpy, op, src, dst, format,
+ srcx, srcy, glyphs[0].x, glyphs[0].y,
+ width, elts, nelt);
if (elts != elts_local)
free (elts);
@@ -0,0 +1,17 @@
diff --git a/lua-api-crates/mux/src/pane.rs b/lua-api-crates/mux/src/pane.rs
index f0d919e16..0a16b03d3 100644
--- a/lua-api-crates/mux/src/pane.rs
+++ b/lua-api-crates/mux/src/pane.rs
@@ -409,6 +409,12 @@ impl UserData for MuxPane {
let pane = this.resolve(&mux)?;
Ok(pane.tty_name())
});
+
+ methods.add_method("get_seqno", move |_lua, this, ()| {
+ let mux = Mux::get();
+ let pane = this.resolve(&mux)?;
+ Ok(pane.get_current_seqno())
+ });
}
}