"Fossies" - the Fresh Open Source Software Archive

Member "feh-3.4.1/src/thumbnail.h" (29 May 2020, 3673 Bytes) of package /linux/privat/feh-3.4.1.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "thumbnail.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.4_vs_3.4.1.

    1 /* thumbnail.h
    2 
    3 Copyright (C) 1999-2003 Tom Gilbert.
    4 Copyright (C) 2010-2020 Daniel Friesel.
    5 
    6 Permission is hereby granted, free of charge, to any person obtaining a copy
    7 of this software and associated documentation files (the "Software"), to
    8 deal in the Software without restriction, including without limitation the
    9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   10 sell copies of the Software, and to permit persons to whom the Software is
   11 furnished to do so, subject to the following conditions:
   12 
   13 The above copyright notice and this permission notice shall be included in
   14 all copies of the Software and its documentation and acknowledgment shall be
   15 given in the documentation and software packages that this Software was
   16 used.
   17 
   18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
   21 THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
   22 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   23 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   24 
   25 */
   26 
   27 #ifndef THIMBNAIL_H
   28 #define THIMBNAIL_H
   29 
   30 #include "feh.h"
   31 #include "filelist.h"
   32 #include "winwidget.h"
   33 
   34 #define FEH_THUMB(l) ((feh_thumbnail *) l)
   35 
   36 typedef struct thumbnail {
   37     int x;
   38     int y;
   39     int w;
   40     int h;
   41     feh_file *file;
   42     unsigned char exists;
   43     struct feh_thumbnail *next;
   44 } feh_thumbnail;
   45 
   46 typedef struct thumbmode_data {
   47     Imlib_Image im_main;     /* base image which all thumbnails are rendered on */
   48     Imlib_Image im_bg;       /* background for the thumbnails */
   49 
   50     Imlib_Font font_main;    /* font used for file info */
   51     Imlib_Font font_title;   /* font used for title */
   52 
   53     int w, h, bg_w, bg_h;    /* dimensions of the window and bg image */
   54 
   55     int thumb_tot_h;         /* total space needed for a thumbnail including description */
   56     int text_area_w, text_area_h; /* space needed for thumbnail description */
   57 
   58     int max_column_w;        /* FIXME: description */
   59     int vertical;            /* == !opt.limit_w && opt.limit_h */
   60 
   61     int cache_thumbnails;    /* use cached thumbnails from ~/.thumbnails */
   62     int cache_dim;           /* 128 = 128x128 ("normal"), 256 = 256x256 ("large") */
   63     char *cache_dir;         /* "normal"/"large" (.thumbnails/...) */
   64     feh_thumbnail *selected;     /* currently selected thumbnail */
   65 
   66 } thumbmode_data;
   67 
   68 feh_thumbnail *feh_thumbnail_new(feh_file * fil, int x, int y, int w, int h);
   69 feh_file *feh_thumbnail_get_file_from_coords(int x, int y);
   70 feh_thumbnail *feh_thumbnail_get_thumbnail_from_coords(int x, int y);
   71 feh_thumbnail *feh_thumbnail_get_from_file(feh_file * file);
   72 void feh_thumbnail_mark_removed(feh_file * file, int deleted);
   73 
   74 void feh_thumbnail_calculate_geometry(void);
   75 
   76 int feh_thumbnail_get_thumbnail(Imlib_Image * image, feh_file * file, int * orig_w, int * orig_h);
   77 int feh_thumbnail_generate(Imlib_Image * image, feh_file * file, char *thumb_file, char *uri, int * orig_w, int * orig_h);
   78 int feh_thumbnail_get_generated(Imlib_Image * image, feh_file * file, char * thumb_file, int * orig_w, int * orig_h);
   79 char *feh_thumbnail_get_name(char *uri);
   80 char *feh_thumbnail_get_name_uri(char *name);
   81 char *feh_thumbnail_get_name_md5(char *uri);
   82 void feh_thumbnail_show_fullsize(feh_file *thumbfile);
   83 void feh_thumbnail_select(winwidget winwid, feh_thumbnail *thumbnail);
   84 void feh_thumbnail_select_next(winwidget winwid, int jump);
   85 void feh_thumbnail_select_prev(winwidget winwid, int jump);
   86 void feh_thumbnail_show_selected();
   87 feh_file *feh_thumbnail_get_selected_file();
   88 
   89 int feh_thumbnail_setup_thumbnail_dir(void);
   90 
   91 #endif