From c158e0596f6f103ee2e5465051d03028f7b9b181 Mon Sep 17 00:00:00 2001 From: nirav Date: Sat, 27 Apr 2019 17:26:15 +0000 Subject: Rename to im --- .gitignore | 2 +- Makefile | 30 +++++++++--------- README | 5 +-- data/im.css | 9 ++++++ data/im.gresources.xml | 6 ++++ data/qwe.css | 9 ------ data/qwe.gresources.xml | 6 ---- doc/im.1.scd | 67 +++++++++++++++++++++++++++++++++++++++ doc/qwe.1 | 84 ------------------------------------------------- doc/qwe.1.scd | 67 --------------------------------------- im.desktop | 8 +++++ qwe.desktop | 8 ----- src/option.c | 4 +-- src/window.c | 4 +-- 14 files changed, 111 insertions(+), 198 deletions(-) create mode 100644 data/im.css create mode 100644 data/im.gresources.xml delete mode 100644 data/qwe.css delete mode 100644 data/qwe.gresources.xml create mode 100644 doc/im.1.scd delete mode 100644 doc/qwe.1 delete mode 100644 doc/qwe.1.scd create mode 100644 im.desktop delete mode 100644 qwe.desktop diff --git a/.gitignore b/.gitignore index 787c97d..74a58ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ src/resources.c -qwe +im *.o diff --git a/Makefile b/Makefile index 12fae3d..5de8517 100644 --- a/Makefile +++ b/Makefile @@ -24,13 +24,13 @@ OBJECTS=$(SRCDIR)/main.o \ $(SRCDIR)/option.o \ $(SRCDIR)/resources.o -all: qwe +all: im -qwe: $(OBJECTS) +im: $(OBJECTS) $(CC) $(_LDFLAGS) -o $@ $(OBJECTS) -$(SRCDIR)/resources.c: $(DATADIR)/qwe.gresources.xml $(DATADIR)/qwe.css - glib-compile-resources $(DATADIR)/qwe.gresources.xml --target=$@ --generate-source +$(SRCDIR)/resources.c: $(DATADIR)/im.gresources.xml $(DATADIR)/im.css + glib-compile-resources $(DATADIR)/im.gresources.xml --target=$@ --generate-source .c.o: $(CC) $(_CFLAGS) $(DFLAGS) -c -o $@ $< @@ -38,23 +38,23 @@ $(SRCDIR)/resources.c: $(DATADIR)/qwe.gresources.xml $(DATADIR)/qwe.css clean: rm -f $(SRCDIR)/resources.c rm -f $(SRCDIR)/*.o - rm -f qwe + rm -f im -install: qwe qwe.desktop +install: im im.desktop mkdir -p $(DESTDIR)$(BINDIR) - cp qwe $(DESTDIR)$(BINDIR)/qwe - chmod 0775 $(DESTDIR)$(BINDIR)/qwe + cp im $(DESTDIR)$(BINDIR)/im + chmod 0775 $(DESTDIR)$(BINDIR)/im mkdir -p $(DESTDIR)$(APPDIR) - cp qwe.desktop $(DESTDIR)$(APPDIR)/qwe.desktop - chmod 0664 $(DESTDIR)$(APPDIR)/qwe.desktop + cp im.desktop $(DESTDIR)$(APPDIR)/im.desktop + chmod 0664 $(DESTDIR)$(APPDIR)/im.desktop mkdir -p $(DESTDIR)$(MANDIR) - cp doc/qwe.1 $(DESTDIR)$(MANDIR)/qwe.1 - chmod 0664 $(DESTDIR)$(MANDIR)/qwe.1 + cp doc/im.1 $(DESTDIR)$(MANDIR)/im.1 + chmod 0664 $(DESTDIR)$(MANDIR)/im.1 uninstall: - rm -f $(DESTDIR)$(BINDIR)/qwe - rm -f $(DESTDIR)$(APPDIR)/qwe.desktop - rm -f $(DESTDIR)$(MANDIR)/qwe.1 + rm -f $(DESTDIR)$(BINDIR)/im + rm -f $(DESTDIR)$(APPDIR)/im.desktop + rm -f $(DESTDIR)$(MANDIR)/im.1 src/file.o: src/file.c src/file.h src/image.h src/image.o: src/image.c src/image.h src/window.h diff --git a/README b/README index eebbf3c..f37955d 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -qwe: Image Viewer +im: Image Viewer Dependencies @@ -10,6 +10,3 @@ Installation $ make # make install - -Contact -qwe@airmail.cc diff --git a/data/im.css b/data/im.css new file mode 100644 index 0000000..375165e --- /dev/null +++ b/data/im.css @@ -0,0 +1,9 @@ +#info-panel { + background-color: #000000; + color: #ffffff; + padding: 0px 4px; +} + +#main-window { + background-color: #444444; +} diff --git a/data/im.gresources.xml b/data/im.gresources.xml new file mode 100644 index 0000000..5821b3f --- /dev/null +++ b/data/im.gresources.xml @@ -0,0 +1,6 @@ + + + + data/im.css + + diff --git a/data/qwe.css b/data/qwe.css deleted file mode 100644 index 375165e..0000000 --- a/data/qwe.css +++ /dev/null @@ -1,9 +0,0 @@ -#info-panel { - background-color: #000000; - color: #ffffff; - padding: 0px 4px; -} - -#main-window { - background-color: #444444; -} diff --git a/data/qwe.gresources.xml b/data/qwe.gresources.xml deleted file mode 100644 index 336977a..0000000 --- a/data/qwe.gresources.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - data/qwe.css - - diff --git a/doc/im.1.scd b/doc/im.1.scd new file mode 100644 index 0000000..ec64aa9 --- /dev/null +++ b/doc/im.1.scd @@ -0,0 +1,67 @@ +im(1) + +# NAME + +im - a simple image viewer + +# SYNOPSIS + +*im* _filename_ + +# DESCRIPTION + +im is a image viewer written in GTK+. It can open any image file +supported by GdkPixbuf library, use *-f* flag to print the list of image +formats supported by GdkPixbuf. + + +# MODES + +im supports two image display modes, *Fit* and *Zoom*. + + +The default mode *Fit* will resize the image to fit inside the current window +while maintaining the aspect ratio. + + +Zoom mode let's you zoom and pan (scroll) the zoomed-in image. + +# KEY BINDINGS + +im has separate key bindings for both *Fit* and *Zoom* mode. + +## FIT MODE + + *j*, *l*, *n*, **, ** Next image + + *k*, *h*, *p*, **, ** Previous image + +## ZOOM MODE + + *j*, ** Scroll down + + *k*, ** Scroll up + + *h*, ** Scroll left + + *l*, ** Scroll right + + *J*, *L*, **, ** Next image + + *K*, *H*, **, ** Previous image + +## ANY MODE + + *+*, ** Zoom-in by 10% and switch to *Zoom* mode + + *-*, ** Zoom-out by 10% and switch to *Zoom* mode + + *=* Reset zoom to 100% and switch to *Zoom* mode + + *w* Switch to *Fit* mode + + *q* Quit + +# SEE ALSO + +*sxiv*(1), *feh*(1) diff --git a/doc/qwe.1 b/doc/qwe.1 deleted file mode 100644 index 9e60cf6..0000000 --- a/doc/qwe.1 +++ /dev/null @@ -1,84 +0,0 @@ -.\" Generated by scdoc 1.2.3 -.\" Fix weird quotation marks: -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" Disable hyphenation: -.nh -.\" Disable justification: -.ad l -.\" Generated content: -.TH "qwe" "1" "2018-09-09" -.P -.SH NAME -.P -qwe - a simple image viewer -.P -.SH SYNOPSIS -.P -\fBqwe\fR \fIfilename\fR -.P -.SH DESCRIPTION -.P -qwe is a image viewer written in GTK+. It can open any image file -supported by GdkPixbuf library, use \fB-f\fR flag to print the list of image -formats supported by GdkPixbuf. -.P -.P -.SH MODES -.P -qwe supports two image display modes, \fBFit\fR and \fBZoom\fR. -.P -.P -The default mode \fBFit\fR will resize the image to fit inside the current window -while maintaining the aspect ratio. -.P -.P -Zoom mode let's you zoom and pan (scroll) the zoomed-in image. -.P -.SH KEY BINDINGS -.P -qwe has separate key bindings for both \fBFit\fR and \fBZoom\fR mode. -.P -.SS FIT MODE -.P -.RS "4" -\fBj\fR, \fBl\fR, \fBn\fR, \fB\fR, \fB\fR Next image -.P -\fBk\fR, \fBh\fR, \fBp\fR, \fB\fR, \fB\fR Previous image -.P -.RE -.SS ZOOM MODE -.P -.RS "4" -\fBj\fR, \fB\fR Scroll down -.P -\fBk\fR, \fB\fR Scroll up -.P -\fBh\fR, \fB\fR Scroll left -.P -\fBl\fR, \fB\fR Scroll right -.P -\fBJ\fR, \fBL\fR, \fB\fR, \fB\fR Next image -.P -\fBK\fR, \fBH\fR, \fB\fR, \fB\fR Previous image -.P -.RE -.SS ANY MODE -.P -.RS "4" -\fB+\fR, \fB\fR Zoom-in by 10% and switch to \fBZoom\fR mode -.P -\fB-\fR, \fB\fR Zoom-out by 10% and switch to \fBZoom\fR mode -.P -\fB=\fR Reset zoom to 100% and switch to \fBZoom\fR mode -.P -\fBw\fR Switch to \fBFit\fR mode -.P -\fBq\fR Quit -.P -.RE -.SH SEE ALSO -.P -\fBsxiv\fR(1), \fBfeh\fR(1) diff --git a/doc/qwe.1.scd b/doc/qwe.1.scd deleted file mode 100644 index be83cae..0000000 --- a/doc/qwe.1.scd +++ /dev/null @@ -1,67 +0,0 @@ -qwe(1) - -# NAME - -qwe - a simple image viewer - -# SYNOPSIS - -*qwe* _filename_ - -# DESCRIPTION - -qwe is a image viewer written in GTK+. It can open any image file -supported by GdkPixbuf library, use *-f* flag to print the list of image -formats supported by GdkPixbuf. - - -# MODES - -qwe supports two image display modes, *Fit* and *Zoom*. - - -The default mode *Fit* will resize the image to fit inside the current window -while maintaining the aspect ratio. - - -Zoom mode let's you zoom and pan (scroll) the zoomed-in image. - -# KEY BINDINGS - -qwe has separate key bindings for both *Fit* and *Zoom* mode. - -## FIT MODE - - *j*, *l*, *n*, **, ** Next image - - *k*, *h*, *p*, **, ** Previous image - -## ZOOM MODE - - *j*, ** Scroll down - - *k*, ** Scroll up - - *h*, ** Scroll left - - *l*, ** Scroll right - - *J*, *L*, **, ** Next image - - *K*, *H*, **, ** Previous image - -## ANY MODE - - *+*, ** Zoom-in by 10% and switch to *Zoom* mode - - *-*, ** Zoom-out by 10% and switch to *Zoom* mode - - *=* Reset zoom to 100% and switch to *Zoom* mode - - *w* Switch to *Fit* mode - - *q* Quit - -# SEE ALSO - -*sxiv*(1), *feh*(1) diff --git a/im.desktop b/im.desktop new file mode 100644 index 0000000..d08f2ad --- /dev/null +++ b/im.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=im +Comment=Image Viewer +Exec=im %f +Terminal=false +NoDisplay=true +MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/png;image/tiff;image/x-bmp;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-tga;image/x-xpixmap; diff --git a/qwe.desktop b/qwe.desktop deleted file mode 100644 index b21cc16..0000000 --- a/qwe.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=qwe -Comment=Image Viewer -Exec=qwe %f -Terminal=false -NoDisplay=true -MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/png;image/tiff;image/x-bmp;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-tga;image/x-xpixmap; diff --git a/src/option.c b/src/option.c index e548d78..4385c29 100644 --- a/src/option.c +++ b/src/option.c @@ -6,9 +6,9 @@ #include "option.h" -static const char version[] = "qwe version 0.01"; +static const char version[] = "im version 0.01"; static const char usage[] = - "Usage: qwe [options...] \n" + "Usage: im [options...] \n" "\n" " -i Hide info bar by default.\n" " -f Use fullscreen mode by default.\n" diff --git a/src/window.c b/src/window.c index dbb41f9..4493fb5 100644 --- a/src/window.c +++ b/src/window.c @@ -56,7 +56,7 @@ static gboolean configure_callback( void load_css() { GtkCssProvider *provider = gtk_css_provider_new(); - gtk_css_provider_load_from_resource(provider, "/org/gtk/qwe/qwe.css"); + gtk_css_provider_load_from_resource(provider, "/org/gtk/im/im.css"); gtk_style_context_add_provider_for_screen( gdk_display_get_default_screen(gdk_display_get_default()), GTK_STYLE_PROVIDER(provider), @@ -70,7 +70,7 @@ void create_main_window() window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); gtk_widget_set_name(GTK_WIDGET(window), "main-window"); - gtk_window_set_title(GTK_WINDOW(window), "qwe"); + gtk_window_set_title(GTK_WINDOW(window), "im"); gtk_window_set_default_size(GTK_WINDOW(window), 800, 600); gtk_widget_add_events(GTK_WIDGET(window), GDK_SCROLL_MASK); g_signal_connect(G_OBJECT(window), "configure-event", -- cgit v1.2.3