nedit-5.6.orig/0000755000175000017500000000000011110456077012114 5ustar paulpaulnedit-5.6.orig/Microline/0000755000175000017500000000000011107644404014034 5ustar paulpaulnedit-5.6.orig/Microline/XmL/0000755000175000017500000000000011107644403014533 5ustar paulpaulnedit-5.6.orig/Microline/XmL/Folder.c0000644000175000017500000032270310470434621016122 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#include "FolderP.h"
#include
#include
#include
#include
#include
#include
#ifdef SUNOS4
int fprintf(FILE *, char *, ...);
#endif
/* Create and Destroy */
static void ClassInitialize();
static void Initialize(Widget req, Widget newW,
ArgList args, Cardinal *nargs);
static void Destroy(Widget w);
/* Geometry, Drawing, Entry and Picking */
static void Realize(Widget w, XtValueMask *valueMask,
XSetWindowAttributes *attr);
static void Redisplay(Widget w, XExposeEvent *event, Region region);
static void Layout(XmLFolderWidget f, int resizeIfNeeded);
static void LayoutTopBottom(XmLFolderWidget f, int resizeIfNeeded);
static void LayoutLeftRight(XmLFolderWidget f, int resizeIfNeeded);
static void Resize(Widget w);
static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *request,
XtWidgetGeometry *);
static void ChangeManaged(Widget w);
static void ConstraintInitialize(Widget, Widget w,
ArgList args, Cardinal *nargs);
static void ConstraintDestroy(Widget w);
static void SetActiveTab(XmLFolderWidget f, Widget w, XEvent *event,
Boolean notify);
static void DrawTabPixmap(XmLFolderWidget f, Widget tab, int active);
static void DrawManagerShadowLeftRight(XmLFolderWidget f, XRectangle *rect);
static void DrawManagerShadowTopBottom(XmLFolderWidget f, XRectangle *rect);
static void DrawTabHighlight(XmLFolderWidget f, Widget w);
static void SetTabPlacement(XmLFolderWidget f, Widget tab);
static void GetTabRect(XmLFolderWidget f, Widget tab, XRectangle *rect,
int includeShadow);
static void DrawTabShadowArcTopBottom(XmLFolderWidget f, Widget w);
static void DrawTabShadowArcLeftRight(XmLFolderWidget f, Widget w);
static void DrawTabShadowLineTopBottom(XmLFolderWidget f, Widget w);
static void DrawTabShadowLineLeftRight(XmLFolderWidget f, Widget w);
static void DrawTabShadowNoneTopBottom(XmLFolderWidget f, Widget w);
static void DrawTabShadowNoneLeftRight(XmLFolderWidget f, Widget w);
static void SetGC(XmLFolderWidget f, int type);
/* Getting and Setting Values */
static Boolean SetValues(Widget curW, Widget reqW, Widget newW,
ArgList args, Cardinal *nargs);
static Boolean ConstraintSetValues(Widget curW, Widget, Widget newW,
ArgList, Cardinal *);
static void CopyFontList(XmLFolderWidget f);
static Boolean CvtStringToCornerStyle(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static Boolean CvtStringToFolderResizePolicy(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static Boolean CvtStringToTabPlacement(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
/* Utility */
static void GetCoreBackground(Widget w, int, XrmValue *value);
static void GetDefaultTabWidgetClass(Widget w, int, XrmValue *value);
static void GetManagerForeground(Widget w, int, XrmValue *value);
static Boolean ServerDrawsArcsLarge(Display *dpy, int debug);
/* Actions, Callbacks and Handlers */
static void Activate(Widget w, XEvent *event, String *, Cardinal *);
static void PrimActivate(Widget w, XtPointer, XtPointer);
static void PrimFocusIn(Widget w, XEvent *event, String *, Cardinal *);
static void PrimFocusOut(Widget w, XEvent *event, String *, Cardinal *);
static XtActionsRec actions[] =
{
{ "XmLFolderActivate", Activate },
{ "XmLFolderPrimFocusIn", PrimFocusIn },
{ "XmLFolderPrimFocusOut", PrimFocusOut },
};
#define MAX_TAB_ROWS 64
#define GC_SHADOWBOT 0
#define GC_SHADOWTOP 1
#define GC_BLANK 2
#define GC_UNSET 3
/* Folder Translations */
static char translations[] =
": XmLFolderActivate()\n\
: ManagerEnter()\n\
: ManagerLeave()\n\
: ManagerFocusOut()\n\
: ManagerFocusIn()";
/* Primitive Child Translations */
static char primTranslations[] =
": XmLFolderPrimFocusIn() PrimitiveFocusIn()\n\
: XmLFolderPrimFocusOut() PrimitiveFocusOut()";
static XtResource resources[] =
{
/* Folder Resources */
{
XmNtabWidgetClass, XmCTabWidgetClass,
XmRWidgetClass, sizeof(WidgetClass),
XtOffset(XmLFolderWidget, folder.tabWidgetClass),
XmRCallProc, (XtPointer)GetDefaultTabWidgetClass,
},
{
XmNactivateCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLFolderWidget, folder.activateCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNactiveTab, XmCActiveTab,
XmRInt, sizeof(int),
XtOffset(XmLFolderWidget, folder.activeTab),
XmRImmediate, (XtPointer)-1,
},
{
XmNautoSelect, XmCAutoSelect,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLFolderWidget, folder.autoSelect),
XmRImmediate, (XtPointer)True,
},
{
XmNblankBackground, XmCBlankBackground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLFolderWidget, folder.blankBg),
XmRCallProc, (XtPointer)GetCoreBackground,
},
{
XmNblankBackgroundPixmap, XmCBlankBackgroundPixmap,
XmRManForegroundPixmap, sizeof(Pixmap),
XtOffset(XmLFolderWidget, folder.blankPix),
XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP,
},
{
XmNcornerDimension, XmCCornerDimension,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.cornerDimension),
XmRImmediate, (XtPointer)2,
},
{
XmNcornerStyle, XmCCornerStyle,
XmRCornerStyle, sizeof(unsigned char),
XtOffset(XmLFolderWidget, folder.cornerStyle),
XmRImmediate, (XtPointer)XmCORNER_ARC,
},
{
XmNfontList, XmCFontList,
XmRFontList, sizeof(XmFontList),
XtOffset(XmLFolderWidget, folder.fontList),
XmRImmediate, (XtPointer)0,
},
{
XmNhighlightThickness, XmCHighlightThickness,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.highlightThickness),
XmRImmediate, (XtPointer)2,
},
{
XmNinactiveBackground, XmCInactiveBackground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLFolderWidget, folder.inactiveBg),
XmRCallProc, (XtPointer)GetCoreBackground,
},
{
XmNinactiveForeground, XmCInactiveForeground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLFolderWidget, folder.inactiveFg),
XmRCallProc, (XtPointer)GetManagerForeground,
},
{
XmNmarginHeight, XmCMarginHeight,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.marginHeight),
XmRImmediate, (XtPointer)0,
},
{
XmNmarginWidth, XmCMarginWidth,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.marginWidth),
XmRImmediate, (XtPointer)0,
},
{
XmNminTabWidth, XmCminTabWidth,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.minTabWidth),
XmRImmediate, (XtPointer)0,
},
{
XmNmaxTabWidth, XmCmaxTabWidth,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.maxTabWidth),
XmRImmediate, (XtPointer)100,
},
{
XmNpixmapMargin, XmCPixmapMargin,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.pixmapMargin),
XmRImmediate, (XtPointer)2,
},
{
XmNresizePolicy, XmCFolderResizePolicy,
XmRFolderResizePolicy, sizeof(unsigned char),
XtOffset(XmLFolderWidget, folder.resizePolicy),
XmRImmediate, (XtPointer)XmRESIZE_STATIC,
},
{
XmNrotateWhenLeftRight, XmCRotateWhenLeftRight,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLFolderWidget, folder.allowRotate),
XmRImmediate, (XtPointer)True,
},
{
XmNspacing, XmCSpacing,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.spacing),
XmRImmediate, (XtPointer)0,
},
{
XmNtabBarHeight, XmCTabBarHeight,
XmRDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, folder.tabBarHeight),
XmRImmediate, (XtPointer)0,
},
{
XmNtabCount, XmCTabCount,
XmRInt, sizeof(int),
XtOffset(XmLFolderWidget, folder.tabCount),
XmRImmediate, (XtPointer)0,
},
{
XmNtabPlacement, XmCTabPlacement,
XmRTabPlacement, sizeof(unsigned char),
XtOffset(XmLFolderWidget, folder.tabPlacement),
XmRImmediate, (XtPointer)XmFOLDER_TOP,
},
{
XmNtabsPerRow, XmCTabsPerRow,
XmRInt, sizeof(int),
XtOffset(XmLFolderWidget, folder.tabsPerRow),
XmRImmediate, (XtPointer)0,
},
{
XmNtabWidgetList, XmCReadOnly,
XmRPointer, sizeof(XtPointer),
XtOffset(XmLFolderWidget, folder.tabs),
XmRImmediate, (XtPointer)0,
},
{
XmNtabTranslations, XmCTranslations,
XmRTranslationTable, sizeof(XtTranslations),
XtOffset(XmLFolderWidget, folder.primTrans),
XmRString, (XtPointer)primTranslations,
},
{
XmNdebugLevel, XmCDebugLevel,
XmRInt, sizeof(int),
XtOffset(XmLFolderWidget, folder.debugLevel),
XmRImmediate, (XtPointer)0,
},
/* Overridden inherited resources */
{
XmNshadowThickness, XmCShadowThickness,
XmRHorizontalDimension, sizeof(Dimension),
XtOffset(XmLFolderWidget, manager.shadow_thickness),
XmRImmediate, (XtPointer)2,
},
};
static XtResource constraint_resources[] =
{
/* Folder Constraint Resources */
{
XmNtabFreePixmaps, XmCTabFreePixmaps,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLFolderConstraintPtr, folder.freePix),
XmRImmediate, (XtPointer)False,
},
{
XmNtabInactivePixmap, XmCTabInactivePixmap,
XmRPrimForegroundPixmap, sizeof(Pixmap),
XtOffset(XmLFolderConstraintPtr, folder.inactPix),
XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP,
},
{
XmNtabManagedName, XmCTabManagedName,
XmRString, sizeof(char *),
XtOffset(XmLFolderConstraintPtr, folder.managedName),
XmRImmediate, (XtPointer)0,
},
{
XmNtabManagedWidget, XmCTabManagedWidget,
XmRWidget, sizeof(Widget),
XtOffset(XmLFolderConstraintPtr, folder.managedW),
XmRImmediate, (XtPointer)0,
},
{
XmNtabPixmap, XmCTabPixmap,
XmRPrimForegroundPixmap, sizeof(Pixmap),
XtOffset(XmLFolderConstraintPtr, folder.pix),
XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP,
},
};
XmLFolderClassRec xmlFolderClassRec =
{
{ /* core_class */
(WidgetClass)&xmManagerClassRec, /* superclass */
"XmLFolder", /* class_name */
sizeof(XmLFolderRec), /* widget_size */
ClassInitialize, /* class_init */
0, /* class_part_init */
FALSE, /* class_inited */
(XtInitProc)Initialize, /* initialize */
0, /* initialize_hook */
(XtRealizeProc)Realize, /* realize */
(XtActionList)actions, /* actions */
(Cardinal)XtNumber(actions), /* num_actions */
(XtResource *)resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
TRUE, /* compress_motion */
XtExposeCompressMultiple, /* compress_exposure */
TRUE, /* compress_enterlv */
TRUE, /* visible_interest */
(XtWidgetProc)Destroy, /* destroy */
(XtWidgetProc)Resize, /* resize */
(XtExposeProc)Redisplay, /* expose */
(XtSetValuesFunc)SetValues, /* set_values */
0, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
0, /* get_values_hook */
0, /* accept_focus */
XtVersion, /* version */
0, /* callback_private */
translations, /* tm_table */
0, /* query_geometry */
0, /* display_acceleratr */
0, /* extension */
},
{ /* composite_class */
(XtGeometryHandler)GeometryManager, /* geometry_manager */
(XtWidgetProc)ChangeManaged, /* change_managed */
XtInheritInsertChild, /* insert_child */
XtInheritDeleteChild, /* delete_child */
0, /* extension */
},
{ /* constraint_class */
(XtResource *)constraint_resources, /* subresources */
XtNumber(constraint_resources), /* subresource_count */
sizeof(XmLFolderConstraintRec), /* constraint_size */
(XtInitProc)ConstraintInitialize, /* initialize */
(XtWidgetProc)ConstraintDestroy, /* destroy */
(XtSetValuesFunc)ConstraintSetValues, /* set_values */
0, /* extension */
},
{ /* manager_class */
XtInheritTranslations, /* translations */
0, /* syn resources */
0, /* num syn_resources */
0, /* get_cont_resources */
0, /* num_get_cont_resrc */
XmInheritParentProcess, /* parent_process */
0, /* extension */
},
{ /* folder_class */
0, /* unused */
}
};
WidgetClass xmlFolderWidgetClass = (WidgetClass)&xmlFolderClassRec;
/*
Create and Destroy
*/
static void
ClassInitialize(void)
{
XmLInitialize();
XtSetTypeConverter(XmRString, XmRCornerStyle,
CvtStringToCornerStyle, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRFolderResizePolicy,
CvtStringToFolderResizePolicy, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRTabPlacement,
CvtStringToTabPlacement, 0, 0, XtCacheNone, 0);
}
static void
Initialize(Widget req,
Widget newW,
ArgList args,
Cardinal *narg)
{
Display *dpy;
/* Window root;*/
XmLFolderWidget f, request;
f = (XmLFolderWidget)newW;
dpy = XtDisplay((Widget)f);
request = (XmLFolderWidget)req;
if (f->core.width == 0)
f->core.width = 100;
if (f->core.height == 0)
f->core.height = 100;
f->folder.gc = 0;
f->folder.tabAllocCount = 32;
f->folder.tabs = (Widget *)malloc(sizeof(Widget) * 32);
f->folder.tabHeight = 0;
f->folder.tabWidth = 0;
f->folder.activeW = 0;
f->folder.focusW = 0;
f->folder.allowLayout = 1;
f->folder.activeRow = -1;
CopyFontList(f);
if (f->folder.tabBarHeight)
{
XmLWarning((Widget)f, "Initialize() - can't set tabBarHeight");
f->folder.tabBarHeight = 0;
}
if (f->folder.tabCount)
{
XmLWarning((Widget)f, "Initialize() - can't set tabCount");
f->folder.tabCount = 0;
}
if (f->folder.activeTab != -1)
{
XmLWarning((Widget)f, "Initialize() - can't set activeTab");
f->folder.activeTab = -1;
}
if (f->folder.cornerDimension < 1)
{
XmLWarning((Widget)f, "Initialize() - cornerDimension can't be < 1");
f->folder.cornerDimension = 1;
}
f->folder.serverDrawsArcsLarge = ServerDrawsArcsLarge(dpy,
f->folder.debugLevel);
if (f->folder.minTabWidth <= 0)
{
/* a quick hack to determine the minimum tab width - enough
to show at least one character of the tab string */
XmString st = XmStringCreateSimple("W");
f->folder.minTabWidth = XmStringWidth(f->folder.fontList, st);
XmStringFree(st);
}
}
static void
Destroy(Widget w)
{
XmLFolderWidget f;
Display *dpy;
f = (XmLFolderWidget)w;
dpy = XtDisplay(w);
if (f->folder.debugLevel)
fprintf(stderr, "Folder destroy: \n");
if (f->folder.tabs)
free((char *)f->folder.tabs);
if (f->folder.gc)
XFreeGC(dpy, f->folder.gc);
XmFontListFree(f->folder.fontList);
}
/*
Geometry, Drawing, Entry and Picking
*/
static void
Realize(Widget w,
XtValueMask *valueMask,
XSetWindowAttributes *attr)
{
XmLFolderWidget f;
Display *dpy;
WidgetClass superClass;
XtRealizeProc realize;
XGCValues values;
XtGCMask mask;
f = (XmLFolderWidget)w;
dpy = XtDisplay(f);
superClass = xmlFolderWidgetClass->core_class.superclass;
realize = superClass->core_class.realize;
(*realize)(w, valueMask, attr);
if (!f->folder.gc)
{
values.foreground = f->manager.foreground;
mask = GCForeground;
f->folder.gc = XCreateGC(dpy, XtWindow(f), mask, &values);
if (f->folder.autoSelect == True && f->folder.tabCount)
XmLFolderSetActiveTab(w, 0, False);
}
}
static void
Redisplay(Widget w,
XExposeEvent *event,
Region region)
{
Display *dpy;
Window win;
XmLFolderWidget f;
XmLFolderConstraintRec *fc;
XRectangle eRect, rRect, rect;
/* XSegment *topSeg, *botSeg; */
/* int tCount, bCount; */
Widget tab;
int i, st, ht; /*, x, y; */
f = (XmLFolderWidget)w;
if (!XtIsRealized(w))
return;
if (!f->core.visible)
return;
dpy = XtDisplay(f);
win = XtWindow(f);
st = f->manager.shadow_thickness;
ht = f->folder.highlightThickness;
if (event)
{
eRect.x = event->x;
eRect.y = event->y;
eRect.width = event->width;
eRect.height = event->height;
if (f->folder.debugLevel > 1)
fprintf(stderr, "XmLFolder: Redisplay x %d y %d w %d h %d\n",
event->x, event->y, event->width, event->height);
}
else
{
eRect.x = 0;
eRect.y = 0;
eRect.width = f->core.width;
eRect.height = f->core.height;
}
if (!eRect.width || !eRect.height)
return;
if (f->folder.tabPlacement == XmFOLDER_TOP)
{
rRect.x = 0;
rRect.y = f->folder.tabHeight;
rRect.width = f->core.width;
rRect.height = f->core.height - f->folder.tabHeight;
}
else if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
rRect.x = 0;
rRect.y = 0;
rRect.width = f->core.width;
rRect.height = f->core.height - f->folder.tabHeight;
}
if (f->folder.tabPlacement == XmFOLDER_LEFT)
{
rRect.x = f->folder.tabWidth;
rRect.y = 0;
rRect.width = f->core.width - f->folder.tabWidth;
rRect.height = f->core.height;
}
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
rRect.x = 0;
rRect.y = 0;
rRect.width = f->core.width - f->folder.tabWidth;
rRect.height = f->core.height;
}
if (XmLRectIntersect(&eRect, &rRect) != XmLRectOutside)
{
if (f->folder.tabPlacement == XmFOLDER_TOP ||
f->folder.tabPlacement == XmFOLDER_BOTTOM)
DrawManagerShadowTopBottom(f, &rRect);
else
DrawManagerShadowLeftRight(f, &rRect);
}
if (!f->folder.tabCount)
return;
rRect.x = 0;
rRect.y = 0;
rRect.width = 0;
rRect.height = 0;
/* Draw tabs */
for (i = 0; i < f->folder.tabCount; i++)
{
tab = f->folder.tabs[i];
if (!XtIsManaged(tab))
continue;
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
GetTabRect(f, tab, &rRect, 0);
/* include spacing in intersect test */
rect = rRect;
if (f->folder.tabPlacement == XmFOLDER_TOP ||
f->folder.tabPlacement == XmFOLDER_BOTTOM)
rect.width += f->folder.spacing;
else
rect.height += f->folder.spacing;
/* include indent in intersect test */
if (f->folder.tabsPerRow)
{
if (rRect.x == 2)
rect.x = 0;
if (rRect.y == 2)
rect.y = 0;
if (rRect.x + rRect.width == f->core.width - 2)
rect.width += 2;
if (rRect.y + rRect.height == f->core.height - 2)
rect.height += 2;
}
if (XmLRectIntersect(&eRect, &rect) == XmLRectOutside)
continue;
if (event && XRectInRegion(region, rect.x, rect.y,
rect.width, rect.height) == RectangleOut)
continue;
if (f->folder.debugLevel > 1)
fprintf(stderr, "XmLFolder: Redisplay tab for widget %d\n", i);
if (tab == f->folder.activeW)
{
XtVaSetValues(tab,
XmNbackground, f->core.background_pixel,
XmNforeground, f->manager.foreground,
NULL);
}
else
{
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
XFillRectangle(dpy, win, f->folder.gc,
rRect.x, rRect.y, rRect.width, rRect.height);
XtVaSetValues(tab,
XmNbackground, f->folder.inactiveBg,
XmNforeground, f->folder.inactiveFg,
NULL);
}
if (f->folder.tabPlacement == XmFOLDER_TOP ||
f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
if (f->folder.cornerStyle == XmCORNER_LINE)
DrawTabShadowLineTopBottom(f, tab);
else if (f->folder.cornerStyle == XmCORNER_ARC)
DrawTabShadowArcTopBottom(f, tab);
else
DrawTabShadowNoneTopBottom(f, tab);
}
else
{
if (f->folder.cornerStyle == XmCORNER_LINE)
DrawTabShadowLineLeftRight(f, tab);
else if (f->folder.cornerStyle == XmCORNER_ARC)
DrawTabShadowArcLeftRight(f, tab);
else
DrawTabShadowNoneLeftRight(f, tab);
}
if (f->folder.focusW == tab)
DrawTabHighlight(f, tab);
if (tab == f->folder.activeW &&
fc->folder.pix != XmUNSPECIFIED_PIXMAP &&
(fc->folder.maxPixWidth || fc->folder.maxPixHeight))
DrawTabPixmap(f, tab, 1);
else if (tab != f->folder.activeW &&
fc->folder.inactPix != XmUNSPECIFIED_PIXMAP &&
(fc->folder.maxPixWidth || fc->folder.maxPixHeight))
DrawTabPixmap(f, tab, 0);
SetGC(f, GC_BLANK);
/* draw indent */
if (f->folder.tabsPerRow)
{
if (rRect.x == 2)
{
rect = rRect;
rect.x = 0;
rect.width = 2;
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
}
if (rRect.y == 2)
{
rect = rRect;
rect.y = 0;
rect.height = 2;
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
}
if (rRect.x + rRect.width == f->core.width - 2)
{
rect = rRect;
rect.x = f->core.width - 2;
rect.width = 2;
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
}
if (rRect.y + rRect.height == f->core.height - 2)
{
rect = rRect;
rect.y = f->core.height - 2;
rect.height = 2;
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
}
}
if (f->folder.spacing)
{
if (f->folder.tabPlacement == XmFOLDER_TOP ||
f->folder.tabPlacement == XmFOLDER_BOTTOM)
XFillRectangle(dpy, win, f->folder.gc, rRect.x + rRect.width,
rRect.y, f->folder.spacing, rRect.height);
else
XFillRectangle(dpy, win, f->folder.gc, rRect.x,
rRect.y + rRect.height, rRect.width, f->folder.spacing);
}
SetGC(f, GC_UNSET);
}
/* Draw empty area */
if (!f->folder.tabsPerRow)
{
if (f->folder.tabPlacement == XmFOLDER_TOP ||
f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
rRect.x += rRect.width + f->folder.spacing;
if ((int)f->core.width > rRect.x)
{
if (f->folder.tabPlacement == XmFOLDER_TOP)
rRect.y = 0;
else
rRect.y = f->core.height - f->folder.tabHeight;
rRect.width = f->core.width - rRect.x;
rRect.height = f->folder.tabHeight;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc,
rRect.x, rRect.y, rRect.width, rRect.height);
SetGC(f, GC_UNSET);
}
}
else
{
rRect.y += rRect.height + f->folder.spacing;
if ((int)f->core.height > rRect.y)
{
if (f->folder.tabPlacement == XmFOLDER_LEFT)
rRect.x = 0;
else
rRect.x = f->core.width - f->folder.tabWidth;
rRect.width = f->folder.tabWidth;
rRect.height = f->core.height - rRect.y;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc,
rRect.x, rRect.y, rRect.width, rRect.height);
SetGC(f, GC_UNSET);
}
}
}
}
static void
Layout(XmLFolderWidget f,
int resizeIfNeeded)
{
/* Window win;*/
if (!f->folder.allowLayout)
return;
f->folder.allowLayout = 0;
if (f->folder.tabPlacement == XmFOLDER_LEFT ||
f->folder.tabPlacement == XmFOLDER_RIGHT)
LayoutLeftRight(f, resizeIfNeeded);
else
LayoutTopBottom(f, resizeIfNeeded);
if (XtIsRealized((Widget)f) && f->core.visible)
XClearArea(XtDisplay(f), XtWindow(f), 0, 0, 0, 0, True);
f->folder.allowLayout = 1;
}
static void
LayoutTopBottom(XmLFolderWidget f,
int resizeIfNeeded)
{
Display *dpy;
Window root;
int i, tabNum, x, y, w, h, pad1, pad2;
int rowNum, numRows, rowHeight, rowX, rowY;
WidgetList children;
Widget tab, child;
XmLFolderConstraintRec *fc;
XtGeometryResult result;
unsigned int inactPixHeight, pixHeight;
unsigned int inactPixWidth, pixWidth;
unsigned int pixBW, pixDepth;
Dimension height, minHeight;
Dimension width, minWidth, borderWidth;
Dimension co;
int st, ht;
int tabFit = 0, tgtTabWidth = 0;
int tabPaddingWidth, tailSpace = 0;
Boolean map, isManaged;
struct
{
int width, height, numTabs, y;
} rows[MAX_TAB_ROWS];
dpy = XtDisplay(f);
children = f->composite.children;
st = f->manager.shadow_thickness;
ht = f->folder.highlightThickness;
/* calculate corner offset */
if (f->folder.cornerStyle == XmCORNER_LINE)
co = (Dimension)((double)f->folder.cornerDimension * .5 + .99);
else if (f->folder.cornerStyle == XmCORNER_ARC)
co = (Dimension)((double)f->folder.cornerDimension * .3 + .99);
else
co = 0;
/* caculate tabHeight, minWidth, minHeight, row y positions, */
/* row heights and tab pixmap dimensions */
rowX = 0;
rowY = 0;
rowHeight = 0;
rowNum = 0;
tabNum = 0;
minWidth = 0;
if (f->folder.tabCount && f->folder.resizePolicy == XmRESIZE_PACK)
{
int maxTabWidth = f->folder.maxTabWidth;
int tabEffCount = 0;
for (i = 0; i < f->folder.tabCount; i++)
{
tab = f->folder.tabs[i];
if (!XtIsManaged(tab))
continue;
tabEffCount++;
}
tabPaddingWidth = (st + co + f->folder.marginWidth + ht +
f->folder.tabs[0]->core.border_width) * 2;
if (maxTabWidth * tabEffCount > f->core.width)
{
tgtTabWidth = f->core.width/tabEffCount - tabPaddingWidth;
tailSpace = f->core.width % tabEffCount;
tabFit = 1;
/* if tabs get too small */
if (tgtTabWidth < f->folder.minTabWidth) {
tgtTabWidth = f->folder.minTabWidth;
tabFit = 0;
}
}
else
{
tgtTabWidth = maxTabWidth - tabPaddingWidth;
tabFit = 0;
}
}
for (i = 0; i < f->folder.tabCount; i++)
{
tab = f->folder.tabs[i];
if (!XtIsManaged(tab))
continue;
if (f->folder.resizePolicy == XmRESIZE_PACK)
{
if (tabFit)
{
XtVaSetValues(tab, XmNwidth,
tailSpace? tgtTabWidth+1: tgtTabWidth, NULL);
if (tailSpace)
tailSpace--;
}
else
{
XtVaSetValues(tab, XmNwidth, tgtTabWidth, NULL);
}
}
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
/* check for start of a new row */
fc->folder.firstInRow = False;
if (!tabNum)
fc->folder.firstInRow = True;
if (f->folder.tabsPerRow && tabNum == f->folder.tabsPerRow)
{
fc->folder.firstInRow = True;
/* store prev row values and start next row */
if (rowX)
rowX -= f->folder.spacing;
rows[rowNum].y = rowY;
rows[rowNum].width = rowX;
rows[rowNum].height = rowHeight;
rows[rowNum].numTabs = tabNum;
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "row %d: y %d w %d h %d numTabs %d\n",
rowNum, rowY, rowX, rowHeight, tabNum);
}
rowY += rowHeight;
rowHeight = 0;
if (rowX > (int)minWidth)
minWidth = rowX;
rowX = 0;
tabNum = 0;
rowNum++;
if (rowNum == MAX_TAB_ROWS - 1)
{
XmLWarning((Widget)f, "Layout ERROR - too many rows\n");
return;
}
}
/* make sure row height > maximum tab height */
height = co + st + tab->core.height + tab->core.border_width * 2 +
f->folder.marginHeight * 2 + ht * 2;
if ((int)height > rowHeight)
rowHeight = height;
/* calc pixmap dimensions/maximum pixmap height */
fc->folder.pixWidth = 0;
fc->folder.pixHeight = 0;
fc->folder.inactPixWidth = 0;
fc->folder.inactPixHeight = 0;
fc->folder.maxPixWidth = 0;
fc->folder.maxPixHeight = 0;
if (fc->folder.pix != XmUNSPECIFIED_PIXMAP)
{
XGetGeometry(dpy, fc->folder.pix, &root,
&x, &y, &pixWidth, &pixHeight, &pixBW, &pixDepth);
fc->folder.pixWidth = pixWidth;
fc->folder.maxPixWidth = pixWidth;
fc->folder.pixHeight = pixHeight;
fc->folder.maxPixHeight = pixHeight;
height = co + st + pixHeight + f->folder.marginHeight * 2 + ht * 2;
if ((int)height > rowHeight)
rowHeight = height;
}
if (fc->folder.inactPix != XmUNSPECIFIED_PIXMAP)
{
XGetGeometry(dpy, fc->folder.inactPix, &root, &x, &y,
&inactPixWidth, &inactPixHeight, &pixBW, &pixDepth);
fc->folder.inactPixWidth = inactPixWidth;
if (inactPixWidth > fc->folder.maxPixWidth)
fc->folder.maxPixWidth = inactPixWidth;
fc->folder.inactPixHeight = inactPixHeight;
if (inactPixHeight > fc->folder.maxPixHeight)
fc->folder.maxPixHeight = inactPixHeight;
height = co + st + inactPixHeight +
f->folder.marginHeight * 2 + ht * 2;
if ((int)height > rowHeight)
rowHeight = height;
}
/* increment rowX to move on to the next tab */
rowX += st * 2 + co * 2 + f->folder.marginWidth * 2 + ht * 2 +
XtWidth(tab) + tab->core.border_width * 2;
if (fc->folder.maxPixWidth)
rowX += fc->folder.maxPixWidth + f->folder.pixmapMargin;
rowX += f->folder.spacing;
tabNum++;
fc->folder.row = rowNum;
}
/* complete calcuations for last row */
if (rowX)
rowX -= f->folder.spacing;
rows[rowNum].y = rowY;
rows[rowNum].width = rowX;
rows[rowNum].height = rowHeight;
rows[rowNum].numTabs = tabNum;
numRows = rowNum + 1;
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "row %d: y %d w %d h %d numTabs %d\n",
rowNum, rowY, rowX, rowHeight, tabNum);
}
f->folder.tabHeight = rowY + rowHeight;
f->folder.tabBarHeight = f->folder.tabHeight;
minHeight = f->folder.tabHeight;
if ((int)minWidth < rowX)
minWidth = rowX;
/* add space for indent of upper rows */
if (f->folder.tabsPerRow && minWidth)
minWidth += 4;
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "tab bar minimum w %d h %d\n",
(int)minWidth, (int)minHeight);
}
/* calculate width and height of non-tab children ensure */
/* minWidth > width and minHeight > height */
for (i = 0; i < f->composite.num_children; i++)
{
child = children[i];
if (XtIsSubclass(child, xmPrimitiveWidgetClass))
continue;
height = XtHeight(child) + f->folder.tabHeight + st * 2;
if (XtIsWidget(child))
height += child->core.border_width * 2;
if (height > minHeight)
minHeight = height;
width = XtWidth(child) + st * 2;
if (XtIsWidget(child))
width += child->core.border_width * 2;
if (width > minWidth)
minWidth = width;
}
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "with non-tabs minimum w %d h %d\n",
(int)minWidth, (int)minHeight);
}
/* Resize folder if needed */
if (resizeIfNeeded && f->folder.resizePolicy != XmRESIZE_NONE)
{
if (minWidth <= 0)
minWidth = 1;
if (minHeight <= 0)
minHeight = 1;
result = XtMakeResizeRequest((Widget)f, minWidth, minHeight,
&width, &height);
if (result == XtGeometryAlmost)
XtMakeResizeRequest((Widget)f, width, height, NULL, NULL);
}
/* move active row to bottom */
tab = f->folder.activeW;
if (tab)
{
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
rowNum = fc->folder.row;
f->folder.activeRow = rowNum;
rows[rowNum].y = f->folder.tabHeight - rows[rowNum].height;
for (i = rowNum + 1; i < numRows; i++)
rows[i].y -= rows[rowNum].height;
}
else
f->folder.activeRow = -1;
/* configure tab children */
for (i = 0; i < f->folder.tabCount; i++)
{
tab = f->folder.tabs[i];
if (!XtIsManaged(tab))
continue;
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
rowNum = fc->folder.row;
/* calculate tab x */
if (fc->folder.firstInRow == True)
{
if (f->folder.tabsPerRow && rowNum != f->folder.activeRow)
x = 2;
else
x = 0;
}
fc->folder.x = x;
x += st + co + f->folder.marginWidth + ht;
if (fc->folder.maxPixWidth)
x += fc->folder.maxPixWidth + f->folder.pixmapMargin;
/* calculate tab y and tab height */
fc->folder.height = rows[rowNum].height;
if (f->folder.tabPlacement == XmFOLDER_TOP)
{
fc->folder.y = rows[rowNum].y;
y = fc->folder.y + fc->folder.height - f->folder.marginHeight -
ht - XtHeight(tab) - tab->core.border_width * 2;
}
else
{
fc->folder.y = f->core.height - rows[rowNum].y -
rows[rowNum].height;
y = fc->folder.y + f->folder.marginHeight + ht;
}
/* calculate tab padding */
pad1 = 0;
pad2 = 0;
w = f->core.width - rows[rowNum].width;
if (rowNum != f->folder.activeRow)
w -= 4;
if (f->folder.tabsPerRow && w > 0)
{
pad1 = w / (rows[rowNum].numTabs * 2);
pad2 = pad1;
if (fc->folder.firstInRow == True)
pad2 += w - (pad1 * rows[rowNum].numTabs * 2);
}
x += pad1;
/* move tab widget into place */
XtMoveWidget(tab, x, y);
/* calculate tab width and move to next tab */
x += pad2 + XtWidth(tab) + tab->core.border_width * 2 + ht +
f->folder.marginWidth + co + st;
fc->folder.width = x - fc->folder.x;
x += f->folder.spacing;
}
/* configure non-tab children */
for (i = 0; i < f->composite.num_children; i++)
{
child = children[i];
if (XtIsSubclass(child, xmPrimitiveWidgetClass))
continue;
if (f->folder.resizePolicy == XmRESIZE_NONE)
continue;
w = (int)f->core.width - st * 2;
h = (int)f->core.height - (int)f->folder.tabHeight - st * 2;
if (h <= 0 || w <= 0)
continue;
/* manager widgets will not configure correctly unless they */
/* are managed, so manage then unmapped if they are unmanaged */
isManaged = True;
if (!XtIsManaged(child))
{
XtVaGetValues(child,
XmNmappedWhenManaged, &map,
NULL);
XtVaSetValues(child,
XmNmappedWhenManaged, False,
NULL);
XtManageChild(child);
isManaged = False;
}
x = st;
if (f->folder.tabPlacement == XmFOLDER_TOP)
y = f->folder.tabHeight + st;
else
y = st;
width = w;
height = h;
borderWidth = 0;
if (XtIsWidget(child))
borderWidth = child->core.border_width;
XtConfigureWidget(child, x, y, width, height, borderWidth);
if (isManaged == False)
{
XtUnmanageChild(child);
XtVaSetValues(child, XmNmappedWhenManaged, map, NULL);
}
}
}
static void
LayoutLeftRight(XmLFolderWidget f,
int resizeIfNeeded)
{
Display *dpy;
Window root;
int i, tabNum, x, y, w, h, pad1, pad2;
int rowNum, numRows, rowWidth, rowX, rowY;
WidgetList children;
Widget tab, child;
XmLFolderConstraintRec *fc;
XtGeometryResult result;
unsigned int inactPixHeight, pixHeight;
unsigned int inactPixWidth, pixWidth;
unsigned int pixBW, pixDepth;
Dimension height, minHeight;
Dimension width, minWidth, borderWidth;
Dimension co;
int st, ht;
Boolean map, isManaged;
struct
{
int width, height, numTabs, x;
} rows[MAX_TAB_ROWS];
dpy = XtDisplay(f);
children = f->composite.children;
st = f->manager.shadow_thickness;
ht = f->folder.highlightThickness;
/* calculate corner offset */
if (f->folder.cornerStyle == XmCORNER_LINE)
co = (Dimension)((double)f->folder.cornerDimension * .5 + .99);
else if (f->folder.cornerStyle == XmCORNER_ARC)
co = (Dimension)((double)f->folder.cornerDimension * .3 + .99);
else
co = 0;
/* caculate tabWidth, minWidth, minHeight, row x positions, */
/* row widths and tab pixmap dimensions */
rowX = 0;
rowY = 0;
rowWidth = 0;
rowNum = 0;
tabNum = 0;
minHeight = 0;
for (i = 0; i < f->folder.tabCount; i++)
{
tab = f->folder.tabs[i];
if (!XtIsManaged(tab))
continue;
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
/* check for start of a new row */
fc->folder.firstInRow = False;
if (!tabNum)
fc->folder.firstInRow = True;
if (f->folder.tabsPerRow && tabNum == f->folder.tabsPerRow)
{
fc->folder.firstInRow = True;
/* store prev row values and start next row */
if (rowY)
rowY -= f->folder.spacing;
rows[rowNum].x = rowX;
rows[rowNum].height = rowY;
rows[rowNum].width = rowWidth;
rows[rowNum].numTabs = tabNum;
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "row %d: x %d w %d h %d numTabs %d\n",
rowNum, rowX, rowWidth, rowY, tabNum);
}
rowX += rowWidth;
rowWidth = 0;
if (rowY > (int)minHeight)
minHeight = rowY;
rowY = 0;
tabNum = 0;
rowNum++;
if (rowNum == MAX_TAB_ROWS - 1)
{
XmLWarning((Widget)f, "Layout ERROR - too many rows\n");
return;
}
}
/* make sure row width > maximum tab width */
width = co + st + tab->core.width + tab->core.border_width * 2 +
f->folder.marginHeight * 2 + ht * 2;
if ((int)width > rowWidth)
rowWidth = width;
/* calc pixmap dimensions/maximum pixmap width */
pixWidth = 0;
pixHeight = 0;
fc->folder.pixWidth = 0;
fc->folder.pixHeight = 0;
fc->folder.inactPixWidth = 0;
fc->folder.inactPixHeight = 0;
fc->folder.maxPixWidth = 0;
fc->folder.maxPixHeight = 0;
if (fc->folder.pix != XmUNSPECIFIED_PIXMAP)
{
XGetGeometry(dpy, fc->folder.pix, &root,
&x, &y, &pixWidth, &pixHeight, &pixBW, &pixDepth);
fc->folder.pixWidth = pixWidth;
fc->folder.maxPixWidth = pixWidth;
fc->folder.pixHeight = pixHeight;
fc->folder.maxPixHeight = pixHeight;
width = co + st + pixWidth + f->folder.marginHeight * 2 + ht * 2;
if ((int)width > rowWidth)
rowWidth = width;
}
if (fc->folder.inactPix != XmUNSPECIFIED_PIXMAP)
{
XGetGeometry(dpy, fc->folder.inactPix, &root, &x, &y,
&inactPixWidth, &inactPixHeight, &pixBW, &pixDepth);
fc->folder.inactPixWidth = inactPixWidth;
if (inactPixWidth > fc->folder.maxPixWidth)
fc->folder.maxPixWidth = inactPixWidth;
fc->folder.inactPixHeight = inactPixHeight;
if (inactPixHeight > fc->folder.maxPixHeight)
fc->folder.maxPixHeight = inactPixHeight;
width = co + st + inactPixWidth +
f->folder.marginHeight * 2 + ht * 2;
if ((int)width > rowWidth)
rowWidth = width;
}
/* increment rowY to move on to the next tab */
rowY += st * 2 + co * 2 + f->folder.marginWidth * 2 + ht * 2 +
XtHeight(tab) + tab->core.border_width * 2;
if (fc->folder.maxPixHeight)
rowY += fc->folder.maxPixHeight + f->folder.pixmapMargin;
rowY += f->folder.spacing;
tabNum++;
fc->folder.row = rowNum;
}
/* complete calcuations for last row */
if (rowY)
rowY -= f->folder.spacing;
rows[rowNum].x = rowX;
rows[rowNum].height = rowY;
rows[rowNum].width = rowWidth;
rows[rowNum].numTabs = tabNum;
numRows = rowNum + 1;
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "row %d: x %d w %d h %d numTabs %d\n",
rowNum, rowX, rowWidth, rowY, tabNum);
}
f->folder.tabWidth = rowX + rowWidth;
f->folder.tabBarHeight = f->folder.tabWidth;
minWidth = f->folder.tabWidth;
if ((int)minHeight < rowY)
minHeight = rowY;
/* add space for indent of upper rows */
if (f->folder.tabsPerRow && minHeight)
minHeight += 4;
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "tab bar minimum w %d h %d\n",
(int)minWidth, (int)minHeight);
}
/* calculate width and height of non-tab children ensure */
/* minWidth > width and minHeight > height */
for (i = 0; i < f->composite.num_children; i++)
{
child = children[i];
if (XtIsSubclass(child, xmPrimitiveWidgetClass))
continue;
height = XtHeight(child) + st * 2;
if (XtIsWidget(child))
height += f->core.border_width * 2;
if (height > minHeight)
minHeight = height;
width = XtWidth(child) + f->folder.tabWidth + st * 2;
if (XtIsWidget(child))
width += f->core.border_width * 2;
if (width > minWidth)
minWidth = width;
}
if (f->folder.debugLevel)
{
fprintf(stderr, "XmLFolder: Layout: ");
fprintf(stderr, "with non-tabs minimum w %d h %d\n",
(int)minWidth, (int)minHeight);
}
/* Resize folder if needed */
if (resizeIfNeeded && f->folder.resizePolicy != XmRESIZE_NONE)
{
if (minWidth <= 0)
minWidth = 1;
if (minHeight <= 0)
minHeight = 1;
result = XtMakeResizeRequest((Widget)f, minWidth, minHeight,
&width, &height);
if (result == XtGeometryAlmost)
XtMakeResizeRequest((Widget)f, width, height, NULL, NULL);
}
/* move active row to bottom */
tab = f->folder.activeW;
if (tab)
{
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
rowNum = fc->folder.row;
f->folder.activeRow = rowNum;
rows[rowNum].x = f->folder.tabWidth - rows[rowNum].width;
for (i = rowNum + 1; i < numRows; i++)
rows[i].x -= rows[rowNum].width;
}
else
f->folder.activeRow = -1;
/* configure tab children */
for (i = 0; i < f->folder.tabCount; i++)
{
tab = f->folder.tabs[i];
if (!XtIsManaged(tab))
continue;
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
rowNum = fc->folder.row;
/* calculate tab x */
if (fc->folder.firstInRow == True)
{
if (f->folder.tabsPerRow && rowNum != f->folder.activeRow)
y = 2;
else
y = 0;
}
fc->folder.y = y;
y += st + co + f->folder.marginWidth + ht;
if (fc->folder.maxPixHeight)
y += fc->folder.maxPixHeight + f->folder.pixmapMargin;
/* calculate tab x and tab width */
fc->folder.width = rows[rowNum].width;
if (f->folder.tabPlacement == XmFOLDER_LEFT)
{
fc->folder.x = rows[rowNum].x;
x = fc->folder.x + fc->folder.width - f->folder.marginHeight -
ht - XtWidth(tab) - tab->core.border_width * 2;
}
else
{
fc->folder.x = f->core.width - rows[rowNum].x -
rows[rowNum].width;
x = fc->folder.x + f->folder.marginHeight + ht;
}
/* calculate tab padding */
pad1 = 0;
pad2 = 0;
h = f->core.height - rows[rowNum].height;
if (rowNum != f->folder.activeRow)
h -= 4;
if (f->folder.tabsPerRow && h > 0)
{
pad1 = h / (rows[rowNum].numTabs * 2);
pad2 = pad1;
if (fc->folder.firstInRow == True)
pad2 += h - (pad1 * rows[rowNum].numTabs * 2);
}
y += pad1;
/* move tab widget into place */
XtMoveWidget(tab, x, y);
/* calculate tab height and move to next tab */
y += pad2 + XtHeight(tab) + tab->core.border_width * 2 + ht +
f->folder.marginWidth + co + st;
fc->folder.height = y - fc->folder.y;
y += f->folder.spacing;
}
/* configure non-tab children */
for (i = 0; i < f->composite.num_children; i++)
{
child = children[i];
if (XtIsSubclass(child, xmPrimitiveWidgetClass))
continue;
if (f->folder.resizePolicy == XmRESIZE_NONE)
continue;
w = (int)f->core.width - (int)f->folder.tabWidth - st * 2;
h = (int)f->core.height - st * 2;
if (h <= 0 || w <= 0)
continue;
/* manager widgets will not configure correctly unless they */
/* are managed, so manage then unmapped if they are unmanaged */
isManaged = True;
if (!XtIsManaged(child))
{
XtVaGetValues(child,
XmNmappedWhenManaged, &map,
NULL);
XtVaSetValues(child,
XmNmappedWhenManaged, False,
NULL);
XtManageChild(child);
isManaged = False;
}
y = st;
if (f->folder.tabPlacement == XmFOLDER_LEFT)
x = f->folder.tabWidth + st;
else
x = st;
width = w;
height = h;
borderWidth = 0;
if (XtIsWidget(child))
borderWidth = child->core.border_width;
XtConfigureWidget(child, x, y, width, height, borderWidth);
if (isManaged == False)
{
XtUnmanageChild(child);
XtVaSetValues(child, XmNmappedWhenManaged, map, NULL);
}
}
}
static void
Resize(Widget w)
{
XmLFolderWidget f;
f = (XmLFolderWidget)w;
Layout(f, 0);
}
static XtGeometryResult
GeometryManager(Widget w,
XtWidgetGeometry *request,
XtWidgetGeometry *allow)
{
XmLFolderWidget f;
f = (XmLFolderWidget)XtParent(w);
if (f->folder.resizePolicy != XmRESIZE_STATIC ||
XtIsSubclass(w, xmPrimitiveWidgetClass))
{
if (request->request_mode & CWWidth)
w->core.width = request->width;
if (request->request_mode & CWHeight)
w->core.height = request->height;
if (request->request_mode & CWX)
w->core.x = request->x;
if (request->request_mode & CWY)
w->core.y = request->y;
if (request->request_mode & CWBorderWidth)
w->core.border_width = request->border_width;
Layout(f, 1);
return XtGeometryYes;
}
return XtGeometryNo;
}
static void
ChangeManaged(Widget w)
{
XmLFolderWidget f;
f = (XmLFolderWidget)w;
Layout(f, 1);
_XmNavigChangeManaged(w);
}
static void
ConstraintInitialize(Widget req,
Widget w,
ArgList args,
Cardinal *narg)
{
XmLFolderWidget f;
XmLFolderConstraintRec *fc;
if (!XtIsRectObj(w))
return;
f = (XmLFolderWidget)XtParent(w);
if (f->folder.debugLevel)
fprintf(stderr, "XmLFolder: Constraint Init\n");
fc = (XmLFolderConstraintRec *)(w->core.constraints);
fc->folder.x = 0;
fc->folder.y = 0;
fc->folder.width = 0;
fc->folder.height = 0;
fc->folder.maxPixWidth = 0;
fc->folder.maxPixHeight = 0;
fc->folder.row = -1;
fc->folder.firstInRow = False;
if (fc->folder.managedName)
fc->folder.managedName = (char *)strdup(fc->folder.managedName);
if (XtIsSubclass(w, xmPrimitiveWidgetClass))
{
XtOverrideTranslations(w, f->folder.primTrans);
XtAddCallback(w, XmNactivateCallback, PrimActivate, 0);
XtVaSetValues(w,
XmNhighlightThickness, 0,
XmNshadowThickness, 0,
NULL);
if (XtIsSubclass(w, xmLabelWidgetClass))
XtVaSetValues(w, XmNfillOnArm, False, NULL);
/* add child to tabs list */
if (f->folder.tabAllocCount < f->folder.tabCount + 1)
{
f->folder.tabAllocCount *= 2;
f->folder.tabs = (Widget *)realloc((char *)f->folder.tabs,
sizeof(Widget) * f->folder.tabAllocCount);
}
f->folder.tabs[f->folder.tabCount++] = w;
}
if (XmIsDrawnButton(w))
SetTabPlacement(f, w);
#ifdef XmLEVAL
if (f->folder.tabCount > 6)
{
fprintf(stderr, "XmL: evaluation version only supports <= 6 tabs\n");
exit(0);
}
#endif
}
static void
ConstraintDestroy(Widget w)
{
XmLFolderWidget f;
XmLFolderConstraintRec *fc;
int i, j, activePos;
if (!XtIsRectObj(w))
return;
f = (XmLFolderWidget)XtParent(w);
if (f->folder.debugLevel)
fprintf(stderr, "XmLFolder: Constraint Destroy\n");
if (f->folder.focusW == w)
f->folder.focusW = 0;
fc = (XmLFolderConstraintRec *)(w->core.constraints);
if (fc->folder.managedName)
free((char *)fc->folder.managedName);
if (fc->folder.freePix == True)
{
if (fc->folder.pix != XmUNSPECIFIED_PIXMAP)
XFreePixmap(XtDisplay(w), fc->folder.pix);
if (fc->folder.inactPix != XmUNSPECIFIED_PIXMAP)
XFreePixmap(XtDisplay(w), fc->folder.inactPix);
}
if (XtIsSubclass(w, xmPrimitiveWidgetClass))
{
XtRemoveCallback(w, XmNactivateCallback, PrimActivate, 0);
/* remove child from tabs list and calculate active pos */
activePos = -1;
j = 0;
for (i = 0; i < f->folder.tabCount; i++)
if (f->folder.tabs[i] != w)
{
if (f->folder.activeW == f->folder.tabs[i])
activePos = j;
f->folder.tabs[j++] = f->folder.tabs[i];
}
if (j != f->folder.tabCount - 1)
XmLWarning((Widget)f, "ConstraintDestroy() - bad child list");
f->folder.tabCount = j;
f->folder.activeTab = activePos;
if (activePos == -1)
f->folder.activeW = 0;
}
}
static void
DrawTabPixmap(XmLFolderWidget f,
Widget tab,
int active)
{
Display *dpy;
Window win;
int x, y;
Pixmap pixmap;
Dimension pixWidth, pixHeight, ht;
XmLFolderConstraintRec *fc;
x = 0;
y = 0;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
ht = f->folder.highlightThickness;
if (active)
{
pixWidth = fc->folder.pixWidth;
pixHeight = fc->folder.pixHeight;
pixmap = fc->folder.pix;
}
else
{
pixWidth = fc->folder.inactPixWidth;
pixHeight = fc->folder.inactPixHeight;
pixmap = fc->folder.inactPix;
}
if (f->folder.tabPlacement == XmFOLDER_TOP)
{
x = tab->core.x - pixWidth - ht - f->folder.pixmapMargin;
y = tab->core.y + tab->core.height - pixHeight;
}
else if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
x = tab->core.x - fc->folder.pixWidth - ht - f->folder.pixmapMargin;
y = tab->core.y;
}
else if (f->folder.tabPlacement == XmFOLDER_LEFT)
{
x = tab->core.x + tab->core.width - pixWidth;
y = tab->core.y - pixHeight - f->folder.pixmapMargin - ht;
}
else if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
x = tab->core.x;
y = tab->core.y - pixHeight - f->folder.pixmapMargin - ht;
}
XCopyArea(dpy, pixmap, win, f->folder.gc, 0, 0, pixWidth, pixHeight, x, y);
}
static void
DrawManagerShadowTopBottom(XmLFolderWidget f,
XRectangle *rect)
{
Display *dpy;
Window win;
XmLFolderConstraintRec *fc;
XSegment *topSeg, *botSeg;
int i, bCount, tCount, st, botOff, isManaged;
dpy = XtDisplay(f);
win = XtWindow(f);
st = f->manager.shadow_thickness;
if (!st)
return;
botOff = f->core.height - f->folder.tabHeight - 1;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
/* top shadow */
fc = 0;
if (f->folder.activeW)
fc = (XmLFolderConstraintRec *)(f->folder.activeW->core.constraints);
tCount = 0;
if (fc)
for (i = 0; i < st; i++)
{
topSeg[tCount].x1 = rect->x + i;
topSeg[tCount].y1 = rect->y + i;
topSeg[tCount].x2 = fc->folder.x + i;
topSeg[tCount].y2 = rect->y + i;
if (rect->x != fc->folder.x)
tCount++;
topSeg[tCount].x1 = rect->x + fc->folder.x +
fc->folder.width - i - 1;
topSeg[tCount].y1 = rect->y + i;
topSeg[tCount].x2 = rect->x + rect->width - i - 1;
topSeg[tCount].y2 = rect->y + i;
if (fc->folder.x + fc->folder.width != rect->width)
tCount++;
}
else
for (i = 0; i < st; i++)
{
topSeg[tCount].x1 = rect->x + i;
topSeg[tCount].y1 = rect->y + i;
topSeg[tCount].x2 = rect->x + rect->width - i - 1;
topSeg[tCount].y2 = rect->y + i;
tCount++;
}
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
for (i = 0 ; i < tCount; i++)
{
topSeg[i].y1 = botOff - topSeg[i].y1;
topSeg[i].y2 = botOff - topSeg[i].y2;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
SetGC(f, GC_SHADOWBOT);
else
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
/* see if there's any composite widgets in the folder */
isManaged = 0;
for (i = 0; i < f->composite.num_children; i++)
{
Widget child = f->composite.children[i];
if (!XtIsSubclass(child, xmPrimitiveWidgetClass) && XtIsManaged(child))
{
isManaged = 1;
break;
}
}
/* no need to draw shadow for the manager area if
there isn't any composite widgets in the folder */
if (!isManaged)
{
free((char *)topSeg);
free((char *)botSeg);
return;
}
/* left shadow */
tCount = 0;
for (i = 0; i < st; i++)
{
topSeg[tCount].x1 = rect->x + i;
topSeg[tCount].y1 = rect->y + i;
topSeg[tCount].x2 = rect->x + i;
topSeg[tCount].y2 = rect->y + rect->height - i - 1;
tCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
/* right shadow */
bCount = 0;
for (i = 0; i < st; i++)
{
botSeg[bCount].x1 = rect->x + rect->width - i - 1;
botSeg[bCount].y1 = rect->y + i;
botSeg[bCount].x2 = rect->x + rect->width - i - 1;
botSeg[bCount].y2 = rect->y + rect->height - i - 1;
bCount++;
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
/* bottom shadow */
bCount = 0;
for (i = 0; i < st; i++)
{
botSeg[bCount].x1 = rect->x + i;
botSeg[bCount].y1 = rect->y + rect->height - i - 1;
botSeg[bCount].x2 = rect->x + rect->width - i - 1;
botSeg[bCount].y2 = rect->y + rect->height - i - 1;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
botSeg[bCount].y1 = botOff - botSeg[bCount].y1;
botSeg[bCount].y2 = botOff - botSeg[bCount].y2;
}
bCount++;
}
if (bCount)
{
if (f->folder.tabPlacement == XmFOLDER_TOP)
SetGC(f, GC_SHADOWBOT);
else
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
}
static void
DrawManagerShadowLeftRight(XmLFolderWidget f,
XRectangle *rect)
{
Display *dpy;
Window win;
XmLFolderConstraintRec *fc;
XSegment *topSeg, *botSeg;
int i, bCount, tCount, st, rightOff;
dpy = XtDisplay(f);
win = XtWindow(f);
st = f->manager.shadow_thickness;
if (!st)
return;
rightOff = f->core.width - f->folder.tabWidth - 1;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
/* left shadow */
fc = 0;
if (f->folder.activeW)
fc = (XmLFolderConstraintRec *)(f->folder.activeW->core.constraints);
tCount = 0;
if (fc)
for (i = 0; i < st; i++)
{
topSeg[tCount].x1 = rect->x + i;
topSeg[tCount].y1 = rect->y + i;
topSeg[tCount].x2 = rect->x + i;
topSeg[tCount].y2 = fc->folder.y + i;
if (rect->y != fc->folder.y)
tCount++;
topSeg[tCount].x1 = rect->x + i;
topSeg[tCount].y1 = rect->y + fc->folder.y +
fc->folder.height - i - 1;
topSeg[tCount].x2 = rect->x + i;
topSeg[tCount].y2 = rect->y + rect->height - i - 1;
if (fc->folder.y + fc->folder.height != rect->height)
tCount++;
}
else
for (i = 0; i < st; i++)
{
topSeg[tCount].x1 = rect->x + i;
topSeg[tCount].y1 = rect->y + i;
topSeg[tCount].x2 = rect->x + i;
topSeg[tCount].y2 = rect->y + rect->height - i - 1;
tCount++;
}
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
for (i = 0 ; i < tCount; i++)
{
topSeg[i].x1 = rightOff - topSeg[i].x1;
topSeg[i].x2 = rightOff - topSeg[i].x2;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
SetGC(f, GC_SHADOWBOT);
else
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
/* top shadow */
tCount = 0;
for (i = 0; i < st; i++)
{
topSeg[tCount].x1 = rect->x + i;
topSeg[tCount].y1 = rect->y + i;
topSeg[tCount].x2 = rect->x + rect->width - i - 1;
topSeg[tCount].y2 = rect->y + i;
tCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
/* bottom shadow */
bCount = 0;
for (i = 0; i < st; i++)
{
botSeg[bCount].x1 = rect->x + i;
botSeg[bCount].y1 = rect->y + rect->height - i - 1;
botSeg[bCount].x2 = rect->x + rect->width - i - 1;
botSeg[bCount].y2 = rect->y + rect->height - i - 1;
bCount++;
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
/* right shadow */
bCount = 0;
for (i = 0; i < st; i++)
{
botSeg[bCount].x1 = rect->x + rect->width - i - 1;
botSeg[bCount].y1 = rect->y + i;
botSeg[bCount].x2 = rect->x + rect->width - i - 1;
botSeg[bCount].y2 = rect->y + rect->height - i - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
botSeg[bCount].x1 = rightOff - botSeg[bCount].x1;
botSeg[bCount].x2 = rightOff - botSeg[bCount].x2;
}
bCount++;
}
if (bCount)
{
if (f->folder.tabPlacement == XmFOLDER_LEFT)
SetGC(f, GC_SHADOWBOT);
else
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
}
static void
DrawTabShadowArcTopBottom(XmLFolderWidget f,
Widget w)
{
XmLFolderConstraintRec *fc;
Display *dpy;
Window win;
XSegment *topSeg, *botSeg;
XRectangle rect, rect2;
XArc arc;
int tCount, bCount;
int i, st, cd, botOff;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(w->core.constraints);
botOff = 2 * fc->folder.y + fc->folder.height - 1;
st = f->manager.shadow_thickness;
if (!st)
return;
cd = f->folder.cornerDimension;
tCount = 0;
bCount = 0;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st);
for (i = 0; i < st; i++)
{
/* left tab shadow */
topSeg[tCount].x1 = fc->folder.x + i;
topSeg[tCount].y1 = fc->folder.y + cd + st;
topSeg[tCount].x2 = fc->folder.x + i;
topSeg[tCount].y2 = fc->folder.y + fc->folder.height - 1;
if (w == f->folder.activeW)
topSeg[tCount].y2 += i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
topSeg[tCount].y1 = botOff - topSeg[tCount].y1;
topSeg[tCount].y2 = botOff - topSeg[tCount].y2;
}
tCount++;
/* right tab shadow */
botSeg[bCount].x1 = fc->folder.x + fc->folder.width - i - 1;
botSeg[bCount].y1 = fc->folder.y + cd + st;
botSeg[bCount].x2 = fc->folder.x + fc->folder.width - i - 1;
botSeg[bCount].y2 = fc->folder.y + fc->folder.height - 1;
if (w == f->folder.activeW)
botSeg[bCount].y2 += i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
botSeg[bCount].y1 = botOff - botSeg[bCount].y1;
botSeg[bCount].y2 = botOff - botSeg[bCount].y2;
}
bCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
tCount = 0;
for (i = 0; i < st; i++)
{
/* top tab shadow */
topSeg[tCount].x1 = fc->folder.x + cd + st;
topSeg[tCount].y1 = fc->folder.y + i;
topSeg[tCount].x2 = fc->folder.x + fc->folder.width - cd - st - 1;
topSeg[tCount].y2 = fc->folder.y + i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
topSeg[tCount].y1 = botOff - topSeg[tCount].y1;
topSeg[tCount].y2 = botOff - topSeg[tCount].y2;
}
tCount++;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
SetGC(f, GC_SHADOWBOT);
else
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
/* left corner blank background */
rect.x = fc->folder.x;
rect.y = fc->folder.y;
rect.width = cd + st;
rect.height = cd + st;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
rect.y = fc->folder.y + fc->folder.height - rect.height;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
SetGC(f, GC_UNSET);
/* left arc */
/* various X Servers have problems drawing arcs - so set clip rect */
/* and draw two circles, one smaller than the other, for corner */
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect, 1, Unsorted);
arc.x = rect.x;
arc.y = rect.y;
arc.width = rect.width * 2;
arc.height = rect.height * 2;
if (f->folder.serverDrawsArcsLarge == True)
{
arc.width -= 1;
arc.height -= 1;
}
arc.angle1 = 0 * 64;
arc.angle2 = 360 * 64;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
arc.y = fc->folder.y + fc->folder.height - arc.height;
SetGC(f, GC_SHADOWTOP);
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
SetGC(f, GC_UNSET);
rect2 = rect;
rect2.x += st;
rect2.width -= st;
rect2.height -= st;
if (f->folder.tabPlacement == XmFOLDER_TOP)
rect2.y += st;
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect2, 1, Unsorted);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
arc.x += st;
arc.y += st;
arc.width -= st * 2;
arc.height -= st * 2;
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XSetClipMask(dpy, f->folder.gc, None);
/* right corner blank background */
rect.x = fc->folder.x + fc->folder.width - cd - st;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
SetGC(f, GC_UNSET);
/* right arc */
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect, 1, Unsorted);
arc.x = rect.x - cd - st;
arc.y = rect.y;
arc.width = rect.width * 2;
arc.height = rect.height * 2;
if (f->folder.serverDrawsArcsLarge == True)
{
arc.width -= 1;
arc.height -= 1;
}
arc.angle1 = 0 * 64;
arc.angle2 = 360 * 64;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
arc.y = fc->folder.y + fc->folder.height - arc.height;
SetGC(f, GC_SHADOWBOT);
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
SetGC(f, GC_UNSET);
rect2 = rect;
rect2.width -= st;
rect2.height -= st;
if (f->folder.tabPlacement == XmFOLDER_TOP)
rect2.y += st;
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect2, 1, Unsorted);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
arc.x += st;
arc.y += st;
arc.width -= st * 2;
arc.height -= st * 2;
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XSetClipMask(dpy, f->folder.gc, None);
}
static void
DrawTabShadowArcLeftRight(XmLFolderWidget f,
Widget w)
{
XmLFolderConstraintRec *fc;
Display *dpy;
Window win;
XSegment *topSeg, *botSeg;
XRectangle rect, rect2;
XArc arc;
int tCount, bCount;
int i, st, cd, rightOff;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(w->core.constraints);
rightOff = 2 * fc->folder.x + fc->folder.width - 1;
st = f->manager.shadow_thickness;
if (!st)
return;
cd = f->folder.cornerDimension;
tCount = 0;
bCount = 0;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st);
for (i = 0; i < st; i++)
{
/* top tab shadow */
topSeg[tCount].x1 = fc->folder.x + cd + st;
topSeg[tCount].y1 = fc->folder.y + i;
topSeg[tCount].x2 = fc->folder.x + fc->folder.width - 1;
if (w == f->folder.activeW)
topSeg[tCount].x2 += i;
topSeg[tCount].y2 = fc->folder.y + i;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
topSeg[tCount].x1 = rightOff - topSeg[tCount].x1;
topSeg[tCount].x2 = rightOff - topSeg[tCount].x2;
}
tCount++;
/* bottom tab shadow */
botSeg[bCount].x1 = fc->folder.x + cd + st;
botSeg[bCount].y1 = fc->folder.y + fc->folder.height - i - 1;
botSeg[bCount].x2 = fc->folder.x + fc->folder.width - 1;
if (w == f->folder.activeW)
botSeg[bCount].x2 += i;
botSeg[bCount].y2 = fc->folder.y + fc->folder.height - i - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
botSeg[bCount].x1 = rightOff - botSeg[bCount].x1;
botSeg[bCount].x2 = rightOff - botSeg[bCount].x2;
}
bCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
tCount = 0;
for (i = 0; i < st; i++)
{
/* left tab shadow */
topSeg[tCount].x1 = fc->folder.x + i;
topSeg[tCount].y1 = fc->folder.y + cd + st;
topSeg[tCount].x2 = fc->folder.x + i;
topSeg[tCount].y2 = fc->folder.y + fc->folder.height - cd - st - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
topSeg[tCount].x1 = rightOff - topSeg[tCount].x1;
topSeg[tCount].x2 = rightOff - topSeg[tCount].x2;
}
tCount++;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
SetGC(f, GC_SHADOWBOT);
else
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
/* top corner blank background */
rect.x = fc->folder.x;
rect.y = fc->folder.y;
rect.width = cd + st;
rect.height = cd + st;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
rect.x = fc->folder.x + fc->folder.width - rect.width;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
SetGC(f, GC_UNSET);
/* top arc */
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect, 1, Unsorted);
arc.x = rect.x;
arc.y = rect.y;
arc.width = rect.width * 2;
arc.height = rect.height * 2;
if (f->folder.serverDrawsArcsLarge == True)
{
arc.width -= 1;
arc.height -= 1;
}
arc.angle1 = 0 * 64;
arc.angle2 = 360 * 64;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
arc.x = fc->folder.x + fc->folder.width - arc.width;
SetGC(f, GC_SHADOWTOP);
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
SetGC(f, GC_UNSET);
rect2 = rect;
rect2.width -= st;
rect2.height -= st;
rect2.y += st;
if (f->folder.tabPlacement == XmFOLDER_LEFT)
rect2.x += st;
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect2, 1, Unsorted);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
arc.x += st;
arc.y += st;
arc.width -= st * 2;
arc.height -= st * 2;
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XSetClipMask(dpy, f->folder.gc, None);
/* bottom corner blank background */
rect.y = fc->folder.y + fc->folder.height - cd - st;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, rect.x, rect.y,
rect.width, rect.height);
SetGC(f, GC_UNSET);
/* bottom arc */
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect, 1, Unsorted);
arc.x = rect.x;
arc.y = rect.y - cd - st;
arc.width = rect.width * 2;
arc.height = rect.height * 2;
if (f->folder.serverDrawsArcsLarge == True)
{
arc.width -= 1;
arc.height -= 1;
}
arc.angle1 = 0 * 64;
arc.angle2 = 360 * 64;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
arc.x = fc->folder.x + fc->folder.width - arc.width;
SetGC(f, GC_SHADOWBOT);
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
SetGC(f, GC_UNSET);
rect2 = rect;
rect2.width -= st;
rect2.height -= st;
if (f->folder.tabPlacement == XmFOLDER_LEFT)
rect2.x += st;
XSetClipRectangles(dpy, f->folder.gc, 0, 0, &rect2, 1, Unsorted);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
arc.x += st;
arc.y += st;
arc.width -= st * 2;
arc.height -= st * 2;
XFillArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XDrawArc(dpy, win, f->folder.gc, arc.x, arc.y, arc.width, arc.height,
arc.angle1, arc.angle2);
XSetClipMask(dpy, f->folder.gc, None);
}
static void
DrawTabShadowLineTopBottom(XmLFolderWidget f,
Widget w)
{
XmLFolderConstraintRec *fc;
Display *dpy;
Window win;
XSegment *topSeg, *botSeg;
XPoint points[4];
int tCount, bCount, botOff, i, st, cd, y;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(w->core.constraints);
botOff = 2 * fc->folder.y + fc->folder.height - 1;
st = f->manager.shadow_thickness;
if (!st)
return;
cd = f->folder.cornerDimension;
tCount = 0;
bCount = 0;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st);
for (i = 0; i < st; i++)
{
/* left tab shadow */
topSeg[tCount].x1 = fc->folder.x + i;
topSeg[tCount].y1 = fc->folder.y + cd + st;
topSeg[tCount].x2 = fc->folder.x + i;
topSeg[tCount].y2 = fc->folder.y + fc->folder.height - 1;
if (w == f->folder.activeW)
topSeg[tCount].y2 += i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
topSeg[tCount].y1 = botOff - topSeg[tCount].y1;
topSeg[tCount].y2 = botOff - topSeg[tCount].y2;
}
tCount++;
/* right tab shadow */
botSeg[bCount].x1 = fc->folder.x + fc->folder.width - i - 1;
botSeg[bCount].y1 = fc->folder.y + cd + st;
botSeg[bCount].x2 = fc->folder.x + fc->folder.width - i - 1;
botSeg[bCount].y2 = fc->folder.y + fc->folder.height - 1;
if (w == f->folder.activeW)
botSeg[bCount].y2 += i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
botSeg[bCount].y1 = botOff - botSeg[bCount].y1;
botSeg[bCount].y2 = botOff - botSeg[bCount].y2;
}
bCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
tCount = 0;
for (i = 0; i < st; i++)
{
/* top tab shadow */
topSeg[tCount].x1 = fc->folder.x + cd + st;
topSeg[tCount].y1 = fc->folder.y + i;
topSeg[tCount].x2 = fc->folder.x + fc->folder.width - cd - st - 1;
topSeg[tCount].y2 = fc->folder.y + i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
topSeg[tCount].y1 = botOff - topSeg[tCount].y1;
topSeg[tCount].y2 = botOff - topSeg[tCount].y2;
}
tCount++;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_TOP)
SetGC(f, GC_SHADOWTOP);
else
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
/* left top line */
points[0].x = fc->folder.x;
points[0].y = fc->folder.y + cd + st - 1;
points[1].x = fc->folder.x + cd + st - 1;
points[1].y = fc->folder.y;
points[2].x = fc->folder.x + cd + st - 1;
points[2].y = fc->folder.y + cd + st - 1;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
points[0].y = botOff - points[0].y;
points[1].y = botOff - points[1].y;
points[2].y = botOff - points[2].y;
}
y = fc->folder.y;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
y = fc->folder.y + fc->folder.height - cd - st;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, fc->folder.x, y, cd + st, cd + st);
SetGC(f, GC_UNSET);
SetGC(f, GC_SHADOWTOP);
XFillPolygon(dpy, win, f->folder.gc, points, 3, Nonconvex,
CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
SetGC(f, GC_UNSET);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
points[0].x += st;
points[1].y += st;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
points[1].y -= st * 2;
XFillPolygon(dpy, win, f->folder.gc, points, 3,
Nonconvex, CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
/* right top line */
points[0].x = fc->folder.x + fc->folder.width - 1;
points[0].y = fc->folder.y + cd + st - 1;
points[1].x = fc->folder.x + fc->folder.width - cd - st;
points[1].y = fc->folder.y;
points[2].x = fc->folder.x + fc->folder.width - cd - st;
points[2].y = fc->folder.y + cd + st - 1;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
points[0].y = botOff - points[0].y;
points[1].y = botOff - points[1].y;
points[2].y = botOff - points[2].y;
}
y = fc->folder.y;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
y = fc->folder.y + fc->folder.height - cd - st;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, fc->folder.x + fc->folder.width -
cd - st, y, cd + st, cd + st);
SetGC(f, GC_UNSET);
if (f->folder.tabPlacement == XmFOLDER_TOP)
SetGC(f, GC_SHADOWTOP);
else
SetGC(f, GC_SHADOWBOT);
XFillPolygon(dpy, win, f->folder.gc, points, 3, Nonconvex,
CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
SetGC(f, GC_UNSET);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
points[0].x -= st;
points[1].y += st;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
points[1].y -= st * 2;
XFillPolygon(dpy, win, f->folder.gc, points, 3, Nonconvex,
CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
}
static void
DrawTabShadowLineLeftRight(XmLFolderWidget f,
Widget w)
{
XmLFolderConstraintRec *fc;
Display *dpy;
Window win;
XSegment *topSeg, *botSeg;
XPoint points[4];
int tCount, bCount, rightOff, i, st, cd, x;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(w->core.constraints);
rightOff = 2 * fc->folder.x + fc->folder.width - 1;
st = f->manager.shadow_thickness;
if (!st)
return;
cd = f->folder.cornerDimension;
tCount = 0;
bCount = 0;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st);
for (i = 0; i < st; i++)
{
/* top tab shadow */
topSeg[tCount].x1 = fc->folder.x + cd + st;
topSeg[tCount].y1 = fc->folder.y + i;
topSeg[tCount].x2 = fc->folder.x + fc->folder.width - 1;
if (w == f->folder.activeW)
topSeg[tCount].x2 += i;
topSeg[tCount].y2 = fc->folder.y + i;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
topSeg[tCount].x1 = rightOff - topSeg[tCount].x1;
topSeg[tCount].x2 = rightOff - topSeg[tCount].x2;
}
tCount++;
/* bottom tab shadow */
botSeg[bCount].x1 = fc->folder.x + cd + st;
botSeg[bCount].y1 = fc->folder.y + fc->folder.height - i - 1;
botSeg[bCount].x2 = fc->folder.x + fc->folder.width - 1;
if (w == f->folder.activeW)
botSeg[bCount].x2 += i;
botSeg[bCount].y2 = fc->folder.y + fc->folder.height - i - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
botSeg[bCount].x1 = rightOff - botSeg[bCount].x1;
botSeg[bCount].x2 = rightOff - botSeg[bCount].x2;
}
bCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
tCount = 0;
for (i = 0; i < st; i++)
{
/* left tab shadow */
topSeg[tCount].x1 = fc->folder.x + i;
topSeg[tCount].y1 = fc->folder.y + cd + st;
topSeg[tCount].x2 = fc->folder.x + i;
topSeg[tCount].y2 = fc->folder.y + fc->folder.height - cd - st - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
topSeg[tCount].x1 = rightOff - topSeg[tCount].x1;
topSeg[tCount].x2 = rightOff - topSeg[tCount].x2;
}
tCount++;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_LEFT)
SetGC(f, GC_SHADOWTOP);
else
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
/* top line */
points[0].x = fc->folder.x + cd + st - 1;
points[0].y = fc->folder.y;
points[1].x = fc->folder.x;
points[1].y = fc->folder.y + cd + st - 1;
points[2].x = fc->folder.x + cd + st - 1;
points[2].y = fc->folder.y + cd + st - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
points[0].x = rightOff - points[0].x;
points[1].x = rightOff - points[1].x;
points[2].x = rightOff - points[2].x;
}
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
x = fc->folder.x + fc->folder.width - cd - st;
else
x = fc->folder.x;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, x, fc->folder.y, cd + st, cd + st);
SetGC(f, GC_UNSET);
SetGC(f, GC_SHADOWTOP);
XFillPolygon(dpy, win, f->folder.gc, points, 3, Nonconvex,
CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
SetGC(f, GC_UNSET);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
points[0].y += st;
points[1].x += st;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
points[1].x -= st * 2;
XFillPolygon(dpy, win, f->folder.gc, points, 3,
Nonconvex, CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
/* bottom line */
points[0].x = fc->folder.x + cd + st - 1;
points[0].y = fc->folder.y + fc->folder.height - 1;
points[1].x = fc->folder.x;
points[1].y = fc->folder.y + fc->folder.height - cd - st;
points[2].x = fc->folder.x + cd + st - 1;
points[2].y = fc->folder.y + fc->folder.height - cd - st;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
points[0].x = rightOff - points[0].x;
points[1].x = rightOff - points[1].x;
points[2].x = rightOff - points[2].x;
}
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
x = fc->folder.x + fc->folder.width - cd - st;
else
x = fc->folder.x;
SetGC(f, GC_BLANK);
XFillRectangle(dpy, win, f->folder.gc, x, fc->folder.y +
fc->folder.height - cd - st, cd + st, cd + st);
SetGC(f, GC_UNSET);
SetGC(f, GC_SHADOWBOT);
XFillPolygon(dpy, win, f->folder.gc, points, 3, Nonconvex,
CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
SetGC(f, GC_UNSET);
if (w == f->folder.activeW)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
points[0].y -= st;
points[1].x += st;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
points[1].x -= st * 2;
XFillPolygon(dpy, win, f->folder.gc, points, 3, Nonconvex,
CoordModeOrigin);
points[3].x = points[0].x;
points[3].y = points[0].y;
XDrawLines(dpy, win, f->folder.gc, points, 4, CoordModeOrigin);
}
static void
DrawTabShadowNoneTopBottom(XmLFolderWidget f,
Widget w)
{
XmLFolderConstraintRec *fc;
Display *dpy;
Window win;
XSegment *topSeg, *botSeg;
int i, st, botOff, tCount, bCount;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(w->core.constraints);
botOff = 2 * fc->folder.y + fc->folder.height - 1;
st = f->manager.shadow_thickness;
if (!st)
return;
tCount = 0;
bCount = 0;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
for (i = 0; i < st; i++)
{
/* left tab shadow */
topSeg[tCount].x1 = fc->folder.x + i;
topSeg[tCount].y1 = fc->folder.y + i;
topSeg[tCount].x2 = fc->folder.x + i;
topSeg[tCount].y2 = fc->folder.y + fc->folder.height - 1;
if (w == f->folder.activeW)
topSeg[tCount].y2 += i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
topSeg[tCount].y1 = botOff - topSeg[tCount].y1;
topSeg[tCount].y2 = botOff - topSeg[tCount].y2;
}
tCount++;
/* right tab shadow */
botSeg[bCount].x1 = fc->folder.x + fc->folder.width - 1 - i;
botSeg[bCount].y1 = fc->folder.y + i;
botSeg[bCount].x2 = fc->folder.x + fc->folder.width - 1 - i;
botSeg[bCount].y2 = fc->folder.y + fc->folder.height - 1;
if (w == f->folder.activeW)
botSeg[bCount].y2 += i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
botSeg[bCount].y1 = botOff - botSeg[bCount].y1;
botSeg[bCount].y2 = botOff - botSeg[bCount].y2;
}
bCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
tCount = 0;
for (i = 0; i < st; i++)
{
/* top tab shadow */
topSeg[tCount].x1 = fc->folder.x + i + 1;
topSeg[tCount].y1 = fc->folder.y + i;
topSeg[tCount].x2 = fc->folder.x + fc->folder.width - i - 1;
topSeg[tCount].y2 = fc->folder.y + i;
if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
topSeg[tCount].y1 = botOff - topSeg[tCount].y1;
topSeg[tCount].y2 = botOff - topSeg[tCount].y2;
}
tCount++;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_TOP)
SetGC(f, GC_SHADOWTOP);
else
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
}
static void
DrawTabShadowNoneLeftRight(XmLFolderWidget f,
Widget w)
{
XmLFolderConstraintRec *fc;
Display *dpy;
Window win;
XSegment *topSeg, *botSeg;
int i, st, rightOff, tCount, bCount;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(w->core.constraints);
rightOff = 2 * fc->folder.x + fc->folder.width - 1;
st = f->manager.shadow_thickness;
if (!st)
return;
tCount = 0;
bCount = 0;
topSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
botSeg = (XSegment *)malloc(sizeof(XSegment) * st * 2);
for (i = 0; i < st; i++)
{
/* bottom tab shadow */
topSeg[tCount].x1 = fc->folder.x + i;
topSeg[tCount].y1 = fc->folder.y + i;
topSeg[tCount].x2 = fc->folder.x + fc->folder.width - 1;
if (w == f->folder.activeW)
topSeg[tCount].x2 += i;
topSeg[tCount].y2 = fc->folder.y + i;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
topSeg[tCount].x1 = rightOff - topSeg[tCount].x1;
topSeg[tCount].x2 = rightOff - topSeg[tCount].x2;
}
tCount++;
/* top tab shadow */
botSeg[bCount].x1 = fc->folder.x + i;
botSeg[bCount].y1 = fc->folder.y + fc->folder.height - i - 1;
botSeg[bCount].x2 = fc->folder.x + fc->folder.width - 1;
if (w == f->folder.activeW)
botSeg[bCount].x2 += i;
botSeg[bCount].y2 = fc->folder.y + fc->folder.height - i - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
botSeg[bCount].x1 = rightOff - botSeg[bCount].x1;
botSeg[bCount].x2 = rightOff - botSeg[bCount].x2;
}
bCount++;
}
if (tCount)
{
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
if (bCount)
{
SetGC(f, GC_SHADOWBOT);
XDrawSegments(dpy, win, f->folder.gc, botSeg, bCount);
SetGC(f, GC_UNSET);
}
tCount = 0;
for (i = 0; i < st; i++)
{
/* left tab shadow */
topSeg[tCount].x1 = fc->folder.x + i;
topSeg[tCount].y1 = fc->folder.y + i + 1;
topSeg[tCount].x2 = fc->folder.x + i;
topSeg[tCount].y2 = fc->folder.y + fc->folder.height - i - 1;
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
{
topSeg[tCount].x1 = rightOff - topSeg[tCount].x1;
topSeg[tCount].x2 = rightOff - topSeg[tCount].x2;
}
tCount++;
}
if (tCount)
{
if (f->folder.tabPlacement == XmFOLDER_RIGHT)
SetGC(f, GC_SHADOWBOT);
else
SetGC(f, GC_SHADOWTOP);
XDrawSegments(dpy, win, f->folder.gc, topSeg, tCount);
SetGC(f, GC_UNSET);
}
free((char *)topSeg);
free((char *)botSeg);
}
static void
SetGC(XmLFolderWidget f,
int type)
{
Display *dpy;
XGCValues values;
XtGCMask mask;
dpy = XtDisplay(f);
if (type == GC_SHADOWBOT)
{
mask = GCForeground;
values.foreground = f->manager.bottom_shadow_color;
if (f->manager.bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)
{
mask |= GCFillStyle | GCTile;
values.fill_style = FillTiled;
values.tile = f->manager.bottom_shadow_pixmap;
}
XChangeGC(dpy, f->folder.gc, mask, &values);
}
else if (type == GC_SHADOWTOP)
{
mask = GCForeground;
values.foreground = f->manager.top_shadow_color;
if (f->manager.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)
{
mask |= GCFillStyle | GCTile;
values.fill_style = FillTiled;
values.tile = f->manager.top_shadow_pixmap;
}
XChangeGC(dpy, f->folder.gc, mask, &values);
}
else if (type == GC_BLANK)
{
mask = GCForeground;
values.foreground = f->folder.blankBg;
if (f->folder.blankPix != XmUNSPECIFIED_PIXMAP)
{
mask |= GCFillStyle | GCTile;
values.fill_style = FillTiled;
values.tile = f->folder.blankPix;
}
XChangeGC(dpy, f->folder.gc, mask, &values);
}
else
{
mask = GCFillStyle;
values.fill_style = FillSolid;
XChangeGC(dpy, f->folder.gc, mask, &values);
}
}
static void
DrawTabHighlight(XmLFolderWidget f,
Widget w)
{
XmLFolderConstraintRec *fc;
Display *dpy;
Window win;
int ht;
if (!XtIsRealized(w))
return;
if (!f->core.visible)
return;
dpy = XtDisplay(f);
win = XtWindow(f);
fc = (XmLFolderConstraintRec *)(w->core.constraints);
ht = f->folder.highlightThickness;
if (f->folder.focusW == w)
XSetForeground(dpy, f->folder.gc, f->manager.highlight_color);
else
{
if (f->folder.activeW == w)
XSetForeground(dpy, f->folder.gc, f->core.background_pixel);
else
XSetForeground(dpy, f->folder.gc, f->folder.inactiveBg);
}
XFillRectangle(dpy, win, f->folder.gc,
w->core.x - ht, w->core.y - ht,
XtWidth(w) + w->core.border_width * 2 + ht * 2,
XtHeight(w) + w->core.border_width * 2 + ht * 2);
}
static void
SetTabPlacement(XmLFolderWidget f,
Widget tab)
{
if (!XmIsDrawnButton(tab))
return;
if (f->folder.allowRotate == True &&
f->folder.tabPlacement == XmFOLDER_LEFT)
XmLDrawnButtonSetType(tab, XmDRAWNB_STRING, XmDRAWNB_UP);
else if (f->folder.allowRotate == True &&
f->folder.tabPlacement == XmFOLDER_RIGHT)
XmLDrawnButtonSetType(tab, XmDRAWNB_STRING, XmDRAWNB_DOWN);
else
XmLDrawnButtonSetType(tab, XmDRAWNB_STRING, XmDRAWNB_RIGHT);
if (XtIsRealized(tab))
XClearArea(XtDisplay(tab), XtWindow(tab), 0, 0, 0, 0, True);
}
static void
GetTabRect(XmLFolderWidget f,
Widget tab,
XRectangle *rect,
int includeShadow)
{
XmLFolderConstraintRec *fc;
int st;
st = f->manager.shadow_thickness;
fc = (XmLFolderConstraintRec *)(tab->core.constraints);
rect->x = fc->folder.x;
rect->y = fc->folder.y;
rect->width = fc->folder.width;
rect->height = fc->folder.height;
if (includeShadow)
{
if (f->folder.tabPlacement == XmFOLDER_TOP)
rect->height += st;
else if (f->folder.tabPlacement == XmFOLDER_BOTTOM)
{
rect->y -= st;
rect->height += st;
}
else if (f->folder.tabPlacement == XmFOLDER_LEFT)
rect->width += st;
else
{
rect->x -= st;
rect->width += st;
}
}
}
static void
SetActiveTab(XmLFolderWidget f,
Widget w,
XEvent *event,
Boolean notify)
{
XmLFolderCallbackStruct cbs;
XmLFolderConstraintRec *fc, *cfc;
int i, j, pos;
Display *dpy;
Window win;
Widget activeW, child, mw, managedW;
WidgetList children;
XRectangle rect;
char *name, buf[256];
win = (Window)NULL;
if (f->folder.activeW == w)
return;
dpy = 0;
if (XtIsRealized((Widget)f) && f->core.visible)
{
dpy = XtDisplay(f);
win = XtWindow(f);
}
pos = -1;
for (i = 0; i < f->folder.tabCount; i++)
if (w == f->folder.tabs[i])
pos = i;
cbs.allowActivate = 1;
cbs.layoutNeeded = 0;
if (notify == True)
{
if (f->folder.debugLevel)
fprintf(stderr, "XmLFolder: activated %d\n", pos);
cbs.reason = XmCR_ACTIVATE;
cbs.event = event;
cbs.pos = pos;
XtCallCallbackList((Widget)f, f->folder.activateCallback, &cbs);
}
if (!cbs.allowActivate)
return;
/* redraw current active tab */
activeW = f->folder.activeW;
if (activeW && dpy)
{
GetTabRect(f, activeW, &rect, 1);
XClearArea(dpy, win, rect.x, rect.y, rect.width,
rect.height, True);
}
f->folder.activeTab = pos;
f->folder.activeW = w;
if (!w)
return;
/* Not sure this needs to be in the 3.0 (Microline) stuff */
PrimFocusIn(w, NULL, NULL, NULL);
/* if we selected a tab not in active row - move row into place */
if (f->folder.tabsPerRow)
{
fc = (XmLFolderConstraintRec *)(w->core.constraints);
if (fc->folder.row != f->folder.activeRow)
Layout(f, False);
}
/* manage this tabs managed widget if it exists */
children = f->composite.children;
f->folder.allowLayout = 0;
for (i = 0; i < f->composite.num_children; i++)
{
child = children[i];
if (!XtIsSubclass(child, xmPrimitiveWidgetClass))
continue;
fc = (XmLFolderConstraintRec *)(child->core.constraints);
managedW = 0;
if (fc->folder.managedName)
{
for (j = 0; j < f->composite.num_children; j++)
{
mw = children[j];
if (XtIsSubclass(mw, xmPrimitiveWidgetClass))
continue;
name = XtName(mw);
if (name && !strcmp(name, fc->folder.managedName))
managedW = mw;
cfc = (XmLFolderConstraintRec *)(mw->core.constraints);
name = cfc->folder.managedName;
if (name && !strcmp(name, fc->folder.managedName))
managedW = mw;
}
if (!managedW)
{
sprintf(buf, "SetActiveTab() - managed widget named ");
strcat(buf, fc->folder.managedName);
strcat(buf, " not found");
XmLWarning(child, buf);
}
}
else
managedW = fc->folder.managedW;
if (managedW)
{
if (w == child && !XtIsManaged(managedW))
XtManageChild(managedW);
if (w != child && XtIsManaged(managedW))
XtUnmanageChild(managedW);
}
}
f->folder.allowLayout = 1;
/* redraw new active tab */
if (dpy)
{
GetTabRect(f, w, &rect, 1);
XClearArea(dpy, win, rect.x, rect.y, rect.width, rect.height, True);
XmProcessTraversal(w, XmTRAVERSE_CURRENT);
}
if (cbs.layoutNeeded)
Layout(f, 0);
}
/*
Utility
*/
static void
GetCoreBackground(Widget w,
int offset,
XrmValue *value)
{
value->addr = (caddr_t)&w->core.background_pixel;
}
static void
GetDefaultTabWidgetClass(Widget w,
int offset,
XrmValue *value)
{
value->addr = (caddr_t)&xmDrawnButtonWidgetClass;
}
static void
GetManagerForeground(Widget w,
int offset,
XrmValue *value)
{
XmLFolderWidget f;
f = (XmLFolderWidget)w;
value->addr = (caddr_t)&f->manager.foreground;
}
static Boolean
ServerDrawsArcsLarge(Display *dpy,
int debug)
{
Pixmap pixmap;
XImage *image;
Window root;
long pixel;
int x, y, width, height, result;
GC gc;
root = DefaultRootWindow(dpy);
width = 5;
height = 5;
pixmap = XCreatePixmap(dpy, root, width, height, 1);
gc = XCreateGC(dpy, pixmap, 0L, NULL);
XSetForeground(dpy, gc, 0L);
XFillRectangle(dpy, pixmap, gc, 0, 0, width, height);
XSetForeground(dpy, gc, 1L);
XDrawArc(dpy, pixmap, gc, 0, 0, width, height, 0, 360 * 64);
image = XGetImage(dpy, pixmap, 0, 0, width, height, AllPlanes, ZPixmap);
if (debug)
{
fprintf(stderr, "Test X server drawn arc (%d by %d):\n",
width, height);
for (y = 0; y < height; y++)
{
fprintf(stderr, " ");
for (x = 0; x < width; x++)
{
pixel = XGetPixel(image, x, y);
if (pixel == 0L)
fprintf(stderr, ".");
else
fprintf(stderr, "X");
}
fprintf(stderr, "\n");
}
}
if (XGetPixel(image, width - 1, height / 2) != 1L)
{
result = 1;
if (debug)
fprintf(stderr, "X Server Draws Arcs 1 Pixel Large\n");
}
else
{
result = 0;
if (debug)
fprintf(stderr, "X Server Draws Arcs Within Bounds\n");
}
XDestroyImage(image);
XFreeGC(dpy, gc);
XFreePixmap(dpy, pixmap);
return result;
}
/*
Getting and Setting Values
*/
static Boolean
SetValues(Widget curW,
Widget reqW,
Widget newW,
ArgList args,
Cardinal *narg)
{
XmLFolderWidget f;
XmLFolderWidget cur;
int i;
Boolean needsLayout, needsRedisplay;
f = (XmLFolderWidget)newW;
cur = (XmLFolderWidget)curW;
needsLayout = False;
needsRedisplay = False;
#define NE(value) (f->value != cur->value)
if (NE(folder.tabBarHeight))
{
XmLWarning((Widget)f, "SetValues() - can't set tabBarHeight");
f->folder.tabBarHeight = cur->folder.tabBarHeight;
}
if (NE(folder.tabCount))
{
XmLWarning((Widget)f, "SetValues() - can't set tabCount");
f->folder.tabCount = cur->folder.tabCount;
}
if (NE(folder.activeTab))
{
XmLWarning((Widget)f, "SetValues() - can't set activeTab");
f->folder.activeTab = cur->folder.activeTab;
}
if (f->folder.cornerDimension < 1)
{
XmLWarning((Widget)f, "SetValues() - cornerDimension can't be < 1");
f->folder.cornerDimension = cur->folder.cornerDimension;
}
if (NE(folder.tabPlacement) ||
NE(folder.allowRotate))
{
f->folder.allowLayout = 0;
for (i = 0; i < f->folder.tabCount; i++)
SetTabPlacement(f, f->folder.tabs[i]);
f->folder.allowLayout = 1;
needsLayout = True;
}
if (NE(folder.inactiveBg) ||
NE(folder.blankBg) ||
NE(folder.blankPix) ||
NE(folder.inactiveFg))
needsRedisplay = True;
if (NE(folder.cornerDimension) ||
NE(folder.cornerStyle) ||
NE(folder.highlightThickness) ||
NE(folder.marginHeight) ||
NE(folder.marginWidth) ||
NE(folder.pixmapMargin) ||
NE(manager.shadow_thickness) ||
NE(folder.tabsPerRow) ||
NE(folder.spacing))
needsLayout = True;
if (NE(folder.fontList))
{
XmFontListFree(cur->folder.fontList);
CopyFontList(f);
}
#undef NE
if (needsLayout == True)
Layout(f, 1);
return needsRedisplay;
}
static void
CopyFontList(XmLFolderWidget f)
{
if (!f->folder.fontList)
f->folder.fontList = XmLFontListCopyDefault((Widget)f);
else
f->folder.fontList = XmFontListCopy(f->folder.fontList);
if (!f->folder.fontList)
XmLWarning((Widget)f, "- fatal error - font list NULL");
}
static Boolean
ConstraintSetValues(Widget curW,
Widget reqW,
Widget newW,
ArgList args,
Cardinal *narg)
{
XmLFolderConstraintRec *cons, *curCons;
XmLFolderWidget f;
int i, hasLabelChange;
f = (XmLFolderWidget)XtParent(newW);
if (!XtIsRectObj(newW))
return False;
cons = (XmLFolderConstraintRec *)newW->core.constraints;
curCons = (XmLFolderConstraintRec *)curW->core.constraints;
#define NE(value) (cons->value != curCons->value)
if (NE(folder.managedName))
{
if (curCons->folder.managedName)
free((char *)curCons->folder.managedName);
if (cons->folder.managedName)
cons->folder.managedName = (char *)strdup(cons->folder.managedName);
}
#undef NE
hasLabelChange = 0;
if (XtIsSubclass(newW, xmPrimitiveWidgetClass))
{
for (i = 0; i < *narg; i++)
if (args[i].name && !strcmp(args[i].name, XmNlabelString))
hasLabelChange = 1;
if (hasLabelChange &&
(f->folder.tabPlacement == XmFOLDER_LEFT ||
f->folder.tabPlacement == XmFOLDER_RIGHT))
{
f->folder.allowLayout = 0;
for (i = 0; i < f->folder.tabCount; i++)
SetTabPlacement(f, f->folder.tabs[i]);
f->folder.allowLayout = 1;
}
}
if (hasLabelChange ||
curCons->folder.pix != cons->folder.pix ||
curCons->folder.inactPix != cons->folder.inactPix)
Layout((XmLFolderWidget)XtParent(curW), 1);
return False;
}
static Boolean
CvtStringToCornerStyle(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "CORNER_NONE", XmCORNER_NONE },
{ "CORNER_LINE", XmCORNER_LINE },
{ "CORNER_ARC", XmCORNER_ARC },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRCornerStyle", map, fromVal, toVal);
}
static Boolean
CvtStringToFolderResizePolicy(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "RESIZE_NONE", XmRESIZE_NONE },
{ "RESIZE_STATIC", XmRESIZE_STATIC },
{ "RESIZE_DYNAMIC", XmRESIZE_DYNAMIC },
{ "RESIZE_PACK", XmRESIZE_PACK },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRFolderResizePolicy", map,
fromVal, toVal);
}
static Boolean
CvtStringToTabPlacement(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "FOLDER_TOP", XmFOLDER_TOP },
{ "FOLDER_LEFT", XmFOLDER_LEFT },
{ "FOLDER_BOTTOM", XmFOLDER_BOTTOM },
{ "FOLDER_RIGHT", XmFOLDER_RIGHT },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRTabPlacement", map, fromVal, toVal);
}
/*
Actions, Callbacks and Handlers
*/
static void
Activate(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLFolderWidget f;
XButtonEvent *be;
XRectangle rect;
Widget tab;
int i;
f = (XmLFolderWidget)w;
if (!event || event->type != ButtonPress)
return;
be = (XButtonEvent *)event;
if (f->folder.debugLevel)
fprintf(stderr, "XmLFolder: ButtonPress %d %d\n", be->x, be->y);
for (i = 0; i < f->folder.tabCount; i++)
{
tab = f->folder.tabs[i];
if (!XtIsManaged(tab) || !XtIsSensitive(tab))
continue;
GetTabRect(f, tab, &rect, 0);
if (be->x > rect.x && be->x < rect.x + (int)rect.width &&
be->y > rect.y && be->y < rect.y + (int)rect.height)
{
if (f->folder.debugLevel)
fprintf(stderr, "XmLFolder: Pressed tab %d\n", i);
SetActiveTab(f, tab, event, True);
return;
}
}
}
static void
PrimActivate(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLFolderWidget f;
XmAnyCallbackStruct *cbs;
f = (XmLFolderWidget)XtParent(w);
cbs = (XmAnyCallbackStruct *)callData;
SetActiveTab(f, w, cbs->event, True);
}
static void
PrimFocusIn(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLFolderWidget f;
Widget prevW;
f = (XmLFolderWidget)XtParent(w);
prevW = f->folder.focusW;
f->folder.focusW = w;
DrawTabHighlight(f, w);
if (prevW)
DrawTabHighlight(f, prevW);
XmProcessTraversal(w, XmTRAVERSE_CURRENT);
}
static void
PrimFocusOut(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLFolderWidget f;
Widget prevW;
f = (XmLFolderWidget)XtParent(w);
prevW = f->folder.focusW;
f->folder.focusW = 0;
if (prevW)
DrawTabHighlight(f, prevW);
DrawTabHighlight(f, w);
}
/*
Public Functions
*/
Widget
XmLCreateFolder(Widget parent,
char *name,
ArgList arglist,
Cardinal argcount)
{
return XtCreateWidget(name, xmlFolderWidgetClass, parent,
arglist, argcount);
}
Widget
XmLFolderAddBitmapTab(Widget w,
XmString string,
char *bitmapBits,
int bitmapWidth,
int bitmapHeight)
{
XmLFolderWidget f;
Widget tab;
Pixmap pix, inactPix;
Window root;
Display *dpy;
int depth;
char name[20];
if (!XmLIsFolder(w))
{
XmLWarning(w, "AddBitmapTab() - widget not a XmLFolder");
return 0;
}
f = (XmLFolderWidget)w;
dpy = XtDisplay(w);
root = DefaultRootWindow(dpy);
depth = DefaultDepthOfScreen(XtScreen(w));
pix = XCreatePixmapFromBitmapData(dpy, root, bitmapBits,
bitmapWidth, bitmapHeight, f->manager.foreground,
f->core.background_pixel, depth);
inactPix = XCreatePixmapFromBitmapData(dpy, root, bitmapBits,
bitmapWidth, bitmapHeight, f->folder.inactiveFg,
f->folder.inactiveBg, depth);
sprintf(name, "tab%d", f->folder.tabCount);
tab = XtVaCreateManagedWidget(name,
f->folder.tabWidgetClass, w,
XmNfontList, f->folder.fontList,
XmNmarginWidth, 0,
XmNmarginHeight, 0,
XmNlabelString, string,
XmNtabPixmap, pix,
XmNtabInactivePixmap, inactPix,
XmNtabFreePixmaps, True,
NULL);
return tab;
}
Widget
XmLFolderAddBitmapTabForm(Widget w,
XmString string,
char *bitmapBits,
int bitmapWidth,
int bitmapHeight)
{
Widget form, tab;
XmLFolderWidget f;
char name[20];
if (!XmLIsFolder(w))
{
XmLWarning(w, "AddBitmapTabForm() - widget not a XmLFolder");
return 0;
}
f = (XmLFolderWidget)w;
tab = XmLFolderAddBitmapTab(w, string, bitmapBits,
bitmapWidth, bitmapHeight);
sprintf(name, "form%d", f->folder.tabCount);
form = XtVaCreateManagedWidget(name,
xmFormWidgetClass, w,
XmNbackground, f->core.background_pixel,
NULL);
XtVaSetValues(tab, XmNtabManagedWidget, form, NULL);
return form;
}
Widget
XmLFolderAddTab(Widget w,
XmString string)
{
Widget tab;
XmLFolderWidget f;
char name[20];
if (!XmLIsFolder(w))
{
XmLWarning(w, "AddTab() - widget not a XmLFolder");
return 0;
}
f = (XmLFolderWidget)w;
sprintf(name, "tab%d", f->folder.tabCount);
tab = XtVaCreateManagedWidget(name,
f->folder.tabWidgetClass, w,
XmNfontList, f->folder.fontList,
XmNmarginWidth, 0,
XmNmarginHeight, 0,
XmNlabelString, string,
NULL);
return tab;
}
Widget
XmLFolderAddTabFromClass(Widget w,
XmString string)
{
Widget tab;
XmLFolderWidget f;
char name[20];
if (!XmLIsFolder(w))
{
XmLWarning(w, "AddTab() - widget not a XmLFolder");
return 0;
}
f = (XmLFolderWidget)w;
sprintf(name, "tab%d", f->folder.tabCount);
tab = XtVaCreateManagedWidget(name,
f->folder.tabWidgetClass,
/* xmDrawnButtonWidgetClass, */
w,
XmNfontList, f->folder.fontList,
/* XmNmarginWidth, 0, */
/* XmNmarginHeight, 0, */
XmNlabelString, string,
NULL);
return tab;
}
Widget
XmLFolderAddTabForm(Widget w,
XmString string)
{
Widget form, tab;
XmLFolderWidget f;
char name[20];
if (!XmLIsFolder(w))
{
XmLWarning(w, "AddBitmapTabForm() - widget not a XmLFolder");
return 0;
}
f = (XmLFolderWidget)w;
tab = XmLFolderAddTab(w, string);
sprintf(name, "form%d", f->folder.tabCount);
form = XtVaCreateManagedWidget(name,
xmFormWidgetClass, w,
XmNbackground, f->core.background_pixel,
NULL);
XtVaSetValues(tab, XmNtabManagedWidget, form, NULL);
return form;
}
void
XmLFolderSetActiveTab(Widget w,
int position,
Boolean notify)
{
XmLFolderWidget f;
if (!XmLIsFolder(w))
{
XmLWarning(w, "SetActiveTab() - widget not a XmLFolder");
return;
}
f = (XmLFolderWidget)w;
if (position < 0 || position >= f->folder.tabCount)
{
XmLWarning(w, "SetActiveTab() - invalid position");
return;
}
SetActiveTab(f, f->folder.tabs[position], 0, notify);
}
nedit-5.6.orig/Microline/XmL/Folder.h0000644000175000017500000000653010245647600016127 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLFolderH
#define XmLFolderH
#include "XmL.h"
#ifdef XmL_CPP
extern "C" {
#endif
extern WidgetClass xmlFolderWidgetClass;
typedef struct _XmLFolderClassRec *XmLFolderWidgetClass;
typedef struct _XmLFolderRec *XmLFolderWidget;
#define XmLIsFolder(w) XtIsSubclass((w), xmlFolderWidgetClass)
Widget XmLCreateFolder(Widget parent, char *name, ArgList arglist,
Cardinal argcount);
Widget XmLFolderAddBitmapTab(Widget w, XmString string,
char *bitmapBits, int bitmapWidth, int bitmapHeight);
Widget XmLFolderAddBitmapTabForm(Widget w, XmString string,
char *bitmapBits, int bitmapWidth, int bitmapHeight);
Widget XmLFolderAddTab(Widget w, XmString string);
Widget XmLFolderAddTabFromClass(Widget w, XmString string);
Widget XmLFolderAddTabForm(Widget w, XmString string);
void XmLFolderSetActiveTab(Widget w, int position, Boolean notify);
#ifdef XmL_CPP
}
#endif
#endif
nedit-5.6.orig/Microline/XmL/FolderP.h0000644000175000017500000001044110107542711016235 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLFolderPH
#define XmLFolderPH
#include
#ifdef MOTIF11
#else
#include
#endif
#include "Folder.h"
typedef struct _XmLFolderPart
{
int debugLevel;
Boolean serverDrawsArcsLarge;
unsigned char cornerStyle, tabPlacement, resizePolicy;
Boolean allowRotate, autoSelect;
GC gc;
Pixel inactiveBg, inactiveFg, blankBg;
Pixmap blankPix;
WidgetList tabs;
int tabCount, tabAllocCount;
Dimension marginWidth, marginHeight, spacing;
Dimension cornerDimension, highlightThickness;
Dimension pixmapMargin;
Dimension tabHeight, tabWidth, tabBarHeight;
Dimension minTabWidth, maxTabWidth;
int tabsPerRow, activeRow;
XtTranslations primTrans;
Widget focusW, activeW;
int activeTab;
char allowLayout;
XtCallbackList activateCallback;
XmFontList fontList;
WidgetClass tabWidgetClass;
} XmLFolderPart;
typedef struct _XmLFolderRec
{
CorePart core;
CompositePart composite;
ConstraintPart constraint;
XmManagerPart manager;
XmLFolderPart folder;
} XmLFolderRec;
typedef struct _XmLFolderClassPart
{
int unused;
} XmLFolderClassPart;
typedef struct _XmLFolderClassRec
{
CoreClassPart core_class;
CompositeClassPart composite_class;
ConstraintClassPart constraint_class;
XmManagerClassPart manager_class;
XmLFolderClassPart folder_class;
} XmLFolderClassRec;
extern XmLFolderClassRec xmlFolderClassRec;
typedef struct _XmLFolderConstraintPart
{
Position x, y;
Dimension width, height;
Dimension maxPixWidth, maxPixHeight;
Dimension pixWidth, pixHeight;
Dimension inactPixWidth, inactPixHeight;
int row;
Boolean firstInRow;
Boolean freePix;
Pixmap pix, inactPix;
char *managedName;
Widget managedW;
} XmLFolderConstraintPart;
typedef struct _XmLFolderConstraintRec
{
XmManagerConstraintPart manager;
XmLFolderConstraintPart folder;
} XmLFolderConstraintRec, *XmLFolderConstraintPtr;
#endif
nedit-5.6.orig/Microline/XmL/Grid.c0000644000175000017500000107067310077552125015606 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#include "GridP.h"
#include
#include
#include
#include
#ifndef MOTIF11
#include
#endif
#include
#include
#include
#include
#ifdef SUNOS4
int fprintf(FILE *, char *, ...);
int fseek(FILE *, long, int);
int fread(char *, int, int, FILE *);
#endif
/* Create and Destroy */
static void ClassInitialize(void);
static void ClassPartInitialize(WidgetClass wc);
static void Initialize(Widget req, Widget newW, ArgList args, Cardinal *nargs);
static void Destroy(Widget w);
/* Geometry, Drawing, Entry and Picking */
static void Realize(Widget w, XtValueMask *valueMask,
XSetWindowAttributes *attr);
static void Redisplay(Widget w, XExposeEvent *event, Region region);
static void DrawResizeLine(XmLGridWidget g, int xy, int erase);
static void DrawXORRect(XmLGridWidget g, int xy, int size,
int isVert, int erase);
static void DefineCursor(XmLGridWidget g, char defineCursor);
static void DrawArea(XmLGridWidget g, int type, int row, int col);
static void ExtendSelectRange(XmLGridWidget g, int *type,
int *fr, int *lr, int *fc, int *lc);
static void ExtendSelect(XmLGridWidget g, XEvent *event, Boolean set,
int row, int col);
static void SelectTypeArea(XmLGridWidget g, int type, XEvent *event,
int row, int col, Boolean select, Boolean notify);
static int GetSelectedArea(XmLGridWidget g, int type, int *rowPos,
int *colPos, int count);
static void ChangeManaged(Widget w);
static void Resize(Widget w);
static void PlaceScrollbars(XmLGridWidget w);
static void VertLayout(XmLGridWidget g, int resizeIfNeeded);
static void HorizLayout(XmLGridWidget g, int resizeIfNeeded);
static void ApplyVisibleRows(XmLGridWidget g);
static void ApplyVisibleCols(XmLGridWidget g);
static void VisPosChanged(XmLGridWidget g, int isVert);
static void RecalcVisPos(XmLGridWidget g, int isVert);
static int PosToVisPos(XmLGridWidget g, int pos, int isVert);
static int VisPosToPos(XmLGridWidget g, int visPos, int isVert);
static unsigned char ColPosToType(XmLGridWidget g, int pos);
static int ColPosToTypePos(XmLGridWidget g, unsigned char type, int pos);
static unsigned char RowPosToType(XmLGridWidget g, int pos);
static int RowPosToTypePos(XmLGridWidget g, unsigned char type, int pos);
static int ColTypePosToPos(XmLGridWidget g, unsigned char type,
int pos, int allowNeg);
static int RowTypePosToPos(XmLGridWidget g, unsigned char type,
int pos, int allowNeg);
static int ScrollRowBottomPos(XmLGridWidget g, int row);
static int ScrollColRightPos(XmLGridWidget g, int col);
static int PosIsResize(XmLGridWidget g, int x, int y,
int *row, int *col, int *isVert);
static int XYToRowCol(XmLGridWidget g, int x, int y, int *row, int *col);
static int RowColToXY(XmLGridWidget g, int row, int col,
Boolean clipped, XRectangle *rect);
static int RowColFirstSpan(XmLGridWidget g, int row, int col,
int *spanRow, int *spanCol, XRectangle *rect, Boolean lookLeft,
Boolean lookUp);
static void RowColSpanRect(XmLGridWidget g, int row, int col, XRectangle *rect);
static XmLGridCell GetCell(XmLGridWidget g, int row, int col);
static int GetColWidth(XmLGridWidget g, int col);
static int GetRowHeight(XmLGridWidget g, int row);
static int ColIsVisible(XmLGridWidget g, int col);
static int RowIsVisible(XmLGridWidget g, int row);
static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *request,
XtWidgetGeometry *);
static void ScrollCB(Widget w, XtPointer, XtPointer);
static int FindNextFocus(XmLGridWidget g, int row, int col,
int rowDir, int colDir, int *nextRow, int *nextCol);
static int SetFocus(XmLGridWidget g, int row, int col, int rowDir, int colDir);
static void ChangeFocus(XmLGridWidget g, int row, int col);
static void MakeColVisible(XmLGridWidget g, int col);
static void MakeRowVisible(XmLGridWidget g, int row);
static void TextAction(XmLGridWidget g, int action);
/* Getting and Setting Values */
static void GetSubValues(Widget w, ArgList args, Cardinal *nargs);
static void SetSubValues(Widget w, ArgList args, Cardinal *nargs);
static Boolean SetValues(Widget curW, Widget, Widget newW,
ArgList args, Cardinal *nargs);
static void CopyFontList(XmLGridWidget g);
static Boolean CvtStringToSizePolicy(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static Boolean CvtStringToSelectionPolicy(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static Boolean CvtStringToRowColType(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static Boolean CvtStringToCellAlignment(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static Boolean CvtStringToCellType(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static Boolean CvtStringToCellBorderType(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static void SetSimpleHeadings(XmLGridWidget g, char *data);
static void SetSimpleWidths(XmLGridWidget g, char *data);
/* Getting and Setting Row Values */
static void GetRowValueMask(XmLGridWidget g, char *s, long *mask);
static void _GetRowValueMask(XmLGridWidget g, char *s, long *mask);
static void GetRowValue(XmLGridWidget g, XmLGridRow row,
XtArgVal value, long mask);
static void _GetRowValue(XmLGridWidget g, XmLGridRow row,
XtArgVal value, long mask);
static int SetRowValues(XmLGridWidget g, XmLGridRow row, long mask);
static int _SetRowValues(XmLGridWidget g, XmLGridRow row, long mask);
/* Getting and Setting Column Values */
static void GetColumnValueMask(XmLGridWidget g, char *s, long *mask);
static void _GetColumnValueMask(XmLGridWidget g, char *s, long *mask);
static void GetColumnValue(XmLGridWidget g, XmLGridColumn col,
XtArgVal value, long mask);
static void _GetColumnValue(XmLGridWidget g, XmLGridColumn col,
XtArgVal value, long mask);
static int SetColumnValues(XmLGridWidget g, XmLGridColumn col, long mask);
static int _SetColumnValues(XmLGridWidget g, XmLGridColumn col, long mask);
/* Getting and Setting Cell Values */
static void CellValueGetMask(char *s, long *mask);
static void GetCellValue(XmLGridCell cell, XtArgVal value, long mask);
static XmLGridCellRefValues *CellRefValuesCreate(XmLGridWidget g,
XmLGridCellRefValues *copy);
static void SetCellValuesPreprocess(XmLGridWidget g, long mask);
static int SetCellHasRefValues(long mask);
static int SetCellValuesResize(XmLGridWidget g, XmLGridRow row,
XmLGridColumn col, XmLGridCell cell, long mask);
static int _SetCellValuesResize(XmLGridWidget g, XmLGridRow row,
XmLGridColumn col, XmLGridCell cell, long mask);
static void SetCellValues(XmLGridWidget g, XmLGridCell cell, long mask);
static void SetCellRefValues(XmLGridWidget g, XmLGridCellRefValues *values,
long mask);
static int SetCellRefValuesCompare(void *, void **, void **);
static void SetCellRefValuesPreprocess(XmLGridWidget g, int row, int col,
XmLGridCell cell, long mask);
/* Read, Write, Copy, Paste */
static int Read(XmLGridWidget g, int format, char delimiter,
int row, int col, char *data);
static void Write(XmLGridWidget g, FILE *file, int format, char delimiter,
Boolean skipHidden, int row, int col, int nrow, int ncol);
static char *CopyDataCreate(XmLGridWidget g, int selected, int row, int col,
int nrow, int ncol);
static Boolean Copy(XmLGridWidget g, Time time, int selected,
int row, int col, int nrow, int ncol);
static Boolean Paste(XmLGridWidget g, int row, int col);
/* Utility */
static void GetCoreBackground(Widget w, int, XrmValue *value);
static void GetManagerForeground(Widget w, int, XrmValue *value);
static void ClipRectToReg(XmLGridWidget g, XRectangle *rect, GridReg *reg);
static char *FileToString(FILE *file);
static char *CvtXmStringToStr(XmString str);
static XmLGridWidget WidgetToGrid(Widget w, char *funcname);
/* Actions, Callbacks and Handlers */
static void ButtonMotion(Widget w, XEvent *event, String *, Cardinal *);
static void DragTimer(XtPointer, XtIntervalId *);
static void CursorMotion(Widget w, XEvent *event, String *, Cardinal *);
static void Edit(Widget w, XEvent *event, String *, Cardinal *);
static void EditCancel(Widget w, XEvent *event, String *, Cardinal *);
static void EditComplete(Widget w, XEvent *event, String *, Cardinal *);
static void DragStart(Widget w, XEvent *event, String *, Cardinal *);
static Boolean DragConvert(Widget w, Atom *selection, Atom *target,
Atom *type, XtPointer *value, unsigned long *length, int *format);
static void DragFinish(Widget w, XtPointer clientData, XtPointer callData);
static void DropRegister(XmLGridWidget g, Boolean set);
static void DropStart(Widget w, XtPointer clientData, XtPointer callData);
static void DropTransfer(Widget w, XtPointer clientData, Atom *selType,
Atom *type, XtPointer value, unsigned long *length, int *format);
static void Select(Widget w, XEvent *event, String *, Cardinal *);
static void PopupSelect(Widget w, XEvent *event, String *, Cardinal *);
static void TextActivate(Widget w, XtPointer clientData, XtPointer callData);
static void TextFocus(Widget w, XtPointer clientData, XtPointer callData);
static void TextMapped(Widget w, XtPointer closure, XEvent *event,
Boolean *ctd);
static void TextModifyVerify(Widget w, XtPointer clientData,
XtPointer callData);
static void Traverse(Widget w, XEvent *event, String *, Cardinal *);
/* XFE Additions */
static void EditTimer(XtPointer, XtIntervalId *);
static void CreateHideUnhideButtons(XmLGridWidget g);
static void HideAction(Widget w, XEvent *event, String *, Cardinal *);
static void UnhideAction(Widget w, XEvent *event, String *, Cardinal *);
static void setHideUnhideSensitivity(Widget w);
static void MenuArm(Widget w, XEvent *event, String *, Cardinal *);
static void MenuDisarm(Widget w, XEvent *event, String *, Cardinal *);
static void ResizeColumnToFit(XmLGridWidget g, int x);
static int SizeColumnsToFit(XmLGridWidget g, int start_at);
static void GridCrossingEH(Widget w, XtPointer closure, XEvent *event,
Boolean *ctd);
static void GridInvokeCellCrossingCallbacks(Widget w,XtCallbackList list,
int reason,XEvent * event,
int row,int col);
static void GridCrossingEH(Widget w,XtPointer closure,XEvent * event,
Boolean * ctd);
/* XmLGridRow */
static XmLGridRow XmLGridRowNew(Widget grid);
static void XmLGridRowFree(Widget grid, XmLGridRow row);
static XmLGridRow _GridRowNew(Widget grid);
static void _GridRowFree(XmLGridRow row);
static XmLArray XmLGridRowCells(XmLGridRow row);
static int XmLGridRowGetPos(XmLGridRow row);
static int XmLGridRowGetVisPos(XmLGridRow row);
static Boolean XmLGridRowIsHidden(XmLGridRow row);
static Boolean XmLGridRowIsSelected(XmLGridRow row);
static void XmLGridRowSetSelected(XmLGridRow row, Boolean selected);
static void XmLGridRowSetVisPos(XmLGridRow row, int visPos);
static int XmLGridRowHeightInPixels(XmLGridRow row);
static void XmLGridRowHeightChanged(XmLGridRow row);
/* XmLGridColumn */
static XmLGridColumn XmLGridColumnNew(Widget grid);
static void XmLGridColumnFree(Widget grid, XmLGridColumn column);
static XmLGridColumn _GridColumnNew(Widget grid);
static void _GridColumnFree(XmLGridColumn column);
static int XmLGridColumnGetPos(XmLGridColumn column);
static int XmLGridColumnGetVisPos(XmLGridColumn column);
static Boolean XmLGridColumnIsHidden(XmLGridColumn column);
static Boolean XmLGridColumnIsSelected(XmLGridColumn column);
static void XmLGridColumnSetSelected(XmLGridColumn column, Boolean selected);
static void XmLGridColumnSetVisPos(XmLGridColumn column, int visPos);
static int XmLGridColumnWidthInPixels(XmLGridColumn column);
static void XmLGridColumnWidthChanged(XmLGridColumn column);
/* XmLGridCell */
static XmLGridCell XmLGridCellNew();
static void XmLGridCellFree(Widget grid, XmLGridCell cell);
static int XmLGridCellAction(XmLGridCell cell, Widget w,
XmLGridCallbackStruct *cbs);
static int _GridCellAction(XmLGridCell cell, Widget w,
XmLGridCallbackStruct *cbs);
static XmLGridCellRefValues *XmLGridCellGetRefValues(XmLGridCell cell);
static void XmLGridCellSetRefValues(XmLGridCell cell,
XmLGridCellRefValues *values);
static void XmLGridCellDerefValues(XmLGridCellRefValues *values);
static Boolean XmLGridCellInRowSpan(XmLGridCell cell);
static Boolean XmLGridCellInColumnSpan(XmLGridCell cell);
static Boolean XmLGridCellIsSelected(XmLGridCell cell);
static Boolean XmLGridCellIsValueSet(XmLGridCell cell);
static void XmLGridCellSetValueSet(XmLGridCell cell, Boolean set);
static void XmLGridCellSetInRowSpan(XmLGridCell cell, Boolean set);
static void XmLGridCellSetInColumnSpan(XmLGridCell cell, Boolean set);
static void XmLGridCellSetSelected(XmLGridCell cell, Boolean selected);
static void XmLGridCellAllocIcon(XmLGridCell cell);
static void XmLGridCellAllocPixmap(XmLGridCell cell);
static void XmLGridCellSetString(XmLGridCell cell, XmString string,
Boolean copy);
static XmString XmLGridCellGetString(XmLGridCell cell);
static void XmLGridCellSetToggle(XmLGridCell cell, Boolean state);
static Boolean XmLGridCellGetToggle(XmLGridCell cell);
static void XmLGridCellSetPixmap(XmLGridCell cell, Pixmap pixmap,
Dimension width, Dimension height);
static void XmLGridCellSetPixmask(XmLGridCell cell, Pixmap pixmask);
static XmLGridCellPixmap *XmLGridCellGetPixmap(XmLGridCell cell);
/* static void XmLGridCellClearTextString(XmLGridCell cell, Widget w); */
static int _XmLGridCellConfigureText(XmLGridCell cell, Widget w,
XRectangle *rect);
static int _XmLGridCellBeginTextEdit(XmLGridCell cell, Widget w,
XRectangle *clipRect);
static void _XmLGridCellCompleteTextEdit(XmLGridCell cell, Widget w);
static void _XmLGridCellInsertText(XmLGridCell cell, Widget w);
static int _XmLGridCellGetHeight(XmLGridCell cell, Widget w,XmLGridRow row);
static int _XmLGridCellGetWidth(XmLGridCell cell, Widget w,XmLGridColumn col);
static void _XmLGridCellFreeValue(XmLGridCell cell);
/*Xfe Additions*/
static Boolean XmLGridCellDrawSort(XmLGridCell cell);
static Boolean XmLGridCellSortAscending(XmLGridCell cell);
static void XmLGridCellSetDrawSort(XmLGridCell cell, Boolean drawSort);
static void XmLGridCellSetSortAscending(XmLGridCell cell, Boolean ascending);
static XtActionsRec actions[] =
{
{ "XmLGridEditComplete", EditComplete },
{ "XmLGridButtonMotion", ButtonMotion },
{ "XmLGridCursorMotion", CursorMotion },
{ "XmLGridEditCancel", EditCancel },
{ "XmLGridEdit", Edit },
{ "XmLGridSelect", Select },
{ "XmLGridPopupSelect", PopupSelect },
{ "XmLGridDragStart", DragStart },
{ "XmLGridTraverse", Traverse },
/* XFE Additions */
{ "XmLGridHideColumn", HideAction },
{ "XmLGridUnhideColumn", UnhideAction },
{ "MenuArm", MenuArm },
{ "MenuDisarm", MenuDisarm },
};
#define TEXT_HIDE 1
#define TEXT_SHOW 2
#define TEXT_EDIT 3
#define TEXT_EDIT_CANCEL 4
#define TEXT_EDIT_COMPLETE 5
#define TEXT_EDIT_INSERT 6
/* future defines */
#define XmTOGGLE_CELL 240
/* backwards compatibility defines */
#define XmTEXT_CELL 250
#define XmLABEL_CELL 251
/* Cursors */
#define horizp_width 19
#define horizp_height 13
static unsigned char horizp_bits[] = {
0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0xff, 0x07, 0x00, 0x00, 0x06, 0x00,
0x00, 0x06, 0x00, 0x20, 0x46, 0x00, 0x30, 0xc6, 0x00, 0x38, 0xc6, 0x01,
0xfc, 0xff, 0x03, 0x38, 0xc6, 0x01, 0x30, 0xc6, 0x00, 0x20, 0x46, 0x00,
0x00, 0x06, 0x00 };
#define horizm_width 19
#define horizm_height 13
static unsigned char horizm_bits[] = {
0xff, 0x0f, 0x00, 0xff, 0x0f, 0x00, 0xff, 0x0f, 0x00, 0xff, 0x0f, 0x00,
0x60, 0x6f, 0x00, 0x70, 0xef, 0x00, 0x78, 0xef, 0x01, 0xfc, 0xff, 0x03,
0xfe, 0xff, 0x07, 0xfc, 0xff, 0x03, 0x78, 0xef, 0x01, 0x70, 0xef, 0x00,
0x60, 0x6f, 0x00 };
#define vertp_width 13
#define vertp_height 19
static unsigned char vertp_bits[] = {
0x06, 0x00, 0x06, 0x00, 0x06, 0x01, 0x86, 0x03, 0xc6, 0x07, 0xe6, 0x0f,
0x06, 0x01, 0x06, 0x01, 0x06, 0x01, 0xfe, 0x1f, 0xfe, 0x1f, 0x00, 0x01,
0x00, 0x01, 0x00, 0x01, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03, 0x00, 0x01,
0x00, 0x00};
#define vertm_width 13
#define vertm_height 19
static unsigned char vertm_bits[] = {
0x0f, 0x00, 0x0f, 0x01, 0x8f, 0x03, 0xcf, 0x07, 0xef, 0x0f, 0xff, 0x1f,
0xff, 0x1f, 0x8f, 0x03, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f,
0x80, 0x03, 0xf0, 0x1f, 0xf0, 0x1f, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03,
0x00, 0x01};
/* Grid Translations */
static char translations[] =
": XmLGridButtonMotion()\n\
: XmLGridCursorMotion()\n\
~Ctrl ~Shift : XmLGridSelect(BEGIN)\n\
~Ctrl Shift : XmLGridSelect(EXTEND)\n\
Ctrl ~Shift : XmLGridSelect(TOGGLE)\n\
: XmLGridSelect(END)\n\
: XmLGridDragStart()\n\
~Ctrl ~Shift : XmLGridPopupSelect(BEGIN)\n\
~Ctrl Shift : XmLGridPopupSelect(EXTEND)\n\
Ctrl ~Shift : XmLGridPopupSelect(TOGGLE)\n\
: ManagerEnter()\n\
: ManagerLeave()\n\
: ManagerFocusOut()\n\
: ManagerFocusIn()";
/* Text Translations */
static char traverseTranslations[] =
"~Ctrl ~Shift osfUp: XmLGridTraverse(UP)\n\
~Ctrl Shift osfUp: XmLGridTraverse(EXTEND_UP)\n\
Ctrl ~Shift osfUp: XmLGridTraverse(PAGE_UP)\n\
~Ctrl ~Shift osfDown: XmLGridTraverse(DOWN)\n\
~Ctrl Shift osfDown: XmLGridTraverse(EXTEND_DOWN)\n\
Ctrl ~Shift osfDown: XmLGridTraverse(PAGE_DOWN)\n\
~Ctrl ~Shift osfLeft: XmLGridTraverse(LEFT)\n\
~Ctrl Shift osfLeft: XmLGridTraverse(EXTEND_LEFT)\n\
Ctrl ~Shift osfLeft: XmLGridTraverse(PAGE_LEFT)\n\
~Ctrl ~Shift osfRight: XmLGridTraverse(RIGHT)\n\
~Ctrl Shift osfRight: XmLGridTraverse(EXTEND_RIGHT)\n\
Ctrl ~Shift osfRight: XmLGridTraverse(PAGE_RIGHT)\n\
~Ctrl ~Shift osfPageUp: XmLGridTraverse(PAGE_UP)\n\
~Ctrl Shift osfPageUp: XmLGridTraverse(EXTEND_PAGE_UP)\n\
Ctrl ~Shift osfPageUp: XmLGridTraverse(PAGE_LEFT)\n\
Ctrl Shift osfPageUp: XmLGridTraverse(EXTEND_PAGE_LEFT)\n\
~Ctrl Shift osfPageDown: XmLGridTraverse(EXTEND_PAGE_DOWN)\n\
Ctrl ~Shift osfPageDown: XmLGridTraverse(PAGE_RIGHT)\n\
~Ctrl ~Shift osfPageDown: XmLGridTraverse(PAGE_DOWN)\n\
Ctrl Shift osfPageDown: XmLGridTraverse(EXTEND_PAGE_RIGHT)\n\
~Ctrl ~Shift Tab: XmLGridTraverse(RIGHT)\n\
~Ctrl Shift Tab: XmLGridTraverse(LEFT)\n\
~Ctrl ~Shift Home: XmLGridTraverse(TO_TOP)\n\
~Ctrl ~Shift osfBeginLine: XmLGridTraverse(TO_TOP)\n\
Ctrl ~Shift Home: XmLGridTraverse(TO_TOP_LEFT)\n\
~Ctrl ~Shift End: XmLGridTraverse(TO_BOTTOM)\n\
~Ctrl ~Shift osfEndLine: XmLGridTraverse(TO_BOTTOM)\n\
Ctrl ~Shift End: XmLGridTraverse(TO_BOTTOM_RIGHT)\n\
osfInsert: XmLGridEdit()\n\
F2: XmLGridEdit()\n\
~Ctrl ~Shift space: XmLGridSelect(BEGIN)\n\
~Ctrl Shift space: XmLGridSelect(EXTEND)\n\
Ctrl ~Shift space: XmLGridSelect(TOGGLE)\n\
space: XmLGridSelect(END)";
/* You can't put multiple actions for any translation
where one translation changes the translation table
XmLGridComplete() and XmLGridCancel() do this and these
actions can't be combined with others */
static char editTranslations[] =
"~Ctrl ~Shift osfDown: XmLGridEditComplete(DOWN)\n\
~Ctrl Shift Tab: XmLGridEditComplete(LEFT)\n\
~Ctrl ~Shift Tab: XmLGridEditComplete(RIGHT)\n\
~Ctrl ~Shift osfUp: XmLGridEditComplete(UP)\n\
osfCancel: XmLGridEditCancel()\n\
Escape: XmLGridEditCancel()";
#if 0
static char hideButtonTranslations[] =
",: XmLGridHideColumn()";
static char unhideButtonTranslations[] =
",: XmLGridUnhideColumn()";
#endif /*0*/
static XtResource resources[] =
{
/* Grid Resources */
{
XmNactivateCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.activateCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNaddCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.addCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNallowColumnHide, XmCAllowColumnHide,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.allowColHide),
XmRImmediate, (XtPointer)False,
},
{
XmNallowColumnResize, XmCAllowColumnResize,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.allowColResize),
XmRImmediate, (XtPointer)False,
},
{
XmNallowDragSelected, XmCAllowDragSelected,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.allowDrag),
XmRImmediate, (XtPointer)False,
},
{
XmNallowDrop, XmCAllowDrop,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.allowDrop),
XmRImmediate, (XtPointer)False,
},
{
XmNallowRowHide, XmCAllowRowHide,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.allowRowHide),
XmRImmediate, (XtPointer)False,
},
{
XmNallowRowResize, XmCAllowRowResize,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.allowRowResize),
XmRImmediate, (XtPointer)False,
},
{
XmNautoSelect, XmCAutoSelect,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.autoSelect),
XmRImmediate, (XtPointer)True,
},
{
XmNblankBackground, XmCBlankBackground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.blankBg),
XmRCallProc, (XtPointer)GetCoreBackground,
},
{
XmNbottomFixedCount, XmCBottomFixedCount,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.bottomFixedCount),
XmRImmediate, (XtPointer)0,
},
{
XmNbottomFixedMargin, XmCBottomFixedMargin,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.bottomFixedMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNcellDefaults, XmCCellDefaults,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.cellDefaults),
XmRImmediate, (XtPointer)False,
},
{
XmNcellDrawCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.cellDrawCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNcellDropCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.cellDropCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNcellFocusCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.cellFocusCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNcellPasteCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.cellPasteCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNcolumns, XmCColumns,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.colCount),
XmRImmediate, (XtPointer)0,
},
{
XmNdeleteCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.deleteCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNdeselectCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.deselectCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNdebugLevel, XmCDebugLevel,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.debugLevel),
XmRImmediate, (XtPointer)0,
},
{
XmNeditCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.editCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNeditTranslations, XmCTranslations,
XmRTranslationTable, sizeof(XtTranslations),
XtOffset(XmLGridWidget, grid.editTrans),
XmRString, (XtPointer)editTranslations,
},
{
XmNfontList, XmCFontList,
XmRFontList, sizeof(XmFontList),
XtOffset(XmLGridWidget, grid.fontList),
XmRImmediate, (XtPointer)0
},
{
XmNfooterColumns, XmCFooterColumns,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.footerColCount),
XmRImmediate, (XtPointer)0,
},
{
XmNfooterRows, XmCFooterRows,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.footerRowCount),
XmRImmediate, (XtPointer)0,
},
{
XmNglobalPixmapHeight, XmCGlobalPixmapHeight,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.globalPixmapHeight),
XmRImmediate, (XtPointer)0,
},
{
XmNglobalPixmapWidth, XmCGlobalPixmapWidth,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.globalPixmapWidth),
XmRImmediate, (XtPointer)0,
},
{
XmNheadingColumns, XmCHeadingColumns,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.headingColCount),
XmRImmediate, (XtPointer)0,
},
{
XmNheadingRows, XmCHeadingRows,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.headingRowCount),
XmRImmediate, (XtPointer)0,
},
{
XmNhiddenColumns, XmCHiddenColumns,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.hiddenColCount),
XmRImmediate, (XtPointer)0,
},
{
XmNhiddenRows, XmCHiddenRows,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.hiddenRowCount),
XmRImmediate, (XtPointer)0,
},
{
XmNhighlightRowMode, XmCHighlightRowMode,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.highlightRowMode),
XmRImmediate, (XtPointer)False,
},
{
XmNhighlightThickness, XmCHighlightThickness,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.highlightThickness),
XmRImmediate, (XtPointer)2,
},
{
XmNhorizontalScrollBar, XmCHorizontalScrollBar,
XmRWidget, sizeof(Widget),
XtOffset(XmLGridWidget, grid.hsb),
XmRImmediate, (XtPointer)0,
},
{
XmNhorizontalSizePolicy, XmCHorizontalSizePolicy,
XmRGridSizePolicy, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.hsPolicy),
XmRImmediate, (XtPointer)XmCONSTANT,
},
{
XmNhsbDisplayPolicy, XmCHsbDisplayPolicy,
XmRScrollBarDisplayPolicy, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.hsbDisplayPolicy),
XmRImmediate, (XtPointer)XmAS_NEEDED,
},
{
XmNimmediateDraw, XmCImmediateDraw,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.immediateDraw),
XmRImmediate, (XtPointer)False,
},
{
XmNlayoutFrozen, XmCLayoutFrozen,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.layoutFrozen),
XmRImmediate, (XtPointer)False,
},
{
XmNleftFixedCount, XmCLeftFixedCount,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.leftFixedCount),
XmRImmediate, (XtPointer)0,
},
{
XmNleftFixedMargin, XmCLeftFixedMargin,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.leftFixedMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNminColumnWidth, XmCMinColumnWidth,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.minColWidth),
XmRImmediate, (XtPointer)0,
},
{
XmNrightFixedCount, XmCRightFixedCount,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.rightFixedCount),
XmRImmediate, (XtPointer)0,
},
{
XmNrightFixedMargin, XmCRightFixedMargin,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.rightFixedMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNresizeCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.resizeCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNrows, XmCRows,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.rowCount),
XmRImmediate, (XtPointer)0,
},
{
XmNscrollBarMargin, XmCScrollBarMargin,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.scrollBarMargin),
XmRImmediate, (XtPointer)2,
},
{
XmNscrollCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.scrollCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNscrollColumn, XmCScrollColumn,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cScrollCol),
XmRImmediate, (XtPointer)0,
},
{
XmNscrollRow, XmCScrollRow,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cScrollRow),
XmRImmediate, (XtPointer)0,
},
{
XmNselectCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.selectCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNselectionPolicy, XmCGridSelectionPolicy,
XmRGridSelectionPolicy, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.selectionPolicy),
XmRImmediate, (XtPointer)XmSELECT_BROWSE_ROW,
},
{
XmNselectBackground, XmCSelectBackground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.selectBg),
XmRCallProc, (XtPointer)GetManagerForeground,
},
{
XmNselectForeground, XmCSelectForeground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.selectFg),
XmRCallProc, (XtPointer)GetCoreBackground,
},
{
XmNshadowRegions, XmCShadowRegions,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.shadowRegions),
XmRImmediate, (XtPointer)511,
},
{
XmNshadowType, XmCShadowType,
XmRShadowType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.shadowType),
XmRImmediate, (XtPointer)XmSHADOW_IN,
},
{
XmNsimpleHeadings, XmCSimpleHeadings,
XmRString, sizeof(char *),
XtOffset(XmLGridWidget, grid.simpleHeadings),
XmRImmediate, (XtPointer)0,
},
{
XmNsimpleWidths, XmCSimpleWidths,
XmRString, sizeof(char *),
XtOffset(XmLGridWidget, grid.simpleWidths),
XmRImmediate, (XtPointer)0,
},
{
XmNtextWidget, XmCTextWidget,
XmRWidget, sizeof(Widget),
XtOffset(XmLGridWidget, grid.text),
XmRImmediate, (XtPointer)0,
},
{
XmNtoggleBottomColor, XmCToggleBottomColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.toggleBotColor),
XmRCallProc, (XtPointer)GetManagerForeground,
},
{
XmNtoggleTopColor, XmCToggleTopColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.toggleTopColor),
XmRCallProc, (XtPointer)GetManagerForeground,
},
{
XmNtoggleSize, XmCToggleSize,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.toggleSize),
XmRImmediate, (XtPointer)16,
},
{
XmNtraverseTranslations, XmCTranslations,
XmRTranslationTable, sizeof(XtTranslations),
XtOffset(XmLGridWidget, grid.traverseTrans),
XmRString, (XtPointer)traverseTranslations,
},
{
XmNtopFixedCount, XmCTopFixedCount,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.topFixedCount),
XmRImmediate, (XtPointer)0,
},
{
XmNtopFixedMargin, XmCTopFixedMargin,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.topFixedMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNuseAverageFontWidth, XmCUseAverageFontWidth,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.useAvgWidth),
XmRImmediate, (XtPointer)True,
},
{
XmNverticalScrollBar, XmCVerticalScrollBar,
XmRWidget, sizeof(Widget),
XtOffset(XmLGridWidget, grid.vsb),
XmRImmediate, (XtPointer)0,
},
{
XmNverticalSizePolicy, XmCVerticalSizePolicy,
XmRGridSizePolicy, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.vsPolicy),
XmRImmediate, (XtPointer)XmCONSTANT,
},
{
XmNvisibleColumns, XmCVisibleColumns,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.visibleCols),
XmRImmediate, (XtPointer)0,
},
{
XmNvisibleRows, XmCVisibleRows,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.visibleRows),
XmRImmediate, (XtPointer)0,
},
{
XmNvsbDisplayPolicy, XmCVsbDisplayPolicy,
XmRScrollBarDisplayPolicy, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.vsbDisplayPolicy),
XmRImmediate, (XtPointer)XmAS_NEEDED,
},
/* Xfe Additions*/
{
XmNpopupCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid.popupCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNenterCellCallback,
XmCCallback,
XmRCallback,
sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid . enterCellCallback),
XmRImmediate,
(XtPointer) NULL
},
{
XmNleaveCellCallback,
XmCCallback,
XmRCallback,
sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid . leaveCellCallback),
XmRImmediate,
(XtPointer) NULL
},
{
XmNenterGridCallback,
XmCCallback,
XmRCallback,
sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid . enterGridCallback),
XmRImmediate,
(XtPointer) NULL
},
{
XmNleaveGridCallback,
XmCCallback,
XmRCallback,
sizeof(XtCallbackList),
XtOffset(XmLGridWidget, grid . leaveGridCallback),
XmRImmediate,
(XtPointer) NULL
},
/* Row Resources */
{
XmNrow, XmCGridRow,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellRow),
XmRImmediate, (XtPointer)-1,
},
{
XmNrowUserData, XmCUserData,
XmRPointer, sizeof(XtPointer),
XtOffset(XmLGridWidget, grid.rowUserData),
XmRImmediate, (XtPointer)0,
},
{
XmNrowHeight, XmCRowHeight,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.rowHeight),
XmRImmediate, (XtPointer)0,
},
{
XmNrowRangeEnd, XmCRowRangeEnd,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellRowRangeEnd),
XmRImmediate, (XtPointer)-1,
},
{
XmNrowRangeStart, XmCRowRangeStart,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellRowRangeStart),
XmRImmediate, (XtPointer)-1,
},
{
XmNrowSizePolicy, XmCRowSizePolicy,
XmRGridSizePolicy, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.rowSizePolicy),
XmRImmediate, (XtPointer)0,
},
{
XmNrowStep, XmCRowStep,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.rowStep),
XmRImmediate, (XtPointer)1,
},
{
XmNrowType, XmCRowType,
XmRRowType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.rowType),
XmRImmediate, (XtPointer)XmINVALID_TYPE,
},
/* Column Resources */
{
XmNcolumn, XmCGridColumn,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellCol),
XmRImmediate, (XtPointer)-1,
},
{
XmNcolumnUserData, XmCUserData,
XmRPointer, sizeof(XtPointer),
XtOffset(XmLGridWidget, grid.colUserData),
XmRImmediate, (XtPointer)0,
},
{
XmNcolumnResizable, XmCColumnResizable,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.colResizable),
XmRImmediate, (XtPointer)TRUE,
},
{
XmNcolumnWidth, XmCColumnWidth,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.colWidth),
XmRImmediate, (XtPointer)0,
},
{
XmNcolumnRangeEnd, XmCColumnRangeEnd,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellColRangeEnd),
XmRImmediate, (XtPointer)-1,
},
{
XmNcolumnRangeStart, XmCColumnRangeStart,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellColRangeStart),
XmRImmediate, (XtPointer)-1,
},
{
XmNcolumnSizePolicy, XmCColumnSizePolicy,
XmRGridSizePolicy, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.colSizePolicy),
XmRImmediate, (XtPointer)0,
},
{
XmNcolumnStep, XmCColumnStep,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.colStep),
XmRImmediate, (XtPointer)1,
},
{
XmNcolumnType, XmCColumnType,
XmRColumnType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.colType),
XmRImmediate, (XtPointer)XmINVALID_TYPE,
},
/* xfe Column Resource additions */
{
XmNcolumnHidden, XmCColumnHidden,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.colHidden),
XmRImmediate, (XtPointer)FALSE,
},
{
XmNcolumnSortType, XmCColumnSortType,
XmRColumnSortType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.colSortType),
XmRImmediate, (XtPointer)XmSORT_NONE,
},
/* Cell Resources */
{
XmNcellAlignment, XmCCellAlignment,
XmRCellAlignment, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.cellValues.alignment),
XmRImmediate, (XtPointer)0,
},
{
XmNcellBackground, XmCCellBackground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.cellValues.background),
XmRImmediate, (XtPointer)0,
},
{
XmNcellBottomBorderColor, XmCCellBottomBorderColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.cellValues.bottomBorderColor),
XmRImmediate, (XtPointer)0,
},
{
XmNcellBottomBorderType, XmCCellBottomBorderType,
XmRCellBorderType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.cellValues.bottomBorderType),
XmRImmediate, (XtPointer)0,
},
{
XmNcellColumnSpan, XmCCellColumnSpan,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellValues.columnSpan),
XmRImmediate, (XtPointer)0,
},
{
XmNcellEditable, XmCCellEditable,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.cellValues.editable),
XmRImmediate, (XtPointer)False,
},
{
XmNcellFontList, XmCCellFontList,
XmRFontList, sizeof(XmFontList),
XtOffset(XmLGridWidget, grid.cellValues.fontList),
XmRImmediate, (XtPointer)0,
},
{
XmNcellForeground, XmCCellForeground,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.cellValues.foreground),
XmRImmediate, (XtPointer)0,
},
{
XmNcellLeftBorderColor, XmCCellLeftBorderColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.cellValues.leftBorderColor),
XmRImmediate, (XtPointer)0,
},
{
XmNcellLeftBorderType, XmCCellLeftBorderType,
XmRCellBorderType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.cellValues.leftBorderType),
XmRImmediate, (XtPointer)0,
},
{
XmNcellMarginBottom, XmCCellMarginBottom,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.cellValues.bottomMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNcellMarginLeft, XmCCellMarginLeft,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.cellValues.leftMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNcellMarginRight, XmCCellMarginRight,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.cellValues.rightMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNcellMarginTop, XmCCellMarginTop,
XmRDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.cellValues.topMargin),
XmRImmediate, (XtPointer)0,
},
{
XmNcellPixmap, XmCCellPixmap,
XmRManForegroundPixmap, sizeof(Pixmap),
XtOffset(XmLGridWidget, grid.cellPixmap),
XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP,
},
{
XmNcellPixmapMask, XmCCellPixmapMask,
XtRBitmap, sizeof(Pixmap),
XtOffset(XmLGridWidget, grid.cellPixmapMask),
XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP,
},
{
XmNcellRightBorderColor, XmCCellRightBorderColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.cellValues.rightBorderColor),
XmRImmediate, (XtPointer)0,
},
{
XmNcellRightBorderType, XmCCellRightBorderType,
XmRCellBorderType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.cellValues.rightBorderType),
XmRImmediate, (XtPointer)0,
},
{
XmNcellRowSpan, XmCCellRowSpan,
XmRInt, sizeof(int),
XtOffset(XmLGridWidget, grid.cellValues.rowSpan),
XmRImmediate, (XtPointer)0,
},
{
XmNcellString, XmCXmString,
XmRXmString, sizeof(XmString),
XtOffset(XmLGridWidget, grid.cellString),
XmRImmediate, (XtPointer)0,
},
{
XmNcellToggleSet, XmCCellToggleSet,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.cellToggleSet),
XmRImmediate, (XtPointer)False,
},
{
XmNcellTopBorderColor, XmCCellTopBorderColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLGridWidget, grid.cellValues.topBorderColor),
XmRImmediate, (XtPointer)0,
},
{
XmNcellTopBorderType, XmCCellTopBorderType,
XmRCellBorderType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.cellValues.topBorderType),
XmRImmediate, (XtPointer)0,
},
{
XmNcellType, XmCCellType,
XmRCellType, sizeof(unsigned char),
XtOffset(XmLGridWidget, grid.cellValues.type),
XmRImmediate, (XtPointer)XmSTRING_CELL,
},
{
XmNcellUserData, XmCUserData,
XmRPointer, sizeof(XtPointer),
XtOffset(XmLGridWidget, grid.cellValues.userData),
XmRImmediate, (XtPointer)0,
},
/* Overridden inherited resources */
{
XmNshadowThickness, XmCShadowThickness,
XmRHorizontalDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, manager.shadow_thickness),
XmRImmediate, (XtPointer)2,
},
/* XFE Addition*/
{
XmNhideUnhideButtons, XmCHideUnhideButtons,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.hideUnhideButtons),
XmRImmediate, (XtPointer)False,
},
{
XmNsingleClickActivation, XmCSingleClickActivation,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.singleClickActivation),
XmRImmediate, (XtPointer)False,
},
#if 0
{
XmNhideButtonTranslations, XmCTranslations,
XmRTranslationTable, sizeof(XtTranslations),
XtOffset(XmLGridWidget, grid.hideButtonTrans),
XmRString, (XtPointer)hideButtonTranslations,
},
{
XmNunhideButtonTranslations, XmCTranslations,
XmRTranslationTable, sizeof(XtTranslations),
XtOffset(XmLGridWidget, grid.unhideButtonTrans),
XmRString, (XtPointer)unhideButtonTranslations,
},
#endif /*0*/
{
XmNuseTextWidget, XmCUseTextWidget,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLGridWidget, grid.useTextWidget),
XmRImmediate, (XtPointer)True,
},
{
XmNiconSpacing, XmCIconSpacing,
XmRHorizontalDimension, sizeof(Dimension),
XtOffset(XmLGridWidget, grid.iconSpacing),
XmRImmediate, (XtPointer) 4,
},
};
XmLGridClassRec xmlGridClassRec =
{
{ /* core_class */
(WidgetClass)&xmManagerClassRec, /* superclass */
"XmLGrid", /* class_name */
sizeof(XmLGridRec), /* widget_size */
ClassInitialize, /* class_init */
ClassPartInitialize, /* class_part_init */
FALSE, /* class_inited */
(XtInitProc)Initialize, /* initialize */
0, /* initialize_hook */
(XtRealizeProc)Realize, /* realize */
(XtActionList)actions, /* actions */
(Cardinal)XtNumber(actions), /* num_actions */
(XtResource *)resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
TRUE, /* compress_motion */
XtExposeCompressMaximal, /* compress_exposure */
TRUE, /* compress_enterleav */
TRUE, /* visible_interest */
(XtWidgetProc)Destroy, /* destroy */
(XtWidgetProc)Resize, /* resize */
(XtExposeProc)Redisplay, /* expose */
(XtSetValuesFunc)SetValues, /* set_values */
0, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
(XtArgsProc)GetSubValues, /* get_values_hook */
0, /* accept_focus */
XtVersion, /* version */
0, /* callback_private */
translations, /* tm_table */
0, /* query_geometry */
0, /* display_accelerato */
0, /* extension */
},
{ /* composite_class */
(XtGeometryHandler)GeometryManager, /* geometry_manager */
(XtWidgetProc)ChangeManaged, /* change_managed */
XtInheritInsertChild, /* insert_child */
XtInheritDeleteChild, /* delete_child */
0, /* extension */
},
{ /* constraint_class */
0, /* subresources */
0, /* subresource_count */
sizeof(XmLGridConstraintRec), /* constraint_size */
0, /* initialize */
0, /* destroy */
0, /* set_values */
0, /* extension */
},
{ /* manager_class */
XtInheritTranslations, /* translations */
0, /* syn resources */
0, /* num syn_resources */
0, /* get_cont_resources */
0, /* num_get_cont_res */
XmInheritParentProcess, /* parent_process */
0, /* extension */
},
{ /* grid_class */
0, /* initial rows */
0, /* initial columns */
XmInheritGridPreLayout, /* pre layout */
sizeof(struct _XmLGridRowRec), /* row rec size */
_GridRowNew, /* row new */
_GridRowFree, /* row free */
_GetRowValueMask, /* get row value mask */
_GetRowValue, /* get row value */
_SetRowValues, /* set row values */
sizeof(struct _XmLGridColumnRec), /* column rec size */
_GridColumnNew, /* column new */
_GridColumnFree, /* column free */
_GetColumnValueMask, /* get col value mask */
_GetColumnValue, /* get column value */
_SetColumnValues, /* set column values */
_SetCellValuesResize, /* set cell vl resize */
_GridCellAction, /* cell action */
}
};
WidgetClass xmlGridWidgetClass = (WidgetClass)&xmlGridClassRec;
/*
Create and Destroy
*/
static void
ClassInitialize(void)
{
int off1, off2;
XmLInitialize();
XtSetTypeConverter(XmRString, XmRGridSizePolicy,
CvtStringToSizePolicy, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRColumnType,
CvtStringToRowColType, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRRowType,
CvtStringToRowColType, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRGridSelectionPolicy,
CvtStringToSelectionPolicy, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRCellAlignment,
CvtStringToCellAlignment, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRCellType,
CvtStringToCellType, 0, 0, XtCacheNone, 0);
XtSetTypeConverter(XmRString, XmRCellBorderType,
CvtStringToCellBorderType, 0, 0, XtCacheNone, 0);
/* long must be > 2 bytes for cell mask to work */
if (sizeof(long) < 3)
fprintf(stderr, "xmlGridClass: fatal error: long < 3 bytes\n");
/* compiler sanity check - make sure array pos lines up */
off1 = XtOffset(XmLArrayItem *, pos);
off2 = XtOffset(XmLGridColumn, grid.pos);
if (off1 != off2)
fprintf(stderr, "xmlGridClass: fatal error: column pos offset bad\n");
off2 = XtOffset(XmLGridRow, grid.pos);
if (off1 != off2)
fprintf(stderr, "xmlGridClass: fatal error: row pos offset bad\n");
}
static void
ClassPartInitialize(WidgetClass wc)
{
XmLGridWidgetClass c, sc;
c = (XmLGridWidgetClass)wc;
sc = (XmLGridWidgetClass)c->core_class.superclass;
#define INHERIT_PROC(proc, inherit) \
if (c->grid_class.proc == inherit) \
c->grid_class.proc = sc->grid_class.proc;
INHERIT_PROC(rowNewProc, XmInheritGridRowNew)
INHERIT_PROC(rowFreeProc, XmInheritGridRowFree)
INHERIT_PROC(getRowValueMaskProc, XmInheritGridGetRowValueMask)
INHERIT_PROC(getRowValueProc, XmInheritGridGetRowValue)
INHERIT_PROC(setRowValuesProc, XmInheritGridSetRowValues)
INHERIT_PROC(columnNewProc, XmInheritGridColumnNew)
INHERIT_PROC(columnFreeProc, XmInheritGridColumnFree)
INHERIT_PROC(getColumnValueMaskProc, XmInheritGridGetColumnValueMask)
INHERIT_PROC(getColumnValueProc, XmInheritGridGetColumnValue)
INHERIT_PROC(setColumnValuesProc, XmInheritGridSetColumnValues)
INHERIT_PROC(setCellValuesResizeProc, XmInheritGridSetCellValuesResize)
INHERIT_PROC(cellActionProc, XmInheritGridCellAction)
#undef INHERIT_PROC
}
static void
Initialize(Widget reqW,
Widget newW,
ArgList args,
Cardinal *narg)
{
XmLGridWidget g, request;
Display *dpy;
Pixmap pix, pixMask;
Pixel white, black;
XColor fg, bg;
GridReg *reg;
int i, valid, hc, c, fc, hr, r, fr;
Boolean layoutFrozen;
#ifdef POINTER_FOCUS_CHECK
unsigned char kfp;
Widget shell;
#endif
g = (XmLGridWidget)newW;
dpy = XtDisplay((Widget)g);
request = (XmLGridWidget)reqW;
#ifdef POINTER_FOCUS_CHECK
shell = XmLShellOfWidget(newW);
if (shell && XmIsVendorShell(shell))
{
XtVaGetValues(shell,
XmNkeyboardFocusPolicy, &kfp,
NULL);
if (kfp == XmPOINTER)
XmLWarning(newW, "keyboardFocusPolicy of XmPOINTER not supported");
}
#endif
black = BlackPixelOfScreen(XtScreen((Widget)g));
white = WhitePixelOfScreen(XtScreen((Widget)g));
g->grid.rowArray = XmLArrayNew(1, 1);
g->grid.colArray = XmLArrayNew(1, 1);
if (g->core.width <= 0)
g->core.width = 100;
if (g->core.height <= 0)
g->core.height = 100;
CopyFontList(g);
if (g->grid.useTextWidget) {
g->grid.text = XtVaCreateManagedWidget("text", xmTextWidgetClass, (Widget)g,
XmNmarginHeight, 0,
XmNmarginWidth, 3,
XmNshadowThickness, 0,
XmNhighlightThickness, 0,
XmNx, 0,
XmNy, 0,
XmNwidth, 40,
XmNheight, 40,
XmNbackground, g->core.background_pixel,
XmNforeground, g->manager.foreground,
NULL);
XtOverrideTranslations(g->grid.text, g->grid.traverseTrans);
XtAddEventHandler(g->grid.text, StructureNotifyMask,
True, (XtEventHandler)TextMapped, (XtPointer)0);
XtAddCallback(g->grid.text, XmNactivateCallback, TextActivate, 0);
XtAddCallback(g->grid.text, XmNfocusCallback, TextFocus, 0);
XtAddCallback(g->grid.text, XmNlosingFocusCallback, TextFocus, 0);
XtAddCallback(g->grid.text, XmNmodifyVerifyCallback, TextModifyVerify, 0);
}
g->grid.hsb = XtVaCreateWidget(
"hsb", xmScrollBarWidgetClass, (Widget)g,
XmNincrement, 1,
XmNorientation, XmHORIZONTAL,
XmNtraversalOn, False,
XmNbackground, g->core.background_pixel,
/* Don't force foreground on IRIX - it screws up the thumb color in sgiMode */
#ifndef IRIX
XmNforeground, g->manager.foreground,
#endif
XmNtopShadowColor, g->manager.top_shadow_color,
XmNbottomShadowColor, g->manager.bottom_shadow_color,
NULL);
XtAddCallback(g->grid.hsb, XmNdragCallback, ScrollCB, 0);
XtAddCallback(g->grid.hsb, XmNvalueChangedCallback, ScrollCB, 0);
g->grid.vsb = XtVaCreateWidget(
"vsb", xmScrollBarWidgetClass, (Widget)g,
XmNorientation, XmVERTICAL,
XmNincrement, 1,
XmNtraversalOn, False,
XmNbackground, g->core.background_pixel,
/* Don't force foreground on IRIX - it screws up the thumb color in sgiMode */
#ifndef IRIX
XmNforeground, g->manager.foreground,
#endif
XmNtopShadowColor, g->manager.top_shadow_color,
XmNbottomShadowColor, g->manager.bottom_shadow_color,
NULL);
XtAddCallback(g->grid.vsb, XmNdragCallback, ScrollCB, 0);
XtAddCallback(g->grid.vsb, XmNvalueChangedCallback, ScrollCB, 0);
if (g->grid.hideUnhideButtons)
{
CreateHideUnhideButtons(g);
}
else
{
g->grid.hideButton = 0;
g->grid.unhideButton = 0;
}
g->grid.inResize = False;
/* Cursors */
fg.red = ~0;
fg.green = ~0;
fg.blue = ~0;
fg.pixel = white;
fg.flags = DoRed | DoGreen | DoBlue;
bg.red = 0;
bg.green = 0;
bg.blue = 0;
bg.pixel = black;
bg.flags = DoRed | DoGreen | DoBlue;
pix = XCreatePixmapFromBitmapData(dpy, DefaultRootWindow(dpy),
(char *)horizp_bits, horizp_width, horizp_height, 0, 1, 1);
pixMask = XCreatePixmapFromBitmapData(dpy, DefaultRootWindow(dpy),
(char *)horizm_bits, horizm_width, horizm_height, 1, 0, 1);
g->grid.hResizeCursor = XCreatePixmapCursor(dpy, pix, pixMask,
&fg, &bg, 9, 9);
XFreePixmap(dpy, pix);
XFreePixmap(dpy, pixMask);
pix = XCreatePixmapFromBitmapData(dpy, DefaultRootWindow(dpy),
(char *)vertp_bits, vertp_width, vertp_height, 0, 1, 1);
pixMask = XCreatePixmapFromBitmapData(dpy, DefaultRootWindow(dpy),
(char *)vertm_bits, vertm_width, vertm_height, 1, 0, 1);
g->grid.vResizeCursor = XCreatePixmapCursor(dpy, pix, pixMask,
&fg, &bg, 9, 9);
XFreePixmap(dpy, pix);
XFreePixmap(dpy, pixMask);
g->grid.cursorDefined = CursorNormal;
g->grid.focusIn = 0;
g->grid.focusRow = -1;
g->grid.focusCol = -1;
g->grid.mayHaveRowSpans = 0;
g->grid.scrollCol = 0;
g->grid.scrollRow = 0;
g->grid.textHidden = 1;
g->grid.inMode = InNormal;
g->grid.inEdit = 0;
g->grid.singleColScrollMode = 0;
g->grid.layoutStack = 0;
g->grid.needsHorizLayout = 0;
g->grid.needsVertLayout = 0;
g->grid.recalcHorizVisPos = 0;
g->grid.recalcVertVisPos = 0;
g->grid.vertVisChangedHint = 0;
g->grid.defCellValues = CellRefValuesCreate(g, 0);
g->grid.defCellValues->refCount = 1;
g->grid.ignoreModifyVerify = 0;
g->grid.extendRow = -1;
g->grid.extendCol = -1;
g->grid.extendToRow = -1;
g->grid.extendToCol = -1;
g->grid.extendSelect = True;
g->grid.lastSelectRow = -1;
g->grid.lastSelectCol = -1;
g->grid.lastSelectTime = 0;
g->grid.dragTimerSet = 0;
g->grid.editTimerSet = 0;
g->grid.gc = 0;
/*
* Support for:
*
* XmNenterCellCallback
* XmNenterCellCallback
* XmNenterCallback
* XmNleaveCallback
*/
g->grid.lastCursorMotionRow = -1;
g->grid.lastCursorMotionCol = -1;
XtAddEventHandler(newW,
EnterWindowMask | LeaveWindowMask,
True,
(XtEventHandler) GridCrossingEH,
(XtPointer) NULL);
reg = g->grid.reg;
for (i = 0; i < 9; i++)
{
reg[i].x = 0;
reg[i].y = 0;
reg[i].width = 0;
reg[i].height = 0;
reg[i].row = 0;
reg[i].col = 0;
reg[i].nrow = 0;
reg[i].ncol = 0;
}
layoutFrozen = g->grid.layoutFrozen;
g->grid.layoutFrozen = True;
if (g->grid.hiddenColCount || g->grid.hiddenRowCount)
{
XmLWarning(newW, "Initialize() - can't set hidden rows or columns");
g->grid.hiddenColCount = 0;
g->grid.hiddenRowCount = 0;
}
hc = g->grid.headingColCount;
c = XmLGridClassPartOfWidget(g).initialCols;
if (c < g->grid.colCount)
c = g->grid.colCount;
fc = g->grid.footerColCount;
hr = g->grid.headingRowCount;
r = XmLGridClassPartOfWidget(g).initialRows;
if (r < g->grid.rowCount)
r = g->grid.rowCount ;
fr = g->grid.footerRowCount;
g->grid.headingColCount = 0;
g->grid.colCount = 0;
g->grid.footerColCount = 0;
g->grid.headingRowCount = 0;
g->grid.rowCount = 0;
g->grid.footerRowCount = 0;
XmLGridAddColumns(newW, XmHEADING, -1, hc);
XmLGridAddColumns(newW, XmCONTENT, -1, c);
XmLGridAddColumns(newW, XmFOOTER, -1, fc);
XmLGridAddRows(newW, XmHEADING, -1, hr);
XmLGridAddRows(newW, XmCONTENT, -1, r);
XmLGridAddRows(newW, XmFOOTER, -1, fr);
if (g->grid.simpleHeadings)
{
g->grid.simpleHeadings = (char *)strdup(g->grid.simpleHeadings);
SetSimpleHeadings(g, g->grid.simpleHeadings);
}
if (g->grid.simpleWidths)
{
g->grid.simpleWidths = (char *)strdup(g->grid.simpleWidths);
SetSimpleWidths(g, g->grid.simpleWidths);
}
if (g->grid.visibleRows)
ApplyVisibleRows(g);
if (g->grid.visibleCols && g->grid.hsPolicy == XmCONSTANT)
ApplyVisibleCols(g);
g->grid.layoutFrozen = layoutFrozen;
VertLayout(g, 1);
HorizLayout(g, 1);
PlaceScrollbars(g);
valid = 1;
for (i = 0; i < *narg; i++)
{
if (!args[i].name)
continue;
if (!strcmp(args[i].name, XmNrows) ||
!strcmp(args[i].name, XmNcolumns))
continue;
if (!strncmp(args[i].name, "row", 3) ||
!strncmp(args[i].name, "column", 6) ||
!strncmp(args[i].name, "cell", 4))
valid = 0;
}
if (!valid)
XmLWarning(newW,
"Initialize() - can't set row,column or cell values in init");
DropRegister(g, g->grid.allowDrop);
}
static void
Destroy(Widget w)
{
XmLGridWidget g;
Display *dpy;
int i, count;
g = (XmLGridWidget)w;
dpy = XtDisplay(w);
if (g->grid.dragTimerSet)
XtRemoveTimeOut(g->grid.dragTimerId);
if (g->grid.editTimerSet)
XtRemoveTimeOut(g->grid.editTimerId);
DefineCursor(g, CursorNormal);
XFreeCursor(dpy, g->grid.hResizeCursor);
XFreeCursor(dpy, g->grid.vResizeCursor);
if (g->grid.gc)
{
XFreeGC(dpy, g->grid.gc);
XFreeFont(dpy, g->grid.fallbackFont);
}
XmFontListFree(g->grid.fontList);
XmLGridCellDerefValues(g->grid.defCellValues);
ExtendSelect(g, (XEvent *)0, False, -1, -1);
count = XmLArrayGetCount(g->grid.rowArray);
for (i = 0; i < count; i++)
XmLGridRowFree(w, (XmLGridRow)XmLArrayGet(g->grid.rowArray, i));
XmLArrayFree(g->grid.rowArray);
count = XmLArrayGetCount(g->grid.colArray);
for (i = 0; i < count; i++)
XmLGridColumnFree(w, (XmLGridColumn)XmLArrayGet(g->grid.colArray, i));
XmLArrayFree(g->grid.colArray);
if (g->grid.simpleHeadings)
free((char *)g->grid.simpleHeadings);
if (g->grid.simpleWidths)
free((char *)g->grid.simpleWidths);
}
/*
Geometry, Drawing, Entry and Picking
*/
static void
Realize(Widget w,
XtValueMask *valueMask,
XSetWindowAttributes *attr)
{
XmLGridWidget g;
Display *dpy;
WidgetClass superClass;
XtRealizeProc realize;
XGCValues values;
XtGCMask mask;
static char dashes[2] = { 1, 1 };
g = (XmLGridWidget)w;
dpy = XtDisplay(g);
superClass = xmlGridWidgetClass->core_class.superclass;
realize = superClass->core_class.realize;
(*realize)(w, valueMask, attr);
if (!g->grid.gc)
{
g->grid.fallbackFont = XLoadQueryFont(dpy, "fixed");
values.foreground = g->manager.foreground;
values.font = g->grid.fallbackFont->fid;
mask = GCForeground | GCFont;
g->grid.gc = XCreateGC(dpy, XtWindow(g), mask, &values);
XSetDashes(dpy, g->grid.gc, 0, dashes, 2);
if (g->grid.selectionPolicy == XmSELECT_BROWSE_ROW &&
g->grid.autoSelect == True &&
g->grid.rowCount)
XmLGridSelectRow(w, 0, False);
}
}
static void
Redisplay(Widget w,
XExposeEvent *event,
Region region)
{
XmLGridWidget g;
Display *dpy;
Window win;
XmLGridCell cell;
XmLGridRow row;
XmLGridColumn col;
XmLGridCellRefValues *cellValues;
XmLGridDrawStruct ds;
XmLGridCallbackStruct cbs;
GridReg *reg;
XRectangle eRect, rRect, clipRect, rect[6];
int i, n, st, c, r, sc, sr, width, height, rowHeight;
int lastVisPos, visPos, hasDrawCB;
Boolean spanUp, spanLeft;
g = (XmLGridWidget)w;
if (!XtIsRealized((Widget)g))
return;
if (!g->core.visible)
return;
if (g->grid.layoutFrozen == True)
XmLWarning(w, "Redisplay() - layout frozen is True during redraw");
dpy = XtDisplay(g);
win = XtWindow(g);
st = g->manager.shadow_thickness;
reg = g->grid.reg;
if (event)
{
eRect.x = event->x;
eRect.y = event->y;
eRect.width = event->width;
eRect.height = event->height;
if (g->grid.debugLevel > 1)
fprintf(stderr, "XmLGrid: Redisplay x %d y %d w %d h %d\n",
event->x, event->y, event->width, event->height);
}
else
{
eRect.x = 0;
eRect.y = 0;
eRect.width = g->core.width;
eRect.height = g->core.height;
}
if (!eRect.width || !eRect.height)
return;
/* Hide any XORed graphics */
DrawResizeLine(g, 0, 1);
hasDrawCB = 0;
if (XtHasCallbacks(w, XmNcellDrawCallback) == XtCallbackHasSome)
hasDrawCB = 1;
/* Add extra shadow around the whole widget
* if 512 is set for shadow regions
*/
if (g->grid.shadowRegions == 512
&& g->manager.shadow_thickness
&& XmLRectIntersect(&eRect, &rRect) != XmLRectInside)
{
#ifdef MOTIF11
_XmDrawShadow(dpy, win,
g->manager.bottom_shadow_GC,
g->manager.top_shadow_GC,
g->manager.shadow_thickness,
0,0,
g->core.width, g->core.height);
#else
_XmDrawShadows(dpy, win,
g->manager.top_shadow_GC,
g->manager.bottom_shadow_GC,
0,0,
g->core.width, g->core.height,
g->manager.shadow_thickness,
g->grid.shadowType);
#endif
}
/* end of extra shadow */
for (i = 0; i < 9; i++)
{
if (!reg[i].width || !reg[i].height)
continue;
rRect.x = reg[i].x;
rRect.y = reg[i].y;
rRect.width = reg[i].width;
rRect.height = reg[i].height;
if (XmLRectIntersect(&eRect, &rRect) == XmLRectOutside)
continue;
if (g->grid.debugLevel > 2)
fprintf(stderr, "XmLGrid: Redisplay region %d shadows\n", i);
rRect.x += st;
rRect.width -= st * 2;
rRect.y += st;
rRect.height -= st * 2;
if (XmLRectIntersect(&eRect, &rRect) != XmLRectInside
&& g->manager.shadow_thickness
&& g->grid.shadowRegions != 512)
{
if (g->grid.shadowRegions & (1 << i))
#ifdef MOTIF11
_XmDrawShadow(dpy, win,
g->manager.bottom_shadow_GC,
g->manager.top_shadow_GC,
g->manager.shadow_thickness,
reg[i].x, reg[i].y,
reg[i].width, reg[i].height);
#else
_XmDrawShadows(dpy, win,
g->manager.top_shadow_GC,
g->manager.bottom_shadow_GC,
reg[i].x, reg[i].y,
reg[i].width, reg[i].height,
g->manager.shadow_thickness,
g->grid.shadowType);
#endif
else
#ifdef MOTIF11
_XmEraseShadow(dpy, win,
g->manager.shadow_thickness,
reg[i].x, reg[i].y,
reg[i].width, reg[i].height);
#else
_XmClearBorder(dpy, win,
reg[i].x, reg[i].y,
reg[i].width, reg[i].height,
g->manager.shadow_thickness);
#endif
}
rRect.x += st;
height = 0;
if (g->grid.debugLevel > 2)
fprintf(stderr, "XmLGrid: Redisplay region %d content\n", i);
for (r = reg[i].row; r < reg[i].row + reg[i].nrow; r++)
{
rowHeight = GetRowHeight(g, r);
if (!rowHeight && !g->grid.mayHaveRowSpans)
continue;
width = 0;
for (c = reg[i].col; c < reg[i].col + reg[i].ncol; c++)
{
rRect.x = reg[i].x + st + width;
rRect.y = reg[i].y + st + height;
if (g->grid.singleColScrollMode)
rRect.x -= g->grid.singleColScrollPos;
rRect.width = GetColWidth(g, c);
#if 0
if (i == 1 && r == reg[1].row && c == reg[1].col - 1)
{
rRect.width -= 10;
}
#endif /*0 slamm */
rRect.height = rowHeight;
width += rRect.width;
cell = GetCell(g, r, c);
if (!cell)
continue;
cellValues = XmLGridCellGetRefValues(cell);
spanUp = False;
spanLeft = False;
if (XmLGridCellInRowSpan(cell))
{
if (r == reg[i].row)
{
spanUp = True;
if (c == reg[i].col)
spanLeft = True;
}
else
continue;
}
if (XmLGridCellInColumnSpan(cell))
{
if (c == reg[i].col)
spanLeft = True;
else
continue;
}
sr = r;
sc = c;
if (spanUp == True || spanLeft == True ||
cellValues->rowSpan || cellValues->columnSpan)
{
if (RowColFirstSpan(g, r, c, &sr, &sc, &rRect,
spanLeft, spanUp) == -1)
continue;
RowColSpanRect(g, sr, sc, &rRect);
}
if (!rRect.width || !rRect.height)
continue;
clipRect = rRect;
ClipRectToReg(g, &clipRect, ®[i]);
if (!clipRect.width || !clipRect.height)
continue;
if (event && XRectInRegion(region, clipRect.x, clipRect.y,
clipRect.width, clipRect.height) == RectangleOut)
continue;
cell = GetCell(g, sr, sc);
if (!cell)
continue;
cellValues = XmLGridCellGetRefValues(cell);
cbs.reason = XmCR_CELL_DRAW;
cbs.event = (XEvent *)event;
cbs.rowType = RowPosToType(g, sr);
cbs.row = RowPosToTypePos(g, cbs.rowType, sr);
cbs.columnType = ColPosToType(g, sc);
cbs.column = ColPosToTypePos(g, cbs.columnType, sc);
cbs.clipRect = &clipRect;
cbs.drawInfo = &ds;
ds.gc = g->grid.gc;
ds.cellRect = &rRect;
ds.topMargin = cellValues->topMargin;
ds.bottomMargin = cellValues->bottomMargin;
ds.leftMargin = cellValues->leftMargin;
ds.rightMargin = cellValues->rightMargin;
ds.background = cellValues->background;
ds.foreground = cellValues->foreground;
ds.fontList = cellValues->fontList;
ds.alignment = cellValues->alignment;
ds.selectBackground = g->grid.selectBg;
ds.selectForeground = g->grid.selectFg;
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, sr);
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, sc);
ds.drawFocusType = XmDRAW_FOCUS_NONE;
if (g->grid.focusRow == sr &&
g->grid.highlightRowMode == True &&
g->grid.focusIn)
{
RecalcVisPos(g, 0);
visPos = XmLGridColumnGetVisPos(col);
lastVisPos = XmLArrayGetCount(g->grid.colArray) -
g->grid.hiddenColCount - 1;
if (visPos == 0 && visPos == lastVisPos)
ds.drawFocusType = XmDRAW_FOCUS_CELL;
else if (visPos == 0)
ds.drawFocusType = XmDRAW_FOCUS_LEFT;
else if (visPos == lastVisPos)
ds.drawFocusType = XmDRAW_FOCUS_RIGHT;
else
ds.drawFocusType = XmDRAW_FOCUS_MID;
}
if (g->grid.focusRow == sr &&
g->grid.focusCol == sc &&
g->grid.highlightRowMode == False &&
g->grid.focusIn)
ds.drawFocusType = XmDRAW_FOCUS_CELL;
if (XmLGridRowIsSelected(row) == True ||
XmLGridColumnIsSelected(col) == True ||
XmLGridCellIsSelected(cell) == True)
ds.drawSelected = True;
else
ds.drawSelected = False;
if (g->grid.selectionPolicy == XmSELECT_CELL &&
g->grid.focusIn && g->grid.focusRow == sr &&
g->grid.focusCol == sc)
ds.drawSelected = False;
ds.stringDirection = g->manager.string_direction;
XmLGridCellAction(cell, (Widget)g, &cbs);
if (hasDrawCB)
XtCallCallbackList(w, g->grid.cellDrawCallback,
(XtPointer)&cbs);
}
height += rowHeight;
}
}
if (g->grid.debugLevel > 1)
fprintf(stderr, "XmLGrid: Redisplay non-cell areas\n");
n = 0;
if (reg[0].width && g->grid.leftFixedMargin)
{
rect[n].x = reg[0].width;
rect[n].y = 0;
rect[n].width = g->grid.leftFixedMargin;
rect[n].height = g->core.height;
n++;
}
if (reg[2].width && g->grid.rightFixedMargin)
{
width = 0;
if (reg[0].ncol)
width += reg[0].width + g->grid.leftFixedMargin;
if (reg[1].ncol)
width += reg[1].width;
rect[n].x = width;
rect[n].y = 0;
rect[n].width = g->grid.rightFixedMargin;
rect[n].height = g->core.height;
n++;
}
if (reg[0].height && g->grid.topFixedMargin)
{
rect[n].x = 0;
rect[n].y = reg[0].height;
rect[n].width = g->core.width;
rect[n].height = g->grid.topFixedMargin;
n++;
}
if (reg[6].height && g->grid.bottomFixedMargin)
{
rect[n].x = 0;
height = 0;
if (reg[0].nrow)
height += reg[0].height + g->grid.topFixedMargin;
if (reg[3].nrow)
height += reg[3].height;
rect[n].y = height;
rect[n].width = g->core.width;
rect[n].height = g->grid.bottomFixedMargin;
n++;
}
width = reg[1].width;
if (reg[0].ncol)
width += reg[0].width + g->grid.leftFixedMargin;
if (reg[2].ncol)
width += g->grid.rightFixedMargin + reg[2].width;
if (width < (int)g->core.width)
{
rect[n].x = width;
rect[n].y = 0;
rect[n].width = g->core.width - width;
rect[n].height = g->core.height;
n++;
}
height = reg[3].height;
if (reg[0].nrow)
height += reg[0].height + g->grid.topFixedMargin;
if (reg[6].nrow)
height += g->grid.bottomFixedMargin + reg[6].height;
if (height < (int)g->core.height)
{
rect[n].x = 0;
rect[n].y = height;
rect[n].width = g->core.width;
rect[n].height = g->core.height - height;
n++;
}
for (i = 0; i < n; i++)
{
if (XmLRectIntersect(&eRect, &rect[i]) == XmLRectOutside)
continue;
XClearArea(dpy, win, rect[i].x, rect[i].y, rect[i].width,
rect[i].height, False);
}
n = 0;
if (reg[1].width)
{
width = 0;
for (c = reg[1].col; c < reg[1].col + reg[1].ncol; c++)
width += GetColWidth(g, c);
for (i = 1; i < 9; i += 3)
if (reg[i].height && width < reg[i].width - st * 2)
{
rect[n].x = reg[i].x + st + width;
rect[n].y = reg[i].y + st;
rect[n].width = reg[i].x + reg[i].width -
rect[n].x - st;
rect[n].height = reg[i].height - st * 2;
n++;
}
}
if (reg[3].height)
{
height = 0;
for (r = reg[3].row; r < reg[3].row + reg[3].nrow; r++)
height += GetRowHeight(g, r);
for (i = 3; i < 6; i++)
if (reg[i].width && height < reg[i].height - st * 2)
{
rect[n].x = reg[i].x + st;
rect[n].y = reg[i].y + st + height;
rect[n].width = reg[i].width - st * 2;
rect[n].height = reg[i].y + reg[i].height -
rect[n].y - st;
n++;
}
}
XSetForeground(dpy, g->grid.gc, g->grid.blankBg);
for (i = 0; i < n; i++)
{
if (XmLRectIntersect(&eRect, &rect[i]) == XmLRectOutside)
continue;
XFillRectangle(dpy, win, g->grid.gc, rect[i].x, rect[i].y,
rect[i].width, rect[i].height);
}
/* Show any XORed graphics */
DrawResizeLine(g, 0, 1);
}
static void
DrawResizeLine(XmLGridWidget g,
int xy,
int erase)
{
if (g->grid.inMode != InResize)
return;
if (g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE && !g->grid.resizeIsVert)
return;
DrawXORRect(g, xy, 2, g->grid.resizeIsVert, erase);
}
static void
DrawXORRect(XmLGridWidget g,
int xy,
int size,
int isVert,
int erase)
{
Display *dpy;
Window win;
GC gc;
Pixel black, white;
int oldXY, maxX, maxY;
if (!XtIsRealized((Widget)g))
return;
/* erase is (0 == none) (1 == hide/show) (2 == permenent erase) */
dpy = XtDisplay(g);
win = XtWindow(g);
gc = g->grid.gc;
XSetFunction(dpy, gc, GXinvert);
black = BlackPixelOfScreen(XtScreen((Widget)g));
white = WhitePixelOfScreen(XtScreen((Widget)g));
XSetForeground(dpy, gc, black ^ white);
maxX = g->core.width;
if (XtIsManaged(g->grid.vsb))
maxX -= g->grid.vsb->core.width + g->grid.scrollBarMargin;
maxY = g->core.height;
if (XtIsManaged(g->grid.hsb))
maxY -= g->grid.hsb->core.height + g->grid.scrollBarMargin;
oldXY = g->grid.resizeLineXY;
if (isVert)
{
if (oldXY != -1)
XFillRectangle(dpy, win, gc, 0, oldXY, maxX, size);
}
else
{
if (oldXY != -1)
XFillRectangle(dpy, win, gc, oldXY, 0, size, maxY);
}
if (!erase)
{
if (isVert)
{
if (xy > maxY)
xy = maxY - 2;
if (xy < 0)
xy = 0;
XFillRectangle(dpy, win, gc, 0, xy, maxX, size);
}
else
{
if (xy > maxX)
xy = maxX - 2;
if (xy < 0)
xy = 0;
XFillRectangle(dpy, win, gc, xy, 0, size, maxY);
}
g->grid.resizeLineXY = xy;
}
else if (erase == 2)
g->grid.resizeLineXY = -1;
XSetFunction(dpy, gc, GXcopy);
}
static void
DefineCursor(XmLGridWidget g,
char defineCursor)
{
Display *dpy;
Window win;
if (!XtIsRealized((Widget)g))
return;
dpy = XtDisplay(g);
win = XtWindow(g);
if (defineCursor != g->grid.cursorDefined)
XUndefineCursor(dpy, win);
if (defineCursor == CursorVResize)
XDefineCursor(dpy, win, g->grid.vResizeCursor);
else if (defineCursor == CursorHResize)
XDefineCursor(dpy, win, g->grid.hResizeCursor);
g->grid.cursorDefined = defineCursor;
}
static void
DrawArea(XmLGridWidget g,
int type,
int row,
int col)
{
GridReg *reg;
Display *dpy;
Window win;
XExposeEvent event;
XRectangle rect[3];
Region region;
int i, j, n;
Dimension width, height, st;
if (g->grid.layoutFrozen == True)
return;
if (!XtIsRealized((Widget)g))
return;
if (!g->core.visible)
return;
dpy = XtDisplay(g);
win = XtWindow(g);
reg = g->grid.reg;
st = g->manager.shadow_thickness;
if (g->grid.debugLevel > 1)
fprintf(stderr, "XmLGrid: DrawArea %d %d %d\n", type, row, col);
n = 0;
switch (type)
{
case DrawAll:
{
rect[n].x = 0;
rect[n].y = 0;
rect[n].width = g->core.width;
rect[n].height = g->core.height;
n++;
break;
}
case DrawHScroll:
{
for (i = 1; i < 9; i += 3)
{
if (!reg[i].width || !reg[i].height)
continue;
rect[n].x = reg[i].x + st;
rect[n].y = reg[i].y + st;
rect[n].width = reg[i].width - st * 2;
rect[n].height = reg[i].height - st * 2;
n++;
}
break;
}
case DrawVScroll:
{
for (i = 3; i < 6; i++)
{
if (!reg[i].width || !reg[i].height)
continue;
rect[n].x = reg[i].x + st;
rect[n].y = reg[i].y + st;
rect[n].width = reg[i].width - st * 2;
rect[n].height = reg[i].height - st * 2;
n++;
}
break;
}
case DrawRow:
{
for (i = 0; i < 9; i++)
{
if (!reg[i].width || !reg[i].height)
continue;
if (!(row >= reg[i].row &&
row < reg[i].row + reg[i].nrow))
continue;
height = 0;
for (j = reg[i].row; j < row; j++)
height += GetRowHeight(g, j);
rect[n].x = reg[i].x + st;
rect[n].y = reg[i].y + st + height;
rect[n].width = reg[i].width - st * 2;
rect[n].height = GetRowHeight(g, row);
ClipRectToReg(g, &rect[n], ®[i]);
n++;
}
break;
}
case DrawCol:
{
for (i = 0; i < 9; i++)
{
if (!reg[i].width || !reg[i].height)
continue;
if (!(col >= reg[i].col &&
col < reg[i].col + reg[i].ncol))
continue;
width = 0;
for (j = reg[i].col; j < col; j++)
width += GetColWidth(g, j);
rect[n].x = reg[i].x + st + width;
rect[n].y = reg[i].y + st;
rect[n].width = GetColWidth(g, col);
rect[n].height = reg[i].height - st * 2;
ClipRectToReg(g, &rect[n], ®[i]);
n++;
}
break;
}
case DrawCell:
{
if (!RowColToXY(g, row, col, True, &rect[n]))
n++;
break;
}
}
for (i = 0; i < n; i++)
{
if (!rect[i].width || !rect[i].height)
continue;
event.type = Expose;
event.window = win;
event.display = dpy;
event.x = rect[i].x;
event.y = rect[i].y;
event.width = rect[i].width;
event.height = rect[i].height;
event.send_event = True;
event.count = 0;
if (g->grid.immediateDraw)
{
region = XCreateRegion();
XUnionRectWithRegion(&rect[i], region, region);
Redisplay((Widget)g, &event, region);
XDestroyRegion(region);
}
else
XSendEvent(dpy, win, False, ExposureMask, (XEvent *)&event);
if (g->grid.debugLevel > 1)
fprintf(stderr, "XmLGrid: DrawArea expose x %d y %d w %d h %d\n",
event.x, event.y, event.width, event.height);
}
}
static void
ExtendSelectRange(XmLGridWidget g,
int *type,
int *fr,
int *lr,
int *fc,
int *lc)
{
int r, c;
if ((g->grid.selectionPolicy == XmSELECT_MULTIPLE_ROW) ||
(ColPosToType(g, g->grid.extendCol) != XmCONTENT))
*type = SelectRow;
else if (RowPosToType(g, g->grid.extendRow) != XmCONTENT)
*type = SelectCol;
else
*type = SelectCell;
r = g->grid.extendToRow;
if (r < g->grid.headingRowCount)
r = g->grid.headingRowCount;
if (r >= g->grid.headingRowCount + g->grid.rowCount)
r = g->grid.headingRowCount + g->grid.rowCount - 1;
if (*type == SelectCol)
{
*fr = 0;
*lr = 1;
}
else if (g->grid.extendRow < r)
{
*fr = g->grid.extendRow;
*lr = r;
}
else
{
*fr = r;
*lr = g->grid.extendRow;
}
c = g->grid.extendToCol;
if (c < g->grid.headingColCount)
c = g->grid.headingColCount;
if (c >= g->grid.headingColCount + g->grid.colCount)
c = g->grid.headingColCount + g->grid.colCount - 1;
if (*type == SelectRow)
{
*fc = 0;
*lc = 1;
}
else if (g->grid.extendCol < c)
{
*fc = g->grid.extendCol;
*lc = c;
}
else
{
*fc = c;
*lc = g->grid.extendCol;
}
}
static void
ExtendSelect(XmLGridWidget g,
XEvent *event,
Boolean set,
int row,
int col)
{
int type;
int r, fr, lr;
int c, fc, lc;
if (row == -1 || col == -1)
{
g->grid.extendRow = -1;
g->grid.extendCol = -1;
g->grid.extendToRow = -1;
g->grid.extendToCol = -1;
g->grid.extendSelect = True;
return;
}
if (RowPosToType(g, row) == XmFOOTER || ColPosToType(g, col) == XmFOOTER)
return;
if ((g->grid.extendToRow == row && g->grid.extendToCol == col) ||
(g->grid.extendRow == -1 && row == g->grid.focusRow &&
g->grid.extendCol == -1 && col == g->grid.focusCol))
return;
if (g->grid.extendRow != -1 && g->grid.extendCol != -1)
{
/* clear previous extend */
ExtendSelectRange(g, &type, &fr, &lr, &fc, &lc);
for (r = fr; r <= lr; r += 1)
for (c = fc; c <= lc; c += 1)
SelectTypeArea(g, type, event,
RowPosToTypePos(g, XmCONTENT, r),
ColPosToTypePos(g, XmCONTENT, c), False, True);
}
else
{
g->grid.extendRow = g->grid.focusRow;
g->grid.extendCol = g->grid.focusCol;
}
if (set == True)
{
g->grid.extendRow = row;
g->grid.extendCol = col;
}
if (g->grid.extendRow < 0 || g->grid.extendCol < 0)
return;
g->grid.extendToRow = row;
g->grid.extendToCol = col;
/* set new extend */
ExtendSelectRange(g, &type, &fr, &lr, &fc, &lc);
for (r = fr; r <= lr; r += 1)
for (c = fc; c <= lc; c += 1)
SelectTypeArea(g, type, event,
RowPosToTypePos(g, XmCONTENT, r),
ColPosToTypePos(g, XmCONTENT, c),
g->grid.extendSelect, True);
}
static void
SelectTypeArea(XmLGridWidget g,
int type,
XEvent *event,
int row,
int col,
Boolean select,
Boolean notify)
{
Widget w;
XmLGridRow rowp;
XmLGridColumn colp;
XmLGridCell cellp;
int r, fr, lr, hrc;
int c, fc, lc, hcc;
int badPos, hasCB;
XmLGridCallbackStruct cbs;
w = (Widget)g;
hrc = g->grid.headingRowCount;
hcc = g->grid.headingColCount;
cbs.event = event;
cbs.rowType = XmCONTENT;
cbs.columnType = XmCONTENT;
hasCB = 0;
if (select == True)
{
if (type == SelectRow)
cbs.reason = XmCR_SELECT_ROW;
else if (type == SelectCol)
cbs.reason = XmCR_SELECT_COLUMN;
else if (type == SelectCell)
cbs.reason = XmCR_SELECT_CELL;
if (XtHasCallbacks(w, XmNselectCallback) == XtCallbackHasSome)
hasCB = 1;
}
else
{
if (type == SelectRow)
cbs.reason = XmCR_DESELECT_ROW;
else if (type == SelectCol)
cbs.reason = XmCR_DESELECT_COLUMN;
else if (type == SelectCell)
cbs.reason = XmCR_DESELECT_CELL;
if (XtHasCallbacks(w, XmNdeselectCallback) == XtCallbackHasSome)
hasCB = 1;
}
if (row != -1)
{
fr = hrc + row;
lr = fr + 1;
}
else
{
fr = hrc;
lr = XmLArrayGetCount(g->grid.rowArray) - g->grid.footerRowCount;
}
if (col != -1)
{
fc = hcc + col;
lc = fc + 1;
}
else
{
fc = hcc;
lc = XmLArrayGetCount(g->grid.colArray) - g->grid.footerColCount;
}
badPos = 0;
for (r = fr; r < lr; r++)
for (c = fc; c < lc; c++)
{
if (type == SelectRow)
{
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
if (!rowp)
{
badPos = 1;
continue;
}
if (XmLGridRowIsSelected(rowp) == select)
continue;
if (select == True &&
(g->grid.selectionPolicy == XmSELECT_BROWSE_ROW ||
g->grid.selectionPolicy == XmSELECT_SINGLE_ROW))
SelectTypeArea(g, SelectRow, event, -1, 0, False, notify);
XmLGridRowSetSelected(rowp, select);
if (RowIsVisible(g, r))
DrawArea(g, DrawRow, r, 0);
if (notify && hasCB)
{
cbs.row = r - hrc;
if (select == True)
XtCallCallbackList(w, g->grid.selectCallback,
(XtPointer)&cbs);
else
XtCallCallbackList(w, g->grid.deselectCallback,
(XtPointer)&cbs);
}
}
else if (type == SelectCol)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (!colp)
{
badPos = 1;
continue;
}
if (XmLGridColumnIsSelected(colp) == select)
continue;
XmLGridColumnSetSelected(colp, select);
if (ColIsVisible(g, c))
DrawArea(g, DrawCol, 0, c);
if (notify && hasCB)
{
cbs.column = c - hcc;
if (select == True)
XtCallCallbackList(w, g->grid.selectCallback,
(XtPointer)&cbs);
else
XtCallCallbackList(w, g->grid.deselectCallback,
(XtPointer)&cbs);
}
}
else if (type == SelectCell)
{
cellp = GetCell(g, r, c);
if (!cellp)
{
badPos = 1;
continue;
}
if (XmLGridCellIsSelected(cellp) == select)
continue;
XmLGridCellSetSelected(cellp, select);
DrawArea(g, DrawCell, r, c);
if (notify && hasCB)
{
cbs.column = c - hcc;
cbs.row = r - hrc;
if (select == True)
XtCallCallbackList(w, g->grid.selectCallback,
(XtPointer)&cbs);
else
XtCallCallbackList(w, g->grid.deselectCallback,
(XtPointer)&cbs);
}
}
}
if (badPos)
XmLWarning((Widget)g, "SelectTypeArea() - bad position");
}
static int
GetSelectedArea(XmLGridWidget g,
int type,
int *rowPos,
int *colPos,
int count)
{
XmLGridRow row;
XmLGridColumn col;
XmLGridCell cell;
int r, fr, lr;
int c, fc, lc;
int n;
if (type == SelectCol)
{
fr = 0;
lr = 1;
}
else
{
fr = g->grid.headingRowCount;
lr = XmLArrayGetCount(g->grid.rowArray) - g->grid.footerRowCount;
}
if (type == SelectRow)
{
fc = 0;
lc = 1;
}
else
{
fc = g->grid.headingColCount;
lc = XmLArrayGetCount(g->grid.colArray) - g->grid.footerColCount;
}
n = 0;
for (r = fr; r < lr; r++)
for (c = fc; c < lc; c++)
{
if (type == SelectRow)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
if (row && XmLGridRowIsSelected(row) == True)
{
if (rowPos && n < count)
rowPos[n] = r - fr;
n++;
}
}
else if (type == SelectCol)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (col && XmLGridColumnIsSelected(col) == True)
{
if (colPos && n < count)
colPos[n] = c - fc;
n++;
}
}
else if (type == SelectCell)
{
cell = GetCell(g, r, c);
if (cell && XmLGridCellIsSelected(cell) == True)
{
if (rowPos && colPos && n < count)
{
rowPos[n] = r - fr;
colPos[n] = c - fc;
}
n++;
}
}
}
return n;
}
static void
ChangeManaged(Widget w)
{
_XmNavigChangeManaged(w);
}
static void
Resize(Widget w)
{
XmLGridWidget g;
XmLGridCallbackStruct cbs;
g = (XmLGridWidget)w;
if (!g->grid.inResize)
{
cbs.reason = XmCR_RESIZE_GRID;
g->grid.inResize = True;
XtCallCallbackList((Widget)g, g->grid.resizeCallback,
(XtPointer)&cbs);
g->grid.inResize = False;
}
VertLayout(g, 0);
HorizLayout(g, 0);
PlaceScrollbars(g);
DrawArea(g, DrawAll, 0, 0);
}
static void
PlaceScrollbars(XmLGridWidget g)
{
int x, y;
int width, height;
Widget vsb, hsb;
Dimension st, headingRowHeight = 0;
st = g->manager.shadow_thickness;
vsb = g->grid.vsb;
hsb = g->grid.hsb;
width = g->core.width;
if (XtIsManaged(vsb))
width -= vsb->core.width;
if (width <= 0)
width = 1;
y = g->core.height - hsb->core.height;
XtConfigureWidget(hsb, 0, y, width, hsb->core.height, 0);
height = g->core.height;
if (XtIsManaged(hsb))
height -= hsb->core.height;
y = 0;
if (g->grid.headingRowCount > 0)
{
XmLGridRow rowp;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, 0);
headingRowHeight = XmLGridRowHeightInPixels(rowp) + st;
}
if (g->grid.hideUnhideButtons
&& g->grid.hideButton && g->grid.unhideButton)
{
int buttonWidth = vsb->core.width - 4;
if (headingRowHeight == 0)
headingRowHeight = 20;
/* if there is at least heading row, we make the
height of the button the height of the first
heading row.
This is pretty braindead... */
XtConfigureWidget(g->grid.unhideButton,
g->core.width - buttonWidth*2 - st,
y + st,
buttonWidth,
headingRowHeight - st, 0);
XtConfigureWidget(g->grid.hideButton,
g->core.width - buttonWidth - st,
y + st,
buttonWidth,
headingRowHeight - st, 0);
setHideUnhideSensitivity((Widget)g);
/* once we've positioned it, make sure it's managed.
Doing it in this order (position, then manage) reduces
screen flickering -- the button doesn't flash on in the
upper left corner for an instant. */
if (!XtIsManaged(g->grid.hideButton))
XtManageChild(g->grid.hideButton);
if (!XtIsManaged(g->grid.unhideButton))
XtManageChild(g->grid.unhideButton);
}
if (height <= 0)
width = 1;
x = g->core.width - vsb->core.width;
XtConfigureWidget(vsb,
x, y + headingRowHeight + g->manager.shadow_thickness,
vsb->core.width, height - headingRowHeight - g->manager.shadow_thickness,
0);
}
void
_XmLGridLayout(XmLGridWidget g)
{
VertLayout(g, 1);
HorizLayout(g, 1);
}
static void
VertLayout(XmLGridWidget g,
int resizeIfNeeded)
{
GridReg *reg;
int i, j, st2, height, rowCount;
int topNRow, topHeight;
int midRow, midY, midNRow, midHeight;
int botRow, botY, botNRow, botHeight;
int scrollChanged, needsSB, needsResize, cRow;
int maxRow, maxPos, maxHeight, newHeight, sliderSize;
int horizSizeChanged;
XtWidgetGeometry req;
XmLGridCallbackStruct cbs;
XmLGridPreLayoutProc preLayoutProc;
if (g->grid.layoutFrozen == True)
{
g->grid.needsVertLayout = 1;
return;
}
maxRow = maxPos = maxHeight = newHeight = horizSizeChanged = 0;
preLayoutProc = XmLGridClassPartOfWidget(g).preLayoutProc;
if (g->grid.layoutStack < 2 && preLayoutProc != XmInheritGridPreLayout)
horizSizeChanged = preLayoutProc(g, 1);
scrollChanged = 0;
needsResize = 0;
needsSB = 0;
rowCount = XmLArrayGetCount(g->grid.rowArray);
reg = g->grid.reg;
st2 = g->manager.shadow_thickness * 2;
TextAction(g, TEXT_HIDE);
topHeight = 0;
topNRow = g->grid.topFixedCount;
if (topNRow > g->grid.rowCount + g->grid.headingRowCount)
topNRow = g->grid.rowCount + g->grid.headingRowCount;
if (topNRow)
{
topHeight += st2;
for (i = 0; i < topNRow; i++)
topHeight += GetRowHeight(g, i);
}
botHeight = 0;
botNRow = g->grid.bottomFixedCount;
if (topNRow + botNRow > rowCount)
botNRow = rowCount - topNRow;
botRow = rowCount - botNRow;
if (botNRow)
{
botHeight += st2;
for (i = botRow; i < rowCount; i++)
botHeight += GetRowHeight(g, i);
}
height = 0;
if (topNRow)
height += topHeight + g->grid.topFixedMargin;
midY = height;
if (botNRow)
height += botHeight + g->grid.bottomFixedMargin;
if (XtIsManaged(g->grid.hsb))
{
height += g->grid.hsb->core.height;
height += g->grid.scrollBarMargin;
}
maxHeight = g->core.height - height;
if (g->grid.vsPolicy != XmCONSTANT)
{
if (rowCount == topNRow + botNRow)
midHeight = 0;
else
midHeight = st2;
for (i = topNRow; i < rowCount - botNRow; i++)
midHeight += GetRowHeight(g, i);
midRow = topNRow;
midNRow = rowCount - topNRow - botNRow;
needsResize = 1;
newHeight = midHeight + height;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout VARIABLE height\n");
}
else
{
if (maxHeight < st2)
maxHeight = 0;
height = st2;
j = rowCount - botNRow - 1;
for (i = j; i >= topNRow; i--)
{
height += GetRowHeight(g, i);
if (height > maxHeight)
break;
}
i++;
if (i > j)
i = j;
maxRow = i;
if (maxRow < topNRow)
maxRow = topNRow;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout max scroll row %d\n", i);
if (maxRow == topNRow)
{
if (g->grid.scrollRow != topNRow)
{
scrollChanged = 1;
g->grid.scrollRow = topNRow;
}
midRow = topNRow;
midHeight = maxHeight;
midNRow = rowCount - topNRow - botNRow;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout everything fits\n");
}
else
{
if (g->grid.scrollRow < topNRow)
{
scrollChanged = 1;
g->grid.scrollRow = topNRow;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout scrolled < topRow\n");
}
if (g->grid.scrollRow > maxRow)
{
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout scrolled > maxRow\n");
scrollChanged = 1;
g->grid.scrollRow = maxRow;
}
height = st2;
midNRow = 0;
for (i = g->grid.scrollRow; i < rowCount - botNRow; i++)
{
midNRow++;
height += GetRowHeight(g, i);
if (height >= maxHeight)
break;
}
needsSB = 1;
midRow = g->grid.scrollRow;
midHeight = maxHeight;
}
}
botY = midY + midHeight;
if (botNRow)
botY += g->grid.bottomFixedMargin;
for (i = 0; i < 3; i++)
{
reg[i].y = 0;
reg[i].height = topHeight;
reg[i].row = 0;
reg[i].nrow = topNRow;
}
for (i = 3; i < 6; i++)
{
reg[i].y = midY;
reg[i].height = midHeight;
reg[i].row = midRow;
reg[i].nrow = midNRow;
}
for (i = 6; i < 9; i++)
{
reg[i].y = botY;
reg[i].height = botHeight;
reg[i].row = botRow;
reg[i].nrow = botNRow;
}
if (g->grid.debugLevel)
{
fprintf(stderr, "XmLGrid: VertLayout TOP %3dy %3dh %3dr %3dnr\n",
reg[0].y, reg[0].height, reg[0].row, reg[0].nrow);
fprintf(stderr, "XmLGrid: VertLayout MID %3dy %3dh %3dr %3dnr\n",
reg[3].y, reg[3].height, reg[3].row, reg[3].nrow);
fprintf(stderr, "XmLGrid: VertLayout BOT %3dy %3dh %3dr %3dnr\n",
reg[6].y, reg[6].height, reg[6].row, reg[6].nrow);
}
if (needsSB)
{
if (!XtIsManaged(g->grid.vsb))
{
XtManageChild(g->grid.vsb);
horizSizeChanged = 1;
}
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout set sb values\n");
maxPos = PosToVisPos(g, maxRow, 1);
sliderSize = PosToVisPos(g, rowCount - botNRow - 1, 1) - maxPos + 1;
XtVaSetValues(g->grid.vsb,
XmNminimum, PosToVisPos(g, topNRow, 1),
XmNmaximum, maxPos + sliderSize,
XmNsliderSize, sliderSize,
XmNpageIncrement, sliderSize,
XmNvalue, PosToVisPos(g, g->grid.scrollRow, 1),
NULL);
}
else if (g->grid.vsPolicy == XmCONSTANT &&
g->grid.vsbDisplayPolicy == XmSTATIC)
{
if (!XtIsManaged(g->grid.vsb))
{
XtManageChild(g->grid.vsb);
horizSizeChanged = 1;
}
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout vsb not needed but static\n");
XtVaSetValues(g->grid.vsb,
XmNminimum, 0,
XmNmaximum, 1,
XmNsliderSize, 1,
XmNpageIncrement, 1,
XmNvalue, 0,
NULL);
}
else
{
if (XtIsManaged(g->grid.vsb))
{
XtUnmanageChild(g->grid.vsb);
horizSizeChanged = 1;
}
}
if (needsResize && resizeIfNeeded)
{
if (newHeight < 1)
newHeight = 1;
req.request_mode = CWHeight;
req.height = newHeight;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: VertLayout Req h %d\n", (int)newHeight);
XtMakeGeometryRequest((Widget)g, &req, NULL);
PlaceScrollbars(g);
}
if (scrollChanged)
DrawArea(g, DrawVScroll, 0, 0);
TextAction(g, TEXT_SHOW);
cRow = g->grid.scrollRow - g->grid.headingRowCount;
if (cRow != g->grid.cScrollRow)
{
g->grid.cScrollRow = cRow;
cbs.reason = XmCR_SCROLL_ROW;
cbs.rowType = XmCONTENT;
cbs.row = cRow;
XtCallCallbackList((Widget)g, g->grid.scrollCallback, (XtPointer)&cbs);
}
if (horizSizeChanged)
{
if (g->grid.layoutStack > 2)
XmLWarning((Widget)g, "VertLayout() - recursion error");
else
{
g->grid.layoutStack++;
HorizLayout(g, resizeIfNeeded);
g->grid.layoutStack--;
}
PlaceScrollbars(g);
}
}
static void
HorizLayout(XmLGridWidget g,
int resizeIfNeeded)
{
GridReg *reg;
int i, j, st2, width, colCount;
int leftNCol, leftWidth;
int midCol, midX, midNCol, midWidth;
int rightCol, rightX, rightNCol, rightWidth;
int scrollChanged, needsSB, needsResize, cCol;
int maxCol, maxPos, maxWidth, newWidth, sliderSize;
int vertSizeChanged;
XtWidgetGeometry req;
XmLGridCallbackStruct cbs;
XmLGridPreLayoutProc preLayoutProc;
if (g->grid.layoutFrozen == True)
{
g->grid.needsHorizLayout = 1;
return;
}
maxCol = maxPos = newWidth = vertSizeChanged = 0;
preLayoutProc = XmLGridClassPartOfWidget(g).preLayoutProc;
if (g->grid.layoutStack < 2 && preLayoutProc != XmInheritGridPreLayout)
vertSizeChanged = preLayoutProc(g, 0);
scrollChanged = 0;
needsResize = 0;
needsSB = 0;
if (g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE && g->grid.visibleCols)
colCount = g->grid.visibleCols;
else
colCount = g->grid.colCount + g->grid.headingColCount
+ g->grid.footerColCount;
if (g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE)
{
SizeColumnsToFit(g, 0);
}
reg = g->grid.reg;
st2 = g->manager.shadow_thickness * 2;
TextAction(g, TEXT_HIDE);
leftWidth = 0;
leftNCol = g->grid.leftFixedCount;
if (leftNCol > g->grid.colCount + g->grid.headingColCount)
leftNCol = g->grid.colCount + g->grid.headingColCount;
if (leftNCol)
{
leftWidth += st2;
for (i = 0; i < leftNCol; i++)
leftWidth += GetColWidth(g, i);
}
rightWidth = 0;
rightNCol = g->grid.rightFixedCount;
if (rightNCol + leftNCol > colCount)
rightNCol = colCount - leftNCol;
rightCol = colCount - rightNCol;
if (rightNCol)
{
rightWidth += st2;
for (i = rightCol; i < colCount; i++)
rightWidth += GetColWidth(g, i);
}
width = 0;
if (leftNCol)
width += leftWidth + g->grid.leftFixedMargin;
midX = width;
if (rightNCol)
width += rightWidth + g->grid.rightFixedMargin;
if (XtIsManaged(g->grid.vsb))
{
width += g->grid.vsb->core.width;
width += g->grid.scrollBarMargin;
}
maxWidth = g->core.width - width;
if (g->grid.hsPolicy == XmVARIABLE ||
g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE)
{
if (colCount == leftNCol + rightNCol)
midWidth = 0;
else
midWidth = st2;
/* This assumes the show/hide buttons will be wider
than the vertical scrollbar
*/
if (g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE)
{
if (g->grid.hideUnhideButtons)
midWidth += XtWidth(g->grid.hideButton) * 2;
else if (XtIsManaged(g->grid.vsb))
midWidth += XtWidth(g->grid.vsb);
}
for (i = leftNCol; i < colCount - rightNCol; i++)
midWidth += GetColWidth(g, i);
midCol = leftNCol;
midNCol = colCount - leftNCol - rightNCol;
needsResize = 1;
newWidth = midWidth + width;
if (g->grid.debugLevel)
{
if (g->grid.hsPolicy == XmVARIABLE)
fprintf(stderr, "XmLGrid: HorizLayout VARIABLE width\n");
else
fprintf(stderr, "XmLGrid: HorizLayout REZISE_IF_POSSIBLE\n");
}
}
else
{
if (maxWidth < st2)
maxWidth = 0;
width = st2;
j = colCount - rightNCol - 1;
for (i = j; i >= leftNCol; i--)
{
width += GetColWidth(g, i);
if (width > maxWidth)
break;
}
i++;
if (i > j)
i = j;
maxCol = i;
if (maxCol < leftNCol)
maxCol = leftNCol;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: HorizLayout max scroll col %d\n", i);
if (maxCol == leftNCol)
{
if (g->grid.scrollCol != leftNCol)
{
scrollChanged = 1;
g->grid.scrollCol = leftNCol;
}
midCol = leftNCol;
midWidth = maxWidth;
midNCol = colCount - leftNCol - rightNCol;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: HorizLayout everything fits\n");
}
else
{
if (g->grid.scrollCol < leftNCol)
{
scrollChanged = 1;
g->grid.scrollCol = leftNCol;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: HorizLayout scroll < leftCol\n");
}
if (g->grid.scrollCol > maxCol)
{
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: HorizLayout scroll > maxCol\n");
scrollChanged = 1;
g->grid.scrollCol = maxCol;
}
width = st2;
midNCol = 0;
for (i = g->grid.scrollCol; i < colCount - rightNCol; i++)
{
midNCol++;
width += GetColWidth(g, i);
if (width >= maxWidth)
break;
}
needsSB = 1;
midCol = g->grid.scrollCol;
midWidth = maxWidth;
}
}
rightX = midX + midWidth;
if (rightNCol)
rightX += g->grid.rightFixedMargin;
for (i = 0; i < 9; i += 3)
{
reg[i].x = 0;
reg[i].width = leftWidth;
reg[i].col = 0;
reg[i].ncol = leftNCol;
}
for (i = 1; i < 9; i += 3)
{
reg[i].x = midX;
reg[i].width = midWidth;
reg[i].col = midCol;
reg[i].ncol = midNCol;
}
for (i = 2; i < 9; i += 3)
{
reg[i].x = rightX;
reg[i].width = rightWidth;
reg[i].col = rightCol;
reg[i].ncol = rightNCol;
}
if (g->grid.debugLevel)
{
fprintf(stderr, "XmLGrid: HorizLayout LFT %3dx %3dw %3dc %3dnc\n",
reg[0].x, reg[0].width, reg[0].col, reg[0].ncol);
fprintf(stderr, "XmLGrid: HorizLayout MID %3dx %3dw %3dc %3dnc\n",
reg[1].x, reg[1].width, reg[1].col, reg[1].ncol);
fprintf(stderr, "XmLGrid: HorizLayout RHT %3dx %3dw %3dc %3dnc\n",
reg[2].x, reg[2].width, reg[2].col, reg[2].ncol);
}
if (g->grid.hsPolicy == XmCONSTANT && colCount == 1 &&
g->grid.colCount == 1 && width > maxWidth)
{
/* Single Column Pixel Scroll Mode */
if (g->grid.singleColScrollMode)
{
i = g->grid.singleColScrollPos;
if (i < 0)
i = 0;
else if (i > width - maxWidth)
i = width - maxWidth;
}
else
i = 0;
XtVaSetValues(g->grid.hsb,
XmNminimum, 0,
XmNmaximum, width - maxWidth + 1,
XmNsliderSize, 1,
XmNpageIncrement, ((width - maxWidth) / 4) + 1,
XmNvalue, i,
NULL);
if (!XtIsManaged(g->grid.hsb))
{
XtManageChild(g->grid.hsb);
vertSizeChanged = 1;
}
g->grid.singleColScrollMode = 1;
g->grid.singleColScrollPos = i;
}
else
g->grid.singleColScrollMode = 0;
if (g->grid.singleColScrollMode)
;
else if (needsSB)
{
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: HorizLayout set sb values\n");
if (!XtIsManaged(g->grid.hsb))
{
XtManageChild(g->grid.hsb);
vertSizeChanged = 1;
}
maxPos = PosToVisPos(g, maxCol, 0);
sliderSize = PosToVisPos(g, colCount - rightNCol - 1, 0) - maxPos + 1;
XtVaSetValues(g->grid.hsb,
XmNminimum, PosToVisPos(g, leftNCol, 0),
XmNmaximum, maxPos + sliderSize,
XmNsliderSize, sliderSize,
XmNpageIncrement, sliderSize,
XmNvalue, PosToVisPos(g, g->grid.scrollCol, 0),
NULL);
}
else if (g->grid.hsPolicy == XmCONSTANT &&
g->grid.hsbDisplayPolicy == XmSTATIC)
{
if (!XtIsManaged(g->grid.hsb))
{
XtManageChild(g->grid.hsb);
vertSizeChanged = 1;
}
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: HorizLayout hsb not needed - static\n");
XtVaSetValues(g->grid.hsb,
XmNminimum, 0,
XmNmaximum, 1,
XmNsliderSize, 1,
XmNpageIncrement, 1,
XmNvalue, 0,
NULL);
}
else
{
if (XtIsManaged(g->grid.hsb))
{
XtUnmanageChild(g->grid.hsb);
vertSizeChanged = 1;
}
}
if (needsResize && resizeIfNeeded)
{
if (newWidth < 1)
newWidth = 1;
req.request_mode = CWWidth;
req.width = newWidth;
if (g->grid.debugLevel)
fprintf(stderr, "XmLGrid: HorizLayout Req w %d\n", (int)newWidth);
XtMakeGeometryRequest((Widget)g, &req, NULL);
PlaceScrollbars(g);
}
if (scrollChanged)
DrawArea(g, DrawHScroll, 0, 0);
TextAction(g, TEXT_SHOW);
cCol = g->grid.scrollCol - g->grid.headingColCount;
if (cCol != g->grid.cScrollCol)
{
g->grid.cScrollCol = cCol;
cbs.reason = XmCR_SCROLL_COLUMN;
cbs.columnType = XmCONTENT;
cbs.column = cCol;
XtCallCallbackList((Widget)g, g->grid.scrollCallback, (XtPointer)&cbs);
}
if (vertSizeChanged)
{
if (g->grid.layoutStack > 2)
XmLWarning((Widget)g, "HorizLayout() - recursion error");
else
{
g->grid.layoutStack++;
VertLayout(g, resizeIfNeeded);
g->grid.layoutStack--;
}
PlaceScrollbars(g);
}
}
static void
ApplyVisibleRows(XmLGridWidget g)
{
XtWidgetGeometry req;
XmLGridCellRefValues *cellValues;
if (g->grid.vsPolicy != XmCONSTANT)
{
XmLWarning((Widget)g,
"verticalSizePolicy must be XmCONSTANT to set visibleRows");
return;
}
cellValues = g->grid.defCellValues;
req.request_mode = CWHeight;
req.height = g->manager.shadow_thickness * 2 + g->grid.visibleRows *
(4 + cellValues->fontHeight + cellValues->topMargin +
cellValues->bottomMargin);
if (g->grid.hsPolicy == XmCONSTANT &&
g->grid.hsbDisplayPolicy == XmSTATIC)
req.height += g->grid.scrollBarMargin + XtHeight(g->grid.hsb);
XtMakeGeometryRequest((Widget)g, &req, NULL);
}
static void
ApplyVisibleCols(XmLGridWidget g)
{
XtWidgetGeometry req;
XmLGridCellRefValues *cellValues;
if (g->grid.hsPolicy != XmCONSTANT)
{
XmLWarning((Widget)g,
"horizontalSizePolicy must be XmCONSTANT to set visibleColumns");
return;
}
cellValues = g->grid.defCellValues;
req.request_mode = CWWidth;
req.width = g->manager.shadow_thickness * 2 + g->grid.visibleCols *
(4 + 8 * cellValues->fontWidth + cellValues->leftMargin +
cellValues->rightMargin);
if (g->grid.vsPolicy == XmCONSTANT &&
g->grid.vsbDisplayPolicy == XmSTATIC)
req.width += g->grid.scrollBarMargin + XtWidth(g->grid.vsb);
XtMakeGeometryRequest((Widget)g, &req, NULL);
}
static void
VisPosChanged(XmLGridWidget g,
int isVert)
{
if (isVert)
{
g->grid.recalcVertVisPos = 1;
g->grid.vertVisChangedHint = 1;
}
else
g->grid.recalcHorizVisPos = 1;
}
static void
RecalcVisPos(XmLGridWidget g,
int isVert)
{
XmLGridRow row;
XmLGridColumn col;
int i, count, visPos;
if (g->grid.layoutFrozen == True)
XmLWarning((Widget)g, "RecalcVisPos() - layout is frozen");
visPos = 0;
if (isVert)
{
if (!g->grid.recalcVertVisPos)
return;
count = XmLArrayGetCount(g->grid.rowArray);
for (i = 0; i < count; i++)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, i);
XmLGridRowSetVisPos(row, visPos);
if (!XmLGridRowIsHidden(row))
visPos++;
}
g->grid.recalcVertVisPos = 0;
}
else
{
if (!g->grid.recalcHorizVisPos)
return;
count = XmLArrayGetCount(g->grid.colArray);
for (i = 0; i < count; i++)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, i);
XmLGridColumnSetVisPos(col, visPos);
if (!XmLGridColumnIsHidden(col))
visPos++;
}
g->grid.recalcHorizVisPos = 0;
}
}
static int
PosToVisPos(XmLGridWidget g,
int pos,
int isVert)
{
int visPos;
XmLGridRow row;
XmLGridColumn col;
if (isVert)
{
if (!g->grid.hiddenRowCount)
visPos = pos;
else
{
RecalcVisPos(g, isVert);
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, pos);
if (row)
visPos = XmLGridRowGetVisPos(row);
else
visPos = -1;
}
}
else
{
if (!g->grid.hiddenColCount)
visPos = pos;
else
{
RecalcVisPos(g, isVert);
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, pos);
if (col)
visPos = XmLGridColumnGetVisPos(col);
else
visPos = -1;
}
}
if (visPos == -1)
XmLWarning((Widget)g, "PosToVisPos() - invalid pos");
return visPos;
}
static int
VisPosToPos(XmLGridWidget g,
int visPos,
int isVert)
{
XmLGridRow row;
XmLGridColumn col;
int i1, i2, vp1, vp2, ic, mid, val, count;
if (isVert)
{
if (!g->grid.hiddenRowCount)
return visPos;
count = XmLArrayGetCount(g->grid.rowArray);
if (!count)
{
XmLWarning((Widget)g, "VisPosToPos() - called when no rows exist");
return -1;
}
RecalcVisPos(g, isVert);
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, 0);
vp1 = XmLGridRowGetVisPos(row);
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, count - 1);
vp2 = XmLGridRowGetVisPos(row);
if (visPos < vp1 || visPos > vp2)
{
XmLWarning((Widget)g, "VisPosToPos() - invalid Vert visPos");
return -1;
}
}
else
{
if (!g->grid.hiddenColCount)
return visPos;
count = XmLArrayGetCount(g->grid.colArray);
if (!count)
{
XmLWarning((Widget)g, "VisPosToPos() - called when no cols exist");
return -1;
}
RecalcVisPos(g, isVert);
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, 0);
vp1 = XmLGridColumnGetVisPos(col);
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, count - 1);
vp2 = XmLGridColumnGetVisPos(col);
if (visPos < vp1 || visPos > vp2)
{
XmLWarning((Widget)g, "VisPosToPos() - invalid Horiz visPos");
return -1;
}
}
i1 = 0;
i2 = count;
ic = 0;
while (1)
{
mid = i1 + (i2 - i1) / 2;
if (isVert)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, mid);
val = XmLGridRowGetVisPos(row);
}
else
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, mid);
val = XmLGridColumnGetVisPos(col);
}
if (visPos > val)
i1 = mid;
else if (visPos < val)
i2 = mid;
else
break;
if (++ic > 1000)
return -1; /* inf loop */
}
return mid;
}
static unsigned char
ColPosToType(XmLGridWidget g,
int pos)
{
unsigned char type;
if (pos < g->grid.headingColCount)
type = XmHEADING;
else if (pos < g->grid.headingColCount + g->grid.colCount)
type = XmCONTENT;
else
type = XmFOOTER;
return type;
}
static int
ColPosToTypePos(XmLGridWidget g,
unsigned char type,
int pos)
{
int c;
if (type == XmHEADING)
c = pos;
else if (type == XmCONTENT)
c = pos - g->grid.headingColCount;
else
c = pos - g->grid.headingColCount - g->grid.colCount;
return c;
}
static unsigned char
RowPosToType(XmLGridWidget g,
int pos)
{
unsigned char type;
if (pos < g->grid.headingRowCount)
type = XmHEADING;
else if (pos < g->grid.headingRowCount + g->grid.rowCount)
type = XmCONTENT;
else
type = XmFOOTER;
return type;
}
static int
RowPosToTypePos(XmLGridWidget g,
unsigned char type,
int pos)
{
int r;
if (type == XmHEADING)
r = pos;
else if (type == XmCONTENT)
r = pos - g->grid.headingRowCount;
else
r = pos - g->grid.headingRowCount - g->grid.rowCount;
return r;
}
static int
ColTypePosToPos(XmLGridWidget g,
unsigned char type,
int pos,
int allowNeg)
{
if (pos < 0)
{
if (!allowNeg)
return -1;
if (type == XmHEADING)
pos = g->grid.headingColCount;
else if (type == XmFOOTER || type == XmALL_TYPES)
pos = g->grid.headingColCount + g->grid.colCount +
g->grid.footerColCount;
else /* XmCONTENT */
pos = g->grid.headingColCount + g->grid.colCount;
}
else
{
if (type == XmALL_TYPES)
;
else if (type == XmHEADING)
{
if (pos >= g->grid.headingColCount)
return -1;
}
else if (type == XmFOOTER)
{
if (pos >= g->grid.footerColCount)
return -1;
pos += g->grid.headingColCount + g->grid.colCount;
}
else /* XmCONTENT */
{
if (pos >= g->grid.colCount)
return -1;
pos += g->grid.headingColCount;
}
}
return pos;
}
static int
RowTypePosToPos(XmLGridWidget g,
unsigned char type,
int pos,
int allowNeg)
{
if (pos < 0)
{
if (!allowNeg)
return -1;
if (type == XmHEADING)
pos = g->grid.headingRowCount;
else if (type == XmFOOTER || type == XmALL_TYPES)
pos = g->grid.headingRowCount + g->grid.rowCount +
g->grid.footerRowCount;
else /* XmCONTENT */
pos = g->grid.headingRowCount + g->grid.rowCount;
}
else
{
if (type == XmALL_TYPES)
;
else if (type == XmHEADING)
{
if (pos >= g->grid.headingRowCount)
return -1;
}
else if (type == XmFOOTER)
{
if (pos >= g->grid.footerRowCount)
return -1;
pos += g->grid.headingRowCount + g->grid.rowCount;
}
else /* XmCONTENT */
{
if (pos >= g->grid.rowCount)
return -1;
pos += g->grid.headingRowCount;
}
}
return pos;
}
static int
ScrollRowBottomPos(XmLGridWidget g,
int row)
{
int r, h, height;
if (g->grid.vsPolicy == XmVARIABLE)
return -1;
height = g->grid.reg[4].height;
h = 0;
r = row;
while (r >= 0)
{
h += GetRowHeight(g, r);
if (h > height)
break;
r--;
}
if (r != row)
r++;
return r;
}
static int
ScrollColRightPos(XmLGridWidget g,
int col)
{
int c, w, width;
if (g->grid.hsPolicy == XmVARIABLE)
return -1;
width = g->grid.reg[4].width;
w = 0;
c = col;
while (c >= 0)
{
w += GetColWidth(g, c);
if (w >= width)
break;
c--;
}
if (c != col)
c++;
return c;
}
static int
PosIsResize(XmLGridWidget g,
int x,
int y,
int *row,
int *col,
int *isVert)
{
XRectangle rect;
int i, nx, ny, margin;
/* check for bottom resize */
if (g->grid.allowRowResize == True)
for (i = 0; i < 2; i++)
{
nx = x;
ny = y - (4 * i);
if (XYToRowCol(g, nx, ny, row, col) != -1
&& RowColToXY(g, *row, *col, False, &rect) != -1
&& ColPosToType(g, *col) == XmHEADING)
{
margin = ny - (rect.y + rect.height);
if (margin > -5 && margin < 5)
{
*isVert = 1;
return 1;
}
}
}
/* check for right resize */
if (g->grid.allowColResize == True)
for (i = 0; i < 2; i++)
{
XmLGridColumn colp;
int c;
nx = x - (4 * i);
ny = y;
if (XYToRowCol(g, nx, ny, row, col) != -1
&& RowColToXY(g, *row, *col, False, &rect) != -1
&& RowPosToType(g, *row) == XmHEADING
&& *col != XmLArrayGetCount(g->grid.colArray) - 1)
{
Boolean foundResizable = 0;
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, *col);
if (!colp->grid.resizable)
continue;
for (c = *col + 1;
c < XmLArrayGetCount(g->grid.colArray);
c ++)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (colp->grid.resizable
&& (g->grid.hsPolicy != XmRESIZE_IF_POSSIBLE
|| (g->grid.visibleCols == 0
|| c < g->grid.visibleCols))
)
{
foundResizable = True;
break;
}
}
if (!foundResizable) return 0;
margin = nx - (rect.x + rect.width);
if (margin > -5 && margin < 5)
{
*isVert = 0;
return 1;
}
}
}
return 0;
}
int
XmLGridPosIsResize(Widget g,
int x,
int y)
{
int row, col;
int isVert;
return PosIsResize((XmLGridWidget) g, x, y, &row, &col, &isVert);
}
static int
XYToRowCol(XmLGridWidget g,
int x,
int y,
int *row,
int *col)
{
XRectangle xyRect, rect;
GridReg *reg;
int i, r, c;
int width, height;
int st;
reg = g->grid.reg;
st = g->manager.shadow_thickness;
xyRect.x = x;
xyRect.y = y;
xyRect.width = 1;
xyRect.height = 1;
for (i = 0; i < 9; i++)
{
if (!reg[i].width || !reg[i].height)
continue;
rect.x = reg[i].x + st;
rect.y = reg[i].y + st;
rect.width = reg[i].width - st * 2;
rect.height = reg[i].height - st * 2;
if (XmLRectIntersect(&xyRect, &rect) == XmLRectOutside)
continue;
height = 0;
for (r = reg[i].row; r < reg[i].row + reg[i].nrow; r++)
{
width = 0;
for (c = reg[i].col; c < reg[i].col + reg[i].ncol; c++)
{
rect.x = reg[i].x + st + width;
rect.y = reg[i].y + st + height;
rect.width = GetColWidth(g, c);
rect.height = GetRowHeight(g, r);
if (g->grid.singleColScrollMode)
rect.x -= g->grid.singleColScrollPos;
ClipRectToReg(g, &rect, ®[i]);
if (XmLRectIntersect(&xyRect, &rect) != XmLRectOutside)
{
if (!RowColFirstSpan(g, r, c, row, col, 0, True, True))
return 0; /* SUCCESS */
else
return -1;
}
width += GetColWidth(g, c);
}
height += GetRowHeight(g, r);
}
}
return -1;
}
static int
RowColToXY(XmLGridWidget g,
int row,
int col,
Boolean clipped,
XRectangle *rect)
{
XmLGridCell cell;
XmLGridCellRefValues *cellValues;
GridReg *reg;
Dimension st;
int i, r, c, off;
reg = g->grid.reg;
st = g->manager.shadow_thickness;
cell = GetCell(g, row, col);
if (!cell)
return -1;
cellValues = XmLGridCellGetRefValues(cell);
if (!cellValues) return -1;
for (i = 0; i < 9; i++)
{
if (!reg[i].width || !reg[i].height)
continue;
if (!(col >= reg[i].col &&
col < reg[i].col + reg[i].ncol &&
row >= reg[i].row &&
row < reg[i].row + reg[i].nrow))
continue;
off = 0;
for (r = reg[i].row; r < row; r++)
off += GetRowHeight(g, r);
rect->y = reg[i].y + st + off;
rect->height = GetRowHeight(g, row);
if (cellValues->rowSpan)
for (r = row + 1; r <= row + cellValues->rowSpan; r++)
rect->height += GetRowHeight(g, r);
off = 0;
for (c = reg[i].col; c < col; c++)
off += GetColWidth(g, c);
rect->x = reg[i].x + st + off;
rect->width = GetColWidth(g, col);
if (cellValues->columnSpan)
for (c = col + 1; c <= col + cellValues->columnSpan; c++)
rect->width += GetColWidth(g, c);
if (g->grid.singleColScrollMode)
rect->x -= g->grid.singleColScrollPos;
if (clipped == True)
ClipRectToReg(g, rect, ®[i]);
return 0;
}
return -1;
}
static int
RowColFirstSpan(XmLGridWidget g,
int row,
int col,
int *firstRow,
int *firstCol,
XRectangle *rect,
Boolean lookLeft,
Boolean lookUp)
{
XmLGridCell cell;
int done;
done = 0;
while (!done)
{
cell = GetCell(g, row, col);
if (!cell)
return -1;
if (XmLGridCellInRowSpan(cell) == True)
{
if (lookUp == True)
{
row--;
if (rect)
rect->y -= GetRowHeight(g, row);
}
else
row = -1;
if (row < 0)
done = 1;
}
else if (XmLGridCellInColumnSpan(cell) == True)
{
if (lookLeft == True)
{
col--;
if (rect)
rect->x -= GetColWidth(g, col);
}
else
col = -1;
if (col < 0)
done = 1;
}
else
done = 1;
}
if (row < 0 || col < 0)
return -1;
*firstRow = row;
*firstCol = col;
return 0;
}
static void
RowColSpanRect(XmLGridWidget g,
int row,
int col,
XRectangle *rect)
{
XmLGridCell cell;
XmLGridCellRefValues *cellValues;
int r, c;
cell = GetCell(g, row, col);
cellValues = XmLGridCellGetRefValues(cell);
rect->width = 0;
rect->height = 0;
for (r = row; r <= row + cellValues->rowSpan; r++)
rect->height += GetRowHeight(g, r);
for (c = col; c <= col + cellValues->columnSpan; c++)
rect->width += GetColWidth(g, c);
}
static XmLGridCell
GetCell(XmLGridWidget g,
int row,
int col)
{
XmLGridRow rowp;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
if (!rowp)
return 0;
return (XmLGridCell)XmLArrayGet(XmLGridRowCells(rowp), col);
}
static int
GetColWidth(XmLGridWidget g,
int col)
{
XmLGridColumn colp;
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, col);
if (!colp)
return 0;
return XmLGridColumnWidthInPixels(colp);
}
static int
GetRowHeight(XmLGridWidget g,
int row)
{
XmLGridRow rowp;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
if (!rowp)
return 0;
return XmLGridRowHeightInPixels(rowp);
}
static int
ColIsVisible(XmLGridWidget g,
int col)
{
XmLGridColumn c;
int i, c1, c2;
c = (XmLGridColumn)XmLArrayGet(g->grid.colArray, col);
if (!c)
{
XmLWarning((Widget)g, "ColumnIsVisible() - invalid column");
return -1;
}
if (XmLGridColumnIsHidden(c) == True)
return 0;
if (g->grid.hsPolicy != XmCONSTANT)
return 1;
for (i = 0; i < 3; i ++)
{
c1 = g->grid.reg[i].col;
c2 = c1 + g->grid.reg[i].ncol;
if (col >= c1 && col < c2)
return 1;
}
return 0;
}
static int
RowIsVisible(XmLGridWidget g,
int row)
{
XmLGridRow r;
int i, r1, r2;
r = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
if (!r)
{
XmLWarning((Widget)g, "RowIsVisible() - invalid row");
return -1;
}
if (XmLGridRowIsHidden(r) == True)
return 0;
if (g->grid.vsPolicy != XmCONSTANT)
return 1;
for (i = 0; i < 9; i += 3)
{
r1 = g->grid.reg[i].row;
r2 = r1 + g->grid.reg[i].nrow;
if (row >= r1 && row < r2)
return 1;
}
return 0;
}
static XtGeometryResult
GeometryManager(Widget w,
XtWidgetGeometry *request,
XtWidgetGeometry *allow)
{
if (request->request_mode & CWWidth)
w->core.width = request->width;
if (request->request_mode & CWHeight)
w->core.height = request->height;
if (request->request_mode & CWX)
w->core.x = request->x;
if (request->request_mode & CWY)
w->core.y = request->y;
if (request->request_mode & CWBorderWidth)
w->core.border_width = request->border_width;
return XtGeometryYes;
}
static void
ScrollCB(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLGridWidget g;
XmScrollBarCallbackStruct *cbs;
unsigned char orientation;
int visPos;
g = (XmLGridWidget)(XtParent(w));
cbs = (XmScrollBarCallbackStruct *)callData;
visPos = cbs->value;
XtVaGetValues(w, XmNorientation, &orientation, NULL);
if (orientation == XmHORIZONTAL && g->grid.singleColScrollMode)
{
g->grid.singleColScrollPos = visPos;
DrawArea(g, DrawHScroll, 0, 0);
}
else if (orientation == XmVERTICAL)
{
if (visPos == PosToVisPos(g, g->grid.scrollRow, 1))
return;
g->grid.scrollRow = VisPosToPos(g, visPos, 1);
VertLayout(g, 0);
DrawArea(g, DrawVScroll, 0, 0);
}
else
{
if (visPos == PosToVisPos(g, g->grid.scrollCol, 0))
return;
g->grid.scrollCol = VisPosToPos(g, visPos, 0);
HorizLayout(g, 0);
DrawArea(g, DrawHScroll, 0, 0);
}
}
static int
FindNextFocus(XmLGridWidget g,
int row,
int col,
int rowDir,
int colDir,
int *nextRow,
int *nextCol)
{
int traverse;
int hrc, hcc, rc, cc;
XmLGridColumn colp;
XmLGridRow rowp;
XmLGridCell cell;
hcc = g->grid.headingColCount;
cc = g->grid.colCount;
hrc = g->grid.headingRowCount;
rc = g->grid.rowCount;
if (!rc || !cc)
return -1;
if (col < hcc)
col = hcc;
else if (col >= hcc + cc)
col = hcc + cc - 1;
if (row < hrc)
row = hrc;
else if (row >= hrc + rc)
row = hrc + rc - 1;
traverse = 0;
while (1)
{
if (row < hrc || row >= hrc + rc)
break;
if (col < hcc || col >= hcc + cc)
break;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, col);
cell = GetCell(g, row, col);
if (cell &&
RowPosToType(g, row) == XmCONTENT &&
ColPosToType(g, col) == XmCONTENT &&
XmLGridCellInRowSpan(cell) == False &&
XmLGridCellInColumnSpan(cell) == False &&
XmLGridRowIsHidden(rowp) == False &&
XmLGridColumnIsHidden(colp) == False)
{
traverse = 1;
break;
}
if (!rowDir && !colDir)
break;
row += rowDir;
col += colDir;
}
if (!traverse)
return -1;
*nextRow = row;
*nextCol = col;
return 0;
}
static int
SetFocus(XmLGridWidget g,
int row,
int col,
int rowDir,
int colDir)
{
if (FindNextFocus(g, row, col, rowDir, colDir, &row, &col) == -1)
return -1;
ChangeFocus(g, row, col);
return 0;
}
static void
ChangeFocus(XmLGridWidget g,
int row,
int col)
{
XmLGridCell cell;
XmLGridCallbackStruct cbs;
int focusRow, focusCol;
focusRow = g->grid.focusRow;
focusCol = g->grid.focusCol;
g->grid.focusRow = row;
g->grid.focusCol = col;
if (focusRow != -1 && focusCol != -1)
{
cell = GetCell(g, focusRow, focusCol);
if (cell)
{
if (g->grid.highlightRowMode == True)
DrawArea(g, DrawRow, focusRow, 0);
else
DrawArea(g, DrawCell, focusRow, focusCol);
cbs.reason = XmCR_CELL_FOCUS_OUT;
cbs.columnType = ColPosToType(g, focusCol);
cbs.column = ColPosToTypePos(g, cbs.columnType, focusCol);
cbs.rowType = RowPosToType(g, focusRow);
cbs.row = RowPosToTypePos(g, cbs.rowType, focusRow);
XmLGridCellAction(cell, (Widget)g, &cbs);
XtCallCallbackList((Widget)g, g->grid.cellFocusCallback,
(XtPointer)&cbs);
}
}
if (row != -1 && col != -1)
{
cell = GetCell(g, row, col);
if (cell)
{
if (g->grid.highlightRowMode == True)
DrawArea(g, DrawRow, row, 0);
else
DrawArea(g, DrawCell, row, col);
cbs.reason = XmCR_CELL_FOCUS_IN;
cbs.columnType = ColPosToType(g, col);
cbs.column = ColPosToTypePos(g, cbs.columnType, col);
cbs.rowType = RowPosToType(g, row);
cbs.row = RowPosToTypePos(g, cbs.rowType, row);
XmLGridCellAction(cell, (Widget)g, &cbs);
XtCallCallbackList((Widget)g, g->grid.cellFocusCallback,
(XtPointer)&cbs);
}
else
{
if (!XmLArrayGet(g->grid.rowArray, row))
g->grid.focusRow = -1;
if (!XmLArrayGet(g->grid.colArray, col))
g->grid.focusCol = -1;
}
}
}
static void
MakeColVisible(XmLGridWidget g,
int col)
{
int st, width, scrollWidth, scrollCol, prevScrollCol;
if (g->grid.hsPolicy != XmCONSTANT)
return;
if (col < g->grid.leftFixedCount ||
col >= XmLArrayGetCount(g->grid.colArray) - g->grid.rightFixedCount)
return;
st = g->manager.shadow_thickness;
scrollCol = col;
if (col > g->grid.scrollCol)
{
scrollWidth = g->grid.reg[4].width - st * 2;
width = 0;
while (1)
{
width += GetColWidth(g, scrollCol);
if (width > scrollWidth)
break;
if (scrollCol < g->grid.leftFixedCount)
break;
scrollCol--;
}
scrollCol++;
if (scrollCol > col)
scrollCol = col;
/* only scroll if needed */
if (scrollCol < g->grid.scrollCol)
scrollCol = g->grid.scrollCol;
}
if (scrollCol == g->grid.scrollCol)
return;
prevScrollCol = g->grid.scrollCol;
g->grid.scrollCol = scrollCol;
HorizLayout(g, 0);
if (g->grid.scrollCol != prevScrollCol)
DrawArea(g, DrawHScroll, 0, 0);
}
static void
MakeRowVisible(XmLGridWidget g,
int row)
{
int st, height, scrollHeight, scrollRow, prevScrollRow;
if (g->grid.vsPolicy != XmCONSTANT)
return;
if (row < g->grid.topFixedCount ||
row >= XmLArrayGetCount(g->grid.rowArray) - g->grid.bottomFixedCount)
return;
st = g->manager.shadow_thickness;
scrollRow = row;
if (row > g->grid.scrollRow)
{
scrollHeight = g->grid.reg[4].height - st * 2;
height = 0;
while (1)
{
height += GetRowHeight(g, scrollRow);
if (height > scrollHeight)
break;
if (scrollRow < g->grid.topFixedCount)
break;
scrollRow--;
}
scrollRow++;
if (scrollRow > row)
scrollRow = row;
/* only scroll if needed */
if (scrollRow < g->grid.scrollRow)
scrollRow = g->grid.scrollRow;
}
if (scrollRow == g->grid.scrollRow)
return;
prevScrollRow = g->grid.scrollRow;
g->grid.scrollRow = scrollRow;
VertLayout(g, 0);
if (g->grid.scrollRow != prevScrollRow)
DrawArea(g, DrawVScroll, 0, 0);
}
static void
TextAction(XmLGridWidget g,
int action)
{
int row, col, reason, ret, isVisible;
XRectangle rect;
XtTranslations trans;
WidgetClass wc;
XmLGridCell cellp;
XmLGridCallbackStruct cbs;
if (!g->grid.text || !XtIsRealized(g->grid.text))
return;
row = g->grid.focusRow;
col = g->grid.focusCol;
if (row == -1 || col == -1)
return;
isVisible = 0;
if (RowColToXY(g, row, col, True, &rect) != -1)
isVisible = 1;
cellp = GetCell(g, row, col);
if (!cellp)
return;
cbs.rowType = XmCONTENT;
cbs.row = RowPosToTypePos(g, XmCONTENT, row);
cbs.columnType = XmCONTENT;
cbs.column = ColPosToTypePos(g, XmCONTENT, col);
cbs.clipRect = â–
switch (action)
{
case TEXT_EDIT:
case TEXT_EDIT_INSERT:
{
if (g->grid.inEdit || !isVisible)
return;
g->grid.inEdit = 1;
if (action == TEXT_EDIT)
cbs.reason = XmCR_EDIT_BEGIN;
else
cbs.reason = XmCR_EDIT_INSERT;
ret = XmLGridCellAction(cellp, (Widget)g, &cbs);
if (ret)
{
reason = cbs.reason;
cbs.reason = XmCR_CONF_TEXT;
XmLGridCellAction(cellp, (Widget)g, &cbs);
cbs.reason = reason;
wc = g->grid.text->core.widget_class;
trans = (XtTranslations)wc->core_class.tm_table;
XtVaSetValues(g->grid.text, XmNtranslations, trans, NULL);
XtOverrideTranslations(g->grid.text, g->grid.editTrans);
XtMapWidget(g->grid.text);
g->grid.textHidden = 0;
XtCallCallbackList((Widget)g, g->grid.editCallback,
(XtPointer)&cbs);
}
else
g->grid.inEdit = 0;
break;
}
case TEXT_EDIT_CANCEL:
case TEXT_EDIT_COMPLETE:
{
if (!g->grid.inEdit)
return;
if (action == TEXT_EDIT_COMPLETE)
cbs.reason = XmCR_EDIT_COMPLETE;
else
cbs.reason = XmCR_EDIT_CANCEL;
XmLGridCellAction(cellp, (Widget)g, &cbs);
wc = g->grid.text->core.widget_class;
trans = (XtTranslations)wc->core_class.tm_table;
XtVaSetValues(g->grid.text, XmNtranslations, trans, NULL);
XtOverrideTranslations(g->grid.text, g->grid.traverseTrans);
XtCallCallbackList((Widget)g, g->grid.editCallback,
(XtPointer)&cbs);
XmTextSetString(g->grid.text, "");
XmTextSetInsertionPosition(g->grid.text, 0);
g->grid.inEdit = 0;
XtUnmapWidget(g->grid.text);
g->grid.textHidden = 1;
XtConfigureWidget(g->grid.text, 0, 0, 30, 10, 0);
break;
}
case TEXT_HIDE:
{
if (g->grid.textHidden || !isVisible)
return;
XtUnmapWidget(g->grid.text);
g->grid.textHidden = 1;
break;
}
case TEXT_SHOW:
{
if (!g->grid.textHidden || !g->grid.inEdit || !isVisible)
return;
if (rect.width == 0 || rect.height == 0)
TextAction(g, TEXT_EDIT_CANCEL);
else
{
cbs.reason = XmCR_CONF_TEXT;
XmLGridCellAction(cellp, (Widget)g, &cbs);
XtMapWidget(g->grid.text);
g->grid.textHidden = 0;
}
break;
}
}
}
/*
Getting and Setting Values
*/
static void
GetSubValues(Widget w,
ArgList args,
Cardinal *nargs)
{
XmLGridWidget g;
int i, c;
long mask;
XmLGridRow row;
XmLGridColumn col;
XmLGridCell cell;
g = (XmLGridWidget)w;
row = 0;
col = 0;
for (i = 0; i < *nargs; i++)
{
if (!args[i].name)
continue;
if (!strncmp(args[i].name, "row", 3))
{
if (!strcmp(args[i].name, XmNrowPtr))
{
row = (XmLGridRow)args[i].value;
continue;
}
mask = 0;
GetRowValueMask(g, args[i].name, &mask);
if (!mask)
continue;
if (!row)
{
XmLWarning(w, "GetValues() - invalid row");
continue;
}
GetRowValue(g, row, args[i].value, mask);
}
else if (!strncmp(args[i].name, "column", 6))
{
if (!strcmp(args[i].name, XmNcolumnPtr))
{
col = (XmLGridColumn)args[i].value;
continue;
}
mask = 0;
GetColumnValueMask(g, args[i].name, &mask);
if (!mask)
continue;
if (!col)
{
XmLWarning(w, "GetValues() - invalid column");
continue;
}
GetColumnValue(g, col, args[i].value, mask);
}
else if (!strncmp(args[i].name, "cell", 4))
{
mask = 0;
CellValueGetMask(args[i].name, &mask);
if (!mask)
continue;
if (!row || !col)
{
XmLWarning(w, "GetValues() - invalid cell");
continue;
}
c = XmLGridColumnGetPos(col);
cell = (XmLGridCell)XmLArrayGet(XmLGridRowCells(row), c);
GetCellValue(cell, args[i].value, mask);
}
}
}
static void
SetSubValues(Widget w,
ArgList args,
Cardinal *nargs)
{
XmLGridWidget g;
XmLGridRow row;
XmLGridColumn col;
XmLGridCell cell;
XmLGridCellRefValues *values, *newValues, *prevValues;
XmLArray cellArray;
int r, r1, r2, rowsValid;
int c, c1, c2, cd1, cd2, colsValid;
unsigned char rowType, colType;
long rowMask, colMask, cellMask;
int i, nRefValues, allCols;
int needsHorizResize, needsVertResize;
char buf[256];
newValues = (XmLGridCellRefValues *)NULL;
g = (XmLGridWidget)w;
needsHorizResize = 0;
needsVertResize = 0;
rowMask = 0;
colMask = 0;
cellMask = 0;
for (i = 0; i < *nargs; i++)
{
if (!args[i].name)
continue;
if (!strncmp(args[i].name, "row", 3))
{
if (!strcmp(args[i].name, XmNrowPtr))
XmLWarning(w, "SetValues() - can't use XmNrowPtr");
GetRowValueMask(g, args[i].name, &rowMask);
}
else if (!strncmp(args[i].name, "column", 6))
{
if (!strcmp(args[i].name, XmNcolumnPtr))
XmLWarning(w, "SetValues() - can't use XmNcolumnPtr");
GetColumnValueMask(g, args[i].name, &colMask);
}
else if (!strncmp(args[i].name, "cell", 4))
CellValueGetMask(args[i].name, &cellMask);
else if (rowMask || colMask || cellMask)
{
sprintf(buf, "SetValues() - %s is not a row/column/cell resource",
args[i].name);
XmLWarning(w, buf);
}
}
if (rowMask || colMask || cellMask)
{
if (g->grid.rowType == XmINVALID_TYPE)
rowType = XmCONTENT;
else
rowType = g->grid.rowType;
rowsValid = 1;
if (g->grid.cellRowRangeStart != -1 && g->grid.cellRowRangeEnd != -1)
{
r1 = RowTypePosToPos(g, rowType, g->grid.cellRowRangeStart, 0);
r2 = RowTypePosToPos(g, rowType, g->grid.cellRowRangeEnd, 0);
if (r1 < 0 || r2 < 0 || r1 > r2)
rowsValid = 0;
r2++;
}
else if (g->grid.cellRow != -1)
{
r1 = RowTypePosToPos(g, rowType, g->grid.cellRow, 0);
if (r1 == -1)
rowsValid = 0;
r2 = r1 + 1;
}
else
{
r1 = RowTypePosToPos(g, rowType, 0, 0);
if (r1 == -1)
r1 = 0;
r2 = RowTypePosToPos(g, rowType, -1, 1);
}
if (!rowsValid)
{
XmLWarning(w, "SetValues() - invalid row(s) specified");
r1 = 0;
r2 = 0;
}
if (g->grid.colType == XmINVALID_TYPE)
colType = XmCONTENT;
else
colType = g->grid.colType;
colsValid = 1;
if (g->grid.cellColRangeStart != -1 && g->grid.cellColRangeEnd != -1)
{
c1 = ColTypePosToPos(g, colType, g->grid.cellColRangeStart, 0);
c2 = ColTypePosToPos(g, colType, g->grid.cellColRangeEnd, 0);
if (c1 < 0 || c2 < 0 || c1 > c2)
colsValid = 0;
c2++;
}
else if (g->grid.cellCol != -1)
{
c1 = ColTypePosToPos(g, colType, g->grid.cellCol, 0);
if (c1 == -1)
colsValid = 0;
c2 = c1 + 1;
}
else
{
c1 = ColTypePosToPos(g, colType, 0, 0);
if (c1 == -1)
c1 = 0;
c2 = ColTypePosToPos(g, colType, -1, 1);
}
if (!colsValid)
{
XmLWarning(w, "SetValues() - invalid column(s) specified");
c1 = 0;
c2 = 0;
}
if (g->grid.debugLevel)
{
fprintf(stderr, "XmLGrid: SetValues for rows %d to %d\n", r1, r2);
fprintf(stderr, "XmLGrid: & columns %d to %d\n", c1, c2);
}
if (rowMask)
for (r = r1; r < r2; r += g->grid.rowStep)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
if (!row)
continue;
if (SetRowValues(g, row, rowMask))
needsVertResize = 1;
DrawArea(g, DrawRow, r, 0);
}
if (colMask)
for (c = c1; c < c2; c += g->grid.colStep)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (!col)
continue;
if (SetColumnValues(g, col, colMask))
needsHorizResize = 1;
DrawArea(g, DrawCol, 0, c);
}
if (cellMask)
SetCellValuesPreprocess(g, cellMask);
if (cellMask && g->grid.cellDefaults == True)
{
allCols = 0;
if (g->grid.colType == XmINVALID_TYPE &&
g->grid.cellCol == -1 &&
g->grid.cellColRangeStart == -1 &&
g->grid.cellColRangeEnd == -1 &&
g->grid.colStep == 1)
allCols = 1;
if (allCols)
{
/* set cell default values */
newValues = CellRefValuesCreate(g, g->grid.defCellValues);
newValues->refCount = 1;
SetCellRefValues(g, newValues, cellMask);
if (newValues->rowSpan || newValues->columnSpan)
{
newValues->rowSpan = 0;
newValues->columnSpan = 0;
XmLWarning((Widget)g,
"SetValues() - can't set default cell spans");
}
XmLGridCellDerefValues(g->grid.defCellValues);
g->grid.defCellValues = newValues;
cd1 = 0;
cd2 = XmLArrayGetCount(g->grid.colArray);
}
else
{
cd1 = c1;
cd2 = c2;
}
/* set column cell default values */
for (c = cd1; c < cd2; c += g->grid.colStep)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (!col)
continue;
if (allCols && !col->grid.defCellValues)
continue;
if (col->grid.defCellValues)
newValues = CellRefValuesCreate(g, col->grid.defCellValues);
else
newValues = CellRefValuesCreate(g, g->grid.defCellValues);
newValues->refCount = 1;
SetCellRefValues(g, newValues, cellMask);
if (newValues->rowSpan || newValues->columnSpan)
{
newValues->rowSpan = 0;
newValues->columnSpan = 0;
XmLWarning((Widget)g,
"SetValues() - can't set default cell spans");
}
if (col->grid.defCellValues)
XmLGridCellDerefValues(col->grid.defCellValues);
col->grid.defCellValues = newValues;
}
}
else if (cellMask)
{
/* set cell values */
if (SetCellHasRefValues(cellMask))
{
cellArray = XmLArrayNew(0, 0);
XmLArrayAdd(cellArray, -1, (r2 - r1) * (c2 - c1));
nRefValues = 0;
for (r = r1; r < r2; r += g->grid.rowStep)
for (c = c1; c < c2; c += g->grid.colStep)
{
cell = GetCell(g, r, c);
if (!cell)
continue;
SetCellRefValuesPreprocess(g, r, c, cell, cellMask);
XmLArraySet(cellArray, nRefValues, cell);
nRefValues++;
}
XmLArraySort(cellArray, SetCellRefValuesCompare,
(void *)&cellMask, 0, nRefValues);
prevValues = 0;
for (i = 0; i < nRefValues; i++)
{
cell = (XmLGridCell)XmLArrayGet(cellArray, i);
values = XmLGridCellGetRefValues(cell);
if (values != prevValues)
{
newValues = CellRefValuesCreate(g, values);
SetCellRefValues(g, newValues, cellMask);
}
XmLGridCellSetRefValues(cell, newValues);
prevValues = values;
}
XmLArrayFree(cellArray);
}
for (r = r1; r < r2; r += g->grid.rowStep)
for (c = c1; c < c2; c += g->grid.colStep)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
cell = GetCell(g, r, c);
if (!row || !col || !cell)
continue;
if (SetCellValuesResize(g, row, col, cell, cellMask))
{
needsHorizResize = 1;
needsVertResize = 1;
}
SetCellValues(g, cell, cellMask);
if (!needsHorizResize && !needsVertResize)
DrawArea(g, DrawCell, r, c);
}
}
}
if (needsHorizResize)
HorizLayout(g, 1);
if (needsVertResize)
VertLayout(g, 1);
if (needsHorizResize || needsVertResize)
DrawArea(g, DrawAll, 0, 0);
g->grid.rowType = XmINVALID_TYPE;
g->grid.colType = XmINVALID_TYPE;
g->grid.rowStep = 1;
g->grid.colStep = 1;
g->grid.cellRow = -1;
g->grid.cellRowRangeStart = -1;
g->grid.cellRowRangeEnd = -1;
g->grid.cellCol = -1;
g->grid.cellColRangeStart = -1;
g->grid.cellColRangeEnd = -1;
g->grid.cellDefaults = False;
}
static Boolean
SetValues(Widget curW,
Widget reqW,
Widget newW,
ArgList args,
Cardinal *nargs)
{
XmLGridWidget g, cur;
int hc, c, fc, hr, r, fr;
int tfc, bfc, lfc, rfc;
int needsVertLayout, needsHorizLayout, needsRedraw;
XmLGridCellRefValues *cellValues;
g = (XmLGridWidget)newW;
cur = (XmLGridWidget)curW;
needsRedraw = 0;
needsVertLayout = 0;
needsHorizLayout = 0;
#define NE(value) (g->value != cur->value)
if (NE(grid.cScrollCol))
{
g->grid.scrollCol = g->grid.cScrollCol + g->grid.headingColCount;
needsHorizLayout = 1;
needsRedraw = 1;
}
if (NE(grid.cScrollRow))
{
g->grid.scrollRow = g->grid.cScrollRow + g->grid.headingRowCount;
needsVertLayout = 1;
needsRedraw = 1;
}
if (NE(grid.bottomFixedCount) ||
NE(grid.bottomFixedMargin) ||
NE(grid.topFixedCount) ||
NE(grid.topFixedMargin) ||
NE(grid.vsbDisplayPolicy))
{
needsVertLayout = 1;
needsRedraw = 1;
}
if (NE(grid.leftFixedCount) ||
NE(grid.leftFixedMargin) ||
NE(grid.rightFixedCount) ||
NE(grid.rightFixedMargin) ||
NE(grid.hsbDisplayPolicy))
{
needsHorizLayout = 1;
needsRedraw = 1;
}
if (NE(grid.layoutFrozen))
{
if (g->grid.layoutFrozen == False)
{
if (g->grid.needsVertLayout == True)
{
needsVertLayout = 1;
g->grid.needsVertLayout = False;
}
if (g->grid.needsHorizLayout == True)
{
needsHorizLayout = 1;
g->grid.needsHorizLayout = False;
}
needsRedraw = 1;
}
}
if (NE(grid.scrollBarMargin) ||
NE(manager.shadow_thickness) ||
NE(core.border_width) ||
NE(grid.vsPolicy) ||
NE(grid.hsPolicy))
{
needsVertLayout = 1;
needsHorizLayout = 1;
needsRedraw = 1;
}
if (NE(grid.blankBg) ||
NE(grid.highlightThickness) ||
NE(grid.selectBg) ||
NE(grid.selectFg) ||
NE(grid.toggleTopColor) ||
NE(grid.toggleBotColor) ||
NE(grid.shadowRegions) ||
NE(grid.shadowType))
needsRedraw = 1;
if (NE(grid.fontList))
{
XmFontListFree(cur->grid.fontList);
CopyFontList(g);
cellValues = CellRefValuesCreate(g, g->grid.defCellValues);
cellValues->refCount = 1;
XmFontListFree(cellValues->fontList);
cellValues->fontList = XmFontListCopy(g->grid.fontList);
XmLFontListGetDimensions(cellValues->fontList,
&cellValues->fontWidth, &cellValues->fontHeight,
g->grid.useAvgWidth);
XmLGridCellDerefValues(g->grid.defCellValues);
g->grid.defCellValues = cellValues;
}
if (NE(grid.allowDrop))
DropRegister(g, g->grid.allowDrop);
if (g->grid.rowStep < 1)
{
XmLWarning(newW, "SetValues() - rowStep can't be < 1");
g->grid.rowStep = 1;
}
if (g->grid.colStep < 1)
{
XmLWarning(newW, "SetValues() - colStep can't be < 1");
g->grid.colStep = 1;
}
if (NE(grid.hsb) ||
NE(grid.vsb) ||
NE(grid.text))
{
XmLWarning(newW, "SetValues() - child Widgets are read-only");
g->grid.hsb = cur->grid.hsb;
g->grid.vsb = cur->grid.vsb;
g->grid.text = cur->grid.text;
}
if (NE(grid.useTextWidget))
{
XmLWarning(newW, "SetValues() - can't set use of text widget");
g->grid.useTextWidget = cur->grid.useTextWidget;
}
if (NE(grid.hiddenColCount) ||
NE(grid.hiddenRowCount))
{
XmLWarning(newW, "SetValues() - can't set hidden rows or columns");
g->grid.hiddenColCount = cur->grid.hiddenColCount;
g->grid.hiddenRowCount = cur->grid.hiddenRowCount;
}
/* store fixed counts, add/removing rows/columns can change these */
tfc = -1;
bfc = -1;
lfc = -1;
rfc = -1;
if (NE(grid.topFixedCount))
tfc = g->grid.topFixedCount;
if (NE(grid.bottomFixedCount))
bfc = g->grid.bottomFixedCount;
if (NE(grid.leftFixedCount))
lfc = g->grid.leftFixedCount;
if (NE(grid.rightFixedCount))
rfc = g->grid.rightFixedCount;
g->grid.topFixedCount = cur->grid.topFixedCount;
g->grid.bottomFixedCount = cur->grid.bottomFixedCount;
g->grid.leftFixedCount = cur->grid.leftFixedCount;
g->grid.rightFixedCount = cur->grid.rightFixedCount;
hc = g->grid.headingColCount - cur->grid.headingColCount;
c = g->grid.colCount - cur->grid.colCount;
fc = g->grid.footerColCount - cur->grid.footerColCount;
hr = g->grid.headingRowCount - cur->grid.headingRowCount;
r = g->grid.rowCount - cur->grid.rowCount;
fr = g->grid.footerRowCount - cur->grid.footerRowCount;
g->grid.headingColCount = cur->grid.headingColCount;
g->grid.colCount = cur->grid.colCount;
g->grid.footerColCount = cur->grid.footerColCount;
g->grid.headingRowCount = cur->grid.headingRowCount;
g->grid.rowCount = cur->grid.rowCount;
g->grid.footerRowCount = cur->grid.footerRowCount;
if (hc > 0)
XmLGridAddColumns((Widget)g, XmHEADING, -1, hc);
if (hc < 0)
XmLGridDeleteColumns((Widget)g, XmHEADING,
g->grid.headingColCount + hc, -(hc));
if (c > 0)
XmLGridAddColumns((Widget)g, XmCONTENT, -1, c);
if (c < 0)
XmLGridDeleteColumns((Widget)g, XmCONTENT,
g->grid.colCount + c, -(c));
if (fc > 0)
XmLGridAddColumns((Widget)g, XmFOOTER, -1, fc);
if (fc < 0)
XmLGridDeleteColumns((Widget)g, XmFOOTER,
g->grid.footerColCount + fc, -(fc));
if (hr > 0)
XmLGridAddRows((Widget)g, XmHEADING, -1, hr);
if (hr < 0)
XmLGridDeleteRows((Widget)g, XmHEADING,
g->grid.headingRowCount + hr, -(hr));
if (r > 0)
XmLGridAddRows((Widget)g, XmCONTENT, -1, r);
if (r < 0)
XmLGridDeleteRows((Widget)g, XmCONTENT,
g->grid.rowCount + r, -(r));
if (fr > 0)
XmLGridAddRows((Widget)g, XmFOOTER, -1, fr);
if (fr < 0)
XmLGridDeleteRows((Widget)g, XmFOOTER,
g->grid.footerRowCount + fr, -(fr));
/* restore fixed counts if user specified */
if (tfc != -1)
g->grid.topFixedCount = tfc;
if (bfc != -1)
g->grid.bottomFixedCount = bfc;
if (lfc != -1)
g->grid.leftFixedCount = lfc;
if (rfc != -1)
g->grid.rightFixedCount = rfc;
if (g->grid.topFixedCount < g->grid.headingRowCount)
{
XmLWarning(newW,
"SetValues() - can't set topFixedCount < headingRowCount");
g->grid.topFixedCount = cur->grid.topFixedCount;
}
if (g->grid.bottomFixedCount < g->grid.footerRowCount)
{
XmLWarning(newW,
"SetValues() - can't set bottomFixedCount < footerRowCount");
g->grid.bottomFixedCount = cur->grid.bottomFixedCount;
}
if (g->grid.leftFixedCount < g->grid.headingColCount)
{
XmLWarning(newW,
"SetValues() - can't set leftFixedCount < headingColumnCount");
g->grid.leftFixedCount = cur->grid.leftFixedCount;
}
if (g->grid.rightFixedCount < g->grid.footerColCount)
{
XmLWarning(newW,
"SetValues() - can't set rightFixedCount < footerColumnCount");
g->grid.rightFixedCount = cur->grid.rightFixedCount;
}
if (NE(grid.simpleHeadings))
{
if (cur->grid.simpleHeadings)
free((char *)cur->grid.simpleHeadings);
if (g->grid.simpleHeadings)
{
g->grid.simpleHeadings = (char *)strdup(g->grid.simpleHeadings);
SetSimpleHeadings(g, g->grid.simpleHeadings);
}
}
if (NE(grid.simpleWidths))
{
if (cur->grid.simpleWidths)
free((char *)cur->grid.simpleWidths);
if (g->grid.simpleWidths)
{
g->grid.simpleWidths = (char *)strdup(g->grid.simpleWidths);
SetSimpleWidths(g, g->grid.simpleWidths);
}
}
if (NE(grid.visibleRows))
{
ApplyVisibleRows(g);
needsVertLayout = 1;
needsRedraw = 1;
}
if (NE(grid.visibleCols))
{
if (g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE)
XmLGridSetVisibleColumnCount((Widget)g, g->grid.visibleCols);
else
ApplyVisibleCols(g);
needsHorizLayout = 1;
needsRedraw = 1;
}
/* for the hidden columns stuff */
if (NE(grid.hideUnhideButtons))
{
if (g->grid.hideUnhideButtons)
{
CreateHideUnhideButtons(g);
}
else
{
XtDestroyWidget(g->grid.hideButton);
XtDestroyWidget(g->grid.unhideButton);
g->grid.hideButton = 0;
g->grid.unhideButton = 0;
}
needsVertLayout = 1;
needsHorizLayout = 1;
needsRedraw = 1;
}
#undef NE
SetSubValues(newW, args, nargs);
if (needsVertLayout)
VertLayout(g, 1);
if (needsHorizLayout)
HorizLayout(g, 1);
if (needsRedraw)
DrawArea(g, DrawAll, 0, 0);
return (False);
}
static void
CopyFontList(XmLGridWidget g)
{
if (!g->grid.fontList)
g->grid.fontList = XmLFontListCopyDefault((Widget)g);
else
g->grid.fontList = XmFontListCopy(g->grid.fontList);
if (!g->grid.fontList)
XmLWarning((Widget)g, "- fatal error - font list NULL");
}
static Boolean
CvtStringToSizePolicy(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "CONSTANT", XmCONSTANT },
{ "VARIABLE", XmVARIABLE },
{ "RESIZE_IF_POSSIBLE", XmRESIZE_IF_POSSIBLE },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRGridSizePolicy", map, fromVal, toVal);
}
static Boolean
CvtStringToRowColType(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "HEADING", XmHEADING },
{ "CONTENT", XmCONTENT },
{ "FOOTER", XmFOOTER },
{ "ALL_TYPES", XmALL_TYPES },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRRowColType", map, fromVal, toVal);
}
static Boolean
CvtStringToSelectionPolicy(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "SELECT_NONE", XmSELECT_NONE },
{ "SELECT_SINGLE_ROW", XmSELECT_SINGLE_ROW },
{ "SELECT_BROWSE_ROW", XmSELECT_BROWSE_ROW },
{ "SELECT_MULTIPLE_ROW", XmSELECT_MULTIPLE_ROW },
{ "SELECT_CELL", XmSELECT_CELL },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRGridSelectionPolicy", map,
fromVal, toVal);
}
static Boolean
CvtStringToCellAlignment(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "ALIGNMENT_LEFT", XmALIGNMENT_LEFT },
{ "ALIGNMENT_CENTER", XmALIGNMENT_CENTER },
{ "ALIGNMENT_RIGHT", XmALIGNMENT_RIGHT },
{ "ALIGNMENT_TOP_LEFT", XmALIGNMENT_TOP_LEFT },
{ "ALIGNMENT_TOP", XmALIGNMENT_TOP },
{ "ALIGNMENT_TOP_RIGHT", XmALIGNMENT_TOP_RIGHT },
{ "ALIGNMENT_BOTTOM_LEFT", XmALIGNMENT_BOTTOM_LEFT },
{ "ALIGNMENT_BOTTOM", XmALIGNMENT_BOTTOM },
{ "ALIGNMENT_BOTTOM_RIGHT", XmALIGNMENT_BOTTOM_RIGHT },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRGridCellAlignment", map,
fromVal, toVal);
}
static Boolean
CvtStringToCellBorderType(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "BORDER_NONE", XmBORDER_NONE },
{ "BORDER_LINE", XmBORDER_LINE },
{ "BORDER_DASH", XmBORDER_DASH },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRGridCellBorderType", map,
fromVal, toVal);
}
static Boolean
CvtStringToCellType(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "ICON_CELL", XmICON_CELL },
{ "STRING_CELL", XmSTRING_CELL },
{ "PIXMAP_CELL", XmPIXMAP_CELL },
{ "TOGGLE_CELL", XmTOGGLE_CELL },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRGridCellType", map, fromVal, toVal);
}
static void
SetSimpleHeadings(XmLGridWidget g,
char *data)
{
char *c;
int n, count;
if (!data || !*data)
return;
c = data;
n = 1;
while (*c)
{
if (*c == '|')
n++;
c++;
}
count = XmLArrayGetCount(g->grid.colArray);
if (n > count)
{
XmLWarning((Widget)g,
"SetSimpleHeadings() - headings given for non-existing columns");
return;
}
if (g->grid.headingRowCount < 1)
{
XmLWarning((Widget)g, "SetSimpleHeadings() - no heading row exists");
return;
}
XmLGridSetStrings((Widget)g, data);
}
static void
SetSimpleWidths(XmLGridWidget g,
char *data)
{
XmLGridColumn colp;
int i, n, colCount, valid;
Dimension prevWidth;
unsigned char prevSizePolicy;
long mask;
struct WidthRec
{
Dimension width;
unsigned char sizePolicy;
} *widths;
if (!data)
return;
i = ((int)strlen(data) / 2) + 1;
widths = (struct WidthRec *)malloc(i * sizeof(struct WidthRec));
valid = 1;
n = 0;
while (*data)
{
if (*data >= '0' && *data <= '9')
{
widths[n].width = atoi(data);
while (*data >= '0' && *data <= '9')
data++;
}
else
{
valid = 0;
break;
}
if (*data == 'c' || *data == 'C')
{
widths[n].sizePolicy = XmVARIABLE;
data++;
}
else if (*data == 'p' || *data == 'P')
{
widths[n].sizePolicy = XmCONSTANT;
data++;
}
else
{
valid = 0;
break;
}
while (*data == ' ')
data++;
n++;
}
if (!valid)
{
free((char *)widths);
XmLWarning((Widget)g, "SetSimpleWidths() - invalid widths string");
return;
}
colCount = XmLArrayGetCount(g->grid.colArray);
if (n > colCount)
{
free((char *)widths);
XmLWarning((Widget)g,
"SetSimpleWidths() - widths given for non-existing columns");
return;
}
prevWidth = g->grid.colWidth;
prevSizePolicy = g->grid.colSizePolicy;
for (i = 0; i < n; i++)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, i);
if (!colp)
continue;
GetColumnValueMask(g, XmNcolumnWidth, &mask);
GetColumnValueMask(g, XmNcolumnSizePolicy, &mask);
g->grid.colWidth = widths[i].width;
g->grid.colSizePolicy = widths[i].sizePolicy;
SetColumnValues(g, colp, mask);
}
free((char *)widths);
g->grid.colWidth = prevWidth;
g->grid.colSizePolicy = prevSizePolicy;
HorizLayout(g, 1);
DrawArea(g, DrawAll, 0, 0);
}
/*
Getting and Setting Row Values
*/
static void
GetRowValueMask(XmLGridWidget g,
char *s,
long *mask)
{
XmLGridClassPartOfWidget(g).getRowValueMaskProc(g, s, mask);
}
/* Only to be called through Grid class */
static void
_GetRowValueMask(XmLGridWidget g,
char *s,
long *mask)
{
static XrmQuark qHeight, qSizePolicy, qUserData;
static int quarksValid = 0;
XrmQuark q;
if (!quarksValid)
{
qHeight = XrmStringToQuark(XmNrowHeight);
qSizePolicy = XrmStringToQuark(XmNrowSizePolicy);
qUserData = XrmStringToQuark(XmNrowUserData);
quarksValid = 1;
}
q = XrmStringToQuark(s);
if (q == qHeight)
*mask |= XmLGridRowHeight;
else if (q == qSizePolicy)
*mask |= XmLGridRowSizePolicy;
else if (q == qUserData)
*mask |= XmLGridRowUserData;
}
static void
GetRowValue(XmLGridWidget g,
XmLGridRow row,
XtArgVal value,
long mask)
{
XmLGridClassPartOfWidget(g).getRowValueProc(g, row, value, mask);
}
/* Only to be called through Grid class */
static void
_GetRowValue(XmLGridWidget g,
XmLGridRow row,
XtArgVal value,
long mask)
{
switch (mask)
{
case XmLGridRowHeight:
*((Dimension *)value) = row->grid.height;
break;
case XmLGridRowSizePolicy:
*((unsigned char *)value) = row->grid.sizePolicy;
break;
case XmLGridRowUserData:
*((XtPointer *)value) = (XtPointer)row->grid.userData;
break;
}
}
static int
SetRowValues(XmLGridWidget g,
XmLGridRow row,
long mask)
{
return XmLGridClassPartOfWidget(g).setRowValuesProc(g, row, mask);
}
/* Only to be called through Grid class */
static int
_SetRowValues(XmLGridWidget g, XmLGridRow row, long mask)
{
int needsResize = 0, visible = 0;
Boolean newIsHidden;
if (mask & XmLGridRowHeight || mask & XmLGridRowSizePolicy)
{
visible = RowIsVisible(g, XmLGridRowGetPos(row));
XmLGridRowHeightChanged(row);
}
if (mask & XmLGridRowHeight)
{
if (g->grid.rowHeight > 0)
newIsHidden = False;
else
newIsHidden = True;
if (XmLGridRowIsHidden(row) != newIsHidden)
{
if (newIsHidden == True)
g->grid.hiddenRowCount++;
else
g->grid.hiddenRowCount--;
VisPosChanged(g, 1);
needsResize = 1;
}
if (visible && !g->grid.inResize)
needsResize = 1;
row->grid.height = g->grid.rowHeight;
}
if (mask & XmLGridRowSizePolicy)
{
row->grid.sizePolicy = g->grid.rowSizePolicy;
if (visible && !g->grid.inResize)
needsResize = 1;
}
if (mask & XmLGridRowUserData)
row->grid.userData = g->grid.rowUserData;
return needsResize;
}
/*
Getting and Setting Column Values
*/
static void
GetColumnValueMask(XmLGridWidget g,
char *s,
long *mask)
{
XmLGridClassPartOfWidget(g).getColumnValueMaskProc(g, s, mask);
}
/* Only to be called through Grid class */
static void
_GetColumnValueMask(XmLGridWidget g,
char *s,
long *mask)
{
static XrmQuark qWidth, qSizePolicy, qUserData, qResizable;
static XrmQuark qHidden, qSortType;
static int quarksValid = 0;
XrmQuark q;
if (!quarksValid)
{
qWidth = XrmStringToQuark(XmNcolumnWidth);
qSizePolicy = XrmStringToQuark(XmNcolumnSizePolicy);
qUserData = XrmStringToQuark(XmNcolumnUserData);
qResizable = XrmStringToQuark(XmNcolumnResizable);
qHidden = XrmStringToQuark(XmNcolumnHidden);
qSortType = XrmStringToQuark(XmNcolumnSortType);
quarksValid = 1;
}
q = XrmStringToQuark(s);
if (q == qWidth)
*mask |= XmLGridColumnWidth;
else if (q == qSizePolicy)
*mask |= XmLGridColumnSizePolicy;
else if (q == qUserData)
*mask |= XmLGridColumnUserData;
else if (q == qResizable)
*mask |= XmLGridColumnResizable;
else if (q == qHidden)
*mask |= XmLGridColumnHidden;
else if (q == qSortType)
*mask |= XmLGridColumnSortType;
}
static void
GetColumnValue(XmLGridWidget g,
XmLGridColumn col,
XtArgVal value,
long mask)
{
XmLGridClassPartOfWidget(g).getColumnValueProc(g, col, value, mask);
}
/* Only to be called through Grid class */
static void
_GetColumnValue(XmLGridWidget g,
XmLGridColumn col,
XtArgVal value,
long mask)
{
switch (mask)
{
case XmLGridColumnWidth:
*((Dimension *)value) = col->grid.width;
break;
case XmLGridColumnSizePolicy:
*((unsigned char *)value) = col->grid.sizePolicy;
break;
case XmLGridColumnUserData:
*((XtPointer *)value) = col->grid.userData;
break;
case XmLGridColumnResizable:
*((Boolean *)value) = col->grid.resizable;
break;
case XmLGridColumnHidden:
*((Boolean *)value) = col->grid.hidden;
break;
case XmLGridColumnSortType:
*((unsigned char *)value) = col->grid.sort;
break;
}
}
static int
SetColumnValues(XmLGridWidget g,
XmLGridColumn col,
long mask)
{
return XmLGridClassPartOfWidget(g).setColumnValuesProc(g, col, mask);
}
/* Only to be called through Grid class */
static int
_SetColumnValues(XmLGridWidget g, XmLGridColumn col, long mask)
{
int needsResize = 0, visible = 0;
Boolean newIsHidden;
if (mask & XmLGridColumnWidth || mask & XmLGridColumnSizePolicy)
{
visible = ColIsVisible(g, XmLGridColumnGetPos(col));
XmLGridColumnWidthChanged(col);
}
if (mask & XmLGridColumnWidth)
{
if (g->grid.colWidth > 0)
newIsHidden = False;
else
newIsHidden = True;
if (XmLGridColumnIsHidden(col) != newIsHidden)
{
if (newIsHidden == True)
g->grid.hiddenColCount++;
else
g->grid.hiddenRowCount--;
VisPosChanged(g, 0);
needsResize = 1;
}
if (visible && !g->grid.inResize)
needsResize = 1;
col->grid.width = g->grid.colWidth;
}
if (mask & XmLGridColumnSizePolicy)
{
col->grid.sizePolicy = g->grid.colSizePolicy;
if (visible && !g->grid.inResize)
needsResize = 1;
if (col->grid.sizePolicy != XmCONSTANT
&& g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE)
{
XmLWarning((Widget)g, "XmNcolumnSizePolicy must equal XmCONSTANT");
}
}
if (mask & XmLGridColumnUserData)
col->grid.userData = g->grid.colUserData;
if (mask & XmLGridColumnResizable)
col->grid.resizable = g->grid.colResizable;
if (mask & XmLGridColumnHidden)
col->grid.hidden = g->grid.colHidden;
if (mask & XmLGridColumnSortType)
XmLGridSetSort((Widget)g, XmLGridColumnGetPos(col), g->grid.colSortType);
return needsResize;
}
/*
Getting and Setting Cell Values
*/
static void
CellValueGetMask(char *s,
long *mask)
{
static XrmQuark qAlignment, qBackground, qBottomBorderColor;
static XrmQuark qBottomBorderType, qColumnSpan;
static XrmQuark qEditable, qFontList, qForeground;
static XrmQuark qLeftBorderColor, qLeftBorderType;
static XrmQuark qMarginBottom, qMarginLeft, qMarginRight;
static XrmQuark qMarginTop, qPixmap, qPixmapMask;
static XrmQuark qRightBorderColor, qRightBorderType;
static XrmQuark qRowSpan, qString, qToggleSet;
static XrmQuark qTopBorderColor, qTopBorderType, qType;
static XrmQuark qUserData;
static int quarksValid = 0;
XrmQuark q;
if (!quarksValid)
{
qAlignment = XrmStringToQuark(XmNcellAlignment);
qBackground = XrmStringToQuark(XmNcellBackground);
qBottomBorderColor = XrmStringToQuark(XmNcellBottomBorderColor);
qBottomBorderType = XrmStringToQuark(XmNcellBottomBorderType);
qColumnSpan = XrmStringToQuark(XmNcellColumnSpan);
qEditable = XrmStringToQuark(XmNcellEditable);
qFontList = XrmStringToQuark(XmNcellFontList);
qForeground = XrmStringToQuark(XmNcellForeground);
qLeftBorderColor = XrmStringToQuark(XmNcellLeftBorderColor);
qLeftBorderType = XrmStringToQuark(XmNcellLeftBorderType);
qMarginBottom = XrmStringToQuark(XmNcellMarginBottom);
qMarginLeft = XrmStringToQuark(XmNcellMarginLeft);
qMarginRight = XrmStringToQuark(XmNcellMarginRight);
qMarginTop= XrmStringToQuark(XmNcellMarginTop);
qPixmap = XrmStringToQuark(XmNcellPixmap);
qPixmapMask = XrmStringToQuark(XmNcellPixmapMask);
qRightBorderColor = XrmStringToQuark(XmNcellRightBorderColor);
qRightBorderType = XrmStringToQuark(XmNcellRightBorderType);
qRowSpan = XrmStringToQuark(XmNcellRowSpan);
qString = XrmStringToQuark(XmNcellString);
qToggleSet = XrmStringToQuark(XmNcellToggleSet);
qTopBorderColor = XrmStringToQuark(XmNcellTopBorderColor);
qTopBorderType = XrmStringToQuark(XmNcellTopBorderType);
qType = XrmStringToQuark(XmNcellType);
qUserData = XrmStringToQuark(XmNcellUserData);
quarksValid = 1;
}
q = XrmStringToQuark(s);
if (q == qAlignment)
*mask |= XmLGridCellAlignment;
else if (q == qBackground)
*mask |= XmLGridCellBackground;
else if (q == qBottomBorderColor)
*mask |= XmLGridCellBottomBorderColor;
else if (q == qBottomBorderType)
*mask |= XmLGridCellBottomBorderType;
else if (q == qColumnSpan)
*mask |= XmLGridCellColumnSpan;
else if (q == qEditable)
*mask |= XmLGridCellEditable;
else if (q == qFontList)
*mask |= XmLGridCellFontList;
else if (q == qForeground)
*mask |= XmLGridCellForeground;
else if (q == qLeftBorderColor)
*mask |= XmLGridCellLeftBorderColor;
else if (q == qLeftBorderType)
*mask |= XmLGridCellLeftBorderType;
else if (q == qMarginBottom)
*mask |= XmLGridCellMarginBottom;
else if (q == qMarginLeft)
*mask |= XmLGridCellMarginLeft;
else if (q == qMarginRight)
*mask |= XmLGridCellMarginRight;
else if (q == qMarginTop)
*mask |= XmLGridCellMarginTop;
else if (q == qPixmap)
*mask |= XmLGridCellPixmapF;
else if (q == qPixmapMask)
*mask |= XmLGridCellPixmapMask;
else if (q == qRightBorderColor)
*mask |= XmLGridCellRightBorderColor;
else if (q == qRightBorderType)
*mask |= XmLGridCellRightBorderType;
else if (q == qRowSpan)
*mask |= XmLGridCellRowSpan;
else if (q == qString)
*mask |= XmLGridCellString;
else if (q == qToggleSet)
*mask |= XmLGridCellToggleSet;
else if (q == qTopBorderColor)
*mask |= XmLGridCellTopBorderColor;
else if (q == qTopBorderType)
*mask |= XmLGridCellTopBorderType;
else if (q == qType)
*mask |= XmLGridCellType;
else if (q == qUserData)
*mask |= XmLGridCellUserData;
}
static void
GetCellValue(XmLGridCell cell,
XtArgVal value,
long mask)
{
XmLGridCellRefValues *values;
XmLGridCellPixmap *pix;
XmString str;
values = XmLGridCellGetRefValues(cell);
switch (mask)
{
case XmLGridCellAlignment:
*((unsigned char *)value) = values->alignment;
break;
case XmLGridCellBackground:
*((Pixel *)value) = values->background;
break;
case XmLGridCellBottomBorderColor:
*((Pixel *)value) = values->bottomBorderColor;
break;
case XmLGridCellBottomBorderType:
*((unsigned char *)value) = values->bottomBorderType;
break;
case XmLGridCellColumnSpan:
*((int *)value) = values->columnSpan;
break;
case XmLGridCellEditable:
*((Boolean *)value) = values->editable;
break;
case XmLGridCellFontList:
*((XmFontList *)value) = values->fontList;
break;
case XmLGridCellForeground:
*((Pixel *)value) = values->foreground;
break;
case XmLGridCellLeftBorderColor:
*((Pixel *)value) = values->leftBorderColor;
break;
case XmLGridCellLeftBorderType:
*((unsigned char *)value) = values->leftBorderType;
break;
case XmLGridCellMarginBottom:
*((Dimension *)value) = values->bottomMargin;
break;
case XmLGridCellMarginLeft:
*((Dimension *)value) = values->leftMargin;
break;
case XmLGridCellMarginRight:
*((Dimension *)value) = values->rightMargin;
break;
case XmLGridCellMarginTop:
*((Dimension *)value) = values->topMargin;
break;
case XmLGridCellPixmapF:
pix = XmLGridCellGetPixmap(cell);
if (pix)
*((Pixmap *)value) = pix->pixmap;
else
*((Pixmap *)value) = (Pixmap)XmUNSPECIFIED_PIXMAP;
break;
case XmLGridCellPixmapMask:
pix = XmLGridCellGetPixmap(cell);
if (pix)
*((Pixmap *)value) = pix->pixmask;
else
*((Pixmap *)value) = (Pixmap)XmUNSPECIFIED_PIXMAP;
break;
case XmLGridCellRightBorderColor:
*((Pixel *)value) = values->rightBorderColor;
break;
case XmLGridCellRightBorderType:
*((unsigned char *)value) = values->rightBorderType;
break;
case XmLGridCellRowSpan:
*((int *)value) = values->rowSpan;
break;
case XmLGridCellString:
str = XmLGridCellGetString(cell);
if (str)
*((XmString *)value) = XmStringCopy(str);
else
*((XmString *)value) = 0;
break;
case XmLGridCellToggleSet:
*((Boolean *)value) = XmLGridCellGetToggle(cell);
break;
case XmLGridCellTopBorderColor:
*((Pixel *)value) = values->topBorderColor;
break;
case XmLGridCellTopBorderType:
*((unsigned char *)value) = values->topBorderType;
break;
case XmLGridCellType:
*((unsigned char *)value) = values->type;
break;
case XmLGridCellUserData:
*((XtPointer *)value) = (XtPointer)values->userData;
break;
}
}
static XmLGridCellRefValues *
CellRefValuesCreate(XmLGridWidget g,
XmLGridCellRefValues *copy)
{
short width, height;
XmLGridCellRefValues *values;
values = (XmLGridCellRefValues *)malloc(sizeof(XmLGridCellRefValues));
if (!copy)
{
/* default values */
values->bottomBorderType = XmBORDER_LINE;
values->leftBorderType = XmBORDER_LINE;
values->rightBorderType = XmBORDER_LINE;
values->topBorderType = XmBORDER_LINE;
XmLFontListGetDimensions(g->grid.fontList, &width, &height,
g->grid.useAvgWidth);
values->alignment = XmALIGNMENT_CENTER;
values->background = g->core.background_pixel;
values->bottomBorderColor = g->manager.bottom_shadow_color;
values->bottomMargin = 0;
values->columnSpan = 0;
values->editable = False;
values->fontHeight = height;
values->fontList = XmFontListCopy(g->grid.fontList);
values->fontWidth = width;
values->foreground = g->manager.foreground;
values->leftBorderColor = g->manager.top_shadow_color;
values->leftMargin = 0;
values->refCount = 0;
values->rightBorderColor = g->manager.bottom_shadow_color;
values->rightMargin = 0;
values->rowSpan = 0;
values->topBorderColor = g->manager.top_shadow_color;
values->topMargin = 0;
values->type = XmSTRING_CELL;
values->userData = 0;
}
else
{
/* copy values */
*values = *copy;
values->fontList = XmFontListCopy(copy->fontList);
values->refCount = 0;
}
return values;
}
static void
SetCellValuesPreprocess(XmLGridWidget g,
long mask)
{
XmLGridCellRefValues *newValues;
int x, y;
short width, height;
Display *dpy;
Window pixRoot;
unsigned int pixWidth, pixHeight;
unsigned int pixBW, pixDepth;
/* calculate font width and height if set */
newValues = &g->grid.cellValues;
if (mask & XmLGridCellFontList)
{
XmLFontListGetDimensions(newValues->fontList, &width, &height,
g->grid.useAvgWidth);
newValues->fontWidth = width;
newValues->fontHeight = height;
}
if (mask & XmLGridCellPixmapF)
{
if (g->grid.cellPixmap != XmUNSPECIFIED_PIXMAP &&
g->grid.globalPixmapWidth &&
g->grid.globalPixmapHeight)
{
g->grid.cellPixmapWidth = g->grid.globalPixmapWidth;
g->grid.cellPixmapHeight = g->grid.globalPixmapHeight;
}
else if (g->grid.cellPixmap != XmUNSPECIFIED_PIXMAP)
{
dpy = XtDisplay(g);
XGetGeometry(dpy, g->grid.cellPixmap, &pixRoot,
&x, &y, &pixWidth, &pixHeight, &pixBW, &pixDepth);
g->grid.cellPixmapWidth = (Dimension)pixWidth;
g->grid.cellPixmapHeight = (Dimension)pixHeight;
}
else
{
g->grid.cellPixmapWidth = 0;
g->grid.cellPixmapHeight = 0;
}
}
}
static int
SetCellHasRefValues(long mask)
{
long unrefMask;
/* return 1 if mask contains any reference counted values */
unrefMask = XmLGridCellPixmapF | XmLGridCellPixmapMask |
XmLGridCellString | XmLGridCellToggleSet;
mask = mask | unrefMask;
mask = mask ^ unrefMask;
if (!mask)
return 0;
return 1;
}
static int
SetCellValuesResize(XmLGridWidget g,
XmLGridRow row,
XmLGridColumn col,
XmLGridCell cell,
long mask)
{
return XmLGridClassPartOfWidget(g).setCellValuesResizeProc(g, row, col,
cell, mask);
}
static int
_SetCellValuesResize(XmLGridWidget g,
XmLGridRow row,
XmLGridColumn col,
XmLGridCell cell,
long mask)
{
XmLGridCellPixmap *cellPix;
int pixResize, needsResize, rowVisible, colVisible;
needsResize = 0;
pixResize = 0;
if (mask & XmLGridCellPixmapF)
{
pixResize = 1;
if (!(mask & XmLGridCellType))
{
/* no resize needed if we replace with an equal size pixmap */
cellPix = XmLGridCellGetPixmap(cell);
if (cellPix && cellPix->pixmap != XmUNSPECIFIED_PIXMAP &&
g->grid.cellPixmap != XmUNSPECIFIED_PIXMAP)
{
if (cellPix->width == g->grid.cellPixmapWidth &&
cellPix->height == g->grid.cellPixmapHeight)
pixResize = 0;
}
}
}
if (mask & XmLGridCellType || mask & XmLGridCellFontList || pixResize ||
mask & XmLGridCellRowSpan || mask & XmLGridCellColumnSpan ||
mask & XmLGridCellMarginLeft || mask & XmLGridCellMarginRight ||
mask & XmLGridCellMarginTop || mask & XmLGridCellMarginBottom)
{
XmLGridRowHeightChanged(row);
XmLGridColumnWidthChanged(col);
rowVisible = RowIsVisible(g, XmLGridRowGetPos(row));
colVisible = ColIsVisible(g, XmLGridColumnGetPos(col));
if (rowVisible | colVisible)
needsResize = 1;
}
return needsResize;
}
static void
SetCellValues(XmLGridWidget g,
XmLGridCell cell,
long mask)
{
/* set non-reference counted cell values */
if (mask & XmLGridCellPixmapF)
XmLGridCellSetPixmap(cell, g->grid.cellPixmap,
g->grid.cellPixmapWidth, g->grid.cellPixmapHeight);
if (mask & XmLGridCellPixmapMask)
XmLGridCellSetPixmask(cell, g->grid.cellPixmapMask);
if (mask & XmLGridCellString)
XmLGridCellSetString(cell, g->grid.cellString, True);
if (mask & XmLGridCellToggleSet)
XmLGridCellSetToggle(cell, g->grid.cellToggleSet);
}
static void
SetCellRefValues(XmLGridWidget g,
XmLGridCellRefValues *values,
long mask)
{
XmLGridCellRefValues *newValues;
/* set reference counted cell values */
newValues = &g->grid.cellValues;
if (mask & XmLGridCellAlignment)
values->alignment = newValues->alignment;
if (mask & XmLGridCellBackground)
values->background = newValues->background;
if (mask & XmLGridCellBottomBorderColor)
values->bottomBorderColor = newValues->bottomBorderColor;
if (mask & XmLGridCellBottomBorderType)
values->bottomBorderType = newValues->bottomBorderType;
if (mask & XmLGridCellColumnSpan)
values->columnSpan = newValues->columnSpan;
if (mask & XmLGridCellEditable)
values->editable = newValues->editable;
if (mask & XmLGridCellFontList)
{
XmFontListFree(values->fontList);
values->fontList = XmFontListCopy(newValues->fontList);
values->fontWidth = newValues->fontWidth;
values->fontHeight = newValues->fontHeight;
}
if (mask & XmLGridCellForeground)
values->foreground = newValues->foreground;
if (mask & XmLGridCellLeftBorderColor)
values->leftBorderColor = newValues->leftBorderColor;
if (mask & XmLGridCellLeftBorderType)
values->leftBorderType = newValues->leftBorderType;
if (mask & XmLGridCellRightBorderColor)
values->rightBorderColor = newValues->rightBorderColor;
if (mask & XmLGridCellRightBorderType)
values->rightBorderType = newValues->rightBorderType;
if (mask & XmLGridCellMarginBottom)
values->bottomMargin = newValues->bottomMargin;
if (mask & XmLGridCellMarginLeft)
values->leftMargin = newValues->leftMargin;
if (mask & XmLGridCellMarginRight)
values->rightMargin = newValues->rightMargin;
if (mask & XmLGridCellMarginTop)
values->topMargin = newValues->topMargin;
if (mask & XmLGridCellRowSpan)
values->rowSpan = newValues->rowSpan;
if (mask & XmLGridCellTopBorderColor)
values->topBorderColor = newValues->topBorderColor;
if (mask & XmLGridCellTopBorderType)
values->topBorderType = newValues->topBorderType;
if (mask & XmLGridCellType)
{
values->type = newValues->type;
/* backwards compatibility cell types */
if (values->type == XmLABEL_CELL)
{
values->type = XmSTRING_CELL;
values->editable = False;
}
else if (values->type == XmTEXT_CELL)
{
values->type = XmSTRING_CELL;
values->editable = True;
}
}
if (mask & XmLGridCellUserData)
values->userData = newValues->userData;
}
static int
SetCellRefValuesCompare(void *userData,
void **item1,
void **item2)
{
XmLGridCell cell1, cell2;
XmLGridCellRefValues *values1, *values2;
long mask;
mask = *((long *)userData);
cell1 = (XmLGridCell)*item1;
cell2 = (XmLGridCell)*item2;
values1 = XmLGridCellGetRefValues(cell1);
values2 = XmLGridCellGetRefValues(cell2);
if (values1 == values2)
return 0;
#define RVCOMPARE(res, var) \
if (!(mask & res)) \
{ \
if (values1->var < values2->var) \
return -1; \
if (values1->var > values2->var) \
return 1; \
}
RVCOMPARE(XmLGridCellAlignment, alignment)
RVCOMPARE(XmLGridCellBackground, background)
RVCOMPARE(XmLGridCellBottomBorderColor, bottomBorderColor)
RVCOMPARE(XmLGridCellBottomBorderType, bottomBorderType)
RVCOMPARE(XmLGridCellColumnSpan, columnSpan)
RVCOMPARE(XmLGridCellEditable, editable)
RVCOMPARE(XmLGridCellFontList, fontList)
RVCOMPARE(XmLGridCellForeground, foreground)
RVCOMPARE(XmLGridCellLeftBorderColor, leftBorderColor)
RVCOMPARE(XmLGridCellLeftBorderType, leftBorderType)
RVCOMPARE(XmLGridCellMarginBottom, bottomMargin)
RVCOMPARE(XmLGridCellMarginLeft, leftMargin)
RVCOMPARE(XmLGridCellMarginRight, rightMargin)
RVCOMPARE(XmLGridCellMarginTop, topMargin)
RVCOMPARE(XmLGridCellRightBorderColor, rightBorderColor)
RVCOMPARE(XmLGridCellRightBorderType, rightBorderType)
RVCOMPARE(XmLGridCellRowSpan, rowSpan)
RVCOMPARE(XmLGridCellTopBorderColor, topBorderColor)
RVCOMPARE(XmLGridCellTopBorderType, topBorderType)
RVCOMPARE(XmLGridCellType, type)
RVCOMPARE(XmLGridCellUserData, userData)
#undef RVCOMPARE
/* If the two cell values are equal, we merge them
into one record here. This speeds up the sort
and will allow the merge to compare just the values
pointers to test equality. Note that this will not
merge every possible item that could be merged, we
don't want to do that because of the performance impact */
if (values1 < values2)
XmLGridCellSetRefValues(cell1, values2);
else
XmLGridCellSetRefValues(cell2, values1);
return 0;
}
static void
SetCellRefValuesPreprocess(XmLGridWidget g,
int row,
int col,
XmLGridCell cell,
long mask)
{
int r, c, rowSpan, colSpan;
XmLGridCell spanCell;
XmLGridCellRefValues *oldValues, *newValues;
unsigned char oldType, newType;
XmLGridCallbackStruct cbs;
if (mask & XmLGridCellType)
{
oldType = XmLGridCellGetRefValues(cell)->type;
newType = g->grid.cellValues.type;
if (oldType != newType)
{
cbs.reason = XmCR_FREE_VALUE;
XmLGridCellAction(cell, (Widget)g, &cbs);
}
}
if (mask & XmLGridCellRowSpan || mask & XmLGridCellColumnSpan)
{
/* expose old cell area in case the span area shrinks */
DrawArea(g, DrawCell, row, col);
oldValues = XmLGridCellGetRefValues(cell);
newValues = &g->grid.cellValues;
if (mask & XmLGridCellRowSpan)
{
g->grid.mayHaveRowSpans = 1;
if (newValues->rowSpan < 0)
{
XmLWarning((Widget)g,
"SetValues() - row span can't be < 0");
newValues->rowSpan = 0;
}
rowSpan = newValues->rowSpan;
}
else
rowSpan = oldValues->rowSpan;
if (mask & XmLGridCellColumnSpan)
{
if (newValues->columnSpan < 0)
{
XmLWarning((Widget)g,
"SetValues() - column span can't be < 0");
newValues->columnSpan = 0;
}
colSpan = newValues->columnSpan;
}
else
colSpan = oldValues->columnSpan;
/* clear old span */
for (c = col; c <= col + oldValues->columnSpan; c++)
for (r = row; r <= row + oldValues->rowSpan; r++)
{
/* skip the cell itself */
if (c == col && r == row)
continue;
spanCell = GetCell(g, r, c);
if (!spanCell)
continue;
XmLGridCellSetInRowSpan(spanCell, False);
XmLGridCellSetInColumnSpan(spanCell, False);
}
/* set new span */
for (c = col; c <= col + colSpan; c++)
for (r = row; r <= row + rowSpan; r++)
{
/* skip the cell itself */
if (c == col && r == row)
continue;
spanCell = GetCell(g, r, c);
if (!spanCell)
continue;
if (r == row)
XmLGridCellSetInColumnSpan(spanCell, True);
else
XmLGridCellSetInRowSpan(spanCell, True);
}
}
}
/*
Read, Write, Copy, Paste
*/
static int
Read(XmLGridWidget g,
int format,
char delimiter,
int row,
int col,
char *data)
{
char *c1, *c2, buf[256], *bufp;
int r, c, i, j, len, n, needsResize, allowSet, done;
XmString str;
XmLGridCell cell;
XmLGridRow rowp;
XmLGridColumn colp;
XmLGridCellRefValues *cellValues;
XmLGridCallbackStruct cbs;
if (format == XmFORMAT_PAD)
{
XmLWarning((Widget)g, "Read() - FORMAT_PAD not supported");
return 0;
}
if (format == XmFORMAT_XL ||
format == XmFORMAT_DROP ||
format == XmFORMAT_PASTE)
delimiter = '\t';
c1 = data;
c2 = data;
r = row;
c = col;
needsResize = 0;
done = 0;
n = 0;
while (!done)
{
if (!(*c2) || *c2 == delimiter || *c2 == '\n')
{
len = c2 - c1;
if (len < 256)
bufp = buf;
else
bufp = (char *)malloc(len + 1);
if (format == XmFORMAT_XL)
{
/* strip leading and trailing double-quotes */
if (len && c1[0] == '"')
{
c1++;
len--;
}
if (len && c1[len - 1] == '"')
len--;
}
j = 0;
for (i = 0; i < len; i++)
{
if (c1[0] == '\\' && c1[1] == 'n')
{
bufp[j++] = '\n';
c1 += 2;
i++;
}
else
bufp[j++] = *c1++;
}
bufp[j] = 0;
j = 0;
str = XmStringCreateLtoR(bufp, XmSTRING_DEFAULT_CHARSET);
if (bufp != buf)
free((char *)bufp);
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
cell = GetCell(g, r, c);
allowSet = 1;
if (cell && (format == XmFORMAT_PASTE || format == XmFORMAT_DROP))
{
cellValues = XmLGridCellGetRefValues(cell);
if (cellValues->type != XmSTRING_CELL ||
cellValues->editable != True ||
RowPosToType(g, r) != XmCONTENT ||
ColPosToType(g, c) != XmCONTENT)
allowSet = 0;
}
if (cell && allowSet)
{
XmLGridCellSetString(cell, str, False);
if (SetCellValuesResize(g, rowp, colp, cell, XmLGridCellString))
needsResize = 1;
if (!needsResize)
DrawArea(g, DrawCell, r, c);
cbs.columnType = ColPosToType(g, c);
cbs.column = ColPosToTypePos(g, cbs.columnType, c);
cbs.rowType = RowPosToType(g, r);
cbs.row = RowPosToTypePos(g, cbs.rowType, r);
if (format == XmFORMAT_PASTE)
{
cbs.reason = XmCR_CELL_PASTE;
XtCallCallbackList((Widget)g, g->grid.cellPasteCallback,
(XtPointer)&cbs);
}
else if (format == XmFORMAT_DROP)
{
cbs.reason = XmCR_CELL_DROP;
XtCallCallbackList((Widget)g, g->grid.cellDropCallback,
(XtPointer)&cbs);
}
n++;
}
else
XmStringFree(str);
}
if (!(*c2))
done = 1;
else if (*c2 == delimiter)
{
c++;
c1 = c2 + 1;
}
else if (*c2 == '\n')
{
r++;
c = col;
c1 = c2 + 1;
}
c2++;
}
if (needsResize)
{
VertLayout(g, 1);
HorizLayout(g, 1);
DrawArea(g, DrawAll, 0, 0);
}
return n;
}
static void
Write(XmLGridWidget g,
FILE *file,
int format,
char delimiter,
Boolean skipHidden,
int row,
int col,
int nrow,
int ncol)
{
int r, c, i, first, last;
char *cs = NULL;
Boolean set;
XmString str;
XmLGridColumn colp;
XmLGridRow rowp;
XmLGridCell cell;
first = 1;
for (r = row; r < row + nrow; r++)
{
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
if (!rowp)
continue;
if (skipHidden == True && XmLGridRowIsHidden(rowp) == True)
continue;
if (first)
first = 0;
else
fprintf(file, "\n");
for (c = col; c < col + ncol; c++)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (!colp)
continue;
if (skipHidden == True && XmLGridColumnIsHidden(colp) == True)
continue;
cell = GetCell(g, r, c);
if (!cell)
continue;
str = XmLGridCellGetString(cell);
set = False;
if (str)
{
cs = CvtXmStringToStr(str);
if (cs)
set = True;
}
if (set == False)
cs = "";
fprintf(file, "%s", cs);
last = 0;
if (c == col + ncol - 1)
last = 1;
if (!last && format == XmFORMAT_DELIMITED)
fprintf(file, "%c", delimiter);
else if (!last && format == XmFORMAT_XL)
fprintf(file, "\t");
else if (format == XmFORMAT_PAD)
{
if (colp->grid.sizePolicy == XmVARIABLE)
for (i = 0; i < (int)(colp->grid.width - strlen(cs)); i++)
fprintf(file, " ");
}
if (set == True)
free(cs);
}
}
}
static char *
CopyDataCreate(XmLGridWidget g, int selected, int row, int col, int nrow, int ncol)
{
XmLGridColumn colp;
XmLGridRow rowp;
XmLGridCell cell;
char *buf, *cs = NULL;
XmString str;
Boolean set;
int r, c, wroteStr, bufsize, buflen, len;
if (selected)
{
row = 0;
nrow = XmLArrayGetCount(g->grid.rowArray);
col = 0;
ncol = XmLArrayGetCount(g->grid.colArray);
}
bufsize = 1024;
buflen = 0;
buf = (char *)malloc(bufsize);
for (r = row; r < row + nrow; r++)
{
wroteStr = 0;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
if (!rowp)
continue;
for (c = col; c < col + ncol; c++)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (!colp)
continue;
cell = GetCell(g, r, c);
if (!cell)
continue;
if (selected &&
XmLGridRowIsSelected(rowp) == False &&
XmLGridColumnIsSelected(colp) == False &&
XmLGridCellIsSelected(cell) == False)
continue;
str = XmLGridCellGetString(cell);
set = False;
if (str)
{
cs = CvtXmStringToStr(str);
if (cs)
set = True;
}
if (set == False)
cs = "";
if (wroteStr)
buf[buflen++] = '\t';
len = strlen(cs);
/* allocate if string plus tab plus new-line plus 0 if too large */
while (len + buflen + 3 > bufsize)
bufsize *= 2;
buf = (char *)realloc(buf, bufsize);
strcpy(&buf[buflen], cs);
buflen += len;
if (set == True)
free(cs);
wroteStr = 1;
}
if (wroteStr)
buf[buflen++] = '\n';
}
if (!buflen)
{
free((char *)buf);
return 0;
}
buf[buflen - 1] = 0;
return buf;
}
static Boolean
Copy(XmLGridWidget g,
Time time,
int selected,
int row,
int col,
int nrow,
int ncol)
{
int i;
long itemID;
Display *dpy;
Window win;
XmString clipStr;
char *buf;
#ifdef MOTIF11
int dataID;
#else
long ldataID;
#endif
if (!XtIsRealized((Widget)g))
{
XmLWarning((Widget)g, "Copy() - widget not realized");
return False;
}
dpy = XtDisplay((Widget)g);
win = XtWindow((Widget)g);
buf = CopyDataCreate(g, selected, row, col, nrow, ncol);
if (!buf)
return False;
clipStr = XmStringCreateSimple("Grid Copy");
for (i = 0; i < 10000; i++)
if (XmClipboardStartCopy(dpy, win, clipStr, time, NULL,
NULL, &itemID) == ClipboardSuccess)
break;
XmStringFree(clipStr);
if (i == 10000)
{
XmLWarning((Widget)g, "Copy() - start clipboard copy failed");
return False;
}
for (i = 0; i < 10000; i++)
#ifdef MOTIF11
if (XmClipboardCopy(dpy, win, itemID, "STRING", buf,
(long)strlen(buf) + 1, 0, &dataID) == ClipboardSuccess)
#else
if (XmClipboardCopy(dpy, win, itemID, "STRING", buf,
(long)strlen(buf) + 1, 0, &ldataID) == ClipboardSuccess)
#endif
break;
free((char *)buf);
if (i == 10000)
{
XmLWarning((Widget)g, "Copy() - clipboard copy transfer failed");
return False;
}
for (i = 0; i < 10000; i++)
if (XmClipboardEndCopy(dpy, win, itemID) == ClipboardSuccess)
break;
if (i == 10000)
{
XmLWarning((Widget)g, "Copy() - end clipboard copy failed");
return False;
}
return True;
}
static Boolean
Paste(XmLGridWidget g,
int row,
int col)
{
Display *dpy;
Window win;
int i, res, done;
unsigned long len, reclen;
char *buf;
if (!XtIsRealized((Widget)g))
{
XmLWarning((Widget)g, "Paste() - widget not realized");
return False;
}
dpy = XtDisplay((Widget)g);
win = XtWindow((Widget)g);
for (i = 0; i < 10000; i++)
if (XmClipboardInquireLength(dpy, win, "STRING", &len) ==
ClipboardSuccess)
break;
if (i == 10000)
{
XmLWarning((Widget)g, "Paste() - can't retrieve clipboard length");
return False;
}
if (!len)
return False;
buf = (char *)malloc((int)len);
done = 0;
while (!done)
{
res = XmClipboardRetrieve(dpy, win, "STRING", buf, len,
&reclen, NULL);
switch (res)
{
case ClipboardSuccess:
done = 2;
break;
case ClipboardTruncate:
case ClipboardNoData:
done = 1;
break;
case ClipboardLocked:
break;
}
}
if (done != 2 || reclen != len)
{
free((char *)buf);
XmLWarning((Widget)g, "Paste() - retrieve from clipboard failed");
return False;
}
Read(g, XmFORMAT_PASTE, 0, row, col, buf);
free((char *)buf);
return True;
}
/*
Utility
*/
static void
GetCoreBackground(Widget w,
int offset,
XrmValue *value)
{
value->addr = (caddr_t)&w->core.background_pixel;
}
static void
GetManagerForeground(Widget w,
int offset,
XrmValue *value)
{
XmLGridWidget g;
g = (XmLGridWidget)w;
value->addr = (caddr_t)&g->manager.foreground;
}
static void
ClipRectToReg(XmLGridWidget g,
XRectangle *rect,
GridReg *reg)
{
int i, st;
XRectangle regRect;
st = g->manager.shadow_thickness;
if (!reg->width || !reg->height)
i = XmLRectOutside;
else
{
regRect.x = reg->x + st;
regRect.y = reg->y + st;
regRect.width = reg->width - st * 2;
regRect.height = reg->height - st * 2;
i = XmLRectIntersect(rect, ®Rect);
}
if (i == XmLRectInside)
return;
if (i == XmLRectOutside)
{
rect->width = 0;
rect->height = 0;
return;
}
if (rect->y + (int)rect->height - 1 >= reg->y + (int)reg->height - st)
rect->height = reg->y + reg->height - rect->y - st;
if (rect->x + (int)rect->width - 1 >= reg->x + (int)reg->width - st)
rect->width = reg->x + reg->width - rect->x - st;
if (rect->y < reg->y + st)
{
rect->height -= (reg->y + st) - rect->y;
rect->y = reg->y + st;
}
if (rect->x < reg->x + st)
{
rect->width -= (reg->x + st) - rect->x;
rect->x = reg->x + st;
}
}
static char *
FileToString(FILE *file)
{
long len, n;
char *s;
if (!file)
return 0;
fseek(file, 0L, 2);
len = ftell(file);
s = (char *)malloc((int)len + 1);
if (!s)
return 0;
s[len] = 0;
fseek(file, 0L, 0);
n = fread(s, 1, (int)len, file);
if (n != len)
{
free((char *)s);
return 0;
}
return s;
}
static char *
CvtXmStringToStr(XmString str)
{
XmStringContext context;
XmStringCharSet charset;
XmStringDirection dir;
Boolean sep;
char *text, *c;
int len, size;
if (!XmStringInitContext(&context, str))
return 0;
size = 0;
c = 0;
while (XmStringGetNextSegment(context, &text, &charset, &dir, &sep))
{
len = strlen(text);
size += len + 3;
if (!c)
{
c = (char *)malloc(size);
*c = 0;
}
else
c = (char *)realloc(c, size);
strcat(c, text);
if (sep == True)
{
len = strlen(c);
c[len] = '\\';
c[len + 1] = 'n';
c[len + 2] = 0;
}
XtFree(text);
XtFree(charset);
}
XmStringFreeContext(context);
return c;
}
static XmLGridWidget
WidgetToGrid(Widget w,
char *funcname)
{
char buf[256];
if (!XmLIsGrid(w))
{
sprintf(buf, "%s - widget not an XmLGrid", funcname);
XmLWarning(w, buf);
return 0;
}
return (XmLGridWidget)w;
}
/*
Actions, Callbacks and Handlers
*/
static void
ButtonMotion(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
XMotionEvent *me;
char dragTimerSet;
int row, col, x, y;
if (event->type != MotionNotify)
return;
g = (XmLGridWidget)w;
me = (XMotionEvent *)event;
if (g->grid.inMode == InResize)
{
if (g->grid.resizeIsVert)
DrawResizeLine(g, me->y, 0);
else
{
DrawResizeLine(g, me->x, 0);
if (g->grid.hsPolicy == XmRESIZE_IF_POSSIBLE)
ResizeColumnToFit(g, me->x);
}
}
/* drag scrolling */
dragTimerSet = 0;
if (g->grid.inMode == InSelect)
{
if (g->grid.vsPolicy == XmCONSTANT)
{
y = g->grid.reg[4].y;
if (g->grid.selectionPolicy == XmSELECT_CELL &&
g->grid.extendRow != -1 &&
g->grid.extendCol != -1 &&
RowPosToType(g, g->grid.extendRow) == XmHEADING)
;
else if (me->y < y)
dragTimerSet |= DragUp;
y += g->grid.reg[4].height;
if (me->y > y)
dragTimerSet |= DragDown;
}
if (g->grid.hsPolicy == XmCONSTANT)
{
x = g->grid.reg[4].x;
if (g->grid.selectionPolicy == XmSELECT_CELL &&
g->grid.extendCol != -1 &&
g->grid.extendRow != -1 &&
ColPosToType(g, g->grid.extendCol) == XmHEADING)
;
else if (me->x < x)
dragTimerSet |= DragLeft;
x += g->grid.reg[4].width;
if (me->x > x)
dragTimerSet |= DragRight;
}
}
if (!g->grid.dragTimerSet && dragTimerSet)
g->grid.dragTimerId = XtAppAddTimeOut(XtWidgetToApplicationContext(w),
80, DragTimer, (caddr_t)g);
else if (g->grid.dragTimerSet && !dragTimerSet)
XtRemoveTimeOut(g->grid.dragTimerId);
g->grid.dragTimerSet = dragTimerSet;
/* Extend Selection */
if (g->grid.inMode == InSelect && XYToRowCol(g, me->x, me->y,
&row, &col) != -1)
{
TextAction(g, TEXT_EDIT_CANCEL);
if (g->grid.selectionPolicy == XmSELECT_MULTIPLE_ROW &&
RowPosToType(g, row) == XmCONTENT)
ExtendSelect(g, event, False, row, col);
else if (g->grid.selectionPolicy == XmSELECT_CELL)
ExtendSelect(g, event, False, row, col);
}
if (g->grid.inMode == InSelect &&
g->grid.selectionPolicy == XmSELECT_BROWSE_ROW &&
XYToRowCol(g, me->x, me->y, &row, &col) != -1)
{
if (RowPosToType(g, row) == XmCONTENT)
{
if (!SetFocus(g, row, col, 0, 1))
SelectTypeArea(g, SelectRow, event,
RowPosToTypePos(g, XmCONTENT,
g->grid.focusRow), 0, True, True);
}
}
}
static void
DragTimer(XtPointer clientData,
XtIntervalId *intervalId)
{
Widget w;
XmLGridWidget g;
XRectangle rect;
XmLGridRow rowp;
XmLGridColumn colp;
int r, c, min, max, inc, pi, ss, value, newValue;
int extRow, extCol;
g = (XmLGridWidget)clientData;
w = (Widget)g;
extRow = -1;
extCol = -1;
if (g->grid.vsPolicy == XmCONSTANT && ((g->grid.dragTimerSet & DragUp) ||
(g->grid.dragTimerSet & DragDown)))
{
XtVaGetValues(g->grid.vsb,
XmNminimum, &min,
XmNmaximum, &max,
XmNvalue, &value,
XmNsliderSize, &ss,
XmNincrement, &inc,
XmNpageIncrement, &pi,
NULL);
newValue = value;
if (g->grid.dragTimerSet & DragUp)
newValue--;
else
newValue++;
if (newValue != value && newValue >= min && newValue <= (max - ss))
{
XmScrollBarSetValues(g->grid.vsb, newValue, ss, inc, pi, True);
r = g->grid.reg[4].row;
if (g->grid.dragTimerSet & DragDown)
r += g->grid.reg[4].nrow - 1;
/* simple check to make sure row selected is totally visible */
if (g->grid.reg[4].nrow)
{
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, r);
if (rowp && !RowColToXY(g, r, 0, True, &rect))
{
if (GetRowHeight(g, r) != rect.height)
r--;
}
}
if (g->grid.selectionPolicy == XmSELECT_BROWSE_ROW)
{
if (!SetFocus(g, r, g->grid.focusCol, -1, 1))
SelectTypeArea(g, SelectRow, (XEvent *)0,
RowPosToTypePos(g, XmCONTENT, g->grid.focusRow),
0, True, True);
}
else if (g->grid.selectionPolicy == XmSELECT_MULTIPLE_ROW)
ExtendSelect(g, (XEvent *)0, False, r, g->grid.focusCol);
else if (g->grid.selectionPolicy == XmSELECT_CELL)
{
extRow = r;
extCol = g->grid.extendToCol;
}
}
}
if (g->grid.hsPolicy == XmCONSTANT && ((g->grid.dragTimerSet & DragLeft) ||
(g->grid.dragTimerSet & DragRight)))
{
XtVaGetValues(g->grid.hsb,
XmNminimum, &min,
XmNmaximum, &max,
XmNvalue, &value,
XmNsliderSize, &ss,
XmNincrement, &inc,
XmNpageIncrement, &pi,
NULL);
newValue = value;
if (g->grid.dragTimerSet & DragLeft)
newValue--;
else
newValue++;
if (newValue != value && newValue >= min && newValue <= (max - ss))
{
XmScrollBarSetValues(g->grid.hsb, newValue, ss, inc, pi, True);
c = g->grid.reg[4].col;
if (g->grid.dragTimerSet & DragRight)
c += g->grid.reg[4].ncol - 1;
if (g->grid.selectionPolicy == XmSELECT_CELL)
{
/* simple check to make sure col selected is totally visible */
if (g->grid.reg[4].ncol)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, c);
if (colp && !RowColToXY(g, c, 0, True, &rect))
{
if (GetColWidth(g, c) != rect.width)
c--;
}
}
if (extRow == -1)
extRow = g->grid.extendToRow;
extCol = c;
}
}
}
if (extRow != -1 && extCol != -1)
ExtendSelect(g, (XEvent *)0, False, extRow, extCol);
g->grid.dragTimerId = XtAppAddTimeOut(XtWidgetToApplicationContext(w),
80, DragTimer, (caddr_t)g);
}
/*----------------------------------------------------------------------*/
static void
CursorMotion(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
XMotionEvent *me;
int isVert, row, col;
char defineCursor;
if (event->type != MotionNotify)
return;
g = (XmLGridWidget)w;
me = (XMotionEvent *)event;
defineCursor = CursorNormal;
{
int motionRow;
int motionCol;
int newMotionRow = -1;
int newMotionCol = -1;
Boolean invokeEnterCellCallback = False;
if (XYToRowCol(g,me->x,me->y,&motionRow,&motionCol) != -1)
{
if (motionRow != g->grid.lastCursorMotionRow ||
motionCol != g->grid.lastCursorMotionCol)
{
newMotionRow = motionRow;
newMotionCol = motionCol;
invokeEnterCellCallback = True;
}
}
if (g->grid.lastCursorMotionRow != -1 &&
g->grid.lastCursorMotionCol != -1)
{
/* Invoke XmNleaveCellCallback */
GridInvokeCellCrossingCallbacks(w,
g->grid.leaveCellCallback,
XmCR_LEAVE_CELL,
event,
g->grid.lastCursorMotionRow,
g->grid.lastCursorMotionCol);
}
if (invokeEnterCellCallback)
{
/* Invoke XmNenterCellCallback */
GridInvokeCellCrossingCallbacks(w,
g->grid.enterCellCallback,
XmCR_ENTER_CELL,
event,
newMotionRow,
newMotionCol);
}
g->grid.lastCursorMotionRow = newMotionRow;
g->grid.lastCursorMotionCol = newMotionCol;
}
if (PosIsResize(g, me->x, me->y, &row, &col, &isVert))
{
if (isVert)
defineCursor = CursorVResize;
else
defineCursor = CursorHResize;
}
DefineCursor(g, defineCursor);
}
/*----------------------------------------------------------------------*/
static void
Edit(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
g = (XmLGridWidget)XtParent(w);
TextAction(g, TEXT_EDIT_INSERT);
}
static void
EditCancel(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
g = (XmLGridWidget)XtParent(w);
TextAction(g, TEXT_EDIT_CANCEL);
}
static void
EditComplete(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
g = (XmLGridWidget)XtParent(w);
TextAction(g, TEXT_EDIT_COMPLETE);
if (*nparam == 1)
Traverse(w, event, params, nparam);
}
#ifndef MOTIF11
extern Widget _XmGetTextualDragIcon(Widget);
#endif
static void
DragStart(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
#ifndef MOTIF11
XmLGridWidget g;
Widget dragIcon;
Atom exportTargets[1];
Arg args[10];
char *data;
XButtonEvent *be;
int row, col;
XmLGridColumn colp;
XmLGridRow rowp;
XmLGridCell cell;
static XtCallbackRec dragFinish[2] =
{ { DragFinish, NULL }, { NULL, NULL } };
g = (XmLGridWidget)w;
be = (XButtonEvent *)event;
if (!g->grid.allowDrag || !be)
return;
if (XYToRowCol(g, be->x, be->y, &row, &col) == -1)
return;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, col);
cell = GetCell(g, row, col);
if (!rowp || !colp || !cell)
return;
if (XmLGridRowIsSelected(rowp) == False &&
XmLGridColumnIsSelected(colp) == False &&
XmLGridCellIsSelected(cell) == False)
return;
data = CopyDataCreate(g, 1, 0, 0, 0, 0);
if (!data)
return;
dragIcon = _XmGetTextualDragIcon((Widget)w);
exportTargets[0] = XA_STRING;
dragFinish[0].closure = (XtPointer)data;
XtSetArg(args[0], XmNconvertProc, DragConvert);
XtSetArg(args[1], XmNexportTargets, exportTargets);
XtSetArg(args[2], XmNnumExportTargets, 1);
XtSetArg(args[3], XmNdragOperations, XmDROP_COPY);
XtSetArg(args[4], XmNsourceCursorIcon, dragIcon);
XtSetArg(args[4], XmNclientData, (XtPointer)data);
XtSetArg(args[5], XmNdragDropFinishCallback, dragFinish);
XmDragStart(w, event, args, 6);
#endif
}
static Boolean
DragConvert(Widget w,
Atom *selection,
Atom *target,
Atom *type,
XtPointer *value,
unsigned long *length,
int *format)
{
#ifdef MOTIF11
return FALSE;
#else
Atom targetsA, timestampA, multipleA, *exportTargets;
int n;
char *data, *dataCopy;
if (!XmIsDragContext(w))
return FALSE;
targetsA = XInternAtom(XtDisplay(w), "TARGETS", FALSE);
timestampA = XInternAtom(XtDisplay(w), "TIMESTAMP", FALSE);
multipleA = XInternAtom(XtDisplay(w), "MULTIPLE", FALSE);
if (*target == targetsA)
{
n = 4;
exportTargets = (Atom *)XtMalloc(sizeof(Atom) * n);
exportTargets[0] = XA_STRING;
exportTargets[1] = targetsA;
exportTargets[2] = multipleA;
exportTargets[3] = timestampA;
*type = XA_ATOM;
*value = (XtPointer)exportTargets;
*format = 32;
*length = (n * sizeof(Atom)) >> 2;
return TRUE;
}
else if (*target == XA_STRING)
{
XtVaGetValues(w, XmNclientData, &data, NULL);
*type = XA_STRING;
dataCopy = XtMalloc(strlen(data));
strncpy(dataCopy, data, strlen(data));
*value = (XtPointer)dataCopy;
*length = strlen(data);
*format = 8;
return TRUE;
}
return FALSE;
#endif
}
static void
DragFinish(Widget w,
XtPointer clientData,
XtPointer callData)
{
free ((char *)clientData);
}
static void
DropRegister(XmLGridWidget g, Boolean set)
{
#ifndef MOTIF11
Atom importTargets[1];
Arg args[4];
if (set == True)
{
importTargets[0] = XA_STRING;
XtSetArg(args[0], XmNdropSiteOperations, XmDROP_COPY);
XtSetArg(args[1], XmNimportTargets, importTargets);
XtSetArg(args[2], XmNnumImportTargets, 1);
XtSetArg(args[3], XmNdropProc, DropStart);
XmDropSiteRegister((Widget)g, args, 4);
}
else
XmDropSiteUnregister((Widget)g);
#endif
}
static void
DropStart(Widget w,
XtPointer clientData,
XtPointer callData)
{
#ifndef MOTIF11
XmLGridWidget g;
XmDropProcCallbackStruct *cbs;
XmDropTransferEntryRec te[2];
Atom *exportTargets;
Arg args[10];
int row, col, i, n, valid;
g = (XmLGridWidget)w;
cbs = (XmDropProcCallbackStruct *)callData;
if (g->grid.allowDrop == False || cbs->dropAction == XmDROP_HELP)
{
cbs->dropSiteStatus = XmINVALID_DROP_SITE;
return;
}
valid = 0;
if (XYToRowCol(g, cbs->x, cbs->y, &row, &col) != -1 &&
cbs->dropAction == XmDROP && cbs->operation == XmDROP_COPY)
{
XtVaGetValues(cbs->dragContext,
XmNexportTargets, &exportTargets,
XmNnumExportTargets, &n,
NULL);
for (i = 0; i < n; i++)
if (exportTargets[i] == XA_STRING)
valid = 1;
}
if (!valid)
{
cbs->operation = (long)XmDROP_NOOP;
cbs->dropSiteStatus = XmINVALID_DROP_SITE;
XtSetArg(args[0], XmNtransferStatus, XmTRANSFER_FAILURE);
XtSetArg(args[1], XmNnumDropTransfers, 0);
XmDropTransferStart(cbs->dragContext, args, 2);
return;
}
g->grid.dropLoc.row = row;
g->grid.dropLoc.col = col;
cbs->operation = (long)XmDROP_COPY;
te[0].target = XA_STRING;
te[0].client_data = (XtPointer)g;
XtSetArg(args[0], XmNdropTransfers, te);
XtSetArg(args[1], XmNnumDropTransfers, 1);
XtSetArg(args[2], XmNtransferProc, DropTransfer);
XmDropTransferStart(cbs->dragContext, args, 3);
#endif
}
static void
DropTransfer(Widget w,
XtPointer clientData,
Atom *selType,
Atom *type,
XtPointer value,
unsigned long *length,
int *format)
{
#ifndef MOTIF11
XmLGridWidget g;
char *buf;
int len;
if (!value)
return;
g = (XmLGridWidget)clientData;
len = (int)*length;
if (len < 0)
return;
buf = (char *)malloc(len + 1);
strncpy(buf, (char *)value, len);
XtFree((char *)value);
buf[len] = 0;
Read(g, XmFORMAT_DROP, 0, g->grid.dropLoc.row, g->grid.dropLoc.col, buf);
free((char *)buf);
#endif
}
static void
Select(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
Display *dpy;
Window win;
static XrmQuark qACTIVATE, qBEGIN, qEXTEND, qEND;
static XrmQuark qTOGGLE;
static int quarksValid = 0;
XrmQuark q;
int isVert;
int row, col, resizeRow, resizeCol;
XButtonEvent *be;
XRectangle rect;
XmLGridRow rowp;
XmLGridCell cellp;
XmLGridColumn colp;
XmLGridCallbackStruct cbs;
Boolean flag;
if (*nparam != 1)
return;
if (XmLIsGrid(w))
g = (XmLGridWidget)w;
else
g = (XmLGridWidget)XtParent(w);
dpy = XtDisplay(g);
win = XtWindow(g);
if (!quarksValid)
{
qACTIVATE = XrmStringToQuark("ACTIVATE");
qBEGIN = XrmStringToQuark("BEGIN");
qEXTEND = XrmStringToQuark("EXTEND");
qEND = XrmStringToQuark("END");
qTOGGLE = XrmStringToQuark("TOGGLE");
}
q = XrmStringToQuark(params[0]);
be = 0;
if (event->type == KeyPress || event->type == KeyRelease)
{
row = g->grid.focusRow;
col = g->grid.focusCol;
}
else /* Button */
{
be = (XButtonEvent *)event;
if (XYToRowCol(g, be->x, be->y, &row, &col) == -1)
{
row = -1;
col = -1;
}
}
/* double click activate check */
if (q == qBEGIN && be)
{
if (row != -1 && col != -1
&& row == g->grid.focusRow && col == g->grid.focusCol
)
{
int doubleClickTime = XtGetMultiClickTime(dpy);
Time timeSinceLastClick = be->time - g->grid.lastSelectTime;
if (timeSinceLastClick < doubleClickTime)
{
/* Clear inplace editing if some other event happens */
if (g->grid.editTimerSet)
{
XtRemoveTimeOut(g->grid.editTimerId);
g->grid.editTimerSet = 0;
}
/* Second click came within double click time */
q = qACTIVATE;
}
else if (!g->grid.editTimerSet && g->grid.lastSelectTime != 0)
{
/* Only begin an edit when we are sure we don't
* have a double click
*/
if (!g->grid.singleClickActivation) {
g->grid.editTimerId =
XtAppAddTimeOut(XtWidgetToApplicationContext(w),
doubleClickTime*2, EditTimer, (caddr_t)g);
g->grid.editTimerSet = 1;
}
}
}
g->grid.lastSelectRow = row;
g->grid.lastSelectCol = col;
g->grid.lastSelectTime = be->time;
}
else if (q == qBEGIN)
g->grid.lastSelectTime = 0;
if (q == qBEGIN && be && PosIsResize(g, be->x, be->y,
&resizeRow, &resizeCol, &isVert))
{
g->grid.resizeIsVert = isVert;
g->grid.inMode = InResize;
g->grid.resizeLineXY = -1;
g->grid.resizeRow = resizeRow;
g->grid.resizeCol = resizeCol;
if (isVert)
{
DrawResizeLine(g, be->y, 0);
DefineCursor(g, CursorVResize);
}
else
{
DrawResizeLine(g, be->x, 0);
DefineCursor(g, CursorHResize);
}
}
else if (q == qBEGIN || q == qEXTEND || q == qTOGGLE)
{
if (g->grid.inMode != InNormal)
return;
if (row == -1 || col == -1)
return;
if (RowPosToType(g, row) == XmCONTENT &&
ColPosToType(g, col) == XmCONTENT)
{
TextAction(g, TEXT_EDIT_COMPLETE);
if (q != qEXTEND)
{
SetFocus(g, row, col, 0, 1);
ExtendSelect(g, event, False, -1, -1);
}
XmProcessTraversal(g->grid.text, XmTRAVERSE_CURRENT);
}
if (g->grid.selectionPolicy == XmSELECT_MULTIPLE_ROW &&
RowPosToType(g, row) == XmCONTENT)
{
flag = True;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
#if 0
/* Don't want single click to unselect something. -slamm */
if (q == qBEGIN && rowp && XmLGridRowIsSelected(rowp) == True)
flag = False;
#endif /* 0 -slamm */
if (q == qTOGGLE && rowp && XmLGridRowIsSelected(rowp) == True)
flag = False;
if (q == qBEGIN)
SelectTypeArea(g, SelectRow, event, -1, 0, False, True);
if (be && q == qEXTEND)
ExtendSelect(g, event, False, row, col);
else
SelectTypeArea(g, SelectRow, event,
RowPosToTypePos(g, XmCONTENT, row), 0, flag, True);
}
if (g->grid.selectionPolicy == XmSELECT_CELL)
{
if (q == qBEGIN)
{
SelectTypeArea(g, SelectCell, event, -1, -1, False, True);
SelectTypeArea(g, SelectRow, event, -1, 0, False, True);
SelectTypeArea(g, SelectCol, event, 0, -1, False, True);
}
else if (q == qTOGGLE)
ExtendSelect(g, event, False, -1, -1);
if (RowPosToType(g, row) == XmFOOTER ||
ColPosToType(g, col) == XmFOOTER)
ExtendSelect(g, event, False, -1, -1);
if (be && q == qEXTEND)
ExtendSelect(g, event, False, row, col);
else if (RowPosToType(g, row) == XmCONTENT &&
ColPosToType(g, col) == XmCONTENT)
{
flag = True;
cellp = GetCell(g, row, col);
if (q == qTOGGLE && cellp &&
XmLGridCellIsSelected(cellp) == True)
flag = False;
SelectTypeArea(g, SelectCell, event,
RowPosToTypePos(g, XmCONTENT, row),
ColPosToTypePos(g, XmCONTENT, col), flag, True);
}
else if (RowPosToType(g, row) == XmHEADING &&
ColPosToType(g, col) == XmCONTENT)
{
if (q == qTOGGLE)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, col);
if (colp && XmLGridColumnIsSelected(colp) == True)
g->grid.extendSelect = False;
}
ExtendSelect(g, event, True, row, col);
}
else if (ColPosToType(g, col) == XmHEADING &&
RowPosToType(g, row) == XmCONTENT)
{
if (q == qTOGGLE)
{
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
if (rowp && XmLGridRowIsSelected(rowp) == True)
g->grid.extendSelect = False;
}
ExtendSelect(g, event, True, row, col);
}
}
if (g->grid.selectionPolicy == XmSELECT_SINGLE_ROW &&
RowPosToType(g, row) == XmCONTENT)
{
flag = True;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
if (rowp && XmLGridRowIsSelected(rowp) == True)
flag = False;
SelectTypeArea(g, SelectRow, event,
RowPosToTypePos(g, XmCONTENT, row), 0, flag, True);
}
if (g->grid.selectionPolicy == XmSELECT_BROWSE_ROW &&
RowPosToType(g, row) == XmCONTENT)
SelectTypeArea(g, SelectRow, event,
RowPosToTypePos(g, XmCONTENT, row), 0, True, True);
if (g->grid.selectionPolicy == XmSELECT_NONE ||
(g->grid.selectionPolicy == XmSELECT_BROWSE_ROW &&
RowPosToType(g, row) != XmCONTENT) ||
(g->grid.selectionPolicy == XmSELECT_SINGLE_ROW &&
RowPosToType(g, row) != XmCONTENT) ||
(g->grid.selectionPolicy == XmSELECT_MULTIPLE_ROW &&
RowPosToType(g, row) != XmCONTENT) )
{
cbs.reason = XmCR_SELECT_CELL;
cbs.event = event;
cbs.columnType = ColPosToType(g, col);
cbs.column = ColPosToTypePos(g, cbs.columnType, col);
cbs.rowType = RowPosToType(g, row);
cbs.row = RowPosToTypePos(g, cbs.rowType, row);
XtCallCallbackList((Widget)g, g->grid.selectCallback,
(XtPointer)&cbs);
}
g->grid.inMode = InSelect;
}
else if (q == qEND && g->grid.inMode == InResize)
{
int r, c, width, height;
r = g->grid.resizeRow;
c = g->grid.resizeCol;
g->grid.resizeRow = -1;
g->grid.resizeCol = -1;
if (!RowColToXY(g, r, c, False, &rect))
{
if (g->grid.resizeIsVert)
{
cbs.rowType = RowPosToType(g, r);
cbs.row = RowPosToTypePos(g, cbs.rowType, r);
height = 0;
if (g->grid.resizeLineXY > rect.y)
height = g->grid.resizeLineXY - rect.y -
(rect.height - GetRowHeight(g, r));
if (height < 6 && g->grid.allowRowHide == False)
height = 6;
XtVaSetValues((Widget)g,
XmNrowType, cbs.rowType,
XmNrow, cbs.row,
XmNrowHeight, height,
XmNrowSizePolicy, XmCONSTANT,
NULL);
cbs.reason = XmCR_RESIZE_ROW;
}
else
{
cbs.columnType = ColPosToType(g, c);
cbs.column = ColPosToTypePos(g, cbs.columnType, c);
width = 0;
if (g->grid.resizeLineXY > rect.x)
width = g->grid.resizeLineXY - rect.x -
(rect.width - GetColWidth(g, c));
if (width < 6 && g->grid.allowColHide == False)
width = 6;
XtVaSetValues((Widget)g,
XmNcolumnType, cbs.columnType,
XmNcolumn, cbs.column,
XmNcolumnWidth, width,
XmNcolumnSizePolicy, XmCONSTANT,
NULL);
cbs.reason = XmCR_RESIZE_COLUMN;
}
XtCallCallbackList((Widget)g, g->grid.resizeCallback,
(XtPointer)&cbs);
}
DrawResizeLine(g, 0, 2);
DefineCursor(g, CursorNormal);
g->grid.inMode = InNormal;
}
else if (q == qEND)
{
g->grid.inMode = InNormal;
if (g->grid.dragTimerSet)
XtRemoveTimeOut(g->grid.dragTimerId);
g->grid.dragTimerSet = 0;
/* XFE Additions to handle button up events in menus - they generate activate events */
{
if (XmIsMenuShell(XmLShellOfWidget((Widget)g)))
{
cbs.reason = XmCR_ACTIVATE;
cbs.event = event;
cbs.columnType = ColPosToType(g, col);
cbs.column = ColPosToTypePos(g, cbs.columnType, col);
cbs.rowType = RowPosToType(g, row);
cbs.row = RowPosToTypePos(g, cbs.rowType, row);
XtCallCallbackList((Widget)g, g->grid.activateCallback,
(XtPointer)&cbs);
}
}
}
if (q == qBEGIN && g->grid.singleClickActivation) {
cbs.reason = XmCR_ACTIVATE;
cbs.event = event;
cbs.columnType = ColPosToType(g, col);
cbs.column = ColPosToTypePos(g, cbs.columnType, col);
cbs.rowType = RowPosToType(g, row);
cbs.row = RowPosToTypePos(g, cbs.rowType, row);
XtCallCallbackList((Widget)g, g->grid.activateCallback,
(XtPointer)&cbs);
}
if (q == qACTIVATE)
{
cbs.reason = XmCR_ACTIVATE;
cbs.event = event;
cbs.columnType = ColPosToType(g, col);
cbs.column = ColPosToTypePos(g, cbs.columnType, col);
cbs.rowType = RowPosToType(g, row);
cbs.row = RowPosToTypePos(g, cbs.rowType, row);
XtCallCallbackList((Widget)g, g->grid.activateCallback,
(XtPointer)&cbs);
}
}
/*
* Selection policy when posting a context menu.
* If over a current selection, leave the selection alone.
* Otherwise, change the selection the same as Select(),
* except do not allow dragging to extend the selection.
*/
static void
PopupSelect(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
int row, col;
XButtonEvent *be;
XmLGridRow rowp;
XmLGridCallbackStruct cbs;
if (*nparam != 1)
return;
if (XmLIsGrid(w))
g = (XmLGridWidget)w;
else
g = (XmLGridWidget)XtParent(w);
be = 0;
if (event->type == KeyPress || event->type == KeyRelease)
{
row = g->grid.focusRow;
col = g->grid.focusCol;
}
else /* Button */
{
be = (XButtonEvent *)event;
if (XYToRowCol(g, be->x, be->y, &row, &col) == -1)
{
row = -1;
col = -1;
}
}
if (RowPosToType(g, row) == XmCONTENT)
{
XmLGridRow rowp;
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, row);
if (rowp && !XmLGridRowIsSelected(rowp))
{
String end_params[1];
end_params[0] = "END";
Select(w, event, params, nparam);
Select(w, event, end_params, nparam);
}
}
if (XtHasCallbacks(w, XmNpopupCallback) == XtCallbackHasSome)
{
cbs.reason = XmCR_SHOW_POPUP;
cbs.event = event;
cbs.columnType = ColPosToType(g, col);
cbs.column = ColPosToTypePos(g, cbs.columnType, col);
cbs.rowType = RowPosToType(g, row);
cbs.row = RowPosToTypePos(g, cbs.rowType, row);
XtCallCallbackList((Widget)g, g->grid.popupCallback,
(XtPointer)&cbs);
}
}
static void
Traverse(Widget w,
XEvent *event,
String *params,
Cardinal *nparam)
{
XmLGridWidget g;
static XrmQuark qDOWN, qEXTEND_DOWN, qEXTEND_LEFT;
static XrmQuark qEXTEND_PAGE_DOWN, qEXTEND_PAGE_LEFT;
static XrmQuark qEXTEND_PAGE_RIGHT, qEXTEND_PAGE_UP;
static XrmQuark qEXTEND_RIGHT, qEXTEND_UP, qLEFT, qPAGE_DOWN;
static XrmQuark qPAGE_LEFT, qPAGE_RIGHT, qPAGE_UP, qRIGHT;
static XrmQuark qTO_BOTTOM, qTO_BOTTOM_RIGHT, qTO_LEFT;
static XrmQuark qTO_RIGHT, qTO_TOP, qTO_TOP_LEFT, qUP;
static int quarksValid = 0;
int extend, focusRow, focusCol, rowDir, colDir;
int rowLoc, colLoc, prevRowLoc, prevColLoc;
int scrollRow, scrollCol, prevScrollRow, prevScrollCol;
XrmQuark q;
g = (XmLGridWidget)XtParent(w);
if (*nparam != 1)
return;
if (!quarksValid)
{
qDOWN = XrmStringToQuark("DOWN");
qEXTEND_DOWN = XrmStringToQuark("EXTEND_DOWN");
qEXTEND_LEFT = XrmStringToQuark("EXTEND_LEFT");
qEXTEND_PAGE_DOWN = XrmStringToQuark("EXTEND_PAGE_DOWN");
qEXTEND_PAGE_LEFT = XrmStringToQuark("EXTEND_PAGE_LEFT");
qEXTEND_PAGE_RIGHT = XrmStringToQuark("EXTEND_PAGE_RIGHT");
qEXTEND_PAGE_UP = XrmStringToQuark("EXTEND_PAGE_UP");
qEXTEND_RIGHT = XrmStringToQuark("EXTEND_RIGHT");
qEXTEND_UP = XrmStringToQuark("EXTEND_UP");
qLEFT = XrmStringToQuark("LEFT");
qPAGE_DOWN = XrmStringToQuark("PAGE_DOWN");
qPAGE_LEFT = XrmStringToQuark("PAGE_LEFT");
qPAGE_RIGHT = XrmStringToQuark("PAGE_RIGHT");
qPAGE_UP = XrmStringToQuark("PAGE_UP");
qRIGHT = XrmStringToQuark("RIGHT");
qTO_BOTTOM = XrmStringToQuark("TO_BOTTOM");
qTO_BOTTOM_RIGHT = XrmStringToQuark("TO_BOTTOM_RIGHT");
qTO_LEFT = XrmStringToQuark("TO_LEFT");
qTO_RIGHT = XrmStringToQuark("TO_RIGHT");
qTO_TOP = XrmStringToQuark("TO_TOP");
qTO_TOP_LEFT = XrmStringToQuark("TO_TOP_LEFT");
qUP = XrmStringToQuark("UP");
quarksValid = 1;
}
q = XrmStringToQuark(params[0]);
extend = 0;
/* map the extends to their counterparts and set extend flag */
if (q == qEXTEND_DOWN)
{
q = qDOWN;
extend = 1;
}
else if (q == qEXTEND_LEFT)
{
q = qLEFT;
extend = 1;
}
else if (q == qEXTEND_PAGE_DOWN)
{
q = qPAGE_DOWN;
extend = 1;
}
else if (q == qEXTEND_PAGE_LEFT)
{
q = qPAGE_LEFT;
extend = 1;
}
else if (q == qEXTEND_PAGE_RIGHT)
{
q = qPAGE_RIGHT;
extend = 1;
}
else if (q == qEXTEND_PAGE_UP)
{
q = qPAGE_UP;
extend = 1;
}
else if (q == qEXTEND_RIGHT)
{
q = qRIGHT;
extend = 1;
}
else if (q == qEXTEND_UP)
{
q = qUP;
extend = 1;
}
if (extend && g->grid.selectionPolicy != XmSELECT_MULTIPLE_ROW &&
g->grid.selectionPolicy != XmSELECT_CELL)
return;
if (extend && g->grid.extendRow != -1 && g->grid.extendCol != -1)
{
focusRow = g->grid.extendToRow;
focusCol = g->grid.extendToCol;
}
else
{
focusRow = g->grid.focusRow;
focusCol = g->grid.focusCol;
}
rowDir = 0;
colDir = 0;
if (focusRow < g->grid.topFixedCount)
prevRowLoc = 0;
else if (focusRow >= XmLArrayGetCount(g->grid.rowArray) -
g->grid.bottomFixedCount)
prevRowLoc = 2;
else
prevRowLoc = 1;
if (focusCol < g->grid.leftFixedCount)
prevColLoc = 0;
else if (focusCol >= XmLArrayGetCount(g->grid.colArray) -
g->grid.rightFixedCount)
prevColLoc = 2;
else
prevColLoc = 1;
/* calculate new focus row, col and walk direction */
if (q == qDOWN)
{
focusRow++;
rowDir = 1;
}
else if (q == qLEFT)
{
focusCol--;
colDir = -1;
}
else if (q == qPAGE_DOWN)
{
if (prevRowLoc == 1)
focusRow = g->grid.reg[4].row + g->grid.reg[4].nrow - 1;
if (focusRow == g->grid.focusRow)
focusRow += 4;
rowDir = 1;
}
else if (q == qPAGE_LEFT)
{
if (prevColLoc == 1)
focusCol = g->grid.reg[4].col - 1;
if (focusCol == g->grid.focusCol)
focusCol -= 4;
colDir = -1;
}
else if (q == qPAGE_RIGHT)
{
if (prevColLoc == 1)
focusCol = g->grid.reg[4].col + g->grid.reg[4].ncol - 1;
if (focusCol == g->grid.focusCol)
focusCol += 4;
colDir = 1;
}
else if (q == qPAGE_UP)
{
if (prevRowLoc == 1)
focusRow = g->grid.reg[4].row - 1;
if (focusRow == g->grid.focusRow)
focusRow -= 4;
rowDir = -1;
}
else if (q == qRIGHT)
{
focusCol++;
colDir = 1;
}
else if (q == qTO_BOTTOM)
{
focusRow = XmLArrayGetCount(g->grid.rowArray) - 1;
rowDir = -1;
}
else if (q == qTO_BOTTOM_RIGHT)
{
focusCol = XmLArrayGetCount(g->grid.colArray) - 1;
focusRow = XmLArrayGetCount(g->grid.rowArray) - 1;
rowDir = -1;
colDir = -1;
}
else if (q == qTO_LEFT)
{
focusCol = 0;
colDir = 1;
}
else if (q == qTO_RIGHT)
{
focusCol = XmLArrayGetCount(g->grid.colArray) - 1;
colDir = -1;
}
else if (q == qTO_TOP)
{
focusRow = 0;
rowDir = 1;
}
else if (q == qTO_TOP_LEFT)
{
focusCol = 0;
focusRow = 0;
rowDir = 1;
colDir = 1;
}
else if (q == qUP)
{
focusRow -= 1;
rowDir = -1;
}
if (!rowDir && !colDir)
return;
if (extend)
{
if (FindNextFocus(g, focusRow, focusCol, rowDir, colDir,
&focusRow, &focusCol) == -1)
return;
ExtendSelect(g, event, False, focusRow, focusCol);
}
else
{
if (SetFocus(g, focusRow, focusCol, rowDir, colDir) == -1)
return;
ExtendSelect(g, event, False, -1, -1);
focusRow = g->grid.focusRow;
focusCol = g->grid.focusCol;
if (g->grid.selectionPolicy == XmSELECT_CELL)
{
SelectTypeArea(g, SelectRow, event, -1, 0, False, True);
SelectTypeArea(g, SelectCol, event, 0, -1, False, True);
SelectTypeArea(g, SelectCell, event, -1, -1, False, True);
SelectTypeArea(g, SelectCell, event,
RowPosToTypePos(g, XmCONTENT, focusRow),
ColPosToTypePos(g, XmCONTENT, focusCol),
True, True);
}
else if (g->grid.selectionPolicy == XmSELECT_BROWSE_ROW)
SelectTypeArea(g, SelectRow, event,
RowPosToTypePos(g, XmCONTENT, focusRow), 0, True, True);
}
scrollRow = -1;
scrollCol = -1;
if (q == qPAGE_UP)
scrollRow = ScrollRowBottomPos(g, focusRow);
else if (q == qPAGE_DOWN)
scrollRow = focusRow;
else if (q == qPAGE_LEFT)
scrollCol = ScrollColRightPos(g, focusCol);
else if (q == qPAGE_RIGHT)
scrollCol = focusCol;
else
{
if (focusRow < g->grid.topFixedCount)
rowLoc = 0;
else if (focusRow >= XmLArrayGetCount(g->grid.rowArray) -
g->grid.bottomFixedCount)
rowLoc = 2;
else
rowLoc = 1;
if (prevRowLoc != 0 && rowLoc == 0)
scrollRow = g->grid.reg[0].nrow;
else if (prevRowLoc != 2 && rowLoc == 2)
scrollRow = g->grid.reg[6].row - 1;
if (focusCol < g->grid.leftFixedCount)
colLoc = 0;
else if (focusCol >= XmLArrayGetCount(g->grid.colArray) -
g->grid.rightFixedCount)
colLoc = 2;
else
colLoc = 1;
if (prevColLoc != 0 && colLoc == 0)
scrollCol = g->grid.reg[0].ncol;
else if (prevColLoc != 2 && colLoc == 2)
scrollCol = g->grid.reg[2].col - 1;
}
if (g->grid.vsPolicy == XmVARIABLE)
;
else if (scrollRow != -1)
{
prevScrollRow = g->grid.scrollRow;
g->grid.scrollRow = scrollRow;
VertLayout(g, 0);
if (g->grid.scrollRow != prevScrollRow)
DrawArea(g, DrawVScroll, 0, 0);
}
else
MakeRowVisible(g, focusRow);
if (g->grid.hsPolicy == XmVARIABLE)
;
else if (scrollCol != -1)
{
prevScrollCol = g->grid.scrollCol;
g->grid.scrollCol = scrollCol;
HorizLayout(g, 0);
if (g->grid.scrollCol != prevScrollCol)
DrawArea(g, DrawHScroll, 0, 0);
}
else
MakeColVisible(g, focusCol);
}
static void
TextActivate(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLGridWidget g;
XmAnyCallbackStruct *cbs;
String params[1];
Cardinal nparam;
cbs = (XmAnyCallbackStruct *)callData;
g = (XmLGridWidget)XtParent(w);
if (g->grid.inEdit)
{
nparam = 0;
EditComplete(w, cbs->event, params, &nparam);
}
else
{
params[0] = "ACTIVATE";
nparam = 1;
Select(XtParent(w), cbs->event, params, &nparam);
}
}
static void
TextFocus(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLGridWidget g;
XmAnyCallbackStruct *cbs;
int focusRow, focusCol;
cbs = (XmAnyCallbackStruct *)callData;
g = (XmLGridWidget)XtParent(w);
if (cbs->reason == XmCR_FOCUS)
g->grid.focusIn = 1;
else
g->grid.focusIn = 0;
focusRow = g->grid.focusRow;
focusCol = g->grid.focusCol;
if (focusRow != -1 && focusCol != -1)
{
if (g->grid.highlightRowMode == True)
DrawArea(g, DrawRow, focusRow, 0);
else
DrawArea(g, DrawCell, focusRow, focusCol);
}
}
static void
TextMapped(Widget w,
XtPointer clientData,
XEvent *event,
Boolean *con)
{
XmLGridWidget g;
g = (XmLGridWidget)(XtParent(w));
if (event->type != MapNotify)
return;
if (g->grid.textHidden)
XtUnmapWidget(g->grid.text);
}
static void
TextModifyVerify(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLGridWidget g;
XmTextVerifyCallbackStruct *cbs;
g = (XmLGridWidget)XtParent(w);
cbs = (XmTextVerifyCallbackStruct *)callData;
if (!cbs->event || g->grid.ignoreModifyVerify || g->grid.inEdit)
return;
TextAction(g, TEXT_EDIT);
if (!g->grid.inEdit)
cbs->doit = False;
}
/*
XmLGridRow
*/
static
XmLGridRow XmLGridRowNew(Widget grid)
{
return XmLGridClassPartOfWidget(grid).rowNewProc(grid);
}
/* Only to be called through Grid class */
static XmLGridRow
_GridRowNew(Widget grid)
{
XmLGridWidget g;
XmLGridRow row;
int size;
g = (XmLGridWidget)grid;
size = XmLGridClassPartOfWidget(grid).rowRecSize;
row = (XmLGridRow)malloc(size);
row->grid.grid = grid;
row->grid.heightInPixels = 0;
row->grid.heightInPixelsValid = 0;
row->grid.height = 1;
row->grid.selected = False;
row->grid.sizePolicy = XmVARIABLE;
row->grid.userData = 0;
row->grid.cellArray = XmLArrayNew(0, 0);
return row;
}
static void
XmLGridRowFree(Widget grid,
XmLGridRow row)
{
XmLGridClassPartOfWidget(grid).rowFreeProc(row);
}
/* Only to be called through Grid class */
static void
_GridRowFree(XmLGridRow row)
{
int i, count;
count = XmLArrayGetCount(row->grid.cellArray);
for (i = 0; i < count; i++)
XmLGridCellFree(row->grid.grid,
(XmLGridCell)XmLArrayGet(row->grid.cellArray, i));
XmLArrayFree(row->grid.cellArray);
free ((char *)row);
}
static
XmLArray XmLGridRowCells(XmLGridRow row)
{
return row->grid.cellArray;
}
static int
XmLGridRowGetPos(XmLGridRow row)
{
return row->grid.pos;
}
static int
XmLGridRowGetVisPos(XmLGridRow row)
{
return row->grid.visPos;
}
static Boolean
XmLGridRowIsHidden(XmLGridRow row)
{
if (!row->grid.height)
return True;
return False;
}
static Boolean
XmLGridRowIsSelected(XmLGridRow row)
{
return row->grid.selected;
}
static void
XmLGridRowSetSelected(XmLGridRow row,
Boolean selected)
{
row->grid.selected = selected;
}
static void
XmLGridRowSetVisPos(XmLGridRow row,
int visPos)
{
row->grid.visPos = visPos;
}
static int
XmLGridRowHeightInPixels(XmLGridRow row)
{
int i, count;
Dimension height, maxHeight;
XmLGridWidget g;
XmLGridCell cell;
XmLGridCallbackStruct cbs;
XmLGridCellRefValues *cellValues;
if (row->grid.sizePolicy == XmCONSTANT)
return row->grid.height;
if (!row->grid.height)
return 0;
if (!row->grid.heightInPixelsValid)
{
g = (XmLGridWidget)row->grid.grid;
count = XmLArrayGetCount(row->grid.cellArray);
if (!count)
{
cellValues = g->grid.defCellValues;
maxHeight = 4 + row->grid.height * cellValues->fontHeight +
cellValues->topMargin + cellValues->bottomMargin;
}
else
maxHeight = 0;
for (i = 0; i < count; i++)
{
cell = (XmLGridCell)XmLArrayGet(row->grid.cellArray, i);
cbs.reason = XmCR_PREF_HEIGHT;
cbs.rowType = RowPosToType(g, row->grid.pos);
cbs.row = RowPosToTypePos(g, cbs.rowType, row->grid.pos);
cbs.columnType = ColPosToType(g, i);
cbs.column = ColPosToTypePos(g, cbs.columnType, i);
cbs.object = (void *)row;
height = XmLGridCellAction(cell, (Widget)g, &cbs);
if (height > maxHeight)
maxHeight = height;
}
row->grid.heightInPixels = maxHeight;
row->grid.heightInPixelsValid = 1;
}
return row->grid.heightInPixels;
}
static void
XmLGridRowHeightChanged(XmLGridRow row)
{
row->grid.heightInPixelsValid = 0;
}
/*
XmLGridColumn
*/
static XmLGridColumn
XmLGridColumnNew(Widget grid)
{
return XmLGridClassPartOfWidget(grid).columnNewProc(grid);
}
/* Only to be called through Grid class */
static XmLGridColumn
_GridColumnNew(Widget grid)
{
XmLGridWidget g;
XmLGridColumn column;
int size;
g = (XmLGridWidget)grid;
size = XmLGridClassPartOfWidget(grid).columnRecSize;
column = (XmLGridColumn)malloc(size);
column->grid.grid = grid;
column->grid.widthInPixels = 0;
column->grid.widthInPixelsValid = 0;
column->grid.defCellValues = 0;
column->grid.selected = False;
column->grid.sizePolicy = XmVARIABLE;
column->grid.width = 8;
column->grid.userData = 0;
column->grid.resizable = True;
column->grid.hidden = 0;
return column;
}
static void
XmLGridColumnFree(Widget grid,
XmLGridColumn column)
{
XmLGridClassPartOfWidget(grid).columnFreeProc(column);
}
/* Only to be called through Grid class */
static void
_GridColumnFree(XmLGridColumn column)
{
if (column->grid.defCellValues)
XmLGridCellDerefValues(column->grid.defCellValues);
free((char *)column);
}
static int
XmLGridColumnGetPos(XmLGridColumn column)
{
return column->grid.pos;
}
static int
XmLGridColumnGetVisPos(XmLGridColumn column)
{
return column->grid.visPos;
}
static Boolean
XmLGridColumnIsHidden(XmLGridColumn column)
{
return column->grid.width == 0
|| column->grid.hidden;
}
static Boolean
XmLGridColumnIsSelected(XmLGridColumn column)
{
return column->grid.selected;
}
static void
XmLGridColumnSetSelected(XmLGridColumn column,
Boolean selected)
{
column->grid.selected = selected;
}
static void
XmLGridColumnSetVisPos(XmLGridColumn column,
int visPos)
{
column->grid.visPos = visPos;
}
static int
XmLGridColumnWidthInPixels(XmLGridColumn column)
{
int i, count;
Dimension width, maxWidth;
XmLGridCell cell;
XmLGridWidget g;
XmLGridCallbackStruct cbs;
XmLGridCellRefValues *cellValues;
if (column->grid.sizePolicy == XmCONSTANT)
return column->grid.width;
if (!column->grid.width)
return 0;
if (!column->grid.widthInPixelsValid)
{
g = (XmLGridWidget)column->grid.grid;
count = XmLArrayGetCount(g->grid.rowArray);
if (!count)
{
cellValues = g->grid.defCellValues;
maxWidth = 4 + column->grid.width * cellValues->fontWidth +
cellValues->leftMargin + cellValues->rightMargin;
}
else
maxWidth = 0;
for (i = 0; i < count; i++)
{
cell = GetCell(g, i, column->grid.pos);
cbs.reason = XmCR_PREF_WIDTH;
cbs.rowType = RowPosToType(g, i);
cbs.row = RowPosToTypePos(g, cbs.rowType, i);
cbs.columnType = ColPosToType(g, column->grid.pos);
cbs.column = ColPosToTypePos(g, cbs.columnType, column->grid.pos);
cbs.object = (void *)column;
width = XmLGridCellAction(cell, (Widget)g, &cbs);
if (width > maxWidth)
maxWidth = width;
}
column->grid.widthInPixels = maxWidth;
column->grid.widthInPixelsValid = 1;
}
return column->grid.widthInPixels;
}
static void
XmLGridColumnWidthChanged(XmLGridColumn column)
{
column->grid.widthInPixelsValid = 0;
}
/*
XmLGridCell
*/
static XmLGridCell
XmLGridCellNew(void)
{
XmLGridCell c;
c = (XmLGridCell)malloc(sizeof(struct _XmLGridCellRec));
c->cell.refValues = 0;
c->cell.flags = 0;
return c;
}
static void
XmLGridCellFree(Widget grid,
XmLGridCell cell)
{
XmLGridCallbackStruct cbs;
cbs.reason = XmCR_FREE_VALUE;
XmLGridCellAction(cell, grid, &cbs);
XmLGridCellDerefValues(cell->cell.refValues);
free((char *)cell);
}
static int
XmLGridCellAction(XmLGridCell cell,
Widget w,
XmLGridCallbackStruct *cbs)
{
return XmLGridClassPartOfWidget(w).cellActionProc(cell, w, cbs);
}
/* Only to be called through Grid class */
static int
_GridCellAction(XmLGridCell cell,
Widget w,
XmLGridCallbackStruct *cbs)
{
int ret;
ret = 0;
switch (cbs->reason)
{
case XmCR_CELL_DRAW:
_XmLGridCellDrawBackground(cell, w, cbs->clipRect, cbs->drawInfo);
_XmLGridCellDrawValue(cell, w, cbs->clipRect, cbs->drawInfo);
_XmLGridCellDrawBorders(cell, w, cbs->clipRect, cbs->drawInfo);
break;
case XmCR_CELL_FOCUS_IN:
break;
case XmCR_CELL_FOCUS_OUT:
break;
case XmCR_CONF_TEXT:
_XmLGridCellConfigureText(cell, w, cbs->clipRect);
break;
case XmCR_EDIT_BEGIN:
ret = _XmLGridCellBeginTextEdit(cell, w, cbs->clipRect);
break;
case XmCR_EDIT_CANCEL:
break;
case XmCR_EDIT_COMPLETE:
_XmLGridCellCompleteTextEdit(cell, w);
break;
case XmCR_EDIT_INSERT:
ret = _XmLGridCellBeginTextEdit(cell, w, cbs->clipRect);
if (ret)
_XmLGridCellInsertText(cell, w);
break;
case XmCR_FREE_VALUE:
_XmLGridCellFreeValue(cell);
break;
case XmCR_PREF_HEIGHT:
ret = _XmLGridCellGetHeight(cell, w,(XmLGridRow)cbs->object);
break;
case XmCR_PREF_WIDTH:
ret = _XmLGridCellGetWidth(cell, w,(XmLGridColumn)cbs->object);
break;
}
return ret;
}
static XmLGridCellRefValues *
XmLGridCellGetRefValues(XmLGridCell cell)
{
return cell->cell.refValues;
}
static void
XmLGridCellSetRefValues(XmLGridCell cell,
XmLGridCellRefValues *values)
{
values->refCount++;
XmLGridCellDerefValues(cell->cell.refValues);
cell->cell.refValues = values;
}
static void
XmLGridCellDerefValues(XmLGridCellRefValues *values)
{
if (!values)
return;
values->refCount--;
if (!values->refCount)
{
XmFontListFree(values->fontList);
free((char *)values);
}
}
static Boolean
XmLGridCellInRowSpan(XmLGridCell cell)
{
if (cell->cell.flags & XmLGridCellInRowSpanFlag)
return True;
return False;
}
static Boolean
XmLGridCellInColumnSpan(XmLGridCell cell)
{
if (cell->cell.flags & XmLGridCellInColumnSpanFlag)
return True;
return False;
}
static Boolean
XmLGridCellIsSelected(XmLGridCell cell)
{
if (cell->cell.flags & XmLGridCellSelectedFlag)
return True;
return False;
}
static Boolean
XmLGridCellIsValueSet(XmLGridCell cell)
{
if (cell->cell.flags & XmLGridCellValueSetFlag)
return True;
return False;
}
static void
XmLGridCellSetValueSet(XmLGridCell cell,
Boolean set)
{
cell->cell.flags |= XmLGridCellValueSetFlag;
if (set != True)
cell->cell.flags ^= XmLGridCellValueSetFlag;
}
static void
XmLGridCellSetInRowSpan(XmLGridCell cell,
Boolean set)
{
cell->cell.flags |= XmLGridCellInRowSpanFlag;
if (set != True)
cell->cell.flags ^= XmLGridCellInRowSpanFlag;
}
static void
XmLGridCellSetInColumnSpan(XmLGridCell cell,
Boolean set)
{
cell->cell.flags |= XmLGridCellInColumnSpanFlag;
if (set != True)
cell->cell.flags ^= XmLGridCellInColumnSpanFlag;
}
static void
XmLGridCellSetSelected(XmLGridCell cell,
Boolean selected)
{
cell->cell.flags |= XmLGridCellSelectedFlag;
if (selected != True)
cell->cell.flags ^= XmLGridCellSelectedFlag;
}
/*Xfe Additions*/
static Boolean
XmLGridCellDrawSort(XmLGridCell cell)
{
if (cell->cell.flags & XmLGridCellDrawSortFlag)
return True;
return False;
}
static Boolean
XmLGridCellSortAscending(XmLGridCell cell)
{
if (cell->cell.flags & XmLGridCellSortAscendingFlag)
return True;
return False;
}
static void
XmLGridCellSetDrawSort(XmLGridCell cell, Boolean drawSort)
{
cell->cell.flags |= XmLGridCellDrawSortFlag;
if (drawSort != True)
cell->cell.flags ^= XmLGridCellDrawSortFlag;
}
static void
XmLGridCellSetSortAscending(XmLGridCell cell, Boolean ascending)
{
cell->cell.flags |= XmLGridCellSortAscendingFlag;
if (ascending != True)
cell->cell.flags ^= XmLGridCellSortAscendingFlag;
}
static void
XmLGridCellAllocIcon(XmLGridCell cell)
{
XmLGridCellIcon *icon;
icon = (XmLGridCellIcon *)malloc(sizeof(XmLGridCellIcon));
icon->pix.pixmap = XmUNSPECIFIED_PIXMAP;
icon->pix.pixmask = XmUNSPECIFIED_PIXMAP;
icon->pix.width = 0;
icon->pix.height = 0;
icon->string = 0;
cell->cell.value = (void *)icon;
XmLGridCellSetValueSet(cell, True);
}
static void
XmLGridCellAllocPixmap(XmLGridCell cell)
{
XmLGridCellPixmap *pix;
pix = (XmLGridCellPixmap *)malloc(sizeof(XmLGridCellPixmap));
pix->width = 0;
pix->height = 0;
pix->pixmap = XmUNSPECIFIED_PIXMAP;
pix->pixmask = XmUNSPECIFIED_PIXMAP;
cell->cell.value = (void *)pix;
XmLGridCellSetValueSet(cell, True);
}
static void
XmLGridCellSetString(XmLGridCell cell,
XmString string,
Boolean copy)
{
XmLGridCellIcon *icon;
if (cell->cell.refValues->type == XmSTRING_CELL)
{
_XmLGridCellFreeValue(cell);
if (string)
{
if (copy == True)
cell->cell.value = (void *)XmStringCopy(string);
else
cell->cell.value = (void *)string;
XmLGridCellSetValueSet(cell, True);
}
else
XmLGridCellSetValueSet(cell, False);
}
else if (cell->cell.refValues->type == XmICON_CELL)
{
if (XmLGridCellIsValueSet(cell) == False)
XmLGridCellAllocIcon(cell);
icon = (XmLGridCellIcon *)cell->cell.value;
if (icon->string)
XmStringFree(icon->string);
if (string && copy == True)
icon->string = XmStringCopy(string);
else
icon->string = string;
}
else if (string && copy == False)
XmStringFree(string);
}
static XmString
XmLGridCellGetString(XmLGridCell cell)
{
XmString str;
str = 0;
if (cell->cell.refValues->type == XmSTRING_CELL)
{
if (XmLGridCellIsValueSet(cell) == True)
str = (XmString)cell->cell.value;
}
else if (cell->cell.refValues->type == XmICON_CELL)
{
if (XmLGridCellIsValueSet(cell) == True)
str = ((XmLGridCellIcon *)cell->cell.value)->string;
}
return str;
}
static void
XmLGridCellSetToggle(XmLGridCell cell,
Boolean state)
{
if (cell->cell.refValues->type == XmTOGGLE_CELL)
{
if (state)
cell->cell.value = (void *)1;
else
cell->cell.value = (void *)0;
XmLGridCellSetValueSet(cell, True);
}
}
static Boolean
XmLGridCellGetToggle(XmLGridCell cell)
{
Boolean toggled;
toggled = False;
if (cell->cell.refValues->type == XmTOGGLE_CELL)
{
if (XmLGridCellIsValueSet(cell) == True &&
cell->cell.value == (void *)1)
toggled = True;
}
return toggled;
}
static void
XmLGridCellSetPixmap(XmLGridCell cell,
Pixmap pixmap,
Dimension width,
Dimension height)
{
XmLGridCellPixmap *pix;
pix = 0;
if (cell->cell.refValues->type == XmPIXMAP_CELL)
{
if (XmLGridCellIsValueSet(cell) == False)
XmLGridCellAllocPixmap(cell);
pix = (XmLGridCellPixmap *)cell->cell.value;
}
else if (cell->cell.refValues->type == XmICON_CELL)
{
if (XmLGridCellIsValueSet(cell) == False)
XmLGridCellAllocIcon(cell);
pix = &((XmLGridCellIcon *)cell->cell.value)->pix;
}
if (!pix)
return;
pix->pixmap = pixmap;
pix->height = height;
pix->width = width;
}
static void
XmLGridCellSetPixmask(XmLGridCell cell,
Pixmap pixmask)
{
XmLGridCellPixmap *pix;
if (XmLGridCellIsValueSet(cell) == False)
{
fprintf(stderr, "XmLGridCellSetPixmask: pixmap must be set ");
fprintf(stderr, "before pixmask\n");
return;
}
pix = 0;
if (cell->cell.refValues->type == XmPIXMAP_CELL)
pix = (XmLGridCellPixmap *)cell->cell.value;
else if (cell->cell.refValues->type == XmICON_CELL)
pix = &((XmLGridCellIcon *)cell->cell.value)->pix;
if (!pix)
return;
pix->pixmask = pixmask;
}
static XmLGridCellPixmap *
XmLGridCellGetPixmap(XmLGridCell cell)
{
XmLGridCellPixmap *pix;
pix = 0;
if (cell->cell.refValues->type == XmPIXMAP_CELL)
{
if (XmLGridCellIsValueSet(cell) == True)
pix = (XmLGridCellPixmap *)cell->cell.value;
}
else if (cell->cell.refValues->type == XmICON_CELL)
{
if (XmLGridCellIsValueSet(cell) == True)
pix = &((XmLGridCellIcon *)cell->cell.value)->pix;
}
return pix;
}
/* Only to be called by XmLGridCellAction() */
void
_XmLGridCellDrawBackground(XmLGridCell cell,
Widget w,
XRectangle *clipRect,
XmLGridDrawStruct *ds)
{
Display *dpy;
Window win;
dpy = XtDisplay(w);
win = XtWindow(w);
if (ds->drawSelected == True)
XSetForeground(dpy, ds->gc, ds->selectBackground);
else
XSetForeground(dpy, ds->gc, ds->background);
XFillRectangle(dpy, win, ds->gc, clipRect->x, clipRect->y,
clipRect->width, clipRect->height);
}
/* Only to be called by XmLGridCellAction() */
void
_XmLGridCellDrawBorders(XmLGridCell cell,
Widget w,
XRectangle *clipRect,
XmLGridDrawStruct *ds)
{
XmLGridWidget g;
Display *dpy;
Window win;
GC gc;
Pixel black, white;
int x1, x2, y1, y2, loff, roff;
int drawLeft, drawRight, drawBot, drawTop;
XRectangle *cellRect;
unsigned char borderType;
g = (XmLGridWidget)w;
dpy = XtDisplay(w);
win = XtWindow(w);
gc = ds->gc;
cellRect = ds->cellRect;
black = BlackPixelOfScreen(XtScreen(w));
white = WhitePixelOfScreen(XtScreen(w));
x1 = clipRect->x;
x2 = clipRect->x + clipRect->width - 1;
y1 = clipRect->y;
y2 = clipRect->y + clipRect->height - 1;
drawLeft = 1;
drawRight = 1;
drawBot = 1;
drawTop = 1;
if (cellRect->x != clipRect->x)
drawLeft = 0;
if (cellRect->x + cellRect->width != clipRect->x + clipRect->width)
drawRight = 0;
if (cellRect->y != clipRect->y)
drawTop = 0;
if (cellRect->y + cellRect->height != clipRect->y + clipRect->height)
drawBot = 0;
borderType = cell->cell.refValues->rightBorderType;
if (borderType != XmBORDER_NONE && drawRight)
{
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineOnOffDash, CapButt, JoinMiter);
XSetForeground(dpy, gc, cell->cell.refValues->rightBorderColor);
XDrawLine(dpy, win, gc, x2, y1, x2, y2);
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineSolid, CapButt, JoinMiter);
}
borderType = cell->cell.refValues->bottomBorderType;
if (borderType != XmBORDER_NONE && drawBot)
{
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineOnOffDash, CapButt, JoinMiter);
XSetForeground(dpy, gc, cell->cell.refValues->bottomBorderColor);
XDrawLine(dpy, win, gc, x1, y2, x2, y2);
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineSolid, CapButt, JoinMiter);
}
borderType = cell->cell.refValues->topBorderType;
if (borderType != XmBORDER_NONE && drawTop)
{
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineOnOffDash, CapButt, JoinMiter);
XSetForeground(dpy, gc, cell->cell.refValues->topBorderColor);
XDrawLine(dpy, win, gc, x1, y1, x2, y1);
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineSolid, CapButt, JoinMiter);
}
borderType = cell->cell.refValues->leftBorderType;
if (borderType != XmBORDER_NONE && drawLeft)
{
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineOnOffDash, CapButt, JoinMiter);
XSetForeground(dpy, gc, cell->cell.refValues->leftBorderColor);
XDrawLine(dpy, win, gc, x1, y1, x1, y2);
if (borderType == XmBORDER_DASH)
XSetLineAttributes(dpy, gc, 0, LineSolid, CapButt, JoinMiter);
}
if (ds->drawFocusType == XmDRAW_FOCUS_NONE)
return;
if (ds->drawFocusType == XmDRAW_FOCUS_LEFT)
drawRight = 0;
else if (ds->drawFocusType == XmDRAW_FOCUS_RIGHT)
drawLeft = 0;
else if (ds->drawFocusType == XmDRAW_FOCUS_MID)
{
drawLeft = 0;
drawRight = 0;
}
if (!drawLeft)
loff = 0;
else
loff = 2;
if (!drawRight)
roff = 0;
else
roff = 2;
if (g->grid.highlightThickness < 2)
return;
XSetForeground(dpy, gc, g->manager.highlight_color);
if (drawTop)
XDrawLine(dpy, win, gc, x1, y1, x2, y1);
if (drawLeft)
XDrawLine(dpy, win, gc, x1, y1 + 2, x1, y2);
if (drawRight)
XDrawLine(dpy, win, gc, x2, y1 + 2, x2, y2);
if (drawBot)
XDrawLine(dpy, win, gc, x1 + loff, y2, x2 - roff, y2);
if (drawTop && clipRect->height > 1)
XDrawLine(dpy, win, gc, x1, y1 + 1, x2, y1 + 1);
if (drawBot && (int)clipRect->height > 1 &&
(int)clipRect->width > roff &&
(int)clipRect->width > loff)
XDrawLine(dpy, win, gc, x1 + loff, y2 - 1, x2 - roff, y2 - 1);
if (clipRect->width > 1 && clipRect->height > 2)
{
if (drawLeft)
XDrawLine(dpy, win, gc, x1 + 1, y1 + 2, x1 + 1, y2);
if (drawRight)
XDrawLine(dpy, win, gc, x2 - 1, y1 + 2, x2 - 1, y2);
}
}
/* Only to be called by XmLGridCellAction() */
void
_XmLGridCellDrawValue(XmLGridCell cell,
Widget w,
XRectangle *clipRect,
XmLGridDrawStruct *ds)
{
XmLGridWidget g;
Display *dpy;
XmLGridCellPixmap *pix;
XmLGridCellIcon *icon;
XRectangle cellRect;
XmLGridCellRefValues *cellValues;
int type, horizMargin, vertMargin, xoff;
g = (XmLGridWidget)w;
cellRect = *ds->cellRect;
cellValues = cell->cell.refValues;
horizMargin = ds->leftMargin + ds->rightMargin;
vertMargin = ds->topMargin + ds->bottomMargin;
if (horizMargin >= (int)cellRect.width ||
vertMargin >= (int)cellRect.height)
return;
type = cellValues->type;
cellRect.x += ds->leftMargin;
cellRect.y += ds->topMargin;
cellRect.width -= horizMargin;
cellRect.height -= vertMargin;
dpy = XtDisplay(w);
if (type == XmSTRING_CELL && XmLGridCellIsValueSet(cell) == True)
{
if (ds->drawSelected == True)
XSetForeground(dpy, ds->gc, ds->selectForeground);
else
XSetForeground(dpy, ds->gc, ds->foreground);
XmLStringDraw(w, (XmString)cell->cell.value, ds->stringDirection,
ds->fontList, ds->alignment, ds->gc,
&cellRect, clipRect);
}
if (type == XmPIXMAP_CELL && XmLGridCellIsValueSet(cell) == True)
{
pix = (XmLGridCellPixmap *)cell->cell.value;
XmLPixmapDraw(w, pix->pixmap, pix->pixmask,
pix->width, pix->height, ds->alignment,
ds->gc, &cellRect, clipRect);
}
if (type == XmICON_CELL && XmLGridCellIsValueSet(cell) == True)
{
icon = (XmLGridCellIcon *)cell->cell.value;
if (icon->pix.pixmap != XmUNSPECIFIED_PIXMAP)
{
XmLPixmapDraw(w, icon->pix.pixmap, icon->pix.pixmask,
icon->pix.width, icon->pix.height, ds->alignment,
ds->gc, &cellRect, clipRect);
xoff = icon->pix.width + g->grid.iconSpacing;
cellRect.x += xoff;
if (xoff < (int)cellRect.width)
cellRect.width -= xoff;
else
cellRect.width = 0;
}
if (cellRect.width && icon->string)
{
if (ds->drawSelected == True)
XSetForeground(dpy, ds->gc, ds->selectForeground);
else
XSetForeground(dpy, ds->gc, ds->foreground);
XmLStringDraw(w, icon->string, ds->stringDirection,
ds->fontList, ds->alignment, ds->gc,
&cellRect, clipRect);
}
}
if (type == XmTOGGLE_CELL)
XmLDrawToggle(w, XmLGridCellGetToggle(cell),
g->grid.toggleSize, ds->alignment, ds->gc,
ds->background, g->grid.toggleTopColor,
g->grid.toggleBotColor, ds->foreground,
&cellRect, clipRect);
if (cellRect.width > cellRect.height - 4 && XmLGridCellDrawSort(cell))
{
int arrow_direction = XmLGridCellSortAscending(cell);
int arrow_size = cellRect.height * 0.75;
if (arrow_size > 0)
{
XSetForeground(dpy, ds->gc, ds->background);
_XmDrawArrow(dpy, XtWindow(w),
((XmManagerWidget)g)->manager.bottom_shadow_GC,
((XmManagerWidget)g)->manager.top_shadow_GC,
ds->gc,
cellRect.x + cellRect.width - arrow_size - 2,
cellRect.y + (cellRect.height / 2 - arrow_size / 2),
arrow_size,
arrow_size,
2,
arrow_direction);
}
}
}
/* Only to be called by XmLGridCellAction() */
static int
_XmLGridCellConfigureText(XmLGridCell cell, Widget w, XRectangle *rect)
{
XmLGridWidget g;
g = (XmLGridWidget)w;
XtConfigureWidget(g->grid.text, rect->x, rect->y,
rect->width, rect->height, 0);
return(0);
}
/* Only to be called by XmLGridCellAction() */
static int
_XmLGridCellBeginTextEdit(XmLGridCell cell,
Widget w,
XRectangle *clipRect)
{
XmLGridWidget g = (XmLGridWidget)w;
Widget text;
if ((cell->cell.refValues->type != XmSTRING_CELL &&
cell->cell.refValues->type != XmICON_CELL)
|| cell->cell.refValues->editable != True
|| g->grid.useTextWidget != True)
return 0;
XtVaGetValues(w,
XmNtextWidget, &text,
NULL);
XtVaSetValues(text,
XmNfontList, cell->cell.refValues->fontList,
NULL);
return 1;
}
/* Only to be called by XmLGridCellAction() */
static void
_XmLGridCellCompleteTextEdit(XmLGridCell cell,
Widget w)
{
XmLGridWidget g = (XmLGridWidget)w;
Widget text;
char *s;
int i, len;
if ((cell->cell.refValues->type != XmSTRING_CELL &&
cell->cell.refValues->type != XmICON_CELL)
|| cell->cell.refValues->editable != True
|| g->grid.useTextWidget != True)
return;
XtVaGetValues(w,
XmNtextWidget, &text,
NULL);
s = XmTextGetString(text);
len = strlen(s);
for (i = 0; i < len - 1; i++)
if (s[i] == '\\' && s[i + 1] == 'n')
{
s[i] = '\n';
strcpy(&s[i + 1], &s[i + 2]);
}
XmLGridCellSetString(cell,
XmStringCreateLtoR(s, XmSTRING_DEFAULT_CHARSET),
False);
#if 0
if (XmLGridCellIsValueSet(cell) == True)
XmStringFree((XmString)cell->cell.value);
if (strlen(s))
{
cell->cell.value = (void *)XmStringCreateLtoR(s,
XmSTRING_DEFAULT_CHARSET);
XmLGridCellSetValueSet(cell, True);
}
else
XmLGridCellSetValueSet(cell, False);
#endif /*0*/
XtFree(s);
}
/* Only to be called by XmLGridCellAction() */
static void
_XmLGridCellInsertText(XmLGridCell cell,
Widget w)
{
XmLGridWidget g = (XmLGridWidget)w;
char *s;
Widget text = NULL;
if ((cell->cell.refValues->type != XmSTRING_CELL &&
cell->cell.refValues->type != XmICON_CELL)
|| cell->cell.refValues->editable != True
|| g->grid.useTextWidget != True)
return;
XtVaGetValues(w,
XmNtextWidget, &text,
NULL);
s = 0;
if (XmLGridCellIsValueSet(cell) == True)
s = CvtXmStringToStr(XmLGridCellGetString(cell));
if (s)
{
XmTextSetString(text, s);
free(s);
}
else
XmTextSetString(text, "");
XmTextSetInsertionPosition(text, XmTextGetLastPosition(text));
XmProcessTraversal(text, XmTRAVERSE_CURRENT);
}
/* Only to be called by XmLGridCellAction() */
static int
_XmLGridCellGetHeight(XmLGridCell cell,
Widget w,
XmLGridRow row)
{
XmLGridCellPixmap *pix;
XmLGridCellIcon *icon;
XmLGridCellRefValues *cellValues;
int height, pixHeight;
cellValues = cell->cell.refValues;
height = -1;
if (cellValues->type == XmPIXMAP_CELL)
{
if (XmLGridCellIsValueSet(cell) == True)
{
pix = (XmLGridCellPixmap *)cell->cell.value;
if (pix->height)
height = 4 + pix->height + cellValues->topMargin +
cellValues->bottomMargin;
}
}
else if (cellValues->type == XmICON_CELL)
{
pixHeight = 0;
if (XmLGridCellIsValueSet(cell) == True)
{
icon = (XmLGridCellIcon *)cell->cell.value;
if (icon->pix.pixmap != XmUNSPECIFIED_PIXMAP && icon->pix.height)
pixHeight = 4 + icon->pix.height +
cellValues->topMargin + cellValues->bottomMargin;
}
height = 4 + row->grid.height * cellValues->fontHeight +
cellValues->topMargin + cellValues->bottomMargin;
if (pixHeight > height)
height = pixHeight;
}
else if (cellValues->type == XmTOGGLE_CELL)
height = 4 + 16 + cellValues->topMargin +
cellValues->bottomMargin;
else if (cellValues->type == XmSTRING_CELL)
{
height = 4 + row->grid.height * cellValues->fontHeight +
cellValues->topMargin + cellValues->bottomMargin;
}
if (height < 0 || cellValues->rowSpan)
height = 4;
return height;
}
/* Only to be called by XmLGridCellAction() */
static int
_XmLGridCellGetWidth(XmLGridCell cell,
Widget w,
XmLGridColumn col)
{
XmLGridWidget g = (XmLGridWidget)w;
XmLGridCellPixmap *pix;
XmLGridCellIcon *icon;
XmLGridCellRefValues *cellValues;
int width;
cellValues = cell->cell.refValues;
width = -1;
if (cellValues->type == XmPIXMAP_CELL)
{
if (XmLGridCellIsValueSet(cell) == True)
{
pix = (XmLGridCellPixmap *)cell->cell.value;
if (pix->width)
width = 4 + pix->width + cellValues->leftMargin +
cellValues->rightMargin;
}
}
else if (cellValues->type == XmICON_CELL)
{
width = 4 + col->grid.width * cellValues->fontWidth +
cellValues->leftMargin + cellValues->rightMargin;
if (XmLGridCellIsValueSet(cell) == True)
{
icon = (XmLGridCellIcon *)cell->cell.value;
if (icon->pix.pixmap != XmUNSPECIFIED_PIXMAP && icon->pix.width)
width += icon->pix.width + g->grid.iconSpacing;
}
}
else if (cellValues->type == XmTOGGLE_CELL)
width = 4 + 16 + cellValues->leftMargin +
cellValues->rightMargin;
else if (cellValues->type == XmSTRING_CELL)
width = 4 + col->grid.width * cellValues->fontWidth +
cellValues->leftMargin + cellValues->rightMargin;
if (width < 0 || cellValues->columnSpan)
width = 4;
return width;
}
/* Only to be called by XmLGridCellAction() */
static void
_XmLGridCellFreeValue(XmLGridCell cell)
{
int type;
XmLGridCellIcon *icon;
if (XmLGridCellIsValueSet(cell) == False)
return;
type = cell->cell.refValues->type;
if (type == XmSTRING_CELL)
XmStringFree((XmString)cell->cell.value);
else if (type == XmPIXMAP_CELL)
free((char *)cell->cell.value);
else if (type == XmICON_CELL)
{
icon = (XmLGridCellIcon *)cell->cell.value;
if (icon->string)
XmStringFree(icon->string);
free((char *)icon);
}
XmLGridCellSetValueSet(cell, False);
}
/*
Public Functions
*/
Widget
XmLCreateGrid(Widget parent,
char *name,
ArgList arglist,
Cardinal argcount)
{
return XtCreateWidget(name, xmlGridWidgetClass, parent,
arglist, argcount);
}
void
XmLGridAddColumns(Widget w,
unsigned char type,
int position,
int count)
{
XmLGridWidget g;
XmLGridColumn col;
XmLGridRow row;
XmLGridCell cell;
XmLGridCallbackStruct cbs;
int i, j, rowCount, hasAddCB, redraw;
g = WidgetToGrid(w, "AddColumns()");
if (!g)
return;
if (count <= 0)
return;
redraw = 0;
position = ColTypePosToPos(g, type, position, 1);
if (position < 0)
position = ColTypePosToPos(g, type, -1, 1);
/* adjust count */
if (type == XmHEADING)
{
g->grid.headingColCount += count;
g->grid.leftFixedCount += count;
redraw = 1;
}
else if (type == XmFOOTER)
{
g->grid.footerColCount += count;
g->grid.rightFixedCount += count;
redraw = 1;
}
else /* XmCONTENT */
g->grid.colCount += count;
hasAddCB = 0;
if (XtHasCallbacks(w, XmNaddCallback) == XtCallbackHasSome)
hasAddCB = 1;
/* add columns */
XmLArrayAdd(g->grid.colArray, position, count);
for (i = 0; i < count; i++)
{
col = 0;
if (hasAddCB)
{
cbs.reason = XmCR_ADD_COLUMN;
cbs.columnType = type;
cbs.object = 0;
XtCallCallbackList(w, g->grid.addCallback, (XtPointer)&cbs);
col = (XmLGridColumn)cbs.object;
}
if (!col)
col = XmLGridColumnNew(w);
XmLArraySet(g->grid.colArray, position + i, col);
}
/* add cells */
rowCount = XmLArrayGetCount(g->grid.rowArray);
for (j = 0; j < rowCount; j++)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, j);
XmLArrayAdd(XmLGridRowCells(row), position, count);
for (i = position; i < position + count; i++)
{
cell = 0;
if (hasAddCB)
{
cbs.reason = XmCR_ADD_CELL;
cbs.rowType = RowPosToType(g, j);
cbs.columnType = type;
cbs.object = 0;
XtCallCallbackList(w, g->grid.addCallback, (XtPointer)&cbs);
cell = (XmLGridCell)cbs.object;
}
if (!cell)
cell = XmLGridCellNew();
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, i);
if (col->grid.defCellValues)
XmLGridCellSetRefValues(cell, col->grid.defCellValues);
else
XmLGridCellSetRefValues(cell, g->grid.defCellValues);
XmLArraySet(XmLGridRowCells(row), i, cell);
}
XmLGridRowHeightChanged(row);
}
for (i = position; i < position + count; i++)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, i);
XmLGridColumnWidthChanged(col);
}
/* sanity check */
if (XmLArrayGetCount(g->grid.colArray) != g->grid.headingColCount +
g->grid.colCount + g->grid.footerColCount)
XmLWarning(w, "AddColumns() - count sanity check failed");
/* maintain scroll and focus position */
if (g->grid.hsPolicy == XmCONSTANT)
{
if (type == XmCONTENT && g->grid.colCount == count)
g->grid.scrollCol = 0;
else if (position <= g->grid.scrollCol)
g->grid.scrollCol += count;
}
if (position <= g->grid.focusCol)
g->grid.focusCol += count;
VisPosChanged(g, 0);
HorizLayout(g, 1);
VertLayout(g, 1);
if (g->grid.focusCol == -1 && type == XmCONTENT)
{
if (g->grid.focusRow != -1)
SetFocus(g, g->grid.focusRow, position, 0, 0);
else
g->grid.focusCol = position;
}
for (i = position; i < position + count; i++)
redraw |= ColIsVisible(g, i);
if (redraw)
DrawArea(g, DrawAll, 0, 0);
}
void
XmLGridAddRows(Widget w,
unsigned char type,
int position,
int count)
{
XmLGridWidget g;
XmLGridRow row;
XmLGridColumn col;
XmLGridCell cell;
XmLGridCallbackStruct cbs;
int i, j, hasAddCB, redraw, colCount;
g = WidgetToGrid(w, "AddRows()");
if (!g)
return;
if (count <= 0)
return;
redraw = 0;
position = RowTypePosToPos(g, type, position, 1);
if (position < 0)
position = RowTypePosToPos(g, type, -1, 1);
/* adjust count */
if (type == XmHEADING)
{
g->grid.headingRowCount += count;
g->grid.topFixedCount += count;
redraw = 1;
}
else if (type == XmFOOTER)
{
g->grid.footerRowCount += count;
g->grid.bottomFixedCount += count;
redraw = 1;
}
else /* XmCONTENT */
g->grid.rowCount += count;
/* add rows and cells */
XmLArrayAdd(g->grid.rowArray, position, count);
colCount = XmLArrayGetCount(g->grid.colArray);
hasAddCB = 0;
if (XtHasCallbacks(w, XmNaddCallback) == XtCallbackHasSome)
hasAddCB = 1;
for (i = 0; i < count; i++)
{
row = 0;
if (hasAddCB)
{
cbs.reason = XmCR_ADD_ROW;
cbs.rowType = type;
cbs.object = 0;
XtCallCallbackList(w, g->grid.addCallback, (XtPointer)&cbs);
row = (XmLGridRow)cbs.object;
}
if (!row)
row = XmLGridRowNew(w);
XmLArraySet(g->grid.rowArray, position + i, row);
XmLArrayAdd(XmLGridRowCells(row), 0, colCount);
for (j = 0; j < colCount; j++)
{
cell = 0;
if (hasAddCB)
{
cbs.reason = XmCR_ADD_CELL;
cbs.rowType = type;
cbs.columnType = ColPosToType(g, j);
cbs.object = 0;
XtCallCallbackList(w, g->grid.addCallback, (XtPointer)&cbs);
cell = (XmLGridCell)cbs.object;
}
if (!cell)
cell = XmLGridCellNew();
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, j);
if (col->grid.defCellValues)
XmLGridCellSetRefValues(cell, col->grid.defCellValues);
else
XmLGridCellSetRefValues(cell, g->grid.defCellValues);
XmLArraySet(XmLGridRowCells(row), j, cell);
}
XmLGridRowHeightChanged(row);
}
for (j = 0; j < colCount; j++)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, j);
XmLGridColumnWidthChanged(col);
}
/* sanity check */
if (XmLArrayGetCount(g->grid.rowArray) != g->grid.headingRowCount +
g->grid.rowCount + g->grid.footerRowCount)
XmLWarning(w, "AddRows() - count sanity check failed");
/* maintain scroll and focus position */
if (g->grid.vsPolicy == XmCONSTANT)
{
if (type == XmCONTENT && g->grid.rowCount == count)
g->grid.scrollRow = 0;
else if (position <= g->grid.scrollRow)
g->grid.scrollRow += count;
}
if (position <= g->grid.focusRow)
g->grid.focusRow += count;
VisPosChanged(g, 1);
HorizLayout(g, 1);
VertLayout(g, 1);
if (g->grid.focusRow == -1 && type == XmCONTENT)
{
if (g->grid.focusCol != -1)
SetFocus(g, position, g->grid.focusCol, 0, 0);
else
g->grid.focusRow = position;
}
for (i = position; i < position + count; i++)
redraw |= RowIsVisible(g, i);
if (redraw)
DrawArea(g, DrawAll, 0, 0);
#ifdef XmLEVAL
if (g->grid.rowCount > 100)
{
fprintf(stderr, "XmL: evaluation version only supports <= 100 rows\n");
exit(0);
}
#endif
}
void
XmLGridDeleteAllColumns(Widget w,
unsigned char type)
{
XmLGridWidget g;
int n;
g = WidgetToGrid(w, "DeleteAllColumns()");
if (!g)
return;
if (type == XmHEADING)
n = g->grid.headingColCount;
else if (type == XmCONTENT)
n = g->grid.colCount;
else if (type == XmFOOTER)
n = g->grid.footerColCount;
else
{
XmLWarning(w, "DeleteAllColumns() - invalid type");
return;
}
if (!n)
return;
XmLGridDeleteColumns(w, type, 0, n);
}
void
XmLGridDeleteAllRows(Widget w,
unsigned char type)
{
XmLGridWidget g;
int n;
g = WidgetToGrid(w, "DeleteAllRows()");
if (!g)
return;
if (type == XmHEADING)
n = g->grid.headingRowCount;
else if (type == XmCONTENT)
n = g->grid.rowCount;
else if (type == XmFOOTER)
n = g->grid.footerRowCount;
else
{
XmLWarning(w, "DeleteAllRows() - invalid type");
return;
}
if (!n)
return;
XmLGridDeleteRows(w, type, 0, n);
}
void
XmLGridDeselectAllRows(Widget w,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "DeselectAllRows()");
if (!g)
return;
SelectTypeArea(g, SelectRow, (XEvent *)0, -1, 0, False, notify);
}
void
XmLGridDeselectAllColumns(Widget w,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "DeselectAllColumns()");
if (!g)
return;
SelectTypeArea(g, SelectCol, (XEvent *)0, 0, -1, False, notify);
}
void
XmLGridDeselectAllCells(Widget w,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "DeselectAllCells()");
if (!g)
return;
SelectTypeArea(g, SelectCell, (XEvent *)0, -1, -1, False, notify);
}
void
XmLGridDeselectCell(Widget w,
int row,
int column,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "DeselectCell()");
if (!g)
return;
SelectTypeArea(g, SelectCell, (XEvent *)0, row, column, False, notify);
}
void
XmLGridDeselectColumn(Widget w,
int column,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "DeselectColumn()");
if (!g)
return;
SelectTypeArea(g, SelectCol, (XEvent *)0, 0, column, False, notify);
}
void
XmLGridDeselectRow(Widget w,
int row,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "DeselectRow()");
if (!g)
return;
SelectTypeArea(g, SelectRow, (XEvent *)0, row, 0, False, notify);
}
void
XmLGridDeleteColumns(Widget w,
unsigned char type,
int position,
int count)
{
XmLGridWidget g;
XmLGridRow row;
XmLGridColumn col;
XmLGridCallbackStruct cbs;
int changeFocus, i, j, rowCount, lastPos, redraw;
g = WidgetToGrid(w, "DeleteColumns()");
if (!g)
return;
if (count <= 0)
return;
lastPos = ColTypePosToPos(g, type, position + count - 1, 0);
position = ColTypePosToPos(g, type, position, 0);
if (position < 0 || lastPos < 0)
{
XmLWarning(w, "DeleteColumns() - invalid position");
return;
}
changeFocus = 0;
if (position <= g->grid.focusCol && lastPos >= g->grid.focusCol)
{
/* deleting focus col */
TextAction(g, TEXT_EDIT_CANCEL);
ChangeFocus(g, g->grid.focusRow, -1);
changeFocus = 1;
}
redraw = 0;
if (XtHasCallbacks(w, XmNdeleteCallback) == XtCallbackHasSome)
for (i = position; i < position + count; i++)
{
rowCount = XmLArrayGetCount(g->grid.rowArray);
for (j = 0; j < rowCount; j++)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, j);
cbs.reason = XmCR_DELETE_CELL;
cbs.rowType = RowPosToType(g, j);
cbs.row = RowPosToTypePos(g, cbs.rowType, i);
cbs.columnType = type;
cbs.column = RowPosToTypePos(g, cbs.columnType, j);
cbs.object = XmLArrayGet(XmLGridRowCells(row), i);
XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs);
}
cbs.reason = XmCR_DELETE_COLUMN;
cbs.columnType = type;
cbs.column = RowPosToTypePos(g, cbs.columnType, i);
cbs.object = XmLArrayGet(g->grid.colArray, i);
XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs);
}
/* adjust count */
if (type == XmHEADING)
{
g->grid.headingColCount -= count;
g->grid.leftFixedCount -= count;
redraw = 1;
}
else if (type == XmFOOTER)
{
g->grid.footerColCount -= count;
g->grid.rightFixedCount -= count;
redraw = 1;
}
else /* XmCONTENT */
g->grid.colCount -= count;
for (i = position; i < position + count; i++)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, i);
if (XmLGridColumnIsHidden(col) == True)
g->grid.hiddenColCount--;
redraw |= ColIsVisible(g, i);
}
/* delete columns */
for (i = position; i < position + count; i++)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, i);
XmLGridColumnFree(w, col);
}
XmLArrayDel(g->grid.colArray, position, count);
/* delete cells */
rowCount = XmLArrayGetCount(g->grid.rowArray);
for (i = 0; i < rowCount; i++)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, i);
for (j = position; j < position + count; j++)
XmLGridCellFree(w,
(XmLGridCell)XmLArrayGet(XmLGridRowCells(row), j));
XmLArrayDel(XmLGridRowCells(row), position, count);
XmLGridRowHeightChanged(row);
}
/* sanity check */
if (XmLArrayGetCount(g->grid.colArray) != g->grid.headingColCount +
g->grid.colCount + g->grid.footerColCount)
XmLWarning(w, "DeleteColumns() - count sanity check failed");
/* maintain scroll and focus position */
if (g->grid.hsPolicy == XmCONSTANT)
{
if (lastPos < g->grid.scrollCol)
g->grid.scrollCol -= count;
else if (position <= g->grid.scrollCol)
g->grid.scrollCol = position;
}
if (lastPos < g->grid.focusCol)
g->grid.focusCol -= count;
VisPosChanged(g, 0);
HorizLayout(g, 1);
VertLayout(g, 1);
if (changeFocus)
{
SetFocus(g, g->grid.focusRow, position, 0, 1);
if (g->grid.focusCol == -1)
SetFocus(g, g->grid.focusRow, position, 0, -1);
}
if (redraw)
DrawArea(g, DrawAll, 0, 0);
}
void
XmLGridDeleteRows(Widget w,
unsigned char type,
int position,
int count)
{
XmLGridWidget g;
XmLGridRow row;
XmLGridColumn col;
XmLGridCallbackStruct cbs;
int changeFocus, i, j, colCount, lastPos, redraw;
g = WidgetToGrid(w, "DeleteRows()");
if (!g)
return;
if (count <= 0)
return;
lastPos = RowTypePosToPos(g, type, position + count - 1, 0);
position = RowTypePosToPos(g, type, position, 0);
if (position < 0 || lastPos < 0)
{
XmLWarning(w, "DeleteRows() - invalid position");
return;
}
changeFocus = 0;
if (position <= g->grid.focusRow && lastPos >= g->grid.focusRow)
{
/* deleting focus row */
TextAction(g, TEXT_EDIT_CANCEL);
ChangeFocus(g, -1, g->grid.focusCol);
changeFocus = 1;
}
redraw = 0;
if (XtHasCallbacks(w, XmNdeleteCallback) == XtCallbackHasSome)
for (i = position; i < position + count; i++)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, i);
colCount = XmLArrayGetCount(g->grid.colArray);
for (j = 0; j < colCount; j++)
{
cbs.reason = XmCR_DELETE_CELL;
cbs.rowType = type;
cbs.row = RowPosToTypePos(g, cbs.rowType, i);
cbs.columnType = ColPosToType(g, j);
cbs.column = ColPosToTypePos(g, cbs.columnType, j);
cbs.object = XmLArrayGet(XmLGridRowCells(row), j);
XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs);
}
cbs.reason = XmCR_DELETE_ROW;
cbs.rowType = type;
cbs.row = RowPosToTypePos(g, cbs.rowType, i);
cbs.object = (void *)row;
XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs);
}
/* adjust count */
if (type == XmHEADING)
{
g->grid.headingRowCount -= count;
g->grid.topFixedCount -= count;
redraw = 1;
}
else if (type == XmFOOTER)
{
g->grid.footerRowCount -= count;
g->grid.bottomFixedCount -= count;
redraw = 1;
}
else /* XmCONTENT */
g->grid.rowCount -= count;
for (i = position; i < position + count; i++)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, i);
if (XmLGridRowIsHidden(row) == True)
g->grid.hiddenRowCount--;
redraw |= RowIsVisible(g, i);
}
/* delete rows and cells */
for (i = position; i < position + count; i++)
{
row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, i);
XmLGridRowFree(w, row);
}
XmLArrayDel(g->grid.rowArray, position, count);
colCount = XmLArrayGetCount(g->grid.colArray);
for (i = 0; i < colCount; i++)
{
col = (XmLGridColumn)XmLArrayGet(g->grid.colArray, i);
XmLGridColumnWidthChanged(col);
}
/* sanity check */
if (XmLArrayGetCount(g->grid.rowArray) != g->grid.headingRowCount +
g->grid.rowCount + g->grid.footerRowCount)
XmLWarning(w, "DeleteRows() - count sanity check failed");
/* maintain scroll and focus position */
if (g->grid.vsPolicy == XmCONSTANT)
{
if (lastPos < g->grid.scrollRow)
g->grid.scrollRow -= count;
else if (position <= g->grid.scrollRow)
g->grid.scrollRow = position;
}
if (lastPos < g->grid.focusRow)
g->grid.focusRow -= count;
VisPosChanged(g, 1);
HorizLayout(g, 1);
VertLayout(g, 1);
if (changeFocus)
{
SetFocus(g, position, g->grid.focusCol, 1, 0);
if (g->grid.focusRow == -1)
SetFocus(g, position, g->grid.focusCol, -1, 0);
}
if (redraw)
DrawArea(g, DrawAll, 0, 0);
}
void
XmLGridGetFocus(Widget w,
int *row,
int *column,
Boolean *focusIn)
{
XmLGridWidget g;
unsigned char rowType, colType;
g = WidgetToGrid(w, "GetFocus()");
if (!g)
return;
if (g->grid.focusIn)
*focusIn = True;
else
*focusIn = False;
if (g->grid.focusRow < 0 || g->grid.focusCol < 0)
{
*row = -1;
*column = -1;
return;
}
rowType = RowPosToType(g, g->grid.focusRow);
colType = ColPosToType(g, g->grid.focusCol);
if (rowType != XmCONTENT || colType != XmCONTENT)
{
*row = -1;
*column = -1;
XmLWarning(w, "GetFocus() - focus row/column invalid\n");
return;
}
*row = RowPosToTypePos(g, XmCONTENT, g->grid.focusRow);
*column = ColPosToTypePos(g, XmCONTENT, g->grid.focusCol);
}
XmLGridRow
XmLGridGetRow(Widget w,
unsigned char rowType,
int row)
{
XmLGridWidget g;
XmLGridRow r;
int pos;
g = WidgetToGrid(w, "GetRow()");
if (!g)
return 0;
pos = RowTypePosToPos(g, rowType, row, 0);
r = (XmLGridRow)XmLArrayGet(g->grid.rowArray, pos);
if (!r)
XmLWarning(w, "GetRow() - invalid row");
return r;
}
int
XmLGridEditBegin(Widget w,
Boolean insert,
int row,
int column)
{
XmLGridWidget g;
int r, c;
XRectangle rect;
g = WidgetToGrid(w, "EditBegin()");
if (!g)
return -1;
if (column < 0 || column >= g->grid.colCount)
{
XmLWarning(w, "EditBegin() - invalid column");
return -1;
}
if (row < 0 || row >= g->grid.rowCount)
{
XmLWarning(w, "EditBegin() - invalid row");
return -1;
}
r = RowTypePosToPos(g, XmCONTENT, row, 0);
c = ColTypePosToPos(g, XmCONTENT, column, 0);
if (RowColToXY(g, r, c, True, &rect) == -1)
{
XmLWarning(w, "EditBegin() - cell must be visible to begin edit");
return -1;
}
if (SetFocus(g, r, c, 0, 0) == -1)
{
XmLWarning(w, "EditBegin() - can't set focus to cell");
return -1;
}
if (insert == False)
TextAction(g, TEXT_EDIT);
else
TextAction(g, TEXT_EDIT_INSERT);
return 0;
}
void
XmLGridEditCancel(Widget w)
{
XmLGridWidget g;
g = WidgetToGrid(w, "EditCancel()");
if (!g)
return;
TextAction(g, TEXT_EDIT_CANCEL);
}
void
XmLGridEditComplete(Widget w)
{
XmLGridWidget g;
g = WidgetToGrid(w, "EditComplete()");
if (!g)
return;
TextAction(g, TEXT_EDIT_COMPLETE);
}
XmLGridColumn
XmLGridGetColumn(Widget w,
unsigned char columnType,
int column)
{
XmLGridWidget g;
XmLGridColumn c;
int pos;
g = WidgetToGrid(w, "GetColumn()");
if (!g)
return 0;
pos = ColTypePosToPos(g, columnType, column, 0);
c = (XmLGridColumn)XmLArrayGet(g->grid.colArray, pos);
if (!c)
XmLWarning(w, "GetColumn() - invalid column");
return c;
}
int
XmLGridGetSelectedCellCount(Widget w)
{
XmLGridWidget g;
g = WidgetToGrid(w, "GetSelectedCellCount()");
if (!g)
return -1;
return GetSelectedArea(g, SelectCell, 0, 0, 0);
}
int
XmLGridGetSelectedCells(Widget w,
int *rowPositions,
int *columnPositions,
int count)
{
XmLGridWidget g;
int n;
g = WidgetToGrid(w, "GetSelectedCells()");
if (!g)
return -1;
n = GetSelectedArea(g, SelectCell, rowPositions, columnPositions, count);
if (count != n)
{
XmLWarning(w, "GetSelectedCells() - count is incorrect");
return -1;
}
return 0;
}
int
XmLGridGetSelectedColumnCount(Widget w)
{
XmLGridWidget g;
g = WidgetToGrid(w, "GetSelectedColumnCount()");
if (!g)
return -1;
return GetSelectedArea(g, SelectCol, 0, 0, 0);
}
int
XmLGridGetSelectedColumns(Widget w,
int *positions,
int count)
{
XmLGridWidget g;
int n;
g = WidgetToGrid(w, "GetSelectedColumns()");
if (!g)
return -1;
n = GetSelectedArea(g, SelectCol, 0, positions, count);
if (count != n)
{
XmLWarning(w, "GetSelectedColumns() - count is incorrect");
return -1;
}
return 0;
}
int
XmLGridGetSelectedRow(Widget w)
{
XmLGridWidget g;
int n, pos;
g = WidgetToGrid(w, "GetSelectedRow()");
if (!g)
return -1;
n = GetSelectedArea(g, SelectRow, &pos, 0, 1);
if (n != 1)
return -1;
return pos;
}
int
XmLGridGetSelectedRowCount(Widget w)
{
XmLGridWidget g;
g = WidgetToGrid(w, "GetSelectedRowCount()");
if (!g)
return -1;
return GetSelectedArea(g, SelectRow, 0, 0, 0);
}
int
XmLGridGetSelectedRows(Widget w,
int *positions,
int count)
{
XmLGridWidget g;
int n;
g = WidgetToGrid(w, "GetSelectedRows()");
if (!g)
return -1;
n = GetSelectedArea(g, SelectRow, positions, 0, count);
if (count != n)
{
XmLWarning(w, "GetSelectedRows() - count is incorrect");
return -1;
}
return 0;
}
Boolean
XmLGridColumnIsVisible(Widget w,
int col)
{
XmLGridWidget g;
g = WidgetToGrid(w, "ColumnIsVisible()");
if (!g)
return -1;
if (!ColIsVisible(g, g->grid.headingColCount + col))
return False;
return True;
}
void
XmLGridMoveColumns(Widget w,
int newPosition,
int position,
int count)
{
XmLGridWidget g;
XmLGridRow row;
int i, np, p, rowCount;
g = WidgetToGrid(w, "MoveColumns()");
if (!g)
return;
np = ColTypePosToPos(g, XmCONTENT, newPosition, 0);
p = ColTypePosToPos(g, XmCONTENT, position, 0);
if (XmLArrayMove(g->grid.colArray, np, p, count) == -1)
{
XmLWarning(w, "MoveColumns() - invalid position");
return;
}
rowCount = XmLArrayGetCount(g->grid.rowArray);
for (i = 0; i < rowCount; i++)
{
row = XmLArrayGet(g->grid.rowArray, i);
XmLArrayMove(XmLGridRowCells(row), np, p, count);
}
VisPosChanged(g, 0);
HorizLayout(g, 1);
DrawArea(g, DrawAll, 0, 0);
}
void
XmLGridMoveRows(Widget w,
int newPosition,
int position,
int count)
{
XmLGridWidget g;
int np, p;
g = WidgetToGrid(w, "MoveRows()");
if (!g)
return;
np = RowTypePosToPos(g, XmCONTENT, newPosition, 0);
p = RowTypePosToPos(g, XmCONTENT, position, 0);
if (XmLArrayMove(g->grid.rowArray, np, p, count) == -1)
{
XmLWarning(w, "MoveRows() - invalid position/count");
return;
}
VisPosChanged(g, 1);
VertLayout(g, 1);
DrawArea(g, DrawAll, 0, 0);
}
void
XmLGridReorderColumns(Widget w,
int *newPositions,
int position,
int count)
{
XmLGridWidget g;
XmLGridRow row;
int i, *np, p, rowCount, status;
g = WidgetToGrid(w, "ReorderColumns()");
if (!g)
return;
if (count <= 0)
return;
p = ColTypePosToPos(g, XmCONTENT, position, 0);
np = (int *)malloc(sizeof(int) * count);
for (i = 0; i < count; i++)
np[i] = ColTypePosToPos(g, XmCONTENT, newPositions[i], 0);
status = XmLArrayReorder(g->grid.colArray, np, p, count);
if (status < 0)
{
free((char *)np);
XmLWarning(w, "ReorderColumns() - invalid position/count");
return;
}
rowCount = XmLArrayGetCount(g->grid.rowArray);
for (i = 0; i < rowCount; i++)
{
row = XmLArrayGet(g->grid.rowArray, i);
XmLArrayReorder(XmLGridRowCells(row), np, p, count);
}
free((char *)np);
VisPosChanged(g, 0);
HorizLayout(g, 1);
DrawArea(g, DrawAll, 0, 0);
}
void
XmLGridReorderRows(Widget w,
int *newPositions,
int position,
int count)
{
XmLGridWidget g;
int i, *np, p, status;
g = WidgetToGrid(w, "ReorderRows()");
if (!g)
return;
if (count <= 0)
return;
p = RowTypePosToPos(g, XmCONTENT, position, 0);
np = (int *)malloc(sizeof(int) * count);
for (i = 0; i < count; i++)
np[i] = RowTypePosToPos(g, XmCONTENT, newPositions[i], 0);
status = XmLArrayReorder(g->grid.rowArray, np, p, count);
free((char *)np);
if (status == -1)
{
XmLWarning(w, "ReorderRows() - invalid position/count");
return;
}
VisPosChanged(g, 1);
VertLayout(g, 1);
DrawArea(g, DrawAll, 0, 0);
}
int
XmLGridRowColumnToXY(Widget w,
unsigned char rowType,
int row,
unsigned char columnType,
int column,
Boolean clipped,
XRectangle *rect)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "RowColumnToXY()");
if (!g)
return -1;
r = RowTypePosToPos(g, rowType, row, 0);
c = ColTypePosToPos(g, columnType, column, 0);
if (r < 0 || r >= XmLArrayGetCount(g->grid.rowArray) ||
c < 0 || c >= XmLArrayGetCount(g->grid.colArray))
{
/* XmLWarning(w, "RowColumnToXY() - invalid position");*/
return -1;
}
return RowColToXY(g, r, c, clipped, rect);
}
Boolean
XmLGridRowIsVisible(Widget w, int row)
{
XmLGridWidget g;
g = WidgetToGrid(w, "RowIsVisible()");
if (!g)
return -1;
if (!RowIsVisible(g, g->grid.headingRowCount + row))
return False;
return True;
}
void
XmLGridSelectAllRows(Widget w,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "SelectAllRows()");
if (!g)
return;
SelectTypeArea(g, SelectRow, (XEvent *)0, -1, 0, True, notify);
}
void
XmLGridSelectAllColumns(Widget w,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "SelectAllColumns()");
if (!g)
return;
SelectTypeArea(g, SelectCol, (XEvent *)0, 0, -1, True, notify);
}
void
XmLGridSelectAllCells(Widget w,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "SelectAllCells()");
if (!g)
return;
SelectTypeArea(g, SelectCell, (XEvent *)0, -1, -1, True, notify);
}
void
XmLGridSelectCell(Widget w,
int row,
int column,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "SelectCell()");
if (!g)
return;
SelectTypeArea(g, SelectCell, (XEvent *)0, row, column, True, notify);
}
void
XmLGridSelectColumn(Widget w,
int column,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "SelectColumn()");
if (!g)
return;
SelectTypeArea(g, SelectCol, (XEvent *)0, 0, column, True, notify);
}
void
XmLGridSelectRow(Widget w,
int row,
Boolean notify)
{
XmLGridWidget g;
g = WidgetToGrid(w, "SelectRow()");
if (!g)
return;
SelectTypeArea(g, SelectRow, (XEvent *)0, row, 0, True, notify);
}
int
XmLGridSetFocus(Widget w,
int row,
int column)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "SetFocus()");
if (!g)
return -1;
if (row < 0 || row >= g->grid.rowCount)
{
XmLWarning(w, "SetFocus() - invalid row");
return -1;
}
if (column < 0 || column >= g->grid.colCount)
{
XmLWarning(w, "SetFocus() - invalid column");
return -1;
}
r = RowTypePosToPos(g, XmCONTENT, row, 0);
c = ColTypePosToPos(g, XmCONTENT, column, 0);
return SetFocus(g, r, c, 0, 0);
}
int
XmLGridXYToRowColumn(Widget w,
int x,
int y,
unsigned char *rowType,
int *row,
unsigned char *columnType,
int *column)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "XYToRowColumn()");
if (!g)
return -1;
if (XYToRowCol(g, x, y, &r, &c) == -1)
return -1;
*rowType = RowPosToType(g, r);
*row = RowPosToTypePos(g, *rowType, r);
*columnType = ColPosToType(g, c);
*column = ColPosToTypePos(g, *columnType, c);
return 0;
}
void
XmLGridRedrawAll(Widget w)
{
XmLGridWidget g;
g = WidgetToGrid(w, "RedrawAll()");
if (!g)
return;
DrawArea(g, DrawAll, 0, 0);
}
void
XmLGridRedrawCell(Widget w,
unsigned char rowType,
int row,
unsigned char columnType,
int column)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "RedrawCell()");
if (!g)
return;
r = RowTypePosToPos(g, rowType, row, 0);
c = ColTypePosToPos(g, columnType, column, 0);
DrawArea(g, DrawCell, r, c);
}
void
XmLGridRedrawColumn(Widget w,
unsigned char type,
int column)
{
XmLGridWidget g;
int c;
g = WidgetToGrid(w, "RedrawColumn()");
if (!g)
return;
c = ColTypePosToPos(g, type, column, 0);
DrawArea(g, DrawCol, 0, c);
}
void
XmLGridRedrawRow(Widget w,
unsigned char type,
int row)
{
XmLGridWidget g;
int r;
g = WidgetToGrid(w, "RedrawRow()");
if (!g)
return;
r = RowTypePosToPos(g, type, row, 0);
DrawArea(g, DrawRow, r, 0);
}
int
XmLGridRead(Widget w,
FILE *file,
int format,
char delimiter)
{
XmLGridWidget g;
char *data;
int n;
g = WidgetToGrid(w, "Read()");
if (!g)
return 0;
if (!file)
{
XmLWarning(w, "Read() - file is NULL");
return 0;
}
data = FileToString(file);
if (!data)
{
XmLWarning(w, "Read() - error loading file");
return 0;
}
n = Read(g, format, delimiter, 0, 0, data);
free((char *)data);
return n;
}
int
XmLGridReadPos(Widget w,
FILE *file,
int format,
char delimiter,
unsigned char rowType,
int row,
unsigned char columnType,
int column)
{
XmLGridWidget g;
char *data;
int r, c, n;
g = WidgetToGrid(w, "ReadPos()");
if (!g)
return 0;
if (!file)
{
XmLWarning(w, "ReadPos() - file is NULL");
return 0;
}
data = FileToString(file);
if (!data)
{
XmLWarning(w, "ReadPos() - error loading file");
return 0;
}
r = RowTypePosToPos(g, rowType, row, 0);
c = ColTypePosToPos(g, columnType, column, 0);
n = Read(g, format, delimiter, r, c, data);
free((char *)data);
return n;
}
int
XmLGridSetStrings(Widget w,
char *data)
{
XmLGridWidget g;
g = WidgetToGrid(w, "SetStrings()");
if (!g)
return 0;
return Read(g, XmFORMAT_DELIMITED, '|', 0, 0, data);
}
int
XmLGridSetStringsPos(Widget w,
unsigned char rowType,
int row,
unsigned char columnType,
int column,
char *data)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "SetStringsPos()");
if (!g)
return 0;
r = RowTypePosToPos(g, rowType, row, 0);
c = ColTypePosToPos(g, columnType, column, 0);
return Read(g, XmFORMAT_DELIMITED, '|', r, c, data);
}
int
XmLGridWrite(Widget w,
FILE *file,
int format,
char delimiter,
Boolean skipHidden)
{
XmLGridWidget g;
int nrow, ncol;
g = WidgetToGrid(w, "Write()");
if (!g)
return 0;
nrow = XmLArrayGetCount(g->grid.rowArray);
ncol = XmLArrayGetCount(g->grid.colArray);
Write(g, file, format, delimiter, skipHidden, 0, 0, nrow, ncol);
return 0;
}
int
XmLGridWritePos(Widget w,
FILE *file,
int format,
char delimiter,
Boolean skipHidden,
unsigned char rowType,
int row,
unsigned char columnType,
int column,
int nrow,
int ncolumn)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "WritePos()");
if (!g)
return 0;
r = RowTypePosToPos(g, rowType, row, 0);
c = ColTypePosToPos(g, columnType, column, 0);
Write(g, file, format, delimiter, skipHidden, r, c, nrow, ncolumn);
return 0;
}
Boolean
XmLGridCopyPos(Widget w,
Time time,
unsigned char rowType,
int row,
unsigned char columnType,
int column,
int nrow,
int ncolumn)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "CopyPos()");
if (!g)
return False;
r = RowTypePosToPos(g, rowType, row, 0);
c = ColTypePosToPos(g, columnType, column, 0);
return Copy(g, time, 0, r, c, nrow, ncolumn);
}
Boolean
XmLGridCopySelected(Widget w,
Time time)
{
XmLGridWidget g;
g = WidgetToGrid(w, "CopySelected()");
if (!g)
return False;
return Copy(g, time, 1, 0, 0, 0, 0);
}
Boolean
XmLGridPaste(Widget w)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "Paste()");
if (!g)
return False;
r = g->grid.focusRow;
c = g->grid.focusCol;
if (r < 0 || c < 0)
{
XmLWarning(w, "Paste() - no cell has focus");
return False;
}
return Paste(g, r, c);
}
Boolean
XmLGridPastePos(Widget w,
unsigned char rowType,
int row,
unsigned char columnType,
int column)
{
XmLGridWidget g;
int r, c;
g = WidgetToGrid(w, "PastePos()");
if (!g)
return False;
r = RowTypePosToPos(g, rowType, row, 0);
c = ColTypePosToPos(g, columnType, column, 0);
return Paste(g, r, c);
}
/* XFE Additions below here */
static void
EditTimer(XtPointer clientData,
XtIntervalId *intervalId)
{
XmLGridWidget g;
g = (XmLGridWidget)clientData;
g->grid.editTimerSet = 0;
g->grid.lastSelectTime = 0;
TextAction(g,TEXT_EDIT_INSERT);
}
void
XmLGridSetVisibleColumnCount(Widget w, int new_num_visible)
{
XmLGridWidget g = (XmLGridWidget)w;
int ii, num_columns, visible_count;
XmLGridColumn colp;
visible_count = 0;
num_columns = XmLArrayGetCount(g->grid.colArray);
if (new_num_visible == 0)
return;
for (ii = 0; ii < num_columns; ii ++)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, ii);
if (colp->grid.hidden && visible_count < new_num_visible)
{
colp->grid.hidden = False;
}
else if (!colp->grid.hidden && visible_count >= new_num_visible)
{
colp->grid.hidden = True;
}
if (!colp->grid.hidden)
visible_count++;
}
if (visible_count < num_columns)
g->grid.visibleCols = visible_count;
else
g->grid.visibleCols = 0;
setHideUnhideSensitivity(w);
HorizLayout(g, 1);
DrawArea(g, DrawAll, 0, 0);
}
static void
HideColumn(Widget w, XtPointer clientData, XtPointer callData)
{
Widget g = (Widget) clientData;
XmLGridHideRightColumn(g);
}
static void
UnhideColumn(Widget w, XtPointer clientData, XtPointer callData)
{
Widget g = (Widget) clientData;
XmLGridUnhideRightColumn(g);
}
static void
CreateHideUnhideButtons(XmLGridWidget g)
{
if (!g->grid.hideUnhideButtons)
{
XmLWarning((Widget)g,"CreateHideUnhideButtons - Creating buttons when XmNhideUnhideButtons is False.");
return;
}
g->grid.hideButton = XtVaCreateWidget(
"hide", xmDrawnButtonWidgetClass,
(Widget)g, XmNhighlightThickness, 0,
XmNshadowThickness, 1,
XmNtraversalOn, False,
XmNbackground, g->core.background_pixel,
XmNforeground, g->manager.foreground,
XmNtopShadowColor, g->manager.top_shadow_color,
XmNbottomShadowColor, g->manager.bottom_shadow_color,
NULL);
g->grid.unhideButton = XtVaCreateWidget(
"unhide", xmDrawnButtonWidgetClass,
(Widget)g, XmNhighlightThickness, 0,
XmNshadowThickness, 1,
XmNtraversalOn, False,
XmNbackground, g->core.background_pixel,
XmNforeground, g->manager.foreground,
XmNtopShadowColor, g->manager.top_shadow_color,
XmNbottomShadowColor, g->manager.bottom_shadow_color,
NULL);
XmLDrawnButtonSetType(g->grid.hideButton, XmDRAWNB_SMALLARROW,
XmDRAWNB_RIGHT);
XmLDrawnButtonSetType(g->grid.unhideButton, XmDRAWNB_SMALLARROW,
XmDRAWNB_LEFT);
XtAddCallback(g->grid.hideButton, XmNactivateCallback,
HideColumn, (XtPointer)g);
XtAddCallback(g->grid.unhideButton, XmNactivateCallback,
UnhideColumn, (XtPointer)g);
#if 0
XtOverrideTranslations(g->grid.unhideButton,
g->grid.unhideButtonTrans);
XtOverrideTranslations(g->grid.hideButton,
g->grid.hideButtonTrans);
#endif /*0*/
}
static void
HideAction(Widget w,
XEvent *event,
String *params,
Cardinal *num_params)
{
XmLGridHideRightColumn(w);
}
static void
UnhideAction(Widget w,
XEvent *event,
String *params,
Cardinal *num_params)
{
XmLGridUnhideRightColumn(w);
}
static void
setHideUnhideSensitivity(Widget w)
{
XmLGridWidget g = (XmLGridWidget)w;
int total_columns = XmLArrayGetCount(g->grid.colArray);
Boolean can_unhide, can_hide;
if (!g->grid.hideUnhideButtons) return;
/* If visibleCols is zero, that means all the columns are visible. */
if (g->grid.visibleCols == 0) {
can_unhide = 0;
can_hide = (total_columns > 1);
} else {
can_unhide = (g->grid.visibleCols < total_columns);
can_hide = (g->grid.visibleCols > 1);
}
XtSetSensitive(g->grid.unhideButton, can_unhide);
XtSetSensitive(g->grid.hideButton, can_hide);
}
void
XmLGridHideRightColumn(Widget w)
{
XmLGridWidget g = (XmLGridWidget)w;
int total_columns = XmLArrayGetCount(g->grid.colArray);
if (total_columns <= 1)
return;
/* If visibleCols is zero, that means all the columns are visible. */
if (g->grid.visibleCols == 0 || g->grid.visibleCols > total_columns)
XmLGridSetVisibleColumnCount(w, total_columns - 1);
else
XmLGridSetVisibleColumnCount(w, g->grid.visibleCols - 1);
}
void
XmLGridUnhideRightColumn(Widget w)
{
XmLGridWidget g = (XmLGridWidget)w;
int total_columns = XmLArrayGetCount(g->grid.colArray);
/* If visibleCols is zero, that means all the columns are visible. */
if ( g->grid.visibleCols != 0 && g->grid.visibleCols < total_columns)
XmLGridSetVisibleColumnCount(w, g->grid.visibleCols + 1);
}
static void
MenuArm(Widget w,
XEvent *event,
String *params,
Cardinal *num_params)
{
XmLGridWidget g = (XmLGridWidget)w;
SelectTypeArea(g, SelectRow, (XEvent *)0, g->grid.lastSelectRow, 0, False, False);
g->grid.inMode = InSelect;
}
static void
MenuDisarm(Widget w,
XEvent *event,
String *params,
Cardinal *num_params)
{
XmLGridWidget g = (XmLGridWidget)w;
g->grid.inMode = InNormal;
}
static void
ResizeColumnToFit(XmLGridWidget g, int new_x)
{
XmLGridColumn colp;
int width = 0;
XRectangle rect;
if (!RowColToXY(g, 0, g->grid.resizeCol, False, &rect))
{
if (new_x > rect.x)
width = (new_x - rect.x) -
(rect.width - GetColWidth(g, g->grid.resizeCol));
if (width < g->grid.minColWidth)
width = g->grid.minColWidth;
/*printf("col(%d) resize_xy(%3d) colx(%3d) colw(%3d) column_width(%3d) new_width(%3d)\n", g->grid.resizeCol, g->grid.resizeLineXY, rect.x, rect.width, GetColWidth(g, g->grid.resizeCol), width);*/
/* Resize all columns to the right */
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray,
g->grid.resizeCol);
colp->grid.width = width;
SizeColumnsToFit(g, g->grid.resizeCol + 1);
HorizLayout(g, 0);
DrawArea(g, DrawAll, 0, 0);
g->grid.resizeLineXY = rect.x + width;
}
}
static int
SizeColumnsToFit(XmLGridWidget g, int starting_at)
{
int resizable_width = 0;
int delta = 0;
float hidden_col_adjust;
int ii, num_columns;
XmLGridColumn colp;
/* Total the width of the columns and
also total how much of that can be resized */
delta = g->core.width;
delta -= g->manager.shadow_thickness * 2;
if (g->grid.hideUnhideButtons)
{
delta -= g->grid.unhideButton->core.width;
delta -= g->grid.hideButton->core.width;
}
else if (XtIsManaged(g->grid.vsb))
{
delta -= g->grid.vsb->core.width;
}
num_columns = g->grid.colCount + g->grid.headingColCount
+ g->grid.footerColCount;
for (ii = 0; ii < num_columns; ii ++)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, ii);
if (colp->grid.sizePolicy != XmCONSTANT)
{
if (g->grid.debugLevel)
XmLWarning((Widget)g, "SizeColumnsToFit() - only valid for XmNcolumnSizePolicy == XmCONSTANT");
colp->grid.sizePolicy = XmCONSTANT;
}
if (!g->grid.visibleCols || ii < g->grid.visibleCols)
{
delta -= colp->grid.width;
if (ii >= starting_at && colp->grid.resizable)
resizable_width += colp->grid.width;
}
}
if (delta == 0 || resizable_width <= 0)
return delta;
if (g->grid.debugLevel)
{
fprintf(stderr,"Applying delta(%d) from %d to %d (%d resizable)\n",
delta, starting_at, num_columns - 1, resizable_width);
}
hidden_col_adjust = (float)delta / resizable_width;
/* Adjust each column to fit based on its percentage of the total width */
for (ii = starting_at; ii < num_columns ; ii ++)
{
int col_width;
int col_delta;
int new_col_width;
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, ii);
col_width = colp->grid.width;
if (!colp->grid.resizable || col_width == 0)
continue;
if (colp->grid.hidden)
col_delta = (int)(hidden_col_adjust * col_width);
else
if (col_width < resizable_width && resizable_width > 0)
col_delta = delta * ((float)col_width / resizable_width);
else
col_delta = delta;
new_col_width = col_width + col_delta;
if (new_col_width < g->grid.minColWidth)
{
new_col_width = g->grid.minColWidth;
col_delta = col_width - new_col_width;
}
if (!colp->grid.hidden)
{
delta -= col_delta;
resizable_width -= col_width;
}
colp->grid.width = new_col_width;
if (g->grid.debugLevel)
fprintf (stderr, "Column %d, width %d -> %d, new delta %d, new resizable width %d\n",
ii, col_width, new_col_width,
delta, resizable_width);
}
return delta;
}
void
XmLGridGetSort(Widget w, int *column, unsigned char *sortType)
{
XmLGridWidget g = (XmLGridWidget)w;
XmLGridColumn colp;
int num_columns = XmLArrayGetCount(g->grid.colArray);
int ii;
*column = 0;
*sortType = XmSORT_NONE;
for (ii = 0; ii < num_columns; ii ++)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, ii);
if (colp && colp->grid.sort != XmSORT_NONE)
{
*column = ii;
*sortType = colp->grid.sort;
break;
}
}
}
void
XmLGridSetSort(Widget w, int column, unsigned char sortType)
{
XmLGridWidget g = (XmLGridWidget)w;
XmLGridRow rowp;
XmLGridColumn colp;
XmLGridCell cellp;
int old_sort_column;
unsigned char old_sort_type;
/*printf("XmLGridSetSort: (%d,%s)\n", column,
sortType == XmSORT_NONE ? "none" :
sortType == XmSORT_ASCENDING ? "ascending" : "descending");
*/
/* Clear old sort resource */
XmLGridGetSort(w, &old_sort_column, &old_sort_type);
if (old_sort_type != XmSORT_NONE)
{
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, old_sort_column);
if (colp)
colp->grid.sort = XmSORT_NONE;
}
colp = (XmLGridColumn)XmLArrayGet(g->grid.colArray, column);
colp->grid.sort = sortType;
/* Clear any existing cell sort masks. */
rowp = (XmLGridRow)XmLArrayGet(g->grid.rowArray, 0);
if (rowp)
{
int ii, count;
count = XmLArrayGetCount(rowp->grid.cellArray);
for (ii = 0; ii < count; ii++)
{
cellp = (XmLGridCell)XmLArrayGet(rowp->grid.cellArray, ii);
if (XmLGridCellDrawSort(cellp))
{
DrawArea(g, DrawCell, 0, ii);
XmLGridCellSetDrawSort(cellp, False);
}
}
}
/* Set the cell mask of the heading cell. */
cellp = GetCell(g, 0, column);
if (cellp)
{
XmLGridCellSetDrawSort(cellp, True);
if (sortType == XmSORT_NONE)
XmLGridCellSetDrawSort(cellp, False);
else if (sortType == XmSORT_ASCENDING)
XmLGridCellSetSortAscending(cellp, True);
else if (sortType == XmSORT_DESCENDING)
XmLGridCellSetSortAscending(cellp, False);
DrawArea(g, DrawCell, 0, column);
}
}
/*----------------------------------------------------------------------*/
static void
GridInvokeCallbacks(Widget w,
XtCallbackList list,
int reason,
XEvent * event)
{
XmLGridWidget g = (XmLGridWidget)w;
/* Make sure widget is alive and callback list is not NULL */
if (!g->core.being_destroyed && list)
{
XmAnyCallbackStruct cbs;
cbs.event = event;
cbs.reason = reason;
/* Invoke the Callback List */
XtCallCallbackList(w,list,&cbs);
}
}
/*----------------------------------------------------------------------*/
static void
GridInvokeCellCrossingCallbacks(Widget w,
XtCallbackList list,
int reason,
XEvent * event,
int row,
int col)
{
XmLGridWidget g = (XmLGridWidget)w;
/* Make sure widget is alive and callback list is not NULL */
if (!g->core.being_destroyed && list)
{
if (row != -1 && col != -1)
{
XmLGridCell cell;
XmLGridCallbackStruct cbs;
cell = GetCell(g, row, col);
if (cell)
{
cbs.reason = XmCR_CELL_FOCUS_OUT;
cbs.columnType = ColPosToType(g, col);
cbs.column = ColPosToTypePos(g, cbs.columnType, col);
cbs.rowType = RowPosToType(g, row);
cbs.row = RowPosToTypePos(g, cbs.rowType, row);
/* XmLGridCellAction(cell, (Widget)g, &cbs); */
/* Invoke the Callback List */
XtCallCallbackList(w,list,&cbs);
}
}
}
}
/*----------------------------------------------------------------------*/
static void
GridCrossingEH(Widget w,
XtPointer closure,
XEvent * event,
Boolean * ctd)
{
XmLGridWidget g = (XmLGridWidget)w;
if (event)
{
if (event->type == EnterNotify)
{
/* Invoke XmNenterGridCallback */
GridInvokeCallbacks(w,
g->grid.enterGridCallback,
XmCR_ENTER_GRID,
event);
/* printf("Enter(%s)\n",XtName(w)); */
}
else if (event->type == LeaveNotify)
{
g->grid.lastCursorMotionRow = -1;
g->grid.lastCursorMotionCol = -1;
/* Invoke XmNleaveGridCallback */
GridInvokeCallbacks(w,
g->grid.leaveGridCallback,
XmCR_LEAVE_GRID,
event);
/* printf("Leave(%s)\n",XtName(w)); */
}
}
*ctd = True;
}
/*----------------------------------------------------------------------*/
nedit-5.6.orig/Microline/XmL/Grid.h0000644000175000017500000001743410245647600015606 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLGridH
#define XmLGridH
#include "XmL.h"
#include
#ifdef XmL_CPP
extern "C" {
#endif
extern WidgetClass xmlGridWidgetClass;
typedef struct _XmLGridClassRec *XmLGridWidgetClass;
typedef struct _XmLGridRec *XmLGridWidget;
typedef struct _XmLGridRowRec *XmLGridRow;
typedef struct _XmLGridColumnRec *XmLGridColumn;
typedef struct _XmLGridCellRec *XmLGridCell;
#define XmLIsGrid(w) XtIsSubclass((w), xmlGridWidgetClass)
Widget XmLCreateGrid(Widget parent, char *name, ArgList arglist,
Cardinal argcount);
void XmLGridAddColumns(Widget w, unsigned char type, int position, int count);
void XmLGridAddRows(Widget w, unsigned char type, int position, int count);
Boolean XmLGridColumnIsVisible(Widget w, int column);
Boolean XmLGridCopyPos(Widget w, Time time, unsigned char rowType, int row,
unsigned char columnType, int column, int nrow, int ncolumn);
Boolean XmLGridCopySelected(Widget w, Time time);
void XmLGridDeleteAllColumns(Widget w, unsigned char type);
void XmLGridDeleteAllRows(Widget w, unsigned char type);
void XmLGridDeleteColumns(Widget w, unsigned char type, int position,
int count);
void XmLGridDeleteRows(Widget w, unsigned char type, int position, int count);
void XmLGridDeselectAllCells(Widget w, Boolean notify);
void XmLGridDeselectAllColumns(Widget w, Boolean notify);
void XmLGridDeselectAllRows(Widget w, Boolean notify);
void XmLGridDeselectCell(Widget w, int row, int column, Boolean notify);
void XmLGridDeselectColumn(Widget w, int column, Boolean notify);
void XmLGridDeselectRow(Widget w, int row, Boolean notify);
int XmLGridEditBegin(Widget w, Boolean insert, int row, int column);
void XmLGridEditCancel(Widget w);
void XmLGridEditComplete(Widget w);
XmLGridColumn XmLGridGetColumn(Widget w, unsigned char columnType, int column);
void XmLGridGetFocus(Widget w, int *row, int *column, Boolean *focusIn);
XmLGridRow XmLGridGetRow(Widget w, unsigned char rowType, int row);
int XmLGridGetSelectedCellCount(Widget w);
int XmLGridGetSelectedCells(Widget w, int *rowPositions,
int *columnPositions, int count);
int XmLGridGetSelectedColumnCount(Widget w);
int XmLGridGetSelectedColumns(Widget w, int *positions, int count);
int XmLGridGetSelectedRow(Widget w);
int XmLGridGetSelectedRowCount(Widget w);
int XmLGridGetSelectedRows(Widget w, int *positions, int count);
void XmLGridMoveColumns(Widget w, int newPosition, int position, int count);
void XmLGridMoveRows(Widget w, int newPosition, int position, int count);
Boolean XmLGridPaste(Widget w);
Boolean XmLGridPastePos(Widget w, unsigned char rowType, int row,
unsigned char columnType, int column);
int XmLGridRead(Widget w, FILE *file, int format, char delimiter);
int XmLGridReadPos(Widget w, FILE *file, int format, char delimiter,
unsigned char rowType, int row, unsigned char columnType, int column);
void XmLGridRedrawAll(Widget w);
void XmLGridRedrawCell(Widget w, unsigned char rowType, int row,
unsigned char columnType, int column);
void XmLGridRedrawColumn(Widget w, unsigned char type, int column);
void XmLGridRedrawRow(Widget w, unsigned char type, int row);
void XmLGridReorderColumns(Widget w, int *newPositions,
int position, int count);
void XmLGridReorderRows(Widget w, int *newPositions,
int position, int count);
int XmLGridRowColumnToXY(Widget w, unsigned char rowType, int row,
unsigned char columnType, int column, Boolean clipped, XRectangle *rect);
Boolean XmLGridRowIsVisible(Widget w, int row);
void XmLGridSelectAllCells(Widget w, Boolean notify);
void XmLGridSelectAllColumns(Widget w, Boolean notify);
void XmLGridSelectAllRows(Widget w, Boolean notify);
void XmLGridSelectCell(Widget w, int row, int column, Boolean notify);
void XmLGridSelectColumn(Widget w, int column, Boolean notify);
void XmLGridSelectRow(Widget w, int row, Boolean notify);
int XmLGridSetFocus(Widget w, int row, int column);
int XmLGridSetStrings(Widget w, char *data);
int XmLGridSetStringsPos(Widget w, unsigned char rowType, int row,
unsigned char columnType, int column, char *data);
int XmLGridWrite(Widget w, FILE *file, int format, char delimiter,
Boolean skipHidden);
int XmLGridWritePos(Widget w, FILE *file, int format, char delimiter,
Boolean skipHidden, unsigned char rowType, int row,
unsigned char columnType, int column, int nrow, int ncolumn);
int XmLGridXYToRowColumn(Widget w, int x, int y, unsigned char *rowType,
int *row, unsigned char *columnType, int *column);
int XmLGridPosIsResize(Widget g, int x, int y);
void XmLGridSetVisibleColumnCount(Widget w, int num_visible);
void XmLGridHideRightColumn(Widget w);
void XmLGridUnhideRightColumn(Widget w);
int XmLGridGetRowCount(Widget w);
int XmLGridGetColumnCount(Widget w);
/* extern */ void
XmLGridXYToCellTracking(Widget widget,
int x, /* input only args. */
int y, /* input only args. */
Boolean * m_inGrid, /* input/output args. */
int * m_lastRow, /* input/output args. */
int * m_lastCol, /* input/output args. */
unsigned char * m_lastRowtype,/* input/output args. */
unsigned char * m_lastColtype,/* input/output args. */
int * outRow, /* output only args. */
int * outCol, /* output only args. */
Boolean * enter, /* output only args. */
Boolean * leave); /* output only args. */
void XmLGridGetSort(Widget w, int *column, unsigned char *sortType);
void XmLGridSetSort(Widget w, int column, unsigned char sortType);
#ifdef XmL_CPP
}
#endif
#endif
nedit-5.6.orig/Microline/XmL/GridP.h0000644000175000017500000003562610077552126015732 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLGridPH
#define XmLGridPH
#include
#include
#ifndef MOTIF11
#include
#include
#include
#include
#endif
#include "Grid.h"
#ifdef XmL_ANSIC
void _XmLGridLayout(XmLGridWidget g);
void _XmLGridCellDrawBackground(XmLGridCell cell, Widget w,
XRectangle *clipRect, XmLGridDrawStruct *ds);
void _XmLGridCellDrawBorders(XmLGridCell cell, Widget w,
XRectangle *clipRect, XmLGridDrawStruct *ds);
void _XmLGridCellDrawValue(XmLGridCell cell, Widget w,
XRectangle *clipRect, XmLGridDrawStruct *ds);
typedef int (*XmLGridPreLayoutProc)(XmLGridWidget g, int isVert);
typedef XmLGridRow (*XmLGridRowNewProc)(Widget grid);
typedef void (*XmLGridRowFreeProc)(XmLGridRow);
typedef void (*XmLGridGetRowValueMaskProc)(XmLGridWidget g,
char *s, long *mask);
typedef void (*XmLGridGetRowValueProc)(XmLGridWidget g, XmLGridRow row,
XtArgVal value, long mask);
typedef int (*XmLGridSetRowValuesProc)(XmLGridWidget g,
XmLGridRow row, long mask);
typedef XmLGridColumn (*XmLGridColumnNewProc)(Widget grid);
typedef void (*XmLGridColumnFreeProc)(XmLGridColumn);
typedef void (*XmLGridGetColumnValueMaskProc)(XmLGridWidget g,
char *s, long *mask);
typedef void (*XmLGridGetColumnValueProc)(XmLGridWidget g, XmLGridColumn col,
XtArgVal value, long mask);
typedef int (*XmLGridSetColumnValuesProc)(XmLGridWidget g,
XmLGridColumn col, long mask);
typedef int (*XmLGridSetCellValuesResizeProc)(XmLGridWidget g,
XmLGridRow row, XmLGridColumn col, XmLGridCell cell, long mask);
typedef int (*XmLGridCellActionProc)(XmLGridCell, Widget,
XmLGridCallbackStruct *);
#else
void _XmLGridLayout();
void _XmLGridCellDrawBackground();
void _XmLGridCellDrawBorders();
void _XmLGridCellDrawValue();
typedef int (*XmLGridPreLayoutProc)();
typedef XmLGridRow (*XmLGridRowNewProc)();
typedef void (*XmLGridRowFreeProc)() ;
typedef void (*XmLGridGetRowValueMaskProc)();
typedef void (*XmLGridGetRowValueProc)();
typedef int (*XmLGridSetRowValuesProc)();
typedef XmLGridColumn (*XmLGridColumnNewProc)() ;
typedef void (*XmLGridColumnFreeProc)() ;
typedef void (*XmLGridGetColumnValueMaskProc)();
typedef void (*XmLGridGetColumnValueProc)();
typedef int (*XmLGridSetColumnValuesProc)();
typedef int (*XmLGridSetCellValuesResizeProc)();
typedef int (*XmLGridCellActionProc)();
#endif
#define XmLGridClassPartOfWidget(w) \
((XmLGridWidgetClass)XtClass(w))->grid_class
#define XmInheritGridPreLayout ((XmLGridPreLayoutProc)_XtInherit)
#define XmInheritGridRowNew ((XmLGridRowNewProc)_XtInherit)
#define XmInheritGridRowFree ((XmLGridRowFreeProc)_XtInherit)
#define XmInheritGridGetRowValueMask ((XmLGridGetRowValueMaskProc)_XtInherit)
#define XmInheritGridGetRowValue ((XmLGridGetRowValueProc)_XtInherit)
#define XmInheritGridSetRowValues ((XmLGridSetRowValuesProc)_XtInherit)
#define XmInheritGridColumnNew ((XmLGridColumnNewProc)_XtInherit)
#define XmInheritGridColumnFree ((XmLGridColumnFreeProc)_XtInherit)
#define XmInheritGridGetColumnValueMask \
((XmLGridGetColumnValueMaskProc)_XtInherit)
#define XmInheritGridGetColumnValue ((XmLGridGetColumnValueProc)_XtInherit)
#define XmInheritGridSetColumnValues ((XmLGridSetColumnValuesProc)_XtInherit)
#define XmInheritGridSetCellValuesResize \
((XmLGridSetCellValuesResizeProc)_XtInherit)
#define XmInheritGridCellAction ((XmLGridCellActionProc)_XtInherit)
/* row value mask for get/set values */
#define XmLGridRowHeight (1L<<0)
#define XmLGridRowSizePolicy (1L<<1)
#define XmLGridRowUserData (1L<<2)
#define XmLGridRowValueMaskLen 3
/* column value mask for get/set values */
#define XmLGridColumnWidth (1L<<0)
#define XmLGridColumnSizePolicy (1L<<1)
#define XmLGridColumnUserData (1L<<2)
#define XmLGridColumnResizable (1L<<3)
#define XmLGridColumnHidden (1L<<4)
#define XmLGridColumnSortType (1L<<5)
#define XmLGridColumnValueMaskLen 6
/* flags for XmLGridCell flags member */
#define XmLGridCellSelectedFlag (1 << 0)
#define XmLGridCellValueSetFlag (1 << 1)
#define XmLGridCellInRowSpanFlag (1 << 2)
#define XmLGridCellInColumnSpanFlag (1 << 3)
#define XmLGridCellDrawSortFlag (1 << 4)
#define XmLGridCellSortAscendingFlag (1 << 5)
/* cell value mask for get/set values */
#define XmLGridCellAlignment (1L<<0)
#define XmLGridCellBackground (1L<<1)
#define XmLGridCellBottomBorderColor (1L<<2)
#define XmLGridCellBottomBorderType (1L<<3)
#define XmLGridCellColumnSpan (1L<<4)
#define XmLGridCellEditable (1L<<5)
#define XmLGridCellFontList (1L<<6)
#define XmLGridCellForeground (1L<<7)
#define XmLGridCellLeftBorderColor (1L<<8)
#define XmLGridCellLeftBorderType (1L<<9)
#define XmLGridCellMarginBottom (1L<<10)
#define XmLGridCellMarginLeft (1L<<11)
#define XmLGridCellMarginRight (1L<<12)
#define XmLGridCellMarginTop (1L<<13)
#define XmLGridCellPixmapF (1L<<14)
#define XmLGridCellPixmapMask (1L<<15)
#define XmLGridCellRightBorderColor (1L<<16)
#define XmLGridCellRightBorderType (1L<<17)
#define XmLGridCellRowSpan (1L<<18)
#define XmLGridCellString (1L<<19)
#define XmLGridCellToggleSet (1L<<20)
#define XmLGridCellTopBorderColor (1L<<21)
#define XmLGridCellTopBorderType (1L<<22)
#define XmLGridCellType (1L<<23)
#define XmLGridCellUserData (1L<<24)
/* This is now a resource */
/* #define XmLICON_SPACING 4 */
enum { DrawAll, DrawHScroll, DrawVScroll, DrawRow, DrawCol, DrawCell };
enum { SelectRow, SelectCol, SelectCell };
enum { CursorNormal, CursorHResize, CursorVResize };
enum { InNormal, InSelect, InResize, InMove };
enum { DragLeft = 1, DragRight = 2, DragUp = 4, DragDown = 8 };
typedef struct
{
int x, y, width, height;
int row, col, nrow, ncol;
} GridReg;
typedef struct
{
int row, col;
} GridDropLoc;
typedef struct
{
unsigned char alignment;
Pixel background;
Pixel bottomBorderColor;
char bottomBorderType;
Dimension bottomMargin;
int columnSpan;
Boolean editable;
short fontHeight;
XmFontList fontList;
short fontWidth;
Pixel foreground;
Pixel leftBorderColor;
char leftBorderType;
Dimension leftMargin;
int refCount;
Pixel rightBorderColor;
char rightBorderType;
Dimension rightMargin;
int rowSpan;
Pixel topBorderColor;
char topBorderType;
Dimension topMargin;
unsigned char type;
void *userData;
} XmLGridCellRefValues;
typedef struct
{
Pixmap pixmap, pixmask;
Dimension width, height;
} XmLGridCellPixmap;
typedef struct
{
XmString string;
XmLGridCellPixmap pix;
} XmLGridCellIcon;
typedef struct _XmLGridCellPart
{
XmLGridCellRefValues *refValues;
unsigned char flags;
void *value;
} XmLGridCellPart;
struct _XmLGridCellRec
{
XmLGridCellPart cell;
};
typedef struct _XmLGridRowPart
{
int pos; /* required first for Array autonumber */
Dimension height;
unsigned char sizePolicy;
Boolean selected;
XtPointer userData;
Dimension heightInPixels;
unsigned int heightInPixelsValid:1;
Widget grid;
int visPos;
XmLArray cellArray;
} XmLGridRowPart;
struct _XmLGridRowRec
{
XmLGridRowPart grid;
};
typedef struct _XmLGridColumnPart
{
int pos; /* required first for Array autonumber */
Dimension width;
unsigned char sizePolicy;
Boolean selected;
XtPointer userData;
XmLGridCellRefValues *defCellValues;
Widget grid;
Dimension widthInPixels;
unsigned int widthInPixelsValid:1;
Boolean resizable;
int visPos;
/* xfe additions */
Boolean hidden;
unsigned char sort;
} XmLGridColumnPart;
struct _XmLGridColumnRec
{
XmLGridColumnPart grid;
};
typedef struct _XmLGridPart
{
/* resource values */
int leftFixedCount, rightFixedCount;
int headingRowCount, footerRowCount;
int topFixedCount, bottomFixedCount;
int headingColCount, footerColCount;
Dimension leftFixedMargin, rightFixedMargin;
Dimension topFixedMargin, bottomFixedMargin;
Dimension scrollBarMargin;
Dimension highlightThickness;
Dimension toggleSize;
Dimension globalPixmapWidth, globalPixmapHeight;
unsigned char selectionPolicy;
Boolean layoutFrozen, immediateDraw;
int debugLevel;
unsigned char vsPolicy, hsPolicy;
unsigned char hsbDisplayPolicy, vsbDisplayPolicy;
int rowCount, colCount;
int hiddenRowCount, hiddenColCount;
int shadowRegions;
unsigned char shadowType;
Widget hsb, vsb, text;
XmFontList fontList;
Pixel blankBg, selectBg, selectFg;
Pixel defaultCellBg, defaultCellFg;
Pixel toggleTopColor, toggleBotColor;
int visibleCols, visibleRows;
char *simpleHeadings, *simpleWidths;
XtTranslations editTrans, traverseTrans;
Boolean allowRowHide, allowColHide;
Boolean allowRowResize, allowColResize;
Boolean allowDrag, allowDrop;
Boolean autoSelect;
Boolean highlightRowMode;
Boolean useAvgWidth;
int scrollRow, scrollCol, cScrollRow, cScrollCol;
XtCallbackList addCallback, deleteCallback;
XtCallbackList cellDrawCallback, cellFocusCallback;
XtCallbackList cellDropCallback, cellPasteCallback;
XtCallbackList activateCallback, editCallback;
XtCallbackList selectCallback, deselectCallback;
XtCallbackList resizeCallback, scrollCallback;
XtCallbackList enterCellCallback;
XtCallbackList leaveCellCallback;
XtCallbackList enterGridCallback;
XtCallbackList leaveGridCallback;
/* XFE Additions */
XtCallbackList popupCallback;
Boolean hideUnhideButtons;
Boolean singleClickActivation;
Widget hideButton;
Widget unhideButton;
XtTranslations hideButtonTrans;
XtTranslations unhideButtonTrans;
Boolean inResize;
Boolean useTextWidget;
Dimension iconSpacing;
Dimension minColWidth;
int lastCursorMotionRow;
int lastCursorMotionCol;
unsigned char colSortType;
/* private data */
GC gc;
Cursor hResizeCursor, vResizeCursor;
XFontStruct *fallbackFont;
char ignoreModifyVerify;
char focusIn, inEdit, inMode;
char singleColScrollMode;
int singleColScrollPos;
char cursorDefined, textHidden, resizeIsVert;
char mayHaveRowSpans;
int layoutStack;
char needsHorizLayout, needsVertLayout;
char recalcHorizVisPos, recalcVertVisPos;
char vertVisChangedHint;
char dragTimerSet;
XtIntervalId dragTimerId;
int resizeRow, resizeCol, resizeLineXY;
int extendRow, extendCol, extendToRow, extendToCol;
Boolean extendSelect;
int lastSelectRow, lastSelectCol;
Time lastSelectTime;
int focusRow, focusCol;
XmLArray rowArray;
XmLArray colArray;
GridReg reg[9];
GridDropLoc dropLoc;
/* resources use by SetSubValues and GetSubValues */
Boolean cellDefaults;
int cellRow, cellCol;
int cellColRangeStart, cellColRangeEnd;
int cellRowRangeStart, cellRowRangeEnd;
int rowStep, colStep;
unsigned char rowType, colType;
Boolean colHidden;
/* cell resources */
XmString cellString;
Boolean cellToggleSet;
Pixmap cellPixmap, cellPixmapMask;
Dimension cellPixmapWidth, cellPixmapHeight;
XmLGridCellRefValues cellValues, *defCellValues;
/* row resources */
Dimension rowHeight;
unsigned char rowSizePolicy;
Boolean rowSelected;
XtPointer rowUserData;
/* column resources */
Dimension colWidth;
unsigned char colSizePolicy;
Boolean colSelected;
XtPointer colUserData;
Boolean colResizable;
/* xfe additions */
/* Edit timer is used for inplace editing */
char editTimerSet;
XtIntervalId editTimerId;
} XmLGridPart;
typedef struct _XmLGridRec
{
CorePart core;
CompositePart composite;
ConstraintPart constraint;
XmManagerPart manager;
XmLGridPart grid;
} XmLGridRec;
typedef struct _XmLGridClassPart
{
int initialRows;
int initialCols;
XmLGridPreLayoutProc preLayoutProc;
int rowRecSize;
XmLGridRowNewProc rowNewProc;
XmLGridRowFreeProc rowFreeProc;
XmLGridGetRowValueMaskProc getRowValueMaskProc;
XmLGridGetRowValueProc getRowValueProc;
XmLGridSetRowValuesProc setRowValuesProc;
int columnRecSize;
XmLGridColumnNewProc columnNewProc;
XmLGridColumnFreeProc columnFreeProc;
XmLGridGetColumnValueMaskProc getColumnValueMaskProc;
XmLGridGetColumnValueProc getColumnValueProc;
XmLGridSetColumnValuesProc setColumnValuesProc;
XmLGridSetCellValuesResizeProc setCellValuesResizeProc;
XmLGridCellActionProc cellActionProc;
} XmLGridClassPart;
typedef struct _XmLGridClassRec
{
CoreClassPart core_class;
CompositeClassPart composite_class;
ConstraintClassPart constraint_class;
XmManagerClassPart manager_class;
XmLGridClassPart grid_class;
} XmLGridClassRec;
extern XmLGridClassRec xmlGridClassRec;
typedef struct _XmLGridConstraintPart
{
int unused;
} XmLGridConstraintPart;
typedef struct _XmLGridConstraintRec
{
XmManagerConstraintPart manager;
XmLGridConstraintPart grid;
} XmLGridConstraintRec, *XmLGridConstraintPtr;
#endif
nedit-5.6.orig/Microline/XmL/GridUtil.c0000644000175000017500000001310410077552126016426 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
/*----------------------------------------------------------------------*/
/* */
/* Name: */
/* */
/* Description: XmLGrid misc utilities. They are here in order not to */
/* continue bloating Grid.c beyond hope. */
/* */
/* Author: Ramiro Estrugo */
/* */
/* Created: Thu May 28 21:55:45 PDT 1998 */
/* */
/*----------------------------------------------------------------------*/
#include "GridP.h"
#include
/*----------------------------------------------------------------------*/
/* extern */ int
XmLGridGetRowCount(Widget w)
{
XmLGridWidget g = (XmLGridWidget) w;
assert( g != NULL );
#ifdef DEBUG_ramiro
{
int rows = 0;
XtVaGetValues(w,XmNrows,&rows,NULL);
assert( rows == g->grid.rowCount );
}
#endif
return g->grid.rowCount;
}
/*----------------------------------------------------------------------*/
/* extern */ int
XmLGridGetColumnCount(Widget w)
{
XmLGridWidget g = (XmLGridWidget) w;
assert( g != NULL );
#ifdef DEBUG_ramiro
{
int columns = 0;
XtVaGetValues(w,XmNcolumns,&columns,NULL);
assert( columns == g->grid.colCount );
}
#endif
return g->grid.colCount;
}
/*----------------------------------------------------------------------*/
/* extern */ void
XmLGridXYToCellTracking(Widget widget,
int x, /* input only args. */
int y, /* input only args. */
Boolean * m_inGrid, /* input/output args. */
int * m_lastRow, /* input/output args. */
int * m_lastCol, /* input/output args. */
unsigned char * m_lastRowtype, /* input/output args. */
unsigned char * m_lastColtype,/* input/output args. */
int * outRow, /* output only args. */
int * outCol, /* output only args. */
Boolean * enter, /* output only args. */
Boolean * leave) /* output only args. */
{
int m_totalLines = 0;
int m_numcolumns = 0;
int row = 0;
int column = 0;
unsigned char rowtype = XmCONTENT;
unsigned char coltype = XmCONTENT;
if (0 > XmLGridXYToRowColumn(widget,
x,
y,
&rowtype,
&row,
&coltype,
&column))
{
/* In grid; but, not in any cells
*/
/* treat it as a leave
*/
*enter = FALSE;
*leave = TRUE;
return;
}/* if */
m_totalLines = XmLGridGetRowCount(widget);
m_numcolumns = XmLGridGetColumnCount(widget);
if ((row < m_totalLines) &&
(column < m_numcolumns) &&
((*m_lastRow != row)||
(*m_lastCol != column) ||
(*m_lastRowtype != rowtype)||
(*m_lastColtype != coltype)))
{
*outRow = (rowtype == XmHEADING)?-1:row;
*outCol = column;
if (*m_inGrid == False)
{
*m_inGrid = True;
/* enter a cell
*/
*enter = TRUE;
*leave = FALSE;
}/* if */
else
{
/* Cruising among cells
*/
*enter = TRUE;
*leave = TRUE;
}/* else */
*m_lastRow = row;
*m_lastCol = column;
*m_lastRowtype = rowtype ;
*m_lastColtype = coltype ;
}/* row /col in grid */
}
/*----------------------------------------------------------------------*/
nedit-5.6.orig/Microline/XmL/Makefile0000644000175000017500000000663210077552126016207 0ustar paulpaul#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# In addition, as a special exception to the GNU GPL, the copyright holders
# give permission to link the code of this program with the Motif and Open
# Motif libraries (or with modified versions of these that use the same
# license), and distribute linked combinations including the two. You
# must obey the GNU General Public License in all respects for all of
# the code used other than linking with Motif/Open Motif. If you modify
# this file, you may extend this exception to your version of the file,
# but you are not obligated to do so. If you do not wish to do so,
# delete this exception statement from your version.
#
# ***** END LICENSE BLOCK *****
##########################################################################
#
# Name: Makefile
# Description: Makefile for Microline Widget library
# Author: Ramiro Estrugo
#
##########################################################################
DEPTH = ../../../..
# XmL headers are exported to dist/include/XmL
MODULE = Microline/XmL
INCL_SUBDIR = /XmL
LIBRARY_NAME = XmL
# There are unused widgets. They are currently not needed to build Mozilla,
# but that might change in the future.
ifdef XFE_WIDGETS_BUILD_UNUSED
XFE_EXTRA_DEFINES += -DXFE_WIDGETS_BUILD_UNUSED
UNUSED_CSRCS = \
Progress.c \
$(NULL)
UNUSED_EXPORTS = \
Progress.h \
ProgressP.h \
$(NULL)
endif
CSRCS = \
$(UNUSED_CSRCS) \
Folder.c \
Grid.c \
GridUtil.c \
Tree.c \
XmL.c \
$(NULL)
REQUIRES = Microline
EXPORTS = \
$(UNUSED_EXPORTS) \
Folder.h \
FolderP.h \
Grid.h \
GridP.h \
Tree.h \
TreeP.h \
XmL.h \
$(NULL)
include $(DEPTH)/config/rules.mk
DEFINES += $(XFE_EXTRA_DEFINES)
nedit-5.6.orig/Microline/XmL/Makefile.common0000644000175000017500000000064707772504713017505 0ustar paulpaul# $Id: Makefile.common,v 1.1 2003/12/25 06:55:07 tksoh Exp $
#
# Platform independent part of make procedure for Nirvana utilities directory,
# included by machine specific makefiles.
#
.c.o:
$(CC) -c -I.. $(CFLAGS) -o $@ $<
OBJS = Folder.o XmL.o
all: libXmL.a
libXmL.a: $(OBJS)
$(AR) $(ARFLAGS) libXmL.a $(OBJS)
clean:
rm -f $(OBJS) libXmL.a
# Get the dependencies for all objects
include Makefile.dependencies
nedit-5.6.orig/Microline/XmL/Makefile.dependencies0000644000175000017500000000007707772504713020640 0ustar paulpaulXmL.o: XmL.c XmL.h
Folder.o: Folder.c Folder.h FolderP.h XmL.h
nedit-5.6.orig/Microline/XmL/Makefile.in0000644000175000017500000000711510077552126016611 0ustar paulpaul#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# In addition, as a special exception to the GNU GPL, the copyright holders
# give permission to link the code of this program with the Motif and Open
# Motif libraries (or with modified versions of these that use the same
# license), and distribute linked combinations including the two. You
# must obey the GNU General Public License in all respects for all of
# the code used other than linking with Motif/Open Motif. If you modify
# this file, you may extend this exception to your version of the file,
# but you are not obligated to do so. If you do not wish to do so,
# delete this exception statement from your version.
#
# ***** END LICENSE BLOCK *****
##########################################################################
#
# Name: Makefile
# Description: Makefile for Microline Widget library
# Author: Ramiro Estrugo
#
##########################################################################
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
# XmL headers are exported to dist/include/XmL
MODULE = Microline/XmL
INCL_SUBDIR = /XmL
LIBRARY_NAME = XmL
# There are unused widgets. They are currently not needed to build Mozilla,
# but that might change in the future.
ifdef XFE_WIDGETS_BUILD_UNUSED
XFE_EXTRA_DEFINES += -DXFE_WIDGETS_BUILD_UNUSED
UNUSED_CSRCS = \
Progress.c \
$(NULL)
UNUSED_EXPORTS = \
Progress.h \
ProgressP.h \
$(NULL)
endif
CSRCS = \
$(UNUSED_CSRCS) \
Folder.c \
Grid.c \
GridUtil.c \
Tree.c \
XmL.c \
$(NULL)
REQUIRES = Microline
EXPORTS = \
$(UNUSED_EXPORTS) \
Folder.h \
FolderP.h \
Grid.h \
GridP.h \
Tree.h \
TreeP.h \
XmL.h \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
include $(topsrcdir)/config/rules.mk
CFLAGS += $(FE_X_CFLAGS)
DEFINES += $(XFE_EXTRA_DEFINES)
nedit-5.6.orig/Microline/XmL/Progress.c0000644000175000017500000004315410704702042016506 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#include "ProgressP.h"
#include
#include
#include
static void ClassInitialize(void);
static void Initialize(Widget , Widget, ArgList, Cardinal *);
static void Resize(Widget);
static void Destroy(Widget);
static void Realize(Widget w, XtValueMask *valueMask,
XSetWindowAttributes *attr);
static void Redisplay(Widget, XEvent *, Region);
static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *);
static void CopyFontList(XmLProgressWidget p);
static void TimeStr(char *, int);
static void DrawBarMeter(XmLProgressWidget p, XRectangle *rect);
static void DrawBoxesMeter(XmLProgressWidget p, XRectangle *rect);
static void DrawString(XmLProgressWidget, XmString, int, int,
int, XRectangle *, XRectangle *);
static Boolean CvtStringToMeterStyle(Display *dpy, XrmValuePtr args,
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
XtPointer *data);
static XtResource resources[] =
{
{
XmNcompleteValue, XmCCompleteValue,
XtRInt, sizeof(int),
XtOffset(XmLProgressWidget, progress.completeValue),
XtRImmediate, (caddr_t)100
},
{
XmNnumBoxes, XmCNumBoxes,
XtRInt, sizeof(int),
XtOffset(XmLProgressWidget, progress.numBoxes),
XtRImmediate, (caddr_t)10
},
{
XmNvalue, XmCValue,
XtRInt, sizeof(int),
XtOffset(XmLProgressWidget, progress.value),
XtRImmediate, (caddr_t)0
},
{
XmNfontList, XmCFontList,
XmRFontList, sizeof(XmFontList),
XtOffset(XmLProgressWidget, progress.fontList),
XmRImmediate, (XtPointer)0,
},
{
XmNmeterStyle, XmCMeterStyle,
XmRMeterStyle, sizeof(unsigned char),
XtOffset(XmLProgressWidget, progress.meterStyle),
XmRImmediate, (XtPointer)XmMETER_BAR,
},
{
XmNshowTime, XmCShowTime,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLProgressWidget, progress.showTime),
XmRImmediate, (XtPointer)False
},
{
XmNshowPercentage, XmCShowPercentage,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLProgressWidget, progress.showPercentage),
XmRImmediate, (XtPointer)True
}
};
XmLProgressClassRec xmlProgressClassRec =
{
{ /* Core */
(WidgetClass)&xmPrimitiveClassRec, /* superclass */
"XmLProgress", /* class_name */
sizeof(XmLProgressRec), /* widget_size */
ClassInitialize, /* class_initialize */
NULL, /* class_part_initialize */
FALSE, /* class_inited */
(XtInitProc)Initialize, /* initialize */
NULL, /* initialize_hook */
(XtRealizeProc)Realize, /* realize */
NULL, /* actions */
0, /* num_actions */
resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
TRUE, /* compress_motion */
FALSE, /* compress_exposure */
TRUE, /* compress_enterleave */
TRUE, /* visible_interest */
(XtWidgetProc)Destroy, /* destroy */
(XtWidgetProc)Resize, /* resize */
(XtExposeProc)Redisplay, /* expose */
(XtSetValuesFunc)SetValues, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accept_focus */
XtVersion, /* version */
NULL, /* callback_private */
XtInheritTranslations, /* tm_table */
NULL, /* query_geometry */
NULL, /* display_accelerator */
NULL, /* extension */
},
{ /* Primitive */
(XtWidgetProc)_XtInherit, /* border_highlight */
(XtWidgetProc)_XtInherit, /* border_unhighlight */
XtInheritTranslations, /* translations */
NULL, /* arm_and_activate */
NULL, /* syn_resources */
0, /* num_syn_resources */
NULL, /* extension */
},
{ /* Progress */
0, /* unused */
}
};
WidgetClass xmlProgressWidgetClass = (WidgetClass)&xmlProgressClassRec;
static void
ClassInitialize(void)
{
XmLInitialize();
XtSetTypeConverter(XmRString, XmRMeterStyle, CvtStringToMeterStyle,
0, 0, XtCacheNone, 0);
}
static void
Initialize(Widget reqW,
Widget newW,
ArgList args,
Cardinal *narg)
{
XmLProgressWidget p;
p = (XmLProgressWidget)newW;
if (!p->core.width)
p->core.width = 200;
if (!p->core.height)
p->core.height = 30;
p->progress.gc = 0;
p->progress.startTime = time(0);
CopyFontList(p);
if (p->progress.completeValue < 1)
{
XmLWarning(newW, "Initialize() - complete value can't be < 1");
p->progress.completeValue = 1;
}
if (p->progress.numBoxes < 1)
{
XmLWarning(newW, "Initialize() - number of boxes can't be < 1");
p->progress.numBoxes = 1;
}
if (p->progress.value < 0)
{
XmLWarning(newW, "Initialize() - value can't be < 0");
p->progress.value = 0;
}
if (p->progress.value > p->progress.completeValue)
{
XmLWarning(newW, "Initialize() - value can't be > completeValue");
p->progress.value = p->progress.completeValue;
}
XtVaSetValues(newW, XmNtraversalOn, False, NULL);
}
static void
Resize(Widget w)
{
Display *dpy;
Window win;
if (!XtIsRealized(w))
return;
dpy = XtDisplay(w);
win = XtWindow(w);
XClearArea(dpy, win, 0, 0, 0, 0, True);
}
static void
Destroy(Widget w)
{
Display *dpy;
XmLProgressWidget p;
p = (XmLProgressWidget)w;
dpy = XtDisplay(w);
if (p->progress.gc)
{
XFreeGC(dpy, p->progress.gc);
XFreeFont(dpy, p->progress.fallbackFont);
}
XmFontListFree(p->progress.fontList);
}
static void
Realize(Widget w,
XtValueMask *valueMask,
XSetWindowAttributes *attr)
{
XmLProgressWidget p;
Display *dpy;
WidgetClass superClass;
XtRealizeProc realize;
XGCValues values;
/* XtGCMask mask;*/
p = (XmLProgressWidget)w;
dpy = XtDisplay(p);
superClass = xmlProgressWidgetClass->core_class.superclass;
realize = superClass->core_class.realize;
(*realize)(w, valueMask, attr);
if (!p->progress.gc)
{
p->progress.fallbackFont = XLoadQueryFont(dpy, "fixed");
values.font = p->progress.fallbackFont->fid;
p->progress.gc = XCreateGC(dpy, XtWindow(p), GCFont, &values);
}
}
static void
Redisplay(Widget w,
XEvent *event,
Region region)
{
XmLProgressWidget p;
Display *dpy;
Window win;
XRectangle rect;
int st;
if (!XtIsRealized(w) || !w->core.visible)
return;
p = (XmLProgressWidget)w;
dpy = XtDisplay(w);
win = XtWindow(w);
st = p->primitive.shadow_thickness;
rect.x = st;
rect.y = st;
rect.width = p->core.width - st * 2;
rect.height = p->core.height - st * 2;
if (p->progress.meterStyle == XmMETER_BAR)
DrawBarMeter(p, &rect);
else if (p->progress.meterStyle == XmMETER_BOXES)
DrawBoxesMeter(p, &rect);
#ifdef MOTIF11
_XmDrawShadow(dpy, win,
p->primitive.bottom_shadow_GC,
p->primitive.top_shadow_GC,
p->primitive.shadow_thickness,
0, 0, p->core.width, p->core.height);
#else
_XmDrawShadows(dpy, win,
p->primitive.top_shadow_GC,
p->primitive.bottom_shadow_GC,
0, 0, p->core.width, p->core.height,
p->primitive.shadow_thickness,
XmSHADOW_IN);
#endif
}
static void
DrawBoxesMeter(XmLProgressWidget p,
XRectangle *rect)
{
Display *dpy;
Window win;
int i, j, st, nb, x1, x2;
dpy = XtDisplay(p);
win = XtWindow(p);
st = p->primitive.shadow_thickness;
nb = p->progress.numBoxes;
if (nb * st * 2 > (int)rect->width)
return;
if (p->progress.completeValue)
j = (int)((long)nb * (long)p->progress.value /
(long)p->progress.completeValue);
else
j = 0;
x2 = 0;
for (i = 0; i < nb; i++)
{
if (i < j)
XSetForeground(dpy, p->progress.gc, p->primitive.foreground);
else
XSetForeground(dpy, p->progress.gc, p->core.background_pixel);
x1 = x2;
if (i == nb - 1)
x2 = rect->width;
else
x2 = ((int)rect->width * (i + 1)) / nb;
XFillRectangle(dpy, win, p->progress.gc,
rect->x + x1 + st, rect->y + st,
x2 - x1 - st * 2, rect->height - st * 2);
#ifdef MOTIF11
_XmDrawShadow(dpy, win,
p->primitive.bottom_shadow_GC,
p->primitive.top_shadow_GC,
p->primitive.shadow_thickness,
rect->x + x1, rect->y,
x2 - x1, rect->height);
#else
_XmDrawShadows(dpy, win,
p->primitive.top_shadow_GC,
p->primitive.bottom_shadow_GC,
rect->x + x1, rect->y,
x2 - x1, rect->height,
p->primitive.shadow_thickness,
XmSHADOW_IN);
#endif
}
}
static void
DrawBarMeter(XmLProgressWidget p,
XRectangle *rect)
{
Display *dpy;
Window win;
int timeLeft, timeSoFar;
time_t currentTime;
XmString str;
Dimension strWidth, strHeight;
XRectangle lRect, rRect;
int percent;
char c[10];
long l;
dpy = XtDisplay(p);
win = XtWindow(p);
/* Left Rect */
if (p->progress.completeValue)
l = (long)rect->width * (long)p->progress.value /
(long)p->progress.completeValue;
else
l = 0;
lRect.x = rect->x;
lRect.y = rect->y;
lRect.width = (Dimension)l;
lRect.height = rect->height;
XSetForeground(dpy, p->progress.gc, p->primitive.foreground);
XFillRectangle(dpy, win, p->progress.gc, lRect.x, lRect.y,
lRect.width, lRect.height);
/* Right Rect */
rRect.x = rect->x + (int)l;
rRect.y = rect->y;
rRect.width = rect->width - (Dimension)l;
rRect.height = rect->height;
XSetForeground(dpy, p->progress.gc, p->core.background_pixel);
XFillRectangle(dpy, win, p->progress.gc, rRect.x, rRect.y,
rRect.width, rRect.height);
if (p->progress.completeValue)
percent = (int)(((long)p->progress.value * 100) /
(long)p->progress.completeValue);
else
percent = 0;
/* percent complete */
sprintf(c, "%d%c", percent, '%');
str = XmStringCreateSimple(c);
XmStringExtent(p->progress.fontList, str, &strWidth, &strHeight);
if (p->progress.showPercentage)
DrawString(p, str, rect->x + rect->width / 2 - (int)strWidth / 2,
rect->y + rect->height / 2 - (int)strHeight / 2, strWidth,
&lRect, &rRect);
XmStringFree(str);
/* Left Time */
currentTime = time(0);
timeSoFar = (int)(currentTime - p->progress.startTime);
if (p->progress.showTime && p->progress.value &&
p->progress.value != p->progress.completeValue && timeSoFar)
{
TimeStr(c, timeSoFar);
str = XmStringCreateSimple(c);
XmStringExtent(p->progress.fontList, str,
&strWidth, &strHeight);
DrawString(p, str, rect->x + 5, rect->y + rect->height / 2 -
(int)strHeight / 2, strWidth, &lRect, &rRect);
XmStringFree(str);
}
/* Right Time */
timeLeft = 0;
if (percent)
timeLeft = (timeSoFar * 100 / percent) - timeSoFar;
if (p->progress.showTime && percent && percent != 100 && timeLeft)
{
TimeStr(c, timeLeft);
str = XmStringCreateSimple(c);
XmStringExtent(p->progress.fontList, str,
&strWidth, &strHeight);
DrawString(p, str, rect->x + rect->width - strWidth - 5,
rect->y + rect->height / 2 - (int)strHeight / 2,
strWidth, &lRect, &rRect);
XmStringFree(str);
}
}
static void
DrawString(XmLProgressWidget p,
XmString str,
int x,
int y,
int strWidth,
XRectangle *lRect,
XRectangle *rRect)
{
Display *dpy;
Window win;
dpy = XtDisplay(p);
win = XtWindow(p);
if (lRect->width && lRect->height)
{
XSetForeground(dpy, p->progress.gc, p->core.background_pixel);
XSetClipRectangles(dpy, p->progress.gc, 0, 0, lRect, 1, Unsorted);
XmStringDraw(dpy, win, p->progress.fontList, str,
p->progress.gc, x, y, strWidth, XmALIGNMENT_BEGINNING,
XmSTRING_DIRECTION_L_TO_R, 0);
XSetClipMask(dpy, p->progress.gc, None);
}
if (rRect->width && rRect->height)
{
XSetForeground(dpy, p->progress.gc, p->primitive.foreground);
XSetClipRectangles(dpy, p->progress.gc, 0, 0, rRect, 1, Unsorted);
XmStringDraw(dpy, win, p->progress.fontList, str,
p->progress.gc, x, y, strWidth, XmALIGNMENT_BEGINNING,
XmSTRING_DIRECTION_L_TO_R, 0);
XSetClipMask(dpy, p->progress.gc, None);
}
}
static void
TimeStr(char *c,
int seconds)
{
int h, m, s;
s = seconds;
m = s / 60;
s -= m * 60;
h = m / 60;
m -= h * 60;
if (h > 99)
h = 99;
if (h > 0 && m < 10)
sprintf(c, "%d:0%d hr", h, m);
else if (h > 0)
sprintf(c, "%d:%d hr", h, m);
else if (m > 0 && s < 10)
sprintf(c, "%d:0%d min", m, s);
else if (m > 0)
sprintf(c, "%d:%d min", m, s);
else
sprintf(c, "%d sec", s);
}
static Boolean
SetValues(Widget curW,
Widget reqW,
Widget newW,
ArgList args,
Cardinal *narg)
{
XmLProgressWidget cur, p;
XtAppContext app;
cur = (XmLProgressWidget)curW;
p = (XmLProgressWidget)newW;
app = XtWidgetToApplicationContext(curW);
if (p->progress.value == 0)
p->progress.startTime = time(0);
if (p->progress.completeValue < 1)
{
XmLWarning(newW, "SetValues() - complete value can't be < 1");
p->progress.completeValue = 1;
}
if (p->progress.numBoxes < 1)
{
XmLWarning(newW, "SetValues() - number of boxes can't be < 1");
p->progress.numBoxes = 1;
}
if (p->progress.value < 0)
{
XmLWarning(newW, "SetValues() - value can't be < 0");
p->progress.value = 0;
}
if (p->progress.value > p->progress.completeValue)
{
XmLWarning(newW, "SetValues() - value can't be > completeValue");
p->progress.value = p->progress.completeValue;
}
if (p->progress.fontList != cur->progress.fontList)
{
XmFontListFree(cur->progress.fontList);
CopyFontList(p);
}
/* display changes immediately since we may be not get back
to XNextEvent if the calling application is computing */
if (p->core.background_pixel != cur->core.background_pixel ||
p->primitive.foreground != cur->primitive.foreground ||
p->progress.value != cur->progress.value ||
p->progress.completeValue != cur->progress.completeValue ||
p->progress.fontList != cur->progress.fontList ||
p->progress.showTime != cur->progress.showTime ||
p->progress.showPercentage != cur->progress.showPercentage ||
p->progress.meterStyle != cur->progress.meterStyle ||
p->progress.numBoxes != cur->progress.numBoxes ||
p->primitive.shadow_thickness != cur->primitive.shadow_thickness)
{
Redisplay(newW, 0, 0);
XFlush(XtDisplay(newW));
XmUpdateDisplay(newW);
}
return FALSE;
}
static void
CopyFontList(XmLProgressWidget p)
{
if (!p->progress.fontList)
p->progress.fontList = XmLFontListCopyDefault((Widget)p);
else
p->progress.fontList = XmFontListCopy(p->progress.fontList);
if (!p->progress.fontList)
XmLWarning((Widget)p, "- fatal error - font list NULL");
}
static Boolean
CvtStringToMeterStyle(Display *dpy,
XrmValuePtr args,
Cardinal *narg,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *data)
{
static XmLStringToUCharMap map[] =
{
{ "METER_BAR", XmMETER_BAR },
{ "METER_BOXES", XmMETER_BOXES },
{ 0, 0 },
};
return XmLCvtStringToUChar(dpy, "XmRMeterStyle", map, fromVal, toVal);
}
/*
Public Functions
*/
Widget
XmLCreateProgress(Widget parent,
char *name,
ArgList arglist,
Cardinal argcount)
{
return XtCreateWidget(name, xmlProgressWidgetClass, parent,
arglist, argcount);
}
nedit-5.6.orig/Microline/XmL/Progress.h0000644000175000017500000000571310245647600016522 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLProgressH
#define XmLProgressH
#include "XmL.h"
#ifdef XmL_CPP
extern "C" {
#endif
extern WidgetClass xmlProgressWidgetClass;
typedef struct _XmLProgressClassRec *XmLProgressWidgetClass;
typedef struct _XmLProgressRec *XmLProgressWidget;
#define XmLIsProgress(w) XtIsSubclass((w), xmlProgressWidgetClass)
#ifdef XmL_ANSIC
Widget XmLCreateProgress(Widget parent, char *name, ArgList arglist,
Cardinal argcount);
#else
Widget XmLCreateProgress();
#endif
#ifdef XmL_CPP
}
#endif
#endif
nedit-5.6.orig/Microline/XmL/ProgressP.h0000644000175000017500000000651310077552126016642 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLProgressPH
#define XmLProgressPH
#include
#include
#ifdef MOTIF11
#else
#include
#include
#endif
#include
#include "Progress.h"
typedef struct _XmLProgressPart
{
int completeValue, value;
Boolean showTime;
Boolean showPercentage;
XmFontList fontList;
GC gc;
time_t startTime;
XFontStruct *fallbackFont;
unsigned char meterStyle;
int numBoxes;
} XmLProgressPart;
typedef struct _XmLProgressRec
{
CorePart core;
XmPrimitivePart primitive;
XmLProgressPart progress;
} XmLProgressRec;
typedef struct _XmLProgressClassPart
{
int null;
} XmLProgressClassPart;
typedef struct _XmLProgressClassRec
{
CoreClassPart core_class;
XmPrimitiveClassPart primitive_class;
XmLProgressClassPart progress_class;
} XmLProgressClassRec;
extern XmLProgressClassRec xmlProgressClassRec;
#endif
nedit-5.6.orig/Microline/XmL/Tree.c0000644000175000017500000011634010470434621015604 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#include "TreeP.h"
#include
static void Initialize(Widget req, Widget newW, ArgList args, Cardinal *nargs);
static void Destroy(Widget w);
static Boolean SetValues(Widget curW, Widget, Widget newW,
ArgList args, Cardinal *nargs);
static int _PreLayout(XmLGridWidget g, int isVert);
static int _TreeCellAction(XmLGridCell cell, Widget w,
XmLGridCallbackStruct *cbs);
static void DrawIconCell(XmLGridCell cell, Widget w,
int row, XRectangle *clipRect, XmLGridDrawStruct *ds);
static void DrawConnectingLine(Display *dpy, Window win, GC gc,
XRectangle *clipRect, int offFlag, int x1, int y1, int x2, int y2);
static void BtnPress(Widget w, XtPointer closure, XEvent *event,
Boolean *ctd);
static void Activate(Widget w, XtPointer clientData, XtPointer callData);
static void SwitchRowState(XmLTreeWidget t, int row, XEvent *event);
static XmLGridRow _RowNew(Widget tree);
static void _GetRowValueMask(XmLGridWidget g, char *s, long *mask);
static void _GetRowValue(XmLGridWidget g, XmLGridRow r,
XtArgVal value, long mask);
static int _SetRowValues(XmLGridWidget g, XmLGridRow r, long mask);
static int _SetCellValuesResize(XmLGridWidget g, XmLGridRow row,
XmLGridColumn col, XmLGridCell cell, long mask);
static void GetManagerForeground(Widget w, int, XrmValue *value);
static void CreateDefaultPixmaps(XmLTreeWidget t);
static XmLTreeWidget WidgetToTree(Widget w, char *funcname);
static XtResource resources[] =
{
{
XmNcollapseCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLTreeWidget, tree.collapseCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNconnectingLineColor, XmCConnectingLineColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLTreeWidget, tree.lineColor),
XmRCallProc, (XtPointer)GetManagerForeground,
},
{
XmNexpandCallback, XmCCallback,
XmRCallback, sizeof(XtCallbackList),
XtOffset(XmLTreeWidget, tree.expandCallback),
XmRImmediate, (XtPointer)0,
},
{
XmNlevelSpacing, XmCLevelSpacing,
XmRDimension, sizeof(Dimension),
XtOffset(XmLTreeWidget, tree.levelSpacing),
XmRImmediate, (XtPointer)11,
},
{
XmNplusMinusColor, XmCPlusMinusColor,
XmRPixel, sizeof(Pixel),
XtOffset(XmLTreeWidget, tree.pmColor),
XmRCallProc, (XtPointer)GetManagerForeground,
},
/* Row Resources */
{
XmNrowExpands, XmCRowExpands,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLTreeWidget, tree.rowExpands),
XmRImmediate, (XtPointer)False,
},
{
XmNrowIsExpanded, XmCRowIsExpanded,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLTreeWidget, tree.rowIsExpanded),
XmRImmediate, (XtPointer)True,
},
{
XmNrowLevel, XmCRowLevel,
XmRInt, sizeof(int),
XtOffset(XmLTreeWidget, tree.rowLevel),
XmRImmediate, (XtPointer)0,
},
/* XmNignorePixmaps. Causes the tree to NOT render any pixmaps */
{
XmNignorePixmaps, XmCIgnorePixmaps,
XmRBoolean, sizeof(Boolean),
XtOffset(XmLTreeWidget, tree.ignorePixmaps),
XmRImmediate, (XtPointer) False,
},
};
XmLTreeClassRec xmlTreeClassRec =
{
{ /* core_class */
(WidgetClass)&xmlGridClassRec, /* superclass */
"XmLTree", /* class_name */
sizeof(XmLTreeRec), /* widget_size */
(XtProc)NULL, /* class_init */
0, /* class_part_init */
FALSE, /* class_inited */
(XtInitProc)Initialize, /* initialize */
0, /* initialize_hook */
XtInheritRealize, /* realize */
NULL, /* actions */
0, /* num_actions */
resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
TRUE, /* compress_motion */
XtExposeCompressMaximal, /* compress_exposure */
TRUE, /* compress_enterleav */
TRUE, /* visible_interest */
(XtWidgetProc)Destroy, /* destroy */
XtInheritResize, /* resize */
XtInheritExpose, /* expose */
(XtSetValuesFunc)SetValues, /* set_values */
0, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
0, /* get_values_hook */
0, /* accept_focus */
XtVersion, /* version */
0, /* callback_private */
XtInheritTranslations, /* tm_table */
0, /* query_geometry */
0, /* display_accelerato */
0, /* extension */
},
{ /* composite_class */
XtInheritGeometryManager, /* geometry_manager */
XtInheritChangeManaged, /* change_managed */
XtInheritInsertChild, /* insert_child */
XtInheritDeleteChild, /* delete_child */
0, /* extension */
},
{ /* constraint_class */
0, /* subresources */
0, /* subresource_count */
sizeof(XmLTreeConstraintRec), /* constraint_size */
0, /* initialize */
0, /* destroy */
0, /* set_values */
0, /* extension */
},
{ /* manager_class */
XtInheritTranslations, /* translations */
0, /* syn resources */
0, /* num syn_resources */
0, /* get_cont_resources */
0, /* num_get_cont_resou */
XmInheritParentProcess, /* parent_process */
0, /* extension */
},
{ /* grid_class */
0, /* initial rows */
1, /* initial cols */
_PreLayout, /* post layout */
sizeof(struct _XmLTreeRowRec), /* row rec size */
_RowNew, /* row new */
XmInheritGridRowFree, /* row free */
_GetRowValueMask, /* get row value mask */
_GetRowValue, /* get row value */
_SetRowValues, /* set row values */
sizeof(struct _XmLGridColumnRec), /* column rec size */
XmInheritGridColumnNew, /* column new */
XmInheritGridColumnFree, /* column free */
XmInheritGridGetColumnValueMask, /* get col value mask */
XmInheritGridGetColumnValue, /* get column value */
XmInheritGridSetColumnValues, /* set column values */
_SetCellValuesResize, /* set cell vl resize */
_TreeCellAction, /* cell action */
},
{ /* tree_class */
0, /* unused */
}
};
WidgetClass xmlTreeWidgetClass = (WidgetClass)&xmlTreeClassRec;
static void
Initialize(Widget reqW,
Widget newW,
ArgList args,
Cardinal *narg)
{
XmLTreeWidget t;
t = (XmLTreeWidget)newW;
if ((int) t->core.width <= 0)
t->core.width = 100;
if (t->core.height <= (Dimension) 0)
t->core.height = 100;
t->tree.defaultPixmapsCreated = 0;
t->tree.linesData = 0;
t->tree.linesSize = 0;
t->tree.recalcTreeWidth = 0;
if (t->grid.rowCount)
{
XmLWarning(newW, "Initialize() - can't set XmNrows");
XmLGridDeleteAllRows(newW, XmCONTENT);
}
XtAddCallback(newW, XmNactivateCallback, Activate, NULL);
XtAddEventHandler(newW, ButtonPressMask,
True, (XtEventHandler)BtnPress, (XtPointer)0);
XtVaSetValues(newW,
XmNcellDefaults, True,
XmNcolumn, 0,
XmNcellType, XmICON_CELL,
NULL);
}
static void
Destroy(Widget w)
{
XmLTreeWidget t;
Display *dpy;
XWindowAttributes attr;
t = (XmLTreeWidget)w;
dpy = XtDisplay(t);
if (t->tree.linesData)
free((char *)t->tree.linesData);
if (t->tree.defaultPixmapsCreated)
{
XGetWindowAttributes(dpy, XtWindow(w), &attr);
XFreePixmap(dpy, t->tree.filePixmask);
XFreePixmap(dpy, t->tree.folderPixmask);
XFreePixmap(dpy, t->tree.folderOpenPixmask);
XFreePixmap(dpy, t->tree.filePixmask);
XFreePixmap(dpy, t->tree.folderPixmask);
XFreePixmap(dpy, t->tree.folderOpenPixmask);
XFreeColors(dpy, attr.colormap, t->tree.pixColors, 4, 0L);
}
}
static Boolean
SetValues(Widget curW,
Widget reqW,
Widget newW,
ArgList args,
Cardinal *nargs)
{
XmLTreeWidget t, cur;
XmLGridColumn col;
Boolean needsResize, needsRedraw;
t = (XmLTreeWidget)newW;
cur = (XmLTreeWidget)curW;
needsResize = False;
needsRedraw = False;
#define NE(value) (t->value != cur->value)
if (NE(grid.rowCount))
XmLWarning(newW, "SetValues() - can't set XmNrows");
if (NE(tree.pmColor) || NE(tree.lineColor))
needsRedraw = True;
if (NE(tree.levelSpacing) ||
t->tree.recalcTreeWidth)
{
col = XmLGridGetColumn(newW, XmCONTENT, 0);
if (col)
col->grid.widthInPixelsValid = 0;
t->tree.recalcTreeWidth = 0;
needsResize = True;
needsRedraw = True;
}
#undef NE
if (needsResize)
_XmLGridLayout((XmLGridWidget)t);
if (needsRedraw)
XmLGridRedrawAll((Widget)t);
return False;
}
static int
_PreLayout(XmLGridWidget g,
int isVert)
{
XmLTreeWidget t;
XmLTreeRow row;
Widget w;
int i, j, size, maxLevel, hideLevel, lineWidth;
char *thisLine, *prevLine;
t = (XmLTreeWidget)g;
w = (Widget)g;
if (!t->grid.vertVisChangedHint)
return 0; /* ?? */
t->grid.vertVisChangedHint = 0;
/* top down calculation of hidden states and maxLevel */
hideLevel = -1;
maxLevel = 0;
t->grid.layoutFrozen = True;
for (i = 0; i < t->grid.rowCount; i++)
{
row = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, i);
if (row->tree.level > maxLevel)
maxLevel = row->tree.level;
if (hideLevel != -1 && row->tree.level > hideLevel)
{
if (row->grid.height)
XtVaSetValues(w,
XmNrow, i,
XmNrowHeight, 0,
NULL);
}
else
{
if (row->tree.expands == True && row->tree.isExpanded == False)
hideLevel = row->tree.level;
else
hideLevel = -1;
if (!row->grid.height)
XtVaSetValues(w,
XmNrow, i,
XmNrowHeight, 1,
NULL);
}
}
t->grid.layoutFrozen = False;
t->tree.linesMaxLevel = maxLevel;
if (!t->grid.rowCount)
return 0;
/* bottom up calculation of connecting lines */
lineWidth = maxLevel + 1;
size = lineWidth * t->grid.rowCount;
if (t->tree.linesSize < size)
{
if (t->tree.linesData)
free((char *)t->tree.linesData);
t->tree.linesSize = size;
t->tree.linesData = (char *)malloc(size);
}
prevLine = 0;
thisLine = &t->tree.linesData[size - lineWidth];
for (i = t->grid.rowCount - 1; i >= 0; i--)
{
row = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, i);
if (!row->grid.height)
{
thisLine -= lineWidth;
continue;
}
for (j = 0; j < row->tree.level - 1; j++)
{
if (prevLine && (prevLine[j] == 'L' || prevLine[j] == 'I' ||
prevLine[j] == 'E'))
thisLine[j] = 'I';
else
thisLine[j] = ' ';
}
if (row->tree.level)
{
if (prevLine && (prevLine[j] == 'L' || prevLine[j] == 'I' ||
prevLine[j] == 'E'))
thisLine[j++] = 'E';
else
thisLine[j++] = 'L';
}
thisLine[j++] = 'O';
for (; j < lineWidth; j++)
thisLine[j] = ' ';
prevLine = thisLine;
thisLine -= lineWidth;
}
if (prevLine)
{
for (i = 0; i < lineWidth; i++)
{
if (prevLine[i] == 'L')
prevLine[i] = '-';
else if (prevLine[i] == 'E')
prevLine[i] = 'P';
}
}
/* if we are in VertLayout(), the horizontal size may need */
/* recomputing because of the row hides. */
if (isVert)
return 1;
/* if we are in HorizLayout(), the vertical recomputation */
/* will be happening regardless, since row changes (vertical) */
/* are why we are here */
return 0;
}
static int
_TreeCellAction(XmLGridCell cell,
Widget w,
XmLGridCallbackStruct *cbs)
{
XmLTreeWidget t;
XmLTreeRow row;
XmLGridColumn col;
XmLGridWidgetClass sc;
XmLGridCellActionProc cellActionProc;
XmLGridCellRefValues *cellValues;
XmLGridCellIcon *icon;
/* XRectangle *rect, cRect;*/
int ret, h, isTreeCell;
Dimension default_icon_width = 16;
Dimension default_icon_height = 16;
t = (XmLTreeWidget)w;
if (cbs->rowType == XmCONTENT &&
cbs->columnType == XmCONTENT &&
cbs->column == 0)
isTreeCell = 1;
else
isTreeCell = 0;
sc = (XmLGridWidgetClass)xmlTreeWidgetClass->core_class.superclass;
cellActionProc = sc->grid_class.cellActionProc;
ret = 0;
/* Check for ignore pixmaps */
if (t->tree.ignorePixmaps)
{
default_icon_width = 0;
default_icon_height = 0;
}
switch (cbs->reason)
{
case XmCR_CELL_DRAW:
if (isTreeCell)
DrawIconCell(cell, w, cbs->row, cbs->clipRect, cbs->drawInfo);
else
ret = cellActionProc(cell, w, cbs);
break;
case XmCR_CONF_TEXT:
if (isTreeCell)
{
int iconOffset;
cellValues = cell->cell.refValues;
row = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, cbs->row);
icon = (XmLGridCellIcon *)cell->cell.value;
iconOffset = 4 + cellValues->leftMargin
+ t->tree.levelSpacing * 2 * row->tree.level;
if (!icon)
iconOffset += default_icon_width;
else if (icon->pix.pixmap == XmUNSPECIFIED_PIXMAP)
iconOffset += default_icon_width;
else
iconOffset += icon->pix.width;
cbs->clipRect->x += iconOffset;
if (cbs->clipRect->width > iconOffset)
cbs->clipRect->width -= iconOffset;
else
cbs->clipRect->width = 0;
}
ret = cellActionProc(cell, w, cbs);
break;
case XmCR_PREF_HEIGHT:
ret = cellActionProc(cell, w, cbs);
if (isTreeCell)
{
cellValues = cell->cell.refValues;
if (cellValues->type != XmICON_CELL)
return 0;
icon = (XmLGridCellIcon *)cell->cell.value;
h = 4 + default_icon_height + cellValues->topMargin + cellValues->bottomMargin;
if (icon && icon->pix.pixmap == XmUNSPECIFIED_PIXMAP &&
ret < h)
ret = h;
}
break;
case XmCR_PREF_WIDTH:
if (isTreeCell)
{
cellValues = cell->cell.refValues;
if (cellValues->type != XmICON_CELL)
return 0;
icon = (XmLGridCellIcon *)cell->cell.value;
col = (XmLGridColumn)cbs->object;
row = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, cbs->row);
if (row->tree.stringWidthValid == False)
{
if (icon && icon->string)
row->tree.stringWidth =
XmStringWidth(cellValues->fontList, icon->string);
else
row->tree.stringWidth = 0;
row->tree.stringWidthValid = True;
}
ret = 4 + cellValues->leftMargin + t->tree.levelSpacing * 2 *
row->tree.level + t->grid.iconSpacing + row->tree.stringWidth +
cellValues->rightMargin;
if (!icon)
ret += default_icon_width;
else if (icon->pix.pixmap == XmUNSPECIFIED_PIXMAP)
ret += default_icon_width;
else
ret += icon->pix.width;
if (!row->grid.height)
ret = 0;
}
else
ret = cellActionProc(cell, w, cbs);
break;
default:
ret = cellActionProc(cell, w, cbs);
break;
}
return ret;
}
static void
DrawIconCell(XmLGridCell cell,
Widget w,
int row,
XRectangle *clipRect,
XmLGridDrawStruct *ds)
{
XmLTreeWidget t;
XmLTreeRow rowp;
XmLGridCellRefValues *cellValues;
XmLGridCellIcon *icon;
XRectangle *cellRect, rect;
Display *dpy;
Window win;
char *thisLine;
int i, clipSet, pixWidth, pixHeight;
int xoff, xoff2, midy, oddFlag, x1, y1, x2, y2;
Pixmap pixmap, pixmask;
t = (XmLTreeWidget)w;
rowp = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, row);
dpy = XtDisplay(w);
win = XtWindow(w);
cellValues = cell->cell.refValues;
if (cellValues->type != XmICON_CELL)
return;
icon = (XmLGridCellIcon *)cell->cell.value;
if (!icon)
return;
cellRect = ds->cellRect;
if (!t->tree.linesData)
{
XmLWarning(w, "DrawIconCell() - no lines data calculated");
return;
}
/* draw background */
XSetForeground(dpy, ds->gc, cell->cell.refValues->background);
XFillRectangle(dpy, win, ds->gc, clipRect->x, clipRect->y,
clipRect->width, clipRect->height);
if (t->grid.singleColScrollMode)
oddFlag = t->grid.singleColScrollPos & 1;
else
oddFlag = 0;
pixWidth = 0;
xoff = t->tree.levelSpacing;
xoff2 = xoff * 2;
y1 = cellRect->y;
y2 = cellRect->y + cellRect->height - 1;
midy = cellRect->y + cellRect->height / 2;
if (midy & 1)
midy += 1;
/* draw connecting lines and pixmap */
XSetForeground(dpy, ds->gc, t->tree.lineColor);
thisLine = &t->tree.linesData[row * (t->tree.linesMaxLevel + 1)];
for (i = 0; i <= t->tree.linesMaxLevel; i++)
{
x1 = cellRect->x + (xoff2 * i);
if (x1 >= clipRect->x + (int)clipRect->width)
continue;
switch (thisLine[i])
{
case 'O':
if (!t->tree.ignorePixmaps)
{
rect.x = x1;
rect.y = cellRect->y;
rect.width = cellRect->width;
rect.height = cellRect->height;
if (icon->pix.pixmap != XmUNSPECIFIED_PIXMAP)
{
pixmap = icon->pix.pixmap;
pixmask = icon->pix.pixmask;
pixWidth = icon->pix.width;
pixHeight = icon->pix.height;
}
else
{
if (!t->tree.defaultPixmapsCreated)
CreateDefaultPixmaps(t);
if (rowp->tree.expands && rowp->tree.isExpanded)
{
pixmap = t->tree.folderOpenPixmap;
pixmask = t->tree.folderOpenPixmask;
}
else if (rowp->tree.expands)
{
pixmap = t->tree.folderPixmap;
pixmask = t->tree.folderPixmask;
}
else
{
pixmap = t->tree.filePixmap;
pixmask = t->tree.filePixmask;
}
pixWidth = 16;
pixHeight = 16;
}
XmLPixmapDraw(w, pixmap, pixmask, pixWidth, pixHeight,
XmALIGNMENT_BOTTOM_LEFT, ds->gc, &rect, clipRect);
} /* !t->tree.ignorePixmaps */
break;
case 'I':
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, y1, x1 + xoff, y2);
break;
case 'E':
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, y1, x1 + xoff, y2);
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, midy, x1 + xoff2, midy);
break;
case 'L':
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, y1, x1 + xoff, midy);
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, midy, x1 + xoff2, midy);
break;
case 'P':
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, midy, x1 + xoff, y2);
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, midy, x1 + xoff2, midy);
break;
case '-':
DrawConnectingLine(dpy, win, ds->gc, clipRect, oddFlag,
x1 + xoff, midy, x1 + xoff2, midy);
break;
}
}
clipSet = 0;
/* draw expand/collapse graphic */
rect.x = cellRect->x + (rowp->tree.level - 1) * xoff2 + xoff - 5;
rect.y = midy - 5;
rect.width = 11;
rect.height = 11;
i = XmLRectIntersect(&rect, clipRect);
if (rowp->tree.expands && rowp->tree.level && i != XmLRectOutside)
{
if (i == XmLRectPartial)
{
clipSet = 1;
XSetClipRectangles(dpy, ds->gc, 0, 0, clipRect, 1, Unsorted);
}
x1 = rect.x;
x2 = rect.x + rect.width - 1;
y1 = rect.y;
y2 = rect.y + rect.height - 1;
XSetForeground(dpy, ds->gc, cellValues->background);
XFillRectangle(dpy, win, ds->gc, x1, y1, 11, 11);
XSetForeground(dpy, ds->gc, t->tree.lineColor);
XDrawLine(dpy, win, ds->gc, x1 + 2, y1 + 1, x2 - 2, y1 + 1);
XDrawLine(dpy, win, ds->gc, x2 - 1, y1 + 2, x2 - 1, y2 - 2);
XDrawLine(dpy, win, ds->gc, x1 + 2, y2 - 1, x2 - 2, y2 - 1);
XDrawLine(dpy, win, ds->gc, x1 + 1, y1 + 2, x1 + 1, y2 - 2);
XSetForeground(dpy, ds->gc, t->tree.pmColor);
if (!rowp->tree.isExpanded)
XDrawLine(dpy, win, ds->gc, x1 + 5, y1 + 3, x1 + 5, y1 + 7);
XDrawLine(dpy, win, ds->gc, x1 + 3, y1 + 5, x1 + 7, y1 + 5);
}
/* draw select background and highlight */
i = rowp->tree.level * xoff2 + pixWidth + t->grid.iconSpacing;
rect.x = cellRect->x + i;
rect.y = cellRect->y;
rect.height = cellRect->height;
rect.width = 0;
if (t->grid.colCount == 1 && rowp->tree.stringWidthValid)
rect.width = rowp->tree.stringWidth + 4;
else if ((int)cellRect->width > i)
rect.width = cellRect->width - i;
i = XmLRectIntersect(&rect, clipRect);
if (i != XmLRectOutside && ds->drawSelected)
{
if (i == XmLRectPartial && !clipSet)
{
clipSet = 1;
XSetClipRectangles(dpy, ds->gc, 0, 0, clipRect, 1, Unsorted);
}
XSetForeground(dpy, ds->gc, ds->selectBackground);
XFillRectangle(dpy, win, ds->gc, rect.x, rect.y,
rect.width, rect.height);
}
if (ds->drawFocusType != XmDRAW_FOCUS_NONE &&
t->grid.highlightThickness >= 2)
{
if (i == XmLRectPartial && !clipSet)
{
clipSet = 1;
XSetClipRectangles(dpy, ds->gc, 0, 0, clipRect, 1, Unsorted);
}
XSetForeground(dpy, ds->gc, t->manager.highlight_color);
x1 = rect.x;
x2 = rect.x + rect.width - 1;
y1 = rect.y;
y2 = rect.y + rect.height - 1;
XDrawLine(dpy, win, ds->gc, x1, y1, x2, y1);
if (ds->drawFocusType == XmDRAW_FOCUS_CELL ||
ds->drawFocusType == XmDRAW_FOCUS_RIGHT)
XDrawLine(dpy, win, ds->gc, x2, y1, x2, y2);
XDrawLine(dpy, win, ds->gc, x1, y2, x2, y2);
XDrawLine(dpy, win, ds->gc, x1, y1, x1, y2);
y1 += 1;
y2 -= 1;
XDrawLine(dpy, win, ds->gc, x1, y2, x2, y2);
XDrawLine(dpy, win, ds->gc, x1, y1, x2, y1);
x1 += 1;
x2 -= 1;
XDrawLine(dpy, win, ds->gc, x1, y1, x1, y2);
if (ds->drawFocusType == XmDRAW_FOCUS_CELL ||
ds->drawFocusType == XmDRAW_FOCUS_RIGHT)
XDrawLine(dpy, win, ds->gc, x2, y1, x2, y2);
}
/* draw string */
if (icon->string)
{
if (ds->drawSelected == True)
XSetForeground(dpy, ds->gc, ds->selectForeground);
else
XSetForeground(dpy, ds->gc, cellValues->foreground);
XmLStringDraw(w, icon->string, ds->stringDirection,
cellValues->fontList, XmALIGNMENT_LEFT,
ds->gc, &rect, clipRect);
}
if (clipSet)
XSetClipMask(dpy, ds->gc, None);
}
static void
DrawConnectingLine(Display *dpy,
Window win,
GC gc,
XRectangle *clipRect,
int oddFlag,
int x1,
int y1,
int x2,
int y2)
{
int i, x, y;
XPoint points[100];
i = 0;
for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++)
{
if ((((x + oddFlag) & 1) == (y & 1)) ||
x < clipRect->x ||
x >= (clipRect->x + (int)clipRect->width) ||
y < clipRect->y ||
y >= (clipRect->y + (int)clipRect->height))
continue;
points[i].x = x;
points[i].y = y;
if (++i < 100)
continue;
XDrawPoints(dpy, win, gc, points, i, CoordModeOrigin);
i = 0;
}
if (i)
XDrawPoints(dpy, win, gc, points, i, CoordModeOrigin);
}
static void
BtnPress(Widget w,
XtPointer closure,
XEvent *event,
Boolean *ctd)
{
XmLTreeWidget t;
XmLTreeRow rowp;
unsigned char rowType, colType;
int row, col, x1, y1, x2, y2, xoff;
XRectangle rect;
XButtonEvent *be;
static int lastRow = -1;
static Time lastSelectTime = 0;
t = (XmLTreeWidget)w;
if (event->type != ButtonPress)
return;
be = (XButtonEvent *)event;
if (be->button != Button1 || be->state & ControlMask ||
be->state & ShiftMask)
return;
if (XmLGridXYToRowColumn(w, be->x, be->y, &rowType, &row,
&colType, &col) == -1)
return;
rowp = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, row);
if (rowType != XmCONTENT || colType != XmCONTENT || col != 0)
return;
if (XmLGridRowColumnToXY(w, rowType, row, colType, col,
False, &rect) == -1)
return;
if ((be->time - lastSelectTime) < XtGetMultiClickTime(XtDisplay(w)) &&
lastRow == row)
{
/* activate callback will be handling expand/collapse */
lastSelectTime = be->time;
return;
}
/*
* If the Grid is using single click activation the activateCallback
* called from Select() will take care of collapsing and
* expanding.
*/
if (((XmLGridWidget)w)->grid.singleClickActivation)
return;
lastSelectTime = be->time;
lastRow = row;
xoff = t->tree.levelSpacing;
x1 = rect.x + (rowp->tree.level - 1) * xoff * 2 + xoff - 6;
x2 = x1 + 13;
y1 = rect.y + rect.height / 2 - 6;
y2 = y1 + 13;
if (be->x > x2 || be->x < x1 || be->y > y2 || be->y < y1)
return;
SwitchRowState(t, row, event);
/* Avoid having a cell edited when expand/collapse is done.
* Yes, this is a hack. By setting this to zero, Grid.c:Select()
* will ignore this click are a second click that would trigger
* inplace editing.
*/
((XmLGridWidget)w)->grid.lastSelectTime = 0;
}
static void
Activate(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLTreeWidget t;
XmLGridCallbackStruct *cbs;
t = (XmLTreeWidget)w;
cbs = (XmLGridCallbackStruct *)callData;
if (cbs->rowType != XmCONTENT)
if (t->grid.selectionPolicy == XmSELECT_CELL &&
(cbs->columnType != XmCONTENT || cbs->column != 0))
return;
SwitchRowState(t, cbs->row, cbs->event);
}
static void
SwitchRowState(XmLTreeWidget t,
int row,
XEvent *event)
{
Widget w;
XmLTreeRow rowp;
XmLGridCallbackStruct cbs;
w = (Widget)t;
rowp = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, row);
if (rowp->tree.expands == False)
return;
cbs.event = event;
cbs.columnType = XmCONTENT;
cbs.column = 0;
cbs.rowType = XmCONTENT;
cbs.row = row;
if (rowp->tree.isExpanded == True)
{
XtVaSetValues(w,
XmNrow, row,
XmNrowIsExpanded, False,
NULL);
cbs.reason = XmCR_COLLAPSE_ROW;
XtCallCallbackList(w, t->tree.collapseCallback, (XtPointer)&cbs);
}
else
{
XtVaSetValues(w,
XmNrow, row,
XmNrowIsExpanded, True,
NULL);
cbs.reason = XmCR_EXPAND_ROW;
XtCallCallbackList(w, t->tree.expandCallback, (XtPointer)&cbs);
}
}
/* Only to be called through Grid class */
static XmLGridRow
_RowNew(Widget tree)
{
XmLGridWidgetClass sc;
XmLTreeRow row;
sc = (XmLGridWidgetClass)xmlTreeWidgetClass->core_class.superclass;
row = (XmLTreeRow)sc->grid_class.rowNewProc(tree);
row->tree.level = 0;
row->tree.expands = False;
row->tree.isExpanded = True;
row->tree.hasSiblings = False;
row->tree.stringWidth = 0;
row->tree.stringWidthValid = False;
return (XmLGridRow)row;
}
/* Only to be called through Grid class */
static void
_GetRowValueMask(XmLGridWidget g,
char *s,
long *mask)
{
XmLGridWidgetClass sc;
static XrmQuark qLevel, qExpands, qIsExpanded;
static int quarksValid = 0;
XrmQuark q;
sc = (XmLGridWidgetClass)xmlTreeWidgetClass->core_class.superclass;
sc->grid_class.getRowValueMaskProc(g, s, mask);
if (!quarksValid)
{
qLevel = XrmStringToQuark(XmNrowLevel);
qExpands = XrmStringToQuark(XmNrowExpands);
qIsExpanded = XrmStringToQuark(XmNrowIsExpanded);
quarksValid = 1;
}
q = XrmStringToQuark(s);
if (q == qLevel)
*mask |= XmLTreeRowLevel;
else if (q == qExpands)
*mask |= XmLTreeRowExpands;
else if (q == qIsExpanded)
*mask |= XmLTreeRowIsExpanded;
}
/* Only to be called through Grid class */
static void
_GetRowValue(XmLGridWidget g,
XmLGridRow r,
XtArgVal value,
long mask)
{
XmLGridWidgetClass sc;
XmLTreeRow row;
sc = (XmLGridWidgetClass)xmlTreeWidgetClass->core_class.superclass;
sc->grid_class.getRowValueProc(g, r, value, mask);
row = (XmLTreeRow)r;
switch (mask)
{
case XmLTreeRowLevel:
*((int *)value) = row->tree.level;
break;
case XmLTreeRowExpands:
*((Boolean *)value) = row->tree.expands;
break;
case XmLTreeRowIsExpanded:
*((Boolean *)value) = row->tree.isExpanded;
break;
}
}
/* Only to be called through Grid class */
static int
_SetRowValues(XmLGridWidget g,
XmLGridRow r,
long mask)
{
XmLGridWidgetClass sc;
int needsResize;
XmLTreeRow row;
XmLTreeWidget t;
sc = (XmLGridWidgetClass)xmlTreeWidgetClass->core_class.superclass;
needsResize = sc->grid_class.setRowValuesProc(g, r, mask);
t = (XmLTreeWidget)g;
row = (XmLTreeRow)r;
if ((mask & XmLGridRowHeight) && needsResize)
t->tree.recalcTreeWidth = 1;
if (mask & XmLTreeRowLevel)
{
row->tree.level = t->tree.rowLevel;
t->tree.recalcTreeWidth = 1;
t->grid.vertVisChangedHint = 1;
needsResize = 1;
}
if (mask & XmLTreeRowExpands)
{
row->tree.expands = t->tree.rowExpands;
t->grid.vertVisChangedHint = 1;
needsResize = 1;
}
if (mask & XmLTreeRowIsExpanded)
{
row->tree.isExpanded = t->tree.rowIsExpanded;
t->grid.vertVisChangedHint = 1;
needsResize = 1;
}
return needsResize;
}
/* Only to be called through Grid class */
static int
_SetCellValuesResize(XmLGridWidget g,
XmLGridRow row,
XmLGridColumn col,
XmLGridCell cell,
long mask)
{
XmLGridWidgetClass sc;
int needsResize;
sc = (XmLGridWidgetClass)xmlTreeWidgetClass->core_class.superclass;
needsResize = 0;
if (col->grid.pos == g->grid.headingColCount &&
row->grid.pos >= g->grid.headingRowCount &&
row->grid.pos < g->grid.headingRowCount + g->grid.rowCount)
{
if (mask & XmLGridCellFontList)
{
row->grid.heightInPixelsValid = 0;
((XmLTreeRow)row)->tree.stringWidthValid = False;
col->grid.widthInPixelsValid = 0;
needsResize = 1;
}
if (mask & XmLGridCellString)
{
((XmLTreeRow)row)->tree.stringWidthValid = False;
col->grid.widthInPixelsValid = 0;
needsResize = 1;
}
}
if (sc->grid_class.setCellValuesResizeProc(g, row, col, cell, mask))
needsResize = 1;
return needsResize;
}
/*
Utility
*/
static void
GetManagerForeground(Widget w,
int offset,
XrmValue *value)
{
XmLTreeWidget t;
t = (XmLTreeWidget)w;
value->addr = (caddr_t)&t->manager.foreground;
}
static void
CreateDefaultPixmaps(XmLTreeWidget t)
{
Display *dpy;
Window win;
XWindowAttributes attr;
XColor color;
Pixmap pixmap;
Pixel pixel;
XImage *image;
int i, x, y;
enum { white = 0, black = 1, yellow = 2, gray = 3 };
static unsigned short colors[4][3] =
{
{ 65535, 65535, 65535 },
{ 0, 0, 0 },
{ 57344, 57344, 0 },
{ 32768, 32768, 32768 },
};
static unsigned char fileMask_bits[] =
{
0xf8, 0x0f, 0xfc, 0x1f, 0xfc, 0x3f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f,
0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f,
0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xf8, 0x7f
};
static unsigned char folderMask_bits[] =
{
0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0xf0, 0x0f, 0xfc, 0x3f, 0xfe, 0x7f,
0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff,
0xfe, 0xff, 0xfe, 0xff, 0xfc, 0xff, 0xf8, 0x7f
};
static unsigned char folderOpenMask_bits[] =
{
0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0xf0, 0x0f, 0xfc, 0x3f, 0xfe, 0x7f,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff,
0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf0, 0x7f
};
static char icons[3][16][16] =
{
{
" GGGGGGGGG ",
" GWWWWWWWWKK ",
" GWWWWWWWWKWK ",
" GWWWWWWWWKKKK ",
" GWWWWWWWWWWGK ",
" GWGGGGGGGWWGK ",
" GWWKKKKKKKWGK ",
" GWWWWWWWWWWGK ",
" GWGGGGGGGWWGK ",
" GWWKKKKKKKWGK ",
" GWWWWWWWWWWGK ",
" GWGGGGGGGWWGK ",
" GWWKKKKKKKWGK ",
" GWWWWWWWWWWGK ",
" GGGGGGGGGGGGK ",
" KKKKKKKKKKKK ",
},
{
" ",
" ",
" GGGGGG ",
" GYYYYYYG ",
" GGYYYYYYYYGG ",
" GWWWWWWWWWWWYG ",
" GWYYYYYYYYYYYGK",
" GWYYYYYYYYYYYGK",
" GWYYYYYYYYYYYGK",
" GWYYYYYYYYYYYGK",
" GWYYYYYYYYYYYGK",
" GWYYYYYYYYYYYGK",
" GWYYYYYYYYYYYGK",
" GYYYYYYYYYYYYGK",
" GGGGGGGGGGGGKK",
" KKKKKKKKKKKK ",
},
{
" ",
" ",
" GGGGGG ",
" GYYYYYYG ",
" GGYYYYYYYYGG ",
" GYYYYYYYYYYYYG ",
" GYYYYYYYYYYYYGK",
"GGGGGGGGGGGYYYGK",
"GWWWWWWWWWYKYYGK",
"GWYYYYYYYYYKYYGK",
" GYYYYYYYYYYKYGK",
" GYYYYYYYYYYKYGK",
" GYYYYYYYYYYKGK",
" GYYYYYYYYYYKGK",
" GGGGGGGGGGGKK",
" KKKKKKKKKKK ",
},
};
dpy = XtDisplay(t);
win = XtWindow(t);
XGetWindowAttributes(dpy, win, &attr);
t->tree.filePixmask = XCreatePixmapFromBitmapData(dpy, win,
(char *)fileMask_bits, 16, 16, 1L, 0L, 1);
t->tree.folderPixmask = XCreatePixmapFromBitmapData(dpy, win,
(char *)folderMask_bits, 16, 16, 1L, 0L, 1);
t->tree.folderOpenPixmask = XCreatePixmapFromBitmapData(dpy, win,
(char *)folderOpenMask_bits, 16, 16, 1L, 0L, 1);
for (i = 0; i < 4; i++)
{
color.red = colors[i][0];
color.green = colors[i][1];
color.blue = colors[i][2];
color.flags = DoRed | DoGreen | DoBlue;
if (XAllocColor(dpy, attr.colormap, &color))
t->tree.pixColors[i] = color.pixel;
else
{
color.flags = 0;
XAllocColor(dpy, attr.colormap, &color);
t->tree.pixColors[i] = color.pixel;
}
}
image = XCreateImage(dpy, attr.visual, attr.depth, ZPixmap, 0,
NULL, 16, 16, XBitmapPad(dpy), 0);
if (!image)
XmLWarning((Widget)t,
"CreateDefaultPixmaps() - can't allocate image");
else
image->data = (char *)malloc(image->bytes_per_line * 16);
for (i = 0; i < 3; i++)
{
pixmap = XCreatePixmap(dpy, win, 16, 16, attr.depth);
for (x = 0; x < 16; x++)
for (y = 0; y < 16; y++)
{
switch (icons[i][y][x])
{
case ' ':
pixel = t->core.background_pixel;
break;
case 'W':
pixel = t->tree.pixColors[white];
break;
case 'K':
pixel = t->tree.pixColors[black];
break;
case 'Y':
pixel = t->tree.pixColors[yellow];
break;
case 'G':
pixel = t->tree.pixColors[gray];
break;
}
XPutPixel(image, x, y, pixel);
}
if (image)
XPutImage(dpy, pixmap, t->grid.gc, image, 0, 0, 0, 0, 16, 16);
if (i == 0)
t->tree.filePixmap = pixmap;
else if (i == 1)
t->tree.folderPixmap = pixmap;
else
t->tree.folderOpenPixmap = pixmap;
}
if (image)
XDestroyImage(image);
t->tree.defaultPixmapsCreated = 1;
}
static XmLTreeWidget
WidgetToTree(Widget w,
char *funcname)
{
char buf[256];
if (!XmLIsTree(w))
{
sprintf(buf, "%s - widget not an XmLTree", funcname);
XmLWarning(w, buf);
return 0;
}
return (XmLTreeWidget)w;
}
/*
Public Functions
*/
Widget
XmLCreateTree(Widget parent,
char *name,
ArgList arglist,
Cardinal argcount)
{
return XtCreateWidget(name, xmlTreeWidgetClass, parent,
arglist, argcount);
}
void
XmLTreeAddRow(Widget w,
int level,
Boolean expands,
Boolean isExpanded,
int position,
Pixmap pixmap,
Pixmap pixmask,
XmString string)
{
XmLTreeRowDefinition row;
row.level = level;
row.expands = expands;
row.isExpanded = isExpanded;
row.pixmap = pixmap;
row.pixmask = pixmask;
row.string = string;
XmLTreeAddRows(w, &row, 1, position);
}
void
XmLTreeAddRows(Widget w,
XmLTreeRowDefinition *rows,
int count,
int position)
{
XmLTreeWidget t;
XmLTreeRow row;
int i, level;
unsigned char layoutFrozen;
t = WidgetToTree(w, "XmLTreeAddRows()");
if (!t || count <= 0)
return;
if (position < 0 || position > t->grid.rowCount)
position = t->grid.rowCount;
layoutFrozen = t->grid.layoutFrozen;
if (layoutFrozen == False)
XtVaSetValues(w,
XmNlayoutFrozen, True,
NULL);
XmLGridAddRows(w, XmCONTENT, position, count);
for (i = 0; i < count; i++)
{
row = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, position + i);
if (!row)
continue;
level = rows[i].level;
if (level < 0)
level = 0;
row->tree.level = level;
row->tree.expands = rows[i].expands;
row->tree.isExpanded = rows[i].isExpanded;
XtVaSetValues(w,
XmNrow, position + i,
XmNcolumn, 0,
XmNcellString, rows[i].string,
XmNcellPixmap, rows[i].pixmap,
XmNcellPixmapMask, rows[i].pixmask,
NULL);
}
if (layoutFrozen == False)
XtVaSetValues(w,
XmNlayoutFrozen, False,
NULL);
}
void
XmLTreeDeleteChildren(Widget w,
int row)
{
XmLTreeWidget t;
XmLTreeRow rowp;
int ii, jj, level, rows;
t = WidgetToTree(w, "XmLTreeDeleteChildren()");
rowp = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, row);
level = rowp->tree.level;
rows = t->grid.rowCount;
ii = row + 1;
while (ii < rows)
{
rowp = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, ii);
if (rowp->tree.level <= level)
break;
ii++;
}
jj = ii - row - 1;
if (jj > 0)
XmLGridDeleteRows(w, XmCONTENT, row + 1, jj);
}
nedit-5.6.orig/Microline/XmL/Tree.h0000644000175000017500000000626710245647600015622 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLTreeH
#define XmLTreeH
#include "XmL.h"
#include "Grid.h"
#ifdef XmL_CPP
extern "C" {
#endif
extern WidgetClass xmlTreeWidgetClass;
typedef struct _XmLTreeClassRec *XmLTreeWidgetClass;
typedef struct _XmLTreeRec *XmLTreeWidget;
typedef struct _XmLTreeRowRec *XmLTreeRow;
#define XmLIsTree(w) XtIsSubclass((w), xmlTreeWidgetClass)
Widget XmLCreateTree(Widget parent, char *name, ArgList arglist,
Cardinal argcount);
void XmLTreeAddRow(Widget w, int level, Boolean expands, Boolean isExpaned,
int position, Pixmap pixmap, Pixmap pixmask, XmString string);
void XmLTreeAddRows(Widget w, XmLTreeRowDefinition *rows,
int count, int position);
void XmLTreeDeleteChildren(Widget w, int position);
#ifdef XmL_CPP
}
#endif
#endif
nedit-5.6.orig/Microline/XmL/TreeP.h0000644000175000017500000001066710077552126015742 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLTreePH
#define XmLTreePH
#include
#ifndef MOTIF11
#include
#include
#endif
#include "Tree.h"
#include "GridP.h"
/* row value mask for get/set values */
#define RVML XmLGridRowValueMaskLen
#define XmLTreeRowLevel (1L << (RVML))
#define XmLTreeRowExpands (1L << (RVML + 1))
#define XmLTreeRowIsExpanded (1L << (RVML + 2))
typedef struct _XmLTreeRowPart
{
Boolean expands;
int level;
Boolean hasChildren, hasSiblings, isExpanded;
Dimension stringWidth;
Boolean stringWidthValid;
} XmLTreeRowPart;
struct _XmLTreeRowRec
{
XmLGridRowPart grid;
XmLTreeRowPart tree;
};
typedef struct _XmLTreePart
{
/* resources */
Dimension levelSpacing;
Pixel lineColor, pmColor;
XtCallbackList collapseCallback, expandCallback;
/* private data */
char *linesData;
int linesSize, linesMaxLevel;
int recalcTreeWidth;
char defaultPixmapsCreated;
Pixel pixColors[4];
Pixmap filePixmask, folderPixmask, folderOpenPixmask;
Pixmap filePixmap, folderPixmap, folderOpenPixmap;
/* row resources */
int rowLevel;
Boolean rowExpands, rowIsExpanded;
/* Causes the tree to NOT render any pixmaps */
Boolean ignorePixmaps;
} XmLTreePart;
typedef struct _XmLTreeRec
{
CorePart core;
CompositePart composite;
ConstraintPart constraint;
XmManagerPart manager;
XmLGridPart grid;
XmLTreePart tree;
} XmLTreeRec;
typedef struct _XmLTreeClassPart
{
int unused;
} XmLTreeClassPart;
typedef struct _XmLTreeClassRec
{
CoreClassPart core_class;
CompositeClassPart composite_class;
ConstraintClassPart constraint_class;
XmManagerClassPart manager_class;
XmLGridClassPart grid_class;
XmLTreeClassPart tree_class;
} XmLTreeClassRec;
extern XmLTreeClassRec xmlTreeClassRec;
typedef struct _XmLTreeConstraintPart
{
int unused;
} XmLTreeConstraintPart;
typedef struct _XmLTreeConstraintRec
{
XmManagerConstraintPart manager;
XmLGridConstraintPart grid;
XmLTreeConstraintPart tree;
} XmLTreeConstraintRec, *XmLTreeConstraintPtr;
#endif
nedit-5.6.orig/Microline/XmL/XmL.c0000644000175000017500000011227510245647600015413 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#include "XmL.h"
#include
#include
#include
#include
#include
#include
#ifdef MOTIF11
#include
#else
#include
#endif
#include
#include
#include
#include
#ifdef SUNOS4
int fprintf(FILE *, char *, ...);
#endif
static void XmLDrawnBDestroyCB(Widget w, XtPointer clientData, XtPointer);
static void XmLDrawnBDrawCB(Widget, XtPointer, XtPointer);
static void XmLDrawnBDrawStringCB(Widget, XtPointer, XtPointer);
static int XmLDrawCalc(Widget w, Dimension width, Dimension height,
unsigned char alignment, XRectangle *rect, XRectangle *clipRect,
int *x, int *y);
static void XmLFontGetAverageWidth(XFontStruct *fs, short *width);
static void XmLMessageBoxResponse(Widget, XtPointer, XtPointer);
static void XmLMessageBoxWMDelete(Widget, XtPointer, XtPointer);
static void XmLSortFunc(char *lvec, char *rvec);
struct _XmLArrayRec
{
char _autonumber, _growFast;
int _count, _size;
void **_items;
};
XmLArray
XmLArrayNew(char autonumber,
char growFast)
{
XmLArray array;
array = (XmLArray)malloc(sizeof(struct _XmLArrayRec));
array->_count = 0;
array->_size = 0;
array->_items = 0;
array->_autonumber = autonumber;
array->_growFast = growFast;
return array;
}
void
XmLArrayFree(XmLArray array)
{
if (array->_items)
free((char *)array->_items);
free((char *)array);
}
void
XmLArrayAdd(XmLArray array,
int pos,
int count)
{
int i;
void **items;
if (count < 1)
return;
if (pos < 0 || pos > array->_count)
pos = array->_count;
if (array->_count + count >= array->_size)
{
if (array->_growFast)
{
if (!array->_size)
array->_size = count + 256;
else
array->_size = (array->_count + count) * 2;
}
else
array->_size = array->_count + count;
items = (void **)malloc(sizeof(void *) * array->_size);
if (array->_items)
{
for (i = 0; i < array->_count; i++)
items[i] = array->_items[i];
free((char *)array->_items);
}
array->_items = items;
}
for (i = array->_count + count - 1; i >= pos + count; i--)
{
array->_items[i] = array->_items[i - count];
if (array->_autonumber)
((XmLArrayItem *)array->_items[i])->pos = i;
}
for (i = pos; i < pos + count; i++)
array->_items[i] = 0;
array->_count += count;
}
int
XmLArrayDel(XmLArray array,
int pos,
int count)
{
int i;
if (pos < 0 || pos + count > array->_count)
return -1;
for (i = pos; i < array->_count - count; i++)
{
array->_items[i] = array->_items[i + count];
if (array->_autonumber)
((XmLArrayItem *)array->_items[i])->pos = i;
}
array->_count -= count;
if (!array->_count)
{
if (array->_items)
free((char *)array->_items);
array->_items = 0;
array->_size = 0;
}
return 0;
}
int
XmLArraySet(XmLArray array,
int pos,
void *item)
{
if (pos < 0 || pos >= array->_count)
return -1;
if (array->_items[pos])
fprintf(stderr, "XmLArraySet: warning: overwriting pointer\n");
array->_items[pos] = item;
if (array->_autonumber)
((XmLArrayItem *)array->_items[pos])->pos = pos;
return 0;
}
void *
XmLArrayGet(XmLArray array,
int pos)
{
if (pos < 0 || pos >= array->_count)
return 0;
return array->_items[pos];
}
int
XmLArrayGetCount(XmLArray array)
{
return array->_count;
}
int
XmLArrayMove(XmLArray array,
int newPos,
int pos,
int count)
{
void **items;
int i;
if (count <= 0)
return -1;
if (newPos < 0 || newPos + count > array->_count)
return -1;
if (pos < 0 || pos + count > array->_count)
return -1;
if (pos == newPos)
return 0;
/* copy items to move */
items = (void **)malloc(sizeof(void *) * count);
for (i = 0; i < count; i++)
items[i] = array->_items[pos + i];
/* move real items around */
if (newPos < pos)
for (i = pos + count - 1; i >= newPos + count; i--)
{
array->_items[i] = array->_items[i - count];
if (array->_autonumber)
((XmLArrayItem *)array->_items[i])->pos = i;
}
else
for (i = pos; i < newPos; i++)
{
array->_items[i] = array->_items[i + count];
if (array->_autonumber)
((XmLArrayItem *)array->_items[i])->pos = i;
}
/* move items copy back */
for (i = 0; i < count; i++)
{
array->_items[newPos + i] = items[i];
if (array->_autonumber)
((XmLArrayItem *)array->_items[newPos + i])->pos = newPos + i;
}
free((char *)items);
return 0;
}
int
XmLArrayReorder(XmLArray array,
int *newPositions,
int pos,
int count)
{
int i;
void **items;
if (count <= 0)
return -1;
if (pos < 0 || pos + count > array->_count)
return -1;
for (i = 0; i < count; i++)
{
if (newPositions[i] < pos || newPositions[i] >= pos + count)
return -1;
}
items = (void **)malloc(sizeof(void *) * count);
for (i = 0; i < count; i++)
items[i] = array->_items[newPositions[i]];
for (i = 0; i < count; i++)
{
array->_items[pos + i] = items[i];
if (array->_autonumber)
((XmLArrayItem *)array->_items[pos + i])->pos = pos + i;
}
free((char *)items);
return 0;
}
int
XmLArraySort(XmLArray array,
XmLArrayCompareFunc compare,
void *userData,
int pos,
int count)
{
int i;
if (pos < 0 || pos + count > array->_count)
return -1;
XmLSort(&array->_items[pos], count, sizeof(void *),
(XmLSortCompareFunc)compare, userData);
if (array->_autonumber)
for (i = pos; i < pos + count; i++)
((XmLArrayItem *)array->_items[i])->pos = i;
return 0;
}
Boolean
XmLCvtStringToUChar(Display *dpy,
char *resname,
XmLStringToUCharMap *map,
XrmValuePtr fromVal,
XrmValuePtr toVal)
{
char *from;
int i, /*num,*/ valid;
from = (char *)fromVal->addr;
valid = 0;
i = 0;
while (map[i].name)
{
if (!strcmp(from, map[i].name))
{
valid = 1;
break;
}
i++;
}
if (!valid)
{
XtDisplayStringConversionWarning(dpy, from, resname);
toVal->size = 0;
toVal->addr = 0;
return False;
}
if (toVal->addr)
{
if (toVal->size < sizeof(unsigned char))
{
toVal->size = sizeof(unsigned char);
return False;
}
*(unsigned char *)(toVal->addr) = map[i].value;
}
else
toVal->addr = (caddr_t)&map[i].value;
toVal->size = sizeof(unsigned char);
return True;
}
int
XmLDateDaysInMonth(int m,
int y)
{
static int d[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
if (m < 1 || m > 12 || y < 1753 || y > 9999)
return -1;
if (m == 2 && (!((y % 4) && (y % 100)) || !(y % 400)))
return 29;
return d[m - 1];
}
/* Calculation from Communications Of The ACM, Vol 6, No 8, p 444 */
/* sun is 0, sat is 6 */
int
XmLDateWeekDay(int m,
int d,
int y)
{
long jd, j1, j2;
if (m < 1 || m > 12 || d < 1 || d > XmLDateDaysInMonth(m, y) ||
y < 1753 || y > 9999)
return -1;
if (m > 2)
m -= 3;
else
{
m += 9;
y--;
}
j1 = y / 100;
j2 = y - 100 * j1;
jd = (146097 * j1) / 4 + (1461 * j2) / 4 + (153 * m + 2) / 5 +
1721119 + d;
return (jd + 1) % 7;
}
typedef struct
{
GC gc;
int type;
int dir;
XFontStruct *fontStruct;
} XmLDrawnBData;
void
XmLDrawnButtonSetType(Widget w,
int drawnType,
int drawnDir)
{
XmLDrawnBData *dd;
XmDrawnButtonWidget b;
XmString str;
XmFontList fontlist;
XGCValues values;
XtGCMask mask;
Dimension width, height, dim;
Dimension highlightThickness, shadowThickness;
Dimension marginWidth, marginHeight;
Dimension marginTop, marginBottom, marginLeft, marginRight;
if (!XtIsSubclass(w, xmDrawnButtonWidgetClass))
{
XmLWarning(w, "DrawnButtonSetType() - not an XmDrawnButton");
return;
}
XtVaSetValues(w,
XmNpushButtonEnabled, True,
NULL);
XtRemoveAllCallbacks(w, XmNexposeCallback);
XtRemoveAllCallbacks(w, XmNresizeCallback);
if (drawnType == XmDRAWNB_STRING && drawnDir == XmDRAWNB_RIGHT)
{
XtVaSetValues(w,
XmNlabelType, XmSTRING,
NULL);
return;
}
b = (XmDrawnButtonWidget)w;
dd = (XmLDrawnBData *)malloc(sizeof(XmLDrawnBData));
dd->type = drawnType;
dd->dir = drawnDir;
dd->gc = 0;
if (dd->type == XmDRAWNB_STRING)
{
XtVaGetValues(w,
XmNlabelString, &str,
XmNfontList, &fontlist,
XmNhighlightThickness, &highlightThickness,
XmNshadowThickness, &shadowThickness,
XmNmarginHeight, &marginHeight,
XmNmarginWidth, &marginWidth,
XmNmarginTop, &marginTop,
XmNmarginBottom, &marginBottom,
XmNmarginLeft, &marginLeft,
XmNmarginRight, &marginRight,
NULL);
if (!str && XtName(w))
str = XmStringCreateSimple(XtName(w));
if (!str)
str = XmStringCreateSimple("");
XmStringExtent(fontlist, str, &width, &height);
XmStringFree(str);
if (drawnDir == XmDRAWNB_UP || drawnDir == XmDRAWNB_DOWN)
{
dim = width;
width = height;
height = dim;
}
height += (highlightThickness + shadowThickness +
marginHeight) * 2 + marginTop + marginBottom;
width += (highlightThickness + shadowThickness +
marginWidth) * 2 + marginLeft + marginRight;
/* change to pixmap type so label string isnt drawn */
XtVaSetValues(w,
XmNlabelType, XmPIXMAP,
NULL);
XtVaSetValues(w,
XmNwidth, width,
XmNheight, height,
NULL);
XtAddCallback(w, XmNexposeCallback, XmLDrawnBDrawStringCB,
(XtPointer)dd);
XtAddCallback(w, XmNresizeCallback, XmLDrawnBDrawStringCB,
(XtPointer)dd);
}
else
{
mask = GCForeground;
values.foreground = b->primitive.foreground;
dd->gc = XtGetGC(w, mask, &values);
XtAddCallback(w, XmNexposeCallback, XmLDrawnBDrawCB, (XtPointer)dd);
XtAddCallback(w, XmNresizeCallback, XmLDrawnBDrawCB, (XtPointer)dd);
}
XtAddCallback(w, XmNdestroyCallback, XmLDrawnBDestroyCB, (XtPointer)dd);
}
static void
XmLDrawnBDestroyCB(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLDrawnBData *dd;
dd = (XmLDrawnBData *)clientData;
if (dd->type == XmDRAWNB_STRING)
{
if (dd->gc)
{
XFreeGC(XtDisplay(w), dd->gc);
XFreeFont(XtDisplay(w), dd->fontStruct);
}
}
else
XtReleaseGC(w, dd->gc);
free((char *)dd);
}
static void
XmLDrawnBDrawStringCB(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLDrawnBData *dd;
XmFontList fontlist;
XmString str;
XmStringDirection stringDir;
unsigned char drawDir, alignment;
int width, height, xoff, yoff, drawWidth;
Pixel fg;
Dimension highlightThickness;
Dimension shadowThickness, marginWidth, marginHeight;
Dimension marginLeft, marginRight, marginTop, marginBottom;
if (!XtIsRealized(w))
return;
dd = (XmLDrawnBData *)clientData;
XtVaGetValues(w,
XmNlabelString, &str,
NULL);
if (!str && XtName(w))
str = XmStringCreateSimple(XtName(w));
if (!str)
return;
XtVaGetValues(w,
XmNforeground, &fg,
XmNfontList, &fontlist,
XmNalignment, &alignment,
XmNhighlightThickness, &highlightThickness,
XmNshadowThickness, &shadowThickness,
XmNmarginWidth, &marginWidth,
XmNmarginHeight, &marginHeight,
XmNmarginLeft, &marginLeft,
XmNmarginRight, &marginRight,
XmNmarginTop, &marginTop,
XmNmarginBottom, &marginBottom,
NULL);
xoff = highlightThickness + shadowThickness + marginLeft + marginWidth;
yoff = highlightThickness + shadowThickness + marginTop + marginHeight;
width = XtWidth(w) - xoff - xoff + marginLeft - marginRight;
height = XtHeight(w) - yoff - yoff + marginTop - marginBottom;
if (XmIsManager(XtParent(w)))
XtVaGetValues(XtParent(w),
XmNstringDirection, &stringDir,
NULL);
else
stringDir = XmSTRING_DIRECTION_L_TO_R;
switch (dd->dir)
{
case XmDRAWNB_LEFT:
drawDir = XmSTRING_LEFT;
break;
case XmDRAWNB_UP:
drawDir = XmSTRING_UP;
break;
case XmDRAWNB_DOWN:
drawDir = XmSTRING_DOWN;
break;
default:
drawDir = XmSTRING_RIGHT;
break;
}
if (drawDir == XmSTRING_LEFT || drawDir == XmSTRING_RIGHT)
drawWidth = width;
else
drawWidth = height;
if (!dd->gc)
{
dd->gc = XCreateGC(XtDisplay(w), XtWindow(w), 0, NULL);
dd->fontStruct = XLoadQueryFont(XtDisplay(w), "fixed");
if (!dd->fontStruct)
{
XmLWarning(w, "DrawnBDrawString() - FATAL can't load fixed font");
return;
}
XSetFont(XtDisplay(w), dd->gc, dd->fontStruct->fid);
}
XSetForeground(XtDisplay(w), dd->gc, fg);
XmLStringDrawDirection(XtDisplay(w), XtWindow(w), fontlist,
str, dd->gc, xoff, yoff, drawWidth, alignment, stringDir, drawDir);
XmStringFree(str);
}
static void
XmLDrawnBDrawCB(Widget w,
XtPointer clientData,
XtPointer callData)
{
XmLDrawnBData *dd;
XmDrawnButtonWidget b;
/* unsigned char drawDir;*/
/* unsigned char alignment;*/
Display *dpy;
Window win;
GC gc;
XPoint p[2][5];
XSegment seg;
int np[2];
int i, j, temp;
int md, type, dir;
int avgx, avgy, xoff, yoff, st;
if (!XtIsRealized(w))
return;
dd = (XmLDrawnBData *)clientData;
type = dd->type;
dir = dd->dir;
gc = dd->gc;
b = (XmDrawnButtonWidget)w;
win = XtWindow(w);
dpy = XtDisplay(w);
st = b->primitive.shadow_thickness;
i = st * 2 + b->primitive.highlight_thickness * 2;
/* calculate max dimension */
md = XtWidth(w) - i;
if (md > ((int)XtHeight(w) - i))
md = XtHeight(w) - i;
if (md < 4)
return;
xoff = ((int)XtWidth(w) - md) / 2;
yoff = ((int)XtHeight(w) - md) / 2;
np[0] = 0;
np[1] = 0;
switch (type)
{
case XmDRAWNB_SMALLARROW:
p[0][0].x = md / 4;
p[0][0].y = md / 4;
p[0][1].x = md / 4;
p[0][1].y = md - md / 4;
p[0][2].x = md - md / 4;
p[0][2].y = md / 2;
np[0] = 3;
break;
case XmDRAWNB_ARROW:
p[0][0].x = md / 6;
p[0][0].y = md / 6;
p[0][1].x = md / 6;
p[0][1].y = md - md / 6;
p[0][2].x = md - md / 6;
p[0][2].y = md / 2;
np[0] = 3;
break;
case XmDRAWNB_ARROWLINE:
p[0][0].x = md / 5;
p[0][0].y = md / 5;
p[0][1].x = md / 5;
p[0][1].y = md - md / 5;
p[0][2].x = md - md / 5;
p[0][2].y = md / 2;
np[0] = 3;
p[1][0].x = md - md / 5 + 1;
p[1][0].y = md / 5;
p[1][1].x = md - md / 5 + 1;
p[1][1].y = md - md / 5;
p[1][2].x = md - md / 10;
p[1][2].y = md - md / 5;
p[1][3].x = md - md / 10;
p[1][3].y = md / 5;
np[1] = 4;
break;
case XmDRAWNB_DOUBLEARROW:
/* odd major dimensions can give jagged lines */
if (md % 2)
md -= 1;
p[0][0].x = md / 10;
p[0][0].y = md / 10;
p[0][1].x = md / 10;
p[0][1].y = md - md / 10;
p[0][2].x = md / 2;
p[0][2].y = md / 2;
np[0] = 3;
p[1][0].x = md - md / 2;
p[1][0].y = md / 10;
p[1][1].x = md - md / 2;
p[1][1].y = md - md / 10;
p[1][2].x = md - md / 10;
p[1][2].y = md / 2;
np[1] = 3;
break;
case XmDRAWNB_SQUARE:
p[0][0].x = md / 3;
p[0][0].y = md / 3;
p[0][1].x = md / 3;
p[0][1].y = md - md / 3;
p[0][2].x = md - md / 3;
p[0][2].y = md - md / 3;
p[0][3].x = md - md / 3;
p[0][3].y = md / 3;
np[0] = 4;
break;
case XmDRAWNB_DOUBLEBAR:
p[0][0].x = md / 3;
p[0][0].y = md / 4;
p[0][1].x = md / 3;
p[0][1].y = md - md / 4;
p[0][2].x = md / 2 - md / 10;
p[0][2].y = md - md / 4;
p[0][3].x = md / 2 - md / 10;
p[0][3].y = md / 4;
np[0] = 4;
p[1][0].x = md - md / 3;
p[1][0].y = md / 4;
p[1][1].x = md - md / 3;
p[1][1].y = md - md / 4;
p[1][2].x = md - md / 2 + md / 10;
p[1][2].y = md - md / 4;
p[1][3].x = md - md / 2 + md / 10;
p[1][3].y = md / 4;
np[1] = 4;
break;
}
for (i = 0; i < 2; i++)
{
avgx = 0;
avgy = 0;
for (j = 0; j < np[i]; j++)
{
switch (dir)
{
case XmDRAWNB_RIGHT:
/* points unchanged */
break;
case XmDRAWNB_LEFT:
p[i][j].x = md - p[i][j].x - 1;
break;
case XmDRAWNB_UP:
temp = p[i][j].x;
p[i][j].x = p[i][j].y;
p[i][j].y = md - temp;
break;
case XmDRAWNB_DOWN:
temp = p[i][j].x;
p[i][j].x = p[i][j].y;
p[i][j].y = temp;
break;
}
p[i][j].x += xoff;
p[i][j].y += yoff;
avgx += p[i][j].x;
avgy += p[i][j].y;
}
if (!np[i])
continue;
avgx /= np[i];
avgy /= np[i];
XFillPolygon(dpy, win, gc, p[i], np[i], Nonconvex, CoordModeOrigin);
p[i][np[i]].x = p[i][0].x;
p[i][np[i]].y = p[i][0].y;
for (j = 0; j < np[i]; j++)
{
seg.x1 = p[i][j].x;
seg.y1 = p[i][j].y;
seg.x2 = p[i][j + 1].x;
seg.y2 = p[i][j + 1].y;
if ((seg.x1 <= avgx && seg.x2 <= avgx) ||
(seg.y1 <= avgy && seg.y2 <= avgy))
XDrawSegments(dpy, win,
b->primitive.bottom_shadow_GC, &seg, 1);
else
XDrawSegments(dpy, win,
b->primitive.top_shadow_GC, &seg, 1);
}
}
}
#define XmLDrawNODRAW 0
#define XmLDrawNOCLIP 1
#define XmLDrawCLIPPED 2
static int
XmLDrawCalc(Widget w,
Dimension width,
Dimension height,
unsigned char alignment,
XRectangle *rect,
XRectangle *clipRect,
int *x,
int *y)
{
if (rect->width <= 4 || rect->height <= 4 ||
clipRect->width < 3 || clipRect->height < 3 ||
!width || !height ||
!XtIsRealized(w) ||
XmLRectIntersect(rect, clipRect) == XmLRectOutside)
return XmLDrawNODRAW;
if (alignment == XmALIGNMENT_TOP_LEFT ||
alignment == XmALIGNMENT_LEFT ||
alignment == XmALIGNMENT_BOTTOM_LEFT)
*x = rect->x + 2;
else if (alignment == XmALIGNMENT_TOP ||
alignment == XmALIGNMENT_CENTER ||
alignment == XmALIGNMENT_BOTTOM)
*x = rect->x + ((int)rect->width - (int)width) / 2;
else
*x = rect->x + rect->width - width - 2;
if (alignment == XmALIGNMENT_TOP ||
alignment == XmALIGNMENT_TOP_LEFT ||
alignment == XmALIGNMENT_TOP_RIGHT)
*y = rect->y + 2;
else if (alignment == XmALIGNMENT_LEFT ||
alignment == XmALIGNMENT_CENTER ||
alignment == XmALIGNMENT_RIGHT)
*y = rect->y + ((int)rect->height - (int)height) / 2;
else
*y = rect->y + rect->height - height - 2;
if (clipRect->x == rect->x &&
clipRect->y == rect->y &&
clipRect->width == rect->width &&
clipRect->height == rect->height &&
(int)width + 4 <= (int)clipRect->width &&
(int)height + 4 <= (int)clipRect->height)
return XmLDrawNOCLIP;
return XmLDrawCLIPPED;
}
void
XmLDrawToggle(Widget w,
Boolean state,
Dimension size,
unsigned char alignment,
GC gc,
Pixel backgroundColor,
Pixel topColor,
Pixel bottomColor,
Pixel checkColor,
XRectangle *rect,
XRectangle *clipRect)
{
Display *dpy;
Window win;
XPoint point[5];
int x, y, cx[3], cy[4], drawType;
drawType = XmLDrawCalc(w, size, size, alignment, rect, clipRect, &x, &y);
if (size < 3 || drawType == XmLDrawNODRAW)
return;
dpy = XtDisplay(w);
win = XtWindow(w);
if (drawType == XmLDrawCLIPPED)
XSetClipRectangles(dpy, gc, 0, 0, clipRect, 1, Unsorted);
/* background */
XSetForeground(dpy, gc, backgroundColor);
XFillRectangle(dpy, win, gc, x, y, size, size);
/* box shadow */
XSetForeground(dpy, gc, topColor);
point[0].x = x;
point[0].y = y + size - 1;
point[1].x = x;
point[1].y = y;
point[2].x = x + size - 1;
point[2].y = y;
XDrawLines(dpy, win, gc, point, 3, CoordModeOrigin);
point[1].x = x + size - 1;
point[1].y = y + size - 1;
XSetForeground(dpy, gc, bottomColor);
XDrawLines(dpy, win, gc, point, 3, CoordModeOrigin);
if (state == True)
{
/* check */
cx[0] = x + 1;
cx[1] = x + (((int)size - 3) / 3) + 1;
cx[2] = x + size - 2;
cy[0] = y + 1;
cy[1] = y + (((int)size - 3) / 2) + 1;
cy[2] = y + ((((int)size - 3) * 2) / 3) + 1;
cy[3] = y + size - 2;
point[0].x = cx[0];
point[0].y = cy[1];
point[1].x = cx[1];
point[1].y = cy[3];
point[2].x = cx[2];
point[2].y = cy[0];
point[3].x = cx[1];
point[3].y = cy[2];
point[4].x = point[0].x;
point[4].y = point[0].y;
XSetForeground(dpy, gc, checkColor);
XFillPolygon(dpy, win, gc, point, 4, Nonconvex, CoordModeOrigin);
XDrawLines(dpy, win, gc, point, 5, CoordModeOrigin);
}
if (drawType == XmLDrawCLIPPED)
XSetClipMask(dpy, gc, None);
}
int
XmLRectIntersect(XRectangle *r1,
XRectangle *r2)
{
if (!r1->width || !r1->height || !r2->width || !r2->height)
return XmLRectOutside;
if (r1->x + (int)r1->width - 1 < r2->x ||
r1->x > r2->x + (int)r2->width - 1 ||
r1->y + (int)r1->height - 1 < r2->y ||
r1->y > r2->y + (int)r2->height - 1)
return XmLRectOutside;
if (r1->x >= r2->x &&
r1->x + (int)r1->width <= r2->x + (int)r2->width &&
r1->y >= r2->y &&
r1->y + (int)r1->height <= r2->y + (int)r2->height)
return XmLRectInside; /* r1 inside r2 */
return XmLRectPartial;
}
XmFontList
XmLFontListCopyDefault(Widget widget)
{
Widget parent;
XFontStruct *font;
XmFontList fontList, fl;
fontList = 0;
parent = XtParent(widget);
while (parent)
{
fl = 0;
if (XmIsVendorShell(parent) || XmIsMenuShell(parent))
XtVaGetValues(parent, XmNdefaultFontList, &fl, NULL);
else if (XmIsBulletinBoard(parent))
XtVaGetValues(parent, XmNbuttonFontList, &fl, NULL);
if (fl)
{
fontList = XmFontListCopy(fl);
parent = 0;
}
if (parent)
parent = XtParent(parent);
}
if (!fontList)
{
font = XLoadQueryFont(XtDisplay(widget), "fixed");
if (!font)
XmLWarning(widget,
"FontListCopyDefault() - FATAL ERROR - can't load fixed font");
fontList = XmFontListCreate(font, XmSTRING_DEFAULT_CHARSET);
}
return fontList;
}
void
XmLFontListGetDimensions(XmFontList fontList,
short *width,
short *height,
Boolean useAverageWidth)
{
XmStringCharSet charset;
XmFontContext context;
XFontStruct *fs;
short w, h;
#if XmVersion < 2000
/* --- begin code to work around Motif 1.x internal bug */
typedef struct {
XmFontList nextFontList;
Boolean unused;
} XmFontListContextRec;
typedef struct {
XFontStruct *font;
XmStringCharSet unused;
} XmFontListRec;
XmFontList nextFontList;
#endif
*width = 0;
*height = 0;
if (XmFontListInitFontContext(&context, fontList))
{
while (1)
{
#if XmVersion < 2000
/* --- begin code to work around Motif internal bug */
/* --- this code must be removed for Motif 2.0 */
nextFontList = ((XmFontListContextRec *)context)->nextFontList;
if (!nextFontList)
break;
if (!((XmFontListRec *)nextFontList)->font)
break;
/* --- end Motif workaround code */
#endif
if (XmFontListGetNextFont(context, &charset, &fs) == False)
break;
XtFree(charset);
if (useAverageWidth == True)
XmLFontGetAverageWidth(fs, &w);
else
w = fs->max_bounds.width;
h = fs->max_bounds.ascent + fs->max_bounds.descent;
if (*height < h)
*height = h;
if (*width < w)
*width = w;
}
XmFontListFreeFontContext(context);
}
}
static void
XmLFontGetAverageWidth(XFontStruct *fs,
short *width)
{
long aw, n;
int r, c, mm, i;
XCharStruct *cs;
n = 0;
aw = 0;
mm = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1;
for (r = fs->min_byte1; r <= fs->max_byte1; r++)
for (c = fs->min_char_or_byte2; c <= fs->max_char_or_byte2; c++)
{
if (!fs->per_char)
continue;
i = ((r - fs->min_byte1) * mm) + (c - fs->min_char_or_byte2);
cs = &fs->per_char[i];
if (!cs->width)
continue;
aw += cs->width;
n++;
}
if (n)
aw = aw / n;
else
aw = fs->min_bounds.width;
*width = (short)aw;
}
int _XmLKey;
void XmLInitialize(void)
{
static int first = 1;
if (!first)
return;
first = 0;
#ifdef XmLEVAL
fprintf(stderr, "XmL: This is an evalation version of the Microline\n");
fprintf(stderr, "XmL: Widget Library. Some features are disabled.\n");
#endif
#ifdef XmLJAVA
if (_XmLKey != 444)
{
fprintf(stderr, "XmL: Error: This version of the library will only");
fprintf(stderr, "XmL: work with JAVA.\n");
exit(0);
}
#endif
}
int
XmLMessageBox(Widget w,
char *string,
Boolean okOnly)
{
int status = 0;
Widget dialog, shell;
Arg args[3];
XtAppContext context;
XmString str, titleStr;
String shellTitle;
Atom WM_DELETE_WINDOW;
str = XmStringCreateLtoR(string, XmSTRING_DEFAULT_CHARSET);
XtSetArg(args[0], XmNmessageString, str);
XtSetArg(args[1], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL);
shell = XmLShellOfWidget(w);
if (shell)
XtVaGetValues(shell, XmNtitle, &shellTitle, NULL);
if (shell && shellTitle)
titleStr = XmStringCreateLtoR(shellTitle,
XmSTRING_DEFAULT_CHARSET);
else
titleStr = XmStringCreateSimple("Notice");
XtSetArg(args[2], XmNdialogTitle, titleStr);
if (okOnly == True)
dialog = XmCreateMessageDialog(XtParent(w), "popup", args, 3);
else
dialog = XmCreateQuestionDialog(XtParent(w), "popup", args, 3);
WM_DELETE_WINDOW = XmInternAtom(XtDisplay(w), "WM_DELETE_WINDOW",
False);
XmAddWMProtocolCallback(shell, WM_DELETE_WINDOW, XmLMessageBoxWMDelete,
(caddr_t)&status);
XmStringFree(str);
XmStringFree(titleStr);
XtAddCallback(dialog, XmNokCallback, XmLMessageBoxResponse,
(XtPointer)&status);
if (okOnly == True)
{
XtUnmanageChild(XmMessageBoxGetChild(dialog,
XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(dialog,
XmDIALOG_HELP_BUTTON));
}
else
{
XtAddCallback(dialog, XmNcancelCallback, XmLMessageBoxResponse,
(XtPointer)&status);
XtAddCallback(dialog, XmNhelpCallback, XmLMessageBoxResponse,
(XtPointer)&status);
}
XtManageChild(dialog);
context = XtWidgetToApplicationContext(w);
while (!status || XtAppPending(context))
XtAppProcessEvent(context, XtIMAll);
XtDestroyWidget(dialog);
return status;
}
static void
XmLMessageBoxWMDelete(Widget w,
XtPointer clientData,
XtPointer callData)
{
int *status = (int *)clientData;
*status = 1;
}
static void
XmLMessageBoxResponse(Widget w,
XtPointer clientData,
XtPointer callData)
{
int *status = (int *)clientData;
XmAnyCallbackStruct *reason;
reason = (XmAnyCallbackStruct *)callData;
switch (reason->reason)
{
case XmCR_OK:
*status = 1;
break;
case XmCR_CANCEL:
*status = 2;
break;
case XmCR_HELP:
*status = 3;
break;
}
}
void
XmLPixmapDraw(Widget w,
Pixmap pixmap,
Pixmap pixmask,
int pixmapWidth,
int pixmapHeight,
unsigned char alignment,
GC gc,
XRectangle *rect,
XRectangle *clipRect)
{
Display *dpy;
Window win;
int px, py, x, y, width, height, drawType;
if (pixmap == XmUNSPECIFIED_PIXMAP)
return;
dpy = XtDisplay(w);
win = XtWindow(w);
width = pixmapWidth;
height = pixmapHeight;
if (!width || !height)
{
alignment = XmALIGNMENT_TOP_LEFT;
width = clipRect->width - 4;
height = clipRect->height - 4;
}
drawType = XmLDrawCalc(w, width, height, alignment,
rect, clipRect, &x, &y);
if (drawType == XmLDrawNODRAW)
return;
px = 0;
py = 0;
/* clip top */
if (clipRect->y > y && clipRect->y < y + height - 1)
{
py = clipRect->y - y;
y += py;
height -= py;
}
/* clip bottom */
if (clipRect->y + (int)clipRect->height - 1 >= y &&
clipRect->y + (int)clipRect->height - 1 <= y + height - 1)
height = clipRect->y + clipRect->height - y;
/* clip left */
if (clipRect->x > x && clipRect->x < x + width - 1)
{
px = clipRect->x - x;
x += px;
width -= px;
}
/* clip right */
if (clipRect->x + (int)clipRect->width - 1 >= x &&
clipRect->x + (int)clipRect->width - 1 <= x + width - 1)
width = clipRect->x + clipRect->width - x;
if (pixmask != XmUNSPECIFIED_PIXMAP)
{
XSetClipMask(dpy, gc, pixmask);
XSetClipOrigin(dpy, gc, x - px, y - py);
}
XSetGraphicsExposures(dpy, gc, False);
XCopyArea(dpy, pixmap, win, gc, px, py, width, height, x, y);
XSetGraphicsExposures(dpy, gc, True);
if (pixmask != XmUNSPECIFIED_PIXMAP)
{
XSetClipMask(dpy, gc, None);
XSetClipOrigin(dpy, gc, 0, 0);
}
}
Widget
XmLShellOfWidget(Widget w)
{
while(1)
{
if (!w)
return 0;
if (XtIsSubclass(w, shellWidgetClass))
return w;
w = XtParent(w);
}
}
static XmLSortCompareFunc XmLSortCompare;
static int XmLSortEleSize;
static void *XmLSortUserData;
void
XmLSort(void *base,
int numItems,
unsigned int itemSize,
XmLSortCompareFunc compare,
void *userData)
{
XmLSortCompareFunc oldCompare;
int oldEleSize;
void *oldUserData;
char *lvec, *rvec;
if (numItems < 2)
return;
/* for sorts within a sort compare function, we must
save any global sort variables on the local stack
and restore them when finished */
oldCompare = XmLSortCompare;
oldEleSize = XmLSortEleSize;
oldUserData = XmLSortUserData;
XmLSortCompare = compare;
XmLSortEleSize = itemSize;
XmLSortUserData = userData;
lvec = (char *)base;
rvec = lvec + (numItems - 1) * itemSize;
XmLSortFunc(lvec, rvec);
XmLSortCompare = oldCompare;
XmLSortEleSize = oldEleSize;
XmLSortUserData = oldUserData;
}
#define SWAP(p1, p2) \
{ \
if (p1 != p2) \
{ \
int zi; \
char zc; \
for (zi = 0; zi < XmLSortEleSize; zi++) \
{ \
zc = (p1)[zi]; \
(p1)[zi] = (p2)[zi]; \
(p2)[zi] = zc; \
} \
}\
}
static void
XmLSortFunc(char *lvec,
char *rvec)
{
int i;
char *nlvec, *nrvec, *pvec;
start:
i = (*XmLSortCompare)(XmLSortUserData, lvec, rvec);
/* two item sort */
if (rvec == lvec + XmLSortEleSize)
{
if (i > 0)
SWAP(lvec, rvec)
return;
}
/* find mid of three items */
pvec = lvec + ((rvec - lvec) / (XmLSortEleSize * 2)) * XmLSortEleSize;
if (i < 0)
{
i = (*XmLSortCompare)(XmLSortUserData, lvec, pvec);
if (i > 0)
pvec = lvec;
else if (i == 0)
pvec = rvec;
}
else if (i > 0)
{
i = (*XmLSortCompare)(XmLSortUserData, rvec, pvec);
if (i > 0)
pvec = rvec;
else if (i == 0)
pvec = lvec;
}
else
{
pvec = lvec + XmLSortEleSize;
while (1)
{
i = (*XmLSortCompare)(XmLSortUserData, lvec, pvec);
if (i < 0)
break;
else if (i > 0)
{
pvec = lvec;
break;
}
if (pvec == rvec)
return;
pvec += XmLSortEleSize;
}
}
/* partition the set */
nlvec = lvec;
nrvec = rvec;
while (1)
{
if (pvec == nrvec)
pvec = nlvec;
else if (pvec == nlvec)
pvec = nrvec;
SWAP(nrvec, nlvec)
while ((*XmLSortCompare)(XmLSortUserData, nlvec, pvec) < 0)
nlvec += XmLSortEleSize;
while ((*XmLSortCompare)(XmLSortUserData, nrvec, pvec) >= 0)
nrvec -= XmLSortEleSize;
if (nlvec > nrvec)
break;
}
/* sort partitioned sets */
if (lvec < nlvec - XmLSortEleSize)
XmLSortFunc(lvec, nlvec - XmLSortEleSize);
if (nlvec < rvec)
{
lvec = nlvec;
goto start;
}
}
void
XmLStringDraw(Widget w,
XmString string,
XmStringDirection stringDir,
XmFontList fontList,
unsigned char alignment,
GC gc,
XRectangle *rect,
XRectangle *clipRect)
{
Display *dpy;
Window win;
Dimension width, height;
int x, y, drawType;
unsigned char strAlignment;
if (!string)
return;
dpy = XtDisplay(w);
win = XtWindow(w);
XmStringExtent(fontList, string, &width, &height);
drawType = XmLDrawCalc(w, width, height, alignment,
rect, clipRect, &x, &y);
if (drawType == XmLDrawNODRAW)
return;
x = rect->x + 2;
if (alignment == XmALIGNMENT_LEFT ||
alignment == XmALIGNMENT_TOP_LEFT ||
alignment == XmALIGNMENT_BOTTOM_LEFT)
strAlignment = XmALIGNMENT_BEGINNING;
else if (alignment == XmALIGNMENT_CENTER ||
alignment == XmALIGNMENT_TOP ||
alignment == XmALIGNMENT_BOTTOM)
if (width <= rect->width - 4)
strAlignment = XmALIGNMENT_CENTER;
else
strAlignment = XmALIGNMENT_BEGINNING;
else
strAlignment = XmALIGNMENT_END;
/* XmStringDraw clipping doesnt work in all cases
so we use a clip region for clipping */
if (drawType == XmLDrawCLIPPED)
XSetClipRectangles(dpy, gc, 0, 0, clipRect, 1, Unsorted);
XmStringDraw(dpy, win, fontList, string, gc,
x, y, rect->width - 4, strAlignment, stringDir, clipRect);
if (drawType == XmLDrawCLIPPED)
XSetClipMask(dpy, gc, None);
}
void
XmLStringDrawDirection(Display *dpy,
Window win,
XmFontList fontlist,
XmString string,
GC gc,
int x,
int y,
Dimension width,
unsigned char alignment,
unsigned char layout_direction,
unsigned char drawing_direction)
{
Screen *screen;
XFontStruct *fontStruct;
XImage *sourceImage, *destImage;
Pixmap pixmap;
GC pixmapGC;
/* int sourceWidth, sourceHeight;*/
int destWidth, destHeight;
int stringWidth, stringHeight;
int i, j, bytesPerLine;
Dimension dW, dH;
char *data;
screen = DefaultScreenOfDisplay(dpy);
XmStringExtent(fontlist, string, &dW, &dH);
stringWidth = (int)dW;
stringHeight = (int)dH;
if (!stringWidth || !stringHeight)
return;
/* draw string into 1 bit deep pixmap */
pixmap = XCreatePixmap(dpy, win, stringWidth, stringHeight, 1);
pixmapGC = XCreateGC(dpy, pixmap, 0, NULL);
fontStruct = XLoadQueryFont(dpy, "fixed");
if (!fontStruct)
{
fprintf(stderr, "XmLStringDrawDirection: error - ");
fprintf(stderr, "can't load fixed font\n");
return;
}
XSetFont(dpy, pixmapGC, fontStruct->fid);
XSetBackground(dpy, pixmapGC, 0L);
XSetForeground(dpy, pixmapGC, 0L);
XFillRectangle(dpy, pixmap, pixmapGC, 0, 0, stringWidth, stringHeight);
XSetForeground(dpy, pixmapGC, 1L);
XmStringDraw(dpy, pixmap, fontlist, string, pixmapGC, 0, 0, stringWidth,
XmALIGNMENT_BEGINNING, layout_direction, 0);
XFreeFont(dpy, fontStruct);
/* copy 1 bit deep pixmap into source image */
sourceImage = XGetImage(dpy, pixmap, 0, 0, stringWidth, stringHeight,
1, XYPixmap);
XFreePixmap(dpy, pixmap);
/* draw rotated text into destination image */
if (drawing_direction == XmSTRING_UP || drawing_direction == XmSTRING_DOWN)
{
destWidth = stringHeight;
destHeight = stringWidth;
}
else
{
destWidth = stringWidth;
destHeight = stringHeight;
}
bytesPerLine = (destWidth - 1) / 8 + 1;
data = (char *)malloc(bytesPerLine * destHeight);
destImage = XCreateImage(dpy, DefaultVisualOfScreen(screen),
1, XYBitmap, 0, data, destWidth, destHeight, 8, 0);
for (i = 0; i < stringWidth; i++)
for (j = 0; j < stringHeight; j++)
{
if (drawing_direction == XmSTRING_UP)
XPutPixel(destImage, j, i,
XGetPixel(sourceImage, stringWidth - i - 1, j));
else if (drawing_direction == XmSTRING_DOWN)
XPutPixel(destImage, stringHeight - j - 1, stringWidth - i - 1,
XGetPixel(sourceImage, stringWidth - i - 1, j));
else if (drawing_direction == XmSTRING_LEFT)
XPutPixel(destImage, i, stringHeight - j - 1,
XGetPixel(sourceImage, stringWidth - i - 1, j));
else
XPutPixel(destImage, i, j,
XGetPixel(sourceImage, i, j));
}
XDestroyImage(sourceImage);
/* copy rotated image into 1 bit deep pixmap */
pixmap = XCreatePixmap(dpy, win, destWidth, destHeight, 1);
XPutImage(dpy, pixmap, pixmapGC, destImage, 0, 0, 0, 0,
destWidth, destHeight);
XDestroyImage(destImage);
XFreeGC(dpy, pixmapGC);
/* adjust position for alignment */
if (drawing_direction == XmSTRING_UP || drawing_direction == XmSTRING_DOWN)
{
if (alignment == XmALIGNMENT_BEGINNING)
;
else if (alignment == XmALIGNMENT_CENTER)
y += width / 2 - stringWidth / 2;
else if (alignment == XmALIGNMENT_END)
y += (int)width - stringWidth;
}
else
{
if (alignment == XmALIGNMENT_BEGINNING)
;
else if (alignment == XmALIGNMENT_CENTER)
x += width / 2 - stringWidth / 2;
else if (alignment == XmALIGNMENT_END)
x += (int)width - stringWidth;
}
/* draw the pixmap as a stipple in the window */
XSetStipple(dpy, gc, pixmap);
XSetFillStyle(dpy, gc, FillStippled);
XSetTSOrigin(dpy, gc, x % destWidth, y % destHeight);
XFillRectangle(dpy, win, gc, x, y, destWidth, destHeight);
XFreePixmap(dpy, pixmap);
XSetFillStyle(dpy, gc, FillSolid);
}
void
XmLWarning(Widget w,
char *msg)
{
XtAppContext app;
char s[512], *cname, *name;
WidgetClass c;
app = XtWidgetToApplicationContext(w);
name = XtName(w);
if (!name)
name = "[No Name]";
c = XtClass(w);
cname = c->core_class.class_name;
if (!cname)
cname = "[No Class]";
sprintf(s, "%s: %s: %s\n", cname, name, msg);
XtAppWarning(app, s);
}
nedit-5.6.orig/Microline/XmL/XmL.h0000644000175000017500000005563710107542711015422 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#ifndef XmLH
#define XmLH
#include
#if defined(__cplusplus) || defined(c_plusplus)
#define XmL_CPP 1
#endif
#if defined(_STDC_) || defined(__STDC__) || defined(XmL_CPP)
#ifndef _NO_PROTO
#define XmL_ANSIC 1
#endif
#endif
#define XmLVERSION_301
#ifdef XmL_CPP
extern "C" {
#endif
/* shared resources */
#define XmNautoSelect "autoSelect"
#define XmCAutoSelect "AutoSelect"
#define XmNblankBackground "blankBackground"
#define XmCBlankBackground "BlankBackground"
#define XmNdebugLevel "debugLevel"
#define XmCDebugLevel "DebugLevel"
/* Folder resources */
#define XmNacceptResize "acceptResize"
#define XmCAcceptResize "AcceptResize"
#define XmNactiveTab "activeTab"
#define XmCActiveTab "ActiveTab"
#define XmNblankBackgroundPixmap "blankBackgroundPixmap"
#define XmCBlankBackgroundPixmap "BlankBackgroundPixmap"
#define XmNcornerDimension "cornerDimension"
#define XmCCornerDimension "CornerDimension"
#define XmNcornerStyle "cornerStyle"
#define XmCCornerStyle "CornerStyle"
#define XmRCornerStyle "CornerStyle"
#define XmNinactiveBackground "inactiveBackground"
#define XmCInactiveBackground "InactiveBackground"
#define XmNinactiveForeground "inactiveForeground"
#define XmCInactiveForeground "InactiveForeground"
#define XmNpixmapMargin "pixmapMargin"
#define XmCPixmapMargin "PixmapMargin"
#define XmCFolderResizePolicy "FolderResizePolicy"
#define XmRFolderResizePolicy "FolderResizePolicy"
#define XmNrotateWhenLeftRight "rotateWhenLeftRight"
#define XmCRotateWhenLeftRight "RotateWhenLeftRight"
#define XmNtabBarHeight "tabBarHeight"
#define XmCTabBarHeight "TabBarHeight"
#define XmNminTabWidth "minTabWidth"
#define XmCminTabWidth "MinTabWidth"
#define XmNmaxTabWidth "maxTabWidth"
#define XmCmaxTabWidth "MaxTabWidth"
#define XmNtabCount "tabCount"
#define XmCTabCount "TabCount"
#define XmNtabPlacement "tabPlacement"
#define XmCTabPlacement "TabPlacement"
#define XmRTabPlacement "TabPlacement"
#define XmNtabsPerRow "tabsPerRow"
#define XmCTabsPerRow "TabsPerRow"
#define XmNtabTranslations "tabTranslations"
#define XmNtabWidgetList "tabWidgetList"
#define XmNtabWidgetClass "tabWidgetClass"
#define XmCTabWidgetClass "TabWidgetClass"
/* Folder Constraint resources */
#define XmNtabFreePixmaps "tabFreePixmaps"
#define XmCTabFreePixmaps "TabFreePixmaps"
#define XmNtabInactivePixmap "tabInactivePixmap"
#define XmCTabInactivePixmap "TabInactivePixmap"
#define XmNtabManagedName "tabManagedName"
#define XmCTabManagedName "TabManagedName"
#define XmNtabManagedWidget "tabManagedWidget"
#define XmCTabManagedWidget "TabManagedWidget"
#define XmNtabPixmap "tabPixmap"
#define XmCTabPixmap "TabPixmap"
/* Folder callbacks */
typedef struct
{
int reason;
XEvent *event;
int pos;
int allowActivate;
int layoutNeeded;
} XmLFolderCallbackStruct;
/* Folder defines */
#define XmCORNER_NONE 0
#define XmCORNER_LINE 1
#define XmCORNER_ARC 2
#define XmFOLDER_TOP 0
#define XmFOLDER_LEFT 1
#define XmFOLDER_BOTTOM 2
#define XmFOLDER_RIGHT 3
#define XmRESIZE_STATIC 10
#define XmRESIZE_DYNAMIC 11
#define XmRESIZE_PACK 12
/* Grid resources */
#define XmNaddCallback "addCallback"
#define XmNallowColumnHide "allowColumnHide"
#define XmCAllowColumnHide "AllowColumnHide"
#define XmNallowColumnResize "allowColumnResize"
#define XmCAllowColumnResize "AllowColumnResize"
#define XmNallowDragSelected "allowDragSelected"
#define XmCAllowDragSelected "AllowDragSelected"
#define XmNallowDrop "allowDrop"
#define XmCAllowDrop "AllowDrop"
#define XmNallowRowHide "allowRowHide"
#define XmCAllowRowHide "AllowRowHide"
#define XmNallowRowResize "allowRowResize"
#define XmCAllowRowResize "AllowRowResize"
#define XmNbottomFixedCount "bottomFixedCount"
#define XmCBottomFixedCount "BottomFixedCount"
#define XmNbottomFixedMargin "bottomFixedMargin"
#define XmCBottomFixedMargin "BottomFixedMargin"
#define XmNcellDefaults "cellDefaults"
#define XmCCellDefaults "CellDefaults"
#define XmNcellDrawCallback "cellDrawCallback"
#define XmNcellDropCallback "cellDropCallback"
#define XmNcellFocusCallback "cellFocusCallback"
#define XmNcellPasteCallback "cellPasteCallback"
#define XmNdeleteCallback "deleteCallback"
#define XmNdeselectCallback "deselectCallback"
#define XmNeditCallback "editCallback"
#define XmNeditTranslations "editTranslations"
#define XmNfooterColumns "footerColumns"
#define XmCFooterColumns "FooterColumns"
#define XmNfooterRows "footerRows"
#define XmCFooterRows "FooterRows"
#define XmNglobalPixmapHeight "globalPixmapHeight"
#define XmCGlobalPixmapHeight "GlobalPixmapHeight"
#define XmNglobalPixmapWidth "globalPixmapWidth"
#define XmCGlobalPixmapWidth "GlobalPixmapWidth"
#define XmCGridSelectionPolicy "GridSelectionPolicy"
#define XmRGridSelectionPolicy "GridSelectionPolicy"
#define XmRGridSizePolicy "GridSizePolicy"
#define XmNheadingColumns "headingColumns"
#define XmCHeadingColumns "HeadingColumns"
#define XmNheadingRows "headingRows"
#define XmCHeadingRows "HeadingRows"
#define XmNhiddenColumns "hiddenColumns"
#define XmCHiddenColumns "HiddenColumns"
#define XmNhiddenRows "hiddenRows"
#define XmCHiddenRows "HiddenRows"
#define XmNhighlightRowMode "highlightRowMode"
#define XmCHighlightRowMode "HighlightRowMode"
#define XmNhorizontalSizePolicy "horizontalSizePolicy"
#define XmCHorizontalSizePolicy "HorizontalSizePolicy"
#define XmNhsbDisplayPolicy "hsbDisplayPolicy"
#define XmCHsbDisplayPolicy "HsbDisplayPolicy"
#define XmNimmediateDraw "immediateDraw"
#define XmCImmediateDraw "ImmediateDraw"
#define XmNlayoutFrozen "layoutFrozen"
#define XmCLayoutFrozen "LayoutFrozen"
#define XmNleftFixedCount "leftFixedCount"
#define XmCLeftFixedCount "LeftFixedCount"
#define XmNleftFixedMargin "leftFixedMargin"
#define XmCLeftFixedMargin "LeftFixedMargin"
#define XmNrightFixedCount "rightFixedCount"
#define XmCRightFixedCount "RightFixedCount"
#define XmNrightFixedMargin "rightFixedMargin"
#define XmCRightFixedMargin "RightFixedMargin"
#define XmNscrollBarMargin "scrollBarMargin"
#define XmCScrollBarMargin "ScrollBarMargin"
#define XmNscrollCallback "scrollCallback"
#define XmNscrollColumn "scrollColumn"
#define XmCScrollColumn "ScrollColumn"
#define XmNscrollRow "scrollRow"
#define XmCScrollRow "ScrollRow"
#define XmNsimpleHeadings "simpleHeadings"
#define XmCSimpleHeadings "SimpleHeadings"
#define XmNsimpleWidths "simpleWidths"
#define XmCSimpleWidths "SimpleWidths"
#ifndef XmNselectCallback /* OM 2.2.3 defines this too. */
#define XmNselectCallback "selectCallback"
#endif
#define XmNselectForeground "selectForeground"
#define XmCSelectForeground "SelectForeground"
#define XmNselectBackground "selectBackground"
#define XmCSelectBackground "SelectBackground"
#define XmNshadowRegions "shadowRegions"
#define XmCShadowRegions "ShadowRegions"
#define XmNtextWidget "textWidget"
#define XmCTextWidget "TextWidget"
#define XmNtoggleTopColor "toggleTopColor"
#define XmCToggleTopColor "ToggleTopColor"
#define XmNtoggleBottomColor "toggleBottomColor"
#define XmCToggleBottomColor "ToggleBottomColor"
#define XmNtoggleSize "toggleSize"
#define XmCToggleSize "ToggleSize"
#define XmNtopFixedCount "topFixedCount"
#define XmCTopFixedCount "TopFixedCount"
#define XmNtopFixedMargin "topFixedMargin"
#define XmCTopFixedMargin "TopFixedMargin"
#define XmNtraverseTranslations "traverseTranslations"
#define XmNuseAverageFontWidth "useAverageFontWidth"
#define XmCUseAverageFontWidth "UseAverageFontWidth"
#define XmNverticalSizePolicy "verticalSizePolicy"
#define XmCVerticalSizePolicy "VerticalSizePolicy"
#define XmNvisibleColumns "visibleColumns"
#define XmCVisibleColumns "VisibleColumns"
#define XmNvisibleRows "visibleRows"
#define XmCVisibleRows "VisibleRows"
#define XmNvsbDisplayPolicy "vsbDisplayPolicy"
#define XmCVsbDisplayPolicy "VsbDisplayPolicy"
#define XmNiconSpacing "iconSpacing"
#define XmCIconSpacing "IconSpacing"
/* XFE Additions */
#define XmNhideUnhideButtons "hideUnhideButtons"
#define XmCHideUnhideButtons "HideUnhideButtons"
#define XmNsingleClickActivation "singleClickActivation"
#define XmCSingleClickActivation "SingleClickActivation"
#define XmNuseTextWidget "useTextWidget"
#define XmCUseTextWidget "UseTextWidget"
#define XmNcolumnSortType "columnSortType"
#define XmCColumnSortType "ColumnSortType"
#define XmRColumnSortType "ColumnSortType"
#if 0
#define XmNhideButtonTranslations "hideButtonTranslations"
#define XmNunhideButtonTranslations "unhideButtonTranslations"
#endif /*0*/
#define XmNminColumnWidth "minColumnWidth"
#define XmCMinColumnWidth "MinColumnWidth"
#define XmNenterCellCallback "enterCellCallback"
#define XmNleaveCellCallback "leaveCellCallback"
#define XmNenterGridCallback "enterGridCallback"
#define XmNleaveGridCallback "leaveGridCallback"
/* Grid Row/Column/Cell resources */
#define XmNrow "row"
#define XmCGridRow "row"
#define XmNrowHeight "rowHeight"
#define XmCRowHeight "RowHeight"
#define XmNrowPtr "rowPtr"
#define XmNrowRangeEnd "rowRangeEnd"
#define XmCRowRangeEnd "RowRangeEnd"
#define XmNrowRangeStart "rowRangeStart"
#define XmCRowRangeStart "RowRangeStart"
#define XmNrowSizePolicy "rowSizePolicy"
#define XmCRowSizePolicy "RowSizePolicy"
#define XmNrowStep "rowStep"
#define XmCRowStep "RowStep"
#define XmNrowType "rowType"
#define XmCRowType "RowType"
#define XmRRowType "RowType"
#define XmNrowUserData "rowUserData"
#define XmNcolumn "column"
#define XmCGridColumn "Column"
#define XmNcolumnPtr "columnPtr"
#define XmNcolumnRangeEnd "columnRangeEnd"
#define XmCColumnRangeEnd "ColumnRangeEnd"
#define XmNcolumnRangeStart "columnRangeStart"
#define XmCColumnRangeStart "ColumnRangeStart"
#define XmNcolumnResizable "columnResizable"
#define XmCColumnResizable "ColumnResizable"
#define XmNcolumnSizePolicy "columnSizePolicy"
#define XmCColumnSizePolicy "ColumnSizePolicy"
#define XmNcolumnHidden "columnHidden"
#define XmCColumnHidden "ColumnHidden"
#define XmNcolumnStep "columnStep"
#define XmCColumnStep "ColumnStep"
#define XmNcolumnType "columnType"
#define XmCColumnType "ColumnType"
#define XmRColumnType "ColumnType"
#define XmNcolumnWidth "columnWidth"
#define XmCColumnWidth "ColumnWidth"
#define XmNcolumnUserData "columnUserData"
#define XmNcellAlignment "cellAlignment"
#define XmCCellAlignment "CellAlignment"
#define XmRCellAlignment "CellAlignment"
#define XmNcellBackground "cellBackground"
#define XmCCellBackground "CellBackground"
#define XmRCellBorderType "CellBorderType"
#define XmNcellBottomBorderType "cellBottomBorderType"
#define XmCCellBottomBorderType "CellBottomBorderType"
#define XmNcellBottomBorderColor "cellBottomBorderColor"
#define XmCCellBottomBorderColor "CellBottomBorderColor"
#define XmNcellColumnSpan "cellColumnSpan"
#define XmCCellColumnSpan "CellColumnSpan"
#define XmNcellEditable "cellEditable"
#define XmCCellEditable "CellEditable"
#define XmNcellForeground "cellForeground"
#define XmCCellForeground "CellForeground"
#define XmNcellFontList "cellFontList"
#define XmCCellFontList "CellFontList"
#define XmNcellLeftBorderType "cellLeftBorderType"
#define XmCCellLeftBorderType "CellLeftBorderType"
#define XmNcellLeftBorderColor "cellLeftBorderColor"
#define XmCCellLeftBorderColor "CellLeftBorderColor"
#define XmNcellMarginBottom "cellMarginBottom"
#define XmCCellMarginBottom "CellMarginBottom"
#define XmNcellMarginLeft "cellMarginLeft"
#define XmCCellMarginLeft "CellMarginLeft"
#define XmNcellMarginRight "cellMarginRight"
#define XmCCellMarginRight "CellMarginRight"
#define XmNcellMarginTop "cellMarginTop"
#define XmCCellMarginTop "CellMarginTop"
#define XmNcellPixmap "cellPixmap"
#define XmCCellPixmap "CellPixmap"
#define XmNcellPixmapMask "cellPixmapMask"
#define XmCCellPixmapMask "CellPixmapMask"
#define XmNcellRightBorderType "cellRightBorderType"
#define XmCCellRightBorderType "CellRightBorderType"
#define XmNcellRightBorderColor "cellRightBorderColor"
#define XmCCellRightBorderColor "CellRightBorderColor"
#define XmNcellRowSpan "cellRowSpan"
#define XmCCellRowSpan "CellRowSpan"
#define XmNcellString "cellString"
#define XmNcellToggleSet "cellToggleSet"
#define XmCCellToggleSet "CellToggleSet"
#define XmNcellTopBorderType "cellTopBorderType"
#define XmCCellTopBorderType "CellTopBorderType"
#define XmNcellTopBorderColor "cellTopBorderColor"
#define XmCCellTopBorderColor "CellTopBorderColor"
#define XmNcellType "cellType"
#define XmCCellType "CellType"
#define XmRCellType "CellType"
#define XmNcellUserData "cellUserData"
/* Grid callbacks */
typedef struct _XmLGridDrawStruct
{
GC gc;
XRectangle *cellRect;
Dimension topMargin;
Dimension bottomMargin;
Dimension leftMargin;
Dimension rightMargin;
Pixel foreground;
Pixel background;
Pixel selectForeground;
Pixel selectBackground;
XmFontList fontList;
unsigned char alignment;
Boolean drawSelected;
int drawFocusType;
XmStringDirection stringDirection;
} XmLGridDrawStruct;
typedef struct _XmLGridCallbackStruct
{
int reason;
XEvent *event;
unsigned char rowType, columnType;
int row, column;
XRectangle *clipRect;
XmLGridDrawStruct *drawInfo;
void *object;
} XmLGridCallbackStruct;
#define XmCR_ADD_ROW 900
#define XmCR_ADD_COLUMN 901
#define XmCR_ADD_CELL 902
#define XmCR_CELL_DRAW 903
#define XmCR_CELL_DROP 904
#define XmCR_CELL_FOCUS_IN 905
#define XmCR_CELL_FOCUS_OUT 906
#define XmCR_CELL_PASTE 907
#define XmCR_CONF_TEXT 908
#define XmCR_PREF_WIDTH 909
#define XmCR_DELETE_ROW 910
#define XmCR_DELETE_COLUMN 911
#define XmCR_DELETE_CELL 912
#define XmCR_EDIT_BEGIN 913
#define XmCR_EDIT_INSERT 914
#define XmCR_EDIT_CANCEL 915
#define XmCR_EDIT_COMPLETE 916
#define XmCR_FREE_VALUE 917
#define XmCR_RESIZE_ROW 918
#define XmCR_RESIZE_COLUMN 919
#define XmCR_PREF_HEIGHT 920
#define XmCR_SCROLL_ROW 921
#define XmCR_SCROLL_COLUMN 922
#define XmCR_SELECT_CELL 923
#define XmCR_SELECT_COLUMN 924
#define XmCR_SELECT_ROW 925
#define XmCR_DESELECT_CELL 926
#define XmCR_DESELECT_COLUMN 927
#define XmCR_DESELECT_ROW 928
/* xfe added callback reason */
#define XmCR_RESIZE_GRID 929
#define XmCR_SHOW_POPUP 930
#define XmCR_SINGLECLICK 931
#define XmCR_ENTER_CELL 931
#define XmCR_ENTER_GRID 932
#define XmCR_LEAVE_CELL 933
#define XmCR_LEAVE_GRID 934
/* Grid defines */
#define XmCONTENT 0
#define XmHEADING 1
#define XmFOOTER 2
#define XmALL_TYPES 3
#define XmINVALID_TYPE 4
#define XmICON_CELL 0
#define XmPIXMAP_CELL 1
#define XmSTRING_CELL 2
#define XmBORDER_NONE 0
#define XmBORDER_LINE 1
#define XmBORDER_DASH 2
#define XmFORMAT_DELIMITED 1
#define XmFORMAT_XL 2
#define XmFORMAT_PAD 3
#define XmFORMAT_PASTE 4
#define XmFORMAT_DROP 5
#define XmSELECT_NONE 1
#define XmSELECT_SINGLE_ROW 2
#define XmSELECT_BROWSE_ROW 3
#define XmSELECT_MULTIPLE_ROW 4
#define XmSELECT_CELL 5
#define XmDRAW_FOCUS_NONE 1
#define XmDRAW_FOCUS_CELL 2
#define XmDRAW_FOCUS_LEFT 3
#define XmDRAW_FOCUS_MID 4
#define XmDRAW_FOCUS_RIGHT 5
#define XmTRAVERSE_EXTEND_DOWN 20
#define XmTRAVERSE_EXTEND_LEFT 21
#define XmTRAVERSE_EXTEND_RIGHT 22
#define XmTRAVERSE_EXTEND_UP 23
#define XmTRAVERSE_PAGE_DOWN 24
#define XmTRAVERSE_PAGE_LEFT 25
#define XmTRAVERSE_PAGE_RIGHT 26
#define XmTRAVERSE_PAGE_UP 27
#define XmTRAVERSE_TO_BOTTOM 28
#define XmTRAVERSE_TO_TOP 29
#define XmALIGNMENT_LEFT 0
#ifndef XmALIGNMENT_CENTER
#define XmALIGNMENT_CENTER 1
#endif
#define XmALIGNMENT_RIGHT 2
#define XmALIGNMENT_TOP_LEFT 3
#define XmALIGNMENT_TOP 4
#define XmALIGNMENT_TOP_RIGHT 5
#define XmALIGNMENT_BOTTOM_LEFT 6
#define XmALIGNMENT_BOTTOM 7
#define XmALIGNMENT_BOTTOM_RIGHT 8
/* xfe additions */
#define XmSORT_NONE 0
#define XmSORT_ASCENDING 1
#define XmSORT_DESCENDING 2
/* Progress resources */
#define XmNcompleteValue "completeValue"
#define XmCCompleteValue "CompleteValue"
#define XmNnumBoxes "numBoxes"
#define XmCNumBoxes "NumBoxes"
#define XmNmeterStyle "meterStyle"
#define XmCMeterStyle "MeterStyle"
#define XmRMeterStyle "MeterStyle"
#define XmNshowPercentage "showPercentage"
#define XmCShowPercentage "ShowPercentage"
#define XmNshowTime "showTime"
#define XmCShowTime "ShowTime"
/* Progress defines */
#define XmMETER_BAR 0
#define XmMETER_BOXES 1
/* Tree resources */
#define XmNcollapseCallback "collapseCallback"
#define XmNconnectingLineColor "connectingLineColor"
#define XmCConnectingLineColor "ConnectingLineColor"
#define XmNexpandCallback "expandCallback"
#define XmNlevelSpacing "levelSpacing"
#define XmCLevelSpacing "LevelSpacing"
#define XmNplusMinusColor "plusMinusColor"
#define XmCPlusMinusColor "PlusMinusColor"
#define XmNrowExpands "rowExpands"
#define XmCRowExpands "RowExpands"
#define XmNrowIsExpanded "rowIsExpanded"
#define XmCRowIsExpanded "RowIsExpanded"
#define XmNrowLevel "rowLevel"
#define XmCRowLevel "RowLevel"
#define XmNignorePixmaps "ignorePixmaps"
#define XmCIgnorePixmaps "IgnorePixmaps"
/* Tree callbacks */
typedef struct
{
int level;
Boolean expands;
Boolean isExpanded;
Pixmap pixmap, pixmask;
XmString string;
} XmLTreeRowDefinition;
#define XmCR_COLLAPSE_ROW 950
#define XmCR_EXPAND_ROW 951
/* Backwards compatibility */
#ifdef XmLBACKWARDS_COMPATIBILITY
#define XmNfooterColumnCount "footerColumns"
#define XmNfooterRowCount "footerRows"
#define XmNheadingColumnCount "headingColumns"
#define XmNheadingRowCount "headingRows"
#define XmNcellBottomBorderPixel "cellBottomBorderColor"
#define XmCCellBottomBorderPixel "CellBottomBorderColor"
#define XmNcellLeftBorderPixel "cellLeftBorderColor"
#define XmCCellLeftBorderPixel "CellLeftBorderColor"
#define XmNcellRightBorderPixel "cellRightBorderColor"
#define XmCCellRightBorderPixel "CellRightBorderColor"
#define XmNcellTopBorderPixel "cellTopBorderColor"
#define XmCCellTopBorderPixel "CellTopBorderColor"
#define XmTEXT_CELL 250
#define XmLABEL_CELL 251
typedef void XmLCGridRow;
typedef void XmLCGridColumn;
typedef void XmLCGridCell;
#endif
/* Utility defines */
#define XmDRAWNB_ARROW 0
#define XmDRAWNB_ARROWLINE 1
#define XmDRAWNB_DOUBLEARROW 2
#define XmDRAWNB_SQUARE 3
#define XmDRAWNB_DOUBLEBAR 4
#define XmDRAWNB_STRING 5
#define XmDRAWNB_SMALLARROW 6
#define XmDRAWNB_RIGHT 0
#define XmDRAWNB_LEFT 1
#define XmDRAWNB_UP 2
#define XmDRAWNB_DOWN 3
#define XmSTRING_RIGHT 0
#define XmSTRING_LEFT 1
#define XmSTRING_UP 2
#define XmSTRING_DOWN 3
enum { XmLRectInside, XmLRectOutside, XmLRectPartial };
typedef struct
{
int pos;
} XmLArrayItem;
typedef struct _XmLArrayRec *XmLArray;
typedef struct
{
char *name;
unsigned char value;
} XmLStringToUCharMap;
/* Utility functions */
typedef int (*XmLSortCompareFunc)(void *userData, void *l, void *r);
typedef int (*XmLArrayCompareFunc)(void *, void **, void **);
XmLArray XmLArrayNew(char autonumber, char growFast);
void XmLArrayFree(XmLArray array);
void XmLArrayAdd(XmLArray array, int pos, int count);
int XmLArrayDel(XmLArray array, int pos, int count);
int XmLArraySet(XmLArray array, int pos, void *item);
void *XmLArrayGet(XmLArray array, int pos);
int XmLArrayGetCount(XmLArray array);
int XmLArrayMove(XmLArray array, int newPos, int pos, int count);
int XmLArrayReorder(XmLArray array, int *newPositions,
int pos, int count);
int XmLArraySort(XmLArray array, XmLArrayCompareFunc compare,
void *userData, int pos, int count);
Boolean XmLCvtStringToUChar(Display *dpy, char *resname,
XmLStringToUCharMap *map, XrmValuePtr fromVal, XrmValuePtr toVal);
int XmLDateDaysInMonth(int m, int y);
int XmLDateWeekDay(int m, int d, int y);
void XmLDrawnButtonSetType(Widget w, int drawnType, int drawnDir);
void XmLDrawToggle(Widget w, Boolean state, Dimension size,
unsigned char alignment, GC gc, Pixel backgroundColor,
Pixel topColor, Pixel bottomColor, Pixel checkColor,
XRectangle *rect, XRectangle *clipRect);
XmFontList XmLFontListCopyDefault(Widget widget);
void XmLFontListGetDimensions(XmFontList fontList, short *width,
short *height, Boolean useAverageWidth);
void XmLInitialize(void);
int XmLMessageBox(Widget w, char *string, Boolean okOnly);
void XmLPixmapDraw(Widget w, Pixmap pixmap, Pixmap pixmask,
int pixmapWidth, int pixmapHeight, unsigned char alignment,
GC gc, XRectangle *rect, XRectangle *clipRect);
int XmLRectIntersect(XRectangle *r1, XRectangle *r2);
Widget XmLShellOfWidget(Widget w);
void XmLSort(void *base, int numItems, unsigned int itemSize,
XmLSortCompareFunc, void *userData);
void XmLStringDraw(Widget w, XmString string, XmStringDirection stringDir,
XmFontList fontList, unsigned char alignment, GC gc,
XRectangle *rect, XRectangle *clipRect);
void XmLStringDrawDirection(Display *dpy, Window win, XmFontList fontlist,
XmString string, GC gc, int x, int y, Dimension width,
unsigned char alignment, unsigned char layout_direction,
unsigned char drawing_direction);
void XmLWarning(Widget w, char *msg);
#ifdef XmL_CPP
}
#endif
#endif
nedit-5.6.orig/Microline/XmL/XmL.uih0000644000175000017500000001715410077552126015757 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
! Common Resources
value
XmNblankBackground : argument ('blankBackground', color);
XmNautoSelect : argument ('autoSelect', boolean);
XmNdebugLevel : argument ('debugLevel', integer);
! Folder Widget
procedure
XmLCreateFolder();
! Folder Resources
value
XmNcornerDimension : argument ('cornerDimension', integer);
XmNcornerStyle : argument ('cornerStyle', integer);
CornerNone : 0;
CornerLine : 1;
CornerArc : 2;
XmNinactiveBackground : argument ('inactiveBackground', color);
XmNinactiveForeground : argument ('inactiveForeground', color);
XmNpixmapMargin : argument ('pixmapMargin', integer);
ResizeStatic : 10;
ResizeDynamic : 11;
XmNrotateWhenLeftRight : argument ('rotateWhenRightLeft', boolean);
XmNtabPlacement : argument ('tabPlacement', integer);
FolderTop : 0;
FolderLeft : 1;
FolderBottom : 2;
FolderRight : 3;
XmNtabsPerRow : argument ('tabsPerRow', integer);
! Folder Constraint resources
XmNtabFreePixmaps : argument ('tabFreePixmaps', boolean);
XmNtabManagedName : argument ('tabManagedName', string);
XmNtabManagedWidget : argument ('tabManagedWidget', any);
! Grid Widget
procedure
XmLCreateGrid();
! Grid Resources
value
XmNallowColumnHide : argument ('allowColumnHide', boolean);
XmNallowColumnResize : argument ('allowColumnResize', boolean);
XmNallowDragSelected : argument ('allowDragSelected', boolean);
XmNallowDrop : argument ('allowDrop', boolean);
XmNallowRowHide : argument ('allowRowHide', boolean);
XmNallowRowResize : argument ('allowRowResize', boolean);
XmNbottomFixedCount : argument ('bottomFixedCount', integer);
XmNbottomFixedMargin : argument ('bottomFixedMargin', integer);
XmNfooterColumns : argument ('footerColumns', integer);
XmNfooterRows : argument ('footerRows', integer);
XmNglobalPixmapHeight : argument ('globalPixmapHeight', integer);
XmNglobalPixmapWidth : argument ('globalPixmapWidth', integer);
XmNheadingColumns : argument ('headingColumns', integer);
XmNheadingRows : argument ('headingRows', integer);
XmNhighlightRowMode : argument ('highlightRowMode', boolean);
XmNhorizontalSizePolicy : argument ('horizontalSizePolicy', integer);
XmNhsbDisplayPolicy : argument ('hsbDisplayPolicy', integer);
XmNimmediateDraw : argument ('immediateDraw', boolean);
XmNleftFixedCount : argument ('leftFixedCount', integer);
XmNleftFixedMargin : argument ('leftFixedMargin', integer);
XmNrightFixedCount : argument ('rightFixedCount', integer);
XmNrightFixedMargin : argument ('rightFixedMargin', integer);
XmNscrollBarMargin : argument ('scrollBarMargin', integer);
SelectNone : 1;
SelectSingleRow : 2;
SelectBrowseRow : 3;
SelectMultipleRow : 4;
SelectCell : 5;
XmNselectBackground : argument ('selectBackground', color);
XmNselectForeground : argument ('selectForeground', color);
XmNshadowRegions : argument ('shadowRegions', integer);
XmNsimpleHeadings : argument ('simpleHeadings', string);
XmNsimpleWidths : argument ('simpleWidths', string);
XmNtopFixedCount : argument ('topFixedCount', integer);
XmNtopFixedMargin : argument ('topFixedMargin', integer);
XmNuseAverageFontWidth : argument ('useAverageFontWidth', boolean);
XmNverticalSizePolicy : argument ('verticalSizePolicy', integer);
XmNvisibleColumns : argument ('visibleColumns', integer);
XmNvisibleRows : argument ('visibleRows', integer);
XmNvsbDisplayPolicy : argument ('vsbDisplayPolicy', integer);
! Grid Callbacks
value
XmNaddCallback : reason ('addCallback');
XmNcellDrawCallback : reason ('cellDrawCallback');
XmNcellDropCallback : reason ('cellDropCallback');
XmNcellFocusCallback : reason ('cellFocusCallback');
XmNcellPasteCallback : reason ('cellPasteCallback');
XmNdeleteCallback : reason ('deleteCallback');
XmNdeselectCallback : reason ('deselectCallback');
XmNeditCallback : reason ('editCallback');
XmNscrollCallback : reason ('scrollCallback');
XmNselectCallback : reason ('selectCallback');
! Progress Widget
procedure
XmLCreateProgress();
! Progress Resources
value
XmNcompleteValue : argument ('completeValue', integer);
XmNmeterStyle : argument ('meterStyle', integer);
MeterBar : 0;
MeterBoxes : 1;
XmNnumBoxes : argument ('numBoxes', integer);
XmNshowTime : argument ('showTime', boolean);
XmNshowPercentage : argument ('showPercentage', boolean);
! Tree Widget
procedure
XmLCreateTree();
! Tree Resources
value
XmNconnectingLineColor : argument ('connectingLineColor', color);
XmNlevelSpacing : argument ('levelSpacing', integer);
XmNplusMinusColor : argument ('plusMinusColor', color);
! Tree Callbacks
value
XmNexpandCallback : reason ('expandCallback');
XmNcollapseCallback : reason ('collapseCallback');
nedit-5.6.orig/Microline/man/0000755000175000017500000000000011107644406014611 5ustar paulpaulnedit-5.6.orig/Microline/man/XmLArrayAdd.3x0000644000175000017500000000615110077552126017202 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayAdd 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayAdd \- add space to an array
.SH SYNTAX
void XmLArrayAdd(\fIarray\fP, \fIpos\fP, \fIcount\fP)
.br
XmLArray \fIarray\fP;
.br
int \fIpos\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to add to
.IP \fIpos\fP 1i
position to add at
.IP \fIcount\fP 1i
size of space to add
.SH DESCRIPTION
Adds (\fIcount\fP * sizeof(void *)) bytes of space at position
\fIpos\fP to the \fIarray\fP given. Use XmLArraySet() to set
the values in the array after adding space.
.SH "SEE ALSO"
XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArrayDel.3x0000644000175000017500000000634310077552126017221 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayDel 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayDel \- remove space from an array
.SH SYNTAX
int XmLArrayDel(\fIarray\fP, \fIpos\fP, \fIcount\fP)
.br
XmLArray \fIarray\fP;
.br
int \fIpos\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to remove from
.IP \fIpos\fP 1i
position to start removal
.IP \fIcount\fP 1i
size of space to remove
.SH DESCRIPTION
Removes (\fIcount\fP * sizeof(void *)) bytes of space at position
\fIpos\fP from the \fIarray\fP given. This call only removes
space from the array, it does not free individual elements.
.SH RETURN VALUE
0 upon success and -1 upon failure (a value passed is out of range).
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayFree(3X) XmLArrayGet(3X)
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArrayFree.3x0000644000175000017500000000565610077552126017404 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayFree 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayFree \- free an array
.SH SYNTAX
void XmLArrayFree(\fIarray\fP)
.br
XmLArray \fIarray\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to free
.SH DESCRIPTION
Frees the \fIarray\fP given and any space allocated by the array.
This function does not free the individual elements of the array.
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayGet(3X)
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArrayGet.3x0000644000175000017500000000606710077552126017237 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayGet 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayGet \- retrieve a pointer from an array
.SH SYNTAX
void *XmLArrayGet(\fIarray\fP, \fIpos\fP)
.br
XmLArray \fIarray\fP;
.br
int \fIpos\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to retrieve from
.IP \fIpos\fP 1i
position of the pointer to retrieve
.SH DESCRIPTION
Returns the pointer at the position \fIpos\fP in the \fIarray\fP given.
.SH RETURN VALUE
The pointer at the given position or NULL if the position is invalid.
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X)
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArrayGetCount.3x0000644000175000017500000000566010077552126020246 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayGetCount 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayGetCount \- return size of an array
.SH SYNTAX
int XmLArrayGetCount(\fIarray\fP)
.br
XmLArray \fIarray\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to query
.SH DESCRIPTION
Returns the size of \fIarray\fP in units of number of pointers it can hold.
.SH RETURN VALUE
The size of the array.
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
XmLArrayMove(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArrayMove.3x0000644000175000017500000000661110077552126017421 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayMove 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayMove \- move items in an array
.SH SYNTAX
int XmLArrayMove(\fIarray\fP, \fInewPos\fP, \fIpos\fP, \fIcount\fP)
.br
XmLArray \fIarray\fP;
.br
int \fInewPos\fP;
.br
int \fIpos\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to operate on
.IP \fInewPos\fP 1i
position to move to
.IP \fIpos\fP 1i
position to move from
.IP \fIcount\fP 1i
number of items to move
.SH DESCRIPTION
Moves \fIcount\fP pointers starting at position \fIpos\fP in the
\fIarray\fP to the new position \fInewPos\fP. The existing pointers
at the new location are moved down to accommodate the move. No pointers
are overwritten by this call and the size of the array will remain
unchanged.
.SH RETURN VALUE
0 upon success and -1 upon failure (a value passed is out of range).
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
XmLArrayGetCount(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArrayNew.3x0000644000175000017500000000735410077552126017251 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayNew 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayNew \- creates an array object
.SH SYNTAX
XmLArray XmLArrayNew(\fIautonumber\fP, \fIgrowFast\fP)
.br
char \fIautonumber\fP;
.br
char \fIgrowFast\fP;
.LP
.SH ARGUMENTS
.IP \fIautonumber\fP 1i
If set to 1, the pointers in the array are assumed to be
pointers to structures containing an integer as the first
element which will be set to the position of the item
in the array. The array will set this value with the
current position of the element whenever position
of the item changes. If set to 0, the array will never
dereference the pointers contained in the array.
.IP \fIgrowFast\fP 1i
If set to 1, the array will grow quickly as items are added
to it. This will cause the amount of memory the array takes
up to usually be greater than the current space for elements.
If set to 0, the array will always be the size of the current
space for the elements contained in the array.
.SH DESCRIPTION
Creates an array object and returns it. An array object is used to
hold an array of pointers. This object should be freed with XmLArrayFree()
when it is no longer used.
.SH RETURN VALUE
The newly allocate array object.
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
XmLArrayGetCount(3X) XmLArrayMove(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArrayReorder.3x0000644000175000017500000000670510077552126020121 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArrayReorder 3X "R1" "XML1" "XML"
.SH NAME
XmLArrayReorder \- reorder items in an array
.SH SYNTAX
int XmLArrayReorder(\fIarray\fP, \fInewPositions\fP, \fIpos\fP, \fIcount\fP)
.br
XmLArray \fIarray\fP;
.br
int \fInewPositions\fP;
.br
int \fIpos\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to operate on
.IP \fInewPositions\fP 1i
new positions of items
.IP \fIpos\fP 1i
start position of items to reorder
.IP \fIcount\fP 1i
number of items to reorder
.SH DESCRIPTION
Reorders the \fIarray\fP by ordering \fIcount\fP pointers at position
\fIpos\fP to the positions specified in the \fInewPositions\fP array.
The newPositions array should contain numbers starting at pos and
ending at pos + count - 1. This function does not free the newPositions
array passed in.
.SH RETURN VALUE
0 upon success and -1 upon failure (a value passed is out of range).
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
XmLArrayGetCount(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArraySet.3x0000644000175000017500000000620210077552126017242 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArraySet 3X "R1" "XML1" "XML"
.SH NAME
XmLArraySet \- set a pointer element in an array
.SH SYNTAX
int XmLArraySet(\fIarray\fP, \fIpos\fP, \fIitem\fP)
.br
XmLArray \fIarray\fP;
.br
int \fIpos\fP;
.br
void *\fIitem\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
array to set in
.IP \fIpos\fP 1i
position of the pointer to set
.IP \fIitem\fP 1i
value of the item to set
.SH DESCRIPTION
Sets the pointer at the position \fIpos\fP in the \fIarray\fP given to
\fIitem\fP.
.SH RETURN VALUE
0 upon success and -1 upon failure (a value passed is out of range).
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X)
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
nedit-5.6.orig/Microline/man/XmLArraySort.3x0000644000175000017500000000675010077552126017446 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLArraySort 3X "R1" "XML1" "XML"
.SH NAME
XmLArraySort \- sort an array
.SH SYNTAX
int XmLArraySort(\fIarray\fP, \fIcompare\fP, \fIuserData\fP, \
\fIpos\fP, \fIcount\fP)
.br
XmLArray \fIarray\fP;
.br
XmLArrayCompareFunc \fIcompare\fP;
.br
void *\fIuserData\fP;
.br
int \fIpos\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIarray\fP 1i
the array to sort
.IP \fIcompare\fP 1i
the comparison function for pointers in the array
.IP \fIuserData\fP 1i
an application defined pointer to pass to the sort function
.IP \fIpos\fP 1i
start position in array to sort
.IP \fIcount\fP 1i
number of items in array to sort
.SH DESCRIPTION
Sorts \fIcount\fP number of elements starting at position
\fIpos\fP in \fIarray\fP using the \fIcompare\fP function given.
The \fIuserData\fP argument is passed as data to the comparison
function.
.SH RETURN VALUE
0 upon success and -1 upon failure (a value passed is out of range).
.SH "SEE ALSO"
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
XmLArrayReorder(3X) XmLArraySet(3X)
nedit-5.6.orig/Microline/man/XmLCreateFolder.3x0000644000175000017500000000614010077552126020050 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLCreateFolder 3X "R1" "XML1" "XML"
.SH NAME
XmLCreateFolder \- create an instance of a Folder widget
.SH SYNTAX
Widget XmLCreateFolder(\fIparent\fP, \fIname\fP, \fIarglist\fP, \fIargcount\fP)
.br
Widget \fIparent\fP;
.br
char *\fIname\fP;
.br
ArgList \fIarglist\fP;
.br
Cardinal \fIargcount\fP;
.LP
.SH ARGUMENTS
.IP \fIparent\fP 1i
new widgets parent widget ID
.IP \fIname\fP 1i
name of the newly created widget
.IP \fIarglist\fP 1i
resource name/value pairs
.IP \fIargcount\fP 1i
count of pairs in arglist
.SH DESCRIPTION
Creates an instance of a Folder widget and returns its widget ID.
.SH RETURN VALUE
The widget ID of the newly created Folder widget.
.SH "SEE ALSO"
XmLFolder(3X)
nedit-5.6.orig/Microline/man/XmLCreateGrid.3x0000644000175000017500000000612210077552126017522 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLCreateGrid 3X "R1" "XML1" "XML"
.SH NAME
XmLCreateGrid \- create an instance of a Grid widget
.SH SYNTAX
Widget XmLCreateGrid(\fIparent\fP, \fIname\fP, \fIarglist\fP, \fIargcount\fP)
.br
Widget \fIparent\fP;
.br
char *\fIname\fP;
.br
ArgList \fIarglist\fP;
.br
Cardinal \fIargcount\fP;
.LP
.SH ARGUMENTS
.IP \fIparent\fP 1i
new widgets parent widget ID
.IP \fIname\fP 1i
name of the newly created widget
.IP \fIarglist\fP 1i
resource name/value pairs
.IP \fIargcount\fP 1i
count of pairs in arglist
.SH DESCRIPTION
Creates an instance of a Grid widget and returns its widget ID.
.SH RETURN VALUE
The widget ID of the newly created Grid widget.
.SH "SEE ALSO"
XmLGrid(3X)
nedit-5.6.orig/Microline/man/XmLCreateProgress.3x0000644000175000017500000000615610077552126020450 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLCreateProgress 3X "R1" "XML1" "XML"
.SH NAME
XmLCreateProgress \- create an instance of a Progress widget
.SH SYNTAX
Widget XmLCreateProgress(\fIparent\fP, \fIname\fP, \fIarglist\fP,
\fIargcount\fP)
.br
Widget \fIparent\fP;
.br
char *\fIname\fP;
.br
ArgList \fIarglist\fP;
.br
Cardinal \fIargcount\fP;
.LP
.SH ARGUMENTS
.IP \fIparent\fP 1i
new widgets parent widget ID
.IP \fIname\fP 1i
name of the newly created widget
.IP \fIarglist\fP 1i
resource name/value pairs
.IP \fIargcount\fP 1i
count of pairs in arglist
.SH DESCRIPTION
Creates an instance of a Progress widget and returns its widget ID.
.SH RETURN VALUE
The widget ID of the newly created Progress widget.
.SH "SEE ALSO"
XmLProgress(3X)
nedit-5.6.orig/Microline/man/XmLCreateTree.3x0000644000175000017500000000612210077552126017534 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLCreateTree 3X "R1" "XML1" "XML"
.SH NAME
XmLCreateTree \- create an instance of a Tree widget
.SH SYNTAX
Widget XmLCreateTree(\fIparent\fP, \fIname\fP, \fIarglist\fP, \fIargcount\fP)
.br
Widget \fIparent\fP;
.br
char *\fIname\fP;
.br
ArgList \fIarglist\fP;
.br
Cardinal \fIargcount\fP;
.LP
.SH ARGUMENTS
.IP \fIparent\fP 1i
new widgets parent widget ID
.IP \fIname\fP 1i
name of the newly created widget
.IP \fIarglist\fP 1i
resource name/value pairs
.IP \fIargcount\fP 1i
count of pairs in arglist
.SH DESCRIPTION
Creates an instance of a Tree widget and returns its widget ID.
.SH RETURN VALUE
The widget ID of the newly created Tree widget.
.SH "SEE ALSO"
XmLTree(3X)
nedit-5.6.orig/Microline/man/XmLCvtStringToUChar.3x0000644000175000017500000000713110077552126020663 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLCvtStringToUChar 3X "R1" "XML1" "XML"
.SH NAME
XmLCvtStringToUChar \- unsigned char resource converter
.SH SYNTAX
Boolean XmLCvtStringToUChar(\fIdpy\fP, \fIresname\fP, \fImap\fP, \
\fIfromVal\fP, \fItoVal\fP)
.br
Display *\fIdpy\fP;
.br
char *\fIresname\fP;
.br
XmLStringToUCharMap *\fImap\fP;
.br
XrmValuePtr \fIfromVal\fP;
.br
XrmValuePtr \fItoVal\fP;
.LP
.SH ARGUMENTS
.IP \fIdpy\fP 1i
the display
.IP \fIresname\fP 1i
the resource name
.IP \fImap\fP 1i
the mappings of string to unsigned char
.IP \fIfromVal\fP 1i
the resource value from
.IP \fItoVal\fP 1i
the resource value to
.SH DESCRIPTION
This function can be used in a widget to perform resource conversion
from a string to an unsigned char. This function should be called inside
a widgets resource converter where parameters \fIdpy\fP,
\fIfromVal\fP and \fItoVal\fP are available to be passed in. The
\fIresname\fP parameter identifies the resource and the \fImap\fP
array is an array of mappings from strings to unsigned chars. A
NULL string should be used in the last array element to terminate
the array.
.SH RETURN VALUE
True if conversion was successful and toVal is filled in and False if
conversion was unsuccessful.
nedit-5.6.orig/Microline/man/XmLDateDaysInMonth.3x0000644000175000017500000000567210077552126020515 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLDateDaysInMonth 3X "R1" "XML1" "XML"
.SH NAME
XmLDateDaysInMonth \- calculates number of days in month
.SH SYNTAX
int XmLDateDaysInMonth(\fIm\fP, \fIy\fP)
.br
int \fIm\fP;
.br
int \fIy\fP;
.LP
.SH ARGUMENTS
.IP \fIm\fP 1i
month 1 to 12
.IP \fIy\fP 1i
year 1753 to 9999
.SH DESCRIPTION
Calculates the number of days in a given month \fIm\fP and year \fIy\fP.
.SH RETURN VALUE
The number of days in the given month and year. A value of -1 is
returned if a passed value is out of range.
.SH "SEE ALSO"
XmLDateWeekDay(3X)
nedit-5.6.orig/Microline/man/XmLDateWeekDay.3x0000644000175000017500000000603010077552126017636 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLDateWeekDay 3X "R1" "XML1" "XML"
.SH NAME
XmLDateWeekDay \- calculates the weekday for a given date
.SH SYNTAX
int XmLDateWeekDay(\fIm\fP, \fId\fP, \fIy\fP)
.br
int \fIm\fP;
.br
int \fId\fP;
.br
int \fIy\fP;
.LP
.SH ARGUMENTS
.IP \fIm\fP 1i
month 1 to 12
.IP \fId\fP 1i
day 1 to number of days in month
.IP \fIy\fP 1i
year 1753 to 9999
.SH DESCRIPTION
Calculates the weekday for the given day \fId\fP, month \fIm\fP, and year
\fIy\fP.
.SH RETURN VALUE
0 for Sunday, 1 for Monday and so on through 6 for Saturday. A value
of -1 is returned if a passed value is out of range.
.SH "SEE ALSO"
XmLDateDaysInMonth(3X)
nedit-5.6.orig/Microline/man/XmLDrawnButtonSetType.3x0000644000175000017500000000667710077552126021315 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLDrawnButtonSetType 3X "R1" "XML1" "XML"
.SH NAME
XmLDrawnButtonSetType \- adds graphics to a DrawnButton widget
.SH SYNTAX
void XmLDrawnButtonSetType(\fIwidget\fP, \fIdrawnType\fP, \fIdrawnDir\fP)
.br
Widget \fIwidget\fP;
.br
int \fIdrawnType\fP;
.br
int \fIdrawnDir\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
DrawnButton widget ID
.IP \fIdrawnType\fP 1i
type of button to display
.IP \fIdrawnDir\fP 1i
direction of button to display
.SH DESCRIPTION
Given a \fIwidget\fP of class XmDrawnButton this function attaches
expose and realize callbacks to the widget to display the specified graphic
in the button. This function also sets the widget's XmNpushButtonEnabled
resource to True. The \fIdrawnType\fP value given must be one of
the following: XmDRAWNB_ARROW, XmDRAWNB_ARROWLINE, XmDRAWNB_DOUBLEARROW,
XmDRAWNB_SQUARE ,XmDRAWNB_DOUBLEBAR or XmDRAWNB_STRING.
The \fIdrawnDir\fP value given must be
XmDRAWNB_RIGHT, XmDRAWNB_LEFT, XmDRAWNB_UP, or XmDRAWNB_DOWN.
The graphics inside the button are drawn in the widget's foreground color.
nedit-5.6.orig/Microline/man/XmLFolder.3x0000644000175000017500000003772510077552126016741 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFolder 3X "R1" "XML1" "XML"
.SH NAME
XmLFolder
.SH SYNOPSIS
#include
.LP
.SH DESCRIPTION
Provides a Folder containing tabs along the top, bottom, left or
right and an area managed by the tabs in the center. Each tab
consists of a Primitive widget surrounded by tab decorations including
an optional pixmap. Any non-Primitive widget children of the Folder
are placed in the center area. The widgets contained in the tabs
can be assigned a non-Primitive widget to display/manage when the
tab widget is selected.
.SS Class Information
Folder inherits from XmManager, Constraint, Composite and Core. Its
class pointer is xmlFolderWidgetClass. Its class name is XmLFolder.
.SS New Resources
.nf
.ft B
Name Class
Type Default Access
.ft P
XmNactiveTab XmCActiveTab
int -1 G
XmNautoSelect XmCAutoSelect
Boolean True CSG
XmNblankBackground XmCBlankBackground
Pixel dynamic CSG
XmNblankBackgroundPixmap XmCBlankBackgroundPixmap
Pixmap dynamic CSG
XmNcornerDimension XmCCornerDimension
Dimension 2 CSG
XmNcornerStyle XmCCornerStyle
unsigned char XmCORNER_ARC CSG
XmNdebugLevel XmCDebugLevel
int 0 CSG
XmNfontList XmCFontList
XmFontList dynamic CSG
XmNhighlightThickness XmCHighlightThickness
Dimension 2 CSG
XmNinactiveBackground XmCInactiveBackground
Pixel dynamic CSG
XmNinactiveForeground XmCInactiveForeground
Pixel dynamic CSG
XmNmarginHeight XmCMarginHeight
Dimension 0 CSG
XmNmarginWidth XmCMarginWidth
Dimension 0 CSG
XmNpixmapMargin XmCPixmapMargin
Dimension 2 CSG
XmNresizePolicy XmCFolderResizePolicy
XmRFolderResizePolicy XmRESIZE_STATIC CSG
XmNrotateWhenLeftRight XmCRotateWhenLeftRight
Boolean True CSG
XmNspacing XmCSpacing
Dimension 0 CSG
XmNtabBarHeight XmCTabBarHeight
Dimension dynamic G
XmNtabCount XmCTabCount
int 0 G
XmNtabPlacement XmCTabPlacement
unsigned char XmFOLDER_TOP CSG
XmNtabsPerRow XmCTabsPerRow
int 0 CSG
XmNtabTranslations XmCTranslations
XtTranslations [focus translations] CG
XmNtabWidgetList XmCReadOnly
WidgetList dynamic G
.fi
.IP XmNactiveTab
The position of the currently active tab. The first tab on the
left has a position of 0. If no tab is active, this value equals -1.
.IP XmNautoSelect
If True (the default), the Folder will activate its first tab
when it is realized. No callback is generated by this action.
If False, no initial tab will be activated.
.IP XmNblankBackground
The color of the area between tabs, around tabs, and between
tabs and the edge of the Folder.
.IP XmNblankBackgroundPixmap
The pixmap to display as a background (tiled) in the blank background
area. See XmNblankBackground.
.IP XmNcornerDimension
If XmNcornerStyle is XmCORNER_LINE, this value is used to determine
the length of the lines that clip the corners of the tabs. The
greater this value is, the longer the corner lines will be. If
XmNcornerStyle is XmCORNER_ARC, this value is used to determine
the sizes of the arcs in the corners of the tabs. If XmNcornerStyle
is XmCORNER_NONE, this resource has no effect.
.IP XmNcornerStyle
Defines the type of corners on the individual tabs. Possible values:
.nf
XmCORNER_NONE /* no corners */
XmCORNER_LINE /* corners are beveled */
XmCORNER_ARC /* corners are round */
.fi
.IP XmNdebugLevel
If set to a value greater than 0, debugging messages will be
printed to stderr. When set to 0 (the default) only error
messages will be generated.
.IP XmNfontList
The default font list for tabs created with the XmLFolderAddTab()
functions. Changing this value does not affect existing widgets.
If this value is NULL, a font list is obtained from the nearest
parent that is a subclass of BulletinBoard, MenuShell, or VendorShell.
.IP XmNhighlightThickness
The thickness of the highlight drawn around the Primitive widget
contained in the active tab. When a Primitive widget is added to
the Folder, its highlightThickness is set to 0. The Folder is
responsible for drawing the highlight in the active tab.
This is necessary because if the Primitive widget were allowed
to draw the highlight, it would erase the highlight with
an incorrect color.
.IP XmNinactiveBackground
The background color of inactive tabs. This value is initially set
to the background color of the Folder widget.
.IP XmNinactiveForeground
The foreground color of inactive tabs. This value is initially
set to the foreground color of the Folder widget.
.IP XmNmarginHeight
If tab placement is on the top or bottom, this value is the margin
between tab widgets and the top of tabs, and between tab widgets
and the bottom of tabs. If tab placement is on the left or right,
this value is the margin between tab widgets and the left of tabs,
and between tab widgets and the right of tabs.
.IP XmNmarginWidth
If tab placement is on the top or bottom, this value is the margin
between tab widgets and the left of tabs, and between tab widgets
and the right of tabs. If tab placement is on the left
or right, this value is the margin between tab widgets and the top of
tabs and between tab widgets and bottoms of tabs.
.IP XmNpixmapMargin
The margin between the tab widget and any pixmap to its left.
.IP XmNresizePolicy
This policy determines when the Folder should perform a request
for a new size from its parent.
A policy of XmRESIZE_STATIC (the default) will cause the Folder
to initially request a size which includes the preferred size of
its children and then reject any subsequent resize requests from
its non-tab widget children. A policy of XmRESIZE_DYNAMIC will
cause the Folder to resize itself to include the preferred size
of any of its children whenever its children change size. A
policy of XmRESIZE_NONE will cause the Folder to never generate
a resize request and also will cause it not to perform geometry
management on its non-tab widget children. Possible values:
.nf
XmRESIZE_NONE /* no resize requests and no
placement or geometry management
of non-tab children */
XmRESIZE_STATIC /* initially layout to include
preferred size of children */
XmRESIZE_DYNAMIC /* dynamically resize as children
request new size */
.fi
.IP XmNrotateWhenLeftRight
If True, XmDrawnButton based tabs (including tabs created with the
XmLFolderAddTab() functions) will display their text vertically
instead of horizontally if they are placed on the left or right
of the Folder. This occurs when the Folder's XmNtabPlacement
resource is XmFOLDER_LEFT or XmFOLDER_RIGHT. Tabs on the
left would have their text drawn up and tabs on the right
would have their text drawn down. If False, tabs are left
oriented horizontally regardless of their placement.
.IP XmNspacing
The amount of space between tabs.
.IP XmNtabBarHeight
The height, in pixels, of the tab bar. If tab placement is on
the left or right, this value is the width of the tab bar.
This value may not be set and is only valid after the Folder
has been managed and has performed its layout.
.IP XmNtabCount
The number of tabs displayed.
.IP XmNtabPlacement
Where to place the tabs. Possible values:
.nf
XmFOLDER_TOP /* top left to right */
XmFOLDER_BOTTOM /* bottom left to right */
XmFOLDER_LEFT /* left top to bottom */
XmFOLDER_RIGHT /* right top to bottom */
.fi
.IP XmNtabsPerRow
If set to 0 (the default), the Folder will place tabs in a
single row one after another during layout. If non-zero,
this value specifies the number of rows of tabs to appear
in the Folder and the Folder will pad each row to the width
of the Folder by proportionally sizing the tabs based on
their contents and the width of the row.
.IP XmNtabTranslations
The translation table used to augment the translations of
Primitive widgets added to the Folder. The Folder overrides
the FocusIn and FocusOut translations of its Primitive widget
children allowing it to draw and erase tab highlights.
.IP XmNtabWidgetList
The list of widgets contained inside the tabs. These widgets
are subclasses of XmPrimitive.
.SS Constraint Resources
Folder defines the following constraint resources.
.nf
.ft B
Name Class
Type Default Access
.ft P
XmNtabFreePixmaps XmCTabFreePixmap
Boolean False CSG
XmNtabInactivePixmap XmCTabInactivePixmap
Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNtabManagedName XmCTabManagedName
String NULL CSG
XmNtabManagedWidget XmCTabManagedWidget
Widget NULL CSG
XmNtabPixmap XmCTabPixmap
Pixmap XmUNSPECIFIED_PIXMAP CSG
.fi
.IP XmNtabFreePixmaps
If True, the Folder will call XFreePixmap on the XmNtabPixmap and
XmNtabInactivePixmap pixmaps when this widget is destroyed.
This value is set to True for tabs created by the
XmLFolderAddBitmapTab() functions.
.IP XmNtabInactivePixmap
The pixmap to appear in the left of the tab when the tab is inactive.
.IP XmNtabManagedName
By setting a managed name on a tab widget and setting the same
managed name on a Manager widget, you specify that the tab
manages the Manager widget. You can also specify that a tab
manages a specific Manager widget by setting the managed name
on the tab widget to the name (XtName) of the Manager widget.
If a tab widget has a managed name, the XmNtabManagedWidget
resource of the tab widget is ignored.
.IP XmNtabManagedWidget
Specifies a widget to be managed when this widget is activated.
When this widget is deactivated, its managed widget will be
unmanaged. This resource allows Manager widgets contained in the
center of the Folder to be attached to tabs, so when a user
selects a tab its attached Manager widget will be displayed on
the screen.
.IP XmNtabPixmap
The pixmap to appear in the left of the tab when the tab is active.
.SS Callback Resources
Folder defines the following callback resources.
.nf
.ft B
Callback Reason
.ft P
XmNactivateCallback XmCR_ACTIVATE
.fi
.SS Callback Structure
Each callback function is passed a pointer to the structure shown below.
.nf
typedef struct
{
int reason; /* callback reason */
XEvent *event; /* event callback or NULL */
int pos; /* position of tab to act */
int allowActivate; /* allow/disallow act (1/0) */
} XmLFolderCallbackStruct;
.fi
pos will be set to the position of the tab (with 0 as the first tab
on the left) to activate for XmNactivateCallback callbacks.
If allowActivate is set to 0 by the callback function, the tab will not
be activated and the attempt to activate the given tab will be rejected.
.SS Inherited Resources
Folder inherits the resources shown below.
.nf
.ft B
Resource From Resource From
.ft P
XmNaccelerators Core XmNinitialResourcePersist Core
XmNancestorSensitive Core XmNinsertPosition Composite
XmNbackground Core XmNmappedWhenManaged Core
XmNbackgroundPixmap Core XmNnavagationType Manager
XmNborderColor Core XmNnumChildren Composite
XmNborderPixmap Core XmNscreen Core
XmNborderWidth Core XmNsensitive Core
XmNbottomShadowColor Manager XmNshadowThicknses Manager
XmNbottomShadowPixmap Manager XmNstringDirection Manager
XmNchildren Composite XmNtopShadowColor Manager
XmNcolormap Core XmNtopShadowPixmap Manager
XmNdepth Core XmNtranslations Core
XmNdestroyCallback Core XmNtraversalOn Manager
XmNforeground Manager XmNunitType Manager
XmNheight Core XmNuserData Manager
XmNhelpCallback Manager XmNwidth Core
XmNhighlightColor Manager XmNx Core
XmNhighlightPixmap Manager XmNy Core
.fi
.SS Folder Translations
Folder defines the translations shown below.
.nf
.ft B
Event Action
.ft P
BSelect Press XmLFolderActivate()
.fi
.SS Folder Primitive Translations
Folder overrides the translations shown below for all of
its Primitive widget children.
.nf
.ft B
Event Action
.ft P
FocusIn PrimitiveFocusIn() XmLFolderPrimFocusIn()
FocusOut PrimtiveFocusOut() XmLFolderPrimFocusOut()
.fi
.SS Action Routines
Folder defines the actions shown below.
.IP XmLFolderActivate()
Activates the tab at the location of the event passed to the action routine.
.IP XmLFolderPrimFocusIn()
Draws a highlight around the given widget.
.IP XmLFolderPrimFocusOut()
Erases the highlight around the given widget.
.SH "SEE ALSO"
XmLCreateFolder(3X) XmLFolderAddBitmapTab(3X) XmLFolderAddBitmapTabForm(3X)
XmLFolderAddTab(3X) XmLFolderAddTabForm(3X) XmLFolderSetActiveTab(3X)
nedit-5.6.orig/Microline/man/XmLFolderAddBitmapTab.3x0000644000175000017500000000653110077552126021125 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFolderAddBitmapTab 3X "R1" "XML1" "XML"
.SH NAME
XmLFolderAddBitmapTab \- add a tab to a Folder containing a string and bitmap
.SH SYNTAX
Widget XmLFolderAddBitmapTab(\fIwidget\fP, \fIstring\fP, \
\fIbitmapBits\fP, \fIbitmapWidth\fP, \fIbitmapHeight\fP)
.br
Widget \fIwidget\fP;
.br
XmString \fIstring\fP;
.br
char *\fIbitmapBits\fP;
.br
int \fIbitmapWidth\fP;
.br
int \fIbitmapHeight\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Folder widget ID
.IP \fIstring\fP 1i
string to display in the tab
.IP \fIbitmapBits\fP 1i
bitmap to display in the tab
.IP \fIbitmapWidth\fP 1i
width of the bitmap in pixels
.IP \fIbitmapHeight\fP 1i
height of the bitmap in pixels
.SH DESCRIPTION
Adds a tab to the Folder \fIwidget\fP containing the \fIstring\fP and
\fIbitmap\fP specified.
.SH RETURN VALUE
Returns the widget ID of the DrawnButton widget contained in the tab.
.SH "SEE ALSO"
XmLFolderAddBitmapTabForm(3X) XmLFolderAddTab(3X) XmLFolder(3X)
nedit-5.6.orig/Microline/man/XmLFolderAddBitmapTabForm.3x0000644000175000017500000000665310077552126021756 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFolderAddBitmapTabForm 3X "R1" "XML1" "XML"
.SH NAME
XmLFolderAddBitmapTabForm \- add a tab to a Folder containing a string
and bitmap and a form managed by the tab
.SH SYNTAX
Widget XmLFolderAddBitmapTabForm(\fIwidget\fP, \fIstring\fP, \
\fIbitmapBits\fP, \fIbitmapWidth\fP, \fIbitmapHeight\fP)
.br
Widget \fIwidget\fP;
.br
XmString \fIstring\fP;
.br
char *\fIbitmapBits\fP;
.br
int \fIbitmapWidth\fP;
.br
int \fIbitmapHeight\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Folder widget ID
.IP \fIstring\fP 1i
string to display in the tab
.IP \fIbitmapBits\fP 1i
bitmap to display in the tab
.IP \fIbitmapWidth\fP 1i
width of the bitmap in pixels
.IP \fIbitmapHeight\fP 1i
height of the bitmap in pixels
.SH DESCRIPTION
Adds a tab to the Folder \fIwidget\fP containing the \fIstring\fP and
\fIbitmap\fP specified and adds a form (XmForm widget) to the Folder
which is managed by that tab.
.SH RETURN VALUE
Returns the widget ID of the Form widget managed by the new tab.
.SH "SEE ALSO"
XmLFolderAddTab(3X) XmLFolder(3X)
nedit-5.6.orig/Microline/man/XmLFolderAddTab.3x0000644000175000017500000000572110077552126017770 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFolderAddTab 3X "R1" "XML1" "XML"
.SH NAME
XmLFolderAddTab \- add a tab to a Folder containing a string
.SH SYNTAX
Widget XmLFolderAddTab(\fIwidget\fP, \fIstring\fP)
.br
Widget \fIwidget\fP;
.br
XmString \fIstring\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Folder widget ID
.IP \fIstring\fP 1i
string to display in the tab
.SH DESCRIPTION
Adds a tab to a Folder containing the \fIstring\fP specified.
.SH RETURN VALUE
Returns the widget ID of the DrawnButton widget contained in the tab.
.SH "SEE ALSO"
XmLFolderAddBitmapTab(3X) XmLFolder(3X)
nedit-5.6.orig/Microline/man/XmLFolderAddTabForm.3x0000644000175000017500000000612510077552126020613 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFolderAddTabForm 3X "R1" "XML1" "XML"
.SH NAME
XmLFolderAddTabForm \- add a tab to a Folder containing a string and
a form managed by the tab
.SH SYNTAX
Widget XmLFolderAddTabForm(\fIwidget\fP, \fIstring\fP)
.br
Widget \fIwidget\fP;
.br
XmString \fIstring\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Folder widget ID
.IP \fIstring\fP 1i
string to display in the tab
.SH DESCRIPTION
Adds a tab to the Folder \fIwidget\fP containing the \fIstring\fP
specified and adds a form (XmForm widget) to the Folder which is
managed by that tab.
.SH RETURN VALUE
Returns the widget ID of the Form widget managed by the new tab.
.SH "SEE ALSO"
XmLFolderAddBitmapTabForm(3X) XmLFolder(3X)
nedit-5.6.orig/Microline/man/XmLFolderSetActiveTab.3x0000644000175000017500000000632210077552126021165 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFolderSetActiveTab 3X "R1" "XML1" "XML"
.SH NAME
XmLFolderSetActiveTab \- activate a tab at a given position
.SH SYNTAX
void XmLFolderSetActiveTab(\fIwidget\fP, \fIposition\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
int \fIposition\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Folder widget ID
.IP \fIposition\fP 1i
active tab position
.IP \fInotify\fP 1i
if True, activate callback will be called
.SH DESCRIPTION
Activates a tab at the given \fIposition\fP. If the activated tab
manages a widget, that widget will be managed and any other widgets
managed by other tabs will be unmanaged. The Folder's XmNactivateCallback
callbacks will be called if \fInotify\fP is True and the position passed
is different from the current active position.
.SH "SEE ALSO"
XmLFolder(3X)
nedit-5.6.orig/Microline/man/XmLFontListCopyDefault.3x0000644000175000017500000000577410077552126021427 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFontListCopyDefault 3X "R1" "XML1" "XML"
.SH NAME
XmLFontListCopyDefault \- returns a copy of the default font list for a widget
.SH SYNTAX
XmLFontList XmLFontListCopyDefault(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
widget to retrieve default font list for
.SH DESCRIPTION
Returns a copy of the default font list for the given \fIwidget\fP.
The default font list is found by looking for the font list default
of the nearest BulletinBoard, MenuShell or VendorShell parent.
.SH RETURN VALUE
A copy of the default font list for the given \fIwidget\fP.
nedit-5.6.orig/Microline/man/XmLFontListGetDimensions.3x0000644000175000017500000000657210077552126021755 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLFontListGetDimensions 3X "R1" "XML1" "XML"
.SH NAME
XmLFontListGetDimensions \- calculates overall width and height of characters
in a font list
.SH SYNTAX
void XmLFontListGetDimensions(\fIfontList\fP, \fIwidth\fP, \
\fIheight\fP, \fIuseAverageWidth\fP)
.br
XmFontList \fIfontList\fP;
.br
short *\fIwidth\fP;
.br
short *\fIheight\fP;
.br
Boolean \fIuseAverageWidth\fP;
.LP
.SH ARGUMENTS
.IP \fIfontList\fP 1i
font list
.IP \fIwidth\fP 1i
maximum or average character width in fontlist
.IP \fIheight\fP 1i
maximum character height in fontlist
.IP \fIuseAverageWidth\fP 1i
if True, return average glyph width instead of maximum glyph width
.SH DESCRIPTION
Calculates the overall \fIwidth\fP and \fIheight\fP of the characters in
a given \fIfontList\fP. The height returned is the height of the tallest
glyph. If \fIuseAverageWidth\fP is False, the width returned is the
width of the widest glyph. If True, the width returned is the average
width of all of the glyphs.
nedit-5.6.orig/Microline/man/XmLGrid.3x0000644000175000017500000017336310077552126016412 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGrid 3X "R1" "XML1" "XML"
.SH NAME
XmLGrid
.SH SYNOPSIS
#include
.LP
.SH DESCRIPTION
A Grid consists of cells in rows and columns. There are two basic
cell types, defined by the nature of the cell content: STRING (XmString
format), and PIXMAP (pixmap images). STRING cells may allow editing.
Cells and regions within the Grid may be formatted with borders and
shadowing. Rows and columns may be fixed on the top, bottom,
left and right to remain in view while scrolling horizontally or
vertically. There may be heading and footer rows at the top and
bottom, and heading and footer columns at the left and right,
in addition to the content rows and columns in the center of
the Grid. While headings and footers must be fixed, content rows
may scroll or may also be fixed on the top, bottom, left and right.
.SS Class Information
Grid inherits from XmManager, Constraint, Composite and Core. Its
class pointer is xmlGridWidgetClass. Its class name is XmLGrid.
.SS New Resources
The Grid resources defined below affect its overall behavior, layout and
appearance. Definitions of resources affecting rows, columns and
cells follow the Grid resource definitions.
.nf
.ft B
Name Class
Type Default Access
.ft P
XmNallowColumnHide XmCAllowColumnHide
Boolean False CSG
XmNallowColumnResize XmCAllowColumnResize
Boolean False CSG
XmNallowDragSelected XmCAllowDragSelected
Boolean False CSG
XmNallowDrop XmCAllowDrop
Boolean False CSG
XmNallowRowHide XmCAllowRowHide
Boolean False CSG
XmNallowRowResize XmCAllowRowResize
Boolean False CSG
XmNautoSelect XmCAutoSelect
Boolean True CSG
XmNblankBackground XmCBlankBackground
Pixel Dynamic CSG
XmNbottomFixedCount XmCBottomFixedCount
int 0 CSG
XmNbottomFixedMargin XmCBottomFixedMargin
Dimension 0 CSG
XmNcolumns XmCColumns
int 0 CSG
XmNdebugLevel XmCDebugLevel
int 0 CSG
XmNeditTranslations XmCTranslations
XtTranslations Dynamic CSG
XmNfontList XmCFontList
XmFontList Dynamic CSG
XmNfooterColumns XmCFooterColumns
int 0 CSG
XmNfooterRows XmCFooterRows
int 0 CSG
XmNglobalPixmapHeight XmCGlobalPixmapHeight
Dimension 0 CSG
XmNglobalPixmapWidth XmCGlobalPixmapWidth
Dimension 0 CSG
XmNheadingColumns XmCHeadingColumns
int 0 CSG
XmNheadingRows XmCHeadingRows
int 0 CSG
XmNhiddenColumns XmCHiddenColumns
int 0 G
XmNhiddenRows XmCHiddenRows
int 0 G
XmNhighlightRowMode XmCHighlightRowMode
Boolean False CSG
XmNhighlightThickness XmCHighlightThickness
Dimension 2 CSG
XmNhorizontalScrollBar XmCHorizontalScrollBar
Widget Dynamic G
XmNhorizontalSizePolicy XmCHorizontalSizePolicy
unsigned char XmCONSTANT CSG
XmNhsbDisplayPolicy XmCHsbDisplayPolicy
unsigned char XmAS_NEEDED CSG
XmNimmediateDraw XmCImmediateDraw
Boolean False CSG
XmNlayoutFrozen XmCLayoutFrozen
Boolean False CSG
XmNleftFixedCount XmCLeftFixedCount
int 0 CSG
XmNleftFixedMargin XmCLeftFixedMargin
Dimension 0 CSG
XmNrightFixedCount XmCRightFixedCount
int 0 CSG
XmNrightFixedMargin XmCRightFixedMargin
Dimension 0 CSG
XmNrows XmCRows
int 0 CSG
XmNscrollBarMargin XmCScrollBarMargin
Dimension 2 CSG
XmNscrollColumn XmCScrollColumn
int Dynamic CSG
XmNscrollRow XmCScrollRow
int Dynamic CSG
XmNselectBackground XmCSelectBackground
Pixel Dynamic CSG
XmNselectForeground XmCSelectForeground
Pixel Dynamic CSG
XmNselectionPolicy XmCGridSelectionPolicy
unsigned char XmSELECT_BROWSE_ROW CSG
XmNshadowRegions XmCShadowRegions
int 511 CSG
XmNshadowType XmCShadowType
unsigned char XmSHADOW_IN CSG
XmNsimpleHeadings XmCSimpleHeadings
String NULL CSG
XmNsimpleWidths XmCSimpleWidths
String NULL CSG
XmNtextWidget XmCTextWidget
Widget Dynamic G
XmNtopFixedCount XmCTopFixedCount
int 0 CSG
XmNtopFixedMargin XmCTopFixedMargin
Dimension 0 CSG
XmNtraverseTranslations XmCTranslations
XtTranslations Dynamic CSG
XmNuseAverageFontWidth XmCUseAverageFontWidth
Boolean True CSG
XmNverticalScrollBar XmCVerticalScrollBar
Widget 0 G
XmNverticalSizePolicy XmCVerticalSizePolicy
unsigned char XmCONSTANT CSG
XmNvisibleColumns XmCVisibleColumns
int 0 CSG
XmNvisibleRows XmCVisibleRows
int 0 CSG
XmNvsbDisplayPolicy XmCVsbDisplayPolicy
unsigned char XmAS_NEEDED CSG
.fi
.IP XmNallowColumnHide
This resource only has effect when XmNallowColumnResize is True.
If the user is able to resize columns, this resource controls
whether a user can hide a column by resizing it to a zero width.
If True, a user may size columns to a zero width (hiding them) and
if False (the default), a user will not be able to resize a column
to a zero width.
.IP XmNallowColumnResize
If True, the user may resize a column by dragging the right
edge of a cell in a heading row. When the user resizes a column,
the column's XmNcolumnSizePolicy is set to XmCONSTANT and the
column's XmNcolumnWidth is set to the pixel width chosen by the
user. If the Grid contains no heading rows, this resource has no
effect. If False, interactive column resizing is disabled.
.IP XmNallowDragSelected
If True, the user may interactively drag cell contents (strings)
to a drop site. If False, dragging is disabled.
.IP XmNallowDrop
If True, the user is allow to drop cell contents (strings) into the
Grid. If False, the Grid will not register itself as a drop site.
.IP XmNallowRowHide
This resource only has effect when XmNallowRowResize is True.
If the user is able to resize rows, this resource controls
whether a user can hide a row by resizing it to a zero height.
If True, a user may size rows to a zero height (hiding them) and
if False (the default), a user will not be able to resize a row
to a zero height.
.IP XmNallowRowResize
If True, the user may resize a row by dragging the bottom edge of
a cell in a heading column. When the user resizes a row, the
row's XmNrowSizePolicy is set to XmCONSTANT and the row's
XmNrowHeight is set to the pixel height chosen by the user. If
the Grid contains no heading columns, this resource has no effect.
If False, interactive row resizing is disabled.
.IP XmNautoSelect
If set to True (the default) and the Grid's XmNselectionPolicy is
XmSELECT_BROWSE_ROW, the Grid will select its first row when it
is realized. No callback is generated by this action. If False,
no initial row will be selected.
.IP XmNblankBackground
If a Grid has a horizontal scrollbar which is scrolled completely
to the right or a vertical scrollbar which is scrolled to the
bottom, an empty area can exist after the last set of scrolling cells. The
color of this empty region is set by the XmNblankBackground
resource. It will only be visible when the Grid is scrolled fully
to the right or bottom. This value is initially set to the background
color of the Grid widget.
.IP XmNbottomFixedCount
The number of fixed rows at the bottom of the Grid including
footer rows. Since footer rows must be fixed, this value may not
be set smaller than the number of footer rows. If this value is
greater than the total number of rows, then as additional rows
are added they will be fixed until this value is reached.
.IP XmNbottomFixedMargin
The height, in pixels, of the margin between the bottom fixed
rows and any rows above them.
.IP XmNcolumns
The number of content columns. Setting this value will add content
columns to the Grid if the value set is greater than the current number
of content columns. Likewise, setting this value to a number less
than the current number of content columns will cause content columns
to be deleted. The Grid updates this resource to reflect the
current number of content columns every time a content column is
added or removed. To get the total number of columns in the
Grid (heading, content and footer) add this value to the number
of heading and footer columns.
.IP XmNdebugLevel
If set to a value greater than 0, debugging messages will be
printed to stderr. When set to 0 (the default) only error
messages will be reported.
.IP XmNeditTranslations
The translations merged into the Text widget child of the Grid
when the Grid goes from traverse mode into edit mode.
.IP XmNfontList
The default font list for new cells. Changing this resource
does not affect existing cells. If this value is NULL, a
font list is obtained from the nearest parent that is a
subclass of BulletinBoard, MenuShell, or VendorShell.
.IP XmNfooterColumns
The number of footer columns. Setting this value will add footer
columns to the Grid if the value set is greater than the current number
of footer columns. Likewise, setting this value to a number less
than the current number of footer columns will cause footer columns
to be deleted. The Grid updates this resource to reflect the
current number of footer columns every time a footer column is
added or removed.
.IP XmNfooterRows
The number of footer rows. Setting this value will add footer rows
to the Grid if the value set is greater than the current number
of footer rows. Likewise, setting this value to a number less
than the current number of footer rows will cause footer rows
to be deleted. The Grid updates this resource to reflect the
current number of footer rows every time a footer row is
added or removed.
.IP XmNglobalPixmapHeight
If non-zero, this value specifies the height of every pixmap
contained in the cells of the Grid. You should set this
resource only if all cell pixmaps have equal size.
If you set this resource, you should also set
XmNglobalPixmapWidth to the width of the pixmaps.
Setting this value will increase performance when setting
cell pixmaps since if this value is not set, the Grid will
need to perform a query to determine the dimensions of any
pixmap set. You should leave this value at 0 (the default)
if you have pixmaps of varying size in the Grid.
.IP XmNglobalPixmapWidth
This resource should be used with XmNglobalPixmapHeight. See
XmNglobalPixmapHeight for details.
.IP XmNheadingColumns
The number of heading columns. Setting this value will add heading
columns to the Grid if the value set is greater than the current number
of heading columns. Likewise, setting this value to a number less
than the current number of heading columns will cause heading columns
to be deleted. The Grid updates this resource to reflect the
current number of heading columns every time a heading column is
added or removed.
.IP XmNheadingRows
The number of heading rows. Setting this value will add heading rows
to the Grid if the value set is greater than the current number
of heading rows. Likewise, setting this value to a number less
than the current number of heading rows will cause heading rows
to be deleted. The Grid updates this resource to reflect the
current number of heading rows every time a heading row is
added or removed.
.IP XmNhiddenColumns
The total number of hidden columns. The Grid updates this
resource every time a column is hidden or unhidden. Hidden
columns are columns with a width of 0.
.IP XmNhiddenRows
The total number of hidden rows. The Grid updates this resource
every time a row is hidden or unhidden. Hidden rows are rows
with a height of 0.
.IP XmNhighlightRowMode
If True, a highlight is drawn around the entire row
containing the cell which has focus instead of just
around the current cell which has focus. If False (the default),
when a cell has focus, the highlight will be drawn only
around that cell.
.IP XmNhighlightThickness
The thickness of the highlight rectangle drawn in cells with focus.
This value must be 0 or 2.
.IP XmNhorizontalScrollBar
The widget ID of the Grid's horizontal ScrollBar.
.IP XmNhorizontalSizePolicy
Determines how the Grid sizes itself horizontally. Possible values:
.nf
XmVARIABLE /* Grid always requests full
width */
XmCONSTANT /* user or parent sets Grid
width and scrollbar is
displayed if required */
.fi
If this value is XmVARIABLE, the Grid determines the amount of
horizontal space required to display the entire Grid and
requests this space from its parent. When the width of the Grid
changes, it will request more or less space causing it to
shrink or expand as its parent widget allows. It will appear
truncated, without a horizontal ScrollBar, if not enough
space is given by the parent. If this value is XmCONSTANT the
user or the parent widget must define the Grid�s width and a
horizontal ScrollBar will appear if needed.
.IP XmNhsbDisplayPolicy
When XmNhorizontalSizePolicy is XmCONSTANT, this resource
controls whether to display the horizontal scroll bar if
all rows fit in the viewing area. Possible values:
.nf
XmSTATIC /* scrollbar always displays */
XmAS_NEEDED /* scrolbar only displayed when
scrolling is possible */
.fi
.IP XmNimmediateDraw
If False (the default), the Grid queues up and compresses
drawing events. For example, if you change a cell's background
and later change the cell's foreground, the Grid will only
draw the cell once to reflect the changes. This drawing
compression includes sending expose events to the X Server.
If you do not want the Grid to queue and compress drawing events,
you should set this value to True. You would want to set
this resource to True in the case where you had a very slow
connection to an X Server (over a serial line for instance).
If set to True and the line to the X Server is slow, more
drawing will be performed but the the drawing will show up faster.
.IP XmNlayoutFrozen
If True, the Grid's layout is frozen and the Grid will not
recompute its layout until this resource is set to False. When
this resource is set back to False, the layout will be recomputed
and the entire Grid will redraw. When rows or columns are added
to or deleted from the Grid, or if row heights, column widths or
margins are changed, the Grid must recompute its layout by determining which
cells to display on the screen. If a number of changes to the
Grid layout are going to take place, then by setting this resource
to True before executing the first change and setting it to False after
the last change is requested, the Grid will not recompute its
layout after each change. Setting this value will not affect what
is displayed on the screen as it is only used to increase performance. If
only a single layout change is requested, such as when adding or
deleting a single range of rows or columns, this resource should
not be used in an attempt to increase performance as the change
may not require a redraw of the Grid. This resource should also
not be used around code which does not cause the Grid to recompute
its layout, such as changing cell or border colors, as that
would decrease performance.
.IP XmNleftFixedCount
The number of fixed columns at the left of the Grid including
heading columns. Since heading columns must be fixed, this
value may not be set smaller than the number of heading columns. If
this value is greater than the total number of columns, then
as additional columns are added they will be fixed until this
value is reached.
.IP XmNleftFixedMargin
The width, in pixels, of the margin between the left fixed
columns and any columns to their right.
.IP XmNrightFixedCount
The number of fixed columns at the right of the Grid including
footer columns. Since footer columns must be fixed, this value
may not be set smaller than the number of footer columns. If
this value is greater than the total number of columns, then
as additional columns are added they will be fixed until this
value is reached.
.IP XmNrightFixedMargin
The width, in pixels, of the margin between the right fixed
columns and any columns to their left.
.IP XmNrows
The number of content rows. Setting this value will add content
rows to the Grid if the value set is greater than the current number
of content rows. Likewise, setting this value to a number less
than the current number of content rows will cause content rows
to be deleted. The Grid updates this resource to reflect the
current number of content rows every time a content row is
added or removed. To get the total number of rows in the
Grid (heading, content and footer) add this value to the number
of heading and footer rows.
.IP XmNscrollBarMargin
The margin, in pixels, between the ScrollBars and the displayed cells.
.IP XmNscrollColumn
The left-most scrolling content column currently displayed.
This value may be set to change the current scroll position.
If setting this value causes the scroll position to change, the Grid's scroll
callbacks will be called. If this value is set greater than the
last possible scrolling column, the Grid will scroll to the last
possible scrolling column. If this value is set less than the first possible
scrolling column, the Grid will scroll to the first possible scrolling column.
.IP XmNscrollRow
The top scrolling content row currently displayed. This value
may be set to change the current scroll position. If setting this
value causes the scroll position to change, the Grid's scroll
callbacks will be called. If this value is set greater than the
last possible scrolling row, the Grid will scroll to the last
possible scrolling row. If this value is set less than the first possible
scrolling row, the Grid will scroll to the first possible scrolling row.
.IP XmNselectBackground
The background color of cells, rows or columns which are
currently selected. This value is initially set to the foreground
color of the Grid widget.
.IP XmNselectForeground
The foreground color of cells, rows or columns which are
currently selected. This value is initially set to the background
color of the Grid widget.
.IP XmNselectionPolicy
Determines the types of selections allowed in the Grid.
In SELECT_NONE mode, user selections have no effect by default and
cell select callbacks are called each time a user selects a cell. The
application may set selections of rows/columns or cells. In
SELECT_SINGLE_ROW mode, one or zero content rows may be selected.
In SELECT_BROWSE_ROW mode, one content row must be selected at all
times. In SELECT_MULTIPLE_ROW, multiple content rows
may be selected. In any of the SELECT_..._ROW modes, when cells
in heading or footer rows are selected by a user, the Grid will
call its cell select callbacks. Therefore, the application must
be sure to check the type of selection made in its select
callback(s). In SELECT_CELL mode, arbitrary regions of cells
in content rows and content columns may be selected. A user
may select cells in heading rows to select columns and cells
in heading columns to select rows. Possible values:
.nf
XmSELECT_NONE /* no selections */
XmSELECT_SINGLE_ROW /* 0 or 1 row selection */
XmSELECT_BROWSE_ROW /* 1 row selection */
XmSELECT_MULTIPLE_ROW /* multiple row selection */
XmSELECT_CELL /* multiple row, column,
cell selections */
.fi
.IP XmNshadowRegions
Determines which regions are drawn with shadows. There are 9 regions
in the Grid numbered as follows:
.nf
1 2 4
8 16 32
64 128 256
.fi
Where 1, 2 and 4 combine to make the top fixed rows. 1, 8 and 64
combine into the left fixed columns, 16 is the scrolling region,
etc. The value should be set to the summation of the region�s
numbers which should be drawn with a shadow. For example, if
this value is set to 428 (64 + 128 + 256) the Grid will draw
a shadow box around each region in the bottom row. Regions not
included are drawn without shadows.
.IP XmNshadowType
The type of shadows to draw around the regions of the Grid.
Possible values:
.nf
XmSHADOW_ETCHED_IN /* etched in appearance */
XmSHADOW_ETCHED_OUT /* etched out appearance */
XmSHADOW_IN /* inset appearance */
XmSHADOW_OUT /* outset appearance */
.fi
.IP XmNsimpleHeadings
This resource may be used to set cell strings in the first
heading row in a Grid with a simple C string. The value passed
should be a null-terminated C string containing headings
separated by the pipe symbol. A heading row must exist at
the time of this call which contains the number of cells
which will be affected or the Grid will generate a warning.
The following example sets the headings of a Grid to "First",
"Second" and "Third":
.nf
XtVaSetValues(grid,
XmNsimpleHeadings, "First|Second|Third",
NULL);
.fi
The Grid makes a copy of the string passed to it for this resource
in a SetValues call. The Grid will return a pointer to this
internal copy of the string if GetValues is called for this resource
and the pointer returned should not be freed by an application.
.IP XmNsimpleWidths
This resource may be used to set the widths of columns in a Grid.
The value passed should be a null-terminated C string containing
numbers specifying widths and a letter 'p' or 'c' following the
number to indicate whether the width is in pixels or characters.
A space should be used after each letter to separate columns.
The columns affected by the call must exist at the time
a value is set, or the Grid will generate a warning. The
following example sets the width of the first column
to 10 characters wide and the second column to 20 pixels wide:
.nf
XtVaSetValues(grid,
XmNsimpleWidths, "10c 20p",
NULL);
.fi
The Grid makes a copy of the string passed to it for this resource
in a SetValues call. The Grid will return a pointer to this
internal copy of the string if GetValues is called for this resource
and the pointer returned should not be freed by an application.
.IP XmNtextWidget
The widget ID of the Grid's Text widget.
.IP XmNtopFixedCount
The number of fixed rows at the top of the Grid including
heading rows. Since heading rows must be fixed, this value may
not be set smaller than the number of heading rows. If this value is
greater than the total number of rows, then as additional rows
are added they will be fixed until this value is reached.
.IP XmNtopFixedMargin
The height, in pixels, of the margin between the top fixed rows
and any rows below them.
.IP XmNtraverseTranslations
The translations merged into the Text widget child of the Grid
when the Grid goes from edit mode into traverse mode.
.IP XmNuseAverageFontWidth
Cells in the Grid which contain text calculate their preferred
width based on the font list character width of the font list
assigned to the cell. The Grid calculates the font list character
width when font lists are assigned to cells. If the value of
this resource is True, the font list character width will be
calculated by averaging all of the glyph widths in the font list. If this
value is False, the font list character width will equal the
the maximum glyph width in the font list. Changing this resource
only affects font lists assigned after this value is changed, it does not
affect the current layout of the Grid. Also, this resource
only affects cells containing proportional fonts since a fixed
width font's average glyph width will equal its maximum glyph width.
.IP XmNverticalScrollBar
The widget ID of the Grid's vertical ScrollBar.
.IP XmNverticalSizePolicy
Determines how the Grid sizes itself vertically. Possible values:
.nf
XmVARIABLE /* Grid always requests
full height */
XmCONSTANT /* user or parent sets Grid
height and scrollbar is
displayed if needed */
.fi
If this value is XmVARIABLE, the Grid determines the amount
of vertical space required to display the entire Grid and
requests this space from its parent. When the height of the Grid
changes, it will request more or less space causing it to
shrink or expand as its parent widget allows. It will appear
truncated, without a vertical ScrollBar, if not enough space
is given by the parent. If this value is XmCONSTANT the user or
the parent widget must define the Grids height and a vertical
ScrollBar will appear if needed.
.IP XmNvisibleColumns
Setting this resource causes the Grid to request a width from
its parent equal to the value set multiplied by the width of
a standard 8 character wide cell. The actual width in pixels
requested is:
.nf
shadowThickness * 2 + value * (4 + 8 * defaultFontWidth +
defaultLeftMargin + defaultRightMargin)
.fi
The width requested is not determined using any existing column
values. For example, if you have 3 columns which are each 20
characters wide and you set XmNvisibleColumns to 3, the width
requested will not fit the 3 columns of 20 characters, it will
fit 3 columns of 8 characters (without Grid borders). The width
requested does depend on the default font in the Grid, however,
to determine the width of a standard 8 character wide cell.
If you want the Grid to request a width equal to the width of
the existing columns, see the XmNhorizontalSizePolicy resource's
XmVARIABLE setting.
.IP XmNvisibleRows
Setting this resource causes the Grid to request a height from
its parent equal to the value set multiplied by the height
of a default 1 character height cell. The actual height in pixels
requested is:
.nf
shadowThickness * 2 + value * (4 + defaultFontHeight +
defaultTopMargin + defaultBottomMargin)
.fi
The height requested is not determined using any existing row
values. For example, if you have 10 rows which are each 3
characters high and you set XmNvisibleRows to 10, the height
requested will not fit the 10 existing rows, it will fit
fit 10 rows of 1 character height (without Grid borders).
The height requested does depend on the default font in the
Grid, however, to determine the height of a standard cell.
If you want the Grid to request a height equal to the height of
the existing rows, see the XmNverticalSizePolicy resource's
XmVARIABLE setting.
.IP XmNvsbDisplayPolicy
When XmNverticalSizePolicy is XmCONSTANT, this resource
controls whether to display the vertical scroll bar if
all rows fit in the viewing area. Possible values:
.nf
XmSTATIC /* scrollbar always displays */
XmAS_NEEDED /* scrolbar only displayed when
scrolling is possible */
.fi
.SS Row/Column/Cell Resources
Grid defines the resources in the table below affecting rows,
columns and cells. A SetValues call can set values for a
single column using XmNcolumn or for a range of columns using
XmNcolumnRangeStart and XmNcolumnRangeEnd. Row values can be
set using XmNrow or XmNrowRangeStart and XmNrowRangeEnd.
Cell values can be set for a single cell using XmNcolumn and
XmNrow, or a range of cells using a variety of combinations
of row and column specifications. A GetValues call can retrieve
values for a column using XmNcolumnPtr, a row using XmNrowPtr,
and a cell using both XmNcolumnPtr and XmNrowPtr.
.nf
.ft B
Name Class
Type Default Access
.ft P
XmNcellAlignment XmCCellAlignment
unsigned char XmALIGNMENT_CENTER SG
XmNcellBackground XmCCellBackground
Pixel Dynamic SG
XmNcellBottomBorderColor XmCCellBottomBorderColor
Pixel Dynamic SG
XmNcellBottomBorderType XmCBottomBorderType
unsigned char XmBORDER_LINE SG
XmNcellColumnSpan XmCCellColumnSpan
int 0 SG
XmNcellDefaults XmCCellDefaults
Boolean False S
XmNcellEditable XmCCellEditable
Boolean False SG
XmNcellFontList XmCCellFontList
XmFontList Dynamic SG
XmNcellForeground XmCCellForeground
Pixel Dynamic SG
XmNcellLeftBorderColor XmCCellLeftBorderColor
Pixel Dynamic SG
XmNcellLeftBorderType XmCCellLeftBorderType
unsigned char XmBORDER_LINE SG
XmNcellMarginBottom XmCCellMarginBottom
Dimension 0 SG
XmNcellMarginLeft XmCCellMarginLeft
Dimension 0 SG
XmNcellMarginRight XmCCellMarginRight
Dimension 0 SG
XmNcellMarginTop XmCCellMarginTop
Dimension 0 SG
XmNcellPixmap XmCCellPixmap
Pixmap XmUNSPECIFIED_PIXMAP SG
XmNcellPixmapMask XmCCellPixmapMask
Pixmap XmUNSPECIFIED_PIXMAP SG
XmNcellRightBorderColor XmCCellRightBorderColor
Pixel Dynamic SG
XmNcellRightBorderType XmCCellRightBorderType
unsigned char XmBORDER_LINE SG
XmNcellRowSpan XmCCellRowSpan
int 0 SG
XmNcellString XmCXmString
XmString NULL SG
XmNcellTopBorderColor XmCCellTopBorderColor
Pixel Dynamic SG
XmNcellTopBorderType XmCCellTopBorderType
unsigned char XmBORDER_LINE SG
XmNcellType XmCCellType
unsigned char XmSTRING_CELL SG
XmNcellUserData XmCUserData
XtPointer 0 SG
XmNcolumn XmCGridColumn
int -1 S
XmNcolumnPtr (none)
XtPointer 0 G
XmNcolumnRangeEnd XmCColumnRangeEnd
int -1 S
XmNcolumnRangeStart XmCColumnRangeStart
int -1 S
XmNcolumnSizePolicy XmCColumnSizePolicy
unsigned char XmVARIABLE SG
XmNcolumnStep XmCColumnStep
int 1 S
XmNcolumnType XmCColumnType
unsigned char XmCONTENT S
XmNcolumnWidth XmCColumnWidth
Dimension 8 SG
XmNcolumnUserData XmCUserData
XtPointer 0 SG
XmNrow XmCGridRow
int -1 S
XmNrowHeight XmCRowHeight
Dimension 1 SG
XmNrowPtr (none)
XtPointer 0 G
XmNrowRangeEnd XmCRowRangeEnd
int -1 S
XmNrowRangeStart XmCRowRangeStart
int -1 S
XmNrowSizePolicy XmCRowSizePolicy
unsigned char XmVARIABLE SG
XmNrowStep XmCRowStep
int 1 S
XmNrowType XmCRowType
unsigned char XmCONTENT S
XmNrowUserData XmCUserData
XtPointer 0 SG
.fi
.IP XmNcellAlignment
Determines the alignment of the XmString or Pixmap contained in
the cell. Possible values:
.nf
XmALIGNMENT_LEFT /* left, centered vertically */
XmALIGNMENT_CENTER /* centered horizontally and
vertically */
XmALIGNMENT_RIGHT /* right, centered vertically */
XmALIGNMENT_TOP_LEFT /* top left */
XmALIGNMENT_TOP /* top, centered horizontally */
XmALIGNMENT_TOP_RIGHT /* top right */
XmALIGNMENT_BOTTOM_LEFT /* bottom left */
XmALIGNMENT_BOTTOM /* bottom, centered horizontally */
XmALIGNMENT_BOTTOM_RIGHT /* bottom right */
.fi
If a cell Pixmap does not have a width or height set, the
cell's alignment will be top left regardless of the value of
this resource since any other alignment could not be calculated.
.IP XmNcellBackground
The cell's background color.
.IP XmNcellBottomBorderColor
The color of the cell's bottom border. If the cell's bottom
border type is XmBORDER_NONE, no bottom border will be drawn and this
resource has no effect. The default value of this resource is the
bottom shadow color of the Grid.
.IP XmNcellBottomBorderType
Determines the type of border to draw at the bottom of
the cell. Possible values:
.nf
XmBORDER_NONE /* no border */
XmBORDER_DASH /* dashed line */
XmBORDER_LINE /* line border */
.fi
.IP XmNcellColumnSpan
The number of columns to the right that are spanned by this cell.
You may combine this with a row span to span both rows and columns.
When a cell spans into adjacent cells, those spanned cells are
not displayed; instead, the contents of the spanning cell are
displayed in the spanned area. This effectively makes the spanning
cell larger while not changing the cell's row or column size.
If cell spans overlap, the visual behavior of the spanned cells
will become undefined. If rows or columns are added or deleted
inside a spanned area, the visual behavior of the spanned
cells will become undefined. If rows or columns are moved or
reordered in a way which does not preserve existing cell spans,
the visual behavior of the spanned cells will become undefined. The
width of a column span in pixels cannnot exceed the maximum
value of the type Dimension. Setting a column span on a cell
sets its preferred cell width to 4 pixels. All cells in a span must
exist at the time the span is set.
.IP XmNcellDefaults
Setting this value to True in a SetValues call indicates that
the call is setting the default cell values. The default cell
values can be assigned on a per-column basis by setting this
resource to True and setting a column (using XmNcolumn) or a
range of columns in the SetValues call. For example, to set
the default editibility for cells in column 0 to editable,
you could:
.nf
XtVaSetValues(grid,
XmNcellDefaults, True,
XmNcolumn, 0,
XmNcellEditable, True,
NULL);
.fi
This specifies that any cell created (cells are created by adding
rows or columns) in column 0 will be editable by default. If you
do not specify a column in a SetValues call where XmNcellDefaults is
True, the default cell values in the call will be set for all columns.
Inotherwords, it will set the defaults for any new cell created.
This value is always reset to False after a SetValues call completes.
.IP XmNcellEditable
Allow (True) or disallow (False) a user either by typing,
using a cut/paste or drag/drop operation, to edit the
cell. This may only be set to True for cells with a XmNcellType
of XmSTRING_CELL.
.IP XmNcellFontList
The font list used for the cell's text. By default, the value
of this resource is set to the Grid's XmNfontList. Changing this
value may cause the row or column containing the cell to resize if
the row's XmNrowSizePolicy or the column's XmNcolumnSizePolicy
is XmVARIABLE.
.IP XmNcellForeground
The cell's foreground color.
.IP XmNcellLeftBorderColor
The color of the cell's left border. If the cell's left border
type is XmBORDER_NONE, no left border will be drawn and this resource
has no effect. The default value of this resource is the top shadow
color of the Grid.
.IP XmNcellLeftBorderType
Determines the type of border to draw at the left of the cell.
Possible values:
.nf
XmBORDER_NONE /* no border */
XmBORDER_DASH /* dashed line */
XmBORDER_LINE /* line border */
.fi
.IP XmNcellMarginBottom
The height, in pixels, of the margin between the bottom of
the cell and the cell's contents.
.IP XmNcellMarginLeft
The width, in pixels, of the margin between the left of
the cell and the cell's contents.
.IP XmNcellMarginRight
The width, in pixels, of the margin between the right of
the cell and the cell's contents.
.IP XmNcellMarginTop
The height, in pixels, of the margin between the top of
the cell and the cell's contents.
.IP XmNcellPixmap
The Pixmap to draw in the cell if the cell's type is XmPIXMAP_CELL.
As in other widgets, the Grid does not make a copy of the Pixmap.
Therefore, the Pixmap should not be freed until it is
no longer required to be displayed by the Grid. Changing this
value may cause the row or column containing the cell to resize
if the row's XmNrowSizePolicy or the column's XmNcolumnSizePolicy
is XmVARIABLE. This value may be XmUNSPECIFIED_PIXMAP.
.IP XmNcellPixmapMask
The pixmap mask to use when drawing a cell if the cell's type is
XmPIXMAP_CELL. This value must be either XmUNSPECIFIED_PIXMAP (the
default) or a Pixmap of depth 1. If set to a Pixmap of depth 1,
the Pixmap specified will be used as a mask for drawing the cell's
contents. As in other widgets, the Grid does not make a copy of
the Pixmap passed. Therefore, the Pixmap should not be freed until
it is no longer required to be used by the Grid.
.IP XmNcellRightBorderColor
The color of the cell's right border. If the cell's right border
type is XmBORDER_NONE, no right border will be drawn and this resource
has no effect. The default value of this resource is the bottom
shadow color of the Grid.
.IP XmNcellRightBorderType
Determines the type of border to draw at the right of the cell.
Possible values:
.nf
XmBORDER_NONE /* no border */
XmBORDER_DASH /* dashed line */
XmBORDER_LINE /* line border */
.fi
.IP XmNcellRowSpan
The number of rows below that are spanned by this cell. You may
combine this with a column span to span both rows and columns.
When a cell spans into adjacent cells, those spanned cells
are not displayed; instead, the contents of the spanning cell
are displayed in the spanned area. This effectively makes the
spanning cell larger while not changing the cell's row or column size.
If cell spans overlap, the visual behavior of the spanned cells
will become undefined. If rows or columns are added or deleted
inside a spanned area, the visual behavior of the spanned cells will
become undefined. If rows or columns are moved or reordered in
a way which does not preserve existing cell spans, the visual
behavior of the spanned cells will become undefined. The height
of a row span in pixels cannnot exceed the maximum value of the
type Dimension. Setting a row span on a cell sets its preferred
cell height to 4 pixels. All cells in a span must exist at the time
the span is set.
.IP XmNcellString
The compound string to draw in the cell if the cell's type
is XmSTRING_CELL. As in other widgets, the Grid
makes a copy of the string and so the string may be freed after
it is used to set this value. Retrieving this value will return
a copy of the cell's string, therefore the retrieved string should
be freed when it will no longer be used. This value
may be NULL.
.IP XmNcellTopBorderColor
The color of the cell's top border. If the cell's top border
type is XmBORDER_NONE, no top border will be drawn and this resource
has no effect. The default value of this resource is the top shadow color
of the Grid.
.IP XmNcellTopBorderType
Determines the type of border to draw at the top of the cell.
Possible values:
.nf
XmBORDER_NONE /* no border */
XmBORDER_DASH /* dashed line */
XmBORDER_LINE /* line border */
.fi
.IP XmNcellType
The type of the cell. Possible values:
.nf
XmSTRING_CELL /* cell displaying XmString */
XmPIXMAP_CELL /* cell displaying a Pixmap */
.fi
Changing this value may cause the row or column containing the
cell to resize if the row's XmNrowSizePolicy or the column's
XmNcolumnSizePolicy is XmVARIABLE. Changing a cell's type from
XmSTRING_CELL to XmPIXMAP_CELL will free the XmNcellString
currently contained in the cell and will set the XmNcellString
to NULL. Changing from XmPIXMAP_CELL to XmSTRING_CELL will
cause the cell's XmNcellPixmap to be set to XmUNSPECIFIED_PIXMAP.
.IP XmNcellUserData
A pointer value unused by the Grid. This resource allows you
to attach a pointer to any cell in the Grid.
.IP XmNcolumn
Defines which column(s) or cell(s) a SetValues call will affect.
A value of -1 (the default) means all columns. This value is
always reset to -1 after the SetValues call completes. The value of 0
defines the first column of a column type. This resource may not
be used in a GetValues call.
.IP XmNcolumnPtr
Defines which column, or column a cell is contained in, a
GetValues call should retrieve values for. This value is a
pointer to a column which should be obtained using XmLGridGetColumn().
This resource may not be used in a SetValues call.
.IP XmNcolumnRangeEnd
Defines the last column or column of cells in a range which a
SetValues call will affect. This resource may not be used in a
GetValues call. This resource must be used with the
XmNcolumnRangeStart resource.
.IP XmNcolumnRangeStart
Defines the first column or column of cells in a range which
a SetValues call will affect. This resource may not be used
in a GetValues call. This resource must be used with the
XmNcolumnRangeEnd resource.
.IP XmNcolumnSizePolicy
Defines how the column width is determined. Possible values:
.nf
XmCONSTANT /* column size is fixed */
XmVARIABLE /* column may resize when
cell size changes */
.fi
If XmVARIABLE, the column will size itself to the maximum
preferred width of the column's cells. For cells containing text,
this usually equals the cell's average or maximum font list glyph
width multiplied by the XmNcolumnWidth (plus space for borders, etc).
If XmCONSTANT, the XmNcolumnWidth value is assumed to be in
pixels and the column width will equal that value.
.IP XmNcolumnStep
Defines the column increment when setting values of multiple
columns or cells in a SetValues call. For example, a column
step of 2 will skip every other column. This value is 1 by default
and will reset to 1 after a SetValues call completes.
.IP XmNcolumnType
Defines which type of columns or cells a SetValues call will
affect. This resource may not be used in a GetValues call.
Possible values:
.nf
XmALL_TYPES /* all column types - heading, content
and footer */
XmCONTENT /* columns containing the Grid's
contents */
XmHEADING /* heading columns on the far left */
XmFOOTER /* footer columns on the far right */
.fi
This resource is used along with XmNcolumn or XmNcolumnRangeStart and
XmNcolumnRangeEnd and determines which type of column the column or
column range specifies. By default, this value is set to XmCONTENT.
This value is always reset to XmCONTENT after a SetValues call completes.
.IP XmNcolumnUserData
A pointer value unused by the Grid. This resource allows you
to attach a pointer to any column in the Grid.
.IP XmNcolumnWidth
If XmNcolumnSizePolicy is XmVARIABLE, the value of this resource
represents the column width in characters and if a font list in
any cell in the column is changed, the column will resize
if required. The pixel width of a column is determined by the
maximum preferred width of the column's cells. Cells containing
text usually determine their preferred width by multiplying the
cell's average or maximum font list glyph width by the column's
XmNcolumnWidth. Pixmap cells ignore this resource since their
preferred width is the width of their pixmap. If
XmNcolumnSizePolicy is XmCONSTANT, the value of this resource
represents the column width in pixels.
.IP XmNrow
Defines which row(s) or cell(s) a SetValues call will affect.
A value of -1 (the default) means all rows. The value of 0
defines the first row of a row type. This value is always
reset to -1 after a SetValues call completes. This resource
may not be used in a GetValues call.
.IP XmNrowHeight
If XmNrowSizePolicy is XmVARIABLE, the value of this resource
represents the row height in characters and if a font list in
any cell in this row is changed, the row will resize if required. The
pixel height of a row is determined by the maximum preferred
height of the row's cells. Cells containing text usually determine
their preferred height by taking their maximum font list
character height and multiplying it by the row's XmNrowHeight.
Pixmap cells ignore this resource since their preferred height
is the height of their pixmap. If XmNrowSizePolicy is
XmCONSTANT, the value of this resource represents the row height in pixels.
.IP XmNrowPtr
Defines which row, or row a cell is contained in, a GetValues
call should retrieve values for. This value is a pointer to a
row which should be obtained using XmLGridGetRow(). This
resource may not be used in a SetValues call.
.IP XmNrowRangeEnd
Defines the last row or row of cells in a range which a SetValues
call will affect. This resource may not be used in a GetValues
call. This resource must be used with the XmNrowRangeStart resource.
.IP XmNrowRangeStart
Defines the first row or row of cells in a range which a SetValues
call will affect. This resource may not be used in a GetValues call.
This resource must be used with the XmNrowRangeEnd resource.
.IP XmNrowSizePolicy
Defines how the row height is determined. Possible values:
.nf
XmCONSTANT /* row size is fixed */
XmVARIABLE /* row may resize when cell
size changes */
.fi
If XmVARIABLE, the row will size itself to the maximum preferred
height of the row's cells. For cells containing text, this usually
equals the cell's maximum font list glyph height multiplied
by the XmNrowHeight (plus space for borders, etc). If XmCONSTANT,
the XmNrowHeight value is assumed to be in pixels and the row
height will equal that value.
.IP XmNrowStep
Defines the row increment when setting values of multiple rows
or cells in a SetValues call. For example, a row step of 2 will
skip every other row. This value is 1 by default and will reset to 1
when a SetValue call completes.
.IP XmNrowType
Defines which type of rows or cells a SetValues call will affect.
This resource may not be used in a GetValues call. Possible values:
.nf
XmALL_TYPES /* all row types - heading/content
and footer */
XmCONTENT /* rows containing the Grid's contents */
XmHEADING /* heading rows on the top */
XmFOOTER /* footer rows on the bottom */
.fi
This resource is used along with XmNrow or XmNrowRangeStart and
XmNrowRangeEnd and determines which type of row the row or row
range specifies. By default, this value is set to XmCONTENT.
This value is always reset to XmCONTENT after a SetValues call completes.
.IP XmNrowUserData
A pointer value unused by the Grid. This resource allows you
to attach a pointer to any row in the Grid.
.SS Callback Resources
Grid defines the following callback resources.
.nf
.ft B
Callback Reasons Called When
.ft P
XmNactivateCallback XmCR_ACTIVATE Cell is activated with
Return or double-click
XmNaddCallback XmCR_ADD_CELL Row, column or cell is
XmCR_ADD_COLUMN created by calling a function
XmCR_ADD_ROW which adds rows or columns
XmNcellDrawCallback XmCR_CELL_DRAW Cell is drawn
XmNcellDropCallback XmCR_CELL_DROP Cell value was changed by new
value dropped into cell
XmNcellFocusCallback XmCR_CELL_FOCUS_IN Focus cell is set or changed
XmCR_CELL_FOCUS_OUT
XmNcellPasteCallback XmCR_CELL_PASTE Cell value was changed by new
value pasted into cell
XmNdeleteCallback XmCR_DELETE_CELL Row, column or cell is
XmCR_DELETE_COLUMN deleted by calling a
XmCR_DELETE_ROW function which deletes
rows or columns
XmNdeselectCallback XmCR_DESELECT_CELL Row, column or cell
XmCR_DESELECT_COLUMN changes from selected
XmCR_DESELECT_ROW to deselected (see also
XmNselectionPolicy resource)
XmNeditCallback XmCR_EDIT_BEGIN Cell edit begins, cancels,
XmCR_EDIT_CANCEL completes or when an
XmCR_EDIT_COMPLETE insert-begin occurs in
XmCR_EDIT_INSERT a cell
XmNresizeCallback XmCR_RESIZE_ROW Row or column is resized
XmCR_RESIZE_COLUMN interactively
XmNscrollCallback XmCR_SCROLL_ROW Current scrolled row or
XmCR_SCROLL_COLUMN column position changes
XmNselectCallback XmCR_SELECT_CELL Row, column or cell is
XmCR_SELECT_COLUMN selected (see also
XmCR_SELECT_ROW XmNselectionPolicy resource)
.fi
.SS Callback Structure
Each callback function is passed a pointer to the structure
shown below; however, only those values which are meaningful
for the callback are set.
.nf
typedef struct
{
int reason; /* callback reason */
XEvent *event; /* event causing callback or NULL */
unsigned char rowType, columnType; /* row and column types */
int row, int column; /* row and column positions */
XRectangle *clipRect; /* clipping rectangle */
XmLGridDrawInfoStruct *drawInfo; /* pointer to draw info */
void *object; /* reserved */
} XmLGridCallbackStruct;
.fi
The drawInfo pointer is set to point to the structure below for
XmNcellDraw callbacks.
.nf
typedef struct
{
GC gc; /* GC used for drawing */
XRectangle *cellRect; /* location/dimensions of
cell (unclipped) */
Dimension topMargin; /* cell margins */
Dimension bottomMargin;
Dimension leftMargin;
Dimension rightMargin;
Pixel foreground; /* cell foreground */
Pixel background; /* cell background */
Pixel selectForeground; /* cell foreground if selected */
Pixel selectBackground; /* cell background if selected */
XmFontList fontList; /* cell fontlist */
unsigned char alignment; /* cell alignment */
Boolean drawSelected; /* True if cell, row or
column selected */
int drawFocusType;
/* type of focus cell has, one of:
XmDRAW_FOCUS_NONE - cell does not have focus
XmDRAW_FOCUS_CELL - focus is in cell
XmDRAW_FOCUS_LEFT - cell is leftmost in focus row
XmDRAW_FOCUS_RIGHT - cell is rightmost in focus row
XmDRAW_FOCUS_MID - cell is in middle of focus row */
XmStringDirection stringDirection;
/* direction for string drawing */
} XmLGridDrawInfoStruct;
.fi
The following table shows which values are set for which callback
reasons. Elements not set will have undefined values.
.nf
.ft B
Reason Values Set
.ft P
XmCR_ACTIVATE event, rowType, columnType, row, column
XmCR_ADD_CELL rowType, columnType
XmCR_ADD_COLUMN columnType
XmCR_ADD_ROW rowType
XmCR_CELL_DRAW event, rowType, columnType, row, column,
clipRect, drawInfo
XmCR_CELL_DROP rowType, columnType, row, column
XmCR_CELL_FOCUS_IN rowType, columnType, row, column
XmCR_CELL_FOCUS_OUT rowType, columnType, row, column
XmCR_CELL_PASTE rowType, columnType, row, column
XmCR_DELETE_CELL rowType, columnType
XmCR_DELETE_COLUMN columnType
XmCR_DELETE_ROW rowType
XmCR_DESELECT_CELL event, rowType, columnType, row, column
XmCR_DESELECT_COLUMN event, columnType, column
XmCR_DESELECT_ROW event, rowType, row
XmCR_EDIT_BEGIN rowType, columnType, row, column
XmCR_EDIT_COMPLETE rowType, columnType, row, column
XmCR_EDIT_CANCEL rowType, columnType, row, column, clipRect
XmCR_EDIT_INSERT rowType, columnType, row, column, clipRect
XmCR_RESIZE_ROW rowType, row
XmCR_RESIZE_COLUMN columnType, column
XmCR_SCROLL_ROW rowType, row
XmCR_SCROLL_COLUMN columnType, column
XmCR_SELECT_CELL event, rowType, columnType, row, column
XmCR_SELECT_COLUMN event, columnType, column
XmCR_SELECT_ROW event, rowType, row
.ni
.SS Inherited Resources
Grid inherits the resources shown below. The Grid resets its
default XmNshadow-Thickness to 2.
.nf
.ft B
Resource From Resource From
.ft P
XmNaccelerators Core XmNinitialResourcePersist Core
XmNancestorSensitive Core XmNinsertPosition Composite
XmNbackground Core XmNmappedWhenManaged Core
XmNbackgroundPixmap Core XmNnavagationType Manager
XmNborderColor Core XmNnumChildren Composite
XmNborderPixmap Core XmNscreen Core
XmNborderWidth Core XmNsensitive Core
XmNbottomShadowColor Manager XmNshadowThicknses Manager
XmNbottomShadowPixmap Manager XmNstringDirection Manager
XmNchildren Composite XmNtopShadowColor Manager
XmNcolormap Core XmNtopShadowPixmap Manager
XmNdepth Core XmNtranslations Core
XmNdestroyCallback Core XmNtraversalOn Manager
XmNforeground Manager XmNunitType Manager
XmNheight Core XmNuserData Manager
XmNhelpCallback Manager XmNwidth Core
XmNhighlightColor Manager XmNx Core
XmNhighlightPixmap Manager XmNy Core
.fi
.SS Grid Translations
Grid defines the translations shown below.
.nf
.ft B
Event Action Event Action
.ft P
BSelect Press XmLGridSelect(BEGIN) BExtend Motion XmLGridButtonMotion()
BExtend Press XmLGridSelect(EXTEND) BToggle Motion XmLGridButtonMotion()
BToggle Press XmLGridSelect(TOGGLE) BSelect Release XmLGridSelect(END)
BSelect Motion XmLGridButtonMotion() BExtend Release XmLGridSelect(END)
BDrag Press XmLGridDragStart()
.fi
.SS Grid Text Traverse Translations
When the Grid widget enters traverse mode, it overrides its Text
widget child's translations with those shown below.
.nf
.ft B
Event Action
.ft P
KUp XmLGridTraverse(UP)
MCtrl KPageDown XmLGridTraverse(PAGE_RIGHT)
MShift KUp XmLGridTraverse(EXTEND_UP)
MCtrl MShift KPageDown XmLGridTraverse(EXTEND_ PAGE_RIGHT)
MCtrl KUp XmLGridTraverse(PAGE_UP)
KTab XmLGridTraverse(RIGHT)
KDown XmLGridTraverse(DOWN)
MShift KTab XmLGridTraverse(LEFT)
MShift KDown XmLGridTraverse(EXTEND_DOWN)
KBeginLine XmLGridTraverse(TO_TOP)
MCtrl KDown XmLGridTraverse(PAGE_DOWN)
KEndLine XmLGridTraverse(TO_BOTTOM)
KLeft XmLGridTraverse(LEFT)
KHome XmLGridTraverse(TO_TOP)
MShift KLeft XmLGridTraverse(EXTEND_LEFT)
MCtrl KHome XmLGridTraverse(TO_TOP_LEFT)
MCtrl KLeft XmLGridTraverse(PAGE_LEFT)
KEnd XmLGridTraverse(TO_BOTTOM)
KRight XmLGridTraverse(RIGHT)
MCtrl KEnd XmLGridTraverse(TO_BOTTOM_RIGHT)
MShift KRight XmLGridTraverse(EXTEND_RIGHT)
KInsert XmLGridEdit()
MCtrl KRight XmLGridTraverse(PAGE_RIGHT)
KF2 XmLGridEdit()
KPageUp XmLGridTraverse(PAGE_UP)
KSelect Press XmLGridSelect(BEGIN)
MShift KPageUp XmLGridTraverse(EXTEND_ PAGE_UP)
MCtrl KSelect Press XmLGridSelect(TOGGLE)
MCtrl KPageUp XmLGridTraverse(PAGE_LEFT)
KSelect Release XmLGridSelect(END)
MCtrl MShift KPageUp XmLGridTraverse(EXTEND_ PAGE_LEFT)
KEntend Press XmLGridSelect(EXTEND)
KPageDown XmLGridTraverse(PAGE_DOWN)
KExtend Release XmLGridSelect(END)
MShift KPageDown XmLGridTraverse(EXTEND_ PAGE_DOWN)
KActivate XmLGridSelect(ACTIVATE)
.fi
.SS Grid Text Edit Translations
When the Grid widget enters edit mode, it overrides its Text
widget child's translations with those shown below.
.nf
.ft B
Event Action Event Action
.ft P
KDown XmLGridEditComplete(DOWN) KCancel XmLGridEditCancel()
MShift KTab XmLGridEditComplete(LEFT) KActivate XmLGridEditComplete()
KTab XmLGridEditComplete(RIGHT) KUp XmLGridEditComplete(UP)
.fi
.SS Action Routines
Grid defines the actions shown below.
.IP XmLGridButtonMotion()
Moves any active resize line or extends the current selection if needed.
.IP XmLGridCursorMotion()
Changes the cursor to a resize cursor if it is over a resize area.
.IP XmLGridDragStart()
Begins a drag of the selected cells if required.
.IP XmLGridEdit()
Enters the Grid into edit mode and begins an edit of the current focus cell.
.IP XmLGridEditCancel()
Cancels any cell edit in progress and returns the Grid to traverse mode.
.IP XmLGridEditComplete(direction)
Completes any edit in progress and traverses in the direction specified.
.IP XmLGridSelect(mode)
Begins or completes selection of the mode type given depending
on the event passed to the action function.
.IP XmLGridTraverse(direction)
Traverses in the given direction from the current focus cell.
If traversal is successful, the new focus cell will be made
visible, scrolling the Grid if necessary.
.SH "SEE ALSO"
XmLCreateGrid(3X) XmLGridAddColumns(3X) XmLGridAddRows(3X)
XmLGridColumnIsVisible(3X) XmLGridDeleteAllColumns(3X) XmLGridDeleteAllRows(3X) XmLGridDeleteColumns(3X) XmLGridDeleteRows(3X) XmLGridDeselectAllCells(3X)
XmLGridDeselectAllColumns(3X) XmLGridDeselectAllRows(3X)
XmLGridDeselectCell(3X) XmLGridDeselectColumn(3X) XmLGridDeselectRow(3X)
XmLGridEditBegin(3X) XmLGridEditCancel(3X) XmLGridEditComplete(3X)
XmLGridGetColumn(3X) XmLGridGetFocus(3X)
XmLGridGetRow(3X) XmLGridGetSelectedCellCount(3X) XmLGridGetSelectedCells(3X)
XmLGridGetSelectedColumnCount(3X) XmLGridGetSelectedColumns(3X)
XmLGridGetSelectedRow(3X) XmLGridGetSelectedRowCount(3X)
XmLGridGetSelectedRows(3X) XmLGridMoveColumns(3X) XmLGridMoveRows(3X)
XmLGridRead(3X) XmLGridReadPos(3X) XmLGridRedrawAll(3X) XmLGridRedrawCell(3X)
XmLGridRedrawColumn(3X) XmLGridRedrawRow(3X) XmLGridReorderColumns(3X)
XmLGridReorderRows(3X) XmLGridRowColumnToXY(3X) XmLGridRowlsVisible(3X)
XmLGridSelectAllCells(3X) XmLGridSelectAllColumns(3X) XmLGridSelectAllRows(3X)
XmLGridSelectCell(3X) XmLGridSelectColumn(3X) XmLGridSelectRow(3X)
XmLGridSetFocus(3X) XmLGridSetStrings(3X) XmLGridSetStringsPos(3X)
XmLGridWrite(3X) XmLGridWritePos(3X) XmLGridXYToRowColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridAddColumns.3x0000644000175000017500000000672310077552126020357 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridAddColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridAddColumns \- add columns to a Grid
.SH SYNTAX
void XmLGridAddColumns(\fIwidget\fP, \fItype\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of column
.IP \fIposition\fP 1i
position of first column
.IP \fIcount\fP 1i
number of columns to add
.SH DESCRIPTION
Adds \fIcount\fP columns of the given \fItype\fP at the specified
\fIposition\fP. See the XmLGrid man page for an explaination of column
types. A position of 0 indicates the first column
of the given type. A position of -1 specifies after the last
position of that column type. The Grid will call its XmNaddCallback
callbacks for each column and cell it creates. It will remain
scrolled to the column scrolled to prior to the addition of
columns, and focus will remain in the column which had focus
prior to the addition of the columns.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridAddRows(3X)
nedit-5.6.orig/Microline/man/XmLGridAddRows.3x0000644000175000017500000000664610077552126017675 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridAddRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridAddRows \- add rows to a Grid
.SH SYNTAX
void XmLGridAddRows(\fIwidget\fP, \fItype\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of row
.IP \fIposition\fP 1i
position of first row
.IP \fIcount\fP 1i
number of rows to add
.SH DESCRIPTION
Adds \fIcount\fP rows of the given \fItype\fP at the specified
\fIposition\fP. See the XmLGrid man page for an explaination of row
types. A position of 0 indicates the first row
of the given type. A position of -1 specifies after the last
position of that row type. The Grid will call its XmNaddCallback
callbacks for each row and cell it creates. It will remain
scrolled to the row scrolled to prior to the addition of
rows, and focus will remain in the row which had focus
prior to the addition of the rows.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridAddColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridColumnIsVisible.3x0000644000175000017500000000573610077552126021400 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridColumnIsVisible 3X "R1" "XML1" "XML"
.SH NAME
XmLGridColumnIsVisible \- determine visiblily of a content column
.SH SYNTAX
void XmLGridColumnIsVisible(\fIwidget\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIcolumn\fP 1i
position of content column
.SH DESCRIPTION
Determines visibility of a content column.
.SH RETURN VALUE
Returns True if any part of the content column given is visible
to the user, and False otherwise.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridRowIsVisible(3X)
nedit-5.6.orig/Microline/man/XmLGridCopyPos.3x0000644000175000017500000000727210077552126017722 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridCopyPos 3X "R1" "XML1" "XML"
.SH NAME
XmLGridCopyPos \- copy the string contents of cells in a Grid at a
given location to the clipboard
.SH SYNTAX
Boolean XmLGridCopyPos(\fIwidget\fP, \fItime\fP, \fIrowType\fP, \fIrow\fP, \
\fIcolumnType\fP, \fIcolumn\fP, \fInrow\fP, \fIncolumn\fP)
.br
Widget \fIwidget\fP;
.br
Time \fItime\fP;
.br
unsigned char \fIrowType\fP;
.br
int \fIrow\fP;
.br
unsigned char \fIcolumnType\fP;
.br
int \fIcolumn\fP;
.br
int \fInrow\fP;
.br
int \fIncolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItime\fP 1i
Time of event
.IP \fIrowType\fP 1i
type of first row
.IP \fIrow\fP 1i
location of first row
.IP \fIcolumnType\fP 1i
type of first column
.IP \fIcolumn\fP 1i
location of first column
.IP \fInrow\fP 1i
number of rows
.IP \fIncolumn\fP 1i
number of columns
.SH DESCRIPTION
Copies the contents of cells in \fInrow\fP number of rows and
\fIncolumn\fP number of columns to the clipboard
starting at the row and column specified by
\fIrowType\fP, \fIrow\fP, \fIcolumnType\fP, and \fIcolumn\fP.
The \fItime\fP parameter should be set to the time of the event
(most likely CurrentTime).
.SH RETURN VALUE
A value of True is returned upon success, and False is returned
upon failure.
.SH "SEE ALSO"
XmLGridCopySelected(3X) XmLGridPaste(3X)
nedit-5.6.orig/Microline/man/XmLGridCopySelected.3x0000644000175000017500000000607010077552126020704 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridCopySelected 3X "R1" "XML1" "XML"
.SH NAME
XmLGridCopySelected \- copy the string contents of selected cells in a Grid
to the clipboard
.SH SYNTAX
Boolean XmLGridCopySelected(\fIwidget\fP, \fItime\fP)
.br
Widget \fIwidget\fP;
.br
Time \fItime\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItime\fP 1i
Time of event
.SH DESCRIPTION
Copies the contents any selected cells in a Grid to the clipboard.
The \fItime\fP parameter should be set to the time of the event
(most likely CurrentTime).
.SH RETURN VALUE
True is returned upon success, and False is returned upon failure.
.SH "SEE ALSO"
XmLGridCopyPos(3X) XmLGridPaste(3X)
nedit-5.6.orig/Microline/man/XmLGridDeleteAllColumns.3x0000644000175000017500000000663210077552126021521 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeleteAllColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeleteAllColumns \- delete all columns of a given type
.SH SYNTAX
void XmLGridDeleteAllColumns(\fIwidget\fP, \fItype\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of column
.SH DESCRIPTION
Deletes all columns of the given type. The Grid will call its
XmNdeleteCallback callbacks for each column and cell deleted.
If possible, the focus will remain in the column which had focus
prior to the deletion of columns. If the cell which has focus
is in one of the columns deleted, the Grid's XmNcellFocusCallback
callbacks will be called with a reason of XmCR_CELL_FOCUS_OUT before
that column is deleted. If a cell in one of the columns is
currently being edited, the Grid's XmNeditCallback callbacks
will be called with a reason of XmCR_EDIT_CANCEL before that
column is deleted.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridDeleteColumns(3X) XmLGridDeleteAllRows(3X)
nedit-5.6.orig/Microline/man/XmLGridDeleteAllRows.3x0000644000175000017500000000656310077552126021036 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeleteAllRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeleteAllRows \- delete all rows of a given type
.SH SYNTAX
void XmLGridDeleteAllRows(\fIwidget\fP, \fItype\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of row
.SH DESCRIPTION
Deletes all rows of the given type. The Grid will call its
XmNdeleteCallback callbacks for each row and cell deleted.
If possible, the focus will remain in the row which had focus
prior to the deletion of rows. If the cell which has focus
is in one of the rows deleted, the Grid's XmNcellFocusCallback
callbacks will be called with a reason of XmCR_CELL_FOCUS_OUT before
that row is deleted. If a cell in one of the rows is
currently being edited, the Grid's XmNeditCallback callbacks
will be called with a reason of XmCR_EDIT_CANCEL before that
row is deleted.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridDeleteRows(3X) XmLGridDeleteAllColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridDeleteColumns.3x0000644000175000017500000000721510077552126021066 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeleteColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeleteColumns \- delete columns in a Grid
.SH SYNTAX
void XmLGridDeleteColumns(\fIwidget\fP, \fItype\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of column
.IP \fIposition\fP 1i
position of first column
.IP \fIcount\fP 1i
number of columns to delete
.SH DESCRIPTION
Deletes \fIcount\fP columns of the given \fItype\fP in the Grid at
the specified \fIposition\fP. A position of 0 indicates the
first column of the given type. The Grid will call its
XmNdeleteCallback callbacks for each column and cell deleted.
If possible, the focus will remain in the column which had
focus prior to the deletion of columns. If the cell which has
focus is in one of the columns deleted, the Grid's
XmNcellFocusCallback callbacks will be called with a reason of
XmCR_CELL_FOCUS_OUT before that column is deleted.
If a cell in one of the columns is currently being edited,
the Grid's XmNeditCallback callbacks will be called with a
reason of XmCR_EDIT_CANCEL before that column is deleted.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridDeleteRows(3X)
nedit-5.6.orig/Microline/man/XmLGridDeleteRows.3x0000644000175000017500000000714010077552126020375 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeleteRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeleteRows \- delete rows in a Grid
.SH SYNTAX
void XmLGridDeleteRows(\fIwidget\fP, \fItype\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of row
.IP \fIposition\fP 1i
position of first row
.IP \fIcount\fP 1i
number of rows to delete
.SH DESCRIPTION
Deletes \fIcount\fP rows of the given \fItype\fP in the Grid at
the specified \fIposition\fP. A position of 0 indicates the
first row of the given type. The Grid will call its
XmNdeleteCallback callbacks for each row and cell deleted.
If possible, the focus will remain in the row which had
focus prior to the deletion of rows. If the cell which has
focus is in one of the rows deleted, the Grid's
XmNcellFocusCallback callbacks will be called with a reason of
XmCR_CELL_FOCUS_OUT before that row is deleted.
If a cell in one of the rows is currently being edited,
the Grid's XmNeditCallback callbacks will be called with a
reason of XmCR_EDIT_CANCEL before that row is deleted.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridDeleteColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridDeselectAllCells.3x0000644000175000017500000000576310077552126021475 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeselectAllCells 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeselectAllCells \- deselect all content cells
.SH SYNTAX
void XmLGridDeselectAllCells(\fIwidget\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInotify\fP 1i
if True, deselect callbacks will be called
.SH DESCRIPTION
Deselects all content cells in the Grid. If \fInotify\fP is True,
the Grid's XmNdeselectCallback callbacks will be called for
each cell deselected.
.SH "SEE ALSO"
XmLGridDeselectAllRows(3X) XmLGridDeselectAllColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridDeselectAllColumns.3x0000644000175000017500000000577510077552126022056 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeselectAllColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeselectAllColumns \- deselect all content columns
.SH SYNTAX
void XmLGridDeselectAllColumns(\fIwidget\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInotify\fP 1i
if True, deselect callbacks will be called
.SH DESCRIPTION
Deselects all content columns in the Grid. If \fInotify\fP is True,
the Grid's XmNdeselectCallback callbacks will be called for
each column deselected.
.SH "SEE ALSO"
XmLGridDeselectAllCells(3X) XmLGridDeselectAllRows(3X)
nedit-5.6.orig/Microline/man/XmLGridDeselectAllRows.3x0000644000175000017500000000575610077552126021367 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeselectAllRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeselectAllRows \- deselect all content rows
.SH SYNTAX
void XmLGridDeselectAllRows(\fIwidget\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInotify\fP 1i
if True, deselect callbacks will be called
.SH DESCRIPTION
Deselects all content rows in the Grid. If \fInotify\fP is True,
the Grid's XmNdeselectCallback callbacks will be called for
each row deselected.
.SH "SEE ALSO"
XmLGridDeselectAllCells(3X) XmLGridDeselectAllColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridDeselectCell.3x0000644000175000017500000000631210077552126020650 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeselectCell 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeselectCell \- deselect a cell
.SH SYNTAX
void XmLGridDeselectCell(\fIwidget\fP, \fIrow\fP, \
\fIcolumn\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
int \fIrow\fP;
.br
int \fIcolumn\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrow\fP 1i
position of content row
.IP \fIcolumn\fP 1i
position of content column
.IP \fInotify\fP 1i
if True, deselect callbacks will be called
.SH DESCRIPTION
Deselects the cell in the Grid at the content \fIrow\fP and
content \fIcolumn\fP specified. If \fInotify\fP is True
and the cell is currently selected, the Grid's XmNdeselectCallback
callbacks will be called.
.SH "SEE ALSO"
XmLGridDeselectAllCells(3X) XmLGridDeselectRow(3X)
XmLGridDeselectColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridDeselectColumn.3x0000644000175000017500000000607110077552126021230 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeselectColumn 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeselectColumn \- deselect a column
.SH SYNTAX
void XmLGridDeselectColumn(\fIwidget\fP, \fIcolumn\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
int \fIcolumn\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIcolumn\fP 1i
position of content column
.IP \fInotify\fP 1i
if True, deselect callbacks will be called
.SH DESCRIPTION
Deselects the specified content \fIcolumn\fP in the Grid. If \fInotify\fP
is True and the column is currently selected, the Grid's
XmNdeselectCallback callbacks will be called.
.SH "SEE ALSO"
XmLGridDeselectAllColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridDeselectRow.3x0000644000175000017500000000603010077552126020535 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridDeselectRow 3X "R1" "XML1" "XML"
.SH NAME
XmLGridDeselectRow \- deselect a row
.SH SYNTAX
void XmLGridDeselectRow(\fIwidget\fP, \fIrow\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
int \fIrow\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrow\fP 1i
position of content row
.IP \fInotify\fP 1i
if True, deselect callbacks will be called
.SH DESCRIPTION
Deselects the specified content \fIrow\fP in the Grid. If \fInotify\fP is
True and the row is currently selected, the Grid's
XmNdeselectCallback callbacks will be called.
.SH "SEE ALSO"
XmLGridDeselectAllRows(3X)
nedit-5.6.orig/Microline/man/XmLGridEditBegin.3x0000644000175000017500000000671110077552126020155 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridEditBegin 3X "R1" "XML1" "XML"
.SH NAME
XmLGridEditBegin \- begin an edit in a cell
.SH SYNTAX
int XmLGridEditBegin(\fIwidget\fP, \fIinsert\fP, \fIrow\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
Boolean \fIinsert\fP;
.br
int \fIrow\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIinsert\fP 1i
insert flag
.IP \fIrow\fP 1i
position of content row
.IP \fIcolumn\fP 1i
position of content column
.SH DESCRIPTION
Begin editing a cell at the given content \fIrow\fP and content
\fIcolumn\fP. If \fIinsert\fP is True, the edit will begin with the
text widget containing the existing cell contents. If False, the text
widget child of the Grid will be cleared when the edit begins. If the
function is successful, the Grid's XmNeditCallback callbacks will be called.
.SH RETURN VALUE
If the cell position specified is invalid or the cell
can not be edited, a value of -1 will be returned. A value of 0
is returned if this function is successful.
.SH "SEE ALSO"
XmLGridEditCancel(3X) XmLGridEditComplete(3X)
nedit-5.6.orig/Microline/man/XmLGridEditCancel.3x0000644000175000017500000000556310077552126020322 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridEditCancel 3X "R1" "XML1" "XML"
.SH NAME
XmLGridEditCancel \- cancel any cell edit in progress
.SH SYNTAX
void XmLGridEditCancel(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
Cancels a cell edit which is in progress. If a cell is being edited,
the Grid's XmNeditCallbacks will be called with a reason of XmCR_EDIT_CANCEL.
.SH "SEE ALSO"
XmLGridEditBegin(3X) XmLGridEditComplete(3X)
nedit-5.6.orig/Microline/man/XmLGridEditComplete.3x0000644000175000017500000000556010077552126020702 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridEditComplete 3X "R1" "XML1" "XML"
.SH NAME
XmLGridEditComplete \- completes a cell edit
.SH SYNTAX
void XmLGridEditComplete(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
Completes a cell edit which is in progress. If a cell is being edited,
the Grid's XmNeditCallbacks will be called with a reason of
XmCR_EDIT_COMPLETE.
.SH "SEE ALSO"
XmLGridEditBegin(3X) XmLGridEditCancel(3X)
nedit-5.6.orig/Microline/man/XmLGridGetColumn.3x0000644000175000017500000000613610077552126020221 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetColumn 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetColumn \- return a pointer to a column
.SH SYNTAX
XmLGridColumn XmLGridGetColumn(\fIwidget\fP, \fItype\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of column
.IP \fIcolumn\fP 1i
position of column
.SH DESCRIPTION
Returns a pointer to the column at position \fIcolumn\fP of type \fItype\fP.
This pointer can be used in a GetValues call to retrieve
values for the column.
.SH RETURN VALUE
A pointer to the column at the given location or NULL if the column position
is invalid.
.SH "SEE ALSO"
XmLGrid(3X)
nedit-5.6.orig/Microline/man/XmLGridGetFocus.3x0000644000175000017500000000635610077552126020047 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetFocus 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetFocus \- return the position of the current focus cell in a Grid
.SH SYNTAX
void XmLGridGetFocus(\fIwidget\fP, \fIrow\fP, \
\fIcolumn\fP, \fIfocusIn\fP)
.br
Widget \fIwidget\fP;
.br
int *\fIrow\fP;
.br
int *\fIcolumn\fP;
.br
Boolean *\fIfocusIn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrow\fP 1i
position of content row
.IP \fIcolumn\fP 1i
position of content column
.IP \fIfocusIn\fP 1i
True if focus is in widget
.SH DESCRIPTION
Returns the content \fIrow\fP and content \fIcolumn\fP which currently has
focus. If focus is currently in the Grid, \fIfocusIn\fP will be set
to True. Otherwise, it will be set to False. The row or column
returned may be set to -1 which indicates that no cell in
the Grid has focus.
.SH "SEE ALSO"
XmLGridSetFocus(3X)
nedit-5.6.orig/Microline/man/XmLGridGetRow.3x0000644000175000017500000000606110077552126017530 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetRow 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetRow \- return a pointer to a row
.SH SYNTAX
XmLGridRow XmLGridGetRow(\fIwidget\fP, \fItype\fP, \fIrow\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIrow\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of row
.IP \fIrow\fP 1i
position of row
.SH DESCRIPTION
Returns a pointer to the row at position \fIrow\fP of type \fItype\fP.
This pointer can be used in a GetValues call to retrieve
values for the row.
.SH RETURN VALUE
A pointer to the row at the given location or NULL if the row position
is invalid.
.SH "SEE ALSO"
XmLGrid(3X)
nedit-5.6.orig/Microline/man/XmLGridGetSelectedCellCount.3x0000644000175000017500000000565410077552126022331 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetSelectedCellCount 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetSelectedCellCount \- return number of currently selected cells
.SH SYNTAX
int XmLGridGetSelectedCellCount(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
Returns the number of currently selected cells. Only cells in
content rows and columns may be selected.
.SH RETURN VALUE
The number of currently selected cells.
.SH "SEE ALSO"
XmLGridGetSelectedCells(3X) XmLGridSelectCell(3X)
nedit-5.6.orig/Microline/man/XmLGridGetSelectedCells.3x0000644000175000017500000000744210077552126021500 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetSelectedCells 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetSelectedCells \- retrieve positions of currently selected cells
.SH SYNTAX
int XmLGridGetSelectedCells(\fIwidget\fP, \fIrowPositions\fP, \
\fIcolumnPositions\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
int *\fIrowPositions\fP;
.br
int *\fIcolumnPositions\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrowPositions\fP 1i
position of content rows
.IP \fIcolumnPositions\fP 1i
positions of content columns
.IP \fIcount\fP 1i
number of position pairs
.SH DESCRIPTION
Returns the row and column positions of the currently selected
cells. The \fIcount\fP value passed to this function must equal the
number of currently selected cells. The number of currently
selected cells can be found by calling
XmLGridGetSelectedCellCount(). The \fIrowPositions\fP and
\fIcolumnPositions\fP arrays must be allocated before calling this
function and must have enough space to hold the positions which
will be returned. This function does not allocate memory; it is
the application's responsibility to allocate and deallocate
the space used to hold the row and column positions.
.SH RETURN VALUE
0 is returned upon successful completion. A value of
-1 is returned and an error message is generated if count
does not equal the number of currently selected cells.
.SH "SEE ALSO"
XmLGridGetSelectedCellCount(3X)
nedit-5.6.orig/Microline/man/XmLGridGetSelectedColumnCount.3x0000644000175000017500000000565210077552126022705 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetSelectedColumnCount 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetSelectedColumnCount \- return number of currently selected columns
.SH SYNTAX
int XmLGridGetSelectedColumnCount(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
Returns the number of currently selected columns. Only content
columns may be selected.
.SH RETURN VALUE
The number of currently selected columns.
.SH "SEE ALSO"
XmLGridGetSelectedColumns(3X) XmLGridSelectColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridGetSelectedColumns.3x0000644000175000017500000000722510077552126022055 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetSelectedColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetSelectedColumns \- retrieve positions of currently selected columns
.SH SYNTAX
int XmLGridGetSelectedColumns(\fIwidget\fP, \fIpositions\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
int *\fIpositions\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIpositions\fP 1i
positions of content columns
.IP \fIcount\fP 1i
number of positions
.SH DESCRIPTION
Returns the \fIpositions\fP of the currently selected content columns.
The \fIcount\fP value passed to this function must equal the number
of currently selected columns. The number of currently selected
columns can be found by calling XmLGridGetSelectedColumnCount().
The column positions arrays must be allocated before
calling this function and must have enough space to hold
the positions which will be returned. This function does not
allocate memory; it is the application's responsibility to
allocate and deallocate the space used to hold the column
positions.
.SH RETURN VALUE
0 is returned upon successful completion. A value of
-1 is returned and an error message is generated if count
does not equal the number of currently selected columns.
.SH "SEE ALSO"
XmLGridGetSelectedColumnCount(3X)
nedit-5.6.orig/Microline/man/XmLGridGetSelectedRow.3x0000644000175000017500000000600110077552126021173 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetSelectedRow 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetSelectedRow \- retrieve position of the currently selected row
.SH SYNTAX
int XmLGridGetSelectedRow(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
When XmNselectionPolicy is XmSELECT_SINGLE_ROW or XmSELECT_BROWSE_ROW,
this function returns the content row position of the currently
selected row or -1 if no row is selected.
.SH RETURN VALUE
The content row position of the currently selected row or -1 if no row is
is selected.
.SH "SEE ALSO"
XmLGridGetSelectedRows(3X)
nedit-5.6.orig/Microline/man/XmLGridGetSelectedRowCount.3x0000644000175000017500000000561710077552126022220 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetSelectedRowCount 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetSelectedRowCount \- return number of currently selected rows
.SH SYNTAX
int XmLGridGetSelectedRowCount(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
Returns the number of currently selected rows. Only content rows
may be selected.
.SH RETURN VALUE
The number of currently selected rows.
.SH "SEE ALSO"
XmLGridGetSelectedRows(3X) XmLGridSelectRow(3X)
nedit-5.6.orig/Microline/man/XmLGridGetSelectedRows.3x0000644000175000017500000000715610077552126021372 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridGetSelectedRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridGetSelectedRows \- retrieve positions of currently selected rows
.SH SYNTAX
int XmLGridGetSelectedRows(\fIwidget\fP, \fIpositions\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
int *\fIpositions\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIpositions\fP 1i
positions of content rows
.IP \fIcount\fP 1i
number of positions
.SH DESCRIPTION
Returns the \fIpositions\fP of the currently selected content rows.
The \fIcount\fP value passed to this function must equal the number
of currently selected rows. The number of currently selected
rows can be found by calling XmLGridGetSelectedRowCount().
The row positions arrays must be allocated before
calling this function and must have enough space to hold
the positions which will be returned. This function does not
allocate memory; it is the application's responsibility to
allocate and deallocate the space used to hold the row
positions.
.SH RETURN VALUE
0 is returned upon successful completion. A value of
-1 is returned and an error message is generated if count
does not equal the number of currently selected rows.
.SH "SEE ALSO"
XmLGridGetSelectedRowCount(3X)
nedit-5.6.orig/Microline/man/XmLGridMoveColumns.3x0000644000175000017500000000610410077552126020566 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridMoveColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridMoveColumns \- move columns to a new location
.SH SYNTAX
void XmLGridMoveColumns(\fIwidget\fP, \fInewPosition\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
int \fInewPosition\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInewPosition\fP 1i
first position of content columns to move to
.IP \fIposition\fP 1i
first position of content columns to move from
.IP \fIcount\fP 1i
number of columns to move
.SH DESCRIPTION
Moves \fIcount\fP content columns at \fIposition\fP to \fInewPosition\fP.
.SH "SEE ALSO"
XmLGridMoveRows(3X)
nedit-5.6.orig/Microline/man/XmLGridMoveRows.3x0000644000175000017500000000605710077552126020107 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridMoveRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridMoveRows \- move rows to a new location
.SH SYNTAX
void XmLGridMoveRows(\fIwidget\fP, \fInewPosition\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
int \fInewPosition\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInewPosition\fP 1i
first position of content rows to move to
.IP \fIposition\fP 1i
first position of content rows to move from
.IP \fIcount\fP 1i
number of rows to move
.SH DESCRIPTION
Moves \fIcount\fP content rows at \fIposition\fP to \fInewPosition\fP.
.SH "SEE ALSO"
XmLGridMoveColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridPaste.3x0000644000175000017500000000575410077552126017405 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridPaste 3X "R1" "XML1" "XML"
.SH NAME
XmLGridPaste \- paste cell contents from the clipboard into a Grid
.SH SYNTAX
Boolean XmLGridPaste(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
Pastes cell contents (strings) from the clipboard into a Grid starting
at the current focus location. This function does not invoke any callbacks.
.SH RETURN VALUE
A value of True is returned upon success, and False is returned
upon failure.
.SH "SEE ALSO"
XmLGridCopyPos(3X) XmLGridCopySelected(3X) cXmLGridPastePos(3X)
nedit-5.6.orig/Microline/man/XmLGridPastePos.3x0000644000175000017500000000666710077552126020073 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridPastePos 3X "R1" "XML1" "XML"
.SH NAME
XmLGridPastePos \- paste cell contents from the clipboard into a Grid
at a specified location
.SH SYNTAX
Boolean XmLGridPastePos(\fIwidget\fP, \fIrowType\fP, \fIrow\fP,
\fIcolumnType\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fIrowType\fP;
.br
int \fIrow\fP;
.br
unsigned char \fIcolumnType\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrowType\fP 1i
type of first row location
.IP \fIrow\fP 1i
location of first row
.IP \fIcolumnType\fP 1i
type of first column location
.IP \fIcolumn\fP 1i
location of first column
.SH DESCRIPTION
Pastes cell contents (strings) from the clipboard into a Grid starting
at the row and column specified by the given \fIrowType\fP, \fIrow\fP,
\fIcolumnType\fP, and \fIcolumn\fP. This function does not invoke
any callbacks.
.SH RETURN VALUE
A value of True is returned upon success, and False is returned
upon failure.
.SH "SEE ALSO"
XmLGridCopyPos(3X) XmLGridCopySelected(3X) XmLGridPaste(3X)
nedit-5.6.orig/Microline/man/XmLGridRead.3x0000644000175000017500000000672010077552126017176 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridRead 3X "R1" "XML1" "XML"
.SH NAME
XmLGridRead \- import data from a file into a Grid
.SH SYNTAX
int XmLGridRead(\fIwidget\fP, \fIfile\fP, \fIformat\fP, \fIdelimiter\fP)
.br
Widget \fIwidget\fP;
.br
FILE *\fIfile\fP;
.br
int \fIformat\fP;
.br
char \fIdelimiter\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIfile\fP 1i
file to read from
.IP \fIformat\fP 1i
format of the file
.IP \fIdelimiter\fP 1i
delimiter if format is XmFORMAT_DELIMITED
.SH DESCRIPTION
Imports data from a \fIfile\fP in a given \fIformat\fP into a Grid
starting at the top, left-most cell. Format must be
either XmFORMAT_XL, where tabs separate columns and
cell data is possibly surrounded by double-quotes,
or XmFORMAT_DELIMITED, where data is delimited by the
\fIdelimiter\fP given. In either case, a new-line signifies a new
row. The rows and columns imported into must exist at the
time of this call. This function does not invoke any callbacks.
.SH RETURN VALUE
The number of cells which had values set by this function.
.SH "SEE ALSO"
XmLGridReadPos(3X)
nedit-5.6.orig/Microline/man/XmLGridReadPos.3x0000644000175000017500000000764110077552126017663 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridReadPos 3X "R1" "XML1" "XML"
.SH NAME
XmLGridReadPos \- import data from a file to a specified location in a Grid
.SH SYNTAX
int XmLGridReadPos(\fIwidget\fP, \fIfile\fP, \fIformat\fP, \
\fIdelimiter\fP, \fIrowType\fP, \fIrow\fP, \fIcolumnType\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
FILE *\fIfile\fP;
.br
int \fIformat\fP;
.br
char \fIdelimiter\fP;
.br
unsigned char \fIrowType\fP;
.br
int \fIrow\fP;
.br
unsigned char \fIcolumnType\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIfile\fP 1i
file to read from
.IP \fIformat\fP 1i
format of the file
.IP \fIdelimiter\fP 1i
delimiter if format is XmFORMAT_DELIMITED
.IP \fIrowType\fP 1i
type of first row location
.IP \fIrow\fP 1i
location of first row
.IP \fIcolumnType\fP 1i
type of first column location
.IP \fIcolumn\fP 1i
location of first column
.SH DESCRIPTION
Imports data from a \fIfile\fP in a given \fIformat\fP into the Grid
starting at the row and column specified by the given
\fIrowType\fP, \fIrow\fP, \fIcolumnType\fP, and \fIcolumn\fP. Format must
be either XmFORMAT_XL, where tabs separate columns and
cell data is possibly surrounded by double-quotes, or
XmFORMAT_DELIMITED, where data is delimited by the \fIdelimiter\fP
given. In either case, a new-line signifies a new row.
The rows and columns imported into must exist at the time of this
call. This function does not invoke any callbacks.
.SH RETURN VALUE
The number of cells which had values set by this function.
.SH "SEE ALSO"
XmLGridRead(3X)
nedit-5.6.orig/Microline/man/XmLGridRedrawAll.3x0000644000175000017500000000557110077552126020203 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridRedrawAll 3X "R1" "XML1" "XML"
.SH NAME
XmLGridRedrawAll \- redraw all cells in a Grid
.SH SYNTAX
void XmLGridRedrawAll(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.SH DESCRIPTION
Redraws all the cells in a Grid. This function is normally only used
to redraw a Grid which performs drawing using an XmNcellDrawCallback.
.SH "SEE ALSO"
XmLGridRedrawCell(3X) XmLGridRedrawRow(3X) XmLGridRedrawColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridRedrawCell.3x0000644000175000017500000000636210077552126020351 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridRedrawCell 3X "R1" "XML1" "XML"
.SH NAME
XmLGridRedrawCell \- redraw a cell
.SH SYNTAX
void XmLGridRedrawCell(\fIwidget\fP, \fIrowType\fP, \fIrow\fP, \
\fIcolumnType\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fIrowType\fP;
.br
int \fIrow\fP;
.br
unsigned char \fIcolumnType\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrowType\fP 1i
type of row
.IP \fIrow\fP 1i
position of row
.IP \fIcolumnType\fP 1i
type of column
.IP \fIcolumn\fP 1i
position of column
.SH DESCRIPTION
Redraws the cell at the \fIcolumn\fP of type \fIcolumnType\fP
and \fIrow\fP of type \fIrowType\fP. This function is normally
only used to redraw areas in a Grid which perform drawing
using an XmNcellDrawCallback.
.SH "SEE ALSO"
XmLGridRedrawAll(3X) XmLGridRedrawRow(3X) XmLGridRedrawColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridRedrawColumn.3x0000644000175000017500000000606010077552126020722 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridRedrawColumn 3X "R1" "XML1" "XML"
.SH NAME
XmLGridRedrawColumn \- redraw a column
.SH SYNTAX
void XmLGridRedrawColumn(\fIwidget\fP, \fItype\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of column
.IP \fIcolumn\fP 1i
position of column
.SH DESCRIPTION
Redraws the column at position \fIcolumn\fP of type \fItype\fP.
This function is normally only used to redraw areas in a Grid
which perform drawing using an XmNcellDrawCallback.
.SH "SEE ALSO"
XmLGridRedrawAll(3X) XmLGridRedrawCell(3X) XmLGridRedrawRow(3X)
nedit-5.6.orig/Microline/man/XmLGridRedrawRow.3x0000644000175000017500000000602210077552126020232 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridRedrawRow 3X "R1" "XML1" "XML"
.SH NAME
XmLGridRedrawRow \- redraw a row
.SH SYNTAX
void XmLGridRedrawRow(\fIwidget\fP, \fItype\fP, \fIrow\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fItype\fP;
.br
int \fIrow\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fItype\fP 1i
type of row
.IP \fIrow\fP 1i
position of row
.SH DESCRIPTION
Redraws the row at position \fIrow\fP of type \fItype\fP.
This function is normally only used to redraw areas in a Grid
which perform drawing using an XmNcellDrawCallback.
.SH "SEE ALSO"
XmLGridRedrawAll(3X) XmLGridRedrawCell(3X) XmLGridRedrawColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridReorderColumns.3x0000644000175000017500000000620610077552126021265 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridReorderColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridReorderColumns \- reorder columns in a Grid
.SH SYNTAX
void XmLGridReorderColumns(\fIwidget\fP, \fInewPositions\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
int *\fInewPositions\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInewPositions\fP 1i
new positions of content columns
.IP \fIposition\fP 1i
first position of content columns to reorder
.IP \fIcount\fP 1i
number of columns to reorder
.SH DESCRIPTION
Changes the positions of \fIcount\fP content columns starting at
\fIposition\fP to the positions specified in the \fInewPositions\fP
array.
.SH "SEE ALSO"
XmLGridReorderRows(3X)
nedit-5.6.orig/Microline/man/XmLGridReorderRows.3x0000644000175000017500000000616110077552126020577 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridReorderRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridReorderRows \- reorder rows in a Grid
.SH SYNTAX
void XmLGridReorderRows(\fIwidget\fP, \fInewPositions\fP, \
\fIposition\fP, \fIcount\fP)
.br
Widget \fIwidget\fP;
.br
int *\fInewPositions\fP;
.br
int \fIposition\fP;
.br
int \fIcount\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInewPositions\fP 1i
new positions of content rows
.IP \fIposition\fP 1i
first position of content rows to reorder
.IP \fIcount\fP 1i
number of rows to reorder
.SH DESCRIPTION
Changes the positions of \fIcount\fP content rows starting at
\fIposition\fP to the positions specified in the \fInewPositions\fP
array.
.SH "SEE ALSO"
XmLGridReorderColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridRowColumnToXY.3x0000644000175000017500000000757710077552126021047 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridRowColumnToXY 3X "R1" "XML1" "XML"
.SH NAME
XmLGridRowColumnToXY \- return coordinates of a cell
.SH SYNTAX
int XmLGridRowColumnToXY(\fIwidget\fP, \fIrowType\fP, \fIrow\fP, \
\fIcolumnType\fP, \fIcolumn\fP, \fIclipped\fP, \fIrect\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fIrowType\fP;
.br
int \fIrow\fP;
.br
unsigned char \fIcolumnType\fP;
.br
int \fIcolumn\fP;
.br
Boolean \fIclipped\fP;
.br
XRectangle *\fIrect\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrowType\fP 1i
type of row
.IP \fIrow\fP 1i
position of row
.IP \fIcolumnType\fP 1i
type of column
.IP \fIcolumn\fP 1i
position of column
.IP \fIclipped\fP 1i
return clipped or unclipped coordinates
.IP \fIrect\fP 1i
cell geometry
.SH DESCRIPTION
Returns the current coordinates of the cell specified by the \fIrow\fP
of type \fIrowType\fP and \fIcolumn\fP of type \fIcolumnType\fP in
the rectangle \fIrect\fP. If \fIclipped\fP is True, the rectangle
returned will be the cell's rectangle clipped to the current viewing
area. If \fIclipped\fP is False, the rectangle returned will be
the cell's unclipped rectangle, a rectangle with the full width and
height of the cell, not clipped to the viewport. The unclipped
cell rectangle is usually used to determine positioning based
on cell alignment.
.SH RETURN VALUE
0 is returned upon success, and a value of -1 is returned if the row
and column position is invalid or if the cell is currently not visible.
.SH "SEE ALSO"
XmLGridXYToRowColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridRowIsVisible.3x0000644000175000017500000000570310077552126020704 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridRowIsVisible 3X "R1" "XML1" "XML"
.SH NAME
XmLGridRowIsVisible \- determine visiblily of a content row
.SH SYNTAX
void XmLGridRowIsVisible(\fIwidget\fP, \fIrow\fP)
.br
Widget \fIwidget\fP;
.br
int \fIrow\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrow\fP 1i
position of content row
.SH DESCRIPTION
Determines visibility of a content row.
.SH RETURN VALUE
Returns True if any part of the content row given is visible
to the user, and False otherwise.
.SH "SEE ALSO"
XmLGrid(3X) XmLGridColumnIsVisible(3X)
nedit-5.6.orig/Microline/man/XmLGridSelectAllCells.3x0000644000175000017500000000573710077552126021165 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSelectAllCells 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSelectAllCells \- select all content cells
.SH SYNTAX
void XmLGridSelectAllCells(\fIwidget\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInotify\fP 1i
if True, select callbacks will be called
.SH DESCRIPTION
Selects all content cells in the Grid. If \fInotify\fP is True,
the Grid's XmNselectCallback callbacks will be called for
each cell selected.
.SH "SEE ALSO"
XmLGridSelectAllRows(3X) XmLGridSelectAllColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridSelectAllColumns.3x0000644000175000017500000000575110077552126021537 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSelectAllColumns 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSelectAllColumns \- select all content columns
.SH SYNTAX
void XmLGridSelectAllColumns(\fIwidget\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInotify\fP 1i
if True, select callbacks will be called
.SH DESCRIPTION
Selects all content columns in the Grid. If \fInotify\fP is True,
the Grid's XmNselectCallback callbacks will be called for
each column selected.
.SH "SEE ALSO"
XmLGridSelectAllCells(3X) XmLGridSelectAllRows(3X)
nedit-5.6.orig/Microline/man/XmLGridSelectAllRows.3x0000644000175000017500000000573210077552126021050 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSelectAllRows 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSelectAllRows \- select all content rows
.SH SYNTAX
void XmLGridSelectAllRows(\fIwidget\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fInotify\fP 1i
if True, select callbacks will be called
.SH DESCRIPTION
Selects all content rows in the Grid. If \fInotify\fP is True,
the Grid's XmNselectCallback callbacks will be called for
each row selected.
.SH "SEE ALSO"
XmLGridSelectAllCells(3X) XmLGridSelectAllColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridSelectCell.3x0000644000175000017500000000627010077552126020342 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSelectCell 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSelectCell \- select a cell
.SH SYNTAX
void XmLGridSelectCell(\fIwidget\fP, \fIrow\fP, \
\fIcolumn\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
int \fIrow\fP;
.br
int \fIcolumn\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrow\fP 1i
position of content row
.IP \fIcolumn\fP 1i
position of content column
.IP \fInotify\fP 1i
if True, select callbacks will be called
.SH DESCRIPTION
Selects the cell in the Grid at the content \fIrow\fP and
content \fIcolumn\fP specified. If \fInotify\fP is True
and the cell is currently deselected, the Grid's XmNselectCallback
callbacks will be called.
.SH "SEE ALSO"
XmLGridSelectAllCells(3X) XmLGridSelectRow(3X)
XmLGridSelectColumn(3X)
nedit-5.6.orig/Microline/man/XmLGridSelectColumn.3x0000644000175000017500000000605310077552126020717 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSelectColumn 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSelectColumn \- select a column
.SH SYNTAX
void XmLGridSelectColumn(\fIwidget\fP, \fIcolumn\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
int \fIcolumn\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIcolumn\fP 1i
position of content column
.IP \fInotify\fP 1i
if True, select callbacks will be called
.SH DESCRIPTION
Selects the specified content \fIcolumn\fP in the Grid. If \fInotify\fP
is True and the column is currently deselected, the Grid's
XmNselectCallback callbacks will be called.
.SH "SEE ALSO"
XmLGridSelectAllColumns(3X)
nedit-5.6.orig/Microline/man/XmLGridSelectRow.3x0000644000175000017500000000601210077552126020224 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSelectRow 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSelectRow \- select a row
.SH SYNTAX
void XmLGridSelectRow(\fIwidget\fP, \fIrow\fP, \fInotify\fP)
.br
Widget \fIwidget\fP;
.br
int \fIrow\fP;
.br
Boolean \fInotify\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrow\fP 1i
position of content row
.IP \fInotify\fP 1i
if True, select callbacks will be called
.SH DESCRIPTION
Selects the specified content \fIrow\fP in the Grid. If \fInotify\fP is
True and the row is currently deselected, the Grid's
XmNselectCallback callbacks will be called.
.SH "SEE ALSO"
XmLGridSelectAllRows(3X)
nedit-5.6.orig/Microline/man/XmLGridSetFocus.3x0000644000175000017500000000607310077552126020057 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSetFocus 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSetFocus \- set focus to a cell
.SH SYNTAX
void XmLGridSetFocus(\fIwidget\fP, \fIrow\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
int \fIrow\fP;
.br
int \fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrow\fP 1i
position of content row
.IP \fIcolumn\fP 1i
position of content column
.SH DESCRIPTION
Sets focus to the cell at the given content row and content column.
.SH RETURN VALUE
Upon success, a value of 0 will be returned. A value of -1 will
be returned if the cell position specified is invalid or the cell
can not accept focus.
.SH "SEE ALSO"
XmLGridGetFocus(3X)
nedit-5.6.orig/Microline/man/XmLGridSetStrings.3x0000644000175000017500000000623010077552126020424 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSetStrings 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSetStrings \- set strings in a Grid
.SH SYNTAX
int XmLGridSetStrings(\fIwidget\fP, \fIdata\fP)
.br
Widget \fIwidget\fP;
.br
char *\fIdata\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIdata\fP 1i
pointer to pipe-separated string data
.SH DESCRIPTION
Sets cell strings in the Grid starting at the top left cell
with the strings contained in \fIdata\fP. The string data should
be in pipe-separated format where pipes signify the start of
a new column and new-lines signify the start of new rows.
The rows and columns set must exist at the time of this call.
.SH RETURN VALUE
The number of cells which had values set by this function.
.SH "SEE ALSO"
XmLGridSetStringsPos(3X)
nedit-5.6.orig/Microline/man/XmLGridSetStringsPos.3x0000644000175000017500000000716010077552126021111 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridSetStringsPos 3X "R1" "XML1" "XML"
.SH NAME
XmLGridSetStringsPos \- set strings in a Grid at a specified location
.SH SYNTAX
int XmLGridSetStringsPos(\fIwidget\fP, \fIrowType\fP, \fIrow\fP, \
\fIcolumnType\fP, \fIcolumn\fP, \fIdata\fP)
.br
Widget \fIwidget\fP;
.br
unsigned char \fIrowType\fP;
.br
int \fIrow\fP;
.br
unsigned char \fIcolumnType\fP;
.br
int \fIcolumn\fP;
.br
char *\fIdata\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIrowType\fP 1i
type of first row location
.IP \fIrow\fP 1i
location of first row
.IP \fIcolumnType\fP 1i
type of first column location
.IP \fIcolumn\fP 1i
location of first column
.IP \fIdata\fP 1i
pointer to pipe-separated string data
.SH DESCRIPTION
Sets cell strings in the Grid with the strings contained in
\fIdata\fP, starting at the row and column specified by the given
\fIrowType\fP, \fIrow\fP, \fIcolumnType\fP, and \fIcolumn\fP. The
string data should be in pipe-separated format where pipes
signify the start of a new column and new-lines signify the start
of new rows. The rows and columns set must exist at the time
of this call.
.SH RETURN VALUE
The number of cells which had values set by this function.
.SH "SEE ALSO"
XmLGridSetStrings(3X)
nedit-5.6.orig/Microline/man/XmLGridWrite.3x0000644000175000017500000000710410077552126017412 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridWrite 3X "R1" "XML1" "XML"
.SH NAME
XmLGridWrite \- write the string contents of cells in a Grid into a file
.SH SYNTAX
int XmLGridWrite(\fIwidget\fP, \fIfile\fP, \fIformat\fP,
\fIdelimiter\fP, \fIskipHidden\fP)
.br
Widget \fIwidget\fP;
.br
FILE *\fIfile\fP;
.br
int \fIformat\fP;
.br
char \fIdelimiter\fP;
.br
Boolean \fIskipHidden\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIfile\fP 1i
file to write to
.IP \fIformat\fP 1i
format of the file
.IP \fIdelimiter\fP 1i
delimiter if format is XmFORMAT_DELIMITED
.IP \fIskipHidden\fP 1i
if True, skip hidden rows and columns
.SH DESCRIPTION
Writes all cell contents in the Grid to a \fIfile\fP in the
given \fIformat\fP. If \fIskipHidden\fP is True, data in hidden rows or
columns will not be included. Format must be one of the
following: XmFORMAT_XL, where tabs separate columns and
cell data is possibly surrounded by double-quotes,
XmFORMAT_PAD, where columns are padded with spaces or
XmFORMAT_DELIMITED, where data is delimited by the
\fIdelimiter\fP given.
.SH RETURN VALUE
A value of 0 is returned upon success, and a value of -1 is
returned upon failure.
.SH "SEE ALSO"
XmLGridWritePos(3X)
nedit-5.6.orig/Microline/man/XmLGridWritePos.3x0000644000175000017500000001034110077552126020071 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridWritePos 3X "R1" "XML1" "XML"
.SH NAME
XmLGridWritePos \- write the string contents of cells in a Grid at a
given location into a file
.SH SYNTAX
int XmLGridWritePos(\fIwidget\fP, \fIfile\fP, \fIformat\fP,
\fIdelimiter\fP, \fIskipHidden\fP, \fIrowType\fP, \fIrow\fP, \
\fIcolumnType\fP, \fIcolumn\fP, \fInrow\fP, \fIncolumn\fP)
.br
Widget \fIwidget\fP;
.br
FILE *\fIfile\fP;
.br
int \fIformat\fP;
.br
char \fIdelimiter\fP;
.br
Boolean \fIskipHidden\fP;
.br
unsigned char \fIrowType\fP;
.br
int \fIrow\fP;
.br
unsigned char \fIcolumnType\fP;
.br
int \fIcolumn\fP;
.br
int \fInrow\fP;
.br
int \fIncolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIfile\fP 1i
file to write to
.IP \fIformat\fP 1i
format of the file
.IP \fIdelimiter\fP 1i
delimiter if format is XmFORMAT_DELIMITED
.IP \fIskipHidden\fP 1i
if True, skip hidden rows and columns
.IP \fIrowType\fP 1i
type of first row
.IP \fIrow\fP 1i
location of first row
.IP \fIcolumnType\fP 1i
type of first column
.IP \fIcolumn\fP 1i
location of first column
.IP \fInrow\fP 1i
number of rows
.IP \fIncolumn\fP 1i
number of columns
.SH DESCRIPTION
Writes the contents of cells in \fInrow\fP number of rows and
\fIncolumn\fP number of columns to a \fIfile\fP in the given
\fIformat\fP starting at the row and column specified by
\fIrowType\fP, \fIrow\fP, \fIcolumnType\fP, and \fIcolumn\fP. If
\fIskipHidden\fP is True, data in hidden rows or columns
will not be included. Format must be one of the following:
XmFORMAT_XL, where tabs separate columns and cell data is
possibly surrounded by double-quotes, XmFORMAT_PAD,
where columns are padded with spaces or XmFORMAT_DELIMITED,
where data is delimited by the \fIdelimiter\fP given.
.SH RETURN VALUE
A value of 0 is returned upon success, and a value of -1 is
returned upon failure.
.SH "SEE ALSO"
XmLGridWrite(3X)
nedit-5.6.orig/Microline/man/XmLGridXYToRowColumn.3x0000644000175000017500000000720610077552126021034 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLGridXYToRowColumn 3X "R1" "XML1" "XML"
.SH NAME
XmLGridXYToRowColumn \- locate the cell at a given position
.SH SYNTAX
int XmLGridXYToRowColumn(\fIwidget\fP, \fIx\fP, \fIy\fP, \
\fIrowType\fP, \fIrow\fP, \fIcolumnType\fP, \fIcolumn\fP)
.br
Widget \fIwidget\fP;
.br
int \fIx\fP;
.br
int \fIy\fP;
.br
unsigned char *\fIrowType\fP;
.br
int *\fIrow\fP;
.br
unsigned char *\fIcolumnType\fP;
.br
int *\fIcolumn\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Grid widget ID
.IP \fIx\fP 1i
x-coordinate relative to Grid's top left
.IP \fIy\fP 1i
y-coordinate relative to Grid's top left
.IP \fIrowType\fP 1i
type of row
.IP \fIrow\fP 1i
position of row
.IP \fIcolumnType\fP 1i
type of column
.IP \fIcolumn\fP 1i
position of column
.SH DESCRIPTION
Returns the position of the cell containing the \fIx\fP and \fIy\fP
coordinates specified. Upon success, a value of 0 will be
returned and \fIrowType\fP and \fIrow\fP will be set the type of
row and row position, respectively, and \fIcolumnType\fP
and \fIcolumn\fP will be set to the type of column and column
position, respectively.
.SH RETURN VALUE
If no cell exists at the location specified, a value of -1 will be returned.
Upon success, a value of 0 will be returned.
.SH "SEE ALSO"
XmLGrid(3X)
nedit-5.6.orig/Microline/man/XmLMessageBox.3x0000644000175000017500000000652110077552127017552 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLMessageBox 3X "R1" "XML1" "XML"
.SH NAME
XmLMessageBox \- display a simple message dialog
.SH SYNTAX
int XmLMessageBox(\fIwidget\fP, \fIstring\fP, \fIokOnly\fP)
.br
Widget \fIwidget\fP;
.br
XmString \fIstring\fP;
.br
Boolean \fIokOnly\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
widget the MessageBox should appear in front of
.IP \fIstring\fP 1i
message to display
.IP \fIokOnly\fP 1i
display 1 or 3 buttons
.SH DESCRIPTION
Displays a message dialog containing a \fIstring\fP and an Ok button if
\fIokOnly\fP is True, or a question dialog with three buttons (Ok,
Cancel, and Help) and a string if okOnly is False. This function
will not return until the user chooses one of the buttons.
If the user closes the window via the title bar, the action
chosen is assumed to be Ok. The dialog will appear in front of
the given \fIwidget\fP.
.SH RETURN VALUE
The number of the button chosen, where 1 is Ok, 2 is Cancel,
and 3 is Help.
nedit-5.6.orig/Microline/man/XmLPixmapDraw.3x0000644000175000017500000001013710077552127017567 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLPixmapDraw 3X "R1" "XML1" "XML"
.SH NAME
XmLPixmapDraw \- draws a pixmap clipped and aligned in a widget
.SH SYNTAX
void XmLPixmapDraw(\fIwidget\fP, \fIpixmap\fP, \fIpixmask\fP, \
\fIpixmapWidth\fP, \fIpixmapHeight\fP, \fIalignment\fP, \
\fIgc\fP, \fIrect\fP, \fIclipRect\fP)
.br
Widget \fIwidget\fP;
.br
Pixmap \fIpixmap\fP;
.br
Pixmap \fIpixmask\fP;
.br
int \fIpixmapWidth\fP;
.br
int \fIpixmapHeight\fP;
.br
unsigned char \fIalignment\fP;
.br
GC \fIgc\fP;
.br
XRectangle *\fIrect\fP;
.br
XRectangle *\fIclipRect\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
drawing destination widget
.IP \fIpixmap\fP 1i
pixmap to draw
.IP \fIpixmask\fP 1i
pixmap mask for drawing
.IP \fIpixmapWidth\fP 1i
width of pixmap in pixels
.IP \fIpixmapHeight\fP 1i
height of pixmap in pixels
.IP \fIalignment\fP 1i
alignment
.IP \fIgc\fP 1i
graphics context for drawing
.IP \fIrect\fP 1i
source rectangle
.IP \fIclipRect\fP 1i
destination/clipping rectangle
.SH DESCRIPTION
Draws a \fIpixmap\fP of width \fIpixmapWidth\fP and height \fIpixmapHeight\fP
using the GC \fIgc\fP in the window of the \fIwidget\fP given. The
\fIpixmask\fP parameter must be either set to XmUNSPECIFIED_PIXMAP
or a Pixmap of depth one. If a Pixmap is specified, it is used as a
mask to restrict the area drawn.
The \fIrect\fP parameter indicates the rectangle used to
determine alignment. The \fIclipRect\fP rectangle parameter given
indicates the rectangle used to clip the drawing.
\fIAlignment\fP must be one of the following:
XmALIGNMENT_TOP_LEFT, XmALIGNMENT_TOP, XmALIGNMENT_TOP_RIGHT,
XmALIGNMENT_LEFT, XmALIGNMENT_CENTER, XmALIGNMENT_RIGHT,
XmALIGNMENT_BOTTOM_LEFT, XmALIGNMENT_BOTTOM or XmALIGNMENT_BOTTOM_RIGHT
.SH "SEE ALSO"
XmLStringDraw(3X)
nedit-5.6.orig/Microline/man/XmLProgress.3x0000644000175000017500000001503210077552127017316 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLProgress 3X "R1" "XML1" "XML"
.SH NAME
XmLFolder
.SH SYNOPSIS
#include
.LP
.SH DESCRIPTION
A progress bar which can be used to chart completion of a task.
Along with a Progress meter, this widget may optionally display text with
percentage completion and elapsed and estimated time to completion.
.SS Class Information
Progress inherits from XmPrimitive and Core. Its class pointer
is xmlProgressWidgetClass. Its class name is XmLProgress.
.SS New Resources
.nf
.ft B
Name Class
Type Default Access
.ft P
XmNcompleteValue XmCCompleteValue
int 100 CSG
XmNfontList XmCFontList
XmFontList fixed CSG
XmNmeterStyle XmCMeterStyle
unsigned char XmMETER_BAR CSG
XmNnumBoxes XmCNumBoxes
int 10 CSG
XmNshowPercentage XmCShowPercentage
Boolean True CSG
XmNshowTime XmCShowTime
Boolean False CSG
XmNvalue XmCValue
int 0 CSG
.fi
.IP XmNcompleteValue
Defines the maximum value of the XmNvalue resource. When
the XmNvalue resource reaches this number, the Progress bar
will show 100% complete. This value is used to determine the
percentage to complete and to estimate time to completion.
.IP XmNfontList
The font list used for drawing the percentage complete and estimated time.
.IP XmNmeterStyle
The style of the meter to draw. Possible values:
.nf
XmMETER_BAR /* standard bar meter */
XmMETER_BOXES /* shadowed boxes meter */
.fi
Only the XmMETER_BAR style can display the percentage complete
indicator and optional and estimated time to completion.
.IP XmNnumBoxes
When XmNmeterStyle is XmMETER_BOXES, this resource defines
the number of boxes to display in the meter.
.IP XmNshowPercentage
If set to True, text will be shown centered in the widget
displaying the current percentage complete. The percentage
complete is calculated by dividing the XmNvalue by the XmNcompleteValue.
.IP XmNshowTime
If set to True, the widget will display the elapsed time in the
left of the widget and the estimated time remaining on the right.
The estimated time remaining is calculated using the XmNvalue,
the XmNcompleteValue and the start time. The start time is the
last time the XmNvalue was set to 0. No estimated time is shown
when XmNvalue is 0 or when it is equal to the XmNcompleteValue.
If set to False, only a percentage complete indicator will be shown.
.IP XmNvalue
A value from 0 to the XmNcompleteValue which defines how much
progress has taken place. When this value is set to 0, the current
time is stored as the start time for calculating estimated
time to completion.
.SS Inherited Resources
Progress inherits the resources shown below
.nf
.ft B
Resource From Resource From
.ft P
XmNaccelerators Core XmNhighlightPixmap Primitive
XmNancestorSensitive Core XmNhighlightThickness Primitive
XmNbackground Core XmNinitialResourcesPersistent Core
XmNbackgroundPixmap Core XmNmappedWhenManaged Core
XmNborderColor Core XmNnavagationType Primitive
XmNborderPixmap Core XmNscreen Core
XmNborderWidth Core XmNsensitive Core
XmNbottomShadowColor Primitive XmNshadowThickness Primitive
XmNbottomShadowPixmap Primitive XmNtopShadowColor Primitive
XmNcolormap Core XmNtopShadowPixmap Primitive
XmNdepth Core XmNtranslations Core
XmNdestroyCallback Core XmNtraversalOn Primitive
XmNforeground Primitive XmNunitType Primitive
XmNheight Core XmNuserData Primitive
XmNhelpCallback Primitive XmNwidth Core
XmNhighlightColor Primitive XmNx Core
XmNhighlightOnEnter Primitive XmNy Core
.fi
.SH "SEE ALSO"
XmLCreateProgress(3X)
nedit-5.6.orig/Microline/man/XmLRectIntersect.3x0000644000175000017500000000556310077552127020300 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLRectIntersect 3X "R1" "XML1" "XML"
.SH NAME
XmLRectIntersect \- determines if two rectangle intersect
.SH SYNTAX
int XmLRectIntersect(\fIr1\fP, \fIr2\fP)
.br
XRectangle *\fIr1\fP;
.br
XRectangle *\fIr2\fP;
.LP
.SH ARGUMENTS
.IP \fIr1\fP 1i
rectangle 1
.IP \fIr2\fP 1i
rectangle 2
.SH DESCRIPTION
Determines if the two rectangles \fIr1\fP and \fIr2\fP intersect.
.SH RETURN VALUE
1 if the rectangles r1 and r2 intersect, and a value of 0 otherwise.
nedit-5.6.orig/Microline/man/XmLShellOfWidget.3x0000644000175000017500000000541510077552127020216 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLShellOfWidget 3X "R1" "XML1" "XML"
.SH NAME
XmLShellOfWidget \- returns the Shell widget of the given widget
.SH SYNTAX
void XmLShellOfWidget(\fIwidget\fP)
.br
Widget \fIwidget\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
widget ID
.SH DESCRIPTION
Returns the Shell widget of the given widget.
.SH RETURN VALUE
The Shell widget of the given widget.
nedit-5.6.orig/Microline/man/XmLSort.3x0000644000175000017500000000677210077552127016454 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLSort 3X "R1" "XML1" "XML"
.SH NAME
XmLSort \- sort an array using a quicksort algorithm
.SH SYNTAX
void XmLSort(\fIbase\fP, \fInumItems\fP, \
\fIitemSize\fP, \fIcompare\fP, \fIuserData\fP)
.br
void *\fIbase\fP;
.br
int \fInumItems\fP;
.br
unsigned int \fIitemSize\fP;
.br
XmLSortCompareFunc \fIcompare\fP;
.br
void *\fIuserData\fP;
.LP
.SH ARGUMENTS
.IP \fIbase\fP 1i
base of array to sort
.IP \fInumItems\fP 1i
number of items to be sorted
.IP \fIitemSize\fP 1i
size of items to be sorted
.IP \fIcompare\fP 1i
comparison function
.IP \fIuserData\fP 1i
user data
.SH DESCRIPTION
Performs a median-of-three quicksort to sort the array starting
at the address \fIbase\fP which contains \fInumItems\fP items of size
\fIitemSize\fP. The \fIcompare\fP function given is used to compare
items, and when sorting occurs, it is passed pointers to the
two items to compare, as well as the \fIuserData\fP pointer given
to this function. The compare function must return a value
less than, greater than, or equal to 0 based on whether the
first item is less than, greater than, or equal to the second item.
nedit-5.6.orig/Microline/man/XmLStringDraw.3x0000644000175000017500000000755310077552127017607 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLStringDraw 3X "R1" "XML1" "XML"
.SH NAME
XmLStringDraw \- draws a string clipped and aligned in a widget
.SH SYNTAX
void XmLStringDraw(\fIwidget\fP, \fIstring\fP, \fIstringDir\fP, \
\fIfontList\fP, \fIalignment\fP, \fIgc\fP, \fIrect\fP, \fIclipRect\fP)
.br
Widget \fIwidget\fP;
.br
String \fIstring\fP;
.br
XmStringDirection \fIstringDir\fP;
.br
XmFontList \fIfontList\fP;
.br
unsigned char \fIalignment\fP;
.br
GC \fIgc\fP;
.br
XRectangle *\fIrect\fP;
.br
XRectangle *\fIclipRect\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
drawing destination widget
.IP \fIstring\fP 1i
string to draw
.IP \fIstringDir\fP 1i
direction to draw string in
.IP \fIfontList\fP 1i
font list used to draw string
.IP \fIalignment\fP 1i
alignment
.IP \fIgc\fP 1i
graphics context for drawing
.IP \fIrect\fP 1i
source rectangle
.IP \fIclipRect\fP 1i
destination/clipping rectangle
.SH DESCRIPTION
Draws a \fIstring\fP in the direction \fIstringDir\fP using the
font list \fIfontList\fP and the GC \fIgc\fP in the window of
the \fIwidget\fP given. The \fIrect\fP parameter indicates the
rectangle used to determine alignment. The \fIclipRect\fP
rectangle parameter given indicates the rectangle used
to clip the drawing. \fIAlignment\fP must be one of the following:
XmALIGNMENT_TOP_LEFT, XmALIGNMENT_TOP, XmALIGNMENT_TOP_RIGHT,
XmALIGNMENT_LEFT, XmALIGNMENT_CENTER, XmALIGNMENT_RIGHT,
XmALIGNMENT_BOTTOM_LEFT, XmALIGNMENT_BOTTOM or XmALIGNMENT_BOTTOM_RIGHT
.SH "SEE ALSO"
XmLPixmapDraw(3X)
nedit-5.6.orig/Microline/man/XmLStringDrawDirection.3x0000644000175000017500000001026010077552127021435 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLStringDrawDirection 3X "R1" "XML1" "XML"
.SH NAME
XmLStringDrawDirection \- draws a string in the given direction
.SH SYNTAX
void XmLStringDrawDirection(\fIdpy\fP, \fIwin\fP, \fIfontList\fP, \
\fIstring\fP, \fIgc\fP, \fIx\fP, \fIy\fP, \fIwidth\fP, \
\fIalignment\fP, \fIlayout_direction\fP, \fIdrawing_direction\fP)
.br
Display *\fIdpy\fP;
.br
Window \fIwin\fP;
.br
XmFontList \fIfontList\fP;
.br
XmString \fIstring\fP;
.br
GC \fIgc\fP;
.br
int \fIx\fP;
.br
int \fIy\fP;
.br
Dimension \fIwidth\fP;
.br
unsigned char \fIalignment\fP;
.br
unsigned char \fIlayout_direction\fP;
.br
unsigned char \fIdrawing_direction\fP;
.LP
.SH ARGUMENTS
.IP \fIdpy\fP 1i
destination display
.IP \fIwin\fP 1i
destination window
.IP \fIfontList\fP 1i
font list used to draw string
.IP \fIstring\fP 1i
string to draw
.IP \fIgc\fP 1i
graphics context for drawing
.IP \fIx\fP 1i
x position
.IP \fIy\fP 1i
y position
.IP \fIwidth\fP 1i
width for alignment
.IP \fIalignment\fP 1i
alignment
.IP \fIlayout_direction\fP 1i
layout direction for drawing
.IP \fIdrawing_direction\fP 1i
direction to draw
.SH DESCRIPTION
Draws a \fIstring\fP in the direction \fIdrawing_direction\fP
using the font list \fIfontList\fP and the GC \fIgc\fP in the window
\fIwin\fP on the display \fIdpy\fP. The string is drawn at the
\fIx\fP and \fIy\fP location given. The \fIwidth\fP parameter is
used solely for determining alignment. The \fIalignment\fP parameter
must be one of: XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER or
XmALIGNMENT_END. The \fIlayout_direction\fP parameter is used to
draw the string right or left for internationalization (see
XmStringDraw). The \fIdrawing_direction\fP parameter must be one
of: XmSTRING_UP, XmSTRING_DOWN, XmSTRING_LEFT or XmSTRING_RIGHT.
.SH "SEE ALSO"
XmLStringDraw(3x), XmLPixmapDraw(3X)
nedit-5.6.orig/Microline/man/XmLTree.3x0000644000175000017500000003074010077552127016414 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLTree 3X "R1" "XML1" "XML"
.SH NAME
XmLTree
.SH SYNOPSIS
#include
.LP
.SH DESCRIPTION
A Tree is a subclass of the Grid widget which displays a hierarchical
tree with a Pixmap, XmString, connecting lines and
possibly an expand/collapse graphic in the cells of its first column.
Each row in the Tree has a position and level which is
used to determine its relationship to other rows in the Tree. Rows
may be expanded or collapsed by clicking on an expand/collapse graphic
or by activating a row with the keyboard. The Tree inherits
all the abilities of the Grid widget, allowing it to contain
multiple columns and rows of varying types, heading and fixed rows and
columns, interactive row and column resizing, cell borders, etc.
.SS Class Information
Tree inherits from XmLGrid, XmManager, Constraint, Composite and Core.
Its class pointer is xmlTreeWidgetClass. Its class name is XmLTree.
.SS New Resources
The Tree resources defined below affect its overall layout and
appearance. Definitions of resources affecting rows, columns
and cells follow the Tree resource definitions.
.nf
.ft B
Name Class
Type Default Access
.ft P
XmNconnectingLineColor XmCConnectingLineColor
Pixel Dynamic CSG
XmNlevelSpacing XmCLevelSpacing
Dimension 11 CSG
XmNplusMinusColor XmCPlusMinusColor
Pixel Dynamic CSG
.fi
.IP XmNconnectingLineColor
The color of the line which is drawn connecting parents, children
and siblings in the first column of the Tree. This values defaults
to the foreground color of the Tree.
.IP XmNlevelSpacing
The indent in pixels for each level in the Tree.
.IP XmNplusMinusColor
The color of the plus and minus expand/collapse graphics drawn
next to parent nodes which may be expanded. This value defaults
to the foreground color of the Tree.
.SS Row/Column/Cell Resources
Tree defines the resources in the table below affecting rows. In addition
to these row resources, the Tree inherits all the row, column and cell
resources which exist in the Grid.
.nf
.ft B
Name Class
Type Default Access
.ft P
XmNrowExpands XmCRowExpands
Boolean False SG
XmNrowIsExpanded XmCRowIsExpanded
Boolean True SG
XmNrowLevel XmCRowLevel
int 0 SG
.fi
.IP XmNrowExpands
True if the row may expand (it is a parent) and False otherwise.
.IP XmNrowIsExpanded
True if the row is currently expanded and False otherwise. If this
resource is set to False, the Tree will hide all children of this
row. Children of this row are determined to be all rows which are
of a level greater than this row's until we find the next row
which is of this row's level or less (a sibling or parent of this
row). Rows are hidden by setting their XmNrowHeight to 0. If
this resource is set to True, the Tree will show all children of
this row. Rows are shown by setting their XmNrowHeight to 1.
The value of this resource has no meaning if XmNrowExpands is False.
.IP XmNrowLevel
The level of the row in the Tree.
.SS Callback Resources
Tree defines the following callback resources.
.nf
.ft B
Callback Reasons Called When
.ft P
XmNcollapseCallback XmCR_COLLAPSE_ROW Row is collapsed by activate
or by clicking on collapse
graphic
XmNexpandCallback XmCR_EXPAND_ROW Row is expanded by activate
or by clicking on expand
graphic
.fi
.SS Callback Structure
Each callback function is passed a pointer to a XmLGridCallbackStruct
structure. See the XmLGrid's Callback Structure section for the
full structure definition.
The following table shows which values are set for which callback
reasons. Elements not set will have undefined values.
.nf
.ft B
Reason Values Set
.ft P
XmCR_COLLAPSE_ROW event, rowType, row
XmCR_EXPAND_ROW event, rowType, row
.ni
.SS Inherited Resources
Tree inherits the resources shown below.
.nf
.ft B
Resource From Resource From
.ft P
XmNaccelerators Core XmNimmediateDraw Grid
XmNallowColumnHide Grid XmNinitialResourcePersist Core
XmNallowColumnResize Grid XmNinsertPosition Composite
XmNallowDragSelected Grid XmNlayoutFrozen Grid
XmNallowDrop Grid XmNleftFixedCount Grid
XmNallowRowHide Grid XmNleftFixedMargin Grid
XmNallowRowResize Grid XmNmappedWhenManaged Core
XmNancestorSensitive Core XmNnavagationType Manager
XmNautoSelect Grid XmNnumChildren Composite
XmNbackground Core XmNrightFixedCount Grid
XmNbackgroundPixmap Core XmNrightFixedMargin Grid
XmNblankBackground Grid XmNrows Grid
XmNborderColor Core XmNscreen Core
XmNborderPixmap Core XmNscrollBarMargin Grid
XmNborderWidth Core XmNscrollColumn Grid
XmNbottomFixedCount Grid XmNscrollRow Grid
XmNbottomFixedMargin Grid XmNselectBackground Grid
XmNbottomShadowColor Manager XmNselectForeground Grid
XmNbottomShadowPixmap Manager XmNselectionPolicy Grid
XmNchildren Composite XmNsensitive Core
XmNcolormap Core XmNshadowRegions Grid
XmNcolumns Grid XmNshadowThicknses Manager
XmNdebugLevel Grid XmNshadowType Grid
XmNdepth Core XmNsimpleHeadings Grid
XmNdestroyCallback Core XmNsimpleWidths Grid
XmNeditTranslations Grid XmNstringDirection Manager
XmNfontList Grid XmNtextWidget Grid
XmNfooterColumns Grid XmNtopFixedCount Grid
XmNfooterRows Grid XmNtopFixedMargin Grid
XmNforeground Manager XmNtopShadowColor Manager
XmNglobalPixmapHeight Grid XmNtopShadowPixmap Manager
XmNglobalPixmapWidth Grid XmNtranslations Core
XmNheadingColumns Grid XmNtraversalOn Manager
XmNheadingRows Grid XmNtraverseTranslations Grid
XmNheight Core XmNunitType Manager
XmNhelpCallback Manager XmNuseAverageFontWidth Grid
XmNhiddenColumns Grid XmNuserData Manager
XmNhiddenRows Grid XmNverticalScrollBar Grid
XmNhighlightColor Manager XmNverticalSizePolicy Grid
XmNhighlightThickness Grid XmNvisibleColumns Grid
XmNhighlightPixmap Manager XmNvisibleRows Grid
XmNhighlightRowMode Grid XmNvsbDisplayPolicy Grid
XmNhorizontalScrollBar Grid XmNwidth Core
XmNhorizontalSizePolicy Grid XmNx Core
XmNhsbDisplayPolicy Grid XmNy Core
.fi
.SS Inherited Row/Column/Cell Resources
Tree inherits the row/column and cell resources shown below.
.nf
.ft B
Resource From Resource From
.ft P
XmNcellAlignment Grid XmNcellTopBorderColor Grid
XmNcellBackground Grid XmNcellTopBorderType Grid
XmNcellBottomBorderColor Grid XmNcellType Grid
XmNcellBottomBorderType Grid XmNcellUserData Grid
XmNcellColumnSpan Grid XmNcolumn Grid
XmNcellDefaults Grid XmNcolumnPtr Grid
XmNcellEditable Grid XmNcolumnRangeEnd Grid
XmNcellFontList Grid XmNcolumnRangeStart Grid
XmNcellForeground Grid XmNcolumnSizePolicy Grid
XmNcellLeftBorderColor Grid XmNcolumnStep Grid
XmNcellLeftBorderType Grid XmNcolumnType Grid
XmNcellMarginBottom Grid XmNcolumnWidth Grid
XmNcellMarginLeft Grid XmNcolumnUserData Grid
XmNcellMarginRight Grid XmNrow Grid
XmNcellMarginTop Grid XmNrowHeight Grid
XmNcellPixmap Grid XmNrowPtr Grid
XmNcellPixmapMask Grid XmNrowRangeEnd Grid
XmNcellRightBorderColor Grid XmNrowRangeStart Grid
XmNcellRightBorderType Grid XmNrowSizePolicy Grid
XmNcellRowSpan Grid XmNrowStep Grid
XmNcellString Grid XmNrowType Grid
.fi
.SH "SEE ALSO"
XmLTreeAddRow(3X) XmLTreeAddRows(3X) XmLGridAddColumns(3X)
XmLGridColumnIsVisible(3X) XmLGridDeleteAllColumns(3X) XmLGridDeleteAllRows(3X) XmLGridDeleteColumns(3X) XmLGridDeleteRows(3X) XmLGridDeselectAllCells(3X)
XmLGridDeselectAllColumns(3X) XmLGridDeselectAllRows(3X)
XmLGridDeselectCell(3X) XmLGridDeselectColumn(3X) XmLGridDeselectRow(3X)
XmLGridEditBegin(3X) XmLGridEditCancel(3X) XmLGridEditComplete(3X)
XmLGridGetColumn(3X) XmLGridGetFocus(3X)
XmLGridGetRow(3X) XmLGridGetSelectedCellCount(3X) XmLGridGetSelectedCells(3X)
XmLGridGetSelectedColumnCount(3X) XmLGridGetSelectedColumns(3X)
XmLGridGetSelectedRow(3X) XmLGridGetSelectedRowCount(3X)
XmLGridGetSelectedRows(3X) XmLGridMoveColumns(3X) XmLGridMoveRows(3X)
XmLGridRead(3X) XmLGridReadPos(3X) XmLGridRedrawAll(3X) XmLGridRedrawCell(3X)
XmLGridRedrawColumn(3X) XmLGridRedrawRow(3X) XmLGridReorderColumns(3X)
XmLGridReorderRows(3X) XmLGridRowColumnToXY(3X) XmLGridRowlsVisible(3X)
XmLGridSelectAllCells(3X) XmLGridSelectAllColumns(3X) XmLGridSelectAllRows(3X)
XmLGridSelectCell(3X) XmLGridSelectColumn(3X) XmLGridSelectRow(3X)
XmLGridSetFocus(3X) XmLGridSetStrings(3X) XmLGridSetStringsPos(3X)
XmLGridWrite(3X) XmLGridWritePos(3X) XmLGridXYToRowColumn(3X)
nedit-5.6.orig/Microline/man/XmLTreeAddRow.3x0000644000175000017500000000744310077552127017521 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLTreeAddRow 3X "R1" "XML1" "XML"
.SH NAME
XmLTreeAddRow \- add a row to a Tree
.SH SYNTAX
void XmLTreeAddRow(\fIwidget\fP, \fIlevel\fP, \fIexpands\fP, \
\fIisExpanded\fP, \fIposition\fP, \fIpixmap\fP, \fIpixmask\fP, \
\fIstring\fP)
.br
Widget \fIwidget\fP;
.br
int \fIlevel\fP;
.br
Boolean \fIexpands\fP;
.br
Boolean \fIisExpanded\fP;
.br
int \fIposition\fP;
.br
Pixmap \fIpixmap\fP;
.br
Pixmap \fIpixmask\fP;
.br
XmString \fIstring\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Tree widget ID
.IP \fIlevel\fP 1i
level of row
.IP \fIexpands\fP 1i
flag indicating whether row may expand
.IP \fIisExpanded\fP 1i
flag indicating current state of row
.IP \fIposition\fP 1i
position of row
.IP \fIpixmap\fP 1i
pixmap for icon
.IP \fIpixmask\fP 1i
pixmask for icon
.IP \fIstring\fP 1i
string to display next to pixmap
.SH DESCRIPTION
Adds a content row of \fIlevel\fP to the Tree at \fIposition\fP.
The \fIpixmap\fP, \fIpixmask\fP and \fIstring\fP will appear in
the first cell of the row. The pixmap and pixmask values may be
XmUNSPECIFIED_PIXMAP, in which case, the default pixmap
will be displayed. If \fIexpands\fP is True, the row
may be expanded by the user. The \fIisExpanded\fP flag
indicates if the row is currently expanded (True) or not (False).
The XmString string passed is copied by the Tree and should be freed
when it is no longer used.
.SH "SEE ALSO"
XmLTree(3X) XmLTreeAddRows(3X)
nedit-5.6.orig/Microline/man/XmLTreeAddRows.3x0000644000175000017500000000746710077552127017712 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLTreeAddRows 3X "R1" "XML1" "XML"
.SH NAME
XmLTreeAddRows \- add rows to a Tree
.SH SYNTAX
void XmLTreeAddRows(\fIwidget\fP, \fIrows\fP, \fIcount\fP, \fIposition\fP)
.br
Widget \fIwidget\fP;
.br
XmLTreeRowDefinition *\fIrows\fP;
.br
int \fIcount\fP;
.br
int \fIposition\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
Tree widget ID
.IP \fIrows\fP 1i
array definining rows to add
.IP \fIcount\fP 1i
number of rows
.IP \fIposition\fP 1i
position of rows to add
.SH DESCRIPTION
Adds \fIcount\fP content rows to the Tree at the specified \fIposition\fP.
A position of 0 indicates the first position and a position of -1
specifies after the last position.
The row levels, expansion abilities, expansion states, strings and pixmaps
for the rows are defined by their value in the \fIrows\fP array passed to this
function. Each item in the array defines a row to be added to the Tree.
The \fIpixmap\fP, \fIpixmask\fP and \fIstring\fPs defined will appear in
the first cell of the row. The pixmap and pixmask values may be
XmUNSPECIFIED_PIXMAP, in which case, the default pixmap
will be displayed. If \fIexpands\fP is True for a row, the row
may be expanded by the user. The \fIisExpanded\fP flag
indicates if a row is currently expanded (True) or not (False).
The XmString strings contained in the array are copied by the Tree
and should be freed when they are no longer used.
.SH "SEE ALSO"
XmLTree(3X) XmLTreeAddRow(3X)
nedit-5.6.orig/Microline/man/XmLWarning.3x0000644000175000017500000000555610077552127017131 0ustar paulpaul.\" ***** BEGIN LICENSE BLOCK *****
.\" Version: MPL 1.1/GPL 2.0/LGPL 2.1
.\"
.\" The contents of this file are subject to the Mozilla Public License Version
.\" 1.1 (the "License"); you may not use this file except in compliance with
.\" the License. You may obtain a copy of the License at
.\" http://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS" basis,
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
.\" for the specific language governing rights and limitations under the
.\" License.
.\"
.\" The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
.\"
.\" The Initial Developer of the Original Code is
.\" Netscape Communications Corporation.
.\" Portions created by the Initial Developer are Copyright (C) 1998
.\" the Initial Developer. All Rights Reserved.
.\"
.\" Contributor(s):
.\"
.\" Alternatively, the contents of this file may be used under the terms of
.\" either the GNU General Public License Version 2 or later (the "GPL"), or
.\" the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
.\" in which case the provisions of the GPL or the LGPL are applicable instead
.\" of those above. If you wish to allow use of your version of this file only
.\" under the terms of either the GPL or the LGPL, and not to allow others to
.\" use your version of this file under the terms of the MPL, indicate your
.\" decision by deleting the provisions above and replace them with the notice
.\" and other provisions required by the GPL or the LGPL. If you do not delete
.\" the provisions above, a recipient may use your version of this file under
.\" the terms of any one of the MPL, the GPL or the LGPL.
.\"
.\" In addition, as a special exception to the GNU GPL, the copyright holders
.\" give permission to link the code of this program with the Motif and Open
.\" Motif libraries (or with modified versions of these that use the same
.\" license), and distribute linked combinations including the two. You
.\" must obey the GNU General Public License in all respects for all of
.\" the code used other than linking with Motif/Open Motif. If you modify
.\" this file, you may extend this exception to your version of the file,
.\" but you are not obligated to do so. If you do not wish to do so,
.\" delete this exception statement from your version.
.\"
.\" ***** END LICENSE BLOCK *****
.TH XmLWarning 3X "R1" "XML1" "XML"
.SH NAME
XmLWarning \- display a widget XtWarning message
.SH SYNTAX
void XmLWarning(\fIwidget\fP, \fImsg\fP)
.br
Widget \fIwidget\fP;
.br
char *\fImsg\fP;
.LP
.SH ARGUMENTS
.IP \fIwidget\fP 1i
widget to display message for
.IP \fImsg\fP 1i
warning message to display
.SH DESCRIPTION
For use in widgets only, this function generates an XtWarning message
containing the string \fImsg\fP for the given \fIwidget\fP.
nedit-5.6.orig/Microline/Makefile0000644000175000017500000000147310220261123015465 0ustar paulpaul# $Id: Makefile,v 1.3 2005/03/23 12:34:27 edg Exp $
SHELL=/bin/sh
#
# Makefile for NEdit text editor
#
# Targets are the suffixes of the system-specific makefiles in
# the makefiles/ directory.
# For example, to build NEdit for Solaris, give the command
#
# make solaris
#
# This builds an intermediate library in the util/ directory,
# then builds the nedit and nc executables in the source/ directory.
#
all:
@echo "Please specify target:"
@echo "(For example, type \"make linux\" for a Linux system.)"
@(cd ../makefiles && ls -C Makefile* | sed -e 's/Makefile.//g')
.DEFAULT:
@- (cd XmL; if [ -f ../../makefiles/Makefile.$@ -a ! -f ./Makefile.$@ ];\
then ln -s ../../makefiles/Makefile.$@ .; fi)
@- (cd XmL; $(MAKE) -f Makefile.$@ libXmL.a)
clean:
@- (cd XmL; $(MAKE) -f Makefile.common clean)
nedit-5.6.orig/Microline/examples/0000755000175000017500000000000011107644404015652 5ustar paulpaulnedit-5.6.orig/Microline/examples/Makefile0000644000175000017500000001112410077552126017315 0ustar paulpaul#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# In addition, as a special exception to the GNU GPL, the copyright holders
# give permission to link the code of this program with the Motif and Open
# Motif libraries (or with modified versions of these that use the same
# license), and distribute linked combinations including the two. You
# must obey the GNU General Public License in all respects for all of
# the code used other than linking with Motif/Open Motif. If you modify
# this file, you may extend this exception to your version of the file,
# but you are not obligated to do so. If you do not wish to do so,
# delete this exception statement from your version.
#
# ***** END LICENSE BLOCK *****
#
# This make file was copied from ns/cmd/xfe/XfeWidgets/tests/Makefile
# and tweaked. A lot of the rules and logic can probably be shared.
# Stuff should be shared in
#
#
DEPTH = ../../../..
ifdef XFE_WIDGETS_BUILD_UNUSED
UNUSED_CSRCS = \
demo.c \
prog1.c \
prog2.c \
prog3.c \
uil1.c \
util1.c \
$(NULL)
endif
CSRCS = \
$(UNUSED_CSRCS) \
folder1.c \
folder2.c \
folder3.c \
folder4.c \
grid1.c \
grid2.c \
grid3.c \
grid4.c \
grid5.c \
grid6.c \
tree1.c \
tree2.c \
tree3.c \
tree4.c \
tree5.c \
$(NULL)
REQUIRES = \
Microline
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.exe))
include $(DEPTH)/config/rules.mk
include $(DEPTH)/cmd/xfe/XfeWidgets/XfeWidgets.mk
all:: $(PROGS)
install:: $(PROGS)
LDFLAGS =
SHARED_XFE_LIBS = $(DIST)/bin/libXmL.$(DLL_SUFFIX)
STATIC_XFE_LIBS = $(DIST)/lib/libXmL.a
DIST_FLAGS = -L$(DIST)/bin
ifeq ($(OS_ARCH),AIX)
XFE_FLAGS = $(STATIC_XFE_LIBS)
else
XFE_FLAGS = $(SHARED_XFE_LIBS)
endif
ifeq ($(OS_ARCH),Linux)
-include $(DEPTH)/config/motif.mk
endif
XM_LD_FLAGS = -lMrm -lXm $(NS_MOTIF2_XP_LD_FLAGS)
X_LD_FLAGS = $(XM_LD_FLAGS) -lXt -lXmu -lXext -lX11
OS_BEFORE_FLAGS =
OS_AFTER_FLAGS =
ifeq ($(OS_ARCH),SunOS)
OS_BEFORE_LDFLAGS =\
-L/usr/dt/lib \
-L/usr/openwin/lib
OS_AFTER_LDFLAGS =\
-lw \
-lintl \
-lsocket \
-lnsl \
-lgen \
-lm \
-ldl
endif
ifeq ($(OS_ARCH),AIX)
OS_BEFORE_LDFLAGS =\
-L/usr/dt/lib
endif
ifeq ($(OS_ARCH),IRIX)
endif
ifeq ($(OS_ARCH),Linux)
OS_BEFORE_LDFLAGS = -L/usr/X11R6/lib
endif
ifeq ($(OS_ARCH),HP-UX)
OS_BEFORE_LDFLAGS = -L$(DIST)/bin
endif
LDFLAGS =\
$(OS_BEFORE_LDFLAGS) \
$(DIST_FLAGS) \
$(XFE_FLAGS) \
$(X_LD_FLAGS) \
$(OS_AFTER_LDFLAGS)
##
## Test dependancies
##
#OTHER_DEPS = Makefile $(XFE_FLAGS)
OTHER_DEPS = $(XFE_FLAGS)
##
## Resource source rule
##
#$(OBJDIR)/%.ad.c:: %.ad # Makefile
# @$(MAKE_OBJDIR)
# @echo 'char * fallback_resources[] = {' > $@; \
# ./ad2c $< >> $@; \
# echo '0};' >> $@
##
## Resource object rule
##
#$(OBJDIR)/%.ad.o: $(OBJDIR)/%.ad.c
# @$(MAKE_OBJDIR)
# $(CC) -o $@ -c $<
##
## Binary link rule
##
$(OBJDIR)/%.exe: $(OBJDIR)/%.o $(OTHER_DEPS)
@$(MAKE_OBJDIR)
$(XFE_PURIFY) $(CC) -o $@ $< $(LDFLAGS)
nedit-5.6.orig/Microline/examples/Makefile.in0000644000175000017500000001127710077552126017733 0ustar paulpaul#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# In addition, as a special exception to the GNU GPL, the copyright holders
# give permission to link the code of this program with the Motif and Open
# Motif libraries (or with modified versions of these that use the same
# license), and distribute linked combinations including the two. You
# must obey the GNU General Public License in all respects for all of
# the code used other than linking with Motif/Open Motif. If you modify
# this file, you may extend this exception to your version of the file,
# but you are not obligated to do so. If you do not wish to do so,
# delete this exception statement from your version.
#
# ***** END LICENSE BLOCK *****
#
# This make file was copied from ns/cmd/xfe/XfeWidgets/tests/Makefile
# and tweaked. A lot of the rules and logic can probably be shared.
# Stuff should be shared in
#
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifdef XFE_WIDGETS_BUILD_UNUSED
UNUSED_CSRCS = \
demo.c \
prog1.c \
prog2.c \
prog3.c \
uil1.c \
util1.c \
$(NULL)
endif
CSRCS = \
$(UNUSED_CSRCS) \
folder1.c \
folder2.c \
folder3.c \
folder4.c \
grid1.c \
grid2.c \
grid3.c \
grid4.c \
grid5.c \
grid6.c \
tree1.c \
tree2.c \
tree3.c \
tree4.c \
tree5.c \
$(NULL)
REQUIRES = \
Microline
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.exe))
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/cmd/xfe/XfeWidgets/XfeWidgets.mk
all:: $(PROGS)
install:: $(PROGS)
LDFLAGS =
SHARED_XFE_LIBS = $(DIST)/bin/libXmL.$(DLL_SUFFIX)
STATIC_XFE_LIBS = $(DIST)/lib/libXmL.a
DIST_FLAGS = -L$(DIST)/bin
ifeq ($(OS_ARCH),AIX)
XFE_FLAGS = $(STATIC_XFE_LIBS)
else
XFE_FLAGS = $(SHARED_XFE_LIBS)
endif
ifeq ($(OS_ARCH),Linux)
-include $(DEPTH)/config/motif.mk
endif
XM_LD_FLAGS = -lMrm -lXm $(NS_MOTIF2_XP_LD_FLAGS)
X_LD_FLAGS = $(XM_LD_FLAGS) -lXt -lXmu -lXext -lX11
OS_BEFORE_FLAGS =
OS_AFTER_FLAGS =
ifeq ($(OS_ARCH),SunOS)
OS_BEFORE_LDFLAGS =\
-L/usr/dt/lib \
-L/usr/openwin/lib
OS_AFTER_LDFLAGS =\
-lw \
-lintl \
-lsocket \
-lnsl \
-lgen \
-lm \
-ldl
endif
ifeq ($(OS_ARCH),AIX)
OS_BEFORE_LDFLAGS =\
-L/usr/dt/lib
endif
ifeq ($(OS_ARCH),IRIX)
endif
ifeq ($(OS_ARCH),Linux)
OS_BEFORE_LDFLAGS = -L/usr/X11R6/lib
endif
ifeq ($(OS_ARCH),HP-UX)
OS_BEFORE_LDFLAGS = -L$(DIST)/bin
endif
LDFLAGS =\
$(OS_BEFORE_LDFLAGS) \
$(DIST_FLAGS) \
$(XFE_FLAGS) \
$(X_LD_FLAGS) \
$(OS_AFTER_LDFLAGS)
##
## Test dependancies
##
#OTHER_DEPS = Makefile $(XFE_FLAGS)
OTHER_DEPS = $(XFE_FLAGS)
##
## Resource source rule
##
#$(OBJDIR)/%.ad.c:: %.ad # Makefile
# @$(MAKE_OBJDIR)
# @echo 'char * fallback_resources[] = {' > $@; \
# ./ad2c $< >> $@; \
# echo '0};' >> $@
##
## Resource object rule
##
#$(OBJDIR)/%.ad.o: $(OBJDIR)/%.ad.c
# @$(MAKE_OBJDIR)
# $(CC) -o $@ -c $<
##
## Binary link rule
##
$(OBJDIR)/%.exe: $(OBJDIR)/%.o $(OTHER_DEPS)
@$(MAKE_OBJDIR)
$(XFE_PURIFY) $(CC) -o $@ $< $(LDFLAGS)
nedit-5.6.orig/Microline/examples/demo.c0000644000175000017500000032353710077552126016763 0ustar paulpaul/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data .
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* In addition, as a special exception to the GNU GPL, the copyright holders
* give permission to link the code of this program with the Motif and Open
* Motif libraries (or with modified versions of these that use the same
* license), and distribute linked combinations including the two. You
* must obey the GNU General Public License in all respects for all of
* the code used other than linking with Motif/Open Motif. If you modify
* this file, you may extend this exception to your version of the file,
* but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* ***** END LICENSE BLOCK ***** */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include