[prev in list] [next in list] [prev in thread] [next in thread]
List: enlightenment-svn
Subject: E CVS: feh gilbertt
From: enlightenment-cvs () lists ! sourceforge ! net
Date: 2002-01-26 16:23:16
[Download RAW message or body]
Enlightenment CVS committal
Author : gilbertt
Project : misc
Module : feh
Dir : misc/feh/src
Modified Files:
.indent.pro Makefile.am collage.c events.c feh.h filelist.c
filelist.h imlib.c index.c keyevents.c list.c menu.c
multiwindow.c options.c options.h slideshow.c structs.h
support.c thumbnail.c winwidget.c winwidget.h
Log Message:
Sat Jan 26 16:20:43 GMT 2002 Tom Gilbert <tom@linuxbrit.co.uk>
* Use giblib fontstyles for menus, instead of hardcoding the shadow.
* Let users choose menu style with --menu-style. Standard giblib
semantics.
Sat Jan 26 15:34:26 GMT 2002 Tom Gilbert <tom@linuxbrit.co.uk>
* make sure fullscreen windows are really fullscreen.
* Haha! feh uses giblib now, pointless me maintaining two list
implementations and two imlib2 wrappers. Plus now I can add fontstyles :)
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/.indent.pro,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- .indent.pro 2000/05/21 09:15:30 1.4
+++ .indent.pro 2002/01/26 16:22:45 1.5
@@ -6,19 +6,21 @@
--blank-lines-after-procedures
--no-blank-lines-after-commas
--break-before-boolean-operator
---braces-after-if-line
--brace-indent 0
---braces-after-struct-decl-line
+--braces-on-if-line
+--braces-on-struct-decl-line
--no-comment-delimiters-on-blank-lines
---dont-cuddle-else
+--cuddle-else
+--cuddle-do-while
+--break-function-decl-args
--else-endif-column 1
--space-after-cast
--declaration-indentation 2
-ndj
--dont-format-first-column-comments
--ignore-newlines
---indent-level 3
---parameter-indentation 3
+--indent-level 2
+--parameter-indentation 2
--continue-at-parentheses
--no-space-after-function-call-names
--procnames-start-lines
@@ -27,7 +29,7 @@
--comment-line-length 78
--case-indentation 2
--case-brace-indentation 0
---continuation-indentation 3
+--continuation-indentation 2
--tab-size 99
--line-length 78
---comment-indentation 45
+--comment-indentation 25
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/Makefile.am,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- Makefile.am 2001/08/13 21:34:39 1.37
+++ Makefile.am 2002/01/26 16:22:45 1.38
@@ -6,7 +6,7 @@
-I$(prefix)/include -I$(includedir) \
-I. -I$(top_srcdir)/src \
-DPREFIX=\""$(prefix)"\" \
- @IMLIB_CFLAGS@
+ @IMLIB_CFLAGS@ @GIBLIB_CFLAGS@
LIBOBJS = @LIBOBJS@
bin_PROGRAMS = feh
@@ -14,9 +14,9 @@
options.c options.h winwidget.c winwidget.h menu.c menu.h structs.h \
filelist.c filelist.h multiwindow.c imlib.c index.c slideshow.c \
utils.c utils.h keyevents.c timers.c timers.h list.c collage.c debug.h \
-events.c events.h feh_imlib2.h feh_imlib2.c support.c support.h \
-thumbnail.c thumbnail.h feh_list.c feh_list.h
-feh_LDADD = -lX11 @IMLIB_LIBS@
+events.c events.h support.c support.h \
+thumbnail.c thumbnail.h
+feh_LDADD = -lX11 @IMLIB_LIBS@ @GIBLIB_LIBS@
images_DATA = about.png menubg.png menubg_chrome.png menubg_brushed.png \
menubg_pastel.png menubg_aluminium.png menubg_aqua.png \
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/collage.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- collage.c 2001/08/09 22:59:10 1.27
+++ collage.c 2002/01/26 16:22:45 1.28
@@ -25,7 +25,7 @@
#include "feh.h"
#include "winwidget.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "options.h"
@@ -41,7 +41,7 @@
Imlib_Image bg_im = NULL, im_thumb = NULL;
feh_file *file = NULL;
unsigned char trans_bg = 0;
- feh_list *l, *last = NULL;
+ gib_list *l, *last = NULL;
int file_num = 0;
char *s;
@@ -49,7 +49,7 @@
mode = "collage";
- file_num = feh_list_length(filelist);
+ file_num = gib_list_length(filelist);
/* Use bg image dimensions for default size */
if (opt.bg && opt.bg_file)
@@ -62,8 +62,8 @@
D(4,("Time to apply a background to blend onto\n"));
if (feh_load_image_char(&bg_im, opt.bg_file) != 0)
{
- bg_w = feh_imlib_image_get_width(bg_im);
- bg_h = feh_imlib_image_get_height(bg_im);
+ bg_w = gib_imlib_image_get_width(bg_im);
+ bg_h = gib_imlib_image_get_height(bg_im);
}
}
}
@@ -102,18 +102,18 @@
eprintf("Imlib error creating image");
if (bg_im)
- feh_imlib_blend_image_onto_image(im_main, bg_im,
- feh_imlib_image_has_alpha(bg_im), 0, 0,
+ gib_imlib_blend_image_onto_image(im_main, bg_im,
+ gib_imlib_image_has_alpha(bg_im), 0, 0,
bg_w, bg_h, 0, 0, w, h, 1, 0, 0);
else if (trans_bg)
{
- feh_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 0);
- feh_imlib_image_set_has_alpha(im_main, 1);
+ gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 0);
+ gib_imlib_image_set_has_alpha(im_main, 1);
}
else
{
/* Colour the background */
- feh_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 255);
+ gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 255);
}
/* Create the title string */
@@ -147,8 +147,8 @@
feh_display_status('.');
www = opt.thumb_w;
hhh = opt.thumb_h;
- ww = feh_imlib_image_get_width(im_temp);
- hh = feh_imlib_image_get_height(im_temp);
+ ww = gib_imlib_image_get_width(im_temp);
+ hh = gib_imlib_image_get_height(im_temp);
if (opt.aspect)
{
@@ -176,28 +176,28 @@
D(5,("image going on at x=%d, y=%d\n", xxx, yyy));
im_thumb =
- feh_imlib_create_cropped_scaled_image(im_temp, 0, 0, ww, hh, www,
+ gib_imlib_create_cropped_scaled_image(im_temp, 0, 0, ww, hh, www,
hhh, 1);
- feh_imlib_free_image_and_decache(im_temp);
+ gib_imlib_free_image_and_decache(im_temp);
if (opt.alpha)
{
DATA8 atab[256];
D(4,("Applying alpha options\n"));
- feh_imlib_image_set_has_alpha(im_thumb, 1);
+ gib_imlib_image_set_has_alpha(im_thumb, 1);
memset(atab, opt.alpha_level, sizeof(atab));
- feh_imlib_apply_color_modifier_to_rectangle(im_thumb, 0, 0, www,
+ gib_imlib_apply_color_modifier_to_rectangle(im_thumb, 0, 0, www,
hhh, NULL, NULL, NULL,
atab);
}
- feh_imlib_blend_image_onto_image(im_main, im_thumb,
- feh_imlib_image_has_alpha(im_thumb),
+ gib_imlib_blend_image_onto_image(im_main, im_thumb,
+ gib_imlib_image_has_alpha(im_thumb),
0, 0, www, hhh, xxx, yyy, www, hhh,
1,
- feh_imlib_image_has_alpha(im_thumb),
+ gib_imlib_image_has_alpha(im_thumb),
0);
- feh_imlib_free_image_and_decache(im_thumb);
+ gib_imlib_free_image_and_decache(im_thumb);
}
else
{
@@ -222,13 +222,13 @@
snprintf(output_buf,1024,"%s/%S", opt.output_dir, opt.output_file);
else
strncpy(output_buf,opt.output_file, 1024);
- feh_imlib_save_image(im_main, output_buf);
+ gib_imlib_save_image(im_main, output_buf);
if (opt.verbose)
{
int tw, th;
- tw = feh_imlib_image_get_width(im_main);
- th = feh_imlib_image_get_height(im_main);
+ tw = gib_imlib_image_get_width(im_main);
+ th = gib_imlib_image_get_height(im_main);
fprintf(stdout, PACKAGE " - File saved as %s\n", output_buf);
fprintf(stdout,
" - Image is %dx%d pixels and contains %d thumbnails\n",
@@ -237,7 +237,7 @@
}
if (!opt.display)
- feh_imlib_free_image_and_decache(im_main);
+ gib_imlib_free_image_and_decache(im_main);
free(s);
D_RETURN_(4);
}
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/events.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- events.c 2002/01/06 01:17:43 1.59
+++ events.c 2002/01/26 16:22:45 1.60
@@ -24,7 +24,7 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "winwidget.h"
#include "timers.h"
@@ -340,7 +340,7 @@
if (!thumbwin)
{
thumbwin =
- winwidget_create_from_file(feh_list_add_front
+ winwidget_create_from_file(gib_list_add_front
(NULL, thumbfile), s,
WIN_TYPE_THUMBNAIL_VIEWER);
winwidget_show(thumbwin);
@@ -348,7 +348,7 @@
else if (FEH_FILE(thumbwin->file->data) != thumbfile)
{
free(thumbwin->file);
- thumbwin->file = feh_list_add_front(NULL, thumbfile);
+ thumbwin->file = gib_list_add_front(NULL, thumbfile);
winwidget_rename(thumbwin, s);
feh_reload_image(thumbwin, 1);
}
@@ -591,10 +591,10 @@
{
Imlib_Image temp;
- temp = feh_imlib_create_rotated_image(winwid->im, 0.0);
- winwid->im_w = feh_imlib_image_get_width(temp);
- winwid->im_h = feh_imlib_image_get_height(temp);
- feh_imlib_free_image_and_decache(temp);
+ temp = gib_imlib_create_rotated_image(winwid->im, 0.0);
+ winwid->im_w = gib_imlib_image_get_width(temp);
+ winwid->im_h = gib_imlib_image_get_height(temp);
+ gib_imlib_free_image_and_decache(temp);
if (!winwid->full_screen && !opt.geom)
winwidget_resize(winwid, winwid->im_w, winwid->im_h);
winwid->has_rotated = 1;
@@ -618,17 +618,17 @@
D(5, ("Blurring\n"));
- temp = feh_imlib_clone_image(winwid->im);
+ temp = gib_imlib_clone_image(winwid->im);
blur_radius = (((double) ev->xmotion.x / winwid->w) * 20) - 10;
D(5, ("angle: %d\n", blur_radius));
if (blur_radius > 0)
- feh_imlib_image_sharpen(temp, blur_radius);
+ gib_imlib_image_sharpen(temp, blur_radius);
else
- feh_imlib_image_blur(temp, 0 - blur_radius);
+ gib_imlib_image_blur(temp, 0 - blur_radius);
ptr = winwid->im;
winwid->im = temp;
winwidget_render_image(winwid, 0, 0);
- feh_imlib_free_image_and_decache(winwid->im);
+ gib_imlib_free_image_and_decache(winwid->im);
winwid->im = ptr;
}
}
@@ -647,12 +647,12 @@
x = ev->xmotion.x - winwid->im_x;
y = ev->xmotion.y - winwid->im_y;
orig_im = winwid->im;
- winwid->im = feh_imlib_clone_image(orig_im);
+ winwid->im = gib_imlib_clone_image(orig_im);
imlib_context_set_image(winwid->im);
imlib_apply_filter("bump_map_point(x=[],y=[],map=" PREFIX
"/share/feh/images/about.png);", &x, &y);
winwidget_render_image(winwid, 0, 1);
- feh_imlib_free_image_and_decache(winwid->im);
+ gib_imlib_free_image_and_decache(winwid->im);
winwid->im = orig_im;
}
else if (winwid->type == WIN_TYPE_THUMBNAIL)
@@ -671,27 +671,27 @@
Imlib_Image origwin;
origwin = winwid->im;
- winwid->im = feh_imlib_clone_image(origwin);
- feh_imlib_image_fill_rectangle(winwid->im, thumbnail->x,
+ winwid->im = gib_imlib_clone_image(origwin);
+ gib_imlib_image_fill_rectangle(winwid->im, thumbnail->x,
thumbnail->y, thumbnail->w,
thumbnail->h, 50, 50, 255,
100);
- feh_imlib_image_draw_rectangle(winwid->im, thumbnail->x,
+ gib_imlib_image_draw_rectangle(winwid->im, thumbnail->x,
thumbnail->y, thumbnail->w,
thumbnail->h, 255, 255, 255,
255);
- feh_imlib_image_draw_rectangle(winwid->im, thumbnail->x + 1,
+ gib_imlib_image_draw_rectangle(winwid->im, thumbnail->x + 1,
thumbnail->y + 1,
thumbnail->w - 2,
thumbnail->h - 2, 0, 0, 0,
255);
- feh_imlib_image_draw_rectangle(winwid->im, thumbnail->x + 2,
+ gib_imlib_image_draw_rectangle(winwid->im, thumbnail->x + 2,
thumbnail->y + 2,
thumbnail->w - 4,
thumbnail->h - 4, 255, 255,
255, 255);
winwidget_render_image(winwid, 0, 1);
- feh_imlib_free_image_and_decache(winwid->im);
+ gib_imlib_free_image_and_decache(winwid->im);
winwid->im = origwin;
}
else
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/feh.h,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -3 -r1.116 -r1.117
--- feh.h 2002/01/26 14:12:34 1.116
+++ feh.h 2002/01/26 16:22:45 1.117
@@ -47,10 +47,10 @@
#include <signal.h>
#include <sys/wait.h>
#include <Imlib2.h>
+#include <giblib/giblib.h>
#include "config.h"
#include "structs.h"
-#include "feh_imlib2.h"
#include "menu.h"
#include "utils.h"
@@ -84,8 +84,6 @@
{ SLIDE_NEXT, SLIDE_PREV, SLIDE_FIRST, SLIDE_LAST, SLIDE_JUMP_FWD,
SLIDE_JUMP_BACK
};
-enum direction
-{ FORWARD, BACK };
typedef void (*sighandler_t) (int);
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/filelist.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- filelist.c 2001/08/11 00:26:57 1.67
+++ filelist.c 2002/01/26 16:22:45 1.68
@@ -24,17 +24,17 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "options.h"
-feh_list *filelist = NULL;
-feh_list *current_file = NULL;
+gib_list *filelist = NULL;
+gib_list *current_file = NULL;
extern int errno;
int file_num = 0;
-static feh_list *rm_filelist = NULL;
+static gib_list *rm_filelist = NULL;
feh_file *
feh_file_new(char *filename)
@@ -105,20 +105,20 @@
D_RETURN_(4);
}
-feh_list *
-feh_file_rm_and_free(feh_list * list, feh_list * l)
+gib_list *
+feh_file_rm_and_free(gib_list * list, gib_list * l)
{
D_ENTER(4);
unlink(FEH_FILE(l->data)->filename);
D_RETURN(4, feh_file_remove_from_list(list, l));
}
-feh_list *
-feh_file_remove_from_list(feh_list * list, feh_list * l)
+gib_list *
+feh_file_remove_from_list(gib_list * list, gib_list * l)
{
D_ENTER(4);
feh_file_free(FEH_FILE(l->data));
- D_RETURN(4, feh_list_remove(list, l));
+ D_RETURN(4, gib_list_remove(list, l));
}
/* Recursive */
@@ -148,7 +148,7 @@
{
/* Its a url */
D(3, ("Adding url %s to filelist\n", path));
- filelist = feh_list_add_front(filelist, feh_file_new(path));
+ filelist = gib_list_add_front(filelist, feh_file_new(path));
/* We'll download it later... */
free(path);
D_RETURN_(5);
@@ -231,7 +231,7 @@
else if (S_ISREG(st.st_mode))
{
D(5, ("Adding regular file %s to filelist\n", path));
- filelist = feh_list_add_front(filelist, feh_file_new(path));
+ filelist = gib_list_add_front(filelist, feh_file_new(path));
}
free(path);
D_RETURN_(5);
@@ -241,14 +241,14 @@
add_file_to_rm_filelist(char *file)
{
D_ENTER(4);
- rm_filelist = feh_list_add_front(rm_filelist, feh_file_new(file));
+ rm_filelist = gib_list_add_front(rm_filelist, feh_file_new(file));
D_RETURN_(4);
}
void
delete_rm_files(void)
{
- feh_list *l;
+ gib_list *l;
D_ENTER(4);
for (l = rm_filelist; l; l = l->next)
@@ -256,12 +256,12 @@
D_RETURN_(4);
}
-feh_list *
-feh_file_info_preload(feh_list * list)
+gib_list *
+feh_file_info_preload(gib_list * list)
{
- feh_list *l;
+ gib_list *l;
feh_file *file = NULL;
- feh_list *remove_list = NULL;
+ gib_list *remove_list = NULL;
D_ENTER(4);
if (opt.verbose)
@@ -275,7 +275,7 @@
if (feh_file_info_load(file, NULL))
{
D(3, ("Failed to load file %p\n", file));
- remove_list = feh_list_add_front(remove_list, l);
+ remove_list = gib_list_add_front(remove_list, l);
if (opt.verbose)
feh_display_status('x');
}
@@ -288,9 +288,9 @@
if (remove_list)
{
for (l = remove_list; l; l = l->next)
- filelist = list = feh_list_remove(list, (feh_list *) l->data);
+ filelist = list = gib_list_remove(list, (gib_list *) l->data);
- feh_list_free(remove_list);
+ gib_list_free(remove_list);
}
D_RETURN(4, list);
@@ -349,19 +349,19 @@
file->info = feh_file_info_new();
- file->info->width = feh_imlib_image_get_width(im1);
- file->info->height = feh_imlib_image_get_height(im1);
+ file->info->width = gib_imlib_image_get_width(im1);
+ file->info->height = gib_imlib_image_get_height(im1);
- file->info->has_alpha = feh_imlib_image_has_alpha(im1);
+ file->info->has_alpha = gib_imlib_image_has_alpha(im1);
file->info->pixels = file->info->width * file->info->height;
- file->info->format = estrdup(feh_imlib_image_format(im1));
+ file->info->format = estrdup(gib_imlib_image_format(im1));
file->info->size = st.st_size;
if (need_free && im1)
- feh_imlib_free_image_and_decache(im1);
+ gib_imlib_free_image_and_decache(im1);
D_RETURN(4, 0);
}
@@ -427,7 +427,7 @@
{
/* For these sort options, we have to preload images */
filelist = feh_file_info_preload(filelist);
- if (!feh_list_length(filelist))
+ if (!gib_list_length(filelist))
show_mini_usage();
}
@@ -438,34 +438,34 @@
if (opt.randomize)
{
/* Randomize the filename order */
- filelist = feh_list_randomize(filelist);
+ filelist = gib_list_randomize(filelist);
}
else if (!opt.reverse)
{
/* Let's reverse the list. Its back-to-front right now ;) */
- filelist = feh_list_reverse(filelist);
+ filelist = gib_list_reverse(filelist);
}
break;
case SORT_NAME:
- filelist = feh_list_sort(filelist, feh_cmp_name);
+ filelist = gib_list_sort(filelist, feh_cmp_name);
break;
case SORT_FILENAME:
- filelist = feh_list_sort(filelist, feh_cmp_filename);
+ filelist = gib_list_sort(filelist, feh_cmp_filename);
break;
case SORT_WIDTH:
- filelist = feh_list_sort(filelist, feh_cmp_width);
+ filelist = gib_list_sort(filelist, feh_cmp_width);
break;
case SORT_HEIGHT:
- filelist = feh_list_sort(filelist, feh_cmp_height);
+ filelist = gib_list_sort(filelist, feh_cmp_height);
break;
case SORT_PIXELS:
- filelist = feh_list_sort(filelist, feh_cmp_pixels);
+ filelist = gib_list_sort(filelist, feh_cmp_pixels);
break;
case SORT_SIZE:
- filelist = feh_list_sort(filelist, feh_cmp_size);
+ filelist = gib_list_sort(filelist, feh_cmp_size);
break;
case SORT_FORMAT:
- filelist = feh_list_sort(filelist, feh_cmp_format);
+ filelist = gib_list_sort(filelist, feh_cmp_format);
break;
default:
break;
@@ -475,17 +475,17 @@
if (opt.reverse && (opt.sort != SORT_NONE))
{
D(3, ("Reversing filelist as requested\n"));
- filelist = feh_list_reverse(filelist);
+ filelist = gib_list_reverse(filelist);
}
D_RETURN_(4);
}
int
-feh_write_filelist(feh_list * list, char *filename)
+feh_write_filelist(gib_list * list, char *filename)
{
FILE *fp;
- feh_list *l;
+ gib_list *l;
D_ENTER(4);
@@ -507,11 +507,11 @@
D_RETURN(4, 1);
}
-feh_list *
+gib_list *
feh_read_filelist(char *filename)
{
FILE *fp;
- feh_list *list = NULL;
+ gib_list *list = NULL;
char s[1024], s1[1024];
D_ENTER(4);
@@ -536,7 +536,7 @@
continue;
D(5, ("Got filename %s from filelist file\n", s1));
/* Add it to the new list */
- list = feh_list_add_front(list, feh_file_new(s1));
+ list = gib_list_add_front(list, feh_file_new(s1));
}
fclose(fp);
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/filelist.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- filelist.h 2001/08/11 00:26:57 1.12
+++ filelist.h 2002/01/26 16:22:45 1.13
@@ -60,17 +60,17 @@
void feh_file_free(feh_file * file);
feh_file_info *feh_file_info_new(void);
void feh_file_info_free(feh_file_info * info);
-feh_list *feh_file_rm_and_free(feh_list * list, feh_list * file);
+gib_list *feh_file_rm_and_free(gib_list * list, gib_list * file);
void add_file_to_filelist_recursively(char *origpath, unsigned char level);
void add_file_to_rm_filelist(char *file);
void delete_rm_files(void);
-feh_list *feh_file_info_preload(feh_list * list);
+gib_list *feh_file_info_preload(gib_list * list);
int feh_file_info_load(feh_file * file, Imlib_Image im);
void feh_prepare_filelist(void);
-int feh_write_filelist(feh_list * list, char *filename);
-feh_list *feh_read_filelist(char *filename);
+int feh_write_filelist(gib_list * list, char *filename);
+gib_list *feh_read_filelist(char *filename);
char *feh_absolute_path(char *path);
-feh_list *feh_file_remove_from_list(feh_list * list, feh_list * l);
+gib_list *feh_file_remove_from_list(gib_list * list, gib_list * l);
void feh_save_filelist();
int feh_cmp_name(void *file1, void *file2);
@@ -81,7 +81,7 @@
int feh_cmp_size(void *file1, void *file2);
int feh_cmp_format(void *file1, void *file2);
-extern feh_list *filelist;
-extern feh_list *current_file;
+extern gib_list *filelist;
+extern gib_list *current_file;
#endif
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/imlib.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- imlib.c 2002/01/26 14:12:34 1.136
+++ imlib.c 2002/01/26 16:22:45 1.137
@@ -24,7 +24,7 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "winwidget.h"
#include "options.h"
@@ -614,7 +614,7 @@
D_RETURN_(4);
if (!fn)
- fn = feh_imlib_load_font(DEFAULT_FONT);
+ fn = gib_imlib_load_font(DEFAULT_FONT);
if (!fn)
{
@@ -626,7 +626,7 @@
(int) (w->im_w * w->zoom), (int) (w->im_h * w->zoom));
/* Work out how high the font is */
- feh_imlib_get_text_size(fn, buf, &tw, &th, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_get_text_size(fn, buf, NULL, &tw, &th, IMLIB_TEXT_TO_RIGHT);
tw += 2;
th += 2;
@@ -634,14 +634,14 @@
if (!im)
eprintf("Couldn't create image. Out of memory?");
- feh_imlib_image_fill_rectangle(im, 0, 0, tw, th, 0, 0, 0, 255);
+ gib_imlib_image_fill_rectangle(im, 0, 0, tw, th, 0, 0, 0, 255);
- feh_imlib_text_draw(im, fn, 1, 1, buf, IMLIB_TEXT_TO_RIGHT, 255, 255, 255,
+ gib_imlib_text_draw(im, fn, NULL, 1, 1, buf, IMLIB_TEXT_TO_RIGHT, 255, 255, 255,
255);
- feh_imlib_render_image_on_drawable(w->bg_pmap, im, 0, w->h - th, 1, 0, 0);
+ gib_imlib_render_image_on_drawable(w->bg_pmap, im, 0, w->h - th, 1, 0, 0);
- feh_imlib_free_image_and_decache(im);
+ gib_imlib_free_image_and_decache(im);
D_RETURN_(4);
}
@@ -661,9 +661,9 @@
if (!fn)
{
if (w->full_screen)
- fn = feh_imlib_load_font(DEFAULT_FONT_BIG);
+ fn = gib_imlib_load_font(DEFAULT_FONT_BIG);
else
- fn = feh_imlib_load_font(DEFAULT_FONT);
+ fn = gib_imlib_load_font(DEFAULT_FONT);
}
if (!fn)
@@ -673,7 +673,7 @@
}
/* Work out how high the font is */
- feh_imlib_get_text_size(fn, FEH_FILE(w->file->data)->filename, &tw, &th,
+ gib_imlib_get_text_size(fn, FEH_FILE(w->file->data)->filename, NULL, &tw, &th,
IMLIB_TEXT_TO_RIGHT);
tw += 2;
@@ -682,14 +682,14 @@
if (!im)
eprintf("Couldn't create image. Out of memory?");
- feh_imlib_image_fill_rectangle(im, 0, 0, tw, th, 0, 0, 0, 255);
+ gib_imlib_image_fill_rectangle(im, 0, 0, tw, th, 0, 0, 0, 255);
- feh_imlib_text_draw(im, fn, 1, 1, FEH_FILE(w->file->data)->filename,
+ gib_imlib_text_draw(im, fn, NULL, 1, 1, FEH_FILE(w->file->data)->filename,
IMLIB_TEXT_TO_RIGHT, 255, 255, 255, 255);
- feh_imlib_render_image_on_drawable(w->bg_pmap, im, 0, 0, 1, 0, 0);
+ gib_imlib_render_image_on_drawable(w->bg_pmap, im, 0, 0, 1, 0, 0);
- feh_imlib_free_image_and_decache(im);
+ gib_imlib_free_image_and_decache(im);
D_RETURN_(4);
}
@@ -707,7 +707,7 @@
D(5, ("filelist %p, filelist->next %p\n", filelist, filelist->next));
if (!init_len)
- init_len = feh_list_length(filelist);
+ init_len = gib_list_length(filelist);
if (i)
{
@@ -723,7 +723,7 @@
int len;
char buf[50];
- len = feh_list_length(filelist);
+ len = gib_list_length(filelist);
snprintf(buf, sizeof(buf), " %5d/%d (%d)\n[%3d%%] ", i, init_len,
len, ((int) ((float) i / init_len * 100)));
fprintf(stdout, buf);
@@ -753,9 +753,9 @@
ret = feh_load_image(&old, FEH_FILE(w->file->data));
if(ret) {
- feh_imlib_image_orientate(old, orientation);
- feh_imlib_save_image(old, FEH_FILE(w->file->data)->filename);
- feh_imlib_free_image(old);
+ gib_imlib_image_orientate(old, orientation);
+ gib_imlib_save_image(old, FEH_FILE(w->file->data)->filename);
+ gib_imlib_free_image(old);
feh_reload_image(w, 1);
} else {
wprintf("failed to load image from disk to edit it in place\n");
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/index.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- index.c 2002/01/26 14:12:34 1.59
+++ index.c 2002/01/26 16:22:45 1.60
@@ -24,7 +24,7 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "winwidget.h"
#include "options.h"
@@ -56,7 +56,7 @@
int vertical = 0;
int max_column_w = 0;
int thumbnailcount = 0;
- feh_list *l = NULL, *last = NULL;
+ gib_list *l = NULL, *last = NULL;
feh_file *file = NULL;
int file_num = 0, lines;
unsigned char trans_bg = 0;
@@ -64,32 +64,32 @@
int x_offset_name = 0, x_offset_dim = 0, x_offset_size = 0;
char *s;
- file_num = feh_list_length(filelist);
+ file_num = gib_list_length(filelist);
D_ENTER(3);
mode = "index";
- fn = feh_imlib_load_font(opt.font);
+ fn = gib_imlib_load_font(opt.font);
if (opt.title_font)
{
int fh, fw;
- title_fn = feh_imlib_load_font(opt.title_font);
+ title_fn = gib_imlib_load_font(opt.title_font);
if (!fn)
- title_fn = feh_imlib_load_font(DEFAULT_FONT_TITLE);
- feh_imlib_get_text_size(title_fn, "W", &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ title_fn = gib_imlib_load_font(DEFAULT_FONT_TITLE);
+ gib_imlib_get_text_size(title_fn, "W", NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
title_area_h = fh + 4;
}
else
- title_fn = feh_imlib_load_font(DEFAULT_FONT_TITLE);
+ title_fn = gib_imlib_load_font(DEFAULT_FONT_TITLE);
if ((!fn) || (!title_fn))
eprintf("Error loading fonts");
/* Work out how tall the font is */
- feh_imlib_get_text_size(fn, "W", &tw, &th, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_get_text_size(fn, "W", NULL, &tw, &th, IMLIB_TEXT_TO_RIGHT);
/* For now, allow room for the right number of lines with small gaps */
text_area_h =
((th + 2) * (opt.index_show_name + opt.index_show_size +
@@ -108,8 +108,8 @@
D(3, ("Time to apply a background to blend onto\n"));
if (feh_load_image_char(&bg_im, opt.bg_file) != 0)
{
- bg_w = feh_imlib_image_get_width(bg_im);
- bg_h = feh_imlib_image_get_height(bg_im);
+ bg_w = gib_imlib_image_get_width(bg_im);
+ bg_h = gib_imlib_image_get_height(bg_im);
}
}
}
@@ -161,24 +161,24 @@
text_area_w = opt.thumb_w;
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_dimension_string(1000, 1000),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
@@ -216,24 +216,24 @@
/* Calc width of text */
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_dimension_string(1000, 1000),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
@@ -266,24 +266,24 @@
text_area_w = opt.thumb_w;
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_dimension_string(1000, 1000),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
@@ -312,19 +312,19 @@
eprintf("Imlib error creating index image, are you low on RAM?");
if (bg_im)
- feh_imlib_blend_image_onto_image(im_main, bg_im,
- feh_imlib_image_has_alpha(bg_im), 0, 0,
+ gib_imlib_blend_image_onto_image(im_main, bg_im,
+ gib_imlib_image_has_alpha(bg_im), 0, 0,
bg_w, bg_h, 0, 0, w, h, 1, 0, 0);
else if (trans_bg)
{
- feh_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
+ gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
0, 0);
- feh_imlib_image_set_has_alpha(im_main, 1);
+ gib_imlib_image_set_has_alpha(im_main, 1);
}
else
{
/* Colour the background */
- feh_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
+ gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
0, 255);
}
@@ -357,8 +357,8 @@
D(4, ("Successfully loaded %s\n", file->filename));
www = opt.thumb_w;
hhh = opt.thumb_h;
- ww = feh_imlib_image_get_width(im_temp);
- hh = feh_imlib_image_get_height(im_temp);
+ ww = gib_imlib_image_get_width(im_temp);
+ hh = gib_imlib_image_get_height(im_temp);
thumbnailcount++;
if (opt.aspect)
@@ -382,18 +382,18 @@
}
im_thumb =
- feh_imlib_create_cropped_scaled_image(im_temp, 0, 0, ww, hh, www,
+ gib_imlib_create_cropped_scaled_image(im_temp, 0, 0, ww, hh, www,
hhh, 1);
- feh_imlib_free_image_and_decache(im_temp);
+ gib_imlib_free_image_and_decache(im_temp);
if (opt.alpha)
{
DATA8 atab[256];
D(3, ("Applying alpha options\n"));
- feh_imlib_image_set_has_alpha(im_thumb, 1);
+ gib_imlib_image_set_has_alpha(im_thumb, 1);
memset(atab, opt.alpha_level, sizeof(atab));
- feh_imlib_apply_color_modifier_to_rectangle(im_thumb, 0, 0, www,
+ gib_imlib_apply_color_modifier_to_rectangle(im_thumb, 0, 0, www,
hhh, NULL, NULL, NULL,
atab);
}
@@ -402,23 +402,23 @@
/* Now draw on the info text */
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw_name, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw_name, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw_name > text_area_w)
text_area_w = fw_name;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn, create_index_dimension_string(ww, hh),
- &fw_dim, &fh, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_get_text_size(fn, create_index_dimension_string(ww, hh),
+ NULL, &fw_dim, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw_dim > text_area_w)
text_area_w = fw_dim;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw_size, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw_size, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw_size > text_area_w)
text_area_w = fw_size;
}
@@ -467,28 +467,28 @@
}
/* Draw now */
- feh_imlib_blend_image_onto_image(im_main, im_thumb,
- feh_imlib_image_has_alpha(im_thumb),
+ gib_imlib_blend_image_onto_image(im_main, im_thumb,
+ gib_imlib_image_has_alpha(im_thumb),
0, 0, www, hhh, xxx, yyy, www, hhh,
1,
- feh_imlib_image_has_alpha(im_thumb),
+ gib_imlib_image_has_alpha(im_thumb),
0);
- feh_imlib_free_image_and_decache(im_thumb);
+ gib_imlib_free_image_and_decache(im_thumb);
lines = 0;
if (opt.index_show_name)
- feh_imlib_text_draw(im_main, fn, x + x_offset_name,
+ gib_imlib_text_draw(im_main, fn, NULL, x + x_offset_name,
y + opt.thumb_h + (lines++ * (th + 2)) + 2,
file->name, IMLIB_TEXT_TO_RIGHT, 255, 255,
255, 255);
if (opt.index_show_dim)
- feh_imlib_text_draw(im_main, fn, x + x_offset_dim,
+ gib_imlib_text_draw(im_main, fn, NULL, x + x_offset_dim,
y + opt.thumb_h + (lines++ * (th + 2)) + 2,
create_index_dimension_string(ww, hh),
IMLIB_TEXT_TO_RIGHT, 255, 255, 255, 255);
if (opt.index_show_size)
- feh_imlib_text_draw(im_main, fn, x + x_offset_size,
+ gib_imlib_text_draw(im_main, fn, NULL, x + x_offset_size,
y + opt.thumb_h + (lines++ * (th + 2)) + 2,
create_index_size_string(file->filename),
IMLIB_TEXT_TO_RIGHT, 255, 255, 255, 255);
@@ -521,10 +521,10 @@
char *s;
s = create_index_title_string(thumbnailcount, w, h);
- feh_imlib_get_text_size(title_fn, s, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_get_text_size(title_fn, s, NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
fx = (index_image_width - fw) >> 1;
fy = index_image_height - fh - 2;
- feh_imlib_text_draw(im_main, title_fn, fx, fy, s, IMLIB_TEXT_TO_RIGHT,
+ gib_imlib_text_draw(im_main, title_fn, NULL, fx, fy, s, IMLIB_TEXT_TO_RIGHT,
255, 255, 255, 255);
}
@@ -537,13 +537,13 @@
else
strncpy(output_buf, opt.output_file, 1024);
- feh_imlib_save_image(im_main, output_buf);
+ gib_imlib_save_image(im_main, output_buf);
if (opt.verbose)
{
int tw, th;
- tw = feh_imlib_image_get_width(im_main);
- th = feh_imlib_image_get_height(im_main);
+ tw = gib_imlib_image_get_width(im_main);
+ th = gib_imlib_image_get_height(im_main);
fprintf(stdout, PACKAGE " - File saved as %s\n", output_buf);
fprintf(stdout,
" - Image is %dx%d pixels and contains %d thumbnails\n",
@@ -552,7 +552,7 @@
}
if (!opt.display)
- feh_imlib_free_image_and_decache(im_main);
+ gib_imlib_free_image_and_decache(im_main);
free(s);
D_RETURN_(3);
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/keyevents.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- keyevents.c 2002/01/06 01:39:30 1.39
+++ keyevents.c 2002/01/26 16:22:45 1.40
@@ -24,7 +24,7 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "thumbnail.h"
#include "filelist.h"
#include "winwidget.h"
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/list.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- list.c 2001/09/04 22:48:11 1.27
+++ list.c 2002/01/26 16:22:45 1.28
@@ -24,14 +24,14 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "options.h"
void
init_list_mode(void)
{
- feh_list *l;
+ gib_list *l;
feh_file *file = NULL;
int j = 0;
@@ -82,7 +82,7 @@
real_loadables_mode(int loadable)
{
feh_file *file;
- feh_list *l;
+ gib_list *l;
D_ENTER(4);
opt.quiet = 1;
@@ -102,7 +102,7 @@
if (opt.action)
feh_action_run(file);
}
- feh_imlib_free_image_and_decache(im);
+ gib_imlib_free_image_and_decache(im);
}
else
{
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/menu.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- menu.c 2002/01/06 01:39:30 1.48
+++ menu.c 2002/01/26 16:22:45 1.49
@@ -25,7 +25,7 @@
#include "feh.h"
#include "support.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "thumbnail.h"
#include "winwidget.h"
#include "filelist.h"
@@ -43,21 +43,39 @@
static feh_menu_list *menus = NULL;
static int common_menus = 0;
-static void feh_menu_cb_about(feh_menu * m, feh_menu_item * i, void *data);
-static void feh_menu_cb_close(feh_menu * m, feh_menu_item * i, void *data);
-static void feh_menu_cb_exit(feh_menu * m, feh_menu_item * i, void *data);
-static void feh_menu_cb_reload(feh_menu * m, feh_menu_item * i, void *data);
-static void feh_menu_cb_remove(feh_menu * m, feh_menu_item * i, void *data);
-static void feh_menu_cb_delete(feh_menu * m, feh_menu_item * i, void *data);
-static void feh_menu_cb_reset(feh_menu * m, feh_menu_item * i, void *data);
+static void feh_menu_cb_about(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static void feh_menu_cb_close(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static void feh_menu_cb_exit(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static void feh_menu_cb_reload(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static void feh_menu_cb_remove(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static void feh_menu_cb_delete(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static void feh_menu_cb_reset(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
-static void feh_menu_cb_remove_thumb(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_remove_thumb(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_delete_thumb(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_delete_thumb(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_background_set_tiled(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_background_set_tiled(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_background_set_scaled(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_background_set_scaled(feh_menu * m,
+ feh_menu_item * i,
void *data);
static void feh_menu_cb_background_set_seamless(feh_menu * m,
feh_menu_item * i,
@@ -75,1694 +93,1742 @@
feh_menu_item * i,
void *data);
-static void feh_menu_cb_sort_filename(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_sort_filename(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_sort_imagename(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_sort_imagename(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_sort_filesize(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_sort_filesize(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_sort_randomize(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_sort_randomize(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_jump_to(feh_menu * m, feh_menu_item * i, void *data);
-static feh_menu *feh_menu_func_gen_jump(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_jump_to(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static feh_menu *feh_menu_func_gen_jump(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static feh_menu *feh_menu_func_gen_info(feh_menu * m, feh_menu_item * i,
+static feh_menu *feh_menu_func_gen_info(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_func_free_info(feh_menu * m, void *data);
-static void feh_menu_cb_save_image(feh_menu * m, feh_menu_item * i,
+static void feh_menu_func_free_info(feh_menu * m,
+ void *data);
+static void feh_menu_cb_save_image(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_save_filelist(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_save_filelist(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_fit(feh_menu * m, feh_menu_item * i, void *data);
-static void feh_menu_cb_opt_draw_filename(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_fit(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
+static void feh_menu_cb_opt_draw_filename(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_opt_keep_http(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_opt_keep_http(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_opt_freeze_window(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_opt_freeze_window(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_cb_opt_fullscreen(feh_menu * m, feh_menu_item * i,
+static void feh_menu_cb_opt_fullscreen(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void feh_menu_func_free_options(feh_menu * m, void *data);
-static feh_menu *feh_menu_func_gen_options(feh_menu * m, feh_menu_item * i,
+static void feh_menu_func_free_options(feh_menu * m,
+ void *data);
+static feh_menu *feh_menu_func_gen_options(feh_menu * m,
+ feh_menu_item * i,
void *data);
-static void
-feh_menu_cb_edit_rotate(feh_menu * m, feh_menu_item * i, void *data);
+static void feh_menu_cb_edit_rotate(feh_menu * m,
+ feh_menu_item * i,
+ void *data);
feh_menu *
feh_menu_new(void)
{
- feh_menu *m;
- XSetWindowAttributes attr;
- feh_menu_list *l;
- static Imlib_Image bg = NULL;
-
- D_ENTER(4);
-
- m = (feh_menu *) emalloc(sizeof(feh_menu));
-
- attr.backing_store = NotUseful;
- attr.override_redirect = True;
- attr.colormap = cm;
- attr.border_pixel = 0;
- attr.background_pixmap = None;
- attr.save_under = False;
- attr.do_not_propagate_mask = True;
-
- m->win =
- XCreateWindow(disp, root, 1, 1, 1, 1, 0, depth, InputOutput, vis,
- CWOverrideRedirect | CWSaveUnder | CWBackingStore |
- CWColormap | CWBackPixmap | CWBorderPixel |
- CWDontPropagate, &attr);
- XSelectInput(disp, m->win,
- ButtonPressMask | ButtonReleaseMask | EnterWindowMask |
- LeaveWindowMask | PointerMotionMask | ButtonMotionMask);
-
- m->name = NULL;
- m->fehwin = NULL;
- m->pmap = 0;
- m->x = 0;
- m->y = 0;
- m->w = 0;
- m->h = 0;
- m->visible = 0;
- m->items = NULL;
- m->next = NULL;
- m->updates = NULL;
- m->needs_redraw = 1;
- m->func_free = NULL;
- m->data = NULL;
- m->calc = 0;
- m->bg = NULL;
-
- l = emalloc(sizeof(feh_menu_list));
- l->menu = m;
- l->next = menus;
- menus = l;
-
- if (!bg)
- feh_load_image_char(&bg, opt.menu_bg);
- if (bg)
- m->bg = feh_imlib_clone_image(bg);
+ feh_menu *m;
+ XSetWindowAttributes attr;
+ feh_menu_list *l;
+ static Imlib_Image bg = NULL;
+
+ D_ENTER(4);
- D_RETURN(4, m);
+ m = (feh_menu *) emalloc(sizeof(feh_menu));
+
+ attr.backing_store = NotUseful;
+ attr.override_redirect = True;
+ attr.colormap = cm;
+ attr.border_pixel = 0;
+ attr.background_pixmap = None;
+ attr.save_under = False;
+ attr.do_not_propagate_mask = True;
+
+ m->win =
+ XCreateWindow(disp, root, 1, 1, 1, 1, 0, depth, InputOutput, vis,
+ CWOverrideRedirect | CWSaveUnder | CWBackingStore |
+ CWColormap | CWBackPixmap | CWBorderPixel | CWDontPropagate,
+ &attr);
+ XSelectInput(disp, m->win,
+ ButtonPressMask | ButtonReleaseMask | EnterWindowMask |
+ LeaveWindowMask | PointerMotionMask | ButtonMotionMask);
+
+ m->name = NULL;
+ m->fehwin = NULL;
+ m->pmap = 0;
+ m->x = 0;
+ m->y = 0;
+ m->w = 0;
+ m->h = 0;
+ m->visible = 0;
+ m->items = NULL;
+ m->next = NULL;
+ m->updates = NULL;
+ m->needs_redraw = 1;
+ m->func_free = NULL;
+ m->data = NULL;
+ m->calc = 0;
+ m->bg = NULL;
+
+ l = emalloc(sizeof(feh_menu_list));
+ l->menu = m;
+ l->next = menus;
+ menus = l;
+
+ if (!bg)
+ feh_load_image_char(&bg, opt.menu_bg);
+ if (bg)
+ m->bg = gib_imlib_clone_image(bg);
+
+ D_RETURN(4, m);
}
void
feh_menu_free(feh_menu * m)
{
- feh_menu_item *i;
- feh_menu_list *l, *pl = NULL;
+ feh_menu_item *i;
+ feh_menu_list *l, *pl = NULL;
- D_ENTER(4);
+ D_ENTER(4);
- if (m->name)
- free(m->name);
- XDestroyWindow(disp, m->win);
- if (m->pmap)
- XFreePixmap(disp, m->pmap);
- if (m->updates)
- imlib_updates_free(m->updates);
- for (i = m->items; i;)
- {
- feh_menu_item *ii;
-
- ii = i;
- i = i->next;
- if (ii->func_free)
- (ii->func_free) (ii->data);
- if (ii->text)
- free(ii->text);
- if (ii->submenu)
- free(ii->submenu);
- free(ii);
- }
-
- for (l = menus; l; l = l->next)
- {
- if (l->menu == m)
- {
- if (pl)
- pl->next = l->next;
- else
- menus = l->next;
- free(l);
- break;
- }
- pl = l;
- }
- free(m);
+ if (m->name)
+ free(m->name);
+ XDestroyWindow(disp, m->win);
+ if (m->pmap)
+ XFreePixmap(disp, m->pmap);
+ if (m->updates)
+ imlib_updates_free(m->updates);
+ for (i = m->items; i;) {
+ feh_menu_item *ii;
+
+ ii = i;
+ i = i->next;
+ if (ii->func_free)
+ (ii->func_free) (ii->data);
+ if (ii->text)
+ free(ii->text);
+ if (ii->submenu)
+ free(ii->submenu);
+ free(ii);
+ }
+
+ for (l = menus; l; l = l->next) {
+ if (l->menu == m) {
+ if (pl)
+ pl->next = l->next;
+ else
+ menus = l->next;
+ free(l);
+ break;
+ }
+ pl = l;
+ }
+ free(m);
- D_RETURN_(4);
+ D_RETURN_(4);
}
feh_menu_item *
feh_menu_find_selected(feh_menu * m)
{
- feh_menu_item *i;
+ feh_menu_item *i;
- D_ENTER(4);
+ D_ENTER(4);
- D(5, ("menu %p\n", m));
+ D(5, ("menu %p\n", m));
- for (i = m->items; i; i = i->next)
- {
- if (MENU_ITEM_IS_SELECTED(i))
- D_RETURN(4, i);
- }
- D_RETURN(4, NULL);
+ for (i = m->items; i; i = i->next) {
+ if (MENU_ITEM_IS_SELECTED(i))
+ D_RETURN(4, i);
+ }
+ D_RETURN(4, NULL);
}
feh_menu_item *
-feh_menu_find_at_xy(feh_menu * m, int x, int y)
+feh_menu_find_at_xy(feh_menu * m,
+ int x,
+ int y)
{
- feh_menu_item *i;
+ feh_menu_item *i;
- D_ENTER(4);
- D(4, ("looking for menu item at %d,%d\n", x, y));
- for (i = m->items; i; i = i->next)
- {
- if (XY_IN_RECT(x, y, i->x, i->y, i->w, i->h))
- {
- D(4, ("Found an item\n"));
- D_RETURN(4, i);
- }
- }
- D(4, ("didn't find an item\n"));
- D_RETURN(4, NULL);
+ D_ENTER(4);
+ D(4, ("looking for menu item at %d,%d\n", x, y));
+ for (i = m->items; i; i = i->next) {
+ if (XY_IN_RECT(x, y, i->x, i->y, i->w, i->h)) {
+ D(4, ("Found an item\n"));
+ D_RETURN(4, i);
+ }
+ }
+ D(4, ("didn't find an item\n"));
+ D_RETURN(4, NULL);
}
void
feh_menu_deselect_selected(feh_menu * m)
{
- feh_menu_item *i;
+ feh_menu_item *i;
- D_ENTER(4);
+ D_ENTER(4);
- if (!m)
- D_RETURN_(4);
+ if (!m)
+ D_RETURN_(4);
- i = feh_menu_find_selected(m);
- if (i)
- {
- D(4, ("found a selected menu, deselecting it\n"));
- MENU_ITEM_SET_NORMAL(i);
- m->updates =
- imlib_update_append_rect(m->updates, i->x, i->y, i->w, i->h);
- m->needs_redraw = 1;
- }
- D_RETURN_(4);
-}
-
-void
-feh_menu_select(feh_menu * m, feh_menu_item * i)
-{
- D_ENTER(4);
- MENU_ITEM_SET_SELECTED(i);
- m->updates = imlib_update_append_rect(m->updates, i->x, i->y, i->w, i->h);
- m->needs_redraw = 1;
- if (m->next)
- {
- feh_menu_hide(m->next, TRUE);
- m->next = NULL;
- }
- if (i->submenu)
- {
- feh_menu *mm;
-
- mm = feh_menu_find(i->submenu);
- if (mm)
- feh_menu_show_at_submenu(mm, m, i);
- else if (i->func_gen_sub)
- feh_menu_show_at_submenu(i->func_gen_sub(m, i, i->data), m, i);
- }
- D_RETURN_(4);
-}
-
-void
-feh_menu_show_at(feh_menu * m, int x, int y)
-{
- D_ENTER(4);
-
- if (m->calc)
- feh_menu_calc_size(m);
- if (!menu_cover)
- {
- XSetWindowAttributes attr;
-
- D(4, ("creating menu cover window\n"));
- attr.override_redirect = True;
- attr.do_not_propagate_mask = True;
- menu_cover =
- XCreateWindow(disp, root, 0, 0, scr->width, scr->height, 0, 0,
- InputOnly, vis, CWOverrideRedirect | CWDontPropagate,
- &attr);
- XSelectInput(disp, menu_cover,
- ButtonPressMask | ButtonReleaseMask | EnterWindowMask |
- LeaveWindowMask | PointerMotionMask | ButtonMotionMask);
-
- XRaiseWindow(disp, menu_cover);
- XMapWindow(disp, menu_cover);
- menu_root = m;
- XUngrabPointer(disp, CurrentTime);
- XSetInputFocus(disp, menu_cover, RevertToPointerRoot, CurrentTime);
- }
- m->visible = 1;
- XMoveWindow(disp, m->win, x, y);
- m->x = x;
- m->y = y;
- XRaiseWindow(disp, m->win);
- feh_menu_redraw(m);
- XMapWindow(disp, m->win);
- D_RETURN_(4);
-}
-
-void
-feh_menu_show_at_xy(feh_menu * m, winwidget winwid, int x, int y)
-{
- D_ENTER(4);
-
- if (!m)
- D_RETURN_(4);
-
- if (m->calc)
- feh_menu_calc_size(m);
- m->fehwin = winwid;
- if ((x + m->w) > scr->width)
- x = scr->width - m->w;
- if ((y + m->h) > scr->height)
- y = scr->height - m->h;
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
- feh_menu_move(m, x, y);
- feh_menu_show(m);
- D_RETURN_(4);
-}
-
-void
-feh_menu_show_at_submenu(feh_menu * m, feh_menu * parent_m, feh_menu_item * i)
-{
- int mx, my;
-
- D_ENTER(4);
-
- if (!m)
- D_RETURN_(4);
-
- if (m->calc)
- feh_menu_calc_size(m);
- mx = parent_m->x + parent_m->w;
- my = parent_m->y + i->y - FEH_MENU_PAD_TOP;
- m->fehwin = parent_m->fehwin;
- parent_m->next = m;
- feh_menu_move(m, mx, my);
- feh_menu_show(m);
- D_RETURN_(4);
-}
-
-void
-feh_menu_move(feh_menu * m, int x, int y)
-{
- int dx, dy;
-
- D_ENTER(4);
-
- if (!m)
- D_RETURN_(4);
- dx = x - m->x;
- dy = y - m->y;
- if (m->visible)
- XMoveWindow(disp, m->win, x, y);
- m->x = x;
- m->y = y;
- D_RETURN_(4);
-}
-
-void
-feh_menu_slide_all_menus_relative(int dx, int dy)
-{
- int i;
- feh_menu_list *m;
- double vector_len = 0;
- int stepx = 0;
- int stepy = 0;
-
- D_ENTER(4);
- vector_len = sqrt(dx * dx + dy * dy);
- if (vector_len)
- {
- if (dx)
- stepx = rint(dx / vector_len);
-
- if (dy)
- stepy = rint(dy / vector_len);
-
- }
- for (i = 0; i < vector_len; i++)
- {
- for (m = menus; m; m = m->next)
- {
- if (m->menu->visible)
- feh_menu_move(m->menu, m->menu->x + stepx, m->menu->y + stepy);
+ i = feh_menu_find_selected(m);
+ if (i) {
+ D(4, ("found a selected menu, deselecting it\n"));
+ MENU_ITEM_SET_NORMAL(i);
+ m->updates = imlib_update_append_rect(m->updates, i->x, i->y, i->w, i->h);
+ m->needs_redraw = 1;
+ }
+ D_RETURN_(4);
+}
- }
- XWarpPointer(disp, None, None, 0, 0, 0, 0, stepx, stepy);
- }
- D_RETURN_(4);
+void
+feh_menu_select(feh_menu * m,
+ feh_menu_item * i)
+{
+ D_ENTER(4);
+ MENU_ITEM_SET_SELECTED(i);
+ m->updates = imlib_update_append_rect(m->updates, i->x, i->y, i->w, i->h);
+ m->needs_redraw = 1;
+ if (m->next) {
+ feh_menu_hide(m->next, TRUE);
+ m->next = NULL;
+ }
+ if (i->submenu) {
+ feh_menu *mm;
+
+ mm = feh_menu_find(i->submenu);
+ if (mm)
+ feh_menu_show_at_submenu(mm, m, i);
+ else if (i->func_gen_sub)
+ feh_menu_show_at_submenu(i->func_gen_sub(m, i, i->data), m, i);
+ }
+ D_RETURN_(4);
}
void
-feh_menu_hide(feh_menu * m, int func_free)
-{
- D_ENTER(4);
-
- if (!m->visible)
- D_RETURN_(4);
- if (m->next)
- {
- feh_menu_hide(m->next, func_free);
- m->next = NULL;
- }
- if (m == menu_root)
- {
- if (menu_cover)
- {
- D(4, ("DESTROYING menu cover\n"));
- XDestroyWindow(disp, menu_cover);
- menu_cover = 0;
- }
- menu_root = NULL;
- }
- m->visible = 0;
- XUnmapWindow(disp, m->win);
- if(func_free && m->func_free)
- m->func_free(m, m->data);
- else
- feh_menu_deselect_selected(m);
- D_RETURN_(4);
+feh_menu_show_at(feh_menu * m,
+ int x,
+ int y)
+{
+ D_ENTER(4);
+
+ if (m->calc)
+ feh_menu_calc_size(m);
+ if (!menu_cover) {
+ XSetWindowAttributes attr;
+
+ D(4, ("creating menu cover window\n"));
+ attr.override_redirect = True;
+ attr.do_not_propagate_mask = True;
+ menu_cover =
+ XCreateWindow(disp, root, 0, 0, scr->width, scr->height, 0, 0,
+ InputOnly, vis, CWOverrideRedirect | CWDontPropagate,
+ &attr);
+ XSelectInput(disp, menu_cover,
+ ButtonPressMask | ButtonReleaseMask | EnterWindowMask |
+ LeaveWindowMask | PointerMotionMask | ButtonMotionMask);
+
+ XRaiseWindow(disp, menu_cover);
+ XMapWindow(disp, menu_cover);
+ menu_root = m;
+ XUngrabPointer(disp, CurrentTime);
+ XSetInputFocus(disp, menu_cover, RevertToPointerRoot, CurrentTime);
+ }
+ m->visible = 1;
+ XMoveWindow(disp, m->win, x, y);
+ m->x = x;
+ m->y = y;
+ XRaiseWindow(disp, m->win);
+ feh_menu_redraw(m);
+ XMapWindow(disp, m->win);
+ D_RETURN_(4);
+}
+
+void
+feh_menu_show_at_xy(feh_menu * m,
+ winwidget winwid,
+ int x,
+ int y)
+{
+ D_ENTER(4);
+
+ if (!m)
+ D_RETURN_(4);
+
+ if (m->calc)
+ feh_menu_calc_size(m);
+ m->fehwin = winwid;
+ if ((x + m->w) > scr->width)
+ x = scr->width - m->w;
+ if ((y + m->h) > scr->height)
+ y = scr->height - m->h;
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+ feh_menu_move(m, x, y);
+ feh_menu_show(m);
+ D_RETURN_(4);
+}
+
+void
+feh_menu_show_at_submenu(feh_menu * m,
+ feh_menu * parent_m,
+ feh_menu_item * i)
+{
+ int mx, my;
+
+ D_ENTER(4);
+
+ if (!m)
+ D_RETURN_(4);
+
+ if (m->calc)
+ feh_menu_calc_size(m);
+ mx = parent_m->x + parent_m->w;
+ my = parent_m->y + i->y - FEH_MENU_PAD_TOP;
+ m->fehwin = parent_m->fehwin;
+ parent_m->next = m;
+ feh_menu_move(m, mx, my);
+ feh_menu_show(m);
+ D_RETURN_(4);
+}
+
+void
+feh_menu_move(feh_menu * m,
+ int x,
+ int y)
+{
+ int dx, dy;
+
+ D_ENTER(4);
+
+ if (!m)
+ D_RETURN_(4);
+ dx = x - m->x;
+ dy = y - m->y;
+ if (m->visible)
+ XMoveWindow(disp, m->win, x, y);
+ m->x = x;
+ m->y = y;
+ D_RETURN_(4);
}
void
+feh_menu_slide_all_menus_relative(int dx,
+ int dy)
+{
+ int i;
+ feh_menu_list *m;
+ double vector_len = 0;
+ int stepx = 0;
+ int stepy = 0;
+
+ D_ENTER(4);
+ vector_len = sqrt(dx * dx + dy * dy);
+ if (vector_len) {
+ if (dx)
+ stepx = rint(dx / vector_len);
+
+ if (dy)
+ stepy = rint(dy / vector_len);
+
+ }
+ for (i = 0; i < vector_len; i++) {
+ for (m = menus; m; m = m->next) {
+ if (m->menu->visible)
+ feh_menu_move(m->menu, m->menu->x + stepx, m->menu->y + stepy);
+
+ }
+ XWarpPointer(disp, None, None, 0, 0, 0, 0, stepx, stepy);
+ }
+ D_RETURN_(4);
+}
+
+void
+feh_menu_hide(feh_menu * m,
+ int func_free)
+{
+ D_ENTER(4);
+
+ if (!m->visible)
+ D_RETURN_(4);
+ if (m->next) {
+ feh_menu_hide(m->next, func_free);
+ m->next = NULL;
+ }
+ if (m == menu_root) {
+ if (menu_cover) {
+ D(4, ("DESTROYING menu cover\n"));
+ XDestroyWindow(disp, menu_cover);
+ menu_cover = 0;
+ }
+ menu_root = NULL;
+ }
+ m->visible = 0;
+ XUnmapWindow(disp, m->win);
+ if (func_free && m->func_free)
+ m->func_free(m, m->data);
+ else
+ feh_menu_deselect_selected(m);
+ D_RETURN_(4);
+}
+
+void
feh_menu_show(feh_menu * m)
{
- D_ENTER(4);
- if (!m)
- D_RETURN_(4);
- feh_menu_show_at(m, m->x, m->y);
- D_RETURN_(4);
+ D_ENTER(4);
+ if (!m)
+ D_RETURN_(4);
+ feh_menu_show_at(m, m->x, m->y);
+ D_RETURN_(4);
}
feh_menu_item *
-feh_menu_add_toggle_entry(feh_menu * m, char *text, Imlib_Image icon,
- char *submenu, menu_func func, void *data,
- void (*func_free) (void *data), int setting)
-{
- feh_menu_item *mi;
-
- D_ENTER(4);
- mi = feh_menu_add_entry(m, text, icon, submenu, func, data, func_free);
- mi->is_toggle = TRUE;
- MENU_ITEM_TOGGLE_SET(mi, setting);
- D_RETURN(4, mi);
+feh_menu_add_toggle_entry(feh_menu * m,
+ char *text,
+ Imlib_Image icon,
+ char *submenu,
+ menu_func func,
+ void *data,
+ void (*func_free) (void *data),
+ int setting)
+{
+ feh_menu_item *mi;
+
+ D_ENTER(4);
+ mi = feh_menu_add_entry(m, text, icon, submenu, func, data, func_free);
+ mi->is_toggle = TRUE;
+ MENU_ITEM_TOGGLE_SET(mi, setting);
+ D_RETURN(4, mi);
}
feh_menu_item *
-feh_menu_add_entry(feh_menu * m, char *text, Imlib_Image icon, char *submenu,
- menu_func func, void *data, void (*func_free) (void *data))
+feh_menu_add_entry(feh_menu * m,
+ char *text,
+ Imlib_Image icon,
+ char *submenu,
+ menu_func func,
+ void *data,
+ void (*func_free) (void *data))
{
- feh_menu_item *mi, *ptr;
+ feh_menu_item *mi, *ptr;
- D_ENTER(4);
+ D_ENTER(4);
- mi = (feh_menu_item *) emalloc(sizeof(feh_menu_item));
- mi->state = MENU_ITEM_STATE_NORMAL;
- mi->icon = icon;
- mi->is_toggle = FALSE;
- if (text)
- mi->text = estrdup(text);
- else
- mi->text = NULL;
- if (submenu)
- mi->submenu = estrdup(submenu);
- else
- mi->submenu = NULL;
- mi->func = func;
- mi->func_free = func_free;
- mi->data = data;
- mi->func_gen_sub = NULL;
- mi->next = NULL;
-
- if (!m->items)
- m->items = mi;
- else
- {
- for (ptr = m->items; ptr; ptr = ptr->next)
- {
- if (!ptr->next)
- {
- ptr->next = mi;
- break;
- }
- }
- }
- m->calc = 1;
- D_RETURN(4, mi);
+ mi = (feh_menu_item *) emalloc(sizeof(feh_menu_item));
+ mi->state = MENU_ITEM_STATE_NORMAL;
+ mi->icon = icon;
+ mi->is_toggle = FALSE;
+ if (text)
+ mi->text = estrdup(text);
+ else
+ mi->text = NULL;
+ if (submenu)
+ mi->submenu = estrdup(submenu);
+ else
+ mi->submenu = NULL;
+ mi->func = func;
+ mi->func_free = func_free;
+ mi->data = data;
+ mi->func_gen_sub = NULL;
+ mi->next = NULL;
+
+ if (!m->items)
+ m->items = mi;
+ else {
+ for (ptr = m->items; ptr; ptr = ptr->next) {
+ if (!ptr->next) {
+ ptr->next = mi;
+ break;
+ }
+ }
+ }
+ m->calc = 1;
+ D_RETURN(4, mi);
}
void
-feh_menu_entry_get_size(feh_menu * m, feh_menu_item * i, int *w, int *h)
-{
- int tw, th;
-
- D_ENTER(4);
-
- if (i->text)
- {
- feh_imlib_get_text_size(opt.menu_fn, i->text, &tw, &th,
- IMLIB_TEXT_TO_RIGHT);
- *w =
- tw + FEH_MENUITEM_PAD_LEFT + FEH_MENUITEM_PAD_RIGHT +
- FEH_MENU_FONT_SHADOW_OFF_X;
- *h =
- th + FEH_MENUITEM_PAD_TOP + FEH_MENUITEM_PAD_BOTTOM +
- FEH_MENU_FONT_SHADOW_OFF_Y;
- }
- else
- {
- *w = FEH_MENUITEM_PAD_LEFT + FEH_MENUITEM_PAD_RIGHT;
- *h = FEH_MENUITEM_PAD_TOP + FEH_MENUITEM_PAD_BOTTOM;
- }
+feh_menu_entry_get_size(feh_menu * m,
+ feh_menu_item * i,
+ int *w,
+ int *h)
+{
+ int tw, th;
- D_RETURN_(4);
- m = NULL;
+ D_ENTER(4);
+
+ if (i->text) {
+ gib_imlib_get_text_size(opt.menu_fn, i->text, opt.menu_style_l, &tw, &th,
+ IMLIB_TEXT_TO_RIGHT);
+ *w =
+ tw + FEH_MENUITEM_PAD_LEFT + FEH_MENUITEM_PAD_RIGHT;
+ *h =
+ th + FEH_MENUITEM_PAD_TOP + FEH_MENUITEM_PAD_BOTTOM;
+ } else {
+ *w = FEH_MENUITEM_PAD_LEFT + FEH_MENUITEM_PAD_RIGHT;
+ *h = FEH_MENUITEM_PAD_TOP + FEH_MENUITEM_PAD_BOTTOM;
+ }
+
+ D_RETURN_(4);
+ m = NULL;
}
void
feh_menu_calc_size(feh_menu * m)
{
- int prev_w, prev_h;
- feh_menu_item *i;
- int j = 0, count = 0, max_w = 0, max_h = 0, icon_w = 0, next_w = 0;
- int toggle_w = 0;
-
- D_ENTER(4);
-
- prev_w = m->w;
- prev_h = m->h;
- m->calc = 0;
-
- for (i = m->items; i; i = i->next)
- {
- int w, h;
-
- feh_menu_entry_get_size(m, i, &w, &h);
- if (w > max_w)
- max_w = w;
- if (h > max_h)
- max_h = h;
- if (i->submenu)
- {
- next_w = FEH_MENU_SUBMENU_W;
- if (FEH_MENU_SUBMENU_H > max_h)
- max_h = FEH_MENU_SUBMENU_H;
- }
- if (i->is_toggle)
- {
- toggle_w = FEH_MENU_TOGGLE_W + FEH_MENU_TOGGLE_PAD;
- if (FEH_MENU_TOGGLE_H > max_h)
- max_h = FEH_MENU_TOGGLE_H;
- }
- count++;
- }
+ int prev_w, prev_h;
+ feh_menu_item *i;
+ int j = 0, count = 0, max_w = 0, max_h = 0, icon_w = 0, next_w = 0;
+ int toggle_w = 0;
- for (i = m->items; i; i = i->next)
- {
- if (i->icon)
- {
- Imlib_Image im;
-
- im = i->icon;
- if (im)
- {
- int iw, ih, ow, oh;
-
- iw = feh_imlib_image_get_width(im);
- ih = feh_imlib_image_get_height(im);
- if (ih <= max_h)
- {
- ow = iw;
- oh = ih;
- }
- else
- {
- ow = (iw * max_h) / ih;
- oh = max_h;
- }
- if (ow > icon_w)
- icon_w = ow;
- }
- }
- }
- m->h = FEH_MENU_PAD_TOP;
- for (i = m->items; i; i = i->next)
- {
- i->x = FEH_MENU_PAD_LEFT;
- i->y = m->h;
- i->w = max_w + icon_w + toggle_w + next_w;
- i->icon_x = FEH_MENUITEM_PAD_LEFT;
- i->toggle_x = i->icon_x + icon_w;
- i->text_x = i->toggle_x + toggle_w;
- i->sub_x = i->text_x + max_w;
- if (i->text)
- i->h = max_h;
- else
- i->h = FEH_MENU_SEP_MAX_H;
- m->h += i->h;
- j++;
- }
- m->h += FEH_MENU_PAD_BOTTOM;
- m->w =
- next_w + toggle_w + icon_w + max_w + FEH_MENU_PAD_LEFT +
- FEH_MENU_PAD_RIGHT;
-
- if ((prev_w != m->w) || (prev_h != m->h))
- {
- if (m->pmap)
- XFreePixmap(disp, m->pmap);
- m->pmap = 0;
- m->needs_redraw = 1;
- XResizeWindow(disp, m->win, m->w, m->h);
- m->updates = imlib_update_append_rect(m->updates, 0, 0, m->w, m->h);
- }
- D(4, ("menu size calculated. w=%d h=%d\n", m->w, m->h));
-
- /* Make sure bg is same size */
- if (m->bg)
- {
- int bg_w, bg_h;
-
- bg_w = feh_imlib_image_get_width(m->bg);
- bg_h = feh_imlib_image_get_height(m->bg);
-
- if (m->w != bg_w || m->h != bg_h)
- {
- Imlib_Image newim = imlib_create_image(m->w, m->h);
-
- D(3, ("resizing bg to %dx%d\n", m->w, m->h));
-
- feh_imlib_blend_image_onto_image(newim, m->bg, 0, 0, 0, bg_w, bg_h,
- 0, 0, m->w, m->h, 0, 0, 1);
- feh_imlib_free_image_and_decache(m->bg);
- m->bg = newim;
- }
- }
+ D_ENTER(4);
+
+ prev_w = m->w;
+ prev_h = m->h;
+ m->calc = 0;
+
+ for (i = m->items; i; i = i->next) {
+ int w, h;
+
+ feh_menu_entry_get_size(m, i, &w, &h);
+ if (w > max_w)
+ max_w = w;
+ if (h > max_h)
+ max_h = h;
+ if (i->submenu) {
+ next_w = FEH_MENU_SUBMENU_W;
+ if (FEH_MENU_SUBMENU_H > max_h)
+ max_h = FEH_MENU_SUBMENU_H;
+ }
+ if (i->is_toggle) {
+ toggle_w = FEH_MENU_TOGGLE_W + FEH_MENU_TOGGLE_PAD;
+ if (FEH_MENU_TOGGLE_H > max_h)
+ max_h = FEH_MENU_TOGGLE_H;
+ }
+ count++;
+ }
+
+ for (i = m->items; i; i = i->next) {
+ if (i->icon) {
+ Imlib_Image im;
+
+ im = i->icon;
+ if (im) {
+ int iw, ih, ow, oh;
+
+ iw = gib_imlib_image_get_width(im);
+ ih = gib_imlib_image_get_height(im);
+ if (ih <= max_h) {
+ ow = iw;
+ oh = ih;
+ } else {
+ ow = (iw * max_h) / ih;
+ oh = max_h;
+ }
+ if (ow > icon_w)
+ icon_w = ow;
+ }
+ }
+ }
+ m->h = FEH_MENU_PAD_TOP;
+ for (i = m->items; i; i = i->next) {
+ i->x = FEH_MENU_PAD_LEFT;
+ i->y = m->h;
+ i->w = max_w + icon_w + toggle_w + next_w;
+ i->icon_x = FEH_MENUITEM_PAD_LEFT;
+ i->toggle_x = i->icon_x + icon_w;
+ i->text_x = i->toggle_x + toggle_w;
+ i->sub_x = i->text_x + max_w;
+ if (i->text)
+ i->h = max_h;
+ else
+ i->h = FEH_MENU_SEP_MAX_H;
+ m->h += i->h;
+ j++;
+ }
+ m->h += FEH_MENU_PAD_BOTTOM;
+ m->w =
+ next_w + toggle_w + icon_w + max_w + FEH_MENU_PAD_LEFT +
+ FEH_MENU_PAD_RIGHT;
+
+ if ((prev_w != m->w) || (prev_h != m->h)) {
+ if (m->pmap)
+ XFreePixmap(disp, m->pmap);
+ m->pmap = 0;
+ m->needs_redraw = 1;
+ XResizeWindow(disp, m->win, m->w, m->h);
+ m->updates = imlib_update_append_rect(m->updates, 0, 0, m->w, m->h);
+ }
+ D(4, ("menu size calculated. w=%d h=%d\n", m->w, m->h));
+
+ /* Make sure bg is same size */
+ if (m->bg) {
+ int bg_w, bg_h;
+
+ bg_w = gib_imlib_image_get_width(m->bg);
+ bg_h = gib_imlib_image_get_height(m->bg);
+
+ if (m->w != bg_w || m->h != bg_h) {
+ Imlib_Image newim = imlib_create_image(m->w, m->h);
+
+ D(3, ("resizing bg to %dx%d\n", m->w, m->h));
+
+ gib_imlib_blend_image_onto_image(newim, m->bg, 0, 0, 0, bg_w, bg_h, 0,
+ 0, m->w, m->h, 0, 0, 1);
+ gib_imlib_free_image_and_decache(m->bg);
+ m->bg = newim;
+ }
+ }
- D_RETURN_(4);
+ D_RETURN_(4);
}
void
-feh_menu_draw_item(feh_menu * m, feh_menu_item * i, Imlib_Image im, int ox,
+feh_menu_draw_item(feh_menu * m,
+ feh_menu_item * i,
+ Imlib_Image im,
+ int ox,
int oy)
{
- D_ENTER(5);
-
- D(5,
- ("drawing item %p (text %s) on menu %p (name %s)\n", i, i->text, m,
- m->name));
-
- if (i->text)
- {
- D(5, ("text item\n"));
- if (MENU_ITEM_IS_SELECTED(i))
- {
- D(5, ("selected item\n"));
- /* draw selected image */
- feh_menu_item_draw_at(i->x, i->y, i->w, i->h, im, ox, oy, 1);
- }
- else
- {
- D(5, ("unselected item\n"));
- /* draw unselected image */
- feh_menu_item_draw_at(i->x, i->y, i->w, i->h, im, ox, oy, 0);
- }
+ D_ENTER(5);
- /* draw text */
- feh_imlib_text_draw(im, opt.menu_fn,
- i->x - ox + i->text_x + FEH_MENU_FONT_SHADOW_OFF_X,
- i->y - oy + FEH_MENUITEM_PAD_TOP +
- FEH_MENU_FONT_SHADOW_OFF_Y, i->text,
- IMLIB_TEXT_TO_RIGHT, 0, 0, 0, 60);
-
- feh_imlib_text_draw(im, opt.menu_fn, i->x - ox + i->text_x,
- i->y - oy + FEH_MENUITEM_PAD_TOP, i->text,
- IMLIB_TEXT_TO_RIGHT, 0, 0, 0, 255);
- if (i->icon)
- {
- Imlib_Image im2;
-
- D(5, ("icon item\n"));
-
- im2 = i->icon;
- if (im2)
- {
- int iw, ih, ow, oh;
-
- iw = feh_imlib_image_get_width(im2);
- ih = feh_imlib_image_get_height(im2);
- if (ih <= (i->h - FEH_MENUITEM_PAD_TOP - FEH_MENUITEM_PAD_BOTTOM))
- {
- ow = iw;
- oh = ih;
- }
- else
- {
- ow =
- (iw *
- (i->h - FEH_MENUITEM_PAD_TOP -
- FEH_MENUITEM_PAD_BOTTOM)) / ih;
- oh = i->h - FEH_MENUITEM_PAD_TOP - FEH_MENUITEM_PAD_BOTTOM;
- }
- feh_imlib_blend_image_onto_image(im, im2, 0, 0, 0, iw, ih,
- i->x + i->icon_x - ox,
- i->y + FEH_MENUITEM_PAD_TOP +
- (((i->h - FEH_MENUITEM_PAD_TOP -
- FEH_MENUITEM_PAD_BOTTOM) -
- oh) / 2) - oy, ow, oh, 1, 1,
- 1);
- feh_imlib_free_image(im2);
- }
- }
- if (i->submenu)
- {
- D(5, ("submenu item\n"));
- feh_menu_draw_submenu_at(i->x + i->sub_x,
- i->y + FEH_MENUITEM_PAD_TOP +
- ((i->h - FEH_MENUITEM_PAD_TOP -
- FEH_MENUITEM_PAD_BOTTOM -
- FEH_MENU_SUBMENU_H) / 2),
- FEH_MENU_SUBMENU_W, FEH_MENU_SUBMENU_H, im,
- ox, oy, MENU_ITEM_IS_SELECTED(i));
- }
- if (i->is_toggle)
- {
- D(5, ("toggleable item\n"));
- feh_menu_draw_toggle_at(i->x + i->toggle_x,
- i->y + FEH_MENUITEM_PAD_TOP +
- ((i->h - FEH_MENUITEM_PAD_TOP -
- FEH_MENUITEM_PAD_BOTTOM -
- FEH_MENU_TOGGLE_H) / 2), FEH_MENU_TOGGLE_W,
- FEH_MENU_TOGGLE_H, im, ox, oy,
- MENU_ITEM_IS_ON(i));
- }
- }
- else
- {
- D(5, ("separator item\n"));
- feh_menu_draw_separator_at(i->x, i->y, i->w, i->h, im, ox, oy);
- }
- D_RETURN_(5);
- m = NULL;
+ D(5,
+ ("drawing item %p (text %s) on menu %p (name %s)\n", i, i->text, m,
+ m->name));
+
+ if (i->text) {
+ D(5, ("text item\n"));
+ if (MENU_ITEM_IS_SELECTED(i)) {
+ D(5, ("selected item\n"));
+ /* draw selected image */
+ feh_menu_item_draw_at(i->x, i->y, i->w, i->h, im, ox, oy, 1);
+ } else {
+ D(5, ("unselected item\n"));
+ /* draw unselected image */
+ feh_menu_item_draw_at(i->x, i->y, i->w, i->h, im, ox, oy, 0);
+ }
+
+ /* draw text */
+ gib_imlib_text_draw(im, opt.menu_fn, opt.menu_style_l,
+ i->x - ox + i->text_x,
+ i->y - oy + FEH_MENUITEM_PAD_TOP, i->text,
+ IMLIB_TEXT_TO_RIGHT, 0, 0, 0, 255);
+ if (i->icon) {
+ Imlib_Image im2;
+
+ D(5, ("icon item\n"));
+
+ im2 = i->icon;
+ if (im2) {
+ int iw, ih, ow, oh;
+
+ iw = gib_imlib_image_get_width(im2);
+ ih = gib_imlib_image_get_height(im2);
+ if (ih <= (i->h - FEH_MENUITEM_PAD_TOP - FEH_MENUITEM_PAD_BOTTOM)) {
+ ow = iw;
+ oh = ih;
+ } else {
+ ow =
+ (iw * (i->h - FEH_MENUITEM_PAD_TOP - FEH_MENUITEM_PAD_BOTTOM)) /
+ ih;
+ oh = i->h - FEH_MENUITEM_PAD_TOP - FEH_MENUITEM_PAD_BOTTOM;
+ }
+ gib_imlib_blend_image_onto_image(im, im2, 0, 0, 0, iw, ih,
+ i->x + i->icon_x - ox,
+ i->y + FEH_MENUITEM_PAD_TOP +
+ (((i->h - FEH_MENUITEM_PAD_TOP -
+ FEH_MENUITEM_PAD_BOTTOM) -
+ oh) / 2) - oy, ow, oh, 1, 1, 1);
+ gib_imlib_free_image(im2);
+ }
+ }
+ if (i->submenu) {
+ D(5, ("submenu item\n"));
+ feh_menu_draw_submenu_at(i->x + i->sub_x,
+ i->y + FEH_MENUITEM_PAD_TOP +
+ ((i->h - FEH_MENUITEM_PAD_TOP -
+ FEH_MENUITEM_PAD_BOTTOM -
+ FEH_MENU_SUBMENU_H) / 2), FEH_MENU_SUBMENU_W,
+ FEH_MENU_SUBMENU_H, im, ox, oy,
+ MENU_ITEM_IS_SELECTED(i));
+ }
+ if (i->is_toggle) {
+ D(5, ("toggleable item\n"));
+ feh_menu_draw_toggle_at(i->x + i->toggle_x,
+ i->y + FEH_MENUITEM_PAD_TOP +
+ ((i->h - FEH_MENUITEM_PAD_TOP -
+ FEH_MENUITEM_PAD_BOTTOM -
+ FEH_MENU_TOGGLE_H) / 2), FEH_MENU_TOGGLE_W,
+ FEH_MENU_TOGGLE_H, im, ox, oy,
+ MENU_ITEM_IS_ON(i));
+ }
+ } else {
+ D(5, ("separator item\n"));
+ feh_menu_draw_separator_at(i->x, i->y, i->w, i->h, im, ox, oy);
+ }
+ D_RETURN_(5);
+ m = NULL;
}
void
feh_menu_redraw(feh_menu * m)
{
- Imlib_Updates u, uu;
+ Imlib_Updates u, uu;
- D_ENTER(5);
+ D_ENTER(5);
- if ((!m->needs_redraw) || (!m->visible) || (!m->updates))
- D_RETURN_(5);
- m->needs_redraw = 0;
- if (!m->pmap)
- m->pmap = XCreatePixmap(disp, m->win, m->w, m->h, depth);
- XSetWindowBackgroundPixmap(disp, m->win, m->pmap);
-
- u = imlib_updates_merge_for_rendering(m->updates, m->w, m->h);
- m->updates = NULL;
- if (u)
- {
- D(5, ("I have updates to render\n"));
- for (uu = u; u; u = imlib_updates_get_next(u))
- {
- int x, y, w, h;
- Imlib_Image im;
-
- imlib_updates_get_coordinates(u, &x, &y, &w, &h);
- D(5, ("update coords %d,%d %d*%d\n", x, y, w, h));
- im = imlib_create_image(w, h);
- feh_imlib_image_fill_rectangle(im, 0, 0, w, h, 0, 0, 0, 0);
- if (im)
- {
- feh_menu_draw_to_buf(m, im, x, y);
- feh_imlib_render_image_on_drawable(m->pmap, im, x, y, 1, 0, 0);
- feh_imlib_free_image(im);
- XClearArea(disp, m->win, x, y, w, h, False);
- }
- }
- imlib_updates_free(uu);
- }
- D_RETURN_(5);
+ if ((!m->needs_redraw) || (!m->visible) || (!m->updates))
+ D_RETURN_(5);
+ m->needs_redraw = 0;
+ if (!m->pmap)
+ m->pmap = XCreatePixmap(disp, m->win, m->w, m->h, depth);
+ XSetWindowBackgroundPixmap(disp, m->win, m->pmap);
+
+ u = imlib_updates_merge_for_rendering(m->updates, m->w, m->h);
+ m->updates = NULL;
+ if (u) {
+ D(5, ("I have updates to render\n"));
+ for (uu = u; u; u = imlib_updates_get_next(u)) {
+ int x, y, w, h;
+ Imlib_Image im;
+
+ imlib_updates_get_coordinates(u, &x, &y, &w, &h);
+ D(5, ("update coords %d,%d %d*%d\n", x, y, w, h));
+ im = imlib_create_image(w, h);
+ gib_imlib_image_fill_rectangle(im, 0, 0, w, h, 0, 0, 0, 0);
+ if (im) {
+ feh_menu_draw_to_buf(m, im, x, y);
+ gib_imlib_render_image_on_drawable(m->pmap, im, x, y, 1, 0, 0);
+ gib_imlib_free_image(im);
+ XClearArea(disp, m->win, x, y, w, h, False);
+ }
+ }
+ imlib_updates_free(uu);
+ }
+ D_RETURN_(5);
}
feh_menu *
feh_menu_find(char *name)
{
- feh_menu_list *l;
+ feh_menu_list *l;
- D_ENTER(4);
- for (l = menus; l; l = l->next)
- {
- if ((l->menu->name) && (!strcmp(l->menu->name, name)))
- D_RETURN(4, l->menu);
- }
- D_RETURN(4, NULL);
+ D_ENTER(4);
+ for (l = menus; l; l = l->next) {
+ if ((l->menu->name) && (!strcmp(l->menu->name, name)))
+ D_RETURN(4, l->menu);
+ }
+ D_RETURN(4, NULL);
}
void
-feh_menu_draw_to_buf(feh_menu * m, Imlib_Image im, int ox, int oy)
+feh_menu_draw_to_buf(feh_menu * m,
+ Imlib_Image im,
+ int ox,
+ int oy)
{
- feh_menu_item *i;
- int w, h;
+ feh_menu_item *i;
+ int w, h;
- D_ENTER(5);
- w = feh_imlib_image_get_width(im);
- h = feh_imlib_image_get_height(im);
+ D_ENTER(5);
+ w = gib_imlib_image_get_width(im);
+ h = gib_imlib_image_get_height(im);
- feh_menu_draw_menu_bg(m, im, ox, oy);
+ feh_menu_draw_menu_bg(m, im, ox, oy);
- for (i = m->items; i; i = i->next)
- {
- if (RECTS_INTERSECT(i->x, i->y, i->w, i->h, ox, oy, w, h))
- feh_menu_draw_item(m, i, im, ox, oy);
- }
- D_RETURN_(5);
+ for (i = m->items; i; i = i->next) {
+ if (RECTS_INTERSECT(i->x, i->y, i->w, i->h, ox, oy, w, h))
+ feh_menu_draw_item(m, i, im, ox, oy);
+ }
+ D_RETURN_(5);
}
void
-feh_menu_draw_menu_bg(feh_menu * m, Imlib_Image im, int ox, int oy)
+feh_menu_draw_menu_bg(feh_menu * m,
+ Imlib_Image im,
+ int ox,
+ int oy)
{
- int w, h;
+ int w, h;
- D_ENTER(5);
+ D_ENTER(5);
- w = feh_imlib_image_get_width(im);
- h = feh_imlib_image_get_height(im);
+ w = gib_imlib_image_get_width(im);
+ h = gib_imlib_image_get_height(im);
- if (m->bg)
- feh_imlib_blend_image_onto_image(im, m->bg, 0, ox, oy, w, h, 0, 0, w, h,
- 0, 0, 0);
- else
- feh_imlib_image_fill_rectangle(im, 0, 0, w, h, 205, 203, 176, 255);
+ if (m->bg)
+ gib_imlib_blend_image_onto_image(im, m->bg, 0, ox, oy, w, h, 0, 0, w, h,
+ 0, 0, 0);
+ else
+ gib_imlib_image_fill_rectangle(im, 0, 0, w, h, 205, 203, 176, 255);
- D_RETURN_(5);
+ D_RETURN_(5);
}
void
-feh_menu_draw_toggle_at(int x, int y, int w, int h, Imlib_Image dst, int ox,
- int oy, int on)
+feh_menu_draw_toggle_at(int x,
+ int y,
+ int w,
+ int h,
+ Imlib_Image dst,
+ int ox,
+ int oy,
+ int on)
{
- int xc, yc;
+ int xc, yc;
- D_ENTER(5);
- x -= ox;
- y -= oy;
- if (on)
- feh_imlib_image_fill_rectangle(dst, x, y, w, h, 0, 0, 0, 255);
- else
- feh_imlib_image_draw_rectangle(dst, x, y, w, h, 0, 0, 0, 255);
- D_RETURN_(5);
+ D_ENTER(5);
+ x -= ox;
+ y -= oy;
+ if (on)
+ gib_imlib_image_fill_rectangle(dst, x, y, w, h, 0, 0, 0, 255);
+ else
+ gib_imlib_image_draw_rectangle(dst, x, y, w, h, 0, 0, 0, 255);
+ D_RETURN_(5);
}
void
-feh_menu_draw_submenu_at(int x, int y, int w, int h, Imlib_Image dst, int ox,
- int oy, int selected)
+feh_menu_draw_submenu_at(int x,
+ int y,
+ int w,
+ int h,
+ Imlib_Image dst,
+ int ox,
+ int oy,
+ int selected)
{
- ImlibPolygon poly;
+ ImlibPolygon poly;
- D_ENTER(5);
+ D_ENTER(5);
- x -= ox;
- y -= oy;
+ x -= ox;
+ y -= oy;
- imlib_context_set_image(dst);
- poly = imlib_polygon_new();
- imlib_polygon_add_point(poly, x + 2, y + 5);
- imlib_polygon_add_point(poly, x + 5, y + 7);
- imlib_polygon_add_point(poly, x + 2, y + 11);
- imlib_context_set_color(0, 0, 0, 60);
- imlib_image_fill_polygon(poly);
- imlib_polygon_free(poly);
+ imlib_context_set_image(dst);
+ poly = imlib_polygon_new();
+ imlib_polygon_add_point(poly, x + 2, y + 5);
+ imlib_polygon_add_point(poly, x + 5, y + 7);
+ imlib_polygon_add_point(poly, x + 2, y + 11);
+ imlib_context_set_color(0, 0, 0, 60);
+ imlib_image_fill_polygon(poly);
+ imlib_polygon_free(poly);
- poly = imlib_polygon_new();
- imlib_polygon_add_point(poly, x, y + 3);
- imlib_polygon_add_point(poly, x + 3, y + 6);
- imlib_polygon_add_point(poly, x, y + 9);
- imlib_context_set_color(0, 0, 0, 255);
- imlib_image_fill_polygon(poly);
- imlib_polygon_free(poly);
+ poly = imlib_polygon_new();
+ imlib_polygon_add_point(poly, x, y + 3);
+ imlib_polygon_add_point(poly, x + 3, y + 6);
+ imlib_polygon_add_point(poly, x, y + 9);
+ imlib_context_set_color(0, 0, 0, 255);
+ imlib_image_fill_polygon(poly);
+ imlib_polygon_free(poly);
- D_RETURN_(5);
- selected = 0;
+ D_RETURN_(5);
+ selected = 0;
}
void
-feh_menu_draw_separator_at(int x, int y, int w, int h, Imlib_Image dst,
- int ox, int oy)
+feh_menu_draw_separator_at(int x,
+ int y,
+ int w,
+ int h,
+ Imlib_Image dst,
+ int ox,
+ int oy)
{
- D_ENTER(5);
- feh_imlib_image_fill_rectangle(dst, x - ox + 2, y - oy + 2, w - 4, h - 4,
- 0, 0, 0, 255);
- D_RETURN_(5);
+ D_ENTER(5);
+ gib_imlib_image_fill_rectangle(dst, x - ox + 2, y - oy + 2, w - 4, h - 4, 0,
+ 0, 0, 255);
+ D_RETURN_(5);
}
void
-feh_menu_item_draw_at(int x, int y, int w, int h, Imlib_Image dst, int ox,
- int oy, int selected)
+feh_menu_item_draw_at(int x,
+ int y,
+ int w,
+ int h,
+ Imlib_Image dst,
+ int ox,
+ int oy,
+ int selected)
{
- D_ENTER(5);
- imlib_context_set_image(dst);
- if (selected)
- feh_imlib_image_fill_rectangle(dst, x - ox, y - oy, w, h, 255, 255, 255,
- 178);
- D_RETURN_(5);
+ D_ENTER(5);
+ imlib_context_set_image(dst);
+ if (selected)
+ gib_imlib_image_fill_rectangle(dst, x - ox, y - oy, w, h, 255, 255, 255,
+ 178);
+ D_RETURN_(5);
}
void
feh_raise_all_menus(void)
{
- feh_menu_list *l;
+ feh_menu_list *l;
- D_ENTER(5);
+ D_ENTER(5);
- for (l = menus; l; l = l->next)
- {
- if (l->menu->visible)
- XRaiseWindow(disp, l->menu->win);
- }
- D_RETURN_(5);
+ for (l = menus; l; l = l->next) {
+ if (l->menu->visible)
+ XRaiseWindow(disp, l->menu->win);
+ }
+ D_RETURN_(5);
}
void
feh_redraw_menus(void)
{
- feh_menu_list *l;
+ feh_menu_list *l;
- D_ENTER(5);
+ D_ENTER(5);
- for (l = menus; l; l = l->next)
- {
- if (l->menu->needs_redraw)
- feh_menu_redraw(l->menu);
- }
+ for (l = menus; l; l = l->next) {
+ if (l->menu->needs_redraw)
+ feh_menu_redraw(l->menu);
+ }
- D_RETURN_(5);
+ D_RETURN_(5);
}
feh_menu *
feh_menu_get_from_window(Window win)
{
- feh_menu_list *l;
+ feh_menu_list *l;
- D_ENTER(5);
- for (l = menus; l; l = l->next)
- if (l->menu->win == win)
- D_RETURN(5, l->menu);
- D_RETURN(5, NULL);
+ D_ENTER(5);
+ for (l = menus; l; l = l->next)
+ if (l->menu->win == win)
+ D_RETURN(5, l->menu);
+ D_RETURN(5, NULL);
}
void
feh_menu_init_main(void)
{
- feh_menu *m;
- feh_menu_item *mi;
+ feh_menu *m;
+ feh_menu_item *mi;
- D_ENTER(4);
- if (!common_menus)
- feh_menu_init_common();
-
- menu_main = feh_menu_new();
- menu_main->name = estrdup("MAIN");
-
- feh_menu_add_entry(menu_main, "File", NULL, "FILE", NULL, NULL, NULL);
- if (opt.slideshow || opt.multiwindow)
- {
+ D_ENTER(4);
+ if (!common_menus)
+ feh_menu_init_common();
+
+ menu_main = feh_menu_new();
+ menu_main->name = estrdup("MAIN");
+
+ feh_menu_add_entry(menu_main, "File", NULL, "FILE", NULL, NULL, NULL);
+ if (opt.slideshow || opt.multiwindow) {
#if 0
- feh_menu_item *mi;
+ feh_menu_item *mi;
- mi =
- feh_menu_add_entry(menu_main, "Jump to", NULL, "JUMP", NULL, NULL,
- NULL);
- mi->func_gen_sub = feh_menu_func_gen_jump;
+ mi =
+ feh_menu_add_entry(menu_main, "Jump to", NULL, "JUMP", NULL, NULL,
+ NULL);
+ mi->func_gen_sub = feh_menu_func_gen_jump;
#endif
- feh_menu_add_entry(menu_main, "Sort Filelist", NULL, "SORT", NULL, NULL,
- NULL);
- mi =
- feh_menu_add_entry(menu_main, "Image Info", NULL, "INFO", NULL, NULL,
- NULL);
- mi->func_gen_sub = feh_menu_func_gen_info;
- feh_menu_add_entry(menu_main, NULL, NULL, NULL, NULL, NULL, NULL);
- }
- mi =
- feh_menu_add_entry(menu_main, "Options", NULL, "OPTIONS", NULL, NULL,
+ feh_menu_add_entry(menu_main, "Sort Filelist", NULL, "SORT", NULL, NULL,
+ NULL);
+ mi =
+ feh_menu_add_entry(menu_main, "Image Info", NULL, "INFO", NULL, NULL,
NULL);
- mi->func_gen_sub = feh_menu_func_gen_options;
+ mi->func_gen_sub = feh_menu_func_gen_info;
+ feh_menu_add_entry(menu_main, NULL, NULL, NULL, NULL, NULL, NULL);
+ }
+ mi =
+ feh_menu_add_entry(menu_main, "Options", NULL, "OPTIONS", NULL, NULL,
+ NULL);
+ mi->func_gen_sub = feh_menu_func_gen_options;
+
+ if (!opt.full_screen)
+ feh_menu_add_entry(menu_main, "About " PACKAGE, NULL, NULL,
+ feh_menu_cb_about, NULL, NULL);
+ if (opt.multiwindow)
+ feh_menu_add_entry(menu_main, "Close", NULL, NULL, feh_menu_cb_close,
+ NULL, NULL);
+ feh_menu_add_entry(menu_main, "Exit", NULL, NULL, feh_menu_cb_exit, NULL,
+ NULL);
+
+ m = feh_menu_new();
+ m->name = estrdup("FILE");
+ feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
+ feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
+ NULL);
+ feh_menu_add_entry(m, "Reload", NULL, NULL, feh_menu_cb_reload, NULL, NULL);
+ feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
+ NULL, NULL);
+ feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
+ feh_menu_cb_save_filelist, NULL, NULL);
+ feh_menu_add_entry(m, "Edit In Place", NULL, "EDIT", NULL, NULL, NULL);
+ feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
+ feh_menu_add_entry(m, NULL, NULL, NULL, NULL, NULL, NULL);
+ feh_menu_add_entry(m, "Hide", NULL, NULL, feh_menu_cb_remove, NULL, NULL);
+ feh_menu_add_entry(m, "Delete", NULL, "CONFIRM", NULL, NULL, NULL);
- if (!opt.full_screen)
- feh_menu_add_entry(menu_main, "About " PACKAGE, NULL, NULL,
- feh_menu_cb_about, NULL, NULL);
- if (opt.multiwindow)
- feh_menu_add_entry(menu_main, "Close", NULL, NULL, feh_menu_cb_close,
- NULL, NULL);
- feh_menu_add_entry(menu_main, "Exit", NULL, NULL, feh_menu_cb_exit, NULL,
- NULL);
-
- m = feh_menu_new();
- m->name = estrdup("FILE");
- feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
- feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
- NULL);
- feh_menu_add_entry(m, "Reload", NULL, NULL, feh_menu_cb_reload, NULL,
- NULL);
- feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
- NULL, NULL);
- feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
- feh_menu_cb_save_filelist, NULL, NULL);
- feh_menu_add_entry(m, "Edit In Place", NULL, "EDIT", NULL, NULL, NULL);
- feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
- feh_menu_add_entry(m, NULL, NULL, NULL, NULL, NULL, NULL);
- feh_menu_add_entry(m, "Hide", NULL, NULL, feh_menu_cb_remove, NULL, NULL);
- feh_menu_add_entry(m, "Delete", NULL, "CONFIRM", NULL, NULL, NULL);
-
- D_RETURN_(4);
+ D_RETURN_(4);
}
void
feh_menu_init_common()
{
- int num_desks, i;
- char buf[30];
- feh_menu *m;
- feh_menu_item *mi;
-
- D_ENTER(4);
-
- if (!opt.menu_fn)
- {
- opt.menu_fn = feh_imlib_load_font(opt.menu_font);
- if (!opt.menu_fn)
- eprintf
- ("couldn't load menu font %s, did you make install?\nAre you specifying \
a nonexistant font?\nDid you tell feh where to find it with \
--fontpath?",
- opt.menu_font);
- }
-
- m = feh_menu_new();
- m->name = estrdup("SORT");
-
- feh_menu_add_entry(m, "By filename", NULL, NULL, feh_menu_cb_sort_filename,
- NULL, NULL);
- feh_menu_add_entry(m, "By image name", NULL, NULL,
- feh_menu_cb_sort_imagename, NULL, NULL);
- if (opt.preload || (opt.sort > SORT_FILENAME))
- feh_menu_add_entry(m, "By file size", NULL, NULL,
- feh_menu_cb_sort_filesize, NULL, NULL);
- feh_menu_add_entry(m, "Randomize", NULL, NULL, feh_menu_cb_sort_randomize,
- NULL, NULL);
-
- m = feh_menu_new();
- m->name = estrdup("CONFIRM");
- feh_menu_add_entry(m, "Confirm", NULL, NULL, feh_menu_cb_delete, NULL,
- NULL);
-
- m = feh_menu_new();
- m->name = estrdup("EDIT");
- feh_menu_add_entry(m, "Rotate 90 CW", NULL, NULL, feh_menu_cb_edit_rotate, (void \
*)1, NULL);
- feh_menu_add_entry(m, "Rotate 180", NULL, NULL, feh_menu_cb_edit_rotate, (void \
*)2, NULL);
- feh_menu_add_entry(m, "Rotate 90 CCW", NULL, NULL, feh_menu_cb_edit_rotate, (void \
*)3, NULL);
-
- menu_bg = feh_menu_new();
- menu_bg->name = estrdup("BACKGROUND");
-
- num_desks = feh_wm_get_num_desks();
- if (num_desks > 1)
- {
- feh_menu_add_entry(menu_bg, "Set tiled", NULL, "TILED", NULL, NULL,
- NULL);
- feh_menu_add_entry(menu_bg, "Set seamless", NULL, "SEAMLESS", NULL,
- NULL, NULL);
- feh_menu_add_entry(menu_bg, "Set scaled", NULL, "SCALED", NULL, NULL,
- NULL);
- feh_menu_add_entry(menu_bg, "Set centered", NULL, "CENTERED", NULL,
- NULL, NULL);
+ int num_desks, i;
+ char buf[30];
+ feh_menu *m;
+ feh_menu_item *mi;
- m = feh_menu_new();
- m->name = estrdup("TILED");
- for (i = 0; i < num_desks; i++)
- {
- snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
- if (opt.slideshow || opt.multiwindow)
- feh_menu_add_entry(m, buf, NULL, NULL,
- feh_menu_cb_background_set_tiled, (void *) i,
- NULL);
- else
- feh_menu_add_entry(m, buf, NULL, NULL,
- feh_menu_cb_background_set_tiled_no_file,
- (void *) i, NULL);
- }
+ D_ENTER(4);
- m = feh_menu_new();
- m->name = estrdup("SEAMLESS");
- for (i = 0; i < num_desks; i++)
- {
- snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
- feh_menu_add_entry(m, buf, NULL, NULL,
- feh_menu_cb_background_set_seamless, (void *) i,
- NULL);
- }
+ if (!opt.menu_fn) {
+ opt.menu_fn = gib_imlib_load_font(opt.menu_font);
+ if (!opt.menu_fn)
+ eprintf
+ ("couldn't load menu font %s, did you make install?\nAre you specifying a \
nonexistant font?\nDid you tell feh where to find it with --fontpath?", + \
opt.menu_font); + }
+ if (!opt.menu_style_l) {
+ opt.menu_style_l = gib_style_new_from_ascii(opt.menu_style);
+ if (!opt.menu_style_l) {
+ weprintf
+ ("couldn't load style file for menu fonts, (%s).\nDid you make install? \
Menus will look boring without the style file.", + opt.menu_style);
+ }
+ }
+
+ m = feh_menu_new();
+ m->name = estrdup("SORT");
+
+ feh_menu_add_entry(m, "By filename", NULL, NULL, feh_menu_cb_sort_filename,
+ NULL, NULL);
+ feh_menu_add_entry(m, "By image name", NULL, NULL,
+ feh_menu_cb_sort_imagename, NULL, NULL);
+ if (opt.preload || (opt.sort > SORT_FILENAME))
+ feh_menu_add_entry(m, "By file size", NULL, NULL,
+ feh_menu_cb_sort_filesize, NULL, NULL);
+ feh_menu_add_entry(m, "Randomize", NULL, NULL, feh_menu_cb_sort_randomize,
+ NULL, NULL);
+
+ m = feh_menu_new();
+ m->name = estrdup("CONFIRM");
+ feh_menu_add_entry(m, "Confirm", NULL, NULL, feh_menu_cb_delete, NULL,
+ NULL);
+
+ m = feh_menu_new();
+ m->name = estrdup("EDIT");
+ feh_menu_add_entry(m, "Rotate 90 CW", NULL, NULL, feh_menu_cb_edit_rotate,
+ (void *) 1, NULL);
+ feh_menu_add_entry(m, "Rotate 180", NULL, NULL, feh_menu_cb_edit_rotate,
+ (void *) 2, NULL);
+ feh_menu_add_entry(m, "Rotate 90 CCW", NULL, NULL, feh_menu_cb_edit_rotate,
+ (void *) 3, NULL);
+
+ menu_bg = feh_menu_new();
+ menu_bg->name = estrdup("BACKGROUND");
+
+ num_desks = feh_wm_get_num_desks();
+ if (num_desks > 1) {
+ feh_menu_add_entry(menu_bg, "Set tiled", NULL, "TILED", NULL, NULL, NULL);
+ feh_menu_add_entry(menu_bg, "Set seamless", NULL, "SEAMLESS", NULL, NULL,
+ NULL);
+ feh_menu_add_entry(menu_bg, "Set scaled", NULL, "SCALED", NULL, NULL,
+ NULL);
+ feh_menu_add_entry(menu_bg, "Set centered", NULL, "CENTERED", NULL, NULL,
+ NULL);
+
+ m = feh_menu_new();
+ m->name = estrdup("TILED");
+ for (i = 0; i < num_desks; i++) {
+ snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
+ if (opt.slideshow || opt.multiwindow)
+ feh_menu_add_entry(m, buf, NULL, NULL,
+ feh_menu_cb_background_set_tiled, (void *) i,
+ NULL);
+ else
+ feh_menu_add_entry(m, buf, NULL, NULL,
+ feh_menu_cb_background_set_tiled_no_file,
+ (void *) i, NULL);
+ }
+
+ m = feh_menu_new();
+ m->name = estrdup("SEAMLESS");
+ for (i = 0; i < num_desks; i++) {
+ snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
+ feh_menu_add_entry(m, buf, NULL, NULL,
+ feh_menu_cb_background_set_seamless, (void *) i,
+ NULL);
+ }
- m = feh_menu_new();
- m->name = estrdup("SCALED");
- for (i = 0; i < num_desks; i++)
- {
- snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
-
- if (opt.slideshow || opt.multiwindow)
- feh_menu_add_entry(m, buf, NULL, NULL,
- feh_menu_cb_background_set_scaled, (void *) i,
- NULL);
- else
- feh_menu_add_entry(m, buf, NULL, NULL,
- feh_menu_cb_background_set_scaled_no_file,
- (void *) i, NULL);
- }
+ m = feh_menu_new();
+ m->name = estrdup("SCALED");
+ for (i = 0; i < num_desks; i++) {
+ snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
- m = feh_menu_new();
- m->name = estrdup("CENTERED");
- for (i = 0; i < num_desks; i++)
- {
- snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
- if (opt.slideshow || opt.multiwindow)
- feh_menu_add_entry(m, buf, NULL, NULL,
- feh_menu_cb_background_set_centered,
- (void *) i, NULL);
- else
- feh_menu_add_entry(m, buf, NULL, NULL,
- feh_menu_cb_background_set_centered_no_file,
- (void *) i, NULL);
- }
- }
- else
- {
if (opt.slideshow || opt.multiwindow)
- {
- feh_menu_add_entry(menu_bg, "Set tiled", NULL, NULL,
- feh_menu_cb_background_set_tiled, NULL, NULL);
- feh_menu_add_entry(menu_bg, "Set seamless", NULL, NULL,
- feh_menu_cb_background_set_seamless, NULL, NULL);
- feh_menu_add_entry(menu_bg, "Set scaled", NULL, NULL,
- feh_menu_cb_background_set_scaled, NULL, NULL);
- feh_menu_add_entry(menu_bg, "Set centered", NULL, NULL,
- feh_menu_cb_background_set_centered, NULL, NULL);
- }
+ feh_menu_add_entry(m, buf, NULL, NULL,
+ feh_menu_cb_background_set_scaled, (void *) i,
+ NULL);
else
- {
- feh_menu_add_entry(menu_bg, "Set tiled", NULL, NULL,
- feh_menu_cb_background_set_tiled_no_file, NULL,
- NULL);
- feh_menu_add_entry(menu_bg, "Set seamless", NULL, NULL,
- feh_menu_cb_background_set_seamless, NULL, NULL);
- feh_menu_add_entry(menu_bg, "Set scaled", NULL, NULL,
- feh_menu_cb_background_set_scaled_no_file, NULL,
- NULL);
- feh_menu_add_entry(menu_bg, "Set centered", NULL, NULL,
- feh_menu_cb_background_set_centered_no_file, NULL,
- NULL);
- }
- }
- common_menus = 1;
+ feh_menu_add_entry(m, buf, NULL, NULL,
+ feh_menu_cb_background_set_scaled_no_file,
+ (void *) i, NULL);
+ }
+
+ m = feh_menu_new();
+ m->name = estrdup("CENTERED");
+ for (i = 0; i < num_desks; i++) {
+ snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
+ if (opt.slideshow || opt.multiwindow)
+ feh_menu_add_entry(m, buf, NULL, NULL,
+ feh_menu_cb_background_set_centered, (void *) i,
+ NULL);
+ else
+ feh_menu_add_entry(m, buf, NULL, NULL,
+ feh_menu_cb_background_set_centered_no_file,
+ (void *) i, NULL);
+ }
+ } else {
+ if (opt.slideshow || opt.multiwindow) {
+ feh_menu_add_entry(menu_bg, "Set tiled", NULL, NULL,
+ feh_menu_cb_background_set_tiled, NULL, NULL);
+ feh_menu_add_entry(menu_bg, "Set seamless", NULL, NULL,
+ feh_menu_cb_background_set_seamless, NULL, NULL);
+ feh_menu_add_entry(menu_bg, "Set scaled", NULL, NULL,
+ feh_menu_cb_background_set_scaled, NULL, NULL);
+ feh_menu_add_entry(menu_bg, "Set centered", NULL, NULL,
+ feh_menu_cb_background_set_centered, NULL, NULL);
+ } else {
+ feh_menu_add_entry(menu_bg, "Set tiled", NULL, NULL,
+ feh_menu_cb_background_set_tiled_no_file, NULL,
+ NULL);
+ feh_menu_add_entry(menu_bg, "Set seamless", NULL, NULL,
+ feh_menu_cb_background_set_seamless, NULL, NULL);
+ feh_menu_add_entry(menu_bg, "Set scaled", NULL, NULL,
+ feh_menu_cb_background_set_scaled_no_file, NULL,
+ NULL);
+ feh_menu_add_entry(menu_bg, "Set centered", NULL, NULL,
+ feh_menu_cb_background_set_centered_no_file, NULL,
+ NULL);
+ }
+ }
+ common_menus = 1;
- D_RETURN_(4);
+ D_RETURN_(4);
}
void
feh_menu_init_about_win(void)
{
- D_ENTER(4);
+ D_ENTER(4);
- menu_about_win = feh_menu_new();
- menu_about_win->name = estrdup("ABOUTWIN");
+ menu_about_win = feh_menu_new();
+ menu_about_win->name = estrdup("ABOUTWIN");
- feh_menu_add_entry(menu_about_win, "Close", NULL, NULL, feh_menu_cb_close,
- NULL, NULL);
- feh_menu_add_entry(menu_about_win, "Exit", NULL, NULL, feh_menu_cb_exit,
- NULL, NULL);
+ feh_menu_add_entry(menu_about_win, "Close", NULL, NULL, feh_menu_cb_close,
+ NULL, NULL);
+ feh_menu_add_entry(menu_about_win, "Exit", NULL, NULL, feh_menu_cb_exit,
+ NULL, NULL);
- D_RETURN_(4);
+ D_RETURN_(4);
}
void
feh_menu_init_single_win(void)
{
- feh_menu *m;
- feh_menu_item *mi;
+ feh_menu *m;
+ feh_menu_item *mi;
- D_ENTER(4);
- if (!common_menus)
- feh_menu_init_common();
-
- menu_single_win = feh_menu_new();
- menu_single_win->name = estrdup("SINGLEWIN");
-
- feh_menu_add_entry(menu_single_win, "File", NULL, "SINGLEWIN_FILE", NULL,
- NULL, NULL);
- m = feh_menu_new();
- m->name = estrdup("SINGLEWIN_FILE");
- feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
- feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
- NULL);
- feh_menu_add_entry(m, "Reload", NULL, NULL, feh_menu_cb_reload, NULL,
- NULL);
- feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
- NULL, NULL);
- feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
- feh_menu_cb_save_filelist, NULL, NULL);
- feh_menu_add_entry(m, "Edit In Place", NULL, "EDIT", NULL, NULL, NULL);
- feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
- if (opt.multiwindow || opt.slideshow)
- {
- feh_menu_add_entry(m, NULL, NULL, NULL, NULL, NULL, NULL);
- feh_menu_add_entry(m, "Hide", NULL, NULL, feh_menu_cb_remove, NULL,
- NULL);
- feh_menu_add_entry(m, "Delete", NULL, "CONFIRM", NULL, NULL, NULL);
- }
+ D_ENTER(4);
+ if (!common_menus)
+ feh_menu_init_common();
- mi =
- feh_menu_add_entry(menu_single_win, "Image Info", NULL, "INFO", NULL,
- NULL, NULL);
- mi->func_gen_sub = feh_menu_func_gen_info;
- feh_menu_add_entry(menu_single_win, NULL, NULL, NULL, NULL, NULL, NULL);
- mi =
- feh_menu_add_entry(menu_single_win, "Options", NULL, "OPTIONS", NULL,
- NULL, NULL);
- mi->func_gen_sub = feh_menu_func_gen_options;
- feh_menu_add_entry(menu_single_win, "About " PACKAGE, NULL, NULL,
- feh_menu_cb_about, NULL, NULL);
- feh_menu_add_entry(menu_single_win, "Close", NULL, NULL, feh_menu_cb_close,
- NULL, NULL);
- feh_menu_add_entry(menu_single_win, "Exit", NULL, NULL, feh_menu_cb_exit,
- NULL, NULL);
+ menu_single_win = feh_menu_new();
+ menu_single_win->name = estrdup("SINGLEWIN");
- D_RETURN_(4);
+ feh_menu_add_entry(menu_single_win, "File", NULL, "SINGLEWIN_FILE", NULL,
+ NULL, NULL);
+ m = feh_menu_new();
+ m->name = estrdup("SINGLEWIN_FILE");
+ feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
+ feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
+ NULL);
+ feh_menu_add_entry(m, "Reload", NULL, NULL, feh_menu_cb_reload, NULL, NULL);
+ feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
+ NULL, NULL);
+ feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
+ feh_menu_cb_save_filelist, NULL, NULL);
+ feh_menu_add_entry(m, "Edit In Place", NULL, "EDIT", NULL, NULL, NULL);
+ feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
+ if (opt.multiwindow || opt.slideshow) {
+ feh_menu_add_entry(m, NULL, NULL, NULL, NULL, NULL, NULL);
+ feh_menu_add_entry(m, "Hide", NULL, NULL, feh_menu_cb_remove, NULL, NULL);
+ feh_menu_add_entry(m, "Delete", NULL, "CONFIRM", NULL, NULL, NULL);
+ }
+
+ mi =
+ feh_menu_add_entry(menu_single_win, "Image Info", NULL, "INFO", NULL,
+ NULL, NULL);
+ mi->func_gen_sub = feh_menu_func_gen_info;
+ feh_menu_add_entry(menu_single_win, NULL, NULL, NULL, NULL, NULL, NULL);
+ mi =
+ feh_menu_add_entry(menu_single_win, "Options", NULL, "OPTIONS", NULL,
+ NULL, NULL);
+ mi->func_gen_sub = feh_menu_func_gen_options;
+ feh_menu_add_entry(menu_single_win, "About " PACKAGE, NULL, NULL,
+ feh_menu_cb_about, NULL, NULL);
+ feh_menu_add_entry(menu_single_win, "Close", NULL, NULL, feh_menu_cb_close,
+ NULL, NULL);
+ feh_menu_add_entry(menu_single_win, "Exit", NULL, NULL, feh_menu_cb_exit,
+ NULL, NULL);
+
+ D_RETURN_(4);
}
void
feh_menu_init_thumbnail_win(void)
{
- feh_menu *m;
- feh_menu_item *mi;
+ feh_menu *m;
+ feh_menu_item *mi;
+
+ D_ENTER(4);
+ if (!common_menus)
+ feh_menu_init_common();
+
+ menu_thumbnail_win = feh_menu_new();
+ menu_thumbnail_win->name = estrdup("THUMBWIN");
- D_ENTER(4);
- if (!common_menus)
- feh_menu_init_common();
-
- menu_thumbnail_win = feh_menu_new();
- menu_thumbnail_win->name = estrdup("THUMBWIN");
-
- feh_menu_add_entry(menu_thumbnail_win, "File", NULL, "THUMBWIN_FILE", NULL,
- NULL, NULL);
- m = feh_menu_new();
- m->name = estrdup("THUMBWIN_FILE");
- feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
- feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
- NULL);
- feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
- NULL, NULL);
- feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
- feh_menu_cb_save_filelist, NULL, NULL);
- feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
- feh_menu_add_entry(menu_thumbnail_win, NULL, NULL, NULL, NULL, NULL, NULL);
- mi =
- feh_menu_add_entry(menu_thumbnail_win, "Options", NULL, "OPTIONS", NULL,
- NULL, NULL);
- mi->func_gen_sub = feh_menu_func_gen_options;
- feh_menu_add_entry(menu_thumbnail_win, "About " PACKAGE, NULL, NULL,
- feh_menu_cb_about, NULL, NULL);
- feh_menu_add_entry(menu_thumbnail_win, "Close", NULL, NULL,
- feh_menu_cb_close, NULL, NULL);
- feh_menu_add_entry(menu_thumbnail_win, "Exit", NULL, NULL,
- feh_menu_cb_exit, NULL, NULL);
- D_RETURN_(4);
+ feh_menu_add_entry(menu_thumbnail_win, "File", NULL, "THUMBWIN_FILE", NULL,
+ NULL, NULL);
+ m = feh_menu_new();
+ m->name = estrdup("THUMBWIN_FILE");
+ feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
+ feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
+ NULL);
+ feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
+ NULL, NULL);
+ feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
+ feh_menu_cb_save_filelist, NULL, NULL);
+ feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
+ feh_menu_add_entry(menu_thumbnail_win, NULL, NULL, NULL, NULL, NULL, NULL);
+ mi =
+ feh_menu_add_entry(menu_thumbnail_win, "Options", NULL, "OPTIONS", NULL,
+ NULL, NULL);
+ mi->func_gen_sub = feh_menu_func_gen_options;
+ feh_menu_add_entry(menu_thumbnail_win, "About " PACKAGE, NULL, NULL,
+ feh_menu_cb_about, NULL, NULL);
+ feh_menu_add_entry(menu_thumbnail_win, "Close", NULL, NULL,
+ feh_menu_cb_close, NULL, NULL);
+ feh_menu_add_entry(menu_thumbnail_win, "Exit", NULL, NULL, feh_menu_cb_exit,
+ NULL, NULL);
+ D_RETURN_(4);
}
void
feh_menu_init_thumbnail_viewer(void)
+{
+ feh_menu *m;
+ feh_menu_item *mi;
+
+ D_ENTER(4);
+ if (!common_menus)
+ feh_menu_init_common();
+
+ menu_thumbnail_viewer = feh_menu_new();
+ menu_thumbnail_viewer->name = estrdup("THUMBVIEW");
+
+ feh_menu_add_entry(menu_thumbnail_viewer, "File", NULL, "THUMBVIEW_FILE",
+ NULL, NULL, NULL);
+ m = feh_menu_new();
+ m->name = estrdup("THUMBVIEW_FILE");
+ feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
+ feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
+ NULL);
+ feh_menu_add_entry(m, "Reload", NULL, NULL, feh_menu_cb_reload, NULL, NULL);
+ feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
+ NULL, NULL);
+ feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
+ feh_menu_cb_save_filelist, NULL, NULL);
+ feh_menu_add_entry(m, "Edit In Place", NULL, "EDIT", NULL, NULL, NULL);
+ feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
+ feh_menu_add_entry(m, NULL, NULL, NULL, NULL, NULL, NULL);
+ feh_menu_add_entry(m, "Hide", NULL, NULL, feh_menu_cb_remove_thumb, NULL,
+ NULL);
+ feh_menu_add_entry(m, "Delete", NULL, "THUMBVIEW_CONFIRM", NULL, NULL,
+ NULL);
+ mi =
+ feh_menu_add_entry(menu_thumbnail_viewer, "Image Info", NULL, "INFO",
+ NULL, NULL, NULL);
+ mi->func_gen_sub = feh_menu_func_gen_info;
+ feh_menu_add_entry(menu_thumbnail_viewer, NULL, NULL, NULL, NULL, NULL,
+ NULL);
+ mi =
+ feh_menu_add_entry(menu_thumbnail_viewer, "Options", NULL, "OPTIONS",
+ NULL, NULL, NULL);
+ mi->func_gen_sub = feh_menu_func_gen_options;
+ feh_menu_add_entry(menu_thumbnail_viewer, "About " PACKAGE, NULL, NULL,
+ feh_menu_cb_about, NULL, NULL);
+ feh_menu_add_entry(menu_thumbnail_viewer, "Close", NULL, NULL,
+ feh_menu_cb_close, NULL, NULL);
+ feh_menu_add_entry(menu_thumbnail_viewer, "Exit", NULL, NULL,
+ feh_menu_cb_exit, NULL, NULL);
+ m = feh_menu_new();
+ m->name = estrdup("THUMBVIEW_CONFIRM");
+ feh_menu_add_entry(m, "Confirm", NULL, NULL, feh_menu_cb_delete_thumb, NULL,
+ NULL);
+ D_RETURN_(4);
+}
+
+static void
+feh_menu_cb_background_set_tiled(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- feh_menu *m;
- feh_menu_item *mi;
+ char *path;
- D_ENTER(4);
- if (!common_menus)
- feh_menu_init_common();
-
- menu_thumbnail_viewer = feh_menu_new();
- menu_thumbnail_viewer->name = estrdup("THUMBVIEW");
-
- feh_menu_add_entry(menu_thumbnail_viewer, "File", NULL, "THUMBVIEW_FILE",
- NULL, NULL, NULL);
- m = feh_menu_new();
- m->name = estrdup("THUMBVIEW_FILE");
- feh_menu_add_entry(m, "Reset", NULL, NULL, feh_menu_cb_reset, NULL, NULL);
- feh_menu_add_entry(m, "Resize win", NULL, NULL, feh_menu_cb_fit, NULL,
- NULL);
- feh_menu_add_entry(m, "Reload", NULL, NULL, feh_menu_cb_reload, NULL,
- NULL);
- feh_menu_add_entry(m, "Save Image", NULL, NULL, feh_menu_cb_save_image,
- NULL, NULL);
- feh_menu_add_entry(m, "Save Filelist", NULL, NULL,
- feh_menu_cb_save_filelist, NULL, NULL);
- feh_menu_add_entry(m, "Edit In Place", NULL, "EDIT", NULL, NULL, NULL);
- feh_menu_add_entry(m, "Background", NULL, "BACKGROUND", NULL, NULL, NULL);
- feh_menu_add_entry(m, NULL, NULL, NULL, NULL, NULL, NULL);
- feh_menu_add_entry(m, "Hide", NULL, NULL, feh_menu_cb_remove_thumb, NULL,
- NULL);
- feh_menu_add_entry(m, "Delete", NULL, "THUMBVIEW_CONFIRM", NULL, NULL,
- NULL);
- mi =
- feh_menu_add_entry(menu_thumbnail_viewer, "Image Info", NULL, "INFO",
- NULL, NULL, NULL);
- mi->func_gen_sub = feh_menu_func_gen_info;
- feh_menu_add_entry(menu_thumbnail_viewer, NULL, NULL, NULL, NULL, NULL,
- NULL);
- mi =
- feh_menu_add_entry(menu_thumbnail_viewer, "Options", NULL, "OPTIONS",
- NULL, NULL, NULL);
- mi->func_gen_sub = feh_menu_func_gen_options;
- feh_menu_add_entry(menu_thumbnail_viewer, "About " PACKAGE, NULL, NULL,
- feh_menu_cb_about, NULL, NULL);
- feh_menu_add_entry(menu_thumbnail_viewer, "Close", NULL, NULL,
- feh_menu_cb_close, NULL, NULL);
- feh_menu_add_entry(menu_thumbnail_viewer, "Exit", NULL, NULL,
- feh_menu_cb_exit, NULL, NULL);
- m = feh_menu_new();
- m->name = estrdup("THUMBVIEW_CONFIRM");
- feh_menu_add_entry(m, "Confirm", NULL, NULL, feh_menu_cb_delete_thumb,
- NULL, NULL);
- D_RETURN_(4);
-}
-
-static void
-feh_menu_cb_background_set_tiled(feh_menu * m, feh_menu_item * i, void *data)
-{
- char *path;
-
- D_ENTER(4);
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
- feh_wm_set_bg(path, m->fehwin->im, 0, 0, (int) data, 1);
- free(path);
- D_RETURN_(4);
- i = NULL;
+ D_ENTER(4);
+ path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ feh_wm_set_bg(path, m->fehwin->im, 0, 0, (int) data, 1);
+ free(path);
+ D_RETURN_(4);
+ i = NULL;
}
static void
-feh_menu_cb_background_set_seamless(feh_menu * m, feh_menu_item * i,
+feh_menu_cb_background_set_seamless(feh_menu * m,
+ feh_menu_item * i,
void *data)
{
- Imlib_Image im;
+ Imlib_Image im;
- D_ENTER(4);
- im = feh_imlib_clone_image(m->fehwin->im);
- feh_imlib_image_tile(im);
- feh_wm_set_bg(NULL, im, 0, 0, (int) data, 1);
- feh_imlib_free_image_and_decache(im);
- D_RETURN_(4);
- i = NULL;
+ D_ENTER(4);
+ im = gib_imlib_clone_image(m->fehwin->im);
+ gib_imlib_image_tile(im);
+ feh_wm_set_bg(NULL, im, 0, 0, (int) data, 1);
+ gib_imlib_free_image_and_decache(im);
+ D_RETURN_(4);
+ i = NULL;
}
static void
-feh_menu_cb_background_set_scaled(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_background_set_scaled(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- char *path;
+ char *path;
- D_ENTER(4);
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
- feh_wm_set_bg(path, m->fehwin->im, 0, 1, (int) data, 1);
- free(path);
- D_RETURN_(4);
- i = NULL;
+ D_ENTER(4);
+ path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ feh_wm_set_bg(path, m->fehwin->im, 0, 1, (int) data, 1);
+ free(path);
+ D_RETURN_(4);
+ i = NULL;
}
static void
-feh_menu_cb_background_set_centered(feh_menu * m, feh_menu_item * i,
+feh_menu_cb_background_set_centered(feh_menu * m,
+ feh_menu_item * i,
void *data)
{
- char *path;
+ char *path;
- D_ENTER(4);
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
- feh_wm_set_bg(path, m->fehwin->im, 1, 0, (int) data, 1);
- free(path);
- D_RETURN_(4);
- i = NULL;
+ D_ENTER(4);
+ path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ feh_wm_set_bg(path, m->fehwin->im, 1, 0, (int) data, 1);
+ free(path);
+ D_RETURN_(4);
+ i = NULL;
}
static void
-feh_menu_cb_background_set_tiled_no_file(feh_menu * m, feh_menu_item * i,
+feh_menu_cb_background_set_tiled_no_file(feh_menu * m,
+ feh_menu_item * i,
void *data)
{
- D_ENTER(4);
- feh_wm_set_bg(NULL, m->fehwin->im, 0, 0, (int) data, 1);
- D_RETURN_(4);
- i = NULL;
+ D_ENTER(4);
+ feh_wm_set_bg(NULL, m->fehwin->im, 0, 0, (int) data, 1);
+ D_RETURN_(4);
+ i = NULL;
}
static void
-feh_menu_cb_background_set_scaled_no_file(feh_menu * m, feh_menu_item * i,
+feh_menu_cb_background_set_scaled_no_file(feh_menu * m,
+ feh_menu_item * i,
void *data)
{
- D_ENTER(4);
- feh_wm_set_bg(NULL, m->fehwin->im, 0, 1, (int) data, 1);
- D_RETURN_(4);
- i = NULL;
+ D_ENTER(4);
+ feh_wm_set_bg(NULL, m->fehwin->im, 0, 1, (int) data, 1);
+ D_RETURN_(4);
+ i = NULL;
}
static void
-feh_menu_cb_background_set_centered_no_file(feh_menu * m, feh_menu_item * i,
+feh_menu_cb_background_set_centered_no_file(feh_menu * m,
+ feh_menu_item * i,
void *data)
{
- D_ENTER(4);
- feh_wm_set_bg(NULL, m->fehwin->im, 1, 0, (int) data, 1);
- D_RETURN_(4);
- i = NULL;
+ D_ENTER(4);
+ feh_wm_set_bg(NULL, m->fehwin->im, 1, 0, (int) data, 1);
+ D_RETURN_(4);
+ i = NULL;
}
static void
-feh_menu_cb_about(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_about(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- Imlib_Image im;
- winwidget winwid;
+ Imlib_Image im;
+ winwidget winwid;
- D_ENTER(4);
- if (feh_load_image_char(&im, PREFIX "/share/feh/images/about.png") != 0)
- {
- winwid =
- winwidget_create_from_image(im, "About " PACKAGE, WIN_TYPE_ABOUT);
- winwid->file =
- feh_list_add_front(NULL,
- feh_file_new(PREFIX
- "/share/feh/images/about.png"));
- winwidget_show(winwid);
- }
- D_RETURN_(4);
- m = NULL;
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ if (feh_load_image_char(&im, PREFIX "/share/feh/images/about.png") != 0) {
+ winwid =
+ winwidget_create_from_image(im, "About " PACKAGE, WIN_TYPE_ABOUT);
+ winwid->file =
+ gib_list_add_front(NULL,
+ feh_file_new(PREFIX "/share/feh/images/about.png"));
+ winwidget_show(winwid);
+ }
+ D_RETURN_(4);
+ m = NULL;
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_close(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_close(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- winwidget_destroy(m->fehwin);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ winwidget_destroy(m->fehwin);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_exit(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_exit(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- winwidget_destroy_all();
- D_RETURN_(4);
- m = NULL;
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ winwidget_destroy_all();
+ D_RETURN_(4);
+ m = NULL;
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_reset(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_reset(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- if (m->fehwin->has_rotated)
- {
- m->fehwin->im_w = feh_imlib_image_get_width(m->fehwin->im);
- m->fehwin->im_h = feh_imlib_image_get_height(m->fehwin->im);
- winwidget_resize(m->fehwin, m->fehwin->im_w, m->fehwin->im_h);
- }
- winwidget_reset_image(m->fehwin);
- winwidget_render_image(m->fehwin, 1, 1);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ if (m->fehwin->has_rotated) {
+ m->fehwin->im_w = gib_imlib_image_get_width(m->fehwin->im);
+ m->fehwin->im_h = gib_imlib_image_get_height(m->fehwin->im);
+ winwidget_resize(m->fehwin, m->fehwin->im_w, m->fehwin->im_h);
+ }
+ winwidget_reset_image(m->fehwin);
+ winwidget_render_image(m->fehwin, 1, 1);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_reload(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_reload(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- feh_reload_image(m->fehwin, 0);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ feh_reload_image(m->fehwin, 0);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_remove(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_remove(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- feh_filelist_image_remove(m->fehwin, 0);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ feh_filelist_image_remove(m->fehwin, 0);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_delete(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_delete(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- feh_filelist_image_remove(m->fehwin, 1);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ feh_filelist_image_remove(m->fehwin, 1);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_remove_thumb(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_remove_thumb(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- feh_thumbnail_mark_removed(FEH_FILE(m->fehwin->file->data), 0);
- feh_filelist_image_remove(m->fehwin, 0);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ feh_thumbnail_mark_removed(FEH_FILE(m->fehwin->file->data), 0);
+ feh_filelist_image_remove(m->fehwin, 0);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_delete_thumb(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_delete_thumb(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- feh_thumbnail_mark_removed(FEH_FILE(m->fehwin->file->data), 1);
- feh_filelist_image_remove(m->fehwin, 1);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ feh_thumbnail_mark_removed(FEH_FILE(m->fehwin->file->data), 1);
+ feh_filelist_image_remove(m->fehwin, 1);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_sort_filename(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_sort_filename(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- filelist = feh_list_sort(filelist, feh_cmp_filename);
- slideshow_change_image(m->fehwin, SLIDE_FIRST);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ filelist = gib_list_sort(filelist, feh_cmp_filename);
+ slideshow_change_image(m->fehwin, SLIDE_FIRST);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_sort_imagename(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_sort_imagename(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- filelist = feh_list_sort(filelist, feh_cmp_name);
- slideshow_change_image(m->fehwin, SLIDE_FIRST);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ filelist = gib_list_sort(filelist, feh_cmp_name);
+ slideshow_change_image(m->fehwin, SLIDE_FIRST);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_sort_filesize(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_sort_filesize(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- filelist = feh_list_sort(filelist, feh_cmp_size);
- slideshow_change_image(m->fehwin, SLIDE_FIRST);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ filelist = gib_list_sort(filelist, feh_cmp_size);
+ slideshow_change_image(m->fehwin, SLIDE_FIRST);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_cb_sort_randomize(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_sort_randomize(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- filelist = feh_list_randomize(filelist);
- slideshow_change_image(m->fehwin, SLIDE_FIRST);
- D_RETURN_(4);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ filelist = gib_list_randomize(filelist);
+ slideshow_change_image(m->fehwin, SLIDE_FIRST);
+ D_RETURN_(4);
+ i = NULL;
+ data = NULL;
}
static feh_menu *
-feh_menu_func_gen_jump(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_func_gen_jump(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- feh_menu *mm;
- feh_list *l;
+ feh_menu *mm;
+ gib_list *l;
- D_ENTER(4);
- mm = feh_menu_new();
- mm->name = estrdup("JUMP");
- for (l = filelist; l; l = l->next)
- {
- feh_menu_add_entry(mm, FEH_FILE(l->data)->name, NULL, NULL,
- feh_menu_cb_jump_to, l, NULL);
- }
- D_RETURN(4, mm);
- m = NULL;
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ mm = feh_menu_new();
+ mm->name = estrdup("JUMP");
+ for (l = filelist; l; l = l->next) {
+ feh_menu_add_entry(mm, FEH_FILE(l->data)->name, NULL, NULL,
+ feh_menu_cb_jump_to, l, NULL);
+ }
+ D_RETURN(4, mm);
+ m = NULL;
+ i = NULL;
+ data = NULL;
}
static feh_menu *
-feh_menu_func_gen_info(feh_menu * m, feh_menu_item * i, void *data)
-{
- Imlib_Image im;
- feh_menu *mm;
- feh_file *file;
- char buffer[400];
-
- D_ENTER(4);
- if (!m->fehwin->file)
- D_RETURN(4, NULL);
- file = FEH_FILE(m->fehwin->file->data);
- im = m->fehwin->im;
- if (!im)
- D_RETURN(4, NULL);
- mm = feh_menu_new();
- mm->name = estrdup("INFO");
- snprintf(buffer, sizeof(buffer), "Filename: %s", file->name);
- feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
- if (!file->info)
- feh_file_info_load(file, im);
- if (file->info)
- {
- snprintf(buffer, sizeof(buffer), "Size: %dKb", file->info->size / 1024);
- feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
- snprintf(buffer, sizeof(buffer), "Dimensions: %dx%d", file->info->width,
- file->info->height);
- feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
- snprintf(buffer, sizeof(buffer), "Type: %s", file->info->format);
- feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
- }
-
- mm->func_free = feh_menu_func_free_info;
- D_RETURN(4, mm);
- i = NULL;
- data = NULL;
+feh_menu_func_gen_info(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
+{
+ Imlib_Image im;
+ feh_menu *mm;
+ feh_file *file;
+ char buffer[400];
+
+ D_ENTER(4);
+ if (!m->fehwin->file)
+ D_RETURN(4, NULL);
+ file = FEH_FILE(m->fehwin->file->data);
+ im = m->fehwin->im;
+ if (!im)
+ D_RETURN(4, NULL);
+ mm = feh_menu_new();
+ mm->name = estrdup("INFO");
+ snprintf(buffer, sizeof(buffer), "Filename: %s", file->name);
+ feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
+ if (!file->info)
+ feh_file_info_load(file, im);
+ if (file->info) {
+ snprintf(buffer, sizeof(buffer), "Size: %dKb", file->info->size / 1024);
+ feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
+ snprintf(buffer, sizeof(buffer), "Dimensions: %dx%d", file->info->width,
+ file->info->height);
+ feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
+ snprintf(buffer, sizeof(buffer), "Type: %s", file->info->format);
+ feh_menu_add_entry(mm, buffer, NULL, NULL, NULL, NULL, NULL);
+ }
+
+ mm->func_free = feh_menu_func_free_info;
+ D_RETURN(4, mm);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_func_free_info(feh_menu * m, void *data)
-{
- D_ENTER(4);
- feh_menu_free(m);
- D_RETURN_(4);
- data = NULL;
+feh_menu_func_free_info(feh_menu * m,
+ void *data)
+{
+ D_ENTER(4);
+ feh_menu_free(m);
+ D_RETURN_(4);
+ data = NULL;
}
static feh_menu *
-feh_menu_func_gen_options(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_func_gen_options(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- feh_menu *mm;
+ feh_menu *mm;
- D_ENTER(4);
- mm = feh_menu_new();
- mm->name = estrdup("OPTIONS");
- mm->fehwin = m->fehwin;
- feh_menu_add_toggle_entry(mm, "Freeze window size", NULL, NULL,
- feh_menu_cb_opt_freeze_window, NULL, NULL,
- opt.geom);
- feh_menu_add_toggle_entry(mm, "Fullscreen", NULL, NULL,
- feh_menu_cb_opt_fullscreen, NULL, NULL,
- m->fehwin->full_screen);
- feh_menu_add_entry(mm, NULL, NULL, NULL, NULL, NULL, NULL);
- feh_menu_add_toggle_entry(mm, "Draw Filename", NULL, NULL,
- feh_menu_cb_opt_draw_filename, NULL, NULL,
- opt.draw_filename);
- feh_menu_add_toggle_entry(mm, "Keep http files", NULL, NULL,
- feh_menu_cb_opt_keep_http, NULL, NULL,
- opt.keep_http);
- mm->func_free = feh_menu_func_free_options;
- D_RETURN(4, mm);
- i = NULL;
- data = NULL;
+ D_ENTER(4);
+ mm = feh_menu_new();
+ mm->name = estrdup("OPTIONS");
+ mm->fehwin = m->fehwin;
+ feh_menu_add_toggle_entry(mm, "Freeze window size", NULL, NULL,
+ feh_menu_cb_opt_freeze_window, NULL, NULL,
+ opt.geom);
+ feh_menu_add_toggle_entry(mm, "Fullscreen", NULL, NULL,
+ feh_menu_cb_opt_fullscreen, NULL, NULL,
+ m->fehwin->full_screen);
+ feh_menu_add_entry(mm, NULL, NULL, NULL, NULL, NULL, NULL);
+ feh_menu_add_toggle_entry(mm, "Draw Filename", NULL, NULL,
+ feh_menu_cb_opt_draw_filename, NULL, NULL,
+ opt.draw_filename);
+ feh_menu_add_toggle_entry(mm, "Keep http files", NULL, NULL,
+ feh_menu_cb_opt_keep_http, NULL, NULL,
+ opt.keep_http);
+ mm->func_free = feh_menu_func_free_options;
+ D_RETURN(4, mm);
+ i = NULL;
+ data = NULL;
}
static void
-feh_menu_func_free_options(feh_menu * m, void *data)
+feh_menu_func_free_options(feh_menu * m,
+ void *data)
{
- D_ENTER(4);
- feh_menu_free(m);
- D_RETURN_(4);
- data = NULL;
+ D_ENTER(4);
+ feh_menu_free(m);
+ D_RETURN_(4);
+ data = NULL;
}
static void
-feh_menu_cb_jump_to(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_jump_to(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- feh_list *l;
+ gib_list *l;
- D_ENTER(4);
- l = (feh_list *) data;
- if (l->prev)
- {
- current_file = l->prev;
- slideshow_change_image(m->fehwin, SLIDE_NEXT);
- }
- else if (l->next)
- {
- current_file = l->next;
- slideshow_change_image(m->fehwin, SLIDE_PREV);
- }
+ D_ENTER(4);
+ l = (gib_list *) data;
+ if (l->prev) {
+ current_file = l->prev;
+ slideshow_change_image(m->fehwin, SLIDE_NEXT);
+ } else if (l->next) {
+ current_file = l->next;
+ slideshow_change_image(m->fehwin, SLIDE_PREV);
+ }
- D_RETURN_(4);
- i = NULL;
- m = NULL;
+ D_RETURN_(4);
+ i = NULL;
+ m = NULL;
}
static void
-feh_menu_cb_fit(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_fit(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- D_ENTER(4);
- winwidget_size_to_image(m->fehwin);
- D_RETURN_(4);
- data = NULL;
+ D_ENTER(4);
+ winwidget_size_to_image(m->fehwin);
+ D_RETURN_(4);
+ data = NULL;
}
static void
-feh_menu_cb_edit_rotate(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_edit_rotate(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
D_ENTER(4);
feh_edit_inplace_orient(m->fehwin, (int) data);
@@ -1770,62 +1836,72 @@
}
static void
-feh_menu_cb_save_image(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_save_image(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- slideshow_save_image(m->fehwin);
+ slideshow_save_image(m->fehwin);
}
static void
-feh_menu_cb_save_filelist(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_save_filelist(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- feh_save_filelist();
+ feh_save_filelist();
}
static void
-feh_menu_cb_opt_draw_filename(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_opt_draw_filename(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- MENU_ITEM_TOGGLE(i);
- if (MENU_ITEM_IS_ON(i))
- opt.draw_filename = TRUE;
- else
- opt.draw_filename = FALSE;
- winwidget_rerender_all(0, 1);
+ MENU_ITEM_TOGGLE(i);
+ if (MENU_ITEM_IS_ON(i))
+ opt.draw_filename = TRUE;
+ else
+ opt.draw_filename = FALSE;
+ winwidget_rerender_all(0, 1);
}
static void
-feh_menu_cb_opt_keep_http(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_opt_keep_http(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- MENU_ITEM_TOGGLE(i);
- if (MENU_ITEM_IS_ON(i))
- opt.keep_http = TRUE;
- else
- opt.keep_http = FALSE;
+ MENU_ITEM_TOGGLE(i);
+ if (MENU_ITEM_IS_ON(i))
+ opt.keep_http = TRUE;
+ else
+ opt.keep_http = FALSE;
}
static void
-feh_menu_cb_opt_freeze_window(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_opt_freeze_window(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- MENU_ITEM_TOGGLE(i);
- if (MENU_ITEM_IS_ON(i))
- {
- opt.geom = TRUE;
- opt.geom_w = m->fehwin->w;
- opt.geom_h = m->fehwin->h;
- }
- else
- opt.geom = FALSE;
+ MENU_ITEM_TOGGLE(i);
+ if (MENU_ITEM_IS_ON(i)) {
+ opt.geom = TRUE;
+ opt.geom_w = m->fehwin->w;
+ opt.geom_h = m->fehwin->h;
+ } else
+ opt.geom = FALSE;
}
static void
-feh_menu_cb_opt_fullscreen(feh_menu * m, feh_menu_item * i, void *data)
+feh_menu_cb_opt_fullscreen(feh_menu * m,
+ feh_menu_item * i,
+ void *data)
{
- MENU_ITEM_TOGGLE(i);
- if (MENU_ITEM_IS_ON(i))
- m->fehwin->full_screen = TRUE;
- else
- m->fehwin->full_screen = FALSE;
- winwidget_destroy_xwin(m->fehwin);
- winwidget_create_window(m->fehwin, m->fehwin->im_w, m->fehwin->im_h);
- winwidget_render_image(m->fehwin, 1, 1);
- winwidget_show(m->fehwin);
+ MENU_ITEM_TOGGLE(i);
+ if (MENU_ITEM_IS_ON(i))
+ m->fehwin->full_screen = TRUE;
+ else
+ m->fehwin->full_screen = FALSE;
+ winwidget_destroy_xwin(m->fehwin);
+ winwidget_create_window(m->fehwin, m->fehwin->im_w, m->fehwin->im_h);
+ winwidget_render_image(m->fehwin, 1, 1);
+ winwidget_show(m->fehwin);
}
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/multiwindow.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- multiwindow.c 2001/08/25 01:54:06 1.32
+++ multiwindow.c 2002/01/26 16:22:45 1.33
@@ -26,7 +26,7 @@
#include "feh.h"
#include "winwidget.h"
#include "timers.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "options.h"
@@ -34,7 +34,7 @@
init_multiwindow_mode(void)
{
winwidget w = NULL;
- feh_list *l;
+ gib_list *l;
feh_file *file = NULL;
D_ENTER(2);
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/options.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -3 -r1.135 -r1.136
--- options.c 2002/01/26 14:12:34 1.135
+++ options.c 2002/01/26 16:22:45 1.136
@@ -24,7 +24,6 @@
*/
#include "feh.h"
-#include "feh_list.h"
#include "filelist.h"
#include "options.h"
@@ -57,6 +56,7 @@
opt.menu_font = estrdup(DEFAULT_MENU_FONT);
opt.font = estrdup(DEFAULT_FONT);
opt.menu_bg = estrdup(PREFIX "/share/feh/images/menubg.png");
+ opt.menu_style = estrdup(PREFIX "/share/feh/fonts/menu.style");
opt.next_button = 1;
opt.zoom_button = 2;
opt.menu_button = 3;
@@ -88,7 +88,7 @@
here, as files specified on the commandline end up at the *end* of
the combined filelist, in the specified order. */
D(3, ("About to load filelist from file\n"));
- filelist = feh_list_cat(filelist, feh_read_filelist(opt.filelistfile));
+ filelist = gib_list_cat(filelist, feh_read_filelist(opt.filelistfile));
}
D(4, ("Options parsed\n"));
@@ -96,7 +96,7 @@
if(opt.bgmode)
D_RETURN_(4);
- if (feh_list_length(filelist) == 0)
+ if (gib_list_length(filelist) == 0)
show_mini_usage();
check_options();
@@ -375,6 +375,7 @@
{"bg-center", 1, 0, 201},
{"bg-scale", 1, 0, 202},
{"bg-seamless", 1, 0, 203},
+ {"menu-style", 1, 0, 204},
{0, 0, 0, 0}
};
int optch = 0, cmdx = 0, i = 0;
@@ -639,6 +640,10 @@
opt.bgmode = BG_MODE_SEAMLESS;
opt.output_file = estrdup(optarg);
break;
+ case 204:
+ free(opt.menu_style);
+ opt.menu_style = estrdup(optarg);
+ break;
default:
break;
}
@@ -875,6 +880,7 @@
" --fontpath PATH Specify an extra directory to look in for \
fonts,\n"
" can be used multiple times to add multiple \
paths.\n"
" -M, --menu-font FONT Use FONT for the font in menus.\n"
+ " --menu-style FILE Use FILE as the style descriptor for menu \
text.\n"
" --menu-bg BG Use BG for the background image in menus.\n"
" -N, --no-menus Don't load or show any menus.\n"
" -1, --next-button B Use button B to advance to the next image in \
any\n" ===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/options.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- options.h 2001/08/15 23:26:41 1.32
+++ options.h 2002/01/26 16:22:45 1.33
@@ -78,6 +78,9 @@
char *customlist;
char *menu_bg;
char *rcfile;
+ char *menu_style;
+
+ gib_style *menu_style_l;
unsigned char next_button;
unsigned char zoom_button;
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/slideshow.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- slideshow.c 2001/08/25 01:54:06 1.71
+++ slideshow.c 2002/01/26 16:22:45 1.72
@@ -24,7 +24,7 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "timers.h"
#include "winwidget.h"
@@ -36,7 +36,7 @@
winwidget w = NULL;
int success = 0;
char *s = NULL;
- feh_list *l = NULL, *last = NULL;
+ gib_list *l = NULL, *last = NULL;
feh_file *file = NULL;
D_ENTER(3);
@@ -44,7 +44,7 @@
mode = "slideshow";
if (opt.start_list_at)
{
- l = feh_list_get_num(filelist, opt.start_list_at);
+ l = gib_list_nth(filelist, opt.start_list_at);
opt.start_list_at = 0; /* for next time */
}
else
@@ -128,22 +128,22 @@
if ((winwidget_loadimage(w, FEH_FILE(w->file->data))) != 0)
{
w->mode = MODE_NORMAL;
- if ((w->im_w != feh_imlib_image_get_width(w->im))
- || (w->im_h != feh_imlib_image_get_height(w->im)))
+ if ((w->im_w != gib_imlib_image_get_width(w->im))
+ || (w->im_h != gib_imlib_image_get_height(w->im)))
w->had_resize = 1;
if (w->has_rotated)
{
Imlib_Image temp;
- temp = feh_imlib_create_rotated_image(w->im, 0.0);
- w->im_w = feh_imlib_image_get_width(temp);
- w->im_h = feh_imlib_image_get_height(temp);
- feh_imlib_free_image_and_decache(temp);
+ temp = gib_imlib_create_rotated_image(w->im, 0.0);
+ w->im_w = gib_imlib_image_get_width(temp);
+ w->im_h = gib_imlib_image_get_height(temp);
+ gib_imlib_free_image_and_decache(temp);
}
else
{
- w->im_w = feh_imlib_image_get_width(w->im);
- w->im_h = feh_imlib_image_get_height(w->im);
+ w->im_w = gib_imlib_image_get_width(w->im);
+ w->im_h = gib_imlib_image_get_height(w->im);
}
winwidget_render_image(w, resize, 1);
}
@@ -162,14 +162,14 @@
slideshow_change_image(winwidget winwid, int change)
{
int success = 0;
- feh_list *last = NULL;
+ gib_list *last = NULL;
int i = 0, file_num = 0;
int jmp = 1;
char *s;
D_ENTER(4);
- file_num = feh_list_length(filelist);
+ file_num = gib_list_length(filelist);
/* Without this, clicking a one-image slideshow reloads it. Not very *
intelligent behaviour :-) */
@@ -182,7 +182,7 @@
then loop forward to find a loadable one. */
if (change == SLIDE_FIRST)
{
- current_file = feh_list_last(filelist);
+ current_file = gib_list_last(filelist);
change = SLIDE_NEXT;
}
else if (change == SLIDE_LAST)
@@ -198,10 +198,10 @@
switch (change)
{
case SLIDE_NEXT:
- current_file = feh_list_jump(filelist, current_file, FORWARD, 1);
+ current_file = gib_list_jump(filelist, current_file, FORWARD, 1);
break;
case SLIDE_PREV:
- current_file = feh_list_jump(filelist, current_file, BACK, 1);
+ current_file = gib_list_jump(filelist, current_file, BACK, 1);
break;
case SLIDE_JUMP_FWD:
if (file_num < 5)
@@ -212,7 +212,7 @@
jmp = file_num / 20;
if (!jmp)
jmp = 2;
- current_file = feh_list_jump(filelist, current_file, FORWARD, jmp);
+ current_file = gib_list_jump(filelist, current_file, FORWARD, jmp);
/* important. if the load fails, we only want to step on ONCE to
try the next file, not another jmp */
change = SLIDE_NEXT;
@@ -226,7 +226,7 @@
jmp = file_num / 20;
if (!jmp)
jmp = 2;
- current_file = feh_list_jump(filelist, current_file, BACK, jmp);
+ current_file = gib_list_jump(filelist, current_file, BACK, jmp);
/* important. if the load fails, we only want to step back ONCE to
try the previous file, not another jmp */
change = SLIDE_NEXT;
@@ -251,12 +251,12 @@
success = 1;
winwid->mode = MODE_NORMAL;
winwid->file = current_file;
- if ((winwid->im_w != feh_imlib_image_get_width(winwid->im))
- || (winwid->im_h != feh_imlib_image_get_height(winwid->im)))
+ if ((winwid->im_w != gib_imlib_image_get_width(winwid->im))
+ || (winwid->im_h != gib_imlib_image_get_height(winwid->im)))
winwid->had_resize = 1;
winwidget_reset_image(winwid);
- winwid->im_w = feh_imlib_image_get_width(winwid->im);
- winwid->im_h = feh_imlib_image_get_height(winwid->im);
+ winwid->im_w = gib_imlib_image_get_width(winwid->im);
+ winwid->im_h = gib_imlib_image_get_height(winwid->im);
winwidget_render_image(winwid, 1, 1);
break;
}
@@ -310,8 +310,8 @@
strlen(PACKAGE " [slideshow mode] - ") + strlen(file->filename) + 1;
s = emalloc(len);
snprintf(s, len, PACKAGE " [%d of %d] - %s",
- feh_list_num(filelist, current_file) + 1,
- feh_list_length(filelist), file->filename);
+ gib_list_num(filelist, current_file) + 1,
+ gib_list_length(filelist), file->filename);
}
else
{
@@ -417,12 +417,12 @@
strcat(ret, mode);
break;
case 'l':
- snprintf(buf, sizeof(buf), "%d", feh_list_length(filelist));
+ snprintf(buf, sizeof(buf), "%d", gib_list_length(filelist));
strcat(ret, buf);
break;
case 'u':
snprintf(buf, sizeof(buf), "%d",
- current_file != NULL ? feh_list_num(filelist,
+ current_file != NULL ? gib_list_num(filelist,
current_file) +
1 : 0);
strcat(ret, buf);
@@ -457,7 +457,7 @@
if (winwid->type == WIN_TYPE_SLIDESHOW)
{
char *s;
- feh_list *doomed;
+ gib_list *doomed;
doomed = current_file;
slideshow_change_image(winwid, SLIDE_NEXT);
@@ -497,7 +497,7 @@
if(!opt.quiet)
printf("saving image to filename '%s'\n", tmpname);
- feh_imlib_save_image(win->im, tmpname);
+ gib_imlib_save_image(win->im, tmpname);
free(tmpname);
D_RETURN_(4);
}
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/structs.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- structs.h 2000/09/24 16:08:22 1.5
+++ structs.h 2002/01/26 16:22:45 1.6
@@ -28,7 +28,6 @@
typedef struct __fehtimer _fehtimer;
typedef _fehtimer *fehtimer;
-typedef struct __feh_list feh_list;
typedef struct __feh_file feh_file;
typedef struct __feh_file_info feh_file_info;
typedef struct __winwidget _winwidget;
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/support.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- support.c 2002/01/14 19:59:43 1.19
+++ support.c 2002/01/26 16:22:45 1.20
@@ -45,7 +45,7 @@
switch (bgmode)
{
case BG_MODE_SEAMLESS:
- feh_imlib_image_tile(im);
+ gib_imlib_image_tile(im);
feh_wm_set_bg(NULL, im, 0, 0, 0, 1);
break;
case BG_MODE_TILE:
@@ -58,7 +58,7 @@
feh_wm_set_bg(file, im, 1, 0, 0, 1);
break;
}
- feh_imlib_free_image_and_decache(im);
+ gib_imlib_free_image_and_decache(im);
feh_file_free(fil);
}
}
@@ -81,7 +81,7 @@
snprintf(bgfil, sizeof(bgfil), "%s/.%s.png", getenv("HOME"), bgname);
imlib_context_set_image(im);
imlib_image_set_format("png");
- feh_imlib_save_image(im, bgfil);
+ gib_imlib_save_image(im, bgfil);
D(3, ("bg saved as %s\n", bgfil));
fil = bgfil;
}
@@ -169,7 +169,7 @@
w = scr->width;
h = scr->height;
pmap_d1 = XCreatePixmap(disp, root, scr->width, scr->height, depth);
- feh_imlib_render_image_on_drawable_at_size(pmap_d1, im, 0, 0,
+ gib_imlib_render_image_on_drawable_at_size(pmap_d1, im, 0, 0,
scr->width, scr->height,
1, 0, 1);
fehbg = estrjoin(" ", "feh --bg-scale", fil, NULL);
@@ -185,17 +185,17 @@
gcval.foreground = BlackPixel(disp, DefaultScreen(disp));
gc = XCreateGC(disp, root, GCForeground, &gcval);
XFillRectangle(disp, pmap_d1, gc, 0, 0, scr->width, scr->height);
- x = (scr->width - feh_imlib_image_get_width(im)) >> 1;
- y = (scr->height - feh_imlib_image_get_height(im)) >> 1;
- feh_imlib_render_image_on_drawable(pmap_d1, im, x, y, 1, 0, 0);
+ x = (scr->width - gib_imlib_image_get_width(im)) >> 1;
+ y = (scr->height - gib_imlib_image_get_height(im)) >> 1;
+ gib_imlib_render_image_on_drawable(pmap_d1, im, x, y, 1, 0, 0);
XFreeGC(disp, gc);
fehbg = estrjoin(" ", "feh --bg-center", fil, NULL);
} else {
- w = feh_imlib_image_get_width(im);
- h = feh_imlib_image_get_height(im);
+ w = gib_imlib_image_get_width(im);
+ h = gib_imlib_image_get_height(im);
pmap_d1 =
XCreatePixmap(disp, root, w, h, depth);
- feh_imlib_render_image_on_drawable(pmap_d1, im, 0, 0, 1, 0, 0);
+ gib_imlib_render_image_on_drawable(pmap_d1, im, 0, 0, 1, 0, 0);
fehbg = estrjoin(" ", "feh --bg-tile", fil, NULL);
}
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/thumbnail.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- thumbnail.c 2002/01/26 14:12:34 1.18
+++ thumbnail.c 2002/01/26 16:22:45 1.19
@@ -24,7 +24,7 @@
*/
#include "feh.h"
-#include "feh_list.h"
+#include "gib_list.h"
#include "filelist.h"
#include "winwidget.h"
#include "options.h"
@@ -33,7 +33,7 @@
static char *create_index_dimension_string(int w, int h);
static char *create_index_size_string(char *file);
static char *create_index_title_string(int num, int w, int h);
-static feh_list *thumbnails = NULL;
+static gib_list *thumbnails = NULL;
/* TODO Break this up a bit ;) */
@@ -61,26 +61,26 @@
int max_column_w = 0;
int thumbnailcount = 0;
feh_file *file = NULL;
- feh_list *l, *last = NULL;
+ gib_list *l, *last = NULL;
int file_num = 0, lines;
int index_image_width, index_image_height;
int x_offset_name = 0, x_offset_dim = 0, x_offset_size = 0;
char *s;
- file_num = feh_list_length(filelist);
+ file_num = gib_list_length(filelist);
D_ENTER(3);
mode = "thumbnail";
- fn = feh_imlib_load_font(opt.font);
+ fn = gib_imlib_load_font(opt.font);
if (opt.title_font)
{
int fh, fw;
- title_fn = feh_imlib_load_font(opt.title_font);
- feh_imlib_get_text_size(title_fn, "W", &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ title_fn = gib_imlib_load_font(opt.title_font);
+ gib_imlib_get_text_size(title_fn, "W", NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
title_area_h = fh + 4;
}
else
@@ -90,7 +90,7 @@
eprintf("Error loading fonts");
/* Work out how tall the font is */
- feh_imlib_get_text_size(fn, "W", &tw, &th, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_get_text_size(fn, "W", NULL, &tw, &th, IMLIB_TEXT_TO_RIGHT);
/* For now, allow room for the right number of lines with small gaps */
text_area_h =
((th + 2) * (opt.index_show_name + opt.index_show_size +
@@ -110,8 +110,8 @@
D(3, ("Time to apply a background to blend onto\n"));
if (feh_load_image_char(&bg_im, opt.bg_file) != 0)
{
- bg_w = feh_imlib_image_get_width(bg_im);
- bg_h = feh_imlib_image_get_height(bg_im);
+ bg_w = gib_imlib_image_get_width(bg_im);
+ bg_h = gib_imlib_image_get_height(bg_im);
}
}
}
@@ -163,24 +163,24 @@
text_area_w = opt.thumb_w;
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_dimension_string(1000, 1000),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
@@ -218,24 +218,24 @@
/* Calc width of text */
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_dimension_string(1000, 1000),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
@@ -268,24 +268,24 @@
text_area_w = opt.thumb_w;
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_dimension_string(1000, 1000),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw > text_area_w)
text_area_w = fw;
}
@@ -314,19 +314,19 @@
eprintf("Imlib error creating index image, are you low on RAM?");
if (bg_im)
- feh_imlib_blend_image_onto_image(im_main, bg_im,
- feh_imlib_image_has_alpha(bg_im), 0, 0,
+ gib_imlib_blend_image_onto_image(im_main, bg_im,
+ gib_imlib_image_has_alpha(bg_im), 0, 0,
bg_w, bg_h, 0, 0, w, h, 1, 0, 0);
else if (trans_bg)
{
- feh_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
+ gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
0, 0);
- feh_imlib_image_set_has_alpha(im_main, 1);
+ gib_imlib_image_set_has_alpha(im_main, 1);
}
else
{
/* Colour the background */
- feh_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
+ gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h + title_area_h, 0, 0,
0, 255);
}
@@ -360,10 +360,10 @@
D(4, ("Successfully loaded %s\n", file->filename));
www = opt.thumb_w;
hhh = opt.thumb_h;
- ww = feh_imlib_image_get_width(im_temp);
- hh = feh_imlib_image_get_height(im_temp);
+ ww = gib_imlib_image_get_width(im_temp);
+ hh = gib_imlib_image_get_height(im_temp);
thumbnailcount++;
- if (feh_imlib_image_has_alpha(im_temp))
+ if (gib_imlib_image_has_alpha(im_temp))
imlib_context_set_blend(1);
else
imlib_context_set_blend(0);
@@ -389,18 +389,18 @@
}
im_thumb =
- feh_imlib_create_cropped_scaled_image(im_temp, 0, 0, ww, hh, www,
+ gib_imlib_create_cropped_scaled_image(im_temp, 0, 0, ww, hh, www,
hhh, 1);
- feh_imlib_free_image_and_decache(im_temp);
+ gib_imlib_free_image_and_decache(im_temp);
if (opt.alpha)
{
DATA8 atab[256];
D(3, ("Applying alpha options\n"));
- feh_imlib_image_set_has_alpha(im_thumb, 1);
+ gib_imlib_image_set_has_alpha(im_thumb, 1);
memset(atab, opt.alpha_level, sizeof(atab));
- feh_imlib_apply_color_modifier_to_rectangle(im_thumb, 0, 0, www,
+ gib_imlib_apply_color_modifier_to_rectangle(im_thumb, 0, 0, www,
hhh, NULL, NULL, NULL,
atab);
}
@@ -409,23 +409,23 @@
/* Now draw on the info text */
if (opt.index_show_name)
{
- feh_imlib_get_text_size(fn, file->name, &fw_name, &fh,
+ gib_imlib_get_text_size(fn, file->name, NULL, &fw_name, &fh,
IMLIB_TEXT_TO_RIGHT);
if (fw_name > text_area_w)
text_area_w = fw_name;
}
if (opt.index_show_dim)
{
- feh_imlib_get_text_size(fn, create_index_dimension_string(ww, hh),
- &fw_dim, &fh, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_get_text_size(fn, create_index_dimension_string(ww, hh),
+ NULL, &fw_dim, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw_dim > text_area_w)
text_area_w = fw_dim;
}
if (opt.index_show_size)
{
- feh_imlib_get_text_size(fn,
+ gib_imlib_get_text_size(fn,
create_index_size_string(file->filename),
- &fw_size, &fh, IMLIB_TEXT_TO_RIGHT);
+ NULL, &fw_size, &fh, IMLIB_TEXT_TO_RIGHT);
if (fw_size > text_area_w)
text_area_w = fw_size;
}
@@ -474,32 +474,32 @@
}
/* Draw now */
- feh_imlib_blend_image_onto_image(im_main, im_thumb,
- feh_imlib_image_has_alpha(im_thumb),
+ gib_imlib_blend_image_onto_image(im_main, im_thumb,
+ gib_imlib_image_has_alpha(im_thumb),
0, 0, www, hhh, xxx, yyy, www, hhh,
1,
- feh_imlib_image_has_alpha(im_thumb),
+ gib_imlib_image_has_alpha(im_thumb),
0);
thumbnails =
- feh_list_add_front(thumbnails,
+ gib_list_add_front(thumbnails,
feh_thumbnail_new(file, xxx, yyy, www, hhh));
- feh_imlib_free_image_and_decache(im_thumb);
+ gib_imlib_free_image_and_decache(im_thumb);
lines = 0;
if (opt.index_show_name)
- feh_imlib_text_draw(im_main, fn, x + x_offset_name,
+ gib_imlib_text_draw(im_main, fn, NULL, x + x_offset_name,
y + opt.thumb_h + (lines++ * (th + 2)) + 2,
file->name, IMLIB_TEXT_TO_RIGHT, 255, 255,
255, 255);
if (opt.index_show_dim)
- feh_imlib_text_draw(im_main, fn, x + x_offset_dim,
+ gib_imlib_text_draw(im_main, fn, NULL, x + x_offset_dim,
y + opt.thumb_h + (lines++ * (th + 2)) + 2,
create_index_dimension_string(ww, hh),
IMLIB_TEXT_TO_RIGHT, 255, 255, 255, 255);
if (opt.index_show_size)
- feh_imlib_text_draw(im_main, fn, x + x_offset_size,
+ gib_imlib_text_draw(im_main, fn, NULL, x + x_offset_size,
y + opt.thumb_h + (lines++ * (th + 2)) + 2,
create_index_size_string(file->filename),
IMLIB_TEXT_TO_RIGHT, 255, 255, 255, 255);
@@ -531,10 +531,10 @@
char *s;
s = create_index_title_string(thumbnailcount, w, h);
- feh_imlib_get_text_size(title_fn, s, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_get_text_size(title_fn, s, NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT);
fx = (index_image_width - fw) >> 1;
fy = index_image_height - fh - 2;
- feh_imlib_text_draw(im_main, title_fn, fx, fy, s, IMLIB_TEXT_TO_RIGHT,
+ gib_imlib_text_draw(im_main, title_fn, NULL, fx, fy, s, IMLIB_TEXT_TO_RIGHT,
255, 255, 255, 255);
}
@@ -546,13 +546,13 @@
snprintf(output_buf, 1024, "%s/%s", opt.output_dir, opt.output_file);
else
strncpy(output_buf, opt.output_file, 1024);
- feh_imlib_save_image(im_main, output_buf);
+ gib_imlib_save_image(im_main, output_buf);
if (opt.verbose)
{
int tw, th;
- tw = feh_imlib_image_get_width(im_main);
- th = feh_imlib_image_get_height(im_main);
+ tw = gib_imlib_image_get_width(im_main);
+ th = gib_imlib_image_get_height(im_main);
fprintf(stdout, PACKAGE " - File saved as %s\n", output_buf);
fprintf(stdout,
" - Image is %dx%d pixels and contains %d thumbnails\n",
@@ -561,7 +561,7 @@
}
if (!opt.display)
- feh_imlib_free_image_and_decache(im_main);
+ gib_imlib_free_image_and_decache(im_main);
free(s);
D_RETURN_(3);
@@ -631,7 +631,7 @@
feh_file *
feh_thumbnail_get_file_from_coords(int x, int y)
{
- feh_list *l;
+ gib_list *l;
feh_thumbnail *thumb;
D_ENTER(4);
@@ -654,7 +654,7 @@
feh_thumbnail *
feh_thumbnail_get_thumbnail_from_coords(int x, int y)
{
- feh_list *l;
+ gib_list *l;
feh_thumbnail *thumb;
D_ENTER(4);
@@ -677,7 +677,7 @@
feh_thumbnail *
feh_thumbnail_get_from_file(feh_file * file)
{
- feh_list *l;
+ gib_list *l;
feh_thumbnail *thumb;
D_ENTER(4);
@@ -715,19 +715,19 @@
{
fn = imlib_load_font(DEFAULT_FONT_TITLE);
if (deleted)
- feh_imlib_image_fill_rectangle(w->im, thumb->x, thumb->y,
+ gib_imlib_image_fill_rectangle(w->im, thumb->x, thumb->y,
thumb->w, thumb->h, 255, 0, 0,
150);
else
- feh_imlib_image_fill_rectangle(w->im, thumb->x, thumb->y,
+ gib_imlib_image_fill_rectangle(w->im, thumb->x, thumb->y,
thumb->w, thumb->h, 0, 0, 255,
150);
if (fn)
{
int tw, th;
- feh_imlib_get_text_size(fn, "X", &tw, &th, IMLIB_TEXT_TO_RIGHT);
- feh_imlib_text_draw(w->im, fn, thumb->x + ((thumb->w - tw) / 2),
+ gib_imlib_get_text_size(fn, "X", NULL, &tw, &th, IMLIB_TEXT_TO_RIGHT);
+ gib_imlib_text_draw(w->im, fn, NULL, thumb->x + ((thumb->w - tw) / 2),
thumb->y + ((thumb->h - th) / 2), "X",
IMLIB_TEXT_TO_RIGHT, 205, 205, 50, 255);
}
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/winwidget.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- winwidget.c 2001/08/25 20:54:11 1.103
+++ winwidget.c 2002/01/26 16:22:46 1.104
@@ -24,7 +24,6 @@
*/
#include "feh.h"
-#include "feh_list.h"
#include "filelist.h"
#include "winwidget.h"
#include "options.h"
@@ -91,8 +90,8 @@
ret->type = type;
ret->im = im;
- ret->w = ret->im_w = feh_imlib_image_get_width(ret->im);
- ret->h = ret->im_h = feh_imlib_image_get_height(ret->im);
+ ret->w = ret->im_w = gib_imlib_image_get_width(ret->im);
+ ret->h = ret->im_h = gib_imlib_image_get_height(ret->im);
if (name)
ret->name = estrdup(name);
@@ -108,7 +107,7 @@
}
winwidget
-winwidget_create_from_file(feh_list * list, char *name, char type)
+winwidget_create_from_file(gib_list * list, char *name, char type)
{
winwidget ret = NULL;
feh_file *file = FEH_FILE(list->data);
@@ -134,11 +133,11 @@
if (!ret->win)
{
- ret->w = ret->im_w = feh_imlib_image_get_width(ret->im);
- ret->h = ret->im_h = feh_imlib_image_get_height(ret->im);
+ ret->w = ret->im_w = gib_imlib_image_get_width(ret->im);
+ ret->h = ret->im_h = gib_imlib_image_get_height(ret->im);
D(3,
("image is %dx%d pixels, format %s\n", ret->w, ret->h,
- feh_imlib_image_format(ret->im)));
+ gib_imlib_image_format(ret->im)));
if(opt.full_screen)
ret->full_screen = True;
winwidget_create_window(ret, ret->w, ret->h);
@@ -241,6 +240,7 @@
xsz.x = 0;
xsz.y = 0;
XSetWMNormalHints(disp, ret->win, &xsz);
+ XMoveWindow(disp, ret->win, 0,0);
}
/* set the icon name property */
@@ -331,7 +331,7 @@
winwidget_setup_pixmaps(winwid);
if (!winwid->full_screen
- && ((feh_imlib_image_has_alpha(winwid->im)) || (opt.geom)
+ && ((gib_imlib_image_has_alpha(winwid->im)) || (opt.geom)
|| (winwid->im_x || winwid->im_y) || (winwid->zoom != 1.0)
|| (winwid->w > winwid->im_w || winwid->h > winwid->im_h)
|| (winwid->has_rotated)))
@@ -449,7 +449,7 @@
D(5, ("winwidget_render(): winwid->im_angle = %f\n", winwid->im_angle));
if (winwid->has_rotated)
- feh_imlib_render_image_part_on_drawable_at_size_with_rotation(winwid->
+ gib_imlib_render_image_part_on_drawable_at_size_with_rotation(winwid->
bg_pmap,
winwid->
im, sx,
@@ -462,10 +462,10 @@
1, 1,
alias);
else
- feh_imlib_render_image_part_on_drawable_at_size(winwid->bg_pmap,
+ gib_imlib_render_image_part_on_drawable_at_size(winwid->bg_pmap,
winwid->im, sx, sy, sw,
sh, dx, dy, dw, dh, 1,
- feh_imlib_image_has_alpha
+ gib_imlib_image_has_alpha
(winwid->im), alias);
if (opt.draw_filename)
@@ -518,10 +518,10 @@
for (x = 0; x < 16; x += 8)
{
if (onoff)
- feh_imlib_image_fill_rectangle(checks, x, y, 8, 8, 144, 144,
+ gib_imlib_image_fill_rectangle(checks, x, y, 8, 8, 144, 144,
144, 255);
else
- feh_imlib_image_fill_rectangle(checks, x, y, 8, 8, 100, 100,
+ gib_imlib_image_fill_rectangle(checks, x, y, 8, 8, 100, 100,
100, 255);
onoff++;
if (onoff == 2)
@@ -529,7 +529,7 @@
}
}
checks_pmap = XCreatePixmap(disp, root, 16, 16, depth);
- feh_imlib_render_image_on_drawable(checks_pmap, checks, 0, 0, 1, 0, 0);
+ gib_imlib_render_image_on_drawable(checks_pmap, checks, 0, 0, 1, 0, 0);
}
D_RETURN(4, checks_pmap);
}
@@ -590,7 +590,7 @@
free(winwid->file);
}
if (winwid->im)
- feh_imlib_free_image_and_decache(winwid->im);
+ gib_imlib_free_image_and_decache(winwid->im);
free(winwid);
D_RETURN_(4);
}
@@ -651,6 +651,8 @@
if (!winwid->visible)
{
XMapWindow(disp, winwid->win);
+ if(opt.full_screen)
+ XMoveWindow(disp, winwid->win, 0,0);
/* wait for the window to map */
D(4, ("Waiting for window to map\n"));
XMaskEvent(disp, StructureNotifyMask, &ev);
@@ -771,7 +773,7 @@
{
D_ENTER(4);
if (w->im)
- feh_imlib_free_image_and_decache(w->im);
+ gib_imlib_free_image_and_decache(w->im);
w->im = NULL;
w->im_w = 0;
w->im_h = 0;
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/winwidget.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- winwidget.h 2001/08/25 19:21:59 1.39
+++ winwidget.h 2002/01/26 16:22:46 1.40
@@ -89,7 +89,7 @@
GC gc;
Pixmap bg_pmap;
char *name;
- feh_list *file;
+ gib_list *file;
unsigned char visible;
/* Stuff for zooming */
@@ -123,7 +123,7 @@
int winwidget_count(void);
winwidget winwidget_get_from_window(Window win);
-winwidget winwidget_create_from_file(feh_list * filename, char *name,
+winwidget winwidget_create_from_file(gib_list * filename, char *name,
char type);
winwidget winwidget_create_from_image(Imlib_Image im, char *name, char type);
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic