summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 38880bd)
raw | patch | inline | side by side (parent: 38880bd)
author | Kalle Wallin <kaw@linux.se> | |
Sat, 11 Jun 2005 09:14:52 +0000 (09:14 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Sat, 11 Jun 2005 09:14:52 +0000 (09:14 +0000) |
ChangeLog | patch | blob | history | |
configure.ac | patch | blob | history | |
src/list_window.c | patch | blob | history | |
src/support.c | patch | blob | history | |
src/support.h | patch | blob | history | |
src/wreadln.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 85e7fd53d81a02f65e001f386a65b11ce2bc9f84..964bfcbafdbb43d93c7b8181ae8e6420b20db16c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2005-06-11: Kalle Wallin <kaw@linux.se>
+ * configure.ac: support wide-char ncurses library (--with-ncursesw)
+
+2005-06-06: Kalle Wallin <kaw@linux.se>
+ * Added Norwegian translations from Ole R. Thorsen
+ * Added an artist (browser) screen
+
2005-06-03: Kalle Wallin <kaw@linux.se>
* Seek time can now be defined in the conf file (seek-time)
* Added a "hide cursor" feature #0000417 (hide-cursor)
diff --git a/configure.ac b/configure.ac
index cdcab65b77b604e990a6d2e1742be4c3e894af96..72043d467b9b0c904eed3f503ff5646b195c81ba 100644 (file)
--- a/configure.ac
+++ b/configure.ac
dnl
dnl ncurses
-AC_CHECK_LIB([ncurses],
+ncurses=ncurses
+AC_ARG_WITH([ncurses],
+ AC_HELP_STRING([--with-ncurses], [compile/link with ncurses library]),
+ [ncurses=ncurses])
+AC_ARG_WITH(ncursesw,
+ AC_HELP_STRING([--with-ncursesw], [compile/link with wide-char ncurses library]),
+ [ncurses=ncursesw])
+
+AC_CHECK_LIB([$ncurses],
[initscr],
- [LIBS="$LIBS -lncurses"],
- [AC_MSG_ERROR(ncurses library is required)])
+ [LIBS="$LIBS -l$ncurses"],
+ [AC_MSG_ERROR($ncurses library is required)])
+
+if test "x$ncurses" = "xncursesw" ; then
+ AC_DEFINE(USE_NCURSESW, 1, [use wide-char ncurses library])
+fi
dnl Check for glib-2.4
[getmouse=yes])
AC_MSG_RESULT([$getmouse])
if test "x$getmouse" = "xyes" ; then
- AC_CHECK_LIB([ncurses],
+ AC_CHECK_LIB([$ncurses],
[getmouse],
- [AC_DEFINE([HAVE_GETMOUSE], [1], [ncurses - getmouse()])],
+ [AC_DEFINE([HAVE_GETMOUSE], [1], [$ncurses - getmouse()])],
[])
fi
-dnl artist screen
-AC_MSG_CHECKING([whether to include the artist screen])
-AC_ARG_ENABLE([artist-screen],
- AC_HELP_STRING([--enable-artist-screen],
- [Enable artist screen (EXPERIMENTAL) @<:@default=no@:>@]),
- [artist_screen="$enableval"],
- [artist_screen=no])
-AC_MSG_RESULT([$artist_screen])
-if test "x$artist_screen" != "xyes" ; then
- AC_DEFINE(DISABLE_ARTIST_SCREEN, 1, [Disable artist screen])
-fi
-
-dnl artist screen
+dnl Optional screen - artist
AC_MSG_CHECKING([whether to include the artist screen])
AC_ARG_ENABLE([artist-screen],
AC_HELP_STRING([--enable-artist-screen],
AC_DEFINE(DISABLE_ARTIST_SCREEN, 1, [Disable artist screen])
fi
-dnl search screen
+dnl Optional screen - search
AC_MSG_CHECKING([whether to include the search screen])
AC_ARG_ENABLE([search-screen],
AC_HELP_STRING([--enable-search-screen],
AC_MSG_CHECKING([whether to include the clock screen])
AC_ARG_ENABLE([clock-screen],
AC_HELP_STRING([--enable-clock-screen],
- [Enable clock screen @<:@default=no@:>@]),
+ [Enable clock screen @<:@default=yes@:>@]),
[clock_screen="$enableval"],
- [clock_screen=no])
+ [clock_screen=yes])
AC_MSG_RESULT([$clock_screen])
if test "x$clock_screen" != "xyes" ; then
AC_DEFINE(DISABLE_CLOCK_SCREEN, 1, [Disable clock screen])
diff --git a/src/list_window.c b/src/list_window.c
index 7bbc6e193ac0dbc7fc67dfeaa74628e989c47020..8966622925ee12bb45a2815f0e27880a38a16786 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
if( label )
{
int selected = lw->start+i == lw->selected;
- size_t len = strlen(label);
+ size_t len = my_strlen(label);
if( highlight )
colors_use(lw->w, COLOR_LIST_BOLD);
diff --git a/src/support.c b/src/support.c
index 254c15eb139e6e7cfcdb3c0dac2b5bb4e2b58141..ade5ee4eb93e36bf281376aedcc0cf7978b197ab 100644 (file)
--- a/src/support.c
+++ b/src/support.c
static gboolean noconvert = TRUE;
+size_t
+my_strlen(char *str)
+{
+ if( g_utf8_validate(str,-1,NULL) )
+ return g_utf8_strlen(str,-1);
+ else
+ return strlen(str);
+}
+
char *
remove_trailing_slash(char *path)
{
}
-
void
charset_init(gboolean disable)
{
diff --git a/src/support.h b/src/support.h
index 0a72e39b0684f87cfce4b19489a79b65c48ce950..8b4a28c188e85d03b8bbb71ff010d608748b7251 100644 (file)
--- a/src/support.h
+++ b/src/support.h
char *utf8_to_locale(char *str);
char *locale_to_utf8(char *str);
+/* number of characters in str */
+size_t my_strlen(char *str);
+/* number of bytes in str */
+size_t my_strsize(char *str);
+
+
#endif
diff --git a/src/wreadln.c b/src/wreadln.c
index 930cb5429f85ad51462f0f295c1ceeab2b80e4d5..d817ee6283e6e4f235f6a1cb03146f022b4ff40c 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
wrln_gcmp_post_cb_t wrln_post_completion_callback = NULL;
extern void screen_bell(void);
+extern size_t my_strlen(char *str);
gchar *
wreadln(WINDOW *w,
/* move the cursor one step to the right */
void cursor_move_right(void) {
- if( cursor < strlen(line) && cursor<wrln_max_line_size-1 )
+ if( cursor < my_strlen(line) && cursor<wrln_max_line_size-1 )
{
cursor++;
if( cursor+x0 >= x1 && start<cursor-width+1)
}
/* move the cursor to the end of the line */
void cursor_move_to_eol(void) {
- cursor = strlen(line);
+ cursor = my_strlen(line);
if( cursor+x0 >= x1 )
start = cursor-width+1;
}
break;
case KEY_DC: /* handle delete key. As above */
case KEY_CTRL_D:
- if( cursor <= strlen(line) - 1 )
+ if( cursor <= my_strlen(line) - 1 )
{
for (i = cursor; line[i] != 0; i++)
line[i] = line[i + 1];