aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-11-18 11:44:59 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-11-18 11:44:59 +0100
commit112b3fbcd8509bc3e198ed7e982373127e2e68b9 (patch)
tree9b56f65be9cd5fece880254c279e6ae531659528
parent9c2956a1b21c125ee4e0a20fca3637cfec9fed53 (diff)
downloadfbida-112b3fbcd8509bc3e198ed7e982373127e2e68b9.tar.gz
add global scale (textreading)
-rwxr-xr-xfbgs1
-rw-r--r--fbi.c10
-rw-r--r--fbiconfig.c5
-rw-r--r--fbiconfig.h2
4 files changed, 17 insertions, 1 deletions
diff --git a/fbgs b/fbgs
index 3b996b5..5a7bdd2 100755
--- a/fbgs
+++ b/fbgs
@@ -86,6 +86,7 @@ while test "$opt" = "1"; do
-a | --autozoom | \
--autoup | --noautoup | \
--autodown | --noautodown | \
+ --autoonce | --noautoonce | \
--fitwidth | --nofitwidth | \
--readahead | --noreadahead | \
-v | --verbose | --noverbose | \
diff --git a/fbi.c b/fbi.c
index 5fdaa36..95290d0 100644
--- a/fbi.c
+++ b/fbi.c
@@ -136,6 +136,7 @@ static float fbgamma = 1;
/* Command line options. */
int autodown;
int autoup;
+int autoonce;
int comments;
int transparency = 40;
int timeout;
@@ -150,6 +151,9 @@ int perfmon = 0;
static char *fontname = NULL;
static FT_Face face;
+/* scaling */
+static float globalscale = 0;
+
/* ---------------------------------------------------------------------- */
/* fwd declarations */
@@ -1343,6 +1347,7 @@ static void flist_img_scale(struct flist *f, float scale, int prefetch)
}
}
f->scale = scale;
+ globalscale = scale;
}
static void flist_img_load(struct flist *f, int prefetch)
@@ -1370,7 +1375,9 @@ static void flist_img_load(struct flist *f, int prefetch)
if (!f->seen) {
scale = 1;
- if (autoup || autodown) {
+ if (autoonce && globalscale != 0) {
+ scale = globalscale;
+ } else if (autoup || autodown) {
scale = auto_scale(f->fimg);
if (scale < 1 && !autodown)
scale = 1;
@@ -1454,6 +1461,7 @@ main(int argc, char *argv[])
once = GET_ONCE();
autoup = GET_AUTO_UP();
autodown = GET_AUTO_DOWN();
+ autoonce = GET_AUTO_ONCE();
fitwidth = GET_FIT_WIDTH();
statusline = GET_VERBOSE();
textreading = GET_TEXT_MODE();
diff --git a/fbiconfig.c b/fbiconfig.c
index fb41f08..e8b62c4 100644
--- a/fbiconfig.c
+++ b/fbiconfig.c
@@ -65,6 +65,11 @@ struct cfg_cmdline fbi_cfg[] = {
.option = { O_FIT_WIDTH },
.yesno = 1,
.desc = " use width only for autoscaling",
+ },{
+ .cmdline = "autoonce",
+ .option = { O_AUTO_ONCE },
+ .yesno = 1,
+ .desc = " autoscale only once",
},{
.letter = 'v',
diff --git a/fbiconfig.h b/fbiconfig.h
index 3abdb6d..bb9ffe3 100644
--- a/fbiconfig.h
+++ b/fbiconfig.h
@@ -12,6 +12,7 @@
#define O_AUTO_UP O_OPTIONS, "auto-up"
#define O_AUTO_DOWN O_OPTIONS, "auto-down"
+#define O_AUTO_ONCE O_OPTIONS, "auto-once"
#define O_FIT_WIDTH O_OPTIONS, "fit-width"
#define O_QUIET O_OPTIONS, "quiet"
#define O_VERBOSE O_OPTIONS, "verbose"
@@ -44,6 +45,7 @@
#define GET_AUTO_UP() cfg_get_bool(O_AUTO_UP, 0)
#define GET_AUTO_DOWN() cfg_get_bool(O_AUTO_DOWN, 0)
+#define GET_AUTO_ONCE() cfg_get_bool(O_AUTO_ONCE, 0)
#define GET_FIT_WIDTH() cfg_get_bool(O_FIT_WIDTH, 0)
#define GET_QUIET() cfg_get_bool(O_QUIET, 0)
#define GET_VERBOSE() cfg_get_bool(O_VERBOSE, 1)