#include <X11/IntrinsicP.h>#include <X11/StringDefs.h>#include <X11/Xaw3d/XawInit.h>#include <X11/Xaw3d/RepeaterP.h>Include dependency graph for Repeater.c:

Go to the source code of this file.
Defines | |
| #define | DO_CALLBACK(rw) XtCallCallbackList ((Widget) rw, rw->command.callbacks, (XtPointer)NULL) |
| #define | ADD_TIMEOUT(rw, delay) |
| #define | CLEAR_TIMEOUT(rw) |
| #define | off(field) XtOffsetOf(RepeaterRec, repeater.field) |
Functions | |
| static void | tic () |
| static void | ActionStart () |
| static void | ActionStop () |
| static void | Initialize () |
| static void | Destroy () |
| static Boolean | SetValues () |
| static void | tic (XtPointer client_data, XtIntervalId *id) |
| static void | Initialize (Widget greq, Widget gnew, ArgList args, Cardinal *num_args) |
| static void | Destroy (Widget gw) |
| static Boolean | SetValues (Widget gcur, Widget greq, Widget gnew, ArgList args, Cardinal *num_args) |
| static void | ActionStart (Widget gw, XEvent *event, String *params, Cardinal *num_params) |
| static void | ActionStop (Widget gw, XEvent *event, String *params, Cardinal *num_params) |
Variables | |
| static char | defaultTranslations [] |
| static XtActionsRec | actions [] |
| static XtResource | resources [] |
| RepeaterClassRec | repeaterClassRec |
| WidgetClass | repeaterWidgetClass = (WidgetClass) &repeaterClassRec |
| #define ADD_TIMEOUT | ( | rw, | |||
| delay | ) |
Value:
XtAppAddTimeOut (XtWidgetToApplicationContext ((Widget) rw), \
(unsigned long) delay, tic, (XtPointer) rw)
Definition at line 43 of file Repeater.c.
Referenced by ActionStart(), and tic().
| #define CLEAR_TIMEOUT | ( | rw | ) |
Value:
if ((rw)->repeater.timer) { \
XtRemoveTimeOut ((rw)->repeater.timer); \
(rw)->repeater.timer = 0; \
}
Definition at line 47 of file Repeater.c.
Referenced by ActionStart(), ActionStop(), and Destroy().
| #define DO_CALLBACK | ( | rw | ) | XtCallCallbackList ((Widget) rw, rw->command.callbacks, (XtPointer)NULL) |
| #define off | ( | field | ) | XtOffsetOf(RepeaterRec, repeater.field) |
Referenced by nextdata().
| static void ActionStart | ( | Widget | gw, | |
| XEvent * | event, | |||
| String * | params, | |||
| Cardinal * | num_params | |||
| ) | [static] |
Definition at line 247 of file Repeater.c.
References ADD_TIMEOUT, CLEAR_TIMEOUT, DO_CALLBACK, and NULL.
00252 { 00253 RepeaterWidget rw = (RepeaterWidget) gw; 00254 00255 CLEAR_TIMEOUT (rw); 00256 if (rw->repeater.start_callbacks) 00257 XtCallCallbackList (gw, rw->repeater.start_callbacks, (XtPointer)NULL); 00258 00259 DO_CALLBACK (rw); 00260 rw->repeater.timer = ADD_TIMEOUT (rw, rw->repeater.initial_delay); 00261 rw->repeater.next_delay = rw->repeater.repeat_delay; 00262 }
| static void ActionStart | ( | ) | [static] |
| static void ActionStop | ( | Widget | gw, | |
| XEvent * | event, | |||
| String * | params, | |||
| Cardinal * | num_params | |||
| ) | [static] |
Definition at line 266 of file Repeater.c.
References CLEAR_TIMEOUT, NULL, _RepeaterRec::repeater, and RepeaterPart::stop_callbacks.
00271 { 00272 RepeaterWidget rw = (RepeaterWidget) gw; 00273 00274 CLEAR_TIMEOUT ((RepeaterWidget) gw); 00275 if (rw->repeater.stop_callbacks) 00276 XtCallCallbackList (gw, rw->repeater.stop_callbacks, (XtPointer)NULL); 00277 }
| static void ActionStop | ( | ) |
| static void Destroy | ( | Widget | gw | ) | [static] |
Definition at line 216 of file Repeater.c.
References CLEAR_TIMEOUT.
00218 { 00219 CLEAR_TIMEOUT ((RepeaterWidget) gw); 00220 }
| static void Destroy | ( | ) | [static] |
| static void Initialize | ( | Widget | greq, | |
| Widget | gnew, | |||
| ArgList | args, | |||
| Cardinal * | num_args | |||
| ) | [static] |
Definition at line 205 of file Repeater.c.
00209 { 00210 RepeaterWidget new = (RepeaterWidget) gnew; 00211 00212 if (new->repeater.minimum_delay < 0) new->repeater.minimum_delay = 0; 00213 new->repeater.timer = (XtIntervalId) 0; 00214 }
| static void Initialize | ( | ) | [static] |
Definition at line 26 of file javasci_globals.c.
00027 { 00028 static char env[1024]; 00029 static char initstr[]="exec(\"SCI/etc/scilab.start\",-1);quit;"; 00030 static int iflag=-1, stacksize = 1000000, ierr=0; 00031 00032 #ifdef _MSC_VER 00033 static char JavaSciInterf[]="javasci"; 00034 static char nw[]="-nw"; 00035 static char nb[]="-nb"; 00036 #endif 00037 00038 00039 char *p1 = (char*)getenv ("SCI"); 00040 00041 00042 #ifdef _MSC_VER 00043 /* Supprime le mode windows et la baniere */ 00044 add_sci_argv(JavaSciInterf); 00045 add_sci_argv(nb); 00046 #endif 00047 00048 #ifdef _MSC_VER 00049 if ( p1== NULL ) 00050 { 00051 /* Detection Scilab path */ 00052 char modname[MAX_PATH+1]; 00053 if (!GetModuleFileName (GetModuleHandle("javasci.dll"), modname, MAX_PATH)) 00054 { 00055 MessageBox(NULL,"javasci.dll not found","Warning",MB_ICONWARNING); 00056 } 00057 else 00058 { 00059 char *p; 00060 if ((p = strrchr (modname, '\\')) == NULL) exit(1); /* remove \javasci.dll from modname */ 00061 else 00062 { 00063 *p='\0'; 00064 if ((p = strrchr (modname, '\\')) == NULL) exit(1); /* remove \bin from modname */ 00065 else 00066 { 00067 *p='\0'; 00068 set_sci_env(modname); 00069 } 00070 } 00071 } 00072 } 00073 else 00074 { 00075 char *pathSCI=(char*)MALLOC((strlen(p1)+1)*sizeof(char)); 00076 sprintf(pathSCI,"%s",p1); 00077 set_sci_env(pathSCI); 00078 if (pathSCI) {FREE(pathSCI);pathSCI=NULL;} 00079 } 00080 #else 00081 if (p1==NULL) 00082 { 00083 fprintf(stderr,"Please define SCI environment variable\n"); 00084 sprintf (env, "%s=%s", "SCI",SCI); 00085 setSCIpath(SCI); 00086 putenv (env); 00087 } 00088 #endif 00089 /* set TMPDIR */ 00090 C2F(settmpdir)(); 00091 /* Scilab Initialization */ 00092 C2F(inisci)(&iflag,&stacksize,&ierr); 00093 if ( ierr > 0 ) 00094 { 00095 fprintf(stderr,"Scilab initialization failed !\n"); 00096 exit(1); 00097 } 00098 00099 00100 /* Initialisation fenetre graphique */ 00101 #ifdef _MSC_VER 00102 InitWindowGraphDll(); 00103 #endif 00104 00105 /* pour initialisation de la primitive scilab : fromjava() */ 00106 SetFromJavaToON(); 00107 00108 /* Chargement de Scilab.start */ 00109 C2F(scirun)(initstr,(int)strlen(initstr)); 00110 00111 }
| static Boolean SetValues | ( | Widget | gcur, | |
| Widget | greq, | |||
| Widget | gnew, | |||
| ArgList | args, | |||
| Cardinal * | num_args | |||
| ) | [static] |
Definition at line 223 of file Repeater.c.
00227 { 00228 RepeaterWidget cur = (RepeaterWidget) gcur; 00229 RepeaterWidget new = (RepeaterWidget) gnew; 00230 Boolean redisplay = FALSE; 00231 00232 if (cur->repeater.minimum_delay != new->repeater.minimum_delay) { 00233 if (new->repeater.next_delay < new->repeater.minimum_delay) 00234 new->repeater.next_delay = new->repeater.minimum_delay; 00235 } 00236 00237 return redisplay; 00238 }
| static Boolean SetValues | ( | ) | [static] |
| static void tic | ( | XtPointer | client_data, | |
| XtIntervalId * | id | |||
| ) | [static] |
Definition at line 168 of file Repeater.c.
References ADD_TIMEOUT, RepeaterPart::decay, DO_CALLBACK, FALSE, RepeaterPart::flash, RepeaterPart::minimum_delay, RepeaterPart::next_delay, NULL, _RepeaterRec::repeater, RepeaterPart::timer, and TRUE.
00171 { 00172 RepeaterWidget rw = (RepeaterWidget) client_data; 00173 00174 rw->repeater.timer = 0; /* timer is removed */ 00175 if (rw->repeater.flash) { 00176 XtExposeProc expose; 00177 expose = repeaterWidgetClass->core_class.superclass->core_class.expose; 00178 XClearWindow (XtDisplay((Widget) rw), XtWindow((Widget) rw)); 00179 rw->command.set = FALSE; 00180 (*expose) ((Widget) rw, (XEvent *) NULL, (Region) NULL); 00181 XClearWindow (XtDisplay((Widget) rw), XtWindow((Widget) rw)); 00182 rw->command.set = TRUE; 00183 (*expose) ((Widget) rw, (XEvent *) NULL, (Region) NULL); 00184 } 00185 DO_CALLBACK (rw); 00186 00187 rw->repeater.timer = ADD_TIMEOUT (rw, rw->repeater.next_delay); 00188 00189 /* decrement delay time, but clamp */ 00190 if (rw->repeater.decay) { 00191 rw->repeater.next_delay -= rw->repeater.decay; 00192 if (rw->repeater.next_delay < rw->repeater.minimum_delay) 00193 rw->repeater.next_delay = rw->repeater.minimum_delay; 00194 } 00195 }
| static void tic | ( | ) | [static] |
XtActionsRec actions[] [static] |
Initial value:
{
{ "start", ActionStart },
{ "stop", ActionStop },
}
Definition at line 69 of file Repeater.c.
char defaultTranslations[] [static] |
Initial value:
"<EnterWindow>: highlight() \n\ <LeaveWindow>: unhighlight() \n\ <Btn1Down>: set() start() \n\ <Btn1Up>: stop() unset() "
Definition at line 57 of file Repeater.c.
Definition at line 106 of file Repeater.c.
| WidgetClass repeaterWidgetClass = (WidgetClass) &repeaterClassRec |
Definition at line 158 of file Repeater.c.
XtResource resources[] [static] |
Initial value:
{
#define off(field)
{ XtNdecay, XtCDecay, XtRInt, sizeof (int),
off(decay), XtRImmediate, (XtPointer) REP_DEF_DECAY },
{ XtNinitialDelay, XtCDelay, XtRInt, sizeof (int),
off(initial_delay), XtRImmediate, (XtPointer) REP_DEF_INITIAL_DELAY },
{ XtNminimumDelay, XtCMinimumDelay, XtRInt, sizeof (int),
off(minimum_delay), XtRImmediate, (XtPointer) REP_DEF_MINIMUM_DELAY },
{ XtNrepeatDelay, XtCDelay, XtRInt, sizeof (int),
off(repeat_delay), XtRImmediate, (XtPointer) REP_DEF_REPEAT_DELAY },
{ XtNflash, XtCBoolean, XtRBoolean, sizeof (Boolean),
off(flash), XtRImmediate, (XtPointer) FALSE },
{ XtNstartCallback, XtCStartCallback, XtRCallback, sizeof (XtPointer),
off(start_callbacks), XtRImmediate, (XtPointer) NULL },
{ XtNstopCallback, XtCStopCallback, XtRCallback, sizeof (XtPointer),
off(stop_callbacks), XtRImmediate, (XtPointer) NULL },
}
Definition at line 78 of file Repeater.c.
1.5.1