_MGUSE_COMPOSITING -> _MGSCHEMA_COMPOSITING; _MGUSE_SHAREDFB -> _MGSCHEMA_SHAREDFB

This commit is contained in:
Vincent Wei
2020-01-13 18:10:01 +08:00
parent 8020e09de5
commit 9c392a3229
10 changed files with 47 additions and 41 deletions

View File

@@ -182,7 +182,7 @@ int GUIAPI ClientRequestEx2 (const REQUEST* request,
#elif defined(_MGGAL_NEXUS)
if ((request->id != REQID_NEXUS_CLIENT_GET_SURFACE)
&& (__mg_client_id == 0 && request->id != REQID_JOINLAYER)) {
#elif defined(_MGUSE_COMPOSITING)
#elif defined(_MGSCHEMA_COMPOSITING)
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER &&
request->id != REQID_GETWPSURFACE) {
#else

View File

@@ -92,7 +92,7 @@ typedef CURSOR* PCURSOR;
#define MONOSIZE (CURSORWIDTH*CURSORHEIGHT/8)
#define MONOPITCH 4
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
# define MAX_CURSORWIDTH 64
# define MAX_CURSORHEIGHT 64
#endif

View File

@@ -61,6 +61,7 @@
#if IS_COMPOSITING_SCHEMA
#include <sys/types.h>
#include <unistd.h>
#include <semaphore.h>
#endif
#define DISABLE_THREADS
@@ -119,10 +120,15 @@ typedef int (*GAL_blit)(struct GAL_Surface *src, GAL_Rect *srcrect,
* than the creator.
*/
typedef struct _SharedSurfaceHeader {
#if 1
/* The semaphore for this shared surface */
sem_t sem_lock;
#else
/* The SysV semaphore set identifier for synchronizing the shared surfaces. */
int semid;
/* The number of semphore for this surface. */
int sem_num;
#endif
/* The pid of the creator */
pid_t creator;
@@ -370,7 +376,7 @@ GAL_Rect ** GAL_ListModes (GAL_PixelFormat *format, Uint32 flags);
GAL_Surface *GAL_SetVideoMode
(int width, int height, int bpp, Uint32 flags);
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
void GAL_SetVideoModeInfo(GAL_Surface* screen);
#endif
@@ -517,7 +523,7 @@ void GAL_FreeSurface (GAL_Surface *surface);
#ifdef _MGRM_PROCESSES
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
/* Allocate a shared RGB surface from the specific video device. */
GAL_Surface *GAL_CreateSharedRGBSurface (GAL_VideoDevice* video,
@@ -597,7 +603,7 @@ typedef struct _REP_SIGMA8654_GETSURFACE {
#endif
void GAL_RequestHWSurface (const REQ_HWSURFACE* request, REP_HWSURFACE* reply);
#endif /* _MGUSE_SHAREDFB */
#endif /* _MGSCHEMA_SHAREDFB */
#endif /* _MGRM_PROCESSES */
@@ -835,7 +841,7 @@ GAL_Surface * GAL_DisplayFormatAlpha (GAL_Surface *surface);
int GAL_SoftStretch (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect);
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
extern GAL_Surface* __gal_screen;
extern GAL_Surface* __gal_fake_screen;
#else

View File

@@ -112,7 +112,7 @@ inline static int boxtop (void)
return CSR_CURSORY - CSR_YHOTSPOT;
}
#ifdef _MGUSE_SHAREDFB
#ifdef _MGSCHEMA_SHAREDFB
unsigned int __mg_csrimgsize;
unsigned int __mg_csrimgpitch;
@@ -122,7 +122,7 @@ unsigned int __mg_csrimgpitch;
static BYTE* _cursor_bits = NULL;
#endif
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
/* the empty global DC for cursor */
static HDC _dc_cursor;
@@ -460,7 +460,7 @@ void mg_TerminateCursor (void)
}
}
#else /* _MGUSE_COMPOSITING */
#else /* _MGSCHEMA_COMPOSITING */
#if 0 /* FIXME: I do not know why this can not work :( */
Uint8* GetPixelUnderCursor (int x, int y, gal_pixel* pixel)
@@ -725,7 +725,7 @@ static void showcursor (void)
GAL_UpdateRects (__gal_screen, 1, &csr_rect);
}
#endif /* _MGUSE_COMPOSITING */
#endif /* _MGSCHEMA_COMPOSITING */
HCURSOR GUIAPI CopyCursor (HCURSOR hcsr)
{
@@ -871,7 +871,7 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
if (oldx != curx || oldy != cury) {
#if defined (_MGHAVE_CURSOR) && defined(_MGUSE_SHAREDFB)
#if defined (_MGHAVE_CURSOR) && defined(_MGSCHEMA_SHAREDFB)
lock_cursor_sem ();
CSR_CURSORX = curx;
CSR_CURSORY = cury;
@@ -886,7 +886,7 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
showcursor ();
}
unlock_cursor_sem ();
#endif /* _MGHAVE_CURSOR && _MGUSE_SHAREDFB*/
#endif /* _MGHAVE_CURSOR && _MGSCHEMA_SHAREDFB*/
oldx = curx;
oldy = cury;
@@ -898,7 +898,7 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
#ifdef _MGHAVE_CURSOR
#ifdef _MGUSE_SHAREDFB
#ifdef _MGSCHEMA_SHAREDFB
/* show cursor hidden by client GDI function */
void kernel_ReShowCursor (void)
{
@@ -911,7 +911,7 @@ void kernel_ReShowCursor (void)
}
unlock_cursor_sem ();
}
#endif /* _MGUSE_SHAREDFB */
#endif /* _MGSCHEMA_SHAREDFB */
/* Always call with "setdef = FALSE" for clients at server side. */
HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL setdef)
@@ -945,7 +945,7 @@ HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL setdef)
pcsr = (PCURSOR)hcsr;
lock_cursor_sem ();
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
CSR_CURRENT_SET = (HCURSOR)pcsr;
CSR_XHOTSPOT = pcsr ? pcsr->xhotspot : -100;
CSR_YHOTSPOT = pcsr ? pcsr->yhotspot : -100;
@@ -955,7 +955,7 @@ HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL setdef)
else
GAL_SetCursor (NULL, 0, 0);
#else /* _MGUSE_SHAREDFB */
#else /* _MGSCHEMA_SHAREDFB */
if (CSR_CURRENT && CSR_SHOW_COUNT >= 0
&& get_hidecursor_sem_val () == 0)
hidecursor();
@@ -978,7 +978,7 @@ HCURSOR GUIAPI GetCurrentCursor (void)
return (HCURSOR)CSR_CURRENT;
}
#ifdef _MGUSE_SHAREDFB
#ifdef _MGSCHEMA_SHAREDFB
static inline BOOL does_need_hide (const RECT* prc)
{
@@ -1002,7 +1002,7 @@ static inline BOOL does_need_hide (const RECT* prc)
return TRUE;
}
/* version for _MGUSE_SHAREDFB */
/* version for _MGSCHEMA_SHAREDFB */
void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
{
PDC cur_pdc = (PDC)pdc;
@@ -1039,7 +1039,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
#else
/* version for _MGUSE_COMPOSITING */
/* version for _MGSCHEMA_COMPOSITING */
void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
{
PDC cur_pdc = (PDC)pdc;
@@ -1056,7 +1056,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
}
}
#endif /* _MGUSE_SHAREDFB */
#endif /* _MGSCHEMA_SHAREDFB */
int GUIAPI ShowCursor (BOOL fShow)
{
@@ -1072,7 +1072,7 @@ int GUIAPI ShowCursor (BOOL fShow)
return ret_value;
}
#ifdef _MGUSE_SHAREDFB
#ifdef _MGSCHEMA_SHAREDFB
lock_cursor_sem ();
if (fShow) {
CSR_SHOW_COUNT++;
@@ -1086,7 +1086,7 @@ int GUIAPI ShowCursor (BOOL fShow)
hidecursor();
}
unlock_cursor_sem ();
#else /* _MGUSE_SHAREDFB */
#else /* _MGSCHEMA_SHAREDFB */
if (fShow) {
CSR_SHOW_COUNT++;
if (CSR_SHOW_COUNT == 0 && CSR_CURRENT) {
@@ -1100,7 +1100,7 @@ int GUIAPI ShowCursor (BOOL fShow)
GAL_SetCursor (NULL, 0, 0);
}
}
#endif /* _MGUSE_COMPOSITING */
#endif /* _MGSCHEMA_COMPOSITING */
return CSR_SHOW_COUNT;
}

