Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

LiteClue.h File Reference

#include <X11/StringDefs.h>

Go to the source code of this file.


Defines

#define XgcNcancelWaitPeriod   "cancelWaitPeriod"
#define XgcNwaitPeriod   "waitPeriod"
#define XgcCCancelWaitPeriod   "cancelWaitPeriod"
#define XgcCWaitPeriod   "WaitPeriod"

Typedefs

typedef _LiteClueClassRecXcgLiteClueWidgetClass
typedef _LiteClueRecXcgLiteClueWidget

Functions

void XcgLiteClueAddWidget (Widget w, Widget watch, char *text, int size, int option)
void XcgLiteClueDeleteWidget (Widget w, Widget watch)
void XcgLiteClueSetSensitive (Widget w, Widget watch, Boolean sensitive)
Boolean XcgLiteClueGetSensitive (Widget w, Widget watch)
Boolean XcgLiteClueDispatchEvent (Widget w, XEvent *event)

Variables

WidgetClass xcgLiteClueWidgetClass

Define Documentation

#define XgcCCancelWaitPeriod   "cancelWaitPeriod"
 

Definition at line 62 of file LiteClue.h.

#define XgcCWaitPeriod   "WaitPeriod"
 

Definition at line 63 of file LiteClue.h.

#define XgcNcancelWaitPeriod   "cancelWaitPeriod"
 

Definition at line 57 of file LiteClue.h.

#define XgcNwaitPeriod   "waitPeriod"
 

Definition at line 58 of file LiteClue.h.

Referenced by MCW_hint_toggle().


Typedef Documentation

typedef struct _LiteClueRec* XcgLiteClueWidget
 

Definition at line 71 of file LiteClue.h.

typedef struct _LiteClueClassRec* XcgLiteClueWidgetClass
 

Definition at line 70 of file LiteClue.h.


Function Documentation

void XcgLiteClueAddWidget Widget    w,
Widget    watch,
char *    text,
int    size,
int    option
 

Definition at line 636 of file LiteClue.c.

References alloc_link_liteClue_context(), CheckWidgetClass, Enter_event(), find_watched_widget(), Leave_event(), liteClue_context_str::sensitive, liteClue_context_str::text, liteClue_context_str::text_size, liteClue_context_str::watched_w, XtFree, and XtMalloc.

Referenced by MCW_register_hint().

00637 {
00638 #       define ROUTINE "XcgLiteClueAddWidget"
00639 #       define BADVALUE /* nada */
00640         XcgLiteClueWidget cw = (XcgLiteClueWidget) w;
00641         struct liteClue_context_str * obj;
00642         Boolean exists = False;
00643 
00644         CheckWidgetClass(ROUTINE);      /* make sure we are called with a LiteClue widget */
00645 
00646         obj = find_watched_widget(cw, watch);
00647         if (obj)
00648         {
00649                 exists = True;
00650                 if (text)
00651                 {
00652                         if(obj->text)
00653                                 XtFree(obj->text);
00654                         obj->text = NULL;
00655                 }
00656         }
00657         else
00658         {
00659                 obj = alloc_link_liteClue_context(cw );
00660                 obj->watched_w = watch;
00661         }
00662         if (text && !(obj->text))
00663         {
00664                 if (!size)
00665                         size = strlen(text);
00666                 obj->text = (char*) XtMalloc(size+1);
00667                 memcpy(obj->text, text, size);
00668                 obj->text[size] = 0;
00669                 obj->text_size = size;
00670         }
00671         if (!exists)    /* was created */
00672         {
00673                 XtAddEventHandler(watch, EnterWindowMask, False, 
00674                         Enter_event, (XtPointer) obj);
00675                 XtAddEventHandler(watch, LeaveWindowMask|ButtonPressMask, 
00676                         False, Leave_event, (XtPointer) obj);
00677                 obj->sensitive = True;
00678         }
00679 
00680 #       undef ROUTINE
00681 #       undef BADVALUE
00682 }

void XcgLiteClueDeleteWidget Widget    w,
Widget    watch
 

Definition at line 701 of file LiteClue.c.

References CheckWidgetClass, Enter_event(), find_watched_widget(), free_widget_context(), LiteCluePart::interval_id, Leave_event(), and _LiteClueRec::liteClue.

Referenced by MCW_unregister_hint().

00702 {
00703 #       define ROUTINE "XcgLiteClueDeleteWidget"
00704 #       define BADVALUE  /* nada */
00705         XcgLiteClueWidget cw = (XcgLiteClueWidget) w;
00706         struct liteClue_context_str * obj;
00707 
00708         CheckWidgetClass(ROUTINE);      /* make sure we are called with a LiteClue widget */
00709         obj = find_watched_widget(cw, watch);
00710         if (obj)
00711         {
00712                 XtRemoveEventHandler(watch, EnterWindowMask, False, 
00713                         Enter_event, (XtPointer) obj);
00714                 XtRemoveEventHandler(watch, LeaveWindowMask|ButtonPressMask, 
00715                         False, Leave_event, (XtPointer) obj);
00716                 if (cw->liteClue.interval_id != (XtIntervalId)0) 
00717                 {
00718                         XtRemoveTimeOut(cw->liteClue.interval_id);
00719                         cw->liteClue.interval_id= (XtIntervalId)0;
00720                 }
00721                 free_widget_context(cw, obj);
00722         }
00723 
00724 #       undef ROUTINE
00725 #       undef BADVALUE
00726 }

