Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h Makefile.am misc.c
Log Message:
Move edge window handling code to new edge.c.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -3 -r1.241 -r1.242
--- E.h 8 Apr 2004 12:54:43 -0000 1.241
+++ E.h 9 Apr 2004 12:50:25 -0000 1.242
@@ -1973,6 +1973,13 @@
int h, char firstlast);
void PropagateShapes(Window win);
+/* edge.c */
+void ShowEdgeWindows(void);
+void HideEdgeWindows(void);
+void EdgeHandleEnter(XEvent * ev);
+void EdgeHandleLeave(XEvent * ev);
+void EdgeHandleMotion(XEvent * ev);
+
/* events.c */
#define ENABLE_DEBUG_EVENTS 1
#if ENABLE_DEBUG_EVENTS
@@ -2363,12 +2370,6 @@
void EDirUserCacheSet(const char *d);
char *EDirUserCache(void);
int EExit(void *code);
-void ShowEdgeWindows(void);
-void HideEdgeWindows(void);
-int IsEdgeWin(Window win);
-void EdgeHandleEnter(XEvent * ev);
-void EdgeHandleLeave(XEvent * ev);
-void EdgeHandleMotion(XEvent * ev);
void Quicksort(void **a, int l, int r,
int (*CompareFunc) (void *d1, void *d2));
void Eprintf(const char *fmt, ...);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Makefile.am,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- Makefile.am 1 Apr 2004 22:48:32 -0000 1.34
+++ Makefile.am 9 Apr 2004 12:50:26 -0000 1.35
@@ -34,6 +34,7 @@
dialog.c \
dock.c \
draw.c \
+ edge.c \
events.c \
evhandlers.c \
file.c \
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/misc.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- misc.c 8 Apr 2004 12:54:45 -0000 1.53
+++ misc.c 9 Apr 2004 12:50:26 -0000 1.54
@@ -23,8 +23,6 @@
#include "E.h"
#include <signal.h>
-static void EdgeTimeout(int val, void *data);
-
static char *userDir = NULL;
static char *cacheDir = NULL;
@@ -179,197 +177,6 @@
EDBUG_RETURN(exitcode);
}
-static Window w1 = 0, w2 = 0, w3 = 0, w4 = 0;
-
-void
-ShowEdgeWindows(void)
-{
- int ax, ay, cx, cy;
-
- if (Conf.edge_flip_resistance <= 0)
- {
- HideEdgeWindows();
- return;
- }
- if (!w1)
- {
- w1 = ECreateEventWindow(root.win, 0, 0, 1, root.h);
- w2 = ECreateEventWindow(root.win, root.w - 1, 0, 1, root.h);
- w3 = ECreateEventWindow(root.win, 0, 0, root.w, 1);
- w4 = ECreateEventWindow(root.win, 0, root.h - 1, root.w, 1);
- XSelectInput(disp, w1,
- EnterWindowMask | LeaveWindowMask | PointerMotionMask |
- ButtonPressMask | ButtonReleaseMask);
- XSelectInput(disp, w2,
- EnterWindowMask | LeaveWindowMask | PointerMotionMask |
- ButtonPressMask | ButtonReleaseMask);
- XSelectInput(disp, w3,
- EnterWindowMask | LeaveWindowMask | PointerMotionMask |
- ButtonPressMask | ButtonReleaseMask);
- XSelectInput(disp, w4,
- EnterWindowMask | LeaveWindowMask | PointerMotionMask |
- ButtonPressMask | ButtonReleaseMask);
- }
- GetCurrentArea(&cx, &cy);
- GetAreaSize(&ax, &ay);
-
- if (cx == 0 && !Conf.areas.wraparound)
- EUnmapWindow(disp, w1);
- else
- EMapRaised(disp, w1);
- if (cx == (ax - 1) && !Conf.areas.wraparound)
- EUnmapWindow(disp, w2);
- else
- EMapRaised(disp, w2);
- if (cy == 0 && !Conf.areas.wraparound)
- EUnmapWindow(disp, w3);
- else
- EMapRaised(disp, w3);
- if (cy == (ay - 1) && !Conf.areas.wraparound)
- EUnmapWindow(disp, w4);
- else
- EMapRaised(disp, w4);
-}
-
-void
-HideEdgeWindows(void)
-{
- if (w1)
- {
- EUnmapWindow(disp, w1);
- EUnmapWindow(disp, w2);
- EUnmapWindow(disp, w3);
- EUnmapWindow(disp, w4);
- }
-}
-
-int
-IsEdgeWin(Window win)
-{
- if (!w1)
- return -1;
- if (win == w1)
- return 0;
- else if (win == w2)
- return 1;
- else if (win == w3)
- return 2;
- else if (win == w4)
- return 3;
- return -1;
-}
-
-void
-EdgeHandleEnter(XEvent * ev)
-{
- int dir;
-
- dir = IsEdgeWin(ev->xcrossing.window);
- if (dir < 0)
- return;
- DoIn("EDGE_TIMEOUT", ((double)Conf.edge_flip_resistance) / 100.0,
- EdgeTimeout, dir, NULL);
-}
-
-void
-EdgeHandleLeave(XEvent * ev)
-{
- int dir;
-
- dir = IsEdgeWin(ev->xcrossing.window);
- if (dir < 0)
- return;
- RemoveTimerEvent("EDGE_TIMEOUT");
-}
-
-void
-EdgeHandleMotion(XEvent * ev)
-{
- static int lastdir = -1;
- int dir;
-
- if (Mode.mode != MODE_MOVE_PENDING && Mode.mode != MODE_MOVE)
- return;
-
- dir = -1;
- if (ev->xmotion.x_root == 0)
- dir = 0;
- else if (ev->xmotion.x_root == (root.w - 1))
- dir = 1;
- else if (ev->xmotion.y_root == 0)
- dir = 2;
- else if (ev->xmotion.y_root == (root.h - 1))
- dir = 3;
-
- if ((lastdir != dir) && (Conf.edge_flip_resistance))
- {
- if (dir < 0)
- RemoveTimerEvent("EDGE_TIMEOUT");
- else
- DoIn("EDGE_TIMEOUT", ((double)Conf.edge_flip_resistance) / 100.0,
- EdgeTimeout, dir, NULL);
- lastdir = dir;
- }
-}
-
-extern char throw_move_events_away;
-
-static void
-EdgeTimeout(int val, void *data)
-{
- int ax, ay, aw, ah, dx, dy, dax, day;
-
- if (Mode.cur_menu_mode > 0)
- return;
- if (!Conf.edge_flip_resistance)
- return;
- throw_move_events_away = 1;
- GetCurrentArea(&ax, &ay);
- GetAreaSize(&aw, &ah);
- dx = 0;
- dy = 0;
- dax = 0;
- day = 0;
- switch (val)
- {
- case 0:
- if (ax == 0 && !Conf.areas.wraparound)
- return;
- dx = root.w - 2;
- dax = -1;
- break;
- case 1:
- if (ax == (aw - 1) && !Conf.areas.wraparound)
- return;
- dx = -(root.w - 2);
- dax = 1;
- break;
- case 2:
- if (ay == 0 && !Conf.areas.wraparound)
- return;
- dy = root.h - 2;
- day = -1;
- break;
- case 3:
- if (ay == (ah - 1) && !Conf.areas.wraparound)
- return;
- dy = -(root.h - 2);
- day = 1;
- break;
- default:
- break;
- }
- Mode.flipp = 1;
- MoveCurrentAreaBy(dax, day);
- Mode.flipp = 0;
- if (aw == 1)
- dx = 0;
- if (ah == 1)
- dy = 0;
- XWarpPointer(disp, None, None, 0, 0, 0, 0, dx, dy);
- data = NULL;
-}
-
/* This is a general quicksort algorithm, using median-of-three strategy.
*
* Parameters:
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs