gomicsv

package module
v0.0.0-...-fb91eac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: GPL-3.0 Imports: 33 Imported by: 0

README

Gomics-v

A GTK comic viewer

Gomics-v is a GTK comic and image archive viewer written in Go, available under the GNU GPL v3 or later.

This is a personal fork of Gomics (without the -v). Please also consult the main project’s README at https://github.com/salviati/gomics.

This fork has been made with personal use for reading manga with mouse-centered navigation in mind. Consequently, some aspects of other workflows might have been broken.

The program has only been confirmed to work on Linux, but it is possible it would work on other platforms.

Changes from Gomics

  • Added Jumpmarks

    Temporary page marks for quickly jumping around the currently open archive. See the Jumpmarks menu in the menu bar for more information.

  • Added Hide UI option (Alt+M to hide/unhide).

  • Added experimental HTTP archive support

    See File › Open URL (experimental) for a detailed explanation. A HTTP archive can alternatively be loaded by providing the URL as a program argument (see ./gomicsv --help) or by pasting the URL into the program.

  • Reworked page navigation

    • Click the left/right half of the image area to go to the previous/next page.

    • Drag with the middle mouse button to pan around the image.

  • Added integration with Kamite (a desktop Japanese immersion companion)

    Right-click on text block for automatic OCR. Right-hold-click to initialize manual block recognition selection. Must be first enabled in Preferences.

  • Added Remember reading position option

    Automatically saves the last reading position for each archive and resumes reading at that position. Must be first enabled in Preferences.

  • Added Save image as… command

  • Added Copy image to clipboard command

  • Polished the look of preferences UI.

  • Made the Background color preference functional.

  • Reorganized the codebase.

  • Various other minor tweaks (and breakages).

Installation

Download the latest release package from the Releases page (Linux only) and extract it to the location where you want to keep the program files (e.g., /opt/gomicsv).

Or build it from the source (see below).

Known issues

  • On GNOME, Hide UI breaks once the window is made full screen or maximized.

Building

git clone "https://github.com/fauu/gomicsv"
cd gomicsv
make build

A self-contained Gomics-v executable will be produced at target/gomicsv.

Building requires go and some GTK-related dependencies. See gomics: Requirements. GTK-related build steps might take up to 15 minutes on first compile.


Extra information for Windows and macOS:

License

Gomics-v
Copyright (c) 2013–2021 Utkan Güngördü utkan@freeconsole.org
Copyright (c) 2021–2023 Piotr Grabowski

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Documentation

Overview

* Copyright (c) 2013-2021 Utkan Güngördü <utkan@freeconsole.org> * Copyright (c) 2021-2023 Piotr Grabowski * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	AppName        = "gomicsv"
	AppNameDisplay = "Gomics-v"
	AppID          = "com.github.fauu.gomicsv"
)
View Source
const (
	ConfigFilename = "config"
	ReadLaterDir   = "read-later"
)

Variables

View Source
var FILE_CHOOSER_RESPONSE_ACCEPT gtk.ResponseType = 100

Functions

This section is empty.

Types

type Accel

type Accel struct {
	Key  uint
	Mods gdk.ModifierType
}

type App

type App struct {
	S      State
	W      Widgets
	Config Config
}

func (*App) Init

func (app *App) Init(nonFlagArgs []string, startupParams AppStartupParams, buildInfo BuildInfo) *gtk.Application

type AppStartupParams

type AppStartupParams struct {
	Referer string
}

type Bookmark

type Bookmark struct {
	Path       string
	Page       uint
	TotalPages *uint
	Added      time.Time
}

type BuildInfo

type BuildInfo struct {
	Version string
	Date    string
}

type Color

type Color struct {
	R byte `json:"R"`
	G byte `json:"G"`
	B byte `json:"B"`
	A byte `json:"A"`
}

func NewColorFromGdkRGBA

func NewColorFromGdkRGBA(rgba *gdk.RGBA) Color

func (Color) ToCSS

func (color Color) ToCSS() string

func (Color) ToGdkRGBA

func (color Color) ToGdkRGBA() gdk.RGBA

func (Color) ToPixelInt

func (color Color) ToPixelInt() uint32

