aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
AgeCommit message (Collapse)Author
2016-11-16Reset slideshow timer when image changed via 'x'Harry Jeffery
When the user hits left/right to change image, the time left until the slideshow changes images is reset. If the user changes image by closing the current image, the timer is not reset. This patch resolves that.
2016-10-23Simplify hex color parserDmitrij D. Czarkoff
It is actually a trivial task for strtoul + some bit shifting, so there is no need for two separate functions.
2016-10-20Cap playback delta-time to 100 msHarry Jeffery
This prevents imv from trying to "catch up" on the time that it was asleep for by playing the gif back at high speed.
2016-09-27Fix GetWidth/GetHeight typo in main.cHarry Jeffery
2016-05-01Make imv_navigator_add() return an integer valueDmitrij D. Czarkoff
In case of error return non-zero value instead of cleaning up navigator. This way main loop may do some more cleanup, or maybe even act differently.
2016-04-29Fix uninitialized use of "last_time"Dmitrij D. Czarkoff
Set "last_time" to current time at declaration time, so that it holds at least something by the time it is used.
2016-04-29Use single buffer for title and overlayDmitrij D. Czarkoff
This allows to drop extra printing steps and memory allocations.
2016-04-26Reimplement '-x' flagDmitrij D. Czarkoff
This change effectively backs out f1737ddd06141afbe99f37af3b5c2d0f1df5fe7a, implementing the same functionality in a simpler and more correct way. Implementation details: * imv_navigator.wrapped - a new field that has value "0" by default; once navigator wraps around the list, this field recieves value "1". * imv_navigator_wrapped(&nav) - a new function that returns non-zero value iff navigator wrapped around the list. Currently just returns value of imv_navigator.wrapped. While at it, expanded "test_navigator_remove" and merged it with "test_navigator_add". Resulting test is called "test_navigator_add_remove". Fixes #94.
2016-04-26Indent fixDmitrij D. Czarkoff
2016-04-26Add vim modelinesDmitrij D. Czarkoff
2016-04-26Conditionally ignore key repeatDmitrij D. Czarkoff
For the following actions: * reset scaling ('s'), * redraw ('r'), * scale to actual size ('a'), * center image ('c'), * remove selection ('x'), * toggle fullscreen ('f'), * toggle playing (space), * print selection ('p'), * toggle overlay ('d') repeating action when key is held does not make sense. After acting upon these events ignore them until key is released or another key is pressed.
2016-04-25Make '+' work on all layoutsDmitrij D. Czarkoff
Key handling code obuses the fact that plus sign is shifted key for equals sign on US keyboard. Add '+' as a control for layouts where this is not the case.
2016-04-02Add -x switch to exit imv when reaching end of file list.Hannes Koerber
2016-03-06Read file list from standard input continuoslyDmitrij D. Czarkoff
This reduces delay before initial draw in case of slow input, opening possibilities for use cases like: $ curl -Osw "%{filename_effective}\n" "http://www.example.com/[1-10].jpg" which will download all images and start showing them once first arrives.
2016-02-08Remove tabsHarry Jeffery
2016-01-24Fix bug in slideshow timingHarry Jeffery
2016-01-16Add third scaling mode: best fitDmitrij D. Czarkoff
* Add new switches: "-S" to force (default) "perfect fit" mode and "-s" to force "best fit" mode. * Add new control key: "s" to switch scaling mode.
2016-01-16Provide some feedback to users when no arguments are givenHarry Jeffery
2016-01-16Trim usage information for -hHarry Jeffery
2016-01-14Loading image data from standard inputDmitrij D. Czarkoff
This commit changes processing of arguments: * When called without arguments (with or without flags), imv reads list of files from standard input. * When called with "-" among arguments, read image data from standard input.
2016-01-13Use PATH_MAX for buffers holding pathsDmitrij D. Czarkoff
2016-01-01Include <limits.h>Dmitrij D. Czarkoff
2015-12-30Reduce amount of stat(2) callsDmitrij D. Czarkoff
Add 8-bit variable that is passed to imv_navigator_poll_changed(). Decrement it on each run of main loop. When it gets to 0, call stat(2).
2015-12-30Allow fractional slideshow timeoutDmitrij D. Czarkoff
Accept slideshow timeout expressed as fractional numbers. It is intentionally lax, so that arguments like ".1" or "5." are accepted and give no surprises.
2015-12-28Hide functions that are not exposed via headersDmitrij D. Czarkoff
2015-12-28Remove names from file copyright headersHarry Jeffery
2015-12-28Use stat(2) to monitor file changesDmitrij D. Czarkoff
Makes file monitoring in imv completely POSIX.
2015-12-26Improve readability of g_optionsHarry Jeffery
The default options block was getting quite ridiculous to try and read. Let's improve the readability.
2015-12-26Merge pull request #62 from czarkoff/fontHarry Jeffery
Use default font
2015-12-25Document default font change in help textDmitrij D. Czarkoff
2015-12-25Use default fontDmitrij D. Czarkoff
"Monospace" is a font name reserved for default monospace font, which is supposed to be set to particular font user prefers.
2015-12-25Don't use "stdin" variable nameDmitrij D. Czarkoff
At least on OpenBSD stdin, stdout and stderr are macros, and thus they are expanded before compilation.
2015-12-10don't create chequered bg if its not usedAleksandra Kosiacka
fixes #40
2015-12-10hide mouse on key pressAleksandra Kosiacka
fixes #37
2015-12-10Add support for reloading filesJose Diez
Closes #8.
2015-12-10Move text rendering into a util functionHarry Jeffery
2015-12-10Make imv_loader_get_image more informativeHarry Jeffery
2015-12-10Clean up redraw logicHarry Jeffery
2015-12-10add -l option for listing all open images on exitAleksandra Kosiacka
fixes #43
2015-12-09Add slideshow option.Hannes Koerber
2015-12-08Refactor imv_navigator interfaceHarry Jeffery
2015-12-07Permit falling back to software rendererHarry Jeffery
2015-12-04Handle null window/renderer gracefullyHarry Jeffery
2015-11-30Comment main.c more thoroughlyHarry Jeffery
2015-11-28Clean up overlays on exitHarry Jeffery
2015-11-28Don't use a possibly NULL current_pathHarry Jeffery
2015-11-28Use correct free function for SDL_SurfaceHarry Jeffery
2015-11-28Resume playback on image changeHarry Jeffery
2015-11-28Remove unused parameterHarry Jeffery
2015-11-28Move utility functions from main.c to util.cHarry Jeffery