summaryrefslogtreecommitdiffstats
path: root/libmenu
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-13 02:58:57 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-13 02:58:57 +0000
commit6e9cbdc10448203e7c8b2de41447442fcc9f7bae (patch)
tree0ed465592509105fdbeab27fc12ddbb2e3590aa5 /libmenu
parenteafe5b7517bbf408ae1ffc936a3abe2313c3b334 (diff)
downloadmpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.bz2
mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.xz
whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu.c28
-rw-r--r--libmenu/menu.h4
-rw-r--r--libmenu/menu_chapsel.c4
-rw-r--r--libmenu/menu_cmdlist.c4
-rw-r--r--libmenu/menu_console.c20
-rw-r--r--libmenu/menu_dvbin.c32
-rw-r--r--libmenu/menu_filesel.c14
-rw-r--r--libmenu/menu_list.c12
-rw-r--r--libmenu/menu_list.h2
-rw-r--r--libmenu/menu_param.c10
-rw-r--r--libmenu/menu_pt.c6
-rw-r--r--libmenu/menu_txt.c6
-rw-r--r--libmenu/vf_menu.c6
13 files changed, 74 insertions, 74 deletions
diff --git a/libmenu/menu.c b/libmenu/menu.c
index 038b969e4f..c8cf349c94 100644
--- a/libmenu/menu.c
+++ b/libmenu/menu.c
@@ -59,7 +59,7 @@ menu_info_t* menu_info_list[] = {
&menu_info_console,
#ifdef CONFIG_DVBIN
&menu_info_dvbsel,
-#endif
+#endif
&menu_info_pref,
NULL
};
@@ -222,7 +222,7 @@ static int menu_parse_config(char* buffer) {
}
}
-
+
/// This will build the menu_defs list from the cfg file
#define BUF_STEP 1024
@@ -552,7 +552,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt,
// Find the first line
if(align & MENU_TEXT_VCENTER)
sy = ymin + ((h - need_h)/2);
- else if(align & MENU_TEXT_BOT)
+ else if(align & MENU_TEXT_BOT)
sy = ymax - need_h - 1;
else
sy = y;
@@ -564,7 +564,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt,
else if(align & MENU_TEXT_RIGHT)
sx = xmax - need_w;
#endif
-
+
xmid = xmin + (xmax - xmin) / 2;
xrmin = xmin;
// Clamp the bb to the mpi size
@@ -572,7 +572,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt,
if(xmin < 0) xmin = 0;
if(ymax > mpi->h) ymax = mpi->h;
if(xmax > mpi->w) xmax = mpi->w;
-
+
// Jump some the beginnig text if needed
while(sy < ymin && *txt) {
int c=utf8_get_char((const char**)&txt);
@@ -672,7 +672,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt,
sy += vo_font->height + vspace;
}
}
-
+
int menu_text_length(char* txt) {
int l = 0;
render_txt(txt);
@@ -704,7 +704,7 @@ void menu_text_size(char* txt,int max_width, int vspace, int warp, int* _w, int*
i -= vo_font->charspace;
if (i > w) w = i;
}
-
+
*_w = w;
*_h = (l-1) * (vo_font->height + vspace) + vo_font->height;
}
@@ -724,7 +724,7 @@ int menu_text_num_lines(char* txt, int max_width) {
}
return l;
}
-
+
char* menu_text_get_next_line(char* txt, int max_width) {
int i = 0;
render_txt(txt);
@@ -746,22 +746,22 @@ char* menu_text_get_next_line(char* txt, int max_width) {
void menu_draw_box(mp_image_t* mpi,unsigned char grey,unsigned char alpha, int x, int y, int w, int h) {
draw_alpha_f draw_alpha = get_draw_alpha(mpi->imgfmt);
int g;
-
+
if(!draw_alpha) {
mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat);
return;
}
-
+
if(x > mpi->w || y > mpi->h) return;
-
+
if(x < 0) w += x, x = 0;
if(x+w > mpi->w) w = mpi->w-x;
if(y < 0) h += y, y = 0;
if(y+h > mpi->h) h = mpi->h-y;
-
+
g = ((256-alpha)*grey)>>8;
if(g < 1) g = 1;
-
+
{
int stride = (w+7)&(~7); // round to 8
char pic[stride*h],pic_alpha[stride*h];
@@ -771,5 +771,5 @@ void menu_draw_box(mp_image_t* mpi,unsigned char grey,unsigned char alpha, int x
mpi->planes[0] + y * mpi->stride[0] + x * (mpi->bpp>>3),
mpi->stride[0]);
}
-
+
}
diff --git a/libmenu/menu.h b/libmenu/menu.h
index 09359dd1d6..d29091a4ae 100644
--- a/libmenu/menu.h
+++ b/libmenu/menu.h
@@ -61,7 +61,7 @@ typedef struct menu_info_s {
#define MENU_CMD_OK 2
#define MENU_CMD_CANCEL 3
#define MENU_CMD_LEFT 4
-#define MENU_CMD_RIGHT 5
+#define MENU_CMD_RIGHT 5
#define MENU_CMD_ACTION 6
#define MENU_CMD_HOME 7
#define MENU_CMD_END 8
@@ -103,7 +103,7 @@ void menu_draw_text(mp_image_t* mpi, char* txt, int x, int y);
int menu_text_length(char* txt);
int menu_text_num_lines(char* txt, int max_width);
-void menu_text_size(char* txt,int max_width,
+void menu_text_size(char* txt,int max_width,
int vspace, int warp,
int* _w, int* _h);
diff --git a/libmenu/menu_chapsel.c b/libmenu/menu_chapsel.c
index 707908a016..01fcd25550 100644
--- a/libmenu/menu_chapsel.c
+++ b/libmenu/menu_chapsel.c
@@ -71,8 +71,8 @@ static m_option_t cfg_fields[] = {
static char *fmt_replace(const char *fmt, const char *chapter_name,
const char *start) {
- static const char ctag[] = "${chapter_name}";
- static const char stag[] = "${start}";
+ static const char ctag[] = "${chapter_name}";
+ static const char stag[] = "${start}";
int l = strlen(fmt);
int cl = strlen(chapter_name);
int sl = strlen(start);
diff --git a/libmenu/menu_cmdlist.c b/libmenu/menu_cmdlist.c
index 7e8f9754ea..e146a4e9db 100644
--- a/libmenu/menu_cmdlist.c
+++ b/libmenu/menu_cmdlist.c
@@ -122,7 +122,7 @@ static int parse_args(menu_t* menu,char* args) {
mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line);
asx_parser_free(parser);
return -1;
- } else if(r == 0) {
+ } else if(r == 0) {
asx_parser_free(parser);
if(!m)
mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition);
@@ -160,7 +160,7 @@ static int open_cmdlist(menu_t* menu, char* args) {
mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ListMenuNeedsAnArgument);
return 0;
}
-
+
menu_list_init(menu);
if(!parse_args(menu,args))
return 0;
diff --git a/libmenu/menu_console.c b/libmenu/menu_console.c
index af50e93a33..db0ab2d7db 100644
--- a/libmenu/menu_console.c
+++ b/libmenu/menu_console.c
@@ -67,7 +67,7 @@ struct menu_priv_s {
history_t* history;
history_t* cur_history;
int history_size;
-
+
char* mp_prompt;
char* child_prompt;
int buf_lines; // Buffer size (in line)
@@ -161,11 +161,11 @@ static void add_string(struct menu_priv_s* priv, char* l) {
priv->add_line = 0;
return;
}
-
+
if(eol) {
eol[0] = '\0';
add_string(priv,l);
- if(eol[1]) {
+ if(eol[1]) {
add_line(priv,eol+1);
priv->add_line = 0;
} else
@@ -215,7 +215,7 @@ static void draw(menu_t* menu, mp_image_t* mpi) {
if(mpriv->bg >= 0)
menu_draw_box(mpi,mpriv->bg,mpriv->bg_alpha,0,0,mpi->w,h);
-
+
if(!mpriv->child || !mpriv->raw_child){
char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1];
sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer);
@@ -259,11 +259,11 @@ static void check_child(menu_t* menu) {
r = waitpid(mpriv->child,&child_status,WNOHANG);
if(r < 0){
if(errno==ECHILD){ ///exiting children get handled in mplayer.c
- for(i = 0 ; i < 3 ; i++)
+ for(i = 0 ; i < 3 ; i++)
close(mpriv->child_fd[i]);
mpriv->child = 0;
mpriv->prompt = mpriv->mp_prompt;
- //add_line(mpriv,"Child process exited");
+ //add_line(mpriv,"Child process exited");
}
else mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WaitPidError,strerror(errno));
}
@@ -271,7 +271,7 @@ static void check_child(menu_t* menu) {
mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_SelectError);
return;
}
-
+
w = 0;
for(i = 1 ; i < 3 ; i++) {
if(FD_ISSET(mpriv->child_fd[i],&rfd)){
@@ -338,7 +338,7 @@ static int run_shell_cmd(menu_t* menu, char* cmd) {
static void enter_cmd(menu_t* menu) {
history_t* h;
char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1];
-
+
sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer);
add_line(mpriv,input);
@@ -360,7 +360,7 @@ static void enter_cmd(menu_t* menu) {
mpriv->history = h;
} else
mpriv->history->buffer[0] = '\0';
-
+
mpriv->cur_history = mpriv->history;
//mpriv->input = mpriv->cur_history->buffer;
}
@@ -477,7 +477,7 @@ static int openMenu(menu_t* menu, char* args) {
mpriv->cur_history = mpriv->history = calloc(1,sizeof(history_t));
mpriv->cur_history->buffer = calloc(255,1);
mpriv->cur_history->size = 255;
-
+
if(args)
add_line(mpriv,args);
diff --git a/libmenu/menu_dvbin.c b/libmenu/menu_dvbin.c
index 671f27e00b..0f84386f8c 100644
--- a/libmenu/menu_dvbin.c
+++ b/libmenu/menu_dvbin.c
@@ -120,17 +120,17 @@ static int fill_channels_menu(menu_t *menu, dvb_channels_list *dvb_list_ptr)
elem->p.next = NULL;
elem->p.txt = strdup(channel->name);
elem->num = n;
-
+
menu_list_add_entry(menu, elem);
}
else
{
- mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n",
+ mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n",
sizeof(list_entry_t), strerror(errno));
break;
}
- }
-
+ }
+
return n;
}
@@ -147,23 +147,23 @@ static int fill_cards_menu(menu_t *menu, dvb_config_t *conf)
elem->p.next = NULL;
elem->p.txt = strdup(conf->cards[n].name);
elem->num = n;
-
+
if(n == 0)
elem->p.prev = NULL;
-
+
menu_list_add_entry(menu, elem);
}
else
{
- fprintf(stderr, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n",
+ fprintf(stderr, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n",
sizeof(list_entry_t), strerror(errno));
if(n)
return 1;
return 0;
}
- }
-
+ }
+
return n;
}
@@ -172,9 +172,9 @@ static int fill_menu(menu_t* menu)
{
list_entry_t* elem;
dvb_channels_list *dvb_list_ptr;
-
+
menu_list_init(menu);
-
+
if(mpriv->config == NULL)
{
if((elem = calloc(1, sizeof(list_entry_t))) != NULL)
@@ -187,7 +187,7 @@ static int fill_menu(menu_t* menu)
}
return 0;
}
-
+
mpriv->p.title = mpriv->title;
if(mpriv->level == 1 && mpriv->config->count > 1)
return fill_cards_menu(menu, mpriv->config);
@@ -216,17 +216,17 @@ static void read_cmd(menu_t* menu, int cmd)
mpriv->card = mpriv->p.current->num;
mpriv->level = 2;
menu_list_uninit(menu, free_entry);
- fill_menu(menu);
+ fill_menu(menu);
}
else
{
dvb_priv_t *dvbp = (dvb_priv_t*) mpriv->config->priv;
cmd_name = malloc(25 + strlen(elem->p.txt));
if(dvbp != NULL)
- sprintf(cmd_name, "dvb_set_channel %d %d", elem->num, mpriv->card);
+ sprintf(cmd_name, "dvb_set_channel %d %d", elem->num, mpriv->card);
else
sprintf(cmd_name, "loadfile 'dvb://%d@%s'", mpriv->card+1, elem->p.txt);
-
+
c = mp_input_parse_cmd(cmd_name);
free(cmd_name);
if(c)
@@ -243,7 +243,7 @@ static void read_cmd(menu_t* menu, int cmd)
case MENU_CMD_CANCEL:
{
elem = mpriv->p.current;
-
+
menu_list_uninit(menu, free_entry);
if(mpriv->config->count > 1)
mpriv->level--;
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index 6247e4073c..1321702945 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -64,7 +64,7 @@ struct menu_priv_s {
char* file_action;
char* dir_action;
char** actions;
- char* filter;
+ char* filter;
};
static struct menu_priv_s cfg_dflt = {
@@ -104,7 +104,7 @@ static char* replace_path(char* title , char* dir , int escape) {
if(p) {
int tl = strlen(title);
int dl = strlen(dir);
- int t1l = p-title;
+ int t1l = p-title;
int l = tl - 2 + dl;
char *r, *n, *d = dir;
@@ -295,7 +295,7 @@ static int open_dir(menu_t* menu,char* args) {
mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReallocError, strerror(errno));
n--;
goto bailout;
- }
+ }
namelist=tp;
}
@@ -305,7 +305,7 @@ static int open_dir(menu_t* menu,char* args) {
n--;
goto bailout;
}
-
+
strcpy(namelist[n], dp->d_name);
if(S_ISDIR(st.st_mode))
strcat(namelist[n], "/");
@@ -433,7 +433,7 @@ static int open_fs(menu_t* menu, char* args) {
if (!path || path[0] == '\0') {
struct stat st;
int path_fp;
-
+
path_fp = open (MENU_KEEP_PATH, O_RDONLY);
if (path_fp >= 0) {
if (!fstat (path_fp, &st) && (st.st_size > 0)) {
@@ -449,7 +449,7 @@ static int open_fs(menu_t* menu, char* args) {
}
}
}
-
+
getcwd(wd,PATH_MAX);
if (!path || path[0] == '\0') {
#if 0
@@ -495,7 +495,7 @@ static int open_fs(menu_t* menu, char* args) {
return r;
}
-
+
const menu_info_t menu_info_filesel = {
"File seletor menu",
"filesel",
diff --git a/libmenu/menu_list.c b/libmenu/menu_list.c
index c896ac0afa..9264490b81 100644
--- a/libmenu/menu_list.c
+++ b/libmenu/menu_list.c
@@ -87,7 +87,7 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) {
if(m) mpriv->current = m;
else ptr_l = 0;
}
-
+
for(i = 0, m = mpriv->menu ; m ; m = m->next, i++) {
int ll;
if(m->hide) continue;
@@ -101,7 +101,7 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) {
x += mpriv->minb;
if(y > 0)
y += mpriv->minb;
- else
+ else
y = mpriv->minb;
need_h = count * line_h - mpriv->vspace;
@@ -151,7 +151,7 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) {
MENU_TEXT_TOP|(x < 0 ? MENU_TEXT_HCENTER :MENU_TEXT_LEFT));
dy += th;
}
-
+
dx = x < 0 ? (mpi->w - need_w) / 2 : x;
bx = x < 0 ? (mpi->w - bg_w) / 2 : x - mpriv->minb;
@@ -273,7 +273,7 @@ void menu_list_read_cmd(menu_t* menu,int cmd) {
mouse_y >= selection_y && mouse_y < selection_y + selection_h)
menu_read_cmd(menu, MENU_CMD_OK);
break;
- }
+ }
}
int menu_list_jump_to_key(menu_t* menu,int c) {
@@ -311,7 +311,7 @@ void menu_list_add_entry(menu_t* menu,list_entry_t* entry) {
l->next = entry;
entry->prev = l;
}
-
+
void menu_list_init(menu_t* menu) {
if(!mpriv)
mpriv = calloc(1,sizeof(struct menu_priv_s));
@@ -328,7 +328,7 @@ void menu_list_uninit(menu_t* menu,free_entry_t free_func) {
free_func(i);
i = j;
}
-
+
mpriv->menu = mpriv->current = NULL;
}
diff --git a/libmenu/menu_list.h b/libmenu/menu_list.h
index 44e5ed8e14..8bc78e2792 100644
--- a/libmenu/menu_list.h
+++ b/libmenu/menu_list.h
@@ -83,7 +83,7 @@ extern const menu_list_priv_t menu_list_priv_dflt;
0xFF, 0xFF, \
0xA4, 0x50 \
}
-
+
#define MENU_LIST_PRIV_FIELDS \
{ "minbor", M_ST_OFF(menu_list_priv_t,minb), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \
diff --git a/libmenu/menu_param.c b/libmenu/menu_param.c
index 9dc69e7d89..529cd49e2f 100644
--- a/libmenu/menu_param.c
+++ b/libmenu/menu_param.c
@@ -60,7 +60,7 @@ struct menu_priv_s {
char* na;
int hide_na;
};
-
+
static struct menu_priv_s cfg_dflt = {
MENU_LIST_PRIV_DFLT,
NULL,
@@ -112,7 +112,7 @@ static int parse_args(menu_t* menu,char* args) {
int r;
m_option_t* opt;
ASX_Parser_t* parser = asx_parser_new();
-
+
while(1) {
r = asx_get_element(parser,&args,&element,&body,&attribs);
@@ -120,7 +120,7 @@ static int parse_args(menu_t* menu,char* args) {
mp_msg(MSGT_OSD_MENU,MSGL_ERR,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line);
asx_parser_free(parser);
return -1;
- } else if(r == 0) {
+ } else if(r == 0) {
asx_parser_free(parser);
if(!m)
mp_msg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition);
@@ -200,7 +200,7 @@ static void read_cmd(menu_t* menu,int cmd) {
if(mp_property_do(e->prop,M_PROPERTY_STEP_DOWN,NULL,menu->ctx) > 0)
update_entries(menu, 0);
return;
-
+
case MENU_CMD_OK:
// check that the property is writable
if(mp_property_do(e->prop,M_PROPERTY_SET,NULL,menu->ctx) < 0) return;
@@ -281,7 +281,7 @@ static int openMenu(menu_t* menu, char* args) {
mp_msg(MSGT_OSD_MENU,MSGL_ERR,MSGTR_LIBMENU_PrefMenuNeedsAnArgument);
return 0;
}
-
+
menu_list_init(menu);
return parse_args(menu,args);
}
diff --git a/libmenu/menu_pt.c b/libmenu/menu_pt.c
index 092912060b..f5f9999492 100644
--- a/libmenu/menu_pt.c
+++ b/libmenu/menu_pt.c
@@ -44,7 +44,7 @@ struct list_entry_s {
struct list_entry p;
play_tree_t* pt;
};
-
+
struct menu_priv_s {
menu_list_priv_t p;
@@ -132,7 +132,7 @@ static int op(menu_t* menu, char* args) {
play_tree_t* i;
list_entry_t* e;
play_tree_iter_t* playtree_iter = mpctx_get_playtree_iter(menu->ctx);
-
+
args = NULL; // Warning kill
menu->draw = menu_list_draw;
@@ -150,7 +150,7 @@ static int op(menu_t* menu, char* args) {
e->pt = playtree_iter->tree->parent;
menu_list_add_entry(menu,e);
}
-
+
for(i = playtree_iter->tree ; i->prev != NULL ; i = i->prev)
/* NOP */;
for( ; i != NULL ; i = i->next ) {
diff --git a/libmenu/menu_txt.c b/libmenu/menu_txt.c
index 74648ff7c7..30d0fcc98f 100644
--- a/libmenu/menu_txt.c
+++ b/libmenu/menu_txt.c
@@ -119,14 +119,14 @@ static void draw(menu_t* menu,mp_image_t* mpi) {
end = i + mpriv->disp_lines;
if(end >= mpriv->num_lines) end = mpriv->num_lines - 1;
}
-
+
for( ; i < end ; i++) {
menu_draw_text(mpi,mpriv->lines[i],x,y);
y += vo_font->height + mpriv->hspace;
}
}
-
+
#define BUF_SIZE 1024
static int open_txt(menu_t* menu, char* args) {
@@ -164,7 +164,7 @@ static int open_txt(menu_t* menu, char* args) {
}
pos += r;
buf[pos] = '\0';
-
+
while((l = strchr(buf,'\n')) != NULL) {
s = l-buf;
mpriv->lines = realloc(mpriv->lines,(mpriv->num_lines + 1)*sizeof(char*));
diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c
index 8fe82b351c..50c9ebfe1a 100644
--- a/libmenu/vf_menu.c
+++ b/libmenu/vf_menu.c
@@ -71,7 +71,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) {
switch(cmd->id) {
case MP_CMD_MENU : { // Convert txt cmd from the users into libmenu stuff
char* arg = cmd->args[0].v.s;
-
+
if (!priv->current->show && strcmp(arg,"hide"))
priv->current->show = 1;
else if(strcmp(arg,"up") == 0)
@@ -132,7 +132,7 @@ static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){
return;
}
}
-
+
static int key_cb(int code) {
return menu_read_key(st_priv->current,code);
}
@@ -214,7 +214,7 @@ static void uninit(vf_instance_t *vf) {
}
static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt) {
+ unsigned int flags, unsigned int outfmt) {
#ifdef CONFIG_FREETYPE
// here is the right place to get screen dimensions
if (force_load_font) {