/**
 *
 * $Id: Xme.c,v 1.2 1997/09/04 22:41:15 u27113 Exp $
 *
 * Copyright (C) 1995 Free Software Foundation, Inc.
 *
 * This file is part of the GNU LessTif Library.
 *
 * 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.
 *
 **/

static char rcsid[] = "$Id: Xme.c,v 1.2 1997/09/04 22:41:15 u27113 Exp $";

#include <LTconfig.h>
#include <XmI/XmI.h>

#include <Xm/XmP.h>

#include <Xm/DragIconP.h>
#include <Xm/XmosP.h>

#ifndef __STDC__
#include <varargs.h>
#else
#include <stdarg.h>
#endif

/* DragIcon */
Widget
XmeGetTextualDragIcon(Widget w)
{
    return _XmGetTextualDragIcon(w);
}

/* GeoUtils */
XtGeometryResult
XmeReplyToQueryGeometry(Widget w,
			XtWidgetGeometry *request,
			XtWidgetGeometry *reply)
{
    return _XmGMReplyToQueryGeometry(w, request, reply);
}

/* GadgetUtil */
void
XmeConfigureObject(Widget g,
		   Position x, Position y,
		   Dimension width, Dimension height, Dimension border_width)
{
    _XmConfigureObject(g, x, y, width, height, border_width);
}

/* GadgetUtil */
void
XmeRedisplayGadgets(Widget w, XEvent *event, Region region)
{
    _XmRedisplayGadgets(w, event, region);
}

/* ImageCache */
Boolean
XmeGetPixmapData(Screen *screen, Pixmap pixmap,
		 char **image_name,
		 int *depth, Pixel *foreground, Pixel *background,
		 int *hot_x, int *hot_y,
		 unsigned int *width, unsigned int *height)
{
    return _XmGetPixmapData(screen, pixmap,
			    image_name,
			    depth, foreground, background,
			    hot_x, hot_y, width, height);
}

