Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
feh
Commits
78a066bc
Commit
78a066bc
authored
14 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Use SIGUSR1/SIGUSR2 in slideshow mode to change images
parent
231d1264
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
ChangeLog
+1
-0
1 addition, 0 deletions
ChangeLog
src/deps.mk
+3
-1
3 additions, 1 deletion
src/deps.mk
src/signals.c
+63
-0
63 additions, 0 deletions
src/signals.c
src/signals.h
+31
-0
31 additions, 0 deletions
src/signals.h
src/slideshow.c
+4
-0
4 additions, 0 deletions
src/slideshow.c
with
102 additions
and
1 deletion
ChangeLog
+
1
−
0
View file @
78a066bc
...
@@ -13,6 +13,7 @@ git HEAD
...
@@ -13,6 +13,7 @@ git HEAD
* Draw a nice little message when in caption editing mode with empty
* Draw a nice little message when in caption editing mode with empty
caption (to indicate that caption editing is actually active)
caption (to indicate that caption editing is actually active)
* caption mode: Automatically create caption directory if it doesn't exist
* caption mode: Automatically create caption directory if it doesn't exist
* Slideshow mode: SIGUSR1 = next image, SIGUSR2 = previous image
Sat Jun 5 21:35:25 CEST 2010 Daniel Friesel <derf@chaosdorf.de
Sat Jun 5 21:35:25 CEST 2010 Daniel Friesel <derf@chaosdorf.de
...
...
This diff is collapsed.
Click to expand it.
src/deps.mk
+
3
−
1
View file @
78a066bc
...
@@ -27,8 +27,10 @@ multiwindow.o: multiwindow.c feh.h structs.h menu.h ipc.h utils.h \
...
@@ -27,8 +27,10 @@ multiwindow.o: multiwindow.c feh.h structs.h menu.h ipc.h utils.h \
getopt.h debug.h winwidget.h timers.h filelist.h options.h
getopt.h debug.h winwidget.h timers.h filelist.h options.h
options.o
:
options.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
options.o
:
options.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
debug.h filelist.h options.h
debug.h filelist.h options.h
signals.o
:
signals.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
debug.h winwidget.h
slideshow.o
:
slideshow.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
slideshow.o
:
slideshow.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
debug.h filelist.h timers.h winwidget.h options.h
debug.h filelist.h timers.h winwidget.h options.h
signals.h
support.o
:
support.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
support.o
:
support.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
debug.h filelist.h options.h support.h
debug.h filelist.h options.h support.h
thumbnail.o
:
thumbnail.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
thumbnail.o
:
thumbnail.c feh.h structs.h menu.h ipc.h utils.h getopt.h
\
...
...
This diff is collapsed.
Click to expand it.
src/signals.c
0 → 100644
+
63
−
0
View file @
78a066bc
/* signals.c
Copyright (C) 2010 by Daniel Friesel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies of the Software and its documentation and acknowledgment shall be
given in the documentation and software packages that this Software was
used.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include
"feh.h"
#include
"winwidget.h"
void
feh_handle_signal
(
int
);
void
setup_signal_handlers
()
{
struct
sigaction
feh_sh
;
sigset_t
feh_ss
;
D_ENTER
(
4
);
sigemptyset
(
&
feh_ss
);
sigaddset
(
&
feh_ss
,
SIGUSR1
);
sigaddset
(
&
feh_ss
,
SIGUSR2
);
feh_sh
.
sa_handler
=
feh_handle_signal
;
feh_sh
.
sa_mask
=
feh_ss
;
sigaction
(
SIGUSR1
,
&
feh_sh
,
NULL
);
sigaction
(
SIGUSR2
,
&
feh_sh
,
NULL
);
D_RETURN_
(
4
);
}
void
feh_handle_signal
(
int
signo
)
{
D_ENTER
(
4
);
winwidget
winwid
=
winwidget_get_first_window_of_type
(
WIN_TYPE_SLIDESHOW
);
if
(
winwid
)
{
if
(
signo
==
SIGUSR1
)
slideshow_change_image
(
winwid
,
SLIDE_NEXT
);
else
if
(
signo
==
SIGUSR2
)
slideshow_change_image
(
winwid
,
SLIDE_PREV
);
}
D_RETURN_
(
4
);
}
This diff is collapsed.
Click to expand it.
src/signals.h
0 → 100644
+
31
−
0
View file @
78a066bc
/* signals.h
Copyright (C) 2010 by Daniel Friesel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies of the Software and its documentation and acknowledgment shall be
given in the documentation and software packages that this Software was
used.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SIGNALS_H
#define SIGNALS_H
void
setup_signal_handlers
();
#endif
This diff is collapsed.
Click to expand it.
src/slideshow.c
+
4
−
0
View file @
78a066bc
...
@@ -28,6 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
...
@@ -28,6 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
"timers.h"
#include
"timers.h"
#include
"winwidget.h"
#include
"winwidget.h"
#include
"options.h"
#include
"options.h"
#include
"signals.h"
void
init_slideshow_mode
(
void
)
void
init_slideshow_mode
(
void
)
{
{
...
@@ -75,6 +76,9 @@ void init_slideshow_mode(void)
...
@@ -75,6 +76,9 @@ void init_slideshow_mode(void)
}
}
if
(
!
success
)
if
(
!
success
)
show_mini_usage
();
show_mini_usage
();
setup_signal_handlers
();
D_RETURN_
(
3
);
D_RETURN_
(
3
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment