/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
*
* (C) 2002,2005 by Marcin Dalecki <martin@dalecki.de>
*
* MARCIN DALECKI ASSUMES NO RESPONSIBILITY FOR THE USE OR INABILITY TO USE ANY
* OF THIS SOFTWARE . THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, AND MARCIN DALECKI EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES,
* INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* Enhanced Motif PushButton widget with move over behavior.
*/
#include "vim.h"
#ifdef FEAT_TOOLBAR
#include <Xm/XmP.h>
#include <Xm/DrawP.h>
#if defined(HAVE_XM_TRAITP_H) && defined(HAVE_XM_MANAGER_H) \
&& defined(HAVE_XM_UNHIGHLIGHTT_H) && defined(HAVE_XM_XPMP_H)
# include <Xm/TraitP.h>
# include <Xm/Manager.h>
# include <Xm/UnhighlightT.h>
# include <Xm/XpmP.h>
# define UNHIGHLIGHTT
#else
# ifdef HAVE_X11_XPM_H
# ifdef VMS
# include <xpm.h>
# else
# include <X11/xpm.h>
# endif
# endif
#endif
#include <Xm/ManagerP.h>
#include <Xm/Display.h>
#include <Xm/DisplayP.h>
#include <X11/Shell.h>
#include <X11/ShellP.h>
#include "gui_xmebwp.h"
// Provide some missing wrappers, which are missed from the LessTif
// implementation. Also missing in Motif 1.2 and earlier.
//
// We neither use XmeGetPixmapData or _XmGetPixmapData, since with LessTif the
// pixmap will not appear in its caches properly. We cache the interesting
// values in XmEnhancedButtonPart instead ourself.
#if defined(LESSTIF_VERSION) || (XmVersion <= 1002)
# ifndef Lab_IsMenupane
# define Lab_IsMenupane(w) (Lab_MenuType(w) == (int)XmMENU_POPUP || \
Lab_MenuType(w) == (int)XmMENU_PULLDOWN)
# endif
# define XmeClearBorder _XmClearBorder
# define XmeDrawShadows _XmDrawShadows
# define XmeDrawHighlight(a, b, c, d, e, f, g, h) \
_XmDrawHighlight(a, b, c, d, e, f, g, h, LineSolid)
#endif
/*
* Motif internals we have to cheat around with.
*/
// Hopefully this will never change...
#ifndef XmFOCUS_IGNORE
# define XmFOCUS_IGNORE 1<<1
#endif
extern Boolean _XmGetInDragMode(Widget widget);
extern void _XmPrimitiveEnter(Widget wid,
XEvent * event,
String * params, Cardinal * num_params);
extern void _XmPrimitiveLeave(Widget wid,
XEvent * event<