diff -r -u gnome-applets-2.4.1.orig/geyes/ChangeLog gnome-applets-2.4.1/geyes/ChangeLog
--- gnome-applets-2.4.1.orig/geyes/ChangeLog	2003-06-03 20:00:10.000000000 -0400
+++ gnome-applets-2.4.1/geyes/ChangeLog	2003-10-16 07:16:48.000000000 -0400
@@ -1,3 +1,9 @@
+2003-10-27  Behdad Esfahbod <gnomeapplets@behdad.org>
+
+	* geyes.c, geyes.h:  Added 3d effect for pupil movement.
+	* themes.c:  Parse new tags crossed-eyes and eye-depth for 3d effect.
+	* themes/*/config:  Added 3d effect tags.
+
 Mon Sep 15 15:17:32 2003  George Lebl <jirka@5z.com>
 
 	* geyes.c: when started in lockdown mode, hide the preferences item
diff -r -u gnome-applets-2.4.1.orig/geyes/geyes.c gnome-applets-2.4.1/geyes/geyes.c
--- gnome-applets-2.4.1.orig/geyes/geyes.c	2003-06-03 20:00:10.000000000 -0400
+++ gnome-applets-2.4.1/geyes/geyes.c	2003-10-16 07:16:48.000000000 -0400
@@ -116,38 +116,63 @@
         double cosa;
         double nx;
         double ny;
+	double dx;
+	double dy;
         double h;
         double temp;
      
         nx = x - ((double) eyes_applet->eye_width / 2);
         ny = y - ((double) eyes_applet->eye_height / 2);
        
-        h = hypot (nx, ny);
-        if (abs (h) 
-            < (abs (hypot (eyes_applet->eye_height / 2, eyes_applet->eye_width / 2)) - eyes_applet->wall_thickness - eyes_applet->pupil_height)) {
-                *pupil_x = x;
-                *pupil_y = y;
-                return;
-        }
-        
         angle = atan2 (nx, ny);
         sina = sin (angle);
         cosa = cos (angle);
         
-        temp = hypot ((eyes_applet->eye_height / 2) * cosa, (eyes_applet->eye_width / 2)* sina);
-        *pupil_x = temp * sina;
-        *pupil_y = temp * cosa;
+	/* calculate the real space */
+        *pupil_x = (eyes_applet->eye_width
+		  - eyes_applet->pupil_width
+		  - eyes_applet->wall_thickness) / 2;
+        *pupil_y = (eyes_applet->eye_height
+		  - eyes_applet->pupil_height
+		  - eyes_applet->wall_thickness) / 2;
+
+	/* circlize */
+	*pupil_x *= sina;
+	*pupil_y *= cosa;
        
-        temp = hypot ((eyes_applet->pupil_width / 2) * sina, (eyes_applet->pupil_height / 2)* cosa);
-        *pupil_x -= temp * sina;
-        *pupil_y -= temp * cosa;
-        
-        temp = hypot ((eyes_applet->wall_thickness / 2) * sina, (eyes_applet->wall_thickness / 2) * cosa);
-        *pupil_x -= temp * sina;
-        *pupil_y -= temp * cosa;
+
+	/* 3d effect */
+
+        h = hypot (nx, ny);
+
+	/* we check for eye_depth from theme,
+	   and fall back to 2d if not available */
+
+
+	/* TODO:
+	   implement 'bigbug' effect, that's to go crossed-eyes
+	   whenever gnome-panel-screenshot is taking a *photo*.
+	   (courtesy of Mohmmad 'bigbug' Toossi <mohammad@bamdad.org>)
+		-- Behdad Esfahbod <geyes@behdad.org>
+	*/
+
+	dx = eyes_applet->eye_depth;
+	if (dx == 0 || eyes_applet->crossed_eyes)
+		/* don't do 3d for x axis if crossed eyes asked for */
+		dx = *pupil_x;
+
+	dy = eyes_applet->eye_depth;
+	if (dy == 0)
+		dy = *pupil_y;
+
+	/* a simple projection */
+	*pupil_x *= h / sqrt(h*h + dx*dx);
+	*pupil_y *= h / sqrt(h*h + dy*dy);
         
-        *pupil_x += (eyes_applet->eye_width / 2);
-        *pupil_y += (eyes_applet->eye_height / 2);
+
+	/* add offset */
+        *pupil_x += eyes_applet->eye_width / 2;
+        *pupil_y += eyes_applet->eye_height / 2;
 }
 
 static void 
diff -r -u gnome-applets-2.4.1.orig/geyes/geyes.h gnome-applets-2.4.1/geyes/geyes.h
--- gnome-applets-2.4.1.orig/geyes/geyes.h	2003-06-03 20:00:10.000000000 -0400
+++ gnome-applets-2.4.1/geyes/geyes.h	2003-10-16 06:45:52.000000000 -0400
@@ -49,8 +49,10 @@
 	gchar *eye_filename;
 	gchar *pupil_filename;
 	gint num_eyes;
+	gint crossed_eyes;
 	gint eye_height;
 	gint eye_width;
+	gint eye_depth;
 	gint pupil_height;
 	gint pupil_width;
 	gint wall_thickness;
diff -r -u gnome-applets-2.4.1.orig/geyes/README.themes gnome-applets-2.4.1/geyes/README.themes
--- gnome-applets-2.4.1.orig/geyes/README.themes	1999-07-09 21:32:17.000000000 -0400
+++ gnome-applets-2.4.1/geyes/README.themes	2003-10-16 07:10:48.000000000 -0400
@@ -23,12 +23,14 @@
 * pupil-pixmap = "filename"
 Yes, the quotes have to be there.  Names the filename to use for the pupil 
 pixmap.
+* eye-depth = n
+Think of eye-depth as how far the eye is behind the monitor screen, in pixels.
+This is used for to create the 3d effect, which seems that the eye is located
+behind the screen, not *on* the screen.
+* crossed-eyes = b
+Where b is 0 or 1.  If 3d effect is on (eye-depth is set), makes it so that
+you can still get a crossed-eyes effect when putting the cursor between
+two of the eyes.
 
 Take a look at the themes that come with gEyes for examples, or the 
 geyes_applet(1) man page for another view of the process.
-
-
-
-
-
-
diff -r -u gnome-applets-2.4.1.orig/geyes/themes/Bizarre/config gnome-applets-2.4.1/geyes/themes/Bizarre/config
--- gnome-applets-2.4.1.orig/geyes/themes/Bizarre/config	1999-07-09 21:32:20.000000000 -0400
+++ gnome-applets-2.4.1/geyes/themes/Bizarre/config	2003-10-16 07:03:56.000000000 -0400
@@ -1,4 +1,5 @@
 wall-thickness=2
 num-eyes = 3
+eye-depth = 300
 eye-pixmap = "Bizarre-eye.png"
 pupil-pixmap = "Bizarre-pupil.png"
diff -r -u gnome-applets-2.4.1.orig/geyes/themes/Bloodshot/config gnome-applets-2.4.1/geyes/themes/Bloodshot/config
--- gnome-applets-2.4.1.orig/geyes/themes/Bloodshot/config	1999-07-09 21:32:20.000000000 -0400
+++ gnome-applets-2.4.1/geyes/themes/Bloodshot/config	2003-10-16 07:03:56.000000000 -0400
@@ -1,4 +1,6 @@
 wall-thickness = 5
 num-eyes = 2
+crossed-eyes = 1
+eye-depth = 300
 eye-pixmap = "Bloodshot-eye.png"
 pupil-pixmap = "Bloodshot-pupil.png"
diff -r -u gnome-applets-2.4.1.orig/geyes/themes/Default/config gnome-applets-2.4.1/geyes/themes/Default/config
--- gnome-applets-2.4.1.orig/geyes/themes/Default/config	1999-07-09 21:32:20.000000000 -0400
+++ gnome-applets-2.4.1/geyes/themes/Default/config	2003-10-16 07:03:57.000000000 -0400
@@ -1,4 +1,6 @@
 wall-thickness = 6
 num-eyes = 2
+crossed-eyes = 1
+eye-depth = 300
 eye-pixmap = "Default-eye.png"
 pupil-pixmap = "Default-pupil.png"
diff -r -u gnome-applets-2.4.1.orig/geyes/themes/Default-tiny/config gnome-applets-2.4.1/geyes/themes/Default-tiny/config
--- gnome-applets-2.4.1.orig/geyes/themes/Default-tiny/config	1999-08-25 21:53:02.000000000 -0400
+++ gnome-applets-2.4.1/geyes/themes/Default-tiny/config	2003-10-16 07:03:57.000000000 -0400
@@ -1,4 +1,6 @@
 wall-thickness = 3
 num-eyes = 2
+crossed-eyes = 1
+eye-depth = 300
 eye-pixmap = "Default-tiny-eye.png"
 pupil-pixmap = "Default-tiny-pupil.png"
diff -r -u gnome-applets-2.4.1.orig/geyes/themes/Horrid/config gnome-applets-2.4.1/geyes/themes/Horrid/config
--- gnome-applets-2.4.1.orig/geyes/themes/Horrid/config	1999-08-03 22:00:09.000000000 -0400
+++ gnome-applets-2.4.1/geyes/themes/Horrid/config	2003-10-16 07:03:58.000000000 -0400
@@ -1,4 +1,5 @@
 wall-thickness = 6
 num-eyes = 1
+eye-depth = 400
 eye-pixmap = "horrid_eye.png"
 pupil-pixmap = "horrid_pupil.png"
diff -r -u gnome-applets-2.4.1.orig/geyes/themes.c gnome-applets-2.4.1/geyes/themes.c
--- gnome-applets-2.4.1.orig/geyes/themes.c	2003-07-21 19:41:41.000000000 -0400
+++ gnome-applets-2.4.1/geyes/themes.c	2003-10-16 06:45:39.000000000 -0400
@@ -41,6 +41,9 @@
 {
         gchar line_buf [512]; /* prolly overkill */
         gchar *token;
+	/* eye-depth and crossed-eyes may not be specified */
+	eyes_applet->crossed_eyes = 0;
+	eyes_applet->eye_depth = 0;
         fgets (line_buf, 512, theme_file);
         while (!feof (theme_file)) {
                 token = strtok (line_buf, "=");
@@ -57,6 +60,18 @@
                                 token++;
                         }
                         sscanf (token, "%d", &eyes_applet->num_eyes);
+                } else if (strncmp (token, "crossed-eyes", strlen ("crossed-eyes")) == 0) {
+                        token += strlen ("crossed-eyes");
+                        while (!isdigit (*token)) {
+                                token++;
+                        }
+                        sscanf (token, "%d", &eyes_applet->crossed_eyes);
+                } else if (strncmp (token, "eye-depth", strlen ("eye-depth")) == 0) {
+                        token += strlen ("eye-depth");
+                        while (!isdigit (*token)) {
+                                token++;
+                        }
+                        sscanf (token, "%d", &eyes_applet->eye_depth);
                 } else if (strncmp (token, "eye-pixmap", strlen ("eye-pixmap")) == 0) {
                         token = strtok (NULL, "\"");
                         token = strtok (NULL, "\"");          