type Config

type Config struct {
	ZoomMode             ZoomMode
	Enlarge              bool
	Shrink               bool
	LastDirectory        string
	Fullscreen           bool
	HideUI               bool
	WindowWidth          int
	WindowHeight         int
	Random               bool
	Seamless             bool
	HFlip                bool
	VFlip                bool
	DoublePage           bool
	MangaMode            bool
	BackgroundColor      Color
	NSkip                int
	NPreload             int
	RememberRecent       bool
	RememberPosition     bool
	RememberPositionHTTP bool
	OneWide              bool
	EmbeddedOrientation  bool
	Interpolation        int
	ImageDiffThres       float32
	SceneScanSkip        int
	SmartScroll          bool
	HideIdleCursor       bool
	KamiteEnabled        bool
	KamitePort           int
	Bookmarks            []Bookmark
}

type Cursor

type Cursor int

type CursorCache

type CursorCache = map[Cursor]*gdk.Cursor

type CursorsState

type CursorsState struct {
	Current      Cursor
	Cache        CursorCache
	LastMoved    time.Time
	Visible      bool
	ForceVisible bool
}

type DragScroll

type DragScroll struct {
	InProgress          bool
	StartX              float64
	StartY              float64
	StartHAdjustmentVal float64
	StartVAdjustmentVal float64
}

type JumpmarkCycleDirection

type JumpmarkCycleDirection int

type Jumpmarks

type Jumpmarks struct {
	// contains filtered or unexported fields
}

type JumpmarksCycle

type JumpmarksCycle struct {
	// contains filtered or unexported fields
}

type KamiteOCRImageCommandParams

