mirror of
https://github.com/gnustep/libs-back.git
synced 2025-06-04 19:20:47 +00:00
Remove unnecessary files from headless
This commit is contained in:
parent
eb33208002
commit
14fa3679c8
3 changed files with 0 additions and 724 deletions
|
@ -1,112 +0,0 @@
|
|||
/* $XConsortium: StdCmap.h,v 1.4 94/04/17 20:16:15 converse Exp $ */
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 1988 X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* The interfaces described by this header file are for miscellaneous utilities
|
||||
* and are not part of the Xlib standard.
|
||||
*/
|
||||
|
||||
#ifndef _XMU_STDCMAP_H_
|
||||
#define _XMU_STDCMAP_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
Status XmuAllStandardColormaps(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* dpy */
|
||||
#endif
|
||||
);
|
||||
|
||||
Status XmuCreateColormap(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* dpy */,
|
||||
XStandardColormap* /* colormap */
|
||||
#endif
|
||||
);
|
||||
|
||||
void XmuDeleteStandardColormap(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* dpy */,
|
||||
int /* screen */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
Status XmuGetColormapAllocation(
|
||||
#if NeedFunctionPrototypes
|
||||
XVisualInfo* /* vinfo */,
|
||||
Atom /* property */,
|
||||
unsigned long* /* red_max_return */,
|
||||
unsigned long* /* green_max_return */,
|
||||
unsigned long* /* blue_max_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
Status XmuLookupStandardColormap(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* dpy */,
|
||||
int /* screen */,
|
||||
VisualID /* visualid */,
|
||||
unsigned int /* depth */,
|
||||
Atom /* property */,
|
||||
Bool /* replace */,
|
||||
Bool /* retain */
|
||||
#endif
|
||||
);
|
||||
|
||||
XStandardColormap *XmuStandardColormap(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* dpy */,
|
||||
int /* screen */,
|
||||
VisualID /* visualid */,
|
||||
unsigned int /* depth */,
|
||||
Atom /* property */,
|
||||
Colormap /* cmap */,
|
||||
unsigned long /* red_max */,
|
||||
unsigned long /* green_max */,
|
||||
unsigned long /* blue_max */
|
||||
#endif
|
||||
);
|
||||
|
||||
Status XmuVisualStandardColormaps(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* dpy */,
|
||||
int /* screen */,
|
||||
VisualID /* visualid */,
|
||||
unsigned int /* depth */,
|
||||
Bool /* replace */,
|
||||
Bool /* retain */
|
||||
#endif
|
||||
);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _XMU_STDCMAP_H_ */
|
|
@ -1,477 +0,0 @@
|
|||
/*
|
||||
* Raster graphics library
|
||||
*
|
||||
* Copyright (c) 1997-2002 Alfredo K. Kojima
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Environment variables:
|
||||
*
|
||||
* WRASTER_GAMMA <rgamma>/<ggamma>/<bgamma>
|
||||
* gamma correction value. Must be greater than 0
|
||||
* Only for PseudoColor visuals.
|
||||
*
|
||||
* Default:
|
||||
* WRASTER_GAMMA 1/1/1
|
||||
*
|
||||
*
|
||||
* If you want a specific value for a screen, append the screen number
|
||||
* preceded by a hash to the variable name as in
|
||||
* WRASTER_GAMMA#1
|
||||
* for screen number 1
|
||||
*/
|
||||
|
||||
#ifndef RLRASTER_H_
|
||||
#define RLRASTER_H_
|
||||
|
||||
|
||||
/* version of the header for the library: 0.21 */
|
||||
#define WRASTER_HEADER_VERSION 21
|
||||
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#ifdef XSHM
|
||||
#include <X11/extensions/XShm.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* RBestMatchRendering or RDitheredRendering */
|
||||
#define RC_RenderMode (1<<0)
|
||||
|
||||
/* number of colors per channel for colormap in PseudoColor mode */
|
||||
#define RC_ColorsPerChannel (1<<1)
|
||||
|
||||
/* do gamma correction */
|
||||
#define RC_GammaCorrection (1<<2)
|
||||
|
||||
/* visual id to use */
|
||||
#define RC_VisualID (1<<3)
|
||||
|
||||
/* shared memory usage */
|
||||
#define RC_UseSharedMemory (1<<4)
|
||||
|
||||
/* use default instead of best visual */
|
||||
#define RC_DefaultVisual (1<<5)
|
||||
|
||||
/* filter type for smoothed scaling */
|
||||
#define RC_ScalingFilter (1<<6)
|
||||
|
||||
/* standard colormap usage */
|
||||
#define RC_StandardColormap (1<<7)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* std colormap usage/creation modes */
|
||||
enum {
|
||||
RUseStdColormap, /* default. fallbacks to RIgnore.. if
|
||||
there is none defined */
|
||||
RCreateStdColormap,
|
||||
RIgnoreStdColormap
|
||||
};
|
||||
|
||||
|
||||
|
||||
typedef struct RContextAttributes {
|
||||
int flags;
|
||||
int render_mode;
|
||||
int colors_per_channel; /* for PseudoColor */
|
||||
float rgamma; /* gamma correction for red, */
|
||||
float ggamma; /* green, */
|
||||
float bgamma; /* and blue */
|
||||
VisualID visualid; /* visual ID to use */
|
||||
int use_shared_memory; /* True of False */
|
||||
int scaling_filter;
|
||||
int standard_colormap_mode; /* what to do with std cma */
|
||||
} RContextAttributes;
|
||||
|
||||
|
||||
/*
|
||||
* describes a screen in terms of depth, visual, number of colors
|
||||
* we can use, if we should do dithering, and what colors to use for
|
||||
* dithering.
|
||||
*/
|
||||
typedef struct RContext {
|
||||
Display *dpy;
|
||||
int screen_number;
|
||||
Colormap cmap;
|
||||
|
||||
RContextAttributes *attribs;
|
||||
|
||||
GC copy_gc;
|
||||
|
||||
Visual *visual;
|
||||
int depth;
|
||||
Window drawable; /* window to pass for XCreatePixmap().*/
|
||||
/* generally = root */
|
||||
int vclass;
|
||||
|
||||
unsigned long black;
|
||||
unsigned long white;
|
||||
|
||||
int red_offset; /* only used in 24bpp */
|
||||
int green_offset;
|
||||
int blue_offset;
|
||||
|
||||
/* only used for pseudocolor and grayscale */
|
||||
|
||||
XStandardColormap *std_rgb_map; /* standard RGB colormap */
|
||||
XStandardColormap *std_gray_map; /* standard grayscale colormap */
|
||||
|
||||
int ncolors; /* total number of colors we can use */
|
||||
XColor *colors; /* internal colormap */
|
||||
unsigned long *pixels; /* RContext->colors[].pixel */
|
||||
|
||||
struct {
|
||||
unsigned int use_shared_pixmap:1;
|
||||
unsigned int optimize_for_speed:1;
|
||||
} flags;
|
||||
|
||||
struct RHermesData *hermes_data; /* handle for Hermes stuff */
|
||||
} RContext;
|
||||
|
||||
|
||||
typedef struct RColor {
|
||||
unsigned char red;
|
||||
unsigned char green;
|
||||
unsigned char blue;
|
||||
unsigned char alpha;
|
||||
} RColor;
|
||||
|
||||
|
||||
typedef struct RHSVColor {
|
||||
unsigned short hue; /* 0-359 */
|
||||
unsigned char saturation; /* 0-255 */
|
||||
unsigned char value; /* 0-255 */
|
||||
} RHSVColor;
|
||||
|
||||
|
||||
|
||||
typedef struct RPoint {
|
||||
int x, y;
|
||||
} RPoint;
|
||||
|
||||
|
||||
typedef struct RSegment {
|
||||
int x1, y1, x2, y2;
|
||||
} RSegment;
|
||||
|
||||
|
||||
|
||||
/* image formats */
|
||||
enum RImageFormat {
|
||||
RRGBFormat,
|
||||
RRGBAFormat
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* internal 24bit+alpha image representation
|
||||
*/
|
||||
typedef struct RImage {
|
||||
unsigned char *data; /* image data RGBA or RGB */
|
||||
int width, height; /* size of the image */
|
||||
enum RImageFormat format;
|
||||
RColor background; /* background color */
|
||||
int refCount;
|
||||
} RImage;
|
||||
|
||||
|
||||
/*
|
||||
* internal wrapper for XImage. Used for shm abstraction
|
||||
*/
|
||||
typedef struct RXImage {
|
||||
XImage *image;
|
||||
|
||||
/* Private data. Do not access */
|
||||
#ifdef XSHM
|
||||
XShmSegmentInfo info;
|
||||
char is_shared;
|
||||
#endif
|
||||
} RXImage;
|
||||
|
||||
|
||||
/* image display modes */
|
||||
enum {
|
||||
RDitheredRendering = 0,
|
||||
RBestMatchRendering = 1
|
||||
};
|
||||
|
||||
|
||||
/* smoothed scaling filter types */
|
||||
enum {
|
||||
RBoxFilter,
|
||||
RTriangleFilter,
|
||||
RBellFilter,
|
||||
RBSplineFilter,
|
||||
RLanczos3Filter,
|
||||
RMitchellFilter
|
||||
};
|
||||
|
||||
|
||||
/* note that not all operations are supported in all functions */
|
||||
enum {
|
||||
RClearOperation, /* clear with 0 */
|
||||
RCopyOperation,
|
||||
RNormalOperation, /* same as combine */
|
||||
RAddOperation,
|
||||
RSubtractOperation
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
RAbsoluteCoordinates = 0,
|
||||
RRelativeCoordinates = 1
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
RSunkenBevel = -1,
|
||||
RNoBevel = 0,
|
||||
RRaisedBevel = 1
|
||||
};
|
||||
/* bw compat */
|
||||
#define RBEV_SUNKEN RSunkenBevel
|
||||
/* 1 pixel wide */
|
||||
#define RBEV_RAISED RRaisedBevel
|
||||
/* 1 pixel wide on top/left 2 on bottom/right */
|
||||
#define RBEV_RAISED2 2
|
||||
/* 2 pixel width */
|
||||
#define RBEV_RAISED3 3
|
||||
|
||||
enum {
|
||||
RHorizontalGradient = 2,
|
||||
RVerticalGradient = 3,
|
||||
RDiagonalGradient = 4
|
||||
};
|
||||
/* for backwards compatibility */
|
||||
#define RGRD_HORIZONTAL RHorizontalGradient
|
||||
#define RGRD_VERTICAL RVerticalGradient
|
||||
#define RGRD_DIAGONAL RDiagonalGradient
|
||||
|
||||
|
||||
|
||||
/* error codes */
|
||||
#define RERR_NONE 0
|
||||
#define RERR_OPEN 1 /* cant open file */
|
||||
#define RERR_READ 2 /* error reading from file */
|
||||
#define RERR_WRITE 3 /* error writing to file */
|
||||
#define RERR_NOMEMORY 4 /* out of memory */
|
||||
#define RERR_NOCOLOR 5 /* out of color cells */
|
||||
#define RERR_BADIMAGEFILE 6 /* image file is corrupted or invalid */
|
||||
#define RERR_BADFORMAT 7 /* image file format is unknown */
|
||||
#define RERR_BADINDEX 8 /* no such image index in file */
|
||||
|
||||
#define RERR_BADVISUALID 16 /* invalid visual ID requested for context */
|
||||
#define RERR_STDCMAPFAIL 17 /* failed to created std colormap */
|
||||
|
||||
#define RERR_XERROR 127 /* internal X error */
|
||||
#define RERR_INTERNAL 128 /* should not happen */
|
||||
|
||||
|
||||
/*
|
||||
* Returns a NULL terminated array of strings containing the
|
||||
* supported formats, such as: TIFF, XPM, PNG, JPEG, PPM, GIF
|
||||
* Do not free the returned data.
|
||||
*/
|
||||
char **RSupportedFileFormats(void);
|
||||
|
||||
|
||||
char *RGetImageFileFormat(char *file);
|
||||
|
||||
/*
|
||||
* Xlib contexts
|
||||
*/
|
||||
RContext *RCreateContext(Display *dpy, int screen_number,
|
||||
RContextAttributes *attribs);
|
||||
|
||||
void RDestroyContext(RContext *context);
|
||||
|
||||
Bool RGetClosestXColor(RContext *context, RColor *color, XColor *retColor);
|
||||
|
||||
/*
|
||||
* RImage creation
|
||||
*/
|
||||
RImage *RCreateImage(unsigned width, unsigned height, int alpha);
|
||||
|
||||
RImage *RCreateImageFromXImage(RContext *context, XImage *image, XImage *mask);
|
||||
|
||||
RImage *RCreateImageFromDrawable(RContext *context, Drawable drawable,
|
||||
Pixmap mask);
|
||||
|
||||
RImage *RLoadImage(RContext *context, char *file, int index);
|
||||
|
||||
RImage* RRetainImage(RImage *image);
|
||||
|
||||
void RReleaseImage(RImage *image);
|
||||
|
||||
/* Obsoleted function. Use RReleaseImage() instead. This was kept only to
|
||||
* allow a smoother transition and to avoid breaking existing programs, but
|
||||
* it will be removed in a future release. Right now is just an alias to
|
||||
* RReleaseImage(). Do _NOT_ use RDestroyImage() anymore in your programs.
|
||||
* Being an alias to RReleaseImage() this function no longer actually
|
||||
* destroys the image, unless the image is no longer retained in some other
|
||||
* place.
|
||||
*/
|
||||
void RDestroyImage(RImage *image);
|
||||
|
||||
RImage *RGetImageFromXPMData(RContext *context, char **xpmData);
|
||||
|
||||
/*
|
||||
* RImage storing
|
||||
*/
|
||||
Bool RSaveImage(RImage *image, char *filename, char *format);
|
||||
|
||||
/*
|
||||
* Area manipulation
|
||||
*/
|
||||
RImage *RCloneImage(RImage *image);
|
||||
|
||||
RImage *RGetSubImage(RImage *image, int x, int y, unsigned width,
|
||||
unsigned height);
|
||||
|
||||
void RCombineImageWithColor(RImage *image, RColor *color);
|
||||
|
||||
void RCombineImages(RImage *image, RImage *src);
|
||||
|
||||
void RCombineArea(RImage *image, RImage *src, int sx, int sy, unsigned width,
|
||||
unsigned height, int dx, int dy);
|
||||
|
||||
void RCombineImagesWithOpaqueness(RImage *image, RImage *src, int opaqueness);
|
||||
|
||||
void RCombineAreaWithOpaqueness(RImage *image, RImage *src, int sx, int sy,
|
||||
unsigned width, unsigned height, int dx, int dy,
|
||||
int opaqueness);
|
||||
|
||||
RImage *RScaleImage(RImage *image, unsigned new_width, unsigned new_height);
|
||||
|
||||
RImage *RSmoothScaleImage(RImage *src, unsigned new_width,
|
||||
unsigned new_height);
|
||||
|
||||
RImage *RRotateImage(RImage *image, float angle);
|
||||
|
||||
|
||||
RImage *RMakeTiledImage(RImage *tile, unsigned width, unsigned height);
|
||||
|
||||
RImage* RMakeCenteredImage(RImage *image, unsigned width, unsigned height,
|
||||
RColor *color);
|
||||
|
||||
/*
|
||||
* Drawing
|
||||
*/
|
||||
Bool RGetPixel(RImage *image, int x, int y, RColor *color);
|
||||
|
||||
void RPutPixel(RImage *image, int x, int y, RColor *color);
|
||||
|
||||
void ROperatePixel(RImage *image, int operation, int x, int y, RColor *color);
|
||||
|
||||
void RPutPixels(RImage *image, RPoint *points, int npoints, int mode,
|
||||
RColor *color);
|
||||
|
||||
void ROperatePixels(RImage *image, int operation, RPoint *points,
|
||||
int npoints, int mode, RColor *color);
|
||||
|
||||
int RDrawLine(RImage *image, int x0, int y0, int x1, int y1, RColor *color);
|
||||
|
||||
int ROperateLine(RImage *image, int operation, int x0, int y0, int x1, int y1,
|
||||
RColor *color);
|
||||
|
||||
void RDrawLines(RImage *image, RPoint *points, int npoints, int mode,
|
||||
RColor *color);
|
||||
|
||||
void ROperateLines(RImage *image, int operation, RPoint *points, int npoints,
|
||||
int mode, RColor *color);
|
||||
|
||||
void RDrawSegments(RImage *image, RSegment *segs, int nsegs, RColor *color);
|
||||
|
||||
void ROperateSegments(RImage *image, int operation, RSegment *segs, int nsegs,
|
||||
RColor *color);
|
||||
|
||||
/*
|
||||
* Color convertion
|
||||
*/
|
||||
void RRGBtoHSV(RColor *color, RHSVColor *hsv);
|
||||
void RHSVtoRGB(RHSVColor *hsv, RColor *rgb);
|
||||
|
||||
/*
|
||||
* Painting
|
||||
*/
|
||||
void RClearImage(RImage *image, RColor *color);
|
||||
|
||||
void RFillImage(RImage *image, RColor *color);
|
||||
|
||||
void RBevelImage(RImage *image, int bevel_type);
|
||||
|
||||
RImage *RRenderGradient(unsigned width, unsigned height, RColor *from,
|
||||
RColor *to, int style);
|
||||
|
||||
|
||||
RImage *RRenderMultiGradient(unsigned width, unsigned height, RColor **colors,
|
||||
int style);
|
||||
|
||||
|
||||
RImage *RRenderInterwovenGradient(unsigned width, unsigned height,
|
||||
RColor colors1[2], int thickness1,
|
||||
RColor colors2[2], int thickness2);
|
||||
|
||||
|
||||
/*
|
||||
* Convertion into X Pixmaps
|
||||
*/
|
||||
int RConvertImage(RContext *context, RImage *image, Pixmap *pixmap);
|
||||
|
||||
int RConvertImageMask(RContext *context, RImage *image, Pixmap *pixmap,
|
||||
Pixmap *mask, int threshold);
|
||||
|
||||
|
||||
/*
|
||||
* misc. utilities
|
||||
*/
|
||||
RXImage *RCreateXImage(RContext *context, int depth,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
RXImage *RGetXImage(RContext *context, Drawable d, int x, int y,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
void RDestroyXImage(RContext *context, RXImage *ximage);
|
||||
|
||||
void RPutXImage(RContext *context, Drawable d, GC gc, RXImage *ximage,
|
||||
int src_x, int src_y, int dest_x, int dest_y,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
/* do not free the returned string! */
|
||||
const char *RMessageForError(int errorCode);
|
||||
|
||||
int RBlurImage(RImage *image);
|
||||
|
||||
/****** Global Variables *******/
|
||||
|
||||
extern int RErrorCode;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
|
@ -1,135 +0,0 @@
|
|||
/*
|
||||
xdnd.c, xdnd.h - C program library for handling the Xdnd protocol
|
||||
|
||||
Copyright (C) 1998 Paul Sheer
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
|
||||
Further info can also be obtained by emailing the author at,
|
||||
psheer@obsidian.co.za
|
||||
*/
|
||||
|
||||
#ifndef _X_DND_H
|
||||
#define _X_DND_H
|
||||
|
||||
#define XDND_VERSION 2
|
||||
|
||||
/* XdndEnter */
|
||||
#define XDND_THREE 3
|
||||
#define XDND_ENTER_SOURCE_WIN(e) ((e)->xclient.data.l[0])
|
||||
#define XDND_ENTER_THREE_TYPES(e) (((e)->xclient.data.l[1] & 0x1UL) == 0)
|
||||
#define XDND_ENTER_THREE_TYPES_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x1UL) | (((b) == 0) ? 0 : 0x1UL)
|
||||
#define XDND_ENTER_VERSION(e) ((e)->xclient.data.l[1] >> 24)
|
||||
#define XDND_ENTER_VERSION_SET(e,v) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~(0xFF << 24)) | ((v) << 24)
|
||||
#define XDND_ENTER_TYPE(e,i) ((e)->xclient.data.l[2 + i]) /* i => (0, 1, 2) */
|
||||
|
||||
/* XdndPosition */
|
||||
#define XDND_POSITION_SOURCE_WIN(e) ((e)->xclient.data.l[0])
|
||||
#define XDND_POSITION_ROOT_X(e) ((e)->xclient.data.l[2] >> 16)
|
||||
#define XDND_POSITION_ROOT_Y(e) ((e)->xclient.data.l[2] & 0xFFFFUL)
|
||||
#define XDND_POSITION_ROOT_SET(e,x,y) (e)->xclient.data.l[2] = ((x) << 16) | ((y) & 0xFFFFUL)
|
||||
#define XDND_POSITION_TIME(e) ((e)->xclient.data.l[3])
|
||||
#define XDND_POSITION_ACTION(e) ((e)->xclient.data.l[4])
|
||||
|
||||
/* XdndStatus */
|
||||
#define XDND_STATUS_TARGET_WIN(e) ((e)->xclient.data.l[0])
|
||||
#define XDND_STATUS_WILL_ACCEPT(e) ((e)->xclient.data.l[1] & 0x1L)
|
||||
#define XDND_STATUS_WILL_ACCEPT_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x1UL) | (((b) == 0) ? 0 : 0x1UL)
|
||||
#define XDND_STATUS_WANT_POSITION(e) ((e)->xclient.data.l[1] & 0x2UL)
|
||||
#define XDND_STATUS_WANT_POSITION_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x2UL) | (((b) == 0) ? 0 : 0x2UL)
|
||||
#define XDND_STATUS_RECT_X(e) ((e)->xclient.data.l[2] >> 16)
|
||||
#define XDND_STATUS_RECT_Y(e) ((e)->xclient.data.l[2] & 0xFFFFL)
|
||||
#define XDND_STATUS_RECT_WIDTH(e) ((e)->xclient.data.l[3] >> 16)
|
||||
#define XDND_STATUS_RECT_HEIGHT(e) ((e)->xclient.data.l[3] & 0xFFFFL)
|
||||
#define XDND_STATUS_RECT_SET(e,x,y,w,h) {(e)->xclient.data.l[2] = ((x) << 16) | ((y) & 0xFFFFUL); (e)->xclient.data.l[3] = ((w) << 16) | ((h) & 0xFFFFUL); }
|
||||
#define XDND_STATUS_ACTION(e) ((e)->xclient.data.l[4])
|
||||
|
||||
/* XdndLeave */
|
||||
#define XDND_LEAVE_SOURCE_WIN(e) ((e)->xclient.data.l[0])
|
||||
|
||||
/* XdndDrop */
|
||||
#define XDND_DROP_SOURCE_WIN(e) ((e)->xclient.data.l[0])
|
||||
#define XDND_DROP_TIME(e) ((e)->xclient.data.l[2])
|
||||
|
||||
/* XdndFinished */
|
||||
#define XDND_FINISHED_TARGET_WIN(e) ((e)->xclient.data.l[0])
|
||||
|
||||
typedef struct _DndClass DndClass;
|
||||
|
||||
struct _DndClass {
|
||||
|
||||
Display *display;
|
||||
|
||||
Atom XdndAware;
|
||||
Atom XdndSelection;
|
||||
Atom XdndEnter;
|
||||
Atom XdndLeave;
|
||||
Atom XdndPosition;
|
||||
Atom XdndDrop;
|
||||
Atom XdndFinished;
|
||||
Atom XdndStatus;
|
||||
Atom XdndActionCopy;
|
||||
Atom XdndActionMove;
|
||||
Atom XdndActionLink;
|
||||
Atom XdndActionAsk;
|
||||
Atom XdndActionPrivate;
|
||||
Atom XdndTypeList;
|
||||
Atom XdndActionList;
|
||||
Atom XdndActionDescription;
|
||||
Atom Xdnd_NON_PROTOCOL_ATOM;
|
||||
Atom version;
|
||||
Window root_window;
|
||||
|
||||
#define XDND_DROP_STAGE_IDLE 0
|
||||
#define XDND_DRAG_STAGE_DRAGGING 1
|
||||
#define XDND_DRAG_STAGE_ENTERED 2
|
||||
#define XDND_DROP_STAGE_CONVERTING 3
|
||||
#define XDND_DROP_STAGE_ENTERED 4
|
||||
int stage;
|
||||
int dragging_version;
|
||||
int internal_drag;
|
||||
int want_position;
|
||||
int ready_to_drop;
|
||||
int will_accept;
|
||||
XRectangle rectangle;
|
||||
Window dropper_window, dragger_window;
|
||||
Atom *dragger_typelist;
|
||||
Atom desired_type;
|
||||
Atom supported_action;
|
||||
Time time;
|
||||
/* drop position from last XdndPosition */
|
||||
int x, y;
|
||||
|
||||
/* block for only this many seconds on not receiving a XdndFinished from target, default : 10 */
|
||||
int time_out;
|
||||
};
|
||||
|
||||
void xdnd_init (DndClass * dnd, Display * display);
|
||||
void xdnd_set_dnd_aware (DndClass * dnd, Window window, Atom * typelist);
|
||||
int xdnd_is_dnd_aware (DndClass * dnd, Window window, int *version, Atom * typelist);
|
||||
void xdnd_set_type_list (DndClass * dnd, Window window, Atom * typelist);
|
||||
void xdnd_get_type_list (DndClass * dnd, Window window, Atom ** typelist);
|
||||
void xdnd_send_enter (DndClass * dnd, Window window, Window from, Atom * typelist);
|
||||
void xdnd_send_position (DndClass * dnd, Window window, Window from, Atom action, int x, int y, unsigned long etime);
|
||||
void xdnd_send_status (DndClass * dnd, Window window, Window from, int will_accept,
|
||||
int want_position, int x, int y, int w, int h, Atom action);
|
||||
void xdnd_send_leave (DndClass * dnd, Window window, Window from);
|
||||
void xdnd_send_drop (DndClass * dnd, Window window, Window from, unsigned long etime);
|
||||
void xdnd_send_finished (DndClass * dnd, Window window, Window from, int error);
|
||||
int xdnd_convert_selection (DndClass * dnd, Window window, Window requester, Atom type);
|
||||
int xdnd_set_selection_owner (DndClass * dnd, Window window, Atom type);
|
||||
void xdnd_selection_send (DndClass * dnd, XSelectionRequestEvent * request, unsigned char *data, int length);
|
||||
|
||||
#endif /* !_X_DND_H */
|
Loading…
Add table
Add a link
Reference in a new issue