summaryrefslogtreecommitdiffstats
path: root/patches/xmms/xmms-ds-rusxmms.patch
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2021-03-12 03:55:34 +0100
committerSuren A. Chilingaryan <csa@suren.me>2021-03-12 03:55:34 +0100
commit60bd665e74cfeeaf70882173a0dd56c883e2014a (patch)
tree8a0066bb9f0259becac5605641e8e1eed1ae0e89 /patches/xmms/xmms-ds-rusxmms.patch
downloadrusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.tar.gz
rusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.tar.bz2
rusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.tar.xz
rusxmms2-60bd665e74cfeeaf70882173a0dd56c883e2014a.zip
Added to git tree
Diffstat (limited to 'patches/xmms/xmms-ds-rusxmms.patch')
-rw-r--r--patches/xmms/xmms-ds-rusxmms.patch172
1 files changed, 172 insertions, 0 deletions
diff --git a/patches/xmms/xmms-ds-rusxmms.patch b/patches/xmms/xmms-ds-rusxmms.patch
new file mode 100644
index 0000000..6b9287f
--- /dev/null
+++ b/patches/xmms/xmms-ds-rusxmms.patch
@@ -0,0 +1,172 @@
+diff -dPNur xmms-1.2.11/libxmms/configure.in xmms-1.2.11-new/libxmms/configure.in
+--- xmms-1.2.11/libxmms/configure.in 2007-11-16 22:51:24.000000000 +0100
++++ xmms-1.2.11-new/libxmms/configure.in 2007-11-25 17:38:56.000000000 +0100
+@@ -57,6 +57,16 @@
+ AC_DEFINE([HAVE_CODESET],,[Define if nl_langinfo(CODESET) is available.])
+ fi
+
++AC_CHECK_LIB(rccgtk, rccUiInit,[
++ AC_CHECK_HEADERS(librcc.h librccui.h,[
++ LIBRCC_LIBS="-lrccgtk"
++ LIBRCC_INCLUDES=""
++ ],[
++ LIBRCC_LIBS=""
++ LIBRCC_INCLUDES=""
++])])
++AC_SUBST(LIBRCC_LIBS)
++AC_SUBST(LIBRCC_INCLUDES)
+
+ AC_OUTPUT([
+ Makefile
+diff -dPNur xmms-1.2.11/libxmms/Makefile.am xmms-1.2.11-new/libxmms/Makefile.am
+--- xmms-1.2.11/libxmms/Makefile.am 2004-04-04 10:51:20.000000000 +0200
++++ xmms-1.2.11-new/libxmms/Makefile.am 2007-11-25 17:38:56.000000000 +0100
+@@ -4,10 +4,11 @@
+ lib_LTLIBRARIES = libxmms.la
+
+ libxmms_la_LDFLAGS = -export-dynamic -version-info $(LIBXMMS_MAJOR_VERSION):$(LIBXMMS_MINOR_VERSION):$(LIBXMMS_MICRO_VERSION)
+-libxmms_la_LIBADD = @GTK_LIBS@ @POSIX_LIBS@
+-INCLUDES = @GTK_CFLAGS@ -I../intl -I..
++libxmms_la_LIBADD = @LIBRCC_LIBS@ @GTK_LIBS@ @POSIX_LIBS@
++INCLUDES = @LIBRCC_INCLUDES@ @GTK_CFLAGS@ -I../intl -I..
+
+ libxmms_la_SOURCES = \
++rcc.c rcc.h rcc_langs.h \
+ configfile.c configfile.h \
+ xmmsctrl.c xmmsctrl.h \
+ dirbrowser.c dirbrowser.h \
+diff -dPNur xmms-1.2.11/libxmms/titlestring.c xmms-1.2.11-new/libxmms/titlestring.c
+--- xmms-1.2.11/libxmms/titlestring.c 2006-07-24 00:11:51.000000000 +0200
++++ xmms-1.2.11-new/libxmms/titlestring.c 2007-11-25 17:39:21.000000000 +0100
+@@ -29,6 +29,7 @@
+ #include <string.h>
+ #include <ctype.h>
+
++#include "rcc.h"
+ #include "titlestring.h"
+ #include "../xmms/i18n.h"
+
+@@ -42,8 +43,9 @@
+ PAD_SIDE_RIGHT,
+ };
+
++#define xmms_vputstr(out, pstr, pad) xmms_charset_vputstr(out, pstr, pad, from, pflag, c)
+
+-static int xmms_vputstr(GString *output, char *pstr, struct padding *pad)
++static int xmms_orig_vputstr(GString *output, char *pstr, struct padding *pad)
+ {
+ int i;
+ /* Lenght of the string that is actually printed */
+@@ -83,6 +85,22 @@
+ return TRUE;
+ }
+
++static int xmms_charset_vputstr(GString *output, char *pstr, struct padding *pad, int from, gint pflag, char c) {
++ int res;
++ gchar *cstring = NULL;
++
++ if ((pflag&1)&&((c=='f')||(c=='F'))) {
++ cstring = xmms_rcc_recode(XMMS_RCC_FS, XMMS_RCC_CTYPE, pstr);
++ }
++ if ((pflag&2)&&((c=='a')||(c=='c')||(c=='g')||(c=='p')||(c=='t'))) {
++ cstring = xmms_rcc_recode((xmms_rcc_class)from, XMMS_RCC_CTYPE, pstr);
++ }
++
++ res = xmms_orig_vputstr(output, cstring?cstring:pstr, pad);
++ if (cstring) g_free(cstring);
++
++ return res;
++}
+
+ static int xmms_vputnum(GString *output, int ival, struct padding *pad)
+ {
+@@ -124,7 +142,7 @@
+ return TRUE;
+ }
+
+-static int parse_variable(char **fmt, GString *string, TitleInput *input)
++static int parse_variable(char **fmt, GString *string, TitleInput *input, int from, gint pflag)
+ {
+ struct padding padding;
+ char *ptr = *fmt;
+@@ -237,9 +255,33 @@
+ return exp;
+ }
+
++static int xmms_charset_analyze_fmt(gchar *fmt) {
++ int flag = 0;
++
++ if (!fmt) return 0;
++ for (;*fmt;fmt++) {
++ while ((*fmt != '%')&&(*fmt != 0)) fmt++;
++ if (!*fmt) break;
++ while ((*fmt == '-')||(*fmt == ' ')||(*fmt == '0')) fmt++;
++ while (*fmt >= '0' && *fmt <= '9') fmt++;
++ if (*fmt == '.') { fmt++; while (*fmt >= '0' && *fmt <= '9') fmt++; }
++ if ((*fmt=='a')||(*fmt=='c')||(*fmt=='g')||(*fmt=='p')||(*fmt=='t')) flag|=1;
++ if ((*fmt=='f')||(*fmt=='F')) flag|=2;
++ }
++
++ return flag;
++}
++
++gchar *xmms_charset_get_titlestring(gchar *fmt, TitleInput *input, int from);
+
+ char *xmms_get_titlestring(char *fmt, TitleInput *input)
+ {
++ return xmms_charset_get_titlestring(fmt, input, (xmms_rcc_class)-1);
++}
++
++gchar *xmms_charset_get_titlestring(gchar *fmt, TitleInput *input, int from) {
++ gint pflag;
++ gchar *cstring = NULL;
+ int f_output = 0;
+ GString *string;
+ char *strptr;
+@@ -249,12 +291,14 @@
+
+ string = g_string_new("");
+
++ pflag = (from == (xmms_rcc_class)-1)?0:xmms_charset_analyze_fmt(fmt);
++
+ while (*fmt)
+ {
+ if (*fmt == '%')
+ {
+ fmt++;
+- f_output += parse_variable(&fmt, string, input);
++ f_output += parse_variable(&fmt, string, input, from, pflag);
+ }
+ else
+ /* Normal character */
+@@ -271,6 +315,19 @@
+ /* Return the result */
+ strptr = string->str;
+ g_string_free(string, FALSE);
++
++ if (pflag<3) {
++ if (pflag&2)
++ cstring = xmms_rcc_recode(XMMS_RCC_FS, XMMS_RCC_CTYPE, strptr);
++ else
++ cstring = xmms_rcc_recode((xmms_rcc_class)from, XMMS_RCC_CTYPE, strptr);
++
++ if (cstring) {
++ g_free(strptr);
++ return cstring;
++ }
++ }
++
+ return strptr;
+ }
+
+diff -dPNur xmms-1.2.11/libxmms/titlestring.h xmms-1.2.11-new/libxmms/titlestring.h
+--- xmms-1.2.11/libxmms/titlestring.h 2005-05-15 02:01:20.000000000 +0200
++++ xmms-1.2.11-new/libxmms/titlestring.h 2007-11-25 17:38:56.000000000 +0100
+@@ -77,6 +77,7 @@
+ #endif
+
+ gchar *xmms_get_titlestring(gchar *fmt, TitleInput *input);
++gchar *xmms_charset_get_titlestring(gchar *fmt, TitleInput *input, int from);
+ GtkWidget* xmms_titlestring_descriptions(char* tags, int rows);
+
+ #ifdef __cplusplus