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>
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;
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
/* Declaritions for functions in just_display.c */
-#if NeedFunctionPrototypes
char *Malloc(unsigned);
char *Realloc(char *, int);
char *Get_Display_Name(int *, char **);
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 */
* 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
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>
/** ------------------------------------------------------------------------
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;
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;
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;
/** ------------------------------------------------------------------------
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;
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;
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;
}
}
-#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;
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) {
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) {
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);
}
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
} 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
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>
/* 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 */
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++)
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 ;
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. */
{
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);
test = 1 ;
}
}
- /*
+#if 0
else {
pmData +=3;
ipmData +=3;
}
- */
+#endif
}
start_of_line += image->bytes_per_line;
}
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 {
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
}
}
}
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
);
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
******************************************************************************/
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
int *numImageVisuals, /* Number of XVisualInfo's pointed
* to by pImageVisuals. */
XVisualInfo ***pImageVisuals /* The device's image visuals. */
-#endif
);
******************************************************************************/
extern void FreeXVisualInfo(
-#if NeedFunctionPrototypes
XVisualInfo *pVisuals,
OverlayInfo *pOverlayVisuals,
XVisualInfo **pImageVisuals
-#endif
);
******************************************************************************/
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
* "depthHint" is desired. */
Visual **pImageVisualToUse, /* The screen's image visual to use. */
int *depthObtained /* Actual depth of the visual. */
-#endif
);
******************************************************************************/
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
int *depthObtained, /* Actual depth of the visual. */
int *transparentColor /* The transparent color the program
* can use with the visual. */
-#endif
);
******************************************************************************/
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
Colormap *imageColormap, /* The window's colormap. */
int *mustFreeImageColormap /* Non-zero if the program must call
* XFreeColormap() for imageColormap. */
-#endif
);
******************************************************************************/
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
int *mustFreeOverlayColormap/* Non-zero if the program must call
* XFreeColormap() for
* overlayColormap. */
-#endif
);