/* ResConvert */
void
#ifdef __STDC__
XmeWarning(Widget w, char *fmt,...)
{
    va_list arg_list;
    char buf[256];

    va_start(arg_list, fmt);
#else
XmeWarning(Widget w, fmt, va_list)
     Widget w;
     char *fmt;
     va_dcl
{
    char buf[256];

    va_start(arg_list);
#endif
    if (w)
    {
	sprintf(buf, "\n    Name: %s\n    Class: %s\n    ",
		XtName(w), XtClass(w)->core_class.class_name);

	vsprintf(buf + strlen(buf), fmt, arg_list);
	va_end(arg_list);

	strcat(buf, "\n");

#ifdef	LESSTIF_PRODUCTION
	XtAppWarning(XtWidgetToApplicationContext(w), buf);
#else
	if (getenv("DEBUG_REDIRECT_XMWARNING"))
	{
	    XdbPrintString(buf);
	}
	else
	{
	    XtAppWarning(XtWidgetToApplicationContext(w), buf);
	}
#endif
    }
    else
    {
	buf[0] = '\0';
	vsprintf(buf + strlen(buf), fmt, arg_list);
	va_end(arg_list);

#ifdef	LESSTIF_PRODUCTION
	XtWarning(buf);
#else
	if (getenv("DEBUG_REDIRECT_XMWARNING"))
	{
	    XdbPrintString(buf);
	}
	else
	{
	    XtWarning(buf);
	}
#endif
    }
}

/* ResConvert */
Boolean
XmeNamesAreEqual(char *in_str, char *text_str)
{
    return _XmStringsAreEqual(in_str, text_str);
}

/* ResInd */
void
XmeFromHorizontalPixels(Widget widget,
			int offset,
			XtArgVal *value)
{
    _XmFromHorizontalPixels(widget, offset, value);
}

/* ResInd */
void
XmeFromVerticalPixels(Widget widget,
		      int offset,
		      XtArgVal *value)
{
    _XmFromVerticalPixels(widget, offset, value);
}

/* ResInd */
XmImportOperator
XmeToHorizontalPixels(Widget widget,
		      int offset,
		      XtArgVal *value)
{
    return _XmToHorizontalPixels(widget, offset, value);
}

/* ResInd */
XmImportOperator
XmeToVerticalPixels(Widget widget,
		    int offset,
		    XtArgVal *value)
{
    return _XmToVerticalPixels(widget, offset, value);
}

/* Screen */
Cursor
XmeGetNullCursor(Widget w)
{
    return _XmGetNullCursor(w);
}

/* Shadow */
void
XmeClearBorder(Display *display,
	       Window win,
	       Position x,
	       Position y,
	       Dimension width,
	       Dimension height,
	       Dimension shadow_thick)
{
    _XmClearBorder(display, win, x, y, width, height, shadow_thick);
}

/* Shadow */
void
XmeDrawShadows(Display *display,
	       Window win,
	       GC topShadowGC,
	       GC bottomShadowGC,
	       Position x, Position y,
	       Dimension width, Dimension height,
	       Dimension shadowThickness,
	       unsigned int shadowType)
{
    _XmDrawShadows(display, win, topShadowGC, bottomShadowGC, x, y,
		   width, height, shadowThickness, shadowType);
}

/* Shadow */
void
XmeDrawArrow(Display *display,
	     Window win,
	     GC bottomGC,
	     GC topGC,
	     GC fillGC,
	     Position x, Position y,
	     Dimension width, Dimension height,
	     Dimension shadowThickness,
	     unsigned char direction)
{
    _XmDrawArrow(display, win, bottomGC, topGC, fillGC,
		 x, y, width, height, shadowThickness, direction);
}

/* Shadow */
void
XmeDrawDiamond(Display *display,
	       Window win,
	       GC bottomGC,
	       GC topGC,
	       GC selectGC,
	       Position x, Position y,
	       Dimension width, Dimension height,
	       Dimension shadowThickness,
	       Dimension fill)
{
    _XmDrawDiamond(display, win, bottomGC, topGC, selectGC, x, y, width, height,
		   shadowThickness, fill);
}

/* Shadow */
void
XmeDrawSeparator(Display *display,
		 Drawable win,
		 GC top_gc,
		 GC bottom_gc,
		 GC separator_GC,
		 Position wx,
		 Position wy,
		 Dimension wwidth,
		 Dimension wheight,
		 Dimension shadowThickness,
		 Dimension margin,
		 unsigned char orientation,
		 unsigned char separator_type)
{
    _XmDrawSeparator(display, win, top_gc, bottom_gc, separator_GC,
		     wx, wy, wwidth, wheight, shadowThickness, margin,
		     orientation, separator_type);
}

/* Shadow */
void
XmeDrawHighlight(Display *display,
		 Drawable d,
		 GC gc,
		 Position x,
		 Position y,
		 Dimension width,
		 Dimension height,
		 Dimension highlight_thick)
{
    _XmDrawHighlight(display, d, gc, x, y, width, height,
		     highlight_thick, LineSolid);
}

/* Traversal */
Boolean
XmeFocusIsInShell(Widget wid)
{
    return _XmFocusIsInShell(wid);
}

/* Traversal */
void
XmeNavigChangeManaged(Widget w)
{
    _XmNavigChangeManaged(w);
}

/* Vendor */
Display *
XmeGetDefaultDisplay(void)
{
    return _XmGetDefaultDisplay();
}

/* VirtKeys */
void
XmeVirtualToActualKeysym(Display *Dsp,
			 KeySym VirtualKeysym,
			 KeySym *RealKeysymReturn,
			 Modifiers *ModifierReturn)
{
    _XmVirtualToActualKeysym(Dsp, VirtualKeysym, RealKeysymReturn,
			     ModifierReturn);
}

/* XmString */
void
XmeStringUpdateWMShellTitle(XmString xmstr, Widget shell)
{
    _XmStringUpdateWMShellTitle(xmstr, shell);
}

/* Xmos */
int
XmeMicroSleep(long secs)
{
    return _XmMicroSleep(secs);
}

/* Xmos */
String
XmeGetHomeDirName(void)
{
    return _XmOSGetHomeDirName();
}