View File

@@ -92,7 +92,7 @@
#define CURSORSECTION "cursorinfo"
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
static BOOL LoadCursorRes (void)
{
@@ -152,7 +152,7 @@ error:
return FALSE;
}
#else /* _MGUSE_COMPOSITING */
#else /* _MGSCHEMA_COMPOSITING */
extern unsigned int __mg_csrimgpitch;
static BOOL LoadCursorRes (void)
@@ -213,7 +213,7 @@ error:
return FALSE;
}
#endif /* _MGUSE_COMPOSITING */
#endif /* _MGSCHEMA_COMPOSITING */
#endif /* _MGHAVE_CURSOR */

View File

@@ -66,7 +66,7 @@
GAL_Surface* __gal_screen;
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
GAL_Surface* __gal_fake_screen;
#endif
@@ -75,7 +75,7 @@ RECT GUIAPI GetScreenRect (void)
static RECT rc;
if (RECTH (rc) == 0) {
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
rc.left = 0;
rc.top = 0;
rc.right = SHAREDRES_VIDEO_HRES;
@@ -163,7 +163,7 @@ static int get_dpi_from_etc (const char* engine)
return dpi;
}
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
#define LEN_WALLPAPER_PATTER_SIZE 31
#include "client.h"
@@ -282,7 +282,7 @@ int mg_InitGAL (char* engine, char* mode)
strncpy (mode, SHAREDRES_VIDEO_MODE, LEN_VIDEO_MODE);
mode [LEN_VIDEO_MODE] = '\0';
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
need_set_mode = FALSE;
#endif
}
@@ -323,7 +323,7 @@ int mg_InitGAL (char* engine, char* mode)
}
}
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
if (!(__gal_fake_screen = create_wp_surface(__gal_screen))) {
GAL_VideoQuit ();
_ERR_PRINTF ("NEWGAL: Failed to create wallpaper pattern surface.\n");

View File

@@ -241,7 +241,7 @@ int GAL_VideoInit (const char *driver_name, Uint32 flags)
GAL_VideoQuit();
}
#if defined(_MGRM_PROCESSES) && defined(_MGUSE_COMPOSITING)
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING)
video = GAL_GetVideo(driver_name, TRUE);
#else
video = GAL_GetVideo(driver_name, FALSE);
@@ -631,7 +631,7 @@ GAL_Surface * GAL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
return(GAL_PublicSurface);
}
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
void GAL_SetVideoModeInfo(GAL_Surface* screen)
{
assert(screen);
@@ -1016,7 +1016,7 @@ void GAL_VideoQuit (void)
video->VideoQuit (this);
if (GAL_VideoSurface != NULL) {
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
GAL_VideoSurface = NULL;
if (IsServer()) {
GAL_FreeSurface (__gal_screen);

View File

@@ -82,7 +82,7 @@ struct GlobalRes
ReleaseProc release_proc;
};
#if defined(_MGHAVE_CURSOR) || defined(_MGGAL_MLSHADOW) || defined(_MGUSE_SHAREDFB)
#if defined(_MGHAVE_CURSOR) || defined(_MGGAL_MLSHADOW) || defined(_MGSCHEMA_SHAREDFB)
static void add_global_res (int cli, void* key,
void* res, ReleaseProc release_proc)
{
@@ -107,7 +107,7 @@ static void add_global_res (int cli, void* key,
}
}
}
#endif // defined(_MGHAVE_CURSOR) || defined(_MGGAL_MLSHADOW) || defined(_MGUSE_SHAREDFB)
#endif // defined(_MGHAVE_CURSOR) || defined(_MGGAL_MLSHADOW) || defined(_MGSCHEMA_SHAREDFB)
#ifdef _MGGAL_MLSHADOW
extern int MLSHADOW_Server(void* request, void* reply);

View File

@@ -345,7 +345,7 @@ BOOL server_IdleHandler4Server (PMSGQUEUE msg_queue)
esetptr = &eset;
}
#if defined (_MGHAVE_CURSOR) && defined(_MGUSE_SHAREDFB)
#if defined (_MGHAVE_CURSOR) && defined(_MGSCHEMA_SHAREDFB)
/* if the cursor has been hide by GDI function of clients
* this call will show the cursor
*/

