2010-06-05 10:30:08 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Gilles Roux
|
|
|
|
* 2003 Garrett Derner
|
|
|
|
* 2010 Yoshihisa Uchida
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef PLUGIN_TEXT_VIEWER_PREFERENCES_H
|
|
|
|
#define PLUGIN_TEXT_VIEWER_PREFERENCES_H
|
|
|
|
|
2010-06-29 11:05:36 +00:00
|
|
|
enum {
|
|
|
|
TV_CALLBACK_OK,
|
|
|
|
TV_CALLBACK_STOP,
|
|
|
|
TV_CALLBACK_ERROR,
|
|
|
|
};
|
|
|
|
|
2010-06-20 21:53:47 +00:00
|
|
|
/* word_mode */
|
|
|
|
enum {
|
2010-06-24 12:58:46 +00:00
|
|
|
WM_WRAP = 0,
|
|
|
|
WM_CHOP,
|
2010-06-20 21:53:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* line_mode */
|
|
|
|
enum {
|
2010-06-24 12:58:46 +00:00
|
|
|
LM_NORMAL = 0,
|
|
|
|
LM_JOIN,
|
|
|
|
LM_EXPAND,
|
|
|
|
LM_REFLOW,
|
2010-06-20 21:53:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* alignment */
|
|
|
|
enum {
|
2010-06-24 12:58:46 +00:00
|
|
|
AL_LEFT = 0,
|
|
|
|
AL_RIGHT,
|
2010-06-20 21:53:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* horizontal_scroll_mode */
|
|
|
|
enum {
|
2010-06-24 12:58:46 +00:00
|
|
|
HS_SCREEN = 0,
|
|
|
|
HS_COLUMN,
|
2010-06-20 21:53:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* vertical_scroll_mode */
|
|
|
|
enum {
|
2010-06-24 12:58:46 +00:00
|
|
|
VS_PAGE = 0,
|
|
|
|
VS_LINE,
|
2010-06-20 21:53:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* narrow_mode */
|
|
|
|
enum {
|
|
|
|
NM_PAGE = 0,
|
|
|
|
NM_TOP_BOTTOM,
|
|
|
|
};
|
|
|
|
|
2010-06-05 10:30:08 +00:00
|
|
|
struct tv_preferences {
|
2010-06-20 21:53:47 +00:00
|
|
|
unsigned word_mode;
|
|
|
|
unsigned line_mode;
|
|
|
|
unsigned alignment;
|
|
|
|
|
|
|
|
unsigned encoding;
|
|
|
|
|
2010-06-29 12:23:41 +00:00
|
|
|
bool horizontal_scrollbar;
|
|
|
|
bool vertical_scrollbar;
|
2010-06-20 21:53:47 +00:00
|
|
|
|
2010-06-29 12:23:41 +00:00
|
|
|
bool overlap_page_mode;
|
|
|
|
bool header_mode;
|
|
|
|
bool footer_mode;
|
2010-06-20 21:53:47 +00:00
|
|
|
unsigned horizontal_scroll_mode;
|
|
|
|
unsigned vertical_scroll_mode;
|
2010-06-05 10:30:08 +00:00
|
|
|
|
|
|
|
int autoscroll_speed;
|
|
|
|
|
2010-06-06 08:44:27 +00:00
|
|
|
int windows;
|
|
|
|
|
2010-06-20 21:53:47 +00:00
|
|
|
unsigned narrow_mode;
|
2010-06-09 11:28:43 +00:00
|
|
|
|
2010-06-20 21:53:47 +00:00
|
|
|
unsigned indent_spaces;
|
2010-06-11 11:13:02 +00:00
|
|
|
|
2010-06-26 12:17:01 +00:00
|
|
|
bool statusbar;
|
|
|
|
|
2010-06-05 10:30:08 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2010-06-20 21:53:47 +00:00
|
|
|
unsigned char font_name[MAX_PATH];
|
2011-09-24 13:19:34 +00:00
|
|
|
int font_id;
|
2010-06-05 10:30:08 +00:00
|
|
|
#endif
|
|
|
|
unsigned char file_name[MAX_PATH];
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
2010-06-23 13:56:08 +00:00
|
|
|
* global pointer to the preferences (read-only)
|
2010-06-05 10:30:08 +00:00
|
|
|
*/
|
2010-06-23 13:56:08 +00:00
|
|
|
extern const struct tv_preferences * const preferences;
|
2010-12-14 21:33:45 +00:00
|
|
|
extern bool preferences_changed;
|
2010-06-05 10:30:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* change the preferences
|
|
|
|
*
|
|
|
|
* [In] new_prefs
|
|
|
|
* new preferences
|
2010-06-29 11:05:36 +00:00
|
|
|
*
|
|
|
|
* return
|
|
|
|
* true success
|
|
|
|
* false error
|
2010-06-05 10:30:08 +00:00
|
|
|
*/
|
2010-06-29 11:05:36 +00:00
|
|
|
bool tv_set_preferences(const struct tv_preferences *new_prefs);
|
2010-06-05 10:30:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* copy the preferences
|
|
|
|
*
|
|
|
|
* [Out] copy_prefs
|
|
|
|
* the preferences in copy destination
|
|
|
|
*/
|
|
|
|
void tv_copy_preferences(struct tv_preferences *copy_prefs);
|
|
|
|
|
2010-12-14 21:33:45 +00:00
|
|
|
/*
|
|
|
|
* compare the preferences structs (binary)
|
|
|
|
*
|
|
|
|
* return
|
|
|
|
* true differs
|
|
|
|
* false identical
|
|
|
|
*/
|
|
|
|
bool tv_compare_preferences(struct tv_preferences *copy_prefs);
|
|
|
|
|
2010-06-05 10:30:08 +00:00
|
|
|
/*
|
|
|
|
* set the default settings
|
|
|
|
*
|
|
|
|
* [Out] p
|
|
|
|
* the preferences which store the default settings
|
|
|
|
*/
|
|
|
|
void tv_set_default_preferences(struct tv_preferences *p);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* register the function to be executed when the current preferences is changed
|
|
|
|
*
|
|
|
|
* [In] listner
|
|
|
|
* the function to be executed when the current preferences is changed
|
|
|
|
*/
|
2010-06-29 11:05:36 +00:00
|
|
|
void tv_add_preferences_change_listner(int (*listner)(const struct tv_preferences *oldp));
|
2010-06-05 10:30:08 +00:00
|
|
|
|
2011-09-24 13:19:34 +00:00
|
|
|
|
|
|
|
void tv_change_fontid(int id);
|
2010-06-05 10:30:08 +00:00
|
|
|
#endif
|