Boolean XcgLiteClueDispatchEvent Widget    w,
XEvent *    event
 

Definition at line 864 of file LiteClue.c.

References CheckWidgetClass, Enter_event(), event, Leave_event(), and liteClue_context_str::watched_w.

00865 {
00866 #       define ROUTINE "XcgLiteClueDispatchEvent"
00867 #       define BADVALUE  False
00868 
00869         XcgLiteClueWidget cw = (XcgLiteClueWidget) w;
00870         struct liteClue_context_str * obj;
00871         Boolean continue_to_dispatch;
00872 
00873         if (event->type != EnterNotify && event->type != LeaveNotify)
00874                 return False;
00875         CheckWidgetClass(ROUTINE);      /* make sure we are called with a LiteClue widget */
00876 
00877         /* scan list */
00878         for (obj = (struct liteClue_context_str *) cw->liteClue.widget_list.forw; 
00879                 obj != (struct liteClue_context_str *) & cw->liteClue.widget_list; 
00880                 obj = (struct liteClue_context_str *)obj->next.forw )
00881         {
00882                 if ((XtWindow(obj->watched_w) != event->xany.window)
00883                 ||  (XtIsSensitive(obj->watched_w)) )
00884                         continue;
00885                 /* found one */
00886                 if (event->type == EnterNotify )
00887                         Enter_event(obj->watched_w, obj, event,  &continue_to_dispatch);
00888                 else
00889                         Leave_event(obj->watched_w, obj, event,  &continue_to_dispatch);
00890                 return True;
00891         }
00892         return False;
00893 
00894 #       undef ROUTINE
00895 #       undef BADVALUE
00896 }

Boolean XcgLiteClueGetSensitive Widget    w,
Widget    watch
 

Definition at line 801 of file LiteClue.c.

References CheckWidgetClass, find_watched_widget(), and liteClue_context_str::sensitive.

00802 {
00803 #       define ROUTINE "XcgLiteClueGetSensitive"
00804 #       define BADVALUE  False
00805 
00806         XcgLiteClueWidget cw = (XcgLiteClueWidget) w;
00807         struct liteClue_context_str * obj;
00808 
00809         CheckWidgetClass(ROUTINE);      /* make sure we are called with a LiteClue widget */
00810         if (watch)
00811         {
00812                 obj = find_watched_widget(cw, watch);
00813                 if (obj)
00814                         return obj->sensitive;
00815                 else
00816                         return False;
00817         }
00818         /* do the first one */
00819         obj = (struct liteClue_context_str *) cw->liteClue.widget_list.forw; 
00820         if (obj != (struct liteClue_context_str *) & cw->liteClue.widget_list)
00821                 return obj->sensitive;
00822         else
00823                 return False;
00824 
00825 #       undef ROUTINE
00826 #       undef BADVALUE
00827 }

void XcgLiteClueSetSensitive Widget    w,
Widget    watch,
Boolean    sensitive
 

Definition at line 749 of file LiteClue.c.

References CheckWidgetClass, find_watched_widget(), and liteClue_context_str::sensitive.

00750 {
00751 #       define ROUTINE "XcgLiteClueSetSensitive"
00752 #       define BADVALUE  /* nada */
00753         XcgLiteClueWidget cw = (XcgLiteClueWidget) w;
00754         struct liteClue_context_str * obj;
00755 
00756         CheckWidgetClass(ROUTINE);      /* make sure we are called with a LiteClue widget */
00757         if (watch)
00758         {
00759                 obj = find_watched_widget(cw, watch);
00760                 if (obj)
00761                 {
00762                         obj->sensitive = sensitive;
00763                         return;
00764                 }
00765                 else
00766                         return;
00767         }
00768 
00769         /* do them all */
00770         for (obj = (struct liteClue_context_str *) cw->liteClue.widget_list.forw; 
00771                 obj != (struct liteClue_context_str *) & cw->liteClue.widget_list; 
00772                 obj = (struct liteClue_context_str *)obj->next.forw )
00773         {
00774                 obj->sensitive = sensitive;
00775         }
00776 
00777 #       undef ROUTINE
00778 #       undef BADVALUE
00779 }

Variable Documentation

WidgetClass xcgLiteClueWidgetClass
 

Definition at line 69 of file LiteClue.h.

 

Powered by Plone

This site conforms to the following standards: