summaryrefslogtreecommitdiffstats
path: root/xlib
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-12 16:24:28 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-12 16:24:28 (GMT)
commit871d0ab87051648f1dcc4fc86445dcde3527c7b2 (patch)
tree3913fec9e26d903dd2d66da3c9010d72391394be /xlib
parentefae1b799e7c55c25fcda6f682415a8fd6e2a25f (diff)
downloadtk-871d0ab87051648f1dcc4fc86445dcde3527c7b2.zip
tk-871d0ab87051648f1dcc4fc86445dcde3527c7b2.tar.gz
tk-871d0ab87051648f1dcc4fc86445dcde3527c7b2.tar.bz2
WIP: Add support for C++
Diffstat (limited to 'xlib')
-rw-r--r--xlib/xcolors.c3
-rw-r--r--xlib/xgc.c158
-rw-r--r--xlib/xutil.c4
3 files changed, 161 insertions, 4 deletions
diff --git a/xlib/xcolors.c b/xlib/xcolors.c
index 31db297..f2d3d2e 100644
--- a/xlib/xcolors.c
+++ b/xlib/xcolors.c
@@ -341,6 +341,9 @@ XParseColor(
const char *spec,
XColor *colorPtr)
{
+ (void)display;
+ (void)map;
+
if (spec[0] == '#') {
char *p;
Tcl_WideInt value = parseHex64bit(++spec, &p);
diff --git a/xlib/xgc.c b/xlib/xgc.c
index aea8851..81209e8 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -48,7 +48,7 @@ static TkpClipMask *AllocClipMask(GC gc) {
TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask;
if (clip_mask == NULL) {
- clip_mask = ckalloc(sizeof(TkpClipMask));
+ clip_mask = (TkpClipMask *)ckalloc(sizeof(TkpClipMask));
gc->clip_mask = (Pixmap) clip_mask;
#ifdef MAC_OSX_TK
} else if (clip_mask->type == TKP_CLIP_REGION) {
@@ -110,6 +110,7 @@ XCreateGC(
XGCValues *values)
{
GC gp;
+ (void)d;
/*
* In order to have room for a dash list, MAX_DASH_LIST_SIZE extra chars
@@ -120,7 +121,7 @@ XCreateGC(
#define MAX_DASH_LIST_SIZE 10
- gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
+ gp = (GC)ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
if (!gp) {
return NULL;
}
@@ -265,6 +266,8 @@ int XFreeGC(
Display *d,
GC gc)
{
+ (void)d;
+
if (gc != NULL) {
FreeClipMask(gc);
TkpFreeGCCache(gc);
@@ -296,6 +299,8 @@ XSetForeground(
GC gc,
unsigned long foreground)
{
+ (void)display;
+
gc->foreground = foreground;
return Success;
}
@@ -306,6 +311,8 @@ XSetBackground(
GC gc,
unsigned long background)
{
+ (void)display;
+
gc->background = background;
return Success;
}
@@ -319,6 +326,7 @@ XSetDashes(
int n)
{
char *p = &(gc->dashes);
+ (void)display;
#ifdef TkWinDeleteBrush
TkWinDeleteBrush(gc->fgBrush);
@@ -341,6 +349,8 @@ XSetFunction(
GC gc,
int function)
{
+ (void)display;
+
gc->function = function;
return Success;
}
@@ -351,6 +361,8 @@ XSetFillRule(
GC gc,
int fill_rule)
{
+ (void)display;
+
gc->fill_rule = fill_rule;
return Success;
}
@@ -361,6 +373,8 @@ XSetFillStyle(
GC gc,
int fill_style)
{
+ (void)display;
+
gc->fill_style = fill_style;
return Success;
}
@@ -371,6 +385,8 @@ XSetTSOrigin(
GC gc,
int x, int y)
{
+ (void)display;
+
gc->ts_x_origin = x;
gc->ts_y_origin = y;
return Success;
@@ -382,6 +398,8 @@ XSetFont(
GC gc,
Font font)
{
+ (void)display;
+
gc->font = font;
return Success;
}
@@ -392,6 +410,8 @@ XSetArcMode(
GC gc,
int arc_mode)
{
+ (void)display;
+
gc->arc_mode = arc_mode;
return Success;
}
@@ -402,6 +422,8 @@ XSetStipple(
GC gc,
Pixmap stipple)
{
+ (void)display;
+
gc->stipple = stipple;
return Success;
}
@@ -415,6 +437,8 @@ XSetLineAttributes(
int cap_style,
int join_style)
{
+ (void)display;
+
gc->line_width = line_width;
gc->line_style = line_style;
gc->cap_style = cap_style;
@@ -429,6 +453,8 @@ XSetClipOrigin(
int clip_x_origin,
int clip_y_origin)
{
+ (void)display;
+
gc->clip_x_origin = clip_x_origin;
gc->clip_y_origin = clip_y_origin;
return Success;
@@ -461,6 +487,8 @@ TkSetRegion(
GC gc,
TkRegion r)
{
+ (void)display;
+
if (r == NULL) {
Tcl_Panic("must not pass NULL to TkSetRegion for compatibility with X11; use XSetClipMask instead");
} else {
@@ -481,6 +509,8 @@ XSetClipMask(
GC gc,
Pixmap pixmap)
{
+ (void)display;
+
if (pixmap == None) {
FreeClipMask(gc);
} else {
@@ -539,6 +569,7 @@ XDrawPoints(
int mode)
{
int res = Success;
+ (void)mode;
while (npoints-- > 0) {
res = XDrawLine(display, d, gc,
@@ -558,6 +589,12 @@ XDrawSegments(
XSegment *segments,
int nsegments)
{
+ (void)display;
+ (void)d;
+ (void)gc;
+ (void)segments;
+ (void)nsegments;
+
return BadDrawable;
}
#endif
@@ -568,6 +605,10 @@ XFetchBuffer(
int *nbytes_return,
int buffer)
{
+ (void)display;
+ (void)nbytes_return;
+ (void)buffer;
+
return (char *) 0;
}
@@ -577,6 +618,10 @@ XFetchName(
Window w,
char **window_name_return)
{
+ (void)display;
+ (void)w;
+ (void)window_name_return;
+
return Success;
}
@@ -586,6 +631,10 @@ XListProperties(
Window w,
int *num_prop_return)
{
+ (void)display;
+ (void)w;
+ (void)num_prop_return;
+
return (Atom *) 0;
}
@@ -594,7 +643,10 @@ XMapRaised(
Display *display,
Window w)
{
- return Success;
+ (void)display;
+ (void)w;
+
+ return Success;
}
int
@@ -608,6 +660,15 @@ XQueryTextExtents(
int *font_descent_return,
XCharStruct *overall_return)
{
+ (void)display;
+ (void)font_ID;
+ (void)string;
+ (void)nchars;
+ (void)direction_return;
+ (void)font_ascent_return;
+ (void)font_descent_return;
+ (void)overall_return;
+
return Success;
}
@@ -619,6 +680,12 @@ XReparentWindow(
int x,
int y)
{
+ (void)display;
+ (void)w;
+ (void)parent;
+ (void)x;
+ (void)y;
+
return BadWindow;
}
@@ -627,6 +694,9 @@ XUndefineCursor(
Display *display,
Window w)
{
+ (void)display;
+ (void)w;
+
return Success;
}
@@ -634,6 +704,7 @@ XVaNestedList
XVaCreateNestedList(
int unused, ...)
{
+ (void)unused;
return NULL;
}
@@ -641,6 +712,7 @@ char *
XSetICValues(
XIC xic, ...)
{
+ (void)xic;
return NULL;
}
@@ -648,6 +720,7 @@ char *
XGetICValues(
XIC xic, ...)
{
+ (void)xic;
return NULL;
}
@@ -655,6 +728,7 @@ void
XSetICFocus(
XIC xic)
{
+ (void)xic;
}
Window
@@ -672,6 +746,19 @@ XCreateWindow(
unsigned long value_mask,
XSetWindowAttributes *attributes)
{
+ (void)display;
+ (void)parent;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)border_width;
+ (void)depth;
+ (void)clazz;
+ (void)visual;
+ (void)value_mask;
+ (void)attributes;
+
return 0;
}
@@ -681,6 +768,10 @@ XPointInRegion(
int x,
int y)
{
+ (void)rgn;
+ (void)x;
+ (void)y;
+
return 0;
}
@@ -690,6 +781,10 @@ XUnionRegion(
Region srcb,
Region dr_return)
{
+ (void)srca;
+ (void)srcb;
+ (void)dr_return;
+
return 0;
}
@@ -699,6 +794,10 @@ XPolygonRegion(
int n,
int rule)
{
+ (void)pts;
+ (void)n;
+ (void)rule;
+
return 0;
}
@@ -706,6 +805,7 @@ void
XDestroyIC(
XIC ic)
{
+ (void)ic;
}
Cursor
@@ -718,6 +818,14 @@ XCreatePixmapCursor(
unsigned int x,
unsigned int y)
{
+ (void)display;
+ (void)source;
+ (void)mask;
+ (void)foreground_color;
+ (void)background_color;
+ (void)x;
+ (void)y;
+
return (Cursor) NULL;
}
@@ -731,6 +839,14 @@ XCreateGlyphCursor(
XColor _Xconst *foreground_color,
XColor _Xconst *background_color)
{
+ (void)display;
+ (void)source_font;
+ (void)mask_font;
+ (void)source_char;
+ (void)mask_char;
+ (void)foreground_color;
+ (void)background_color;
+
return 1;
}
@@ -742,6 +858,12 @@ XCreateFontSet(
int *missing_charset_count /* missing_charset_count */,
char **def_string /* def_string */
) {
+ (void)display;
+ (void)base_font_name_list;
+ (void)missing_charset_list;
+ (void)missing_charset_count;
+ (void)def_string;
+
return (XFontSet)0;
}
@@ -750,18 +872,23 @@ XFreeFontSet(
Display *display, /* display */
XFontSet fontset /* font_set */
) {
+ (void)display;
+ (void)fontset;
}
void
XFreeStringList(
char **list /* list */
) {
+ (void)list;
}
Status
XCloseIM(
XIM im /* im */
) {
+ (void)im;
+
return Success;
}
@@ -774,6 +901,13 @@ XRegisterIMInstantiateCallback(
XIDProc callback /* callback */,
XPointer client_data /* client_data */
) {
+ (void)dpy;
+ (void)rdb;
+ (void)res_name;
+ (void)res_class;
+ (void)callback;
+ (void)client_data;
+
return False;
}
@@ -786,6 +920,13 @@ XUnregisterIMInstantiateCallback(
XIDProc callback /* callback */,
XPointer client_data /* client_data */
) {
+ (void)dpy;
+ (void)rdb;
+ (void)res_name;
+ (void)res_class;
+ (void)callback;
+ (void)client_data;
+
return False;
}
@@ -793,6 +934,8 @@ char *
XSetLocaleModifiers(
const char *modifier_list /* modifier_list */
) {
+ (void)modifier_list;
+
return NULL;
}
@@ -802,6 +945,11 @@ XIM XOpenIM(
char *res_name /* res_name */,
char *res_class /* res_class */
) {
+ (void)dpy;
+ (void)rdb;
+ (void)res_name;
+ (void)res_class;
+
return NULL;
}
@@ -809,6 +957,8 @@ char *
XGetIMValues(
XIM im /* im */, ...
) {
+ (void)im;
+
return NULL;
}
@@ -816,6 +966,8 @@ char *
XSetIMValues(
XIM im /* im */, ...
) {
+ (void)im;
+
return NULL;
}
diff --git a/xlib/xutil.c b/xlib/xutil.c
index d80b742..a5f3b99 100644
--- a/xlib/xutil.c
+++ b/xlib/xutil.c
@@ -36,6 +36,8 @@ XInternAtom(
Bool only_if_exists)
{
static Atom atom = XA_LAST_PREDEFINED;
+ (void)atom_name;
+ (void)only_if_exists;
display->request++;
return ++atom;
@@ -64,7 +66,7 @@ XGetVisualInfo(
XVisualInfo *vinfo_template,
int *nitems_return)
{
- XVisualInfo *info = ckalloc(sizeof(XVisualInfo));
+ XVisualInfo *info = (XVisualInfo *)ckalloc(sizeof(XVisualInfo));
info->visual = DefaultVisual(display, 0);
info->visualid = info->visual->visualid;