diff options
Diffstat (limited to 'src/winwidget.h')
-rw-r--r-- | src/winwidget.h | 140 |
1 files changed, 76 insertions, 64 deletions
diff --git a/src/winwidget.h b/src/winwidget.h index de08ec9..0894b5a 100644 --- a/src/winwidget.h +++ b/src/winwidget.h @@ -1,6 +1,7 @@ /* winwidget.h Copyright (C) 1999-2003 Tom Gilbert. +Copyright (C) 2010-2020 Birte Kristina Friesel. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -59,92 +60,103 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define PROP_MWM_HINTS_ELEMENTS 5 /* Motif window hints */ -typedef struct _mwmhints -{ - CARD32 flags; - CARD32 functions; - CARD32 decorations; - INT32 input_mode; - CARD32 status; -} -MWMHints; - -enum win_type -{ - WIN_TYPE_UNSET, WIN_TYPE_SLIDESHOW, WIN_TYPE_SINGLE, WIN_TYPE_ABOUT, - WIN_TYPE_THUMBNAIL, WIN_TYPE_THUMBNAIL_VIEWER +typedef struct _mwmhints { + unsigned long flags; + unsigned long functions; + unsigned long decorations; + long input_mode; + unsigned long status; +} MWMHints; + +enum win_type { + WIN_TYPE_UNSET, WIN_TYPE_SLIDESHOW, WIN_TYPE_SINGLE, + WIN_TYPE_THUMBNAIL, WIN_TYPE_THUMBNAIL_VIEWER }; -struct __winwidget -{ - Window win; - int x; - int y; - int w; - int h; - int im_w; - int im_h; - double im_angle; - enum win_type type; - unsigned char had_resize, full_screen; - Imlib_Image im; - GC gc; - Pixmap bg_pmap; - Pixmap bg_pmap_cache; - char *name; - gib_list *file; - unsigned char visible; - - /* Stuff for zooming */ - unsigned char mode; - - unsigned char caption_entry; /* are we in caption entry mode? */ - - /* New stuff */ - int im_x; /* image offset from window top left */ - int im_y; /* image offset from window top left */ - double zoom; /* From 0 (not visible) to 100 (actual size) - all the way up to INT_MAX (ouch) */ - int click_offset_x; - int click_offset_y; - int im_click_offset_x; - int im_click_offset_y; - - unsigned char has_rotated; +struct __winwidget { + Window win; + int x; + int y; + int w; + int h; + int im_w; + int im_h; + int force_aliasing; + double im_angle; + enum win_type type; + unsigned char had_resize, full_screen; + Imlib_Image im; + GC gc; + Pixmap bg_pmap; + Pixmap bg_pmap_cache; + char *name; + gib_list *file; + unsigned char visible; + char *errstr; + + /* panning, zooming, etc. */ + unsigned char mode; + + unsigned char caption_entry; + + /* image offset from window top left */ + int im_x; + int im_y; + + /* From 0 (not visible) to 1.00 (actual size) + * all the way up to INT_MAX (eww) + */ + double zoom; + double old_zoom; + + int click_offset_x; + int click_offset_y; + int im_click_offset_x; + int im_click_offset_y; + time_t click_start_time; + + unsigned char has_rotated; + +#ifdef HAVE_INOTIFY + int inotify_wd; +#endif }; +#ifdef HAVE_INOTIFY +void winwidget_inotify_remove(winwidget winwid); +void winwidget_inotify_add(winwidget winwid, feh_file * file); +#endif + int winwidget_loadimage(winwidget winwid, feh_file * filename); void winwidget_show(winwidget winwid); void winwidget_show_menu(winwidget winwid); void winwidget_hide(winwidget winwid); void winwidget_destroy_all(void); void winwidget_free_image(winwidget w); -void winwidget_render_image(winwidget winwid, int resize, int alias); +void winwidget_center_image(winwidget w); +void winwidget_render_image(winwidget winwid, int resize, int force_alias); void winwidget_rotate_image(winwidget winid, double angle); void winwidget_move(winwidget winwid, int x, int y); -void winwidget_resize(winwidget winwid, int w, int h); +void winwidget_resize(winwidget winwid, int w, int h, int force_resize); void winwidget_setup_pixmaps(winwidget winwid); void winwidget_update_title(winwidget ret); -void winwidget_rerender_all(int resize, int alias); +void winwidget_update_caption(winwidget winwid); +void winwidget_rerender_all(int resize); void winwidget_destroy_xwin(winwidget winwid); -int winwidget_count(void); + +void winwidget_set_pointer(winwidget winwid, int visible); void winwidget_get_geometry(winwidget winwid, int *rect); int winwidget_get_width(winwidget winwid); int winwidget_get_height(winwidget winwid); winwidget winwidget_get_from_window(Window win); -winwidget winwidget_create_from_file(gib_list * filename, char *name, - - char type); -winwidget winwidget_create_from_image(Imlib_Image im, char *name, char type); +winwidget winwidget_create_from_file(gib_list * filename, char type); +winwidget winwidget_create_from_image(Imlib_Image im, char type); void winwidget_rename(winwidget winwid, char *newname); void winwidget_destroy(winwidget winwid); void winwidget_create_window(winwidget ret, int w, int h); -void winwidget_clear_background(winwidget w); Pixmap feh_create_checks(void); -double feh_calc_needed_zoom(double *zoom, int orig_w, int orig_h, int dest_w, - - int dest_h); +double feh_calc_needed_zoom(double *zoom, int orig_w, int orig_h, int dest_w, int dest_h); void feh_debug_print_winwid(winwidget winwid); winwidget winwidget_get_first_window_of_type(unsigned int type); void winwidget_reset_image(winwidget winwid); @@ -152,7 +164,7 @@ void winwidget_sanitise_offsets(winwidget winwid); void winwidget_size_to_image(winwidget winwid); void winwidget_render_image_cached(winwidget winwid); -extern int window_num; /* For window list */ -extern winwidget *windows; /* List of windows to loop though */ +extern int window_num; /* For window list */ +extern winwidget *windows; /* List of windows to loop though */ #endif |