diff options
-rw-r--r-- | dsimple.c | 4 | ||||
-rw-r--r-- | dsimple.h | 24 | ||||
-rw-r--r-- | list.c | 57 | ||||
-rw-r--r-- | list.h | 25 | ||||
-rw-r--r-- | multiVis.c | 64 | ||||
-rw-r--r-- | multiVis.h | 7 | ||||
-rw-r--r-- | wsutils.h | 14 |
7 files changed, 28 insertions, 167 deletions
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xlsfonts/dsimple.c,v 3.6 2001/12/14 20:02:09 dawes Exp $ */ +/* $XFree86: xc/programs/xlsfonts/dsimple.c,v 3.7 2003/09/24 02:43:38 dawes Exp $ */ #include <X11/Xos.h> #include <X11/Xlib.h> @@ -306,7 +306,7 @@ Window Select_Window_Args(rargc, argv) w=0; sscanf(OPTION, "0x%lx", &w); if (!w) - sscanf(OPTION, "%ld", &w); + sscanf(OPTION, "%lu", &w); if (!w) Fatal_Error("Invalid window id format: %s.", OPTION); continue; @@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xlsfonts/dsimple.h,v 1.8 2002/12/24 17:43:01 tsi Exp $ */ +/* $XFree86: xc/programs/xlsfonts/dsimple.h,v 1.9 2003/11/17 22:20:54 dawes Exp $ */ /* * Just_display.h: This file contains the definitions needed to use the @@ -50,7 +50,6 @@ extern int screen; /* The current screen */ /* Declaritions for functions in just_display.c */ -#if NeedFunctionPrototypes char *Malloc(unsigned); char *Realloc(char *, int); char *Get_Display_Name(int *, char **); @@ -62,19 +61,6 @@ Pixmap ReadBitmapFile(Drawable, char *, int *, int *, int *, int *); void WriteBitmapFile(char *, Pixmap, int, int, int, int); Window Select_Window_Args(int *, char **); void usage(void); -#else -char *Malloc(); -char *Realloc(); -char *Get_Display_Name(); -Display *Open_Display(); -void Setup_Display_And_Screen(); -XFontStruct *Open_Font(); -void Beep(); -Pixmap ReadBitmapFile(); -void WriteBitmapFile(); -Window Select_Window_Args(); -void usage(); -#endif #define X_USAGE "[host:display]" /* X arguments handled by Get_Display_Name */ @@ -87,19 +73,11 @@ void usage(); * Send bugs, etc. to chariot@athena.mit.edu. */ -#if NeedFunctionPrototypes unsigned long Resolve_Color(Window, char *); Pixmap Bitmap_To_Pixmap(Display *, Drawable, GC, Pixmap, int, int); Window Select_Window(Display *); void blip(void); Window Window_With_Name(Display *, Window, char *); -#else -unsigned long Resolve_Color(); -Pixmap Bitmap_To_Pixmap(); -Window Select_Window(); -void blip(); -Window Window_With_Name(); -#endif #ifdef __GNUC__ void Fatal_Error(char *, ...) __attribute__((__noreturn__)); #else @@ -34,7 +34,7 @@ other dealings in this Software without prior written authorization from The Open Group. ----------------------------------------------------------------------- **/ -/* $XFree86: xc/programs/xwd/list.c,v 3.6 2001/12/14 20:02:33 dawes Exp $ */ +/* $XFree86: xc/programs/xwd/list.c,v 3.7 2003/11/17 22:20:54 dawes Exp $ */ #include <stdio.h> #include <stdlib.h> @@ -45,12 +45,7 @@ from The Open Group. /** ------------------------------------------------------------------------ Sets the pointers of the specified list to NULL. --------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes void zero_list(list_ptr lp) -#else -void zero_list(lp) - list_ptr lp; -#endif { lp->next = NULL; lp->ptr.item = NULL; @@ -64,13 +59,7 @@ void zero_list(lp) and the next pointer in the new node is set to NULL. Returns 1 if successful, 0 if the malloc failed. -------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes int add_to_list(list_ptr lp, void *item) -#else -int add_to_list(lp, item) - list_ptr lp; - void *item; -#endif { while (lp->next) { lp = lp->next; @@ -112,13 +101,7 @@ list_ptr new_list () curr pointer in the new list is the same as in the old list. Returns a pointer to the new list head. -------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes list_ptr dup_list_head(list_ptr lp, int start_at_curr) -#else -list_ptr dup_list_head(lp, start_at_curr) - list_ptr lp; - int start_at_curr; -#endif { list_ptr new_list; @@ -136,12 +119,7 @@ list_ptr dup_list_head(lp, start_at_curr) /** ------------------------------------------------------------------------ Returns the number of items in the list. -------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes unsigned int list_length(list_ptr lp) -#else -unsigned int list_length(lp) - list_ptr lp; -#endif { unsigned int count = 0; @@ -163,13 +141,7 @@ unsigned int list_length(lp) Returns a pointer to the item, so the caller can free it if it so desires. If a match is not found, returns NULL. -------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes void *delete_from_list(list_ptr lp, void *item) -#else -void *delete_from_list(lp, item) - list_ptr lp; - void *item; -#endif { list_ptr new_next; @@ -194,13 +166,7 @@ void *delete_from_list(lp, item) with new_list(). If free_items is true, each item pointed to from the node is freed, in addition to the node itself. -------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes void delete_list(list_ptr lp, int free_items) -#else -void delete_list(lp, free_items) - list_ptr lp; - int free_items; -#endif { list_ptr del_node; void *item; @@ -216,13 +182,7 @@ void delete_list(lp, free_items) } } -#if NeedFunctionPrototypes void delete_list_destroying(list_ptr lp, void destructor(void *item)) -#else -void delete_list_destroying(lp, destructor) - list_ptr lp; - void (*destructor)(); -#endif { list_ptr del_node; void *item; @@ -244,12 +204,7 @@ void delete_list_destroying(lp, destructor) Sets the list head node's curr ptr to the first node in the list. Returns NULL if the list is empty. -------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes void * first_in_list(list_ptr lp) -#else -void * first_in_list(lp) - list_ptr lp; -#endif { if (! lp) { @@ -266,12 +221,7 @@ void * first_in_list(lp) first_in_list must have been called prior. Returns NULL if no next item. -------------------------------------------------------------------- **/ -#if NeedFunctionPrototypes void * next_in_list(list_ptr lp) -#else -void * next_in_list(lp) - list_ptr lp; -#endif { if (! lp) { @@ -284,12 +234,7 @@ void * next_in_list(lp) return lp->ptr.curr ? lp->ptr.curr->ptr.item : NULL; } -#if NeedFunctionPrototypes int list_is_empty(list_ptr lp) -#else -int list_is_empty(lp) - list_ptr lp; -#endif { return (lp == NULL || lp->next == NULL); } @@ -34,6 +34,7 @@ other dealings in this Software without prior written authorization from The Open Group. -------------------------------------------------------------------- **/ +/* $XFree86: xc/programs/xwd/list.h,v 1.6 2003/11/17 22:20:54 dawes Exp $ */ #ifndef LIST_DEF #define LIST_DEF @@ -54,65 +55,41 @@ typedef struct _list_item { } list, list_item, *list_ptr; typedef void (*DESTRUCT_FUNC_PTR)( -#if NeedFunctionPrototypes void * -#endif ); void zero_list( -#if NeedFunctionPrototypes list_ptr -#endif ); int add_to_list ( -#if NeedFunctionPrototypes list_ptr , void * -#endif ); list_ptr new_list ( -#if NeedFunctionPrototypes void -#endif ); list_ptr dup_list_head ( -#if NeedFunctionPrototypes list_ptr , int -#endif ); unsigned int list_length( -#if NeedFunctionPrototypes list_ptr -#endif ); void *delete_from_list ( -#if NeedFunctionPrototypes list_ptr , void * -#endif ); void delete_list( -#if NeedFunctionPrototypes list_ptr , int -#endif ); void delete_list_destroying ( -#if NeedFunctionPrototypes list_ptr , DESTRUCT_FUNC_PTR -#endif ); void *first_in_list ( -#if NeedFunctionPrototypes list_ptr -#endif ); void *next_in_list ( -#if NeedFunctionPrototypes list_ptr -#endif ); int list_is_empty ( -#if NeedFunctionPrototypes list_ptr -#endif ); #endif @@ -34,7 +34,7 @@ other dealings in this Software without prior written authorization from The Open Group. ------------------------------------------------------------------------ **/ -/* $XFree86: xc/programs/xwd/multiVis.c,v 1.8 2002/12/10 22:38:50 tsi Exp $ */ +/* $XFree86: xc/programs/xwd/multiVis.c,v 1.10 2003/11/17 22:20:54 dawes Exp $ */ #include <stdlib.h> #include <X11/Xlib.h> @@ -119,79 +119,53 @@ extern unsigned int list_length(); /* Prototype Declarations for Static Functions */ static int QueryColorMap( -#if NeedFunctionPrototypes Display *, Colormap , Visual *, XColor **, int *, int *, int * -#endif ); static void TransferImage( -#if NeedFunctionPrototypes Display *, XImage *,int, int , image_region_type*, XImage *,int ,int -#endif ); static XImage * ReadRegionsInList( -#if NeedFunctionPrototypes Display *, Visual *, int ,int ,int , int , XRectangle, list_ptr -#endif ); static list_ptr make_region_list( -#if NeedFunctionPrototypes Display*, Window, XRectangle*, int*, int, XVisualInfo**, int * -#endif ); static void destroy_region_list( -#if NeedFunctionPrototypes list_ptr -#endif ) ; static void subtr_rect_from_image_region( -#if NeedFunctionPrototypes image_region_type *, int , int , int , int -#endif ); static void add_rect_to_image_region( -#if NeedFunctionPrototypes image_region_type *, int , int , int , int -#endif ); static int src_in_region_list( -#if NeedFunctionPrototypes image_win_type *, list_ptr -#endif ); static void add_window_to_list( -#if NeedFunctionPrototypes list_ptr, Window, int, int , int , int , int , int, int, Visual*, Colormap, Window -#endif ); static int src_in_image( -#if NeedFunctionPrototypes image_win_type *, int , XVisualInfo** -#endif ); static int src_in_overlay( -#if NeedFunctionPrototypes image_region_type *, int, OverlayInfo *, int*, int* -#endif ); static void make_src_list( -#if NeedFunctionPrototypes Display *, list_ptr, XRectangle *, Window, int, int, XWindowAttributes *, XRectangle * -#endif ); static void destroy_image_region( -#if NeedFunctionPrototypes image_region_type * -#endif ); /* End of Prototype Declarations */ @@ -337,17 +311,13 @@ XImage *reg_image,*target_image ; image_region_type *reg; int srcw,srch,dst_x , dst_y ; { - int ncolors; int i,j,old_pixel,new_pixel,red_ind,green_ind,blue_ind ; XColor *colors; int rShift,gShift,bShift; - int targetBytesPerLine ; - ncolors = QueryColorMap(disp,reg->cmap,reg->vis,&colors, + (void) QueryColorMap(disp,reg->cmap,reg->vis,&colors, &rShift,&gShift,&bShift) ; - targetBytesPerLine = target_image->bytes_per_line; - switch (reg->vis->class) { case TrueColor : for(i=0 ; i < srch ; i++) @@ -529,7 +499,9 @@ XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, Visual fakeVis ; int x1, y1; XImage *image; +#if 0 unsigned char *pmData , *ipmData ; +#endif int transparentColor, transparentType; int srcRect_x,srcRect_y,srcRect_width,srcRect_height ; int diff ; @@ -547,14 +519,18 @@ XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, depth = 24 ; ximage = ReadRegionsInList(disp,&fakeVis,depth,format,width,height, bbox,vis_regions) ; +#if 0 pmData = (unsigned char *)ximage -> data ; +#endif /* if transparency possible do it again, but this time for image planes only */ if (vis_image_regions && (vis_image_regions->next) && !allImage) { ximage_ipm = ReadRegionsInList(disp,&fakeVis,depth,format,width,height, bbox,vis_image_regions) ; +#if 0 ipmData = (unsigned char *)ximage_ipm -> data ; +#endif } /* Now tranverse the overlay visual windows and test for transparency index. */ /* If you find one, subsitute the value from the matching image plane pixmap. */ @@ -593,11 +569,11 @@ XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, { if (*pixel_ptr++ == transparentColor) { - /* +#if 0 *pmData++ = *ipmData++; *pmData++ = *ipmData++; *pmData++ = *ipmData++; - */ +#endif pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ; XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel); @@ -605,12 +581,12 @@ XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, test = 1 ; } } - /* +#if 0 else { pmData +=3; ipmData +=3; } - */ +#endif } start_of_line += image->bytes_per_line; } @@ -622,23 +598,23 @@ XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, int pixel_value = XGetPixel(image, x1, y1); if (pixel_value == transparentColor) { - /* +#if 0 *pmData++ = *ipmData++; *pmData++ = *ipmData++; *pmData++ = *ipmData++; - */ +#endif pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ; XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel); if(!test){ test = 1 ; } } - /* +#if 0 else { pmData +=3; ipmData +=3; } - */ +#endif } } } else { @@ -648,23 +624,23 @@ XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, int pixel_value = XGetPixel(image, x1, y1); if (pixel_value & transparentColor) { - /* +#if 0 *pmData++ = *ipmData++; *pmData++ = *ipmData++; *pmData++ = *ipmData++; - */ +#endif pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ; XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel); if(!test){ test = 1 ; } } - /* +#if 0 else { pmData +=3; ipmData +=3; } - */ +#endif } } } @@ -34,27 +34,22 @@ other dealings in this Software without prior written authorization from The Open Group. ------------------------------------------------------------------------ **/ +/* $XFree86: xc/programs/xwd/multiVis.h,v 1.3 2003/11/17 22:20:54 dawes Exp $ */ extern int GetMultiVisualRegions( -#if NeedFunctionPrototypes Display *, Window, int, int, unsigned int, unsigned int, int *, int *, XVisualInfo **, int *, OverlayInfo **, int *, XVisualInfo ***, list_ptr *, list_ptr *, int * -#endif ); extern XImage *ReadAreaToImage( -#if NeedFunctionPrototypes Display *, Window, int, int, unsigned int, unsigned int, int, XVisualInfo *, int, OverlayInfo *, int, XVisualInfo **, list_ptr, list_ptr, int, int -#endif ); extern void initFakeVisual( -#if NeedFunctionPrototypes Visual * -#endif ); @@ -34,6 +34,8 @@ other dealings in this Software without prior written authorization from The Open Group. ------------------------------------------------------------------------ **/ +/* $XFree86: xc/programs/xwd/wsutils.h,v 1.3 2003/11/17 22:20:54 dawes Exp $ */ + /****************************************************************************** * * This file contains various typedef's, macros and procedure declarations for @@ -129,7 +131,6 @@ typedef struct ******************************************************************************/ extern int GetXVisualInfo( -#if NeedFunctionPrototypes Display *display, /* Which X server (aka "display"). */ int screen, /* Which screen of the "display". */ int *transparentOverlays, /* Non-zero if there's at least one @@ -148,7 +149,6 @@ extern int GetXVisualInfo( int *numImageVisuals, /* Number of XVisualInfo's pointed * to by pImageVisuals. */ XVisualInfo ***pImageVisuals /* The device's image visuals. */ -#endif ); @@ -161,11 +161,9 @@ extern int GetXVisualInfo( ******************************************************************************/ extern void FreeXVisualInfo( -#if NeedFunctionPrototypes XVisualInfo *pVisuals, OverlayInfo *pOverlayVisuals, XVisualInfo **pImageVisuals -#endif ); @@ -190,7 +188,6 @@ extern void FreeXVisualInfo( ******************************************************************************/ extern int FindImagePlanesVisual( -#if NeedFunctionPrototypes Display *display, /* Which X server (aka "display"). */ int screen, /* Which screen of the "display". */ int numImageVisuals, /* Number of XVisualInfo's pointed @@ -204,7 +201,6 @@ extern int FindImagePlanesVisual( * "depthHint" is desired. */ Visual **pImageVisualToUse, /* The screen's image visual to use. */ int *depthObtained /* Actual depth of the visual. */ -#endif ); @@ -238,7 +234,6 @@ extern int FindImagePlanesVisual( ******************************************************************************/ extern int FindOverlayPlanesVisual( -#if NeedFunctionPrototypes Display *display, /* Which X server (aka "display"). */ int screen, /* Which screen of the "display". */ int numOverlayVisuals, /* Number of OverlayInfo's pointed @@ -255,7 +250,6 @@ extern int FindOverlayPlanesVisual( int *depthObtained, /* Actual depth of the visual. */ int *transparentColor /* The transparent color the program * can use with the visual. */ -#endif ); @@ -279,7 +273,6 @@ extern int FindOverlayPlanesVisual( ******************************************************************************/ extern int CreateImagePlanesWindow( -#if NeedFunctionPrototypes Display *display, /* Which X server (aka "display"). */ int screen, /* Which screen of the "display". */ Window parentWindow, /* Window ID of the parent window for @@ -298,7 +291,6 @@ extern int CreateImagePlanesWindow( Colormap *imageColormap, /* The window's colormap. */ int *mustFreeImageColormap /* Non-zero if the program must call * XFreeColormap() for imageColormap. */ -#endif ); @@ -322,7 +314,6 @@ extern int CreateImagePlanesWindow( ******************************************************************************/ int CreateOverlayPlanesWindow( -#if NeedFunctionPrototypes Display *display, /* Which X server (aka "display"). */ int screen, /* Which screen of the "display". */ Window parentWindow, /* Window ID of the parent window for @@ -346,5 +337,4 @@ int CreateOverlayPlanesWindow( int *mustFreeOverlayColormap/* Non-zero if the program must call * XFreeColormap() for * overlayColormap. */ -#endif ); |