Enlightenment CVS committal

Author  : gilbertt
Project : misc
Module  : feh

Dir     : misc/feh/src


Modified Files:
        Makefile.am feh.h imlib.c slideshow.c utils.c utils.h 
        winwidget.c 


Log Message:

fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=169911

start of ipc code, not used yet.


===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/Makefile.am,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- Makefile.am 20 Oct 2002 18:53:50 -0000      1.40
+++ Makefile.am 23 Feb 2003 16:18:53 -0000      1.41
@@ -15,7 +15,7 @@
 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 support.c support.h \
-thumbnail.c thumbnail.h 
+thumbnail.c thumbnail.h ipc.c
 feh_LDADD         = -lX11 @IMLIB_LIBS@ @GIBLIB_LIBS@
 
 images_DATA = about.png menubg_default.png menubg_sky.png \
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/feh.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -3 -r1.125 -r1.126
--- feh.h       23 Dec 2002 01:22:19 -0000      1.125
+++ feh.h       23 Feb 2003 16:18:54 -0000      1.126
@@ -45,8 +45,11 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <sys/stat.h>
+#include <pwd.h>
 #include <sys/types.h>
 #include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/un.h>
 #include <errno.h>
 #include <dirent.h>
 #include <stdarg.h>
@@ -59,6 +62,7 @@
 
 #include "structs.h"
 #include "menu.h"
+#include "ipc.h"
 
 #include "utils.h"
 #include "getopt.h"
@@ -160,7 +164,6 @@
 /* Thumbnail sizes */
 extern int cmdargc;
 extern char **cmdargv;
-extern winwidget progwin;
 extern Window root;
 extern XContext xid_context;
 extern Screen *scr;
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/imlib.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -3 -r1.148 -r1.149
--- imlib.c     22 Dec 2002 14:14:54 -0000      1.148
+++ imlib.c     23 Feb 2003 16:18:54 -0000      1.149
@@ -42,7 +42,6 @@
 Atom wmDeleteWindow;
 XContext xid_context = 0;
 Window root = 0;
-winwidget progwin = NULL;
 
 /* Xinerama support */
 #ifdef HAVE_LIBXINERAMA
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/slideshow.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- slideshow.c 21 Dec 2002 20:38:14 -0000      1.76
+++ slideshow.c 23 Feb 2003 16:18:54 -0000      1.77
@@ -107,6 +107,7 @@
 {
    char *title, *new_title;
    int len;
+   Imlib_Image tmp;
 
    D_ENTER(4);
 
@@ -116,7 +117,6 @@
       D_RETURN_(4);
    }
 
-   winwidget_free_image(w);
    free(FEH_FILE(w->file->data)->caption);
    FEH_FILE(w->file->data)->caption = NULL;
 
@@ -126,30 +126,38 @@
    title = estrdup(w->name);
    winwidget_rename(w, new_title);
 
-   if ((winwidget_loadimage(w, FEH_FILE(w->file->data))) != 0)
+   /* if the image has changed in dimensions - we gotta resize */
+   if ((feh_load_image(&tmp, FEH_FILE(w->file->data))) == 0) {
+     weprintf("Couldn't reload image. Is it still there?");
+   }
+
+   if ((gib_imlib_image_get_width(w->im) != gib_imlib_image_get_width(tmp)) || 
(gib_imlib_image_get_height(w->im) != gib_imlib_image_get_height(tmp))) {
+     resize = 1;
+     winwidget_reset_image(w);
+   }
+
+   winwidget_free_image(w);
+   w->im = tmp;
+
+   w->mode = MODE_NORMAL;
+   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)
    {
-      w->mode = MODE_NORMAL;
-      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 = 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 = gib_imlib_image_get_width(w->im);
-         w->im_h = gib_imlib_image_get_height(w->im);
-      }
-      winwidget_render_image(w, resize, 1);
+       Imlib_Image 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
-      weprintf("Couldn't reload image. Is it still there?");
+   {
+       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);
 
    winwidget_rename(w, title);
    free(title);
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/utils.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- utils.c     21 Dec 2002 20:38:14 -0000      1.14
+++ utils.c     23 Feb 2003 16:18:55 -0000      1.15
@@ -27,6 +27,9 @@
 #include "debug.h"
 #include "options.h"
 
+static char *feh_user_name = NULL;
+static char *feh_tmp_dir = NULL;
+
 /* eprintf: print error message and exit */
 void
 eprintf(char *fmt, ...)
@@ -218,4 +221,31 @@
   fclose(fp);
 
   return estrdup(buffer);  
+}
+
+char *feh_get_tmp_dir(void) {
+  char *tmp;
+  if (feh_tmp_dir)
+    return feh_tmp_dir;
+  tmp = getenv("TMPDIR");
+  if (!tmp)
+    tmp = getenv("TMP");
+  if (!tmp)
+    tmp = getenv("TEMP");
+  if (!tmp)
+    tmp = "/tmp";
+  feh_tmp_dir = estrdup(tmp);
+  return feh_tmp_dir;
+}
+
+char *feh_get_user_name(void) {
+    struct passwd *pw = NULL;
+
+    if (feh_user_name)
+      return feh_user_name;
+    setpwent ();
+    pw = getpwuid (getuid ());
+    endpwent ();
+    feh_user_name = estrdup(pw->pw_name);
+    return feh_user_name;
 }
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/utils.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- utils.h     22 Dec 2002 14:00:36 -0000      1.13
+++ utils.h     23 Feb 2003 16:18:55 -0000      1.14
@@ -39,6 +39,8 @@
 char *stroflen(char, int);
 char *feh_unique_filename(char *path, char *basename);
 char *ereadfile(char *path);
+char *feh_get_tmpdir(void);
+char *feh_get_user_name(void);
 
 #define ESTRAPPEND(a,b) \
   {\
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/winwidget.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -3 -r1.113 -r1.114
--- winwidget.c 23 Dec 2002 01:22:19 -0000      1.113
+++ winwidget.c 23 Feb 2003 16:18:55 -0000      1.114
@@ -698,7 +698,6 @@
 {
   D_ENTER(4);
   D(4, ("filename %s\n", file->filename));
-  progwin = winwid;
   D_RETURN(4, feh_load_image(&(winwid->im), file));
 }
 




-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to