Commit Graph

48 Commits (master)

Author SHA1 Message Date
eylles 733916ad70 add a pick quit keybind (#432)
The last time[0] this was discussed, no-one was against it but no-one
was confident in it either and so it was added to nsxiv-extra as a
patch.

But now that enough time has passed, it seems like there's a pretty high
demand for something like this because there's plenty of use-cases that
use nsxiv as a "picker" where it's meant to quickly pick a single file.

And so add this as a convenient default key-bind.

[0]: https://codeberg.org/nsxiv/nsxiv-record/pulls/42

Co-authored-by: eylles <ed.ylles1997@gmail.com>
Co-authored-by: NRK <nrk@disroot.org>
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/432
Reviewed-by: NRK <nrk@disroot.org>
Co-authored-by: eylles <eylles@noreply.codeberg.org>
Co-committed-by: eylles <eylles@noreply.codeberg.org>
1 year ago
Berke Kocaoğlu 95bc9b463b add brightness and contrast (#396)
* Imlib2 supports modifying gamma, brightness and contrast directly
  while sxiv only supports gamma. Makes sense to extend it to brightness
  and contrast as well.

* Since color corrections need to be aware of each other, they have been
  refactored into one centralized function.

* This also makes the code more hackable as it makes it easier to add
  more color correction functions without them interfering with each
  other.

Co-authored-by: 0ion9 <finticemo@gmail.com>
Co-authored-by: NRK <nrk@disroot.org>
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/396
Reviewed-by: NRK <nrk@disroot.org>
Reviewed-by: TAAPArthur <taaparthur@noreply.codeberg.org>
Co-authored-by: Berke Kocaoğlu <kberke@metu.edu.tr>
Co-committed-by: Berke Kocaoğlu <kberke@metu.edu.tr>
1 year ago
NRK b28449e10c fix: don't use reserved identifiers
identifiers beginning with an underscore is reserved by the C standard.
2 years ago
N-R-K 3a22e6a6c5
Declare every extern function/variable in `nsxiv.h` (#268)
with a couple exceptions as they cause too many -Wshadow warnings.

also moves the `extcmd_t` typedef on top for cosmetic purposes.

also enable `-Wmissing-prototypes` in the ci
2 years ago
Nick Hanley 2ac44709bd
Add keybind to scroll to image center (#203)
There are keybinds for scrolling to the edges of an image but there's no way back to the center. This is particularly annoying while zooming.
2 years ago
N-R-K 7a75c42b37
make thumbnail bindings configureable via config.h (#167)
this allows for configuring thumbnail mode mouse bindings similar to
image mode bindings.

however we can't put the thumbnails bindings into the existing buttons[]
array due to fallthrough. For example M3 would switch mode and then end
up selecting an image.

which is why thumbnail bindings have been put into it's own array
`buttons_tns[]` and `buttons[]` has been renamed to `buttons_img[]` for
consistency.

Closes: https://github.com/nsxiv/nsxiv/issues/131
2 years ago
NRK b42e3ef3d4 fix -Wstrict-prototype warning
looks like i missed one in ff88908
2 years ago
N-R-K ff88908531
specify func argument and related cleanup (#183)
* specifies the function argument type in commands.h compared to leaving
  it unspecified. all the functions in cmd_t must have arg_t as it's
  argument.
* changes to commands.h will now trigger a rebuild - this restores old
  behavior prior to 12efa0e
* cg_quit now uses it's argument as exit status
* DestroyNotify invokes cg_quit rather than calling exit directly.
* Explicitly pass EXIT_SUCCESS to cgquit in keybinding

Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2 years ago
Arthur Williams 12efa0e3b4 Add ability to bind arbitrary functions.
Before all the predated commands where kept in an array and their
indexes were used in bindings. This meant that users couldn't add their
own functions from the config file. Now key/mouse bindings have been
changed to to store the function ptr (wrapped in a cmd_t struct to also
store the mode) directly instead.

General cleanup done in this commit:
Defined `MODE_ALL` instead of using magic number.

For example, suppose one had bindings like:
{ 0,                   XK_q,             g_quit,                     None },
{ ShitMask,            XK_q,             {quit_err},                 None }
{ ControlMask,         XK_q,             {quit_err, .mode=MODE_IMAGE}, None }

The existing binding `q` has been left unchanged and is defined the same
way. However, the new hypothetical binding `Shift-q` can be used to call
the custom function quit_err in any mode (default). `Ctrl-q` on the
other hand will be called only on image mode.

Closes #50
3 years ago
Bert Münnich 148026007c One header file for type definitions and function declarations 7 years ago
Bert Münnich 5dc7993478 Simplified command arguments 10 years ago
Bert Münnich 06164c29b7 Revised command structure and key and mouse button mappings 10 years ago
Bert Münnich e685859a30 Use a checkerboard background for alpha layer; fixes issue #138 10 years ago
Bert Münnich 524d9de877 Removed fit-win-to-img command 10 years ago
Bert Münnich f6510b0a04 Merged pull request #129 10 years ago
Bert Münnich e82397db15 Fixed handling of overloaded key mappings
Issue described here:
https://bbs.archlinux.org/viewtopic.php?pid=1117294#p1117294
11 years ago
Bert Münnich 6a0fa2507c Slideshow mode is back, in a simplified version 11 years ago
Bert Münnich f2e0c492bd Moved external shell commands into exec/key-handler script
Gets called on all unset key mappings. Arguments are: key combo and
current file. Thanks to Francesco Orsenigo (xarvh) for the idea.
11 years ago
Bert Münnich b2eae528ed Proper support for Ctrl/Shift/Alt modifiers in key & mouse mappings 11 years ago
Bert Münnich 091aacb462 Merge remote-tracking branch 'baskerville/reverse-marks' 11 years ago
Bastien Dejean 562197577b Add command to reverse marked images 11 years ago
András Mohari 0353e6eea2 Add support for changing the gamma value 11 years ago
Bert Münnich 7d878bd16d Added file marks; fixes issue #94
- Command it_toggle_image_mark (bound to 'm') toggles mark of current
  image
- Command it_navigate_marked (bound to 'N'/'P') can be used to go to
  the next/previous marked image
- When option -o is given, all marked files get printed
11 years ago
Bert Münnich 6d3bbc6d5e Updated/corrected license header 11 years ago
hut 3a0a1ae889 Removed old definitions from commands.h 11 years ago
Bert Münnich f2a3d73212 New command: i_alternate, go to last image, issue #65 12 years ago
Bert Münnich d1a1e0142b Simplified & sped up reloading of all thumbnails 12 years ago
baskerville de4e9fc83e Added a command to refresh the thumbnails 12 years ago
baskerville ba0a5b89fa Added horizontal and vertical flip commands 12 years ago
Bert Münnich c666d30eea Added it_toggle_bar command; default mapping: XK_b 12 years ago
Bert Münnich d407dd65d5 Already in the year 2012 12 years ago
Bert Münnich 1cdbeb972a Added screen-wise scrolling for thumbnail mode 13 years ago
Bert Münnich 4e8dabd6ac Added i_reset_slideshow: set slideshow delay to number prefix 13 years ago
Bert Münnich 4f5ce2e828 Added i_set_zoom command: set zoom to number prefix 13 years ago
Bert Münnich dc727b8dce Added support for number prefix for commands 13 years ago
Bert Münnich 36177fb180 Updated contact information 13 years ago
Bert b2a2a62b7b Added own bool type 13 years ago
Bert 510512714d Added slideshow support 13 years ago
Bert 26eae8be96 Made i(t)_toggle_alpha command work in thumbnail mode too 13 years ago
Bert d585b86354 Reformated license header 13 years ago
Bert bb577d274d Added command to toggle gif animations 13 years ago
Bert 86a6f00112 Added support for multi-frame images 13 years ago
Bert 1d749382f0 Put event handling back into main.c; events -> commands 13 years ago
Bert c58307ba38 Merged commands.h into config.h 13 years ago
Bert a82c45431b Use ctrl for ext cmds, disable them in config.h 13 years ago
Bert 00d4b0f7cf Use "/bin/sh -c" for external commands 13 years ago
Bert 50e8fbf7b3 Slightly refactored commands.h 13 years ago
Bert c05fd44bdd Support for external commands like mogrify & jpegtran 13 years ago