type KamiteOCRImageCommandParams struct {
	BytesB64 string `json:"bytesB64"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
}
type MenuItemWithAccels struct {
	Item  *gtk.MenuItem
	Accel Accel
}
type MenuWithAccels struct {
	Menu  *gtk.Menu
	Path  string
	Items []MenuItemWithAccels
}

type NotificationLength

type NotificationLength = int
const (
	ShortNotification NotificationLength = iota
	LongNotification
)

type State

type State struct {
	BuildInfo                     BuildInfo
	GTKApplication                *gtk.Application
	Archive                       archive.Archive
	ArchivePos                    int
	ArchivePath                   string
	PixbufL, PixbufR              *gdk.Pixbuf
	GoToThumbPixbuf               *gdk.Pixbuf
	Scale                         float64
	PageCache                     *pagecache.PageCache
	ConfigDirPath                 string
	UserDataDirPath               string
	ReadLaterDirPath              string
	ImageHashes                   map[int]imgdiff.Hash
	Jumpmarks                     Jumpmarks
	Cursor                        CursorsState
	DragScroll                    DragScroll
	SmartScrollInProgress         bool
	KamiteRightClickActionPending bool
	RecentManager                 *gtk.RecentManager
	BackgroundColorCssProvider    *gtk.CssProvider
	PageCacheTrimTimeoutHandle    *glib.SourceHandle
}

type Widgets

type Widgets struct {
	MainWindow                         *gtk.ApplicationWindow `build:"MainWindow"`
	MainContainer                      *gtk.Box               `build:"MainContainer"`
	Menubar                            *gtk.MenuBar           `build:"Menubar"`
	ScrolledWindow                     *gtk.ScrolledWindow    `build:"ScrolledWindow"`
	ImageViewport                      *gtk.Viewport          `build:"ImageViewport"`
	ImageBox                           *gtk.Box               `build:"ImageBox"`
	ImageL                             *gtk.Image             `build:"ImageL"`
	ImageR                             *gtk.Image             `build:"ImageR"`
	NotificationRevealer               *gtk.Revealer          `build:"NotificationRevealer"`
	NotificationLabel                  *gtk.Label             `build:"NotificationLabel"`
	NotificationCloseButton            *gtk.Button            `build:"NotificationCloseButton"`
	MenuAbout                          *gtk.Menu              `build:"MenuAbout"`
	AboutDialog                        *gtk.AboutDialog       `build:"AboutDialog"`
	MenuFile                           *gtk.Menu              `build:"MenuFile"`
	MenuEdit                           *gtk.Menu              `build:"MenuEdit"`
	MenuView                           *gtk.Menu              `build:"MenuView"`
	MenuNavigation                     *gtk.Menu              `build:"MenuNavigation"`
	MenuBookmarks                      *gtk.Menu              `build:"MenuBookmarks"`
	MenuJumpmarks                      *gtk.Menu              `build:"MenuJumpmarks"`
	Statusbar                          *gtk.Statusbar         `build:"Statusbar"`
	MenuItemOpen                       *gtk.MenuItem          `build:"MenuItemOpen"`
	MenuItemOpenURL                    *gtk.MenuItem          `build:"MenuItemOpenURL"`
	MenuItemClose                      *gtk.MenuItem          `build:"MenuItemClose"`
	MenuItemQuit                       *gtk.MenuItem          `build:"MenuItemQuit"`
	MenuItemSaveImage                  *gtk.MenuItem          `build:"MenuItemSaveImage"`
	ArchiveFileChooserDialog           *gtk.FileChooserDialog `build:"ArchiveFileChooserDialog"`
	SaveImageFileChooserDialog         *gtk.FileChooserDialog `build:"SaveImageFileChooserDialog"`
	OpenURLDialog                      *gtk.Dialog            `build:"OpenURLDialog"`
	OpenURLDialogURLEntry              *gtk.Entry             `build:"OpenURLDialogURLEntry"`
	OpenURLDialogExplanationLabel      *gtk.Label             `build:"OpenURLDialogExplanationLabel"`
	OpenURLDialogRefererEntry          *gtk.Entry             `build:"OpenURLDialogRefererEntry"`
	Toolbar                            *gtk.Toolbar           `build:"Toolbar"`
	ButtonNextPage                     *gtk.ToolButton        `build:"ButtonNextPage"`
	ButtonPreviousPage                 *gtk.ToolButton        `build:"ButtonPreviousPage"`
	ButtonLastPage                     *gtk.ToolButton        `build:"ButtonLastPage"`
	ButtonFirstPage                    *gtk.ToolButton        `build:"ButtonFirstPage"`
	ButtonNextArchive                  *gtk.ToolButton        `build:"ButtonNextArchive"`
	ButtonPreviousArchive              *gtk.ToolButton        `build:"ButtonPreviousArchive"`
	ButtonSkipForward                  *gtk.ToolButton        `build:"ButtonSkipForward"`
	ButtonSkipBackward                 *gtk.ToolButton        `build:"ButtonSkipBackward"`
	MenuItemNextPage                   *gtk.MenuItem          `build:"MenuItemNextPage"`
	MenuItemPreviousPage               *gtk.MenuItem          `build:"MenuItemPreviousPage"`
	MenuItemLastPage                   *gtk.MenuItem          `build:"MenuItemLastPage"`
	MenuItemFirstPage                  *gtk.MenuItem          `build:"MenuItemFirstPage"`
	MenuItemNextArchive                *gtk.MenuItem          `build:"MenuItemNextArchive"`
	MenuItemPreviousArchive            *gtk.MenuItem          `build:"MenuItemPreviousArchive"`
	MenuItemSkipForward                *gtk.MenuItem          `build:"MenuItemSkipForward"`
	MenuItemSkipBackward               *gtk.MenuItem          `build:"MenuItemSkipBackward"`
	MenuItemEnlarge                    *gtk.CheckMenuItem     `build:"MenuItemEnlarge"`
	MenuItemShrink                     *gtk.CheckMenuItem     `build:"MenuItemShrink"`
	MenuItemFullscreen                 *gtk.CheckMenuItem     `build:"MenuItemFullscreen"`
	MenuItemHideUI                     *gtk.CheckMenuItem     `build:"MenuItemHideUI"`
	MenuItemSeamless                   *gtk.CheckMenuItem     `build:"MenuItemSeamless"`
	MenuItemRandom                     *gtk.CheckMenuItem     `build:"MenuItemRandom"`
	MenuItemCopyImageToClipboard       *gtk.MenuItem          `build:"MenuItemCopyImageToClipboard"`
	MenuItemPreferences                *gtk.MenuItem          `build:"MenuItemPreferences"`
	MenuItemHFlip                      *gtk.CheckMenuItem     `build:"MenuItemHFlip"`
	MenuItemVFlip                      *gtk.CheckMenuItem     `build:"MenuItemVFlip"`
	MenuItemMangaMode                  *gtk.CheckMenuItem     `build:"MenuItemMangaMode"`
	MenuItemDoublePage                 *gtk.CheckMenuItem     `build:"MenuItemDoublePage"`
	MenuItemGoTo                       *gtk.MenuItem          `build:"MenuItemGoTo"`
	MenuItemBestFit                    *gtk.RadioMenuItem     `build:"MenuItemBestFit"`
	MenuItemOriginal                   *gtk.RadioMenuItem     `build:"MenuItemOriginal"`
	MenuItemFitToWidth                 *gtk.RadioMenuItem     `build:"MenuItemFitToWidth"`
	MenuItemFitToHalfWidth             *gtk.RadioMenuItem     `build:"MenuItemFitToHalfWidth"`
	MenuItemFitToHeight                *gtk.RadioMenuItem     `build:"MenuItemFitToHeight"`
	MenuItemAbout                      *gtk.MenuItem          `build:"MenuItemAbout"`
	GoToThumbnailImage                 *gtk.Image             `build:"GoToThumbnailImage"`
	GoToDialog                         *gtk.Dialog            `build:"GoToDialog"`
	GoToSpinButton                     *gtk.SpinButton        `build:"GoToSpinButton"`
	GoToScrollbar                      *gtk.Scrollbar         `build:"GoToScrollbar"`
	PreferencesDialog                  *gtk.Dialog            `build:"PreferencesDialog"`
	BackgroundColorButton              *gtk.ColorButton       `build:"BackgroundColorButton"`
	PagesToSkipSpinButton              *gtk.SpinButton        `build:"PagesToSkipSpinButton"`
	InterpolationComboBoxText          *gtk.ComboBoxText      `build:"InterpolationComboBoxText"`
	RememberRecentCheckButton          *gtk.CheckButton       `build:"RememberRecentCheckButton"`
	RememberPositionCheckButton        *gtk.CheckButton       `build:"RememberPositionCheckButton"`
	RememberPositionHTTPCheckButton    *gtk.CheckButton       `build:"RememberPositionHTTPCheckButton"`
	OneWideCheckButton                 *gtk.CheckButton       `build:"OneWideCheckButton"`
	SmartScrollCheckButton             *gtk.CheckButton       `build:"SmartScrollCheckButton"`
	EmbeddedOrientationCheckButton     *gtk.CheckButton       `build:"EmbeddedOrientationCheckButton"`
	HideIdleCursorCheckButton          *gtk.CheckButton       `build:"HideIdleCursorCheckButton"`
	KamiteEnabledCheckButton           *gtk.CheckButton       `build:"KamiteEnabledCheckButton"`
	KamitePortContainer                *gtk.Box               `build:"KamitePortContainer"`
	KamitePortEntry                    *gtk.Entry             `build:"KamitePortEntry"`
	MenuItemAddBookmark                *gtk.MenuItem          `build:"AddBookmarkMenuItem"`
	MenuItemToggleJumpmark             *gtk.MenuItem          `build:"ToggleJumpmarkMenuItem"`
	MenuItemCycleJumpmarksBackward     *gtk.MenuItem          `build:"CycleJumpmarksBackwardMenuItem"`
	MenuItemCycleJumpmarksForward      *gtk.MenuItem          `build:"CycleJumpmarksForwardMenuItem"`
	MenuItemJumpmarksReturnFromCycling *gtk.MenuItem          `build:"JumpmarksReturnFromCyclingMenuItem"`
	RecentChooserMenu                  *gtk.RecentChooserMenu `build:"RecentChooserMenu"`
}

type ZoomMode

type ZoomMode int
const (
	FitToWidth ZoomMode = iota
	FitToHalfWidth
	FitToHeight
	BestFit
	Original
)

Directories

Path Synopsis
cmd
Package natsort provides an implementation of the natural sorting algorithm.
Package natsort provides an implementation of the natural sorting algorithm.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL