diff options
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr')
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyr.c | 13 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyr.h | 6 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrinit.c | 12 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrlog.h | 4 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/hostx.c | 41 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/hostx.h | 4 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/makefile | 6 |
7 files changed, 81 insertions, 5 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c index a5225dc7d..772d9b75a 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyr.c +++ b/xorg-server/hw/kdrive/ephyr/ephyr.c @@ -60,8 +60,11 @@ Bool EphyrWantGrayScale = 0; Bool ephyrInitialize(KdCardInfo * card, EphyrPriv * priv) { +#ifdef _MSC_VER + __asm int 3; +#else OsSignal(SIGUSR1, hostx_handle_signal); - +#endif priv->base = 0; priv->bytes_per_line = 0; return TRUE; @@ -759,6 +762,14 @@ ephyrUpdateModifierState(unsigned int state) } } +#ifdef _MSC_VER + __asm int 3; +#else +#endif +#ifdef _MSC_VER + __asm int 3; +#else +#endif static Bool ephyrCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) { diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.h b/xorg-server/hw/kdrive/ephyr/ephyr.h index be910c19e..1e9b930c7 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyr.h +++ b/xorg-server/hw/kdrive/ephyr/ephyr.h @@ -26,9 +26,11 @@ #ifndef _EPHYR_H_ #define _EPHYR_H_ #include <stdio.h> +#ifndef _MSC_VER #include <unistd.h> -#include <signal.h> #include <libgen.h> +#endif +#include <signal.h> #include "os.h" /* for OsSignal() */ #include "kdrive.h" @@ -177,6 +179,8 @@ extern void ephyrCursorEnable(ScreenPtr pScreen); extern int ephyrBufferHeight(KdScreenInfo * screen); +extern int ephyrBufferHeight(KdScreenInfo *screen); + /* ephyr_draw.c */ Bool diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c index 5e2eb672f..d7719e281 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c @@ -53,6 +53,7 @@ InitCard(char *name) KdCardInfoAdd(&ephyrFuncs, 0); } +#ifndef _MSC_VER void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { @@ -130,6 +131,7 @@ ddxUseMsg(void) exit(1); } +#endif void processScreenArg(char *screen_size, char *parent_id) @@ -157,6 +159,7 @@ processScreenArg(char *screen_size, char *parent_id) } } +#ifndef _MSC_VER int ddxProcessArgument(int argc, char **argv, int i) { @@ -298,6 +301,15 @@ OsVendorInit(void) KdOsInit(&EphyrOsFuncs); } +#ifdef DDXOSFATALERROR +void +OsVendorFatalError(void) +{ +} +#endif + +#endif + /* 'Fake' cursor stuff, could be improved */ static Bool diff --git a/xorg-server/hw/kdrive/ephyr/ephyrlog.h b/xorg-server/hw/kdrive/ephyr/ephyrlog.h index 0da0a2518..6671c4779 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrlog.h +++ b/xorg-server/hw/kdrive/ephyr/ephyrlog.h @@ -43,14 +43,14 @@ #ifndef EPHYR_LOG #define EPHYR_LOG(...) \ LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, "in %s:%d:%s: ",\ - __FILE__, __LINE__, __func__) ; \ + __FILE__, __LINE__, __FUNCTION__) ; \ LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, __VA_ARGS__) #endif /*nomadik_log */ #ifndef EPHYR_LOG_ERROR #define EPHYR_LOG_ERROR(...) \ LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, "Error:in %s:%d:%s: ",\ - __FILE__, __LINE__, __func__) ; \ + __FILE__, __LINE__, __FUNCTION__) ; \ LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, __VA_ARGS__) #endif /*EPHYR_LOG_ERROR */ diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c index 6988f1625..f313afa5a 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.c +++ b/xorg-server/hw/kdrive/ephyr/hostx.c @@ -47,9 +47,11 @@ #include <errno.h> #include <time.h> +#ifndef _MSC_VER #include <sys/ipc.h> #include <sys/shm.h> #include <sys/time.h> +#endif #include <X11/Xlib.h> #include <X11/Xutil.h> @@ -198,7 +200,11 @@ hostx_add_screen(EphyrScreenInfo screen, unsigned long win_id, int screen_num) void hostx_set_display_name(char *name) { +#ifdef _MSC_VER + __asm int 3; +#else HostX.server_dpy_name = strdup(name); +#endif } void @@ -458,6 +464,9 @@ hostx_init(void) } /* Try to get share memory ximages for a little bit more speed */ +#ifdef _MSC_VER + __asm int 3; +#else if (!XShmQueryExtension(HostX.dpy) || getenv("XEPHYR_NO_SHM")) { fprintf(stderr, "\nXephyr unable to use SHM XImages\n"); HostX.have_shm = False; @@ -485,6 +494,7 @@ hostx_init(void) shmdt(shminfo.shmaddr); shmctl(shminfo.shmid, IPC_RMID, 0); } +#endif XFlush(HostX.dpy); @@ -622,7 +632,7 @@ hostx_screen_init(EphyrScreenInfo screen, struct EphyrHostScreen *host_screen = host_screen_from_screen_info(screen); if (!host_screen) { - fprintf(stderr, "%s: Error in accessing hostx data\n", __func__); + fprintf(stderr, "%s: Error in accessing hostx data\n", __FUNCTION__); exit(1); } @@ -635,10 +645,14 @@ hostx_screen_init(EphyrScreenInfo screen, */ if (HostX.have_shm) { +#ifdef _MSC_VER + __asm int 3; +#else XShmDetach(HostX.dpy, &host_screen->shminfo); XDestroyImage(host_screen->ximg); shmdt(host_screen->shminfo.shmaddr); shmctl(host_screen->shminfo.shmid, IPC_RMID, 0); +#endif } else { free(host_screen->ximg->data); @@ -650,6 +664,10 @@ hostx_screen_init(EphyrScreenInfo screen, if (HostX.have_shm) { host_screen->ximg = +#ifdef _MSC_VER +__asm int 3; +#else + host_screen->ximg = XShmCreateImage(HostX.dpy, HostX.visual, HostX.depth, ZPixmap, NULL, &host_screen->shminfo, width, buffer_height); @@ -673,6 +691,7 @@ hostx_screen_init(EphyrScreenInfo screen, XShmAttach(HostX.dpy, &host_screen->shminfo); shm_success = True; } +#endif } if (!shm_success) { @@ -792,9 +811,13 @@ hostx_paint_rect(EphyrScreenInfo screen, } if (HostX.have_shm) { +#ifdef _MSC_VER + __asm int 3; +#else XShmPutImage(HostX.dpy, host_screen->win, HostX.gc, host_screen->ximg, sx, sy, dx, dy, width, height, False); +#endif } else { XPutImage(HostX.dpy, host_screen->win, HostX.gc, host_screen->ximg, @@ -808,6 +831,9 @@ static void hostx_paint_debug_rect(struct EphyrHostScreen *host_screen, int x, int y, int width, int height) { +#ifdef _MSC_VER + __asm int 3; +#else struct timespec tspec; tspec.tv_sec = HostX.damage_debug_msec / (1000000); @@ -823,6 +849,7 @@ hostx_paint_debug_rect(struct EphyrHostScreen *host_screen, /* nanosleep seems to work better than usleep for me... */ nanosleep(&tspec, NULL); +#endif } void @@ -1217,8 +1244,12 @@ hostx_set_window_bounding_rectangles(int a_window, rects[i].x, rects[i].y, rects[i].width, rects[i].height); } /*this aways returns 1 */ +#ifdef _MSC_VER + __asm int 3; +#else XShapeCombineRectangles(dpy, a_window, ShapeBounding, 0, 0, rects, a_num_rects, ShapeSet, YXBanded); +#endif is_ok = TRUE; free(rects); @@ -1250,8 +1281,12 @@ hostx_set_window_clipping_rectangles(int a_window, rects[i].x, rects[i].y, rects[i].width, rects[i].height); } /*this aways returns 1 */ +#ifdef _MSC_VER + __asm int 3; +#else XShapeCombineRectangles(dpy, a_window, ShapeClip, 0, 0, rects, a_num_rects, ShapeSet, YXBanded); +#endif is_ok = TRUE; free(rects); @@ -1264,11 +1299,15 @@ int hostx_has_xshape(void) { int event_base = 0, error_base = 0; +#ifdef _MSC_VER + __asm int 3; +#else Display *dpy = hostx_get_display(); if (!XShapeQueryExtension(dpy, &event_base, &error_base)) { return FALSE; } +#endif return TRUE; } diff --git a/xorg-server/hw/kdrive/ephyr/hostx.h b/xorg-server/hw/kdrive/ephyr/hostx.h index d6217119a..c1e1133c0 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.h +++ b/xorg-server/hw/kdrive/ephyr/hostx.h @@ -35,8 +35,12 @@ #define EPHYR_DBG(x, a...) \ fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a) #else +#ifdef _MSC_VER +#define EPHYR_DBG() +#else #define EPHYR_DBG(x, a...) do {} while (0) #endif +#endif typedef struct EphyrHostXVars EphyrHostXVars; typedef struct EphyrHostXEvent EphyrHostXEvent; diff --git a/xorg-server/hw/kdrive/ephyr/makefile b/xorg-server/hw/kdrive/ephyr/makefile new file mode 100644 index 000000000..eba9a93e1 --- /dev/null +++ b/xorg-server/hw/kdrive/ephyr/makefile @@ -0,0 +1,6 @@ +LIBRARY = libxephyr + +CSRCS=ephyrinit.c ephyr.c hostx.c + +INCLUDES += ..\src ..\..\..\exa + |