Back to index

plt-scheme  4.2.1
Defines | Functions | Variables
xwMultiList.c File Reference
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include "xwMultiListP.h"
#include "xwTabString.h"

Go to the source code of this file.

Defines

#define SUPERCLASS   &(coreClassRec)
#define FontAscent(f, xf)   ((f)->max_bounds.ascent)
#define FontDescent(f, xf)   ((f)->max_bounds.descent)
#define FontH(f, xf)   (FontAscent(f, xf) + FontDescent(f, xf) + 2)
#define FontW(f, s, w)   (XfwfTextWidth(f,s,strlen(s), MultiListTabs(w)) + 1)
#define FontMaxCharW(f)   ((f)->max_bounds.rbearing-(f)->min_bounds.lbearing+1)
#define abs(a)   ((a) < 0 ? -(a) : (a))
#define max(a, b)   ((a) > (b) ? (a) : (b))
#define min(a, b)   ((a) < (b) ? (a) : (b))
#define XtStrlen(s)   ((s) ? strlen(s) : 0)
#define TypeAlloc(t, n)   (t *)malloc(sizeof(t) * n)
#define StrCopy(s)   strcpy(TypeAlloc(char,strlen(s)+1),s)
#define StrCopyRetLength(s, lp)   strcpy(TypeAlloc(char,(*lp=(strlen(s)+1))),s)
#define CoreFieldOffset(f)   XtOffset(Widget,core.f)
#define MultiListFieldOffset(f)   XtOffset(XfwfMultiListWidget,multiList.f)

Functions

Pixmap XmuCreateStippledPixmap ()
void XawInitializeWidgetSet ()
int wxGetMultiClickTime (Display *)
static void Initialize ()
static void Redisplay ()
static XtGeometryResult PreferredGeometry ()
static void Resize ()
static Boolean SetValues ()
static void DestroyOldData ()
static void InitializeNewData ()
static void CreateNewGCs ()
static void RedrawAll ()
static void RedrawItem ()
static void RedrawRowColumn ()
static void PixelToRowColumn ()
static void RowColumnToPixels ()
static Boolean RowColumnToItem ()
static Boolean ItemToRowColumn ()
static void Select ()
static void SelectOne ()
static void Unselect ()
static void Toggle ()
static void Extend ()
static void Notify ()
static void Initialize (Widget request, Widget new)
static void Redisplay (XfwfMultiListWidget mlw, XEvent *event, Region rectangle_union)
void XfwfCallComputeInside (Widget self, Position *x, Position *y, int *w, int *h)
static XtGeometryResult PreferredGeometry (XfwfMultiListWidget mlw, XtWidgetGeometry *parent_idea, XtWidgetGeometry *our_idea)
static void Resize (XfwfMultiListWidget mlw)
static Boolean SetValues (XfwfMultiListWidget cpl, XfwfMultiListWidget rpl, XfwfMultiListWidget npl)
static void DestroyOldData (XfwfMultiListWidget mlw)
static void InitializeNewData (XfwfMultiListWidget mlw)
Boolean get_scaled_color (Widget, float, Pixel, Pixel *)
static void CreateNewGCs (XfwfMultiListWidget mlw)
static void RedrawAll (XfwfMultiListWidget mlw)
static void RedrawItem (XfwfMultiListWidget mlw, int item_index)
static void RedrawRowColumn (XfwfMultiListWidget mlw, int row, int column)
static void PixelToRowColumn (XfwfMultiListWidget mlw, int x, int y, int *row_ptr, int *column_ptr)
static void RowColumnToPixels (XfwfMultiListWidget mlw, int row, int col, int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr)
static Boolean RowColumnToItem (XfwfMultiListWidget mlw, int row, int column, int *item_ptr)
static Boolean ItemToRowColumn (XfwfMultiListWidget mlw, int item_index, int *row_ptr, int *column_ptr)
static void Select (XfwfMultiListWidget mlw, XEvent *event, String *params, Cardinal *num_params)
static void SelectOne (XfwfMultiListWidget mlw, XEvent *event, String *params, Cardinal *num_params)
static void Unselect (XfwfMultiListWidget mlw, XEvent *event, String *params, Cardinal *num_params)
static void Toggle (XfwfMultiListWidget mlw, XEvent *event, String *params, Cardinal *num_params)
static void Extend (XfwfMultiListWidget mlw, XEvent *event, String *params, Cardinal *num_params)
static void Notify (XfwfMultiListWidget mlw, XEvent *event, String *params, Cardinal *num_params)
Boolean XfwfMultiListHighlightItem (XfwfMultiListWidget mlw, int item_index)
void XfwfMultiListHighlightAll (XfwfMultiListWidget mlw)
void XfwfMultiListUnhighlightItem (XfwfMultiListWidget mlw, int item_index)
void XfwfMultiListUnhighlightAll (XfwfMultiListWidget mlw)
int XfwfMultiListToggleItem (XfwfMultiListWidget mlw, int item_index)
XfwfMultiListReturnStructXfwfMultiListGetHighlighted (XfwfMultiListWidget mlw)
Boolean XfwfMultiListIsHighlighted (XfwfMultiListWidget mlw, int item_index)
Boolean XfwfMultiListGetItemInfo (XfwfMultiListWidget mlw, int item_index, String *str_ptr, Boolean *h_ptr, Boolean *s_ptr)
void XfwfMultiListSetNewData (XfwfMultiListWidget mlw, String *list, int nitems, int longest, int resize, Boolean *sensitivity_array)

Variables