View File

@@ -105,7 +105,7 @@ HCURSOR __mg_load_cursor_from_res (int i)
int nr_cursors = 0;
char key [32];
char filename [MAX_NAME + 1];
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
const char* ext;
BOOL is_png = FALSE;
int hotspot[2] = { 0, 0 };
@@ -121,7 +121,7 @@ HCURSOR __mg_load_cursor_from_res (int i)
if (GetMgEtcValue (CURSORSECTION, key, filename, MAX_NAME) < 0)
return 0;
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
ext = __mg_get_extension (filename);
if (ext && strcasecmp (ext, "png") == 0) {
sprintf (key, "hotspot%d", i);
@@ -134,7 +134,7 @@ HCURSOR __mg_load_cursor_from_res (int i)
#endif
#ifdef _MGINCORE_RES
# ifdef _MGUSE_COMPOSITING
# ifdef _MGSCHEMA_COMPOSITING
if (is_png)
hCursor = LoadCursorFromPNGMem (__mg_cursors_data + __mg_cursors_offset [i],
hotspot[0], hotspot[1]);
@@ -153,7 +153,7 @@ HCURSOR __mg_load_cursor_from_res (int i)
strcat (path, filename);
path [MAX_PATH] = 0;
#ifdef _MGUSE_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
if (is_png)
hCursor = LoadCursorFromPNGFile (path, hotspot[0], hotspot[1]);
else