#endif /* lint && SABER */
/***********************************************************
Copyright 1989 by the Massachusetts Institute of Technology,
Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/*
* NOTE: There are some ASCII Dependancies on '\n' and '\0' that I
* am not too thrilled with. There is also the implicit assumption
* that the individual characters will fit inside a "char".
* It would be nice if we could generalize this a but more. If
* anyone out there comes up with an implementation of this stuff
* that has no dependency on ASCII, please send the code back to us.
*
* Chris D. Peterson
* MIT X Consortium
*/
#include <stdio.h>
#include <stdlib.h> /* For atoi() */
#include <ctype.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <./Xaw3_1TextP.h>
/*
* These are defined in TextPop.c
*/
void _XawTextSetField(), _XawTextPopdownSearchAction();
/*
* These are defined in Text.c
*/
char * _XawTextGetText();
XawTextBlock *text);
static void
{
case ButtonPress:
case ButtonRelease:
break;
case KeyPress:
case KeyRelease:
break;
case MotionNotify:
break;
case EnterNotify:
case LeaveNotify:
}
}
}
static void
{
}
#ifdef XAW_BC
/*
* These functions are superceeded by insert-selection.
*/
static void
int buffer;
{
return;
}
}
static void
{
}
static void
{
StuffFromBuffer(ctx, 0);
}
#endif /* XAW_BC */
struct _SelectionList {
};
static void GetSelection();
/* ARGSUSED */
static void
Widget w;
unsigned long *length;
int *format;
{
}
return;
}
return;
}
}
static void
Widget w;
{
int buffer;
switch (selection) {
case XA_CUT_BUFFER0: buffer = 0; break;
default: buffer = -1;
}
if (buffer >= 0) {
int nbytes;
unsigned long length;
else if (num_params > 1)
} else {
if (--num_params) {
}
}
static void
Widget w;
{
EndAction((TextWidget)w);
}
/************************************************************
*
* Routines for Moving Around.
*
************************************************************/
static void
Boolean include;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
Widget w;
{
}
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
{
else
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
{
scroll_val = -scroll_val;
}
static void
Widget w;
{
}
static void
Widget w;
{
}
/************************************************************
*
* Delete Routines.
*
************************************************************/
static void
{
char *ptr;
}
return;
}
}
static void
{
}
else
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
static void
TextWidget w;
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
void
{
}
static void
Widget w;
{
}
static void
Widget w;
{
}
/************************************************************
*
* Insertion Routines.
*
************************************************************/
static int
{
ptr[0] = '\n';
}
else
return(error);
}
static void
Widget w;
{
(void) InsertNewLineAndBackupInternal( (TextWidget) w );
EndAction( (TextWidget) w );
_XawTextSetScrollBars( (TextWidget) w);
}
static int
{
return(XawEditError);
return(XawEditDone);
}
static void
Widget w;
{
}
static void
Widget w;
{
return;
}
}
/************************************************************
*
* Selection Routines.
*
*************************************************************/
static void
Widget w;
{
XawTextPosition l, r;
}
static void
Widget w;
{
}
static void
{
}
/* ARGSUSED */
static void
Widget w;
{
}
/* ARGSUSED */
static void
Widget w;
{
}
static void
Widget w;
{
}
/* ARGSUSED */
static void
Widget w;
{
}
/* ARGSUSED */
static void
Widget w;
{
}
static void
TextWidget w;
{
}
/************************************************************
*
* Misc. Routines.
*
************************************************************/
/* ARGSUSED */
static void
Widget w;
{
EndAction( (TextWidget) w);
}
/*ARGSUSED*/
static void
TextWidget w;
{
}
/*ARGSUSED*/
static void
TextWidget w;
{
}
/* Function Name: AutoFill
* Description: Breaks the line at the previous word boundry when
* called inside InsertChar.
* Arguments: ctx - The text widget.
* Returns: none
*/
static void
{
return;
break;
line_num--; /* backup a line. */
return;
}
static void
Widget w;
{
&keysym, &compose_status)) == 0) {
return;
}
}
if (error == XawEditDone) {
}
else
}
/*ARGSUSED*/
static void
Widget w;
{
int i;
for (i = *num_params; i; i--, params++) {
unsigned char hexval;
char c, *p;
hexval = 0;
for (p = *params+2; (c = *p); p++) {
hexval *= 16;
if (c >= '0' && c <= '9')
hexval += c - '0';
else if (c >= 'a' && c <= 'f')
else if (c >= 'A' && c <= 'F')
else break;
}
if (c == '\0') {
return;
}
}
}
static void
Widget w;
{
/* for Crossing events, the default case is to check the focus
* field and only change the caret when focus==True. A second
* argument of "always" will cause the focus field to be ignored.
*/
check_focus = False;
}
if (*num_params > 0) { /* default arg is "True" */
}
}
/* Function Name: Multiply
* Description: Multiplies the current action by the number passed.
* Arguments: w - the text widget.
* event - ** NOT USED **.
* params, num_params - The parameter list, see below.
* Returns: none.
*
* Parameter list;
*
* The parameter list may contain either a number or the string 'Reset'.
*
* A number will multiply the current multiplication factor by that number.
* Many of the text widget actions will will perform n actions, where n is
* the multiplication factor.
*
* The string reset will reset the mutiplication factor to 1.
*
*/
/* ARGSUSED */
static void
Widget w;
{
int mult;
if (*num_params != 1) {
"The multiply action takes exactly one argument.");
return;
}
return;
}
"must be a number greater than zero, or 'Reset'.");
return;
}
}
/* Function Name: StripOutOldCRs
* Description: strips out the old carrige returns.
* Arguments: ctx - the text widget.
* from - starting point.
* to - the ending point
* Returns: the new ending location (we may add some caracters).
*/
static XawTextPosition
{
char *buf;
/*
* Strip out CR's.
*/
while (TRUE) {
break;
}
else {
int i, len;
/*
* Remove all extra spaces.
*/
for (i = 1 ; i < len; i++)
break;
}
}
}
return(to);
}
/* Function Name: InsertNewCRs
* Description: Inserts the new Carrige Returns.
* Arguments: ctx - the text widget.
* from, to - the ends of the region.
* Returns: none
*/
static void
{
char * buf;
while (TRUE) {
break;
return;
for ( i = 0 ; i < len ; i++)
break;
to -= (i - 1);
}
}
/* Function Name: FormRegion
* Description: Forms up the region specified.
* Arguments: ctx - the text widget.
* from, to - the ends of the region.
* Returns: none.
*/
static void
{
}
/* Function Name: FromParagraph.
* Description: reforms up the current paragraph.
* Arguments: w - the text widget.
* event - the X event.
* params, num_params *** NOT USED ***.
* Returns: none
*/
/* ARGSUSED */
static void
Widget w;
{
}
/* Function Name: TransposeCharacters
* Description: Swaps the character to the left of the mark with
* the character to the right of the mark.
* Arguments: w - the text widget.
* event - the event that cause this action.
* params, num_params *** NOT USED ***.
* Returns: none.
*/
/* ARGSUSED */
static void
Widget w;
{
unsigned char * buf, c;
int i;
/*
* Get bounds.
*/
else {
/*
* Retrieve text and swap the characters.
*/
c = buf[0];
buf[i - 1] = c;
/*
* Store new text is source.
*/
}
}
/* Function Name: NoOp
* Description: This action performs no action, and allows
* the user or application programmer to unbind a
* translation.
* Arguments: w - the text widget.
* event - *** UNUSED ***.
* parms and num_params - the action parameters.
* Returns: none.
*
* Note: If the parameter list contains the string "RingBell" then
* this action will ring the bell.
*/
static void
Widget w;
{
if (*num_params != 1)
return;
switch(params[0][0]) {
case 'R':
case 'r':
default: /* Fall Through */
break;
}
}
/* Action Table */
/* motion bindings */
/* delete bindings */
/* kill bindings */
#ifdef XAW_BC
/* unkill bindings */
#endif /* XAW_BC */
/* new line stuff */
/* Selection stuff */
/* Miscellaneous */
/* Action to bind special translations for text Dialogs. */
};