static XtResource resources []
static char defaultTranslations []
static char extendTranslations []
static XtActionsRec actions []
XfwfMultiListClassRec xfwfMultiListClassRec
WidgetClass xfwfMultiListWidgetClass = (WidgetClass)&xfwfMultiListClassRec

Define Documentation

#define abs (   a)    ((a) < 0 ? -(a) : (a))

Definition at line 97 of file xwMultiList.c.

#define CoreFieldOffset (   f)    XtOffset(Widget,core.f)

Definition at line 108 of file xwMultiList.c.

#define FontAscent (   f,
  xf 
)    ((f)->max_bounds.ascent)

Definition at line 88 of file xwMultiList.c.

#define FontDescent (   f,
  xf 
)    ((f)->max_bounds.descent)

Definition at line 89 of file xwMultiList.c.

#define FontH (   f,
  xf 
)    (FontAscent(f, xf) + FontDescent(f, xf) + 2)

Definition at line 92 of file xwMultiList.c.

#define FontMaxCharW (   f)    ((f)->max_bounds.rbearing-(f)->min_bounds.lbearing+1)

Definition at line 94 of file xwMultiList.c.

#define FontW (   f,
  s,
 
)    (XfwfTextWidth(f,s,strlen(s), MultiListTabs(w)) + 1)

Definition at line 93 of file xwMultiList.c.

#define max (   a,
  b 
)    ((a) > (b) ? (a) : (b))

Definition at line 100 of file xwMultiList.c.

#define min (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 101 of file xwMultiList.c.

#define MultiListFieldOffset (   f)    XtOffset(XfwfMultiListWidget,multiList.f)

Definition at line 109 of file xwMultiList.c.

#define StrCopy (   s)    strcpy(TypeAlloc(char,strlen(s)+1),s)

Definition at line 105 of file xwMultiList.c.

#define StrCopyRetLength (   s,
  lp 
)    strcpy(TypeAlloc(char,(*lp=(strlen(s)+1))),s)

Definition at line 106 of file xwMultiList.c.

#define SUPERCLASS   &(coreClassRec)

Definition at line 82 of file xwMultiList.c.

#define TypeAlloc (   t,
 
)    (t *)malloc(sizeof(t) * n)

Definition at line 104 of file xwMultiList.c.

#define XtStrlen (   s)    ((s) ? strlen(s) : 0)

Definition at line 102 of file xwMultiList.c.


Function Documentation

static void CreateNewGCs ( ) [static]

Here is the caller graph for this function:

static void CreateNewGCs ( XfwfMultiListWidget  mlw) [static]

Definition at line 710 of file xwMultiList.c.

{
       XGCValues values;
       unsigned int attribs;

       attribs = GCForeground | GCBackground;
       values.foreground = MultiListFG(mlw);
       values.background = MultiListBG(mlw);
       if (MultiListFont(mlw)) {
         values.font = MultiListFont(mlw)->fid;
         attribs |= GCFont;
       }
       MultiListDrawGC(mlw) = XtGetGC((Widget)mlw,attribs,&values);

       values.foreground = MultiListBG(mlw);
       MultiListEraseGC(mlw) = XtGetGC((Widget)mlw,attribs,&values);

       values.foreground = MultiListHighlightFG(mlw);
       values.background = MultiListHighlightBG(mlw);
       MultiListHighlightForeGC(mlw) = XtGetGC((Widget)mlw,attribs,&values);

       values.foreground = MultiListHighlightBG(mlw);
       values.background = MultiListHighlightBG(mlw);
       MultiListHighlightBackGC(mlw) = XtGetGC((Widget)mlw,attribs,&values);

       if (wx_enough_colors(XtScreen(mlw))) {
         get_scaled_color((Widget)mlw, 0.6, MultiListBG(mlw), &values.foreground);
       } else {
         attribs |= GCTile | GCFillStyle;
         values.foreground = MultiListFG(mlw);
         values.background = MultiListBG(mlw);
         values.fill_style = FillTiled;
         values.tile = XmuCreateStippledPixmap(XtScreen(mlw),MultiListFG(mlw),
                                          MultiListBG(mlw),MultiListDepth(mlw));
       }
       MultiListGrayGC(mlw) = XtGetGC((Widget)mlw,attribs,&values);
} /* End CreateNewGCs */

Here is the call graph for this function:

static void DestroyOldData ( ) [static]

Here is the caller graph for this function:

static void DestroyOldData ( XfwfMultiListWidget  mlw) [static]

Definition at line 595 of file xwMultiList.c.

{
       int i;

       if (MultiListItemArray(mlw) != NULL)      /* Free Old List */
       {
              for (i = 0; i < MultiListNumItems(mlw); i++)
              {
                     free(MultiListItemString(MultiListNthItem(mlw,i)));
              }
              free((char *)MultiListItemArray(mlw));
       }
       if (MultiListSelArray(mlw) != NULL)
           free((char *)MultiListSelArray(mlw));
       MultiListSelArray(mlw) = NULL;
       MultiListNumSelected(mlw) = 0;
       MultiListItemArray(mlw) = NULL;
       MultiListNumItems(mlw) = 0;
} /* End DestroyOldData */
static void Extend ( ) [static]
static void Extend ( XfwfMultiListWidget  mlw,
XEvent *  event,
String *  params,
Cardinal *  num_params 
) [static]

Definition at line 1170 of file xwMultiList.c.

{
       int click_x,click_y;
       int status,item_index,row,column;

       click_x = ((XMotionEvent*)event)->x;
       click_y = ((XMotionEvent*)event)->y;
       PixelToRowColumn(mlw,click_x,click_y,&row,&column);
       status = RowColumnToItem(mlw,row,column,&item_index);
       if ((status == True) &&
           (MultiListItemSensitive(MultiListNthItem(mlw,item_index))))
       {
         MultiListMostRecentItem(mlw) = item_index;
         if (MultiListMostRecentAct(mlw) == XfwfMultiListActionHighlight)
           XfwfMultiListHighlightItem(mlw,item_index);
         else if (MultiListMostRecentAct(mlw) == XfwfMultiListActionUnhighlight)
           XfwfMultiListUnhighlightItem(mlw,item_index);
       }
} /* End Extend */

Here is the call graph for this function:

Boolean get_scaled_color ( Widget  ,
float  ,
Pixel  ,
Pixel  
)

Definition at line 1145 of file xwCommon.c.

{
  /* These two must be mutually prime: */
#define CACHE_SIZE 29
#define CACHE_STEP 10
  static struct {
    int set;
    float scale;
    Pixel in, out;
  } cache[CACHE_SIZE];
  static int reset = 0;
  int i;

  for (i = 0; i < CACHE_SIZE; i++) {
    if (cache[i].set 
       && (cache[i].scale == scale)
       && (cache[i].in == base)) {
      *result = cache[i].out;
      return TRUE;
    }
  }

  if (!XfwfChooseColor(self, scale, base, result))
    return FALSE;
  
  cache[reset].scale = scale;
  cache[reset].in = base;
  cache[reset].out = *result;
  cache[reset].set = 1;

  if (!cache[reset].set) {
    cache[reset].set = 1;
    reset++;
  } else
    reset += CACHE_STEP;

  reset = (reset % CACHE_SIZE);

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void Initialize ( ) [static]

Here is the caller graph for this function:

static void Initialize ( Widget  request,
Widget  new 
) [static]

Definition at line 350 of file xwMultiList.c.

{
       XfwfMultiListWidget mlw;

       mlw = (XfwfMultiListWidget)new;
       MultiListFG(mlw) = BlackPixelOfScreen(XtScreen(new));
       CreateNewGCs(mlw);
       InitializeNewData(mlw);
       MultiListLastRelease(mlw) = CurrentTime;
       MultiListTabs(mlw) = XfwfTablist2Tabs(MultiListTabList(mlw));
       MultiListWidth(mlw) = MultiListHeight(mlw) = 100;
       MultiListNumCols(mlw) = 1;
       MultiListNumRows(mlw) = 1;
       if (MultiListClickExtends(mlw)) {
         XtTranslations t = XtParseTranslationTable(extendTranslations);
         XtOverrideTranslations((Widget)new, t);
         XtFree((char *)t);
       }
} /* Initialize */

Here is the call graph for this function:

static void InitializeNewData ( ) [static]

Here is the caller graph for this function:

static void InitializeNewData ( XfwfMultiListWidget  mlw) [static]

Definition at line 635 of file xwMultiList.c.

{
       int i;
       XfwfMultiListItem *item;
       String *string_array;

       string_array = MultiListList(mlw);
       if (string_array == NULL) MultiListNumItems(mlw) = 0;

       if (MultiListNumItems(mlw) == 0)          /* Count Elements */
       {
              if (string_array == NULL)          /* No elements */
              {
                     MultiListNumItems(mlw) = 0;
              }
                  else
              {
                     for (i = 0; string_array[i] != NULL; i++);
                     MultiListNumItems(mlw) = i;
              }
       }
       if (MultiListNumItems(mlw) == 0)          /* No Items */
       {
              MultiListItemArray(mlw) = NULL;
       }
           else
       {
              MultiListItemArray(mlw) =
                     TypeAlloc(XfwfMultiListItem,MultiListNumItems(mlw));
              for (i = 0; i < MultiListNumItems(mlw); i++)
              {
                     item = MultiListNthItem(mlw,i);
                     if (MultiListSensitiveArray(mlw) == NULL ||
                         (MultiListSensitiveArray(mlw)[i] == True))
                     {
                            MultiListItemSensitive(item) = True;
                     }
                         else
                     {
                            MultiListItemSensitive(item) = False;
                     }
                     MultiListItemString(item) = StrCopy(string_array[i]);
                     MultiListItemHighlighted(item) = False;
              }
       }
       if (MultiListMaxSelectable(mlw) == 0)
       {
              MultiListSelArray(mlw) = NULL;
              MultiListNumSelected(mlw) = 0;
       }
           else
       {
              MultiListSelArray(mlw) =
                     TypeAlloc(int,MultiListMaxSelectable(mlw));
              MultiListNumSelected(mlw) = 0;
       }

       MultiListList(mlw) = NULL;
       MultiListSensitiveArray(mlw) = NULL;
} /* End InitializeNewData */
static Boolean ItemToRowColumn ( ) [static]

Here is the caller graph for this function:

static Boolean ItemToRowColumn ( XfwfMultiListWidget  mlw,
int  item_index,
int row_ptr,
int column_ptr 
) [static]

Definition at line 970 of file xwMultiList.c.

{
       if (item_index < 0 || item_index >= MultiListNumItems(mlw))
       {
              return(False);
       }
       *row_ptr = item_index % MultiListNumRows(mlw);
       *column_ptr = item_index / MultiListNumRows(mlw);

       return(True);
} /* End ItemToRowColumn */
static void Notify ( ) [static]

Here is the caller graph for this function:

static void Notify ( XfwfMultiListWidget  mlw,
XEvent *  event,
String *  params,
Cardinal *  num_params 
) [static]

Definition at line 1211 of file xwMultiList.c.

{
       char *buffer;
       String string;
       int i,byte_count,item_index;
       XfwfMultiListReturnStruct ret_value;

       if (MultiListMostRecentAct(mlw) == XfwfMultiListActionNothing)
         return;

       /* handle double click events using the timestamp of event */
       if (event->xbutton.time - MultiListLastRelease(mlw)
           < wxGetMultiClickTime(XtDisplay(mlw)))
       {
           Select(mlw, event, params, num_params);
           MultiListMostRecentAct(mlw) = XfwfMultiListActionDClick;
       }
       MultiListLastRelease(mlw) = event->xbutton.time;

       if ((MultiListNumSelected(mlw) != 0) && MultiListPaste(mlw))
       {
              byte_count = 0;
              for (i = 0; i < MultiListNumSelected(mlw); i++)
              {
                     item_index = MultiListSelArray(mlw)[i];
                     string = MultiListItemString(MultiListNthItem(mlw,
                            item_index));
                     byte_count = byte_count + strlen(string) + 1;
              }
              buffer = (char *)malloc(byte_count);
              buffer[0] = '\0';
              for (i = 0; i < MultiListNumSelected(mlw); i++)
              {
                     if (i != 0) strcat(buffer,"\n");
                     item_index = MultiListSelArray(mlw)[i];
                     string = MultiListItemString(MultiListNthItem(mlw,
                            item_index));
                     strcat(buffer,string);
              }
              XStoreBytes(XtDisplay(mlw),buffer,byte_count);
              free(buffer);
       }

       ret_value.action = MultiListMostRecentAct(mlw);
       ret_value.item = MultiListMostRecentItem(mlw);
       if (ret_value.item == -1)
              ret_value.string = NULL;
           else
              ret_value.string = MultiListItemString(MultiListNthItem(mlw,
                     ret_value.item));
       ret_value.num_selected = MultiListNumSelected(mlw);
       ret_value.selected_items = MultiListSelArray(mlw);
       XtCallCallbacks((Widget)mlw,XtNcallback,(caddr_t)&ret_value);
} /* End Notify */

Here is the call graph for this function:

static void PixelToRowColumn ( ) [static]

Here is the caller graph for this function:

static void PixelToRowColumn ( XfwfMultiListWidget  mlw,
int  x,
int  y,
int row_ptr,
int column_ptr 
) [static]

Definition at line 898 of file xwMultiList.c.

{
       *row_ptr = (y / (int)MultiListRowHeight(mlw)) + MultiListOffset(mlw);
       *column_ptr = x / (int)MultiListColWidth(mlw);
} /* End PixelToRowColumn */
static XtGeometryResult PreferredGeometry ( ) [static]
static XtGeometryResult PreferredGeometry ( XfwfMultiListWidget  mlw,
XtWidgetGeometry *  parent_idea,
XtWidgetGeometry*  our_idea 
) [static]

Definition at line 438 of file xwMultiList.c.

{
        Position px, py;
       int nw,nh;
       Widget parent;

       parent = XtParent(mlw);
       XfwfCallComputeInside(parent, &px, &py, &nw, &nh);

       our_idea->request_mode |= (CWWidth | CWHeight);
       our_idea->width = nw;
       our_idea->height = nh;

       return XtGeometryAlmost;
} /* End PreferredGeometry */

Here is the call graph for this function:

static void Redisplay ( ) [static]

Here is the caller graph for this function:

static void Redisplay ( XfwfMultiListWidget  mlw,
XEvent *  event,
Region  rectangle_union 
) [static]

Definition at line 382 of file xwMultiList.c.

{
       GC shade_gc;
       int i,x1,y1,w,h,x2,y2,row,col,ul_row,ul_col,lr_row,lr_col;

       if (MultiListShadeSurplus(mlw))
              shade_gc = MultiListGrayGC(mlw);
           else
              shade_gc = MultiListEraseGC(mlw);
       if (event == NULL)
       {
              XFillRectangle(XtDisplay(mlw),XtWindow(mlw),shade_gc,0,0,
                            MultiListWidth(mlw),MultiListHeight(mlw));
              for (i = 0; i < MultiListNumItems(mlw); i++) RedrawItem(mlw,i);
       }
           else
       {
              x1 = event->xexpose.x;
              y1 = event->xexpose.y;
              w = event->xexpose.width;
              h = event->xexpose.height;
              x2 = x1 + w;
              y2 = y1 + h;
              XFillRectangle(XtDisplay(mlw),XtWindow(mlw),
                            shade_gc,x1,y1,w,h);
              PixelToRowColumn(mlw,x1,y1,&ul_row,&ul_col);
              PixelToRowColumn(mlw,x2,y2,&lr_row,&lr_col);
              lr_row = min(lr_row,MultiListNumRows(mlw) - 1);
              lr_col = min(lr_col,MultiListNumCols(mlw) - 1);
              for (col = ul_col; col <= lr_col; col++)
              {
                     for (row = ul_row; row <= lr_row; row++)
                     {
                            RedrawRowColumn(mlw,row,col);
                     }
              }
       }
} /* End Redisplay */

Here is the call graph for this function:

static void RedrawAll ( ) [static]

Here is the caller graph for this function:

static void RedrawAll ( XfwfMultiListWidget  mlw) [static]

Definition at line 764 of file xwMultiList.c.

{
       Redisplay(mlw,NULL,NULL);
} /* End RedrawAll */

Here is the call graph for this function:

static void RedrawItem ( ) [static]

Here is the caller graph for this function:

static void RedrawItem ( XfwfMultiListWidget  mlw,
int  item_index 
) [static]

Definition at line 780 of file xwMultiList.c.

{
       int row,column;

       if (ItemToRowColumn(mlw,item_index,&row,&column))
       {
              RedrawRowColumn(mlw,row,column);
       }
} /* End RedrawItem */

Here is the call graph for this function:

static void RedrawRowColumn ( ) [static]

Here is the caller graph for this function:

static void RedrawRowColumn ( XfwfMultiListWidget  mlw,
int  row,
int  column 
) [static]

Definition at line 804 of file xwMultiList.c.

{
  GC bg_gc=0,fg_gc=0;
  XfwfMultiListItem *item=NULL;
  int ul_x,ul_y,str_x,str_y,w,h,item_index,has_item,text_h;
  int xmode;
       
  if (!XtIsRealized((Widget)mlw)) return;
  has_item = RowColumnToItem(mlw,row,column,&item_index);
  RowColumnToPixels(mlw,row,column,&ul_x,&ul_y,&w,&h);

  if (has_item == False)    /* No Item */
    {
      if (MultiListShadeSurplus(mlw))
       bg_gc = MultiListGrayGC(mlw);
      else
       bg_gc = MultiListEraseGC(mlw);
      xmode = 1;
    } else {
      item = MultiListNthItem(mlw,item_index);
      if ((!MultiListSensitive(mlw)) ||
         (MultiListDrawGray(mlw)) ||
         (!MultiListItemSensitive(item))) /* Insensitive */
       {
         if (MultiListItemHighlighted(item)) /* Selected */
           {
             bg_gc = MultiListGrayGC(mlw);
             fg_gc = MultiListEraseGC(mlw);
             xmode = -1;
           }
         else               /* !Selected */
           {
             bg_gc = MultiListEraseGC(mlw);
             fg_gc = MultiListGrayGC(mlw);
             xmode = 0;
           }
       }
      else                  /* Sensitive */
       {
         if (MultiListItemHighlighted(item)) /* Selected */
           {
             xmode = -1;
             bg_gc = MultiListHighlightBackGC(mlw);
             fg_gc = MultiListHighlightForeGC(mlw);
           }
         else               /* !Selected */
           {
             xmode = 1;
             bg_gc = MultiListEraseGC(mlw);
             fg_gc = MultiListDrawGC(mlw);
           }
       }
    }
  XFillRectangle(XtDisplay(mlw),XtWindow(mlw),bg_gc,ul_x,ul_y,w,h);
  if (has_item == True) {
    text_h = min(FontH(MultiListFont(mlw), MultiListXftFont(mlw)) +
               (int)MultiListRowSpace(mlw),(int)MultiListRowHeight(mlw));
    str_x = ul_x + MultiListColumnSpace(mlw) / 2;
    str_y = ul_y + FontAscent(MultiListFont(mlw), MultiListXftFont(mlw)) +
      ((int)MultiListRowHeight(mlw) - text_h) / 2;
    XfwfDrawString(XtDisplay(mlw),XtWindow(mlw),
                 (MultiListXftFont(mlw) ? NULL : fg_gc),
                 str_x,str_y,MultiListItemString(item),
                 strlen(MultiListItemString(item)),
                 MultiListTabs(mlw), NULL, 
                 MultiListXftFont(mlw), xmode,
                 0, NULL, 0);
  }
} /* End RedrawRowColumn */

Here is the call graph for this function:

static void Resize ( ) [static]
static void Resize ( XfwfMultiListWidget  mlw) [static]

Definition at line 466 of file xwMultiList.c.

{
  MultiListColWidth(mlw) = MultiListWidth(mlw);
} /* End Resize */
static Boolean RowColumnToItem ( ) [static]

Here is the caller graph for this function:

static Boolean RowColumnToItem ( XfwfMultiListWidget  mlw,
int  row,
int  column,
int item_ptr 
) [static]

Definition at line 937 of file xwMultiList.c.

{
       register int x_stride,y_stride;

       if (row < 0 || row >= MultiListNumRows(mlw) ||
           column < 0 || column >= MultiListNumCols(mlw))
       {
              return(False);
       }
       x_stride = MultiListNumRows(mlw);
       y_stride = 1;
       *item_ptr = row * y_stride + column * x_stride;
       if (*item_ptr >= MultiListNumItems(mlw))
              return(False);
           else
              return(True);
} /* End RowColumnToItem */
static void RowColumnToPixels ( ) [static]

Here is the caller graph for this function:

static void RowColumnToPixels ( XfwfMultiListWidget  mlw,
int  row,
int  col,
int x_ptr,
int y_ptr,
int w_ptr,
int h_ptr 
) [static]

Definition at line 915 of file xwMultiList.c.

{
       *x_ptr = col * MultiListColWidth(mlw);
       *y_ptr = (row - MultiListOffset(mlw)) * MultiListRowHeight(mlw);
       *w_ptr = MultiListColWidth(mlw);
       *h_ptr = MultiListRowHeight(mlw);
} /* End RowColumnToPixels */
static void Select ( ) [static]
static void Select ( XfwfMultiListWidget  mlw,
XEvent *  event,
String *  params,
Cardinal *  num_params 
) [static]

Definition at line 1007 of file xwMultiList.c.

{
       int click_x,click_y;
       int status,item_index,row,column;

       click_x = event->xbutton.x;
       click_y = event->xbutton.y;
       PixelToRowColumn(mlw,click_x,click_y,&row,&column);
       MultiListMostRecentAct(mlw) = XfwfMultiListActionHighlight;
       status = RowColumnToItem(mlw,row,column,&item_index);
       if ((status == False) ||
           (!MultiListItemSensitive(MultiListNthItem(mlw,item_index))))
       {
               MultiListMostRecentAct(mlw) = XfwfMultiListActionNothing;
              MultiListMostRecentItem(mlw) = -1;
       }
           else
       {
               XfwfMultiListUnhighlightAll(mlw);
              MultiListMostRecentItem(mlw) = item_index;
              XfwfMultiListHighlightItem(mlw,item_index);
       }
} /* End Select */

Here is the call graph for this function:

static void SelectOne ( ) [static]
static void SelectOne ( XfwfMultiListWidget  mlw,
XEvent *  event,
String *  params,
Cardinal *  num_params 
) [static]

Definition at line 1037 of file xwMultiList.c.

{
       int click_x,click_y;
       int status,item_index,row,column;

       click_x = event->xbutton.x;
       click_y = event->xbutton.y;
       PixelToRowColumn(mlw,click_x,click_y,&row,&column);
       MultiListMostRecentAct(mlw) = XfwfMultiListActionHighlight;
       status = RowColumnToItem(mlw,row,column,&item_index);
       if ((status == False) ||
           (!MultiListItemSensitive(MultiListNthItem(mlw,item_index))))
       {
               MultiListMostRecentAct(mlw) = XfwfMultiListActionNothing;
              MultiListMostRecentItem(mlw) = -1;
       }
           else
       {
              MultiListMostRecentItem(mlw) = item_index;
              XfwfMultiListHighlightItem(mlw,item_index);
       }
} /* End Select */

Here is the call graph for this function:

static Boolean SetValues ( ) [static]
static Boolean SetValues ( XfwfMultiListWidget  cpl,
XfwfMultiListWidget  rpl,
XfwfMultiListWidget  npl 
) [static]

Definition at line 486 of file xwMultiList.c.

{
       Boolean redraw,recalc;

       redraw = False;
       recalc = False;

              /* Graphic Context Changes */

       if ((MultiListFG(cpl) != MultiListFG(npl)) ||
           (MultiListBG(cpl) != MultiListBG(npl)) ||
           (MultiListHighlightFG(cpl) != MultiListHighlightFG(npl)) ||
           (MultiListHighlightBG(cpl) != MultiListHighlightBG(npl)) ||
           (MultiListFont(cpl) != MultiListFont(npl)) ||
           (MultiListXftFont(cpl) != MultiListXftFont(npl)))
       {
              XtDestroyGC(MultiListEraseGC(cpl));
              XtDestroyGC(MultiListDrawGC(cpl));
              XtDestroyGC(MultiListHighlightForeGC(cpl));
              XtDestroyGC(MultiListHighlightBackGC(cpl));
              XtDestroyGC(MultiListGrayGC(cpl));
              CreateNewGCs(npl);
              redraw = True;
       }

              /* Changes That Require Redraw */

       if ((MultiListSensitive(cpl) != MultiListSensitive(npl)) ||
           (MultiListAncesSensitive(cpl) != MultiListAncesSensitive(npl)) ||
           (MultiListDrawGray(cpl) != MultiListDrawGray(npl)))
       {
              redraw = True;
       }

              /* Changes That Require Data Initialization */

       if ((MultiListList(cpl) != MultiListList(npl)) ||
           (MultiListMaxSelectable(cpl) != MultiListMaxSelectable(npl)) ||
           (MultiListNumItems(cpl) != MultiListNumItems(npl)) ||
           (MultiListSensitiveArray(cpl) != MultiListSensitiveArray(npl)))
       {
              DestroyOldData(cpl);
              InitializeNewData(npl);
              recalc = True;
              redraw = True;
       }

       if (MultiListTabList(cpl) != MultiListTabList(npl))
       {
              if (MultiListTabs(cpl))
                     XtFree( (char *) MultiListTabs(cpl));
              MultiListTabs(npl) = XfwfTablist2Tabs(MultiListTabList(npl));
       }

              /* Changes That Require Recalculating Coordinates */

       if ((MultiListWidth(cpl) != MultiListWidth(npl)) ||
           (MultiListHeight(cpl) != MultiListHeight(npl)) ||
           (MultiListColumnSpace(cpl) != MultiListColumnSpace(npl)) ||
           (MultiListRowSpace(cpl) != MultiListRowSpace(npl)) ||
           (MultiListDefaultCols(cpl) != MultiListDefaultCols(npl)) ||
           ((MultiListForceCols(cpl) != MultiListForceCols(npl)) &&
            (MultiListNumCols(cpl) != MultiListNumCols(npl))) ||
           (MultiListFont(cpl) != MultiListFont(npl)) ||
           (MultiListXftFont(cpl) != MultiListXftFont(npl)))
       {
              recalc = True;
              redraw = True;
       }

       if (MultiListOffset(cpl) != MultiListOffset(npl))
         redraw = True;


       if (MultiListColWidth(cpl) != MultiListColWidth(npl))
       {
              XtWarning("columnWidth Resource Is Read-Only");
              MultiListColWidth(npl) = MultiListColWidth(cpl);
       }
       if (MultiListRowHeight(cpl) != MultiListRowHeight(npl))
       {
              XtWarning("rowHeight Resource Is Read-Only");
              MultiListRowHeight(npl) = MultiListRowHeight(cpl);
       }

       if (!XtIsRealized((Widget)cpl))
              return(False);
           else
              return(redraw);
} /* End SetValues */

Here is the call graph for this function:

static void Toggle ( ) [static]
static void Toggle ( XfwfMultiListWidget  mlw,
XEvent *  event,
String *  params,
Cardinal *  num_params 
) [static]

Definition at line 1128 of file xwMultiList.c.

{
       int click_x,click_y;
       int status,item_index,row,column;

       click_x = event->xbutton.x;
       click_y = event->xbutton.y;
       PixelToRowColumn(mlw,click_x,click_y,&row,&column);
       status = RowColumnToItem(mlw,row,column,&item_index);
       if ((status == False) ||
           (!MultiListItemSensitive(MultiListNthItem(mlw,item_index))))
       {
               MultiListMostRecentAct(mlw) = XfwfMultiListActionNothing;
              MultiListMostRecentItem(mlw) = -1;
       }
           else
       {
              MultiListMostRecentAct(mlw) =
                     XfwfMultiListToggleItem(mlw,item_index);
              MultiListMostRecentItem(mlw) = item_index;
       }
} /* End Toggle */

Here is the call graph for this function:

static void Unselect ( ) [static]
static void Unselect ( XfwfMultiListWidget  mlw,
XEvent *  event,
String *  params,
Cardinal *  num_params 
) [static]

Definition at line 1080 of file xwMultiList.c.

{
       int click_x,click_y;
       int status,item_index,row,column;

       click_x = event->xbutton.x;
       click_y = event->xbutton.y;
       PixelToRowColumn(mlw,click_x,click_y,&row,&column);
       MultiListMostRecentItem(mlw) = -1;
       MultiListMostRecentAct(mlw) = XfwfMultiListActionUnhighlight;
       status = RowColumnToItem(mlw,row,column,&item_index);
       if ((status == True) &&
           (MultiListItemSensitive(MultiListNthItem(mlw,item_index)))) {
              XfwfMultiListUnhighlightItem(mlw,item_index);
       } else {
         MultiListMostRecentAct(mlw) = XfwfMultiListActionNothing;
       }
} /* End Unselect */

Here is the call graph for this function:

int wxGetMultiClickTime ( Display *  )

Here is the caller graph for this function:

Here is the caller graph for this function:

void XfwfCallComputeInside ( Widget  self,
Position *  x,
Position *  y,
int w,
int h 
)

Definition at line 1045 of file xwCommon.c.

{
    if (XtIsSubclass(self, xfwfCommonWidgetClass) && ((XfwfCommonWidgetClass)self->core.widget_class)->xfwfCommon_class.compute_inside) {
       int ww, hh;
        ((XfwfCommonWidgetClass)self->core.widget_class)->xfwfCommon_class.compute_inside(self, x, y, &ww, &hh);
       *w = max(0, ww);
       *h = max(0, hh);
    } else 
        XtWarning
            ("XfwfCallComputeInside only applies to subclasses of Common");
}

Here is the caller graph for this function:

Definition at line 1462 of file xwMultiList.c.

{
       XfwfMultiListItem *item;
       static XfwfMultiListReturnStruct ret_value;

       ret_value.action = XfwfMultiListActionStatus;
       if (MultiListNumSelected(mlw) == 0)
       {
              ret_value.item = -1;
              ret_value.string = NULL;
       }
           else
       {
              ret_value.item = MultiListSelArray(mlw)
                     [MultiListNumSelected(mlw) - 1];
              item = MultiListNthItem(mlw,ret_value.item);
              ret_value.string = MultiListItemString(item);
       }
       ret_value.num_selected = MultiListNumSelected(mlw);
       ret_value.selected_items = MultiListSelArray(mlw);
       return(&ret_value);
} /* End XfwfMultiListGetHighlighted */

Here is the caller graph for this function:

Boolean XfwfMultiListGetItemInfo ( XfwfMultiListWidget  mlw,
int  item_index,
String *  str_ptr,
Boolean *  h_ptr,
Boolean*  s_ptr 
)

Definition at line 1521 of file xwMultiList.c.

{
       XfwfMultiListItem *item;

       if (item_index < 0 || item_index >= MultiListNumItems(mlw))
              return(False);
       item = MultiListNthItem(mlw,item_index);
       *str_ptr = MultiListItemString(item);
       *h_ptr = MultiListItemHighlighted(item);
       *s_ptr = MultiListItemSensitive(item);
       return(True);
} /* End XfwfMultiListGetItemInfo */

Definition at line 1329 of file xwMultiList.c.

{
       int i;
       XfwfMultiListItem *item;

       MultiListNumSelected(mlw) = 0;
       for (i = 0; i < MultiListNumItems(mlw); i++)
       {
              item = MultiListNthItem(mlw,i);
              MultiListItemHighlighted(item) = False;
       }
       for (i = 0; i < MultiListNumItems(mlw); i++)
       {
              if (MultiListNumSelected(mlw) == MultiListMaxSelectable(mlw))
                     break;
              item = MultiListNthItem(mlw,i);
              if (MultiListItemSensitive(item) == False) continue;
              MultiListItemHighlighted(item) = True;
              MultiListSelArray(mlw)[MultiListNumSelected(mlw)] = i;
              ++ MultiListNumSelected(mlw);
       }
       RedrawAll(mlw);
} /* End XfwfMultiListHighlightAll */

Here is the call graph for this function:

Boolean XfwfMultiListHighlightItem ( XfwfMultiListWidget  mlw,
int  item_index 
)

Definition at line 1291 of file xwMultiList.c.

{
       XfwfMultiListItem *item;

       if (MultiListMaxSelectable(mlw) == 0) return(False);
       if (item_index < 0 || item_index >= MultiListNumItems(mlw))
       {
              MultiListMostRecentItem(mlw) = -1;
              return(False);
       }
       item = MultiListNthItem(mlw,item_index);
       if (MultiListItemSensitive(item) == False) return(False);
       MultiListMostRecentItem(mlw) = item_index;
       if (MultiListItemHighlighted(item) == True) return(True);
       if (MultiListNumSelected(mlw) == MultiListMaxSelectable(mlw))
       {
              XfwfMultiListUnhighlightItem(mlw,MultiListSelArray(mlw)[0]);
       }
       MultiListItemHighlighted(item) = True;
       MultiListSelArray(mlw)[MultiListNumSelected(mlw)] = item_index;
       ++ MultiListNumSelected(mlw);
       RedrawItem(mlw,item_index);
       return(True);
} /* End XfwfMultiListHighlightItem */

Here is the call graph for this function:

Here is the caller graph for this function:

Boolean XfwfMultiListIsHighlighted ( XfwfMultiListWidget  mlw,
int  item_index 
)

Definition at line 1497 of file xwMultiList.c.

{
       XfwfMultiListItem *item;

       if (item_index < 0 || item_index >= MultiListNumItems(mlw))
              return(False);
       item = MultiListNthItem(mlw,item_index);
       return(MultiListItemHighlighted(item));
} /* End XfwfMultiListIsHighlighted */

Here is the caller graph for this function:

void XfwfMultiListSetNewData ( XfwfMultiListWidget  mlw,
String *  list,
int  nitems,
int  longest,
int  resize,
Boolean *  sensitivity_array 
)

Definition at line 1557 of file xwMultiList.c.

{
       DestroyOldData(mlw);
       MultiListList(mlw) = list;
       MultiListNumItems(mlw) = max(nitems,0);
       MultiListSensitiveArray(mlw) = sensitivity_array;
       MultiListNumCols(mlw) = 1;
       MultiListNumRows(mlw) = nitems;

       MultiListColWidth(mlw) = MultiListWidth(mlw);
        MultiListRowHeight(mlw) = FontH(MultiListFont(mlw), MultiListXftFont(mlw));

       if (MultiListNumItems(mlw) == 0) {
           MultiListList(mlw) = NULL;
           MultiListSensitiveArray(mlw) = NULL;
       }
       InitializeNewData(mlw);
       if (XtIsRealized((Widget)mlw)) Redisplay(mlw,NULL,NULL);
} /* End XfwfMultiListSetNewData */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1424 of file xwMultiList.c.

{
       XfwfMultiListItem *item;

       if (MultiListMaxSelectable(mlw) == 0)
              return(XfwfMultiListActionNothing);
       if (item_index < 0 || item_index >= MultiListNumItems(mlw))
              return(XfwfMultiListActionNothing);
       item = MultiListNthItem(mlw,item_index);
       if (MultiListItemSensitive(item) == False)
              return(XfwfMultiListActionNothing);
       if (MultiListItemHighlighted(item))
       {
              XfwfMultiListUnhighlightItem(mlw,item_index);
              return(XfwfMultiListActionUnhighlight);
       }
           else
       {
              XfwfMultiListHighlightItem(mlw,item_index);
              return(XfwfMultiListActionHighlight);
       }
} /* End XfwfMultiListToggleItem */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1397 of file xwMultiList.c.

{
       int i;
       XfwfMultiListItem *item;

       for (i = 0; i < MultiListNumItems(mlw); i++)
       {
              item = MultiListNthItem(mlw,i);
              if (MultiListItemHighlighted(item))
                     XfwfMultiListUnhighlightItem(mlw,i);
       }
       MultiListNumSelected(mlw) = 0;
} /* End XfwfMultiListUnhighlightAll */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1366 of file xwMultiList.c.

{
       int i;
       XfwfMultiListItem *item;

       if (MultiListMaxSelectable(mlw) == 0) return;
       if (item_index < 0 || item_index >= MultiListNumItems(mlw)) return;
       item = MultiListNthItem(mlw,item_index);
       if (MultiListItemHighlighted(item) == False) return;
       MultiListItemHighlighted(item) = False;

       for (i = 0; i < MultiListNumSelected(mlw); i++)
              if (MultiListSelArray(mlw)[i] == item_index) break;
       for (i = i + 1; i < MultiListNumSelected(mlw); i++)
              MultiListSelArray(mlw)[i - 1] = MultiListSelArray(mlw)[i];
       -- MultiListNumSelected(mlw);

       RedrawItem(mlw,item_index);
} /* End XfwfMultiListUnhighlightItem */

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:


Variable Documentation

XtActionsRec actions[] [static]
Initial value:
{
       {"Select",                         (XtActionProc)Select},
       {"Unselect",                       (XtActionProc)Unselect},
       {"Toggle",                         (XtActionProc)Toggle},
       {"Extend",                         (XtActionProc)Extend},
       {"SelectOne",                      (XtActionProc)SelectOne},
       {"Notify",                         (XtActionProc)Notify},
       {NULL,                             (XtActionProc)NULL}
}

Definition at line 275 of file xwMultiList.c.

char defaultTranslations[] [static]
Initial value:
"      Ctrl <Btn1Down>:                   Toggle()\n\
       Shift <Btn1Down>:                  SelectOne()\n\
       <Btn1Down>:                         Select()\n\
       Button1 <Btn1Motion>:                     Extend()\n\
       <Btn1Up>:                          Notify()"

Definition at line 261 of file xwMultiList.c.

char extendTranslations[] [static]
Initial value:
"      Ctrl <Btn1Down>:                   Toggle()\n\
       Shift <Btn1Down>:                  SelectOne()\n\
       <Btn1Down>:                         Toggle()\n\
       Button1 <Btn1Motion>:                     Extend()\n\
       <Btn1Up>:                          Notify()"

Definition at line 268 of file xwMultiList.c.

XtResource resources[] [static]

Definition at line 193 of file xwMultiList.c.

Definition at line 292 of file xwMultiList.c.

WidgetClass xfwfMultiListWidgetClass = (WidgetClass)&xfwfMultiListClassRec

Definition at line 331 of file xwMultiList.c.