wcommon.h File Reference

#include <stdio.h>
#include "core_math.h"
#include "../../../../graphics/includes/bcg.h"
#include "sciprint.h"

Include dependency graph for wcommon.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tagGFILE

Defines

#define MAX_LINE_LEN   512
#define MAX_ID_LEN   50
#define NO_CARET   (-1)
#define GBUFSIZE   512

Typedefs

typedef tagGFILE GFILE
typedef int Scig_command_handler __PARAMS ((char *))
typedef int Scig_click_handler __PARAMS ((int, int, int, int, int, int))
typedef void Scig_deletegwin_handler __PARAMS ((int))

Functions

void WinExit (void)
void Scistring (char *str)
int C2F() clearexit (integer *n)
void TextSelectFont (LPTW lptw)
void TextCopyClip (LPTW lptw)
int CtrlCHit (LPTW lptw)
void UpdateText (LPTW, int)
void NewLine (LPTW)
void TextPutStr (LPTW lptw, LPSTR str)
void WriteRegistryTxt (LPTW lptw)
void ReadRegistryTxt (LPTW lptw)
void DragFunc (LPTW lptw, HDROP hdrop)
int C2F() sxevents ()
void SendMacro (LPTW lptw, UINT m)
void LoadMacros (LPTW lptw)
void CloseMacros (LPTW lptw)
void MenuFixCurrentWin (int ivalue)
BOOL SciOpenSave (HWND hWndParent, BYTE **s, BOOL save, char **d, int *ierr)
int GetLine (char *buffer, int len, GFILE *gfile)
void LeftJustify (char *d, char *s)
GFILEGfopen (LPSTR lpszFileName, int fnOpenMode)
void Gfclose (GFILE *gfile)
int Gfgets (LPSTR lp, int size, GFILE *gfile)
BOOL PrintSize (HDC printer, HWND hwnd, LPRECT lprect)
void PrintRegister (LP_PRINT lpr)
void PrintUnregister (LP_PRINT lpr)
EXPORT BOOL CALLBACK PrintAbortProc (HDC hdcPrn, int code)
EXPORT BOOL CALLBACK PrintDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
HWND InitStatusBar (HWND hwndParent)
int com_line (void)
void switch_rlgets (int)
int read_line (char *prompt, int interrupt)
int InteractiveMode (void)
void sciprint (char *fmt,...)
void sciprint_nd (char *fmt,...)
int sciprint2 (int v, char *fmt,...)
int Pause (LPSTR mess)
BOOL DialogWindow ()
void add_history_nw ()
char * readline_nw (char *prompt, int interrupt)
void add_history_win ()
char * readline_win (char *prompt, int interrupt)
int WGFindMenuPos (BYTE **macros)
void ScilabMenuAction (char *buf)
void SendGraphMacro (struct BCG *ScilabGC, UINT m)
void write_scilab (char *buf)
void LoadGraphMacros (struct BCG *ScilabGC)
void CloseGraphMacros (struct BCG *ScilabGC)
int C2F() setmen (integer *, char *, integer *, integer *, integer *, integer *)
int C2F() unsmen (integer *, char *, integer *, integer *, integer *, integer *)
int C2F() chmenu (integer *, char *, char *)
int C2F() delbtn (integer *, char *)
int C2F() addmen (integer *, char *, integer *, integer *, integer *, integer *, char *, integer *)
void AddMenu (integer *win_num, char *button_name, char **entries, integer *ne, integer *typ, char *fname, integer *ierr)
int gp_printfile (HINSTANCE hInstance, HWND hwnd, char *filename, char *port)
void SetXsciOn ()
int C2F() xscion (int *i)
int C2F() getmen (char *, integer *, integer *)
integer C2F() ismenu (void)
int GetCommand (char *)
int StoreCommand1 (char *, int)
int StoreCommand (char *)
char * alloc (unsigned long size, char *message)
void squash_spaces (char *s)
void lower_case (char *s)
void os_error (char *str, int t_num)
void int_error (char *str, int t_num)
int instring (char *str, char c)
void sci_windows_main (int, int *, char *, int, int *, int)
void SciMenuSelect (char *Name)
void C2F() setfbutn (char *buf, int *rep)
void C2F() fbutn (char *buf, int *win, int *ent)
void SignalCtrC (void)
void DebugGW (char *fmt,...)
int C2F() deletewin (integer *number)
void CopyToClipboardEMF (struct BCG *ScilabGC)
void CopyToClipboardBitmap (struct BCG *ScilabGC)
int CopyPrint (struct BCG *ScilabGC)
void WriteRegistryGraph (struct BCG *ScilabGC)
void ReadRegistryGraph (struct BCG *ScilabGC)
int PushClickQueue (int win, int x, int y, int ibut, int motion, int release)
int CheckClickQueue (int *win, int *x, int *y, int *ibut, int *motion, int *release)
int ClearClickQueue (int win)
void Tape_Replay (char *, integer *, integer *, integer *, integer *, integer *, integer *, double *, double *, double *, double *)
void C2F() SetDriver ()
int C2F() dr ()
int ScilabPsToEps (char orientation, char *filenamein, char *filenameout)
int ScilabPsToTeX (char orientation, char *filenamein, char *filenameout, double xs, double ys)
int C2F() mainsci (int *, char *, int *, integer)
void set_is_reading (int)
int get_is_reading (void)
int C2F() timer (double *)
int C2F() stimer (void)
int C2F() sigbas (integer *)
void reset_scig_click_handler __PARAMS ((void))
Scig_command_handler set_scig_command_handler __PARAMS ((Scig_command_handler f))
Scig_click_handler set_scig_click_handler __PARAMS ((Scig_click_handler f))
Scig_deletegwin_handler set_scig_deletegwin_handler __PARAMS ((Scig_deletegwin_handler f))


Define Documentation

#define GBUFSIZE   512

Definition at line 36 of file wcommon.h.

Referenced by Gfgets().

#define MAX_ID_LEN   50

Definition at line 34 of file wcommon.h.

#define MAX_LINE_LEN   512

Definition at line 33 of file wcommon.h.

Referenced by read_line().

#define NO_CARET   (-1)

Definition at line 35 of file wcommon.h.

Referenced by alloc(), int_error(), and read_line().


Typedef Documentation

typedef void Scig_deletegwin_handler __PARAMS((int))

Definition at line 195 of file wcommon.h.

typedef int Scig_click_handler __PARAMS((int, int, int, int, int, int))

Definition at line 193 of file wcommon.h.

typedef int Scig_command_handler __PARAMS((char *))

Definition at line 191 of file wcommon.h.

typedef struct tagGFILE GFILE


Function Documentation

Scig_deletegwin_handler set_scig_deletegwin_handler __PARAMS ( (Scig_deletegwin_handler f)   ) 

Scig_click_handler set_scig_click_handler __PARAMS ( (Scig_click_handler f)   ) 

Scig_command_handler set_scig_command_handler __PARAMS ( (Scig_command_handler f)   ) 

void reset_scig_click_handler __PARAMS ( (void)   ) 

void add_history_nw (  ) 

void add_history_win (  ) 

int C2F() addmen ( integer ,
char *  ,
integer ,
integer ,
integer ,
integer ,
char *  ,
integer  
)

Definition at line 879 of file wgmenu.c.

References AddMenu(), FREE, i, ierr, NULL, and ScilabMStr2CM().

00882 {
00883   char **menu_entries;
00884   menu_entries=NULL;
00885   *ierr = 0;
00886   if (*ne != 0)
00887     {
00888       ScilabMStr2CM (entries, ne, ptrentries, &menu_entries, ierr);
00889       if (*ierr == 1)
00890         return (0);
00891     }
00892   /* Modification Allan CORNET */
00893   /* Réinitialisation Menu Console Principale */
00894   if ( (strcmp(button_name,"RESETMENU")==0) && (*win_num==-1) )
00895     {
00896       ResetMenu();      
00897     }
00898   else AddMenu (win_num, button_name, menu_entries, ne, typ, fname, ierr);
00899   return (0);
00900 }

Here is the call graph for this function:

void AddMenu ( integer win_num,
char *  button_name,
char **  entries,
integer ne,
integer typ,
char *  fname,
integer ierr 
)

Definition at line 751 of file wgmenu.c.

References args, command, commandWidgetClass, MenuData::entry, FALSE, MenuData::fname, GetChilds(), height, i, iargs, KillButton(), MALLOC, menuButtonWidgetClass, nc, NULL, SelMenu(), simpleMenuWidgetClass, smeBSBObjectClass, MenuData::type, w, width, MenuData::win_num, x, XtNfont, XtNfromHoriz, and XtNfromVert.

Referenced by addmen(), CreateGedMenus(), initgraphic(), and test_menu().

00753 {
00754   BYTE *macroptr;
00755   struct BCG *ScilabGC;
00756   HWND hwnd;
00757   LPMW lpmw;
00758   int number, nCountMenu;
00759   number = *win_num;
00760   if (*win_num == -1)
00761   {
00762       lpmw = textwin.lpmw;
00763       hwnd = textwin.hWndParent;
00764       nCountMenu = WGFindMenuPos (lpmw->macro);
00765       if (nCountMenu >= NUMMENU)
00766                         {
00767                                 sciprint (MSG_WARNING10);
00768                                 return;
00769                         }
00770   }
00771   else
00772   {
00773      ScilabGC = getWindowXgcNumber (*win_num);
00774      if (ScilabGC != (struct BCG *) 0)
00775                 {
00776                         lpmw = &(ScilabGC->lpmw);
00777                         hwnd = ScilabGC->hWndParent;
00778                         nCountMenu = WGFindMenuPos (lpmw->macro);
00779                         if (nCountMenu >= NUMMENU)
00780             {
00781               sciprint (MSG_WARNING11,*win_num);
00782               return;
00783             }
00784                 }
00785                 else    return;
00786   }
00787 
00788   if (*ne == 0)
00789   {
00790     AppendMenu (lpmw->hMenu, MF_STRING, nCountMenu, button_name);
00791     if ((macroptr = LocalAlloc (LPTR, lstrlen ("@%dexecstr(%s_%d(%d))")+ lstrlen (fname) + 1)) != (BYTE *) NULL)
00792                 {
00793                         if (*win_num < 0)
00794                                 if (*typ==0) 
00795                                         sprintf ((char *) macroptr, "@%dexecstr(%s(%d))", *typ, fname, 1);
00796                                 else 
00797                                         if (*typ==2) sprintf ((char *) macroptr, "@0%s(%d,%d)",fname, 1,*win_num);
00798                                         else sprintf ((char *) macroptr, "@%dexecstr(%s(%d))", *typ,fname, 1);
00799                         else 
00800                                 if (*typ==0) sprintf ((char *) macroptr, "@0execstr(%s_%d(%d))",fname, *win_num, 1);
00801                                 else
00802                                         if (*typ==2) sprintf ((char *) macroptr, "@0%s(%d,%d)",fname, 1,*win_num);
00803                                         else sprintf ((char *) macroptr, "@%dexecstr(%s_%d(%d))", *typ,fname, *win_num, 1);
00804                 }
00805     else
00806                 {
00807                         sciprint (MSG_WARNING12);
00808                         return;
00809                 }
00810 
00811     lpmw->macro[nCountMenu] = macroptr;
00812   }
00813   else
00814   {
00815                 int i=0;
00816                 int j=0;
00817     HMENU hMenu;
00818     hMenu = CreateMenu ();
00819                 
00820 
00821     AppendMenu (lpmw->hMenu, MF_STRING | MF_POPUP, (UINT) hMenu, button_name);
00822     for (i = 0; i < *ne; i++)
00823                 {
00824                         
00825                         nCountMenu = WGFindMenuPos (lpmw->macro);
00826                         if (nCountMenu >= NUMMENU)
00827             {
00828               sciprint (MSG_WARNING13);
00829               return;
00830             }
00831                         if ( strcmp("[--]",entries[i])==0 )
00832                         {
00833                                 AppendMenu (hMenu, MF_SEPARATOR, 0, (LPSTR) NULL);
00834                         }
00835                         else
00836                         {
00837                                 AppendMenu (hMenu, MF_STRING, nCountMenu, entries[i]);
00838                                 if ((macroptr = LocalAlloc (LPTR, lstrlen ("@%dexecstr(%s_%d(%d))")+ lstrlen (fname) + 1)) != (BYTE *) NULL)
00839                                 {
00840                                         if (*win_num < 0)
00841                                                 if (*typ==0) 
00842                                                         sprintf ((char *) macroptr, "@%dexecstr(%s(%d))", *typ, fname, j + 1);
00843                                                 else
00844                                                         if (*typ==2) sprintf ((char *) macroptr, "@0%s(%d)",fname, j + 1);
00845                                                         else sprintf ((char *) macroptr, "@%dexecstr(%s(%d))", *typ,fname, j + 1);
00846                                         else
00847                                                 if (*typ==0) sprintf ((char *) macroptr, "@0execstr(%s_%d(%d))",fname, *win_num, j + 1);
00848                                                 else
00849                                                         if (*typ==2) sprintf ((char *) macroptr, "@0%s(%d,%d)",fname, j + 1,*win_num);
00850                                                         else sprintf ((char *) macroptr, "@%dexecstr(%s_%d(%d))", *typ,fname, *win_num, j + 1);
00851                                         j++;
00852                                 }
00853                                 else
00854                                 {
00855                                         sciprint (MSG_WARNING14);
00856                                         return;
00857                                 }
00858                                 lpmw->macro[nCountMenu] = macroptr;
00859                         }
00860                 }
00861   }
00862   DrawMenuBar (hwnd);
00863 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* alloc ( unsigned long  size,
char *  message 
)

Definition at line 70 of file misc.c.

References int_error(), MALLOC, MSG_ERROR75, NO_CARET, NULL, p, and void().

Referenced by readline_win().

00073 {
00074         char *p;                        /* the new allocation */
00075         char errbuf[100];               /* error message string */
00076         p = MALLOC ((size_t) size);     /* try again */
00077         if (p == (char *) NULL)
00078         {
00079                 /* really out of memory */
00080                 if (message != NULL)
00081                 {
00082                         (void) sprintf (errbuf, MSG_ERROR75, message);
00083                         int_error (errbuf, NO_CARET);
00084                         /* NOTREACHED */
00085                 }
00086                 /* else we return NULL */
00087         }
00088         return (p);
00089 }

Here is the call graph for this function:

Here is the caller graph for this function:

int CheckClickQueue ( int win,
int x,
int y,
int ibut,
int motion,
int release 
)

Definition at line 163 of file Events.c.

References ClickBuf, i, but::ibutton, j, lastc, but::motion, but::release, but::x, and but::y.

00164 {
00165   int i;
00166   for ( i = 0 ; i < lastc ; i++ )
00167     {
00168       int j ;
00169       if ( ClickBuf[i].win == *win || *win == -1 ) 
00170         {
00171           *win = ClickBuf[i].win;
00172           *x= ClickBuf[i].x ;
00173           *y= ClickBuf[i].y ;
00174           *ibut= ClickBuf[i].ibutton; 
00175           *motion= ClickBuf[i].motion ;
00176           *release= ClickBuf[i].release ;
00177           for ( j = i+1 ; j < lastc ; j++ ) 
00178             {
00179               ClickBuf[j-1].win = ClickBuf[j].win ;
00180               ClickBuf[j-1].x   = ClickBuf[j].x ;
00181               ClickBuf[j-1].y =  ClickBuf[j].y ;
00182               ClickBuf[j-1].ibutton = ClickBuf[j].ibutton ;
00183               ClickBuf[j-1].motion =  ClickBuf[j].motion ;
00184               ClickBuf[j-1].release = ClickBuf[j].release ;
00185             }
00186           lastc--;
00187           return(1);
00188         }
00189     }
00190   return(0);
00191 }

int C2F() chmenu ( integer ,
char *  ,
char *   
)

Definition at line 618 of file wgmenu.c.

References getWindowXgcNumber(), tagTW::hWndParent, tagTW::lpmw, SciChMenu(), and textwin.

Referenced by MenuFixCurrentWin().

00619 {
00620   struct BCG *ScilabGC;
00621   if (*win_num == -1)
00622     {
00623       SciChMenu (textwin.lpmw, old_name, new_name);
00624       DrawMenuBar (textwin.hWndParent);
00625     }
00626   else
00627     {
00628       ScilabGC = getWindowXgcNumber (*win_num);
00629       if (ScilabGC != (struct BCG *) 0)
00630         {
00631           SciChMenu (&(ScilabGC->lpmw), old_name, new_name);
00632           DrawMenuBar (ScilabGC->hWndParent);
00633         }
00634     }
00635   return (0);
00636 }

Here is the call graph for this function:

Here is the caller graph for this function:

int ClearClickQueue ( int  win  ) 

Definition at line 193 of file Events.c.

References ClickBuf, i, but::ibutton, j, lastc, but::motion, but::release, but::x, and but::y.

00194 {
00195   int i;
00196   if ( win == -1 ) 
00197     {
00198       lastc = 0;
00199       return 0;
00200     }
00201   for ( i = 0 ; i < lastc ; i++ )
00202     {
00203       int j ;
00204       if ( ClickBuf[i].win == win  ) 
00205         {
00206           for ( j = i+1 ; j < lastc ; j++ ) 
00207             {
00208               ClickBuf[j-1].win = ClickBuf[j].win ;
00209               ClickBuf[j-1].x   = ClickBuf[j].x ;
00210               ClickBuf[j-1].y =  ClickBuf[j].y ;
00211               ClickBuf[j-1].ibutton = ClickBuf[j].ibutton ;
00212               ClickBuf[j-1].motion =  ClickBuf[j].motion ;
00213               ClickBuf[j-1].release = ClickBuf[j].release ;
00214             }
00215           lastc--;
00216         }
00217     }
00218   lastc=0;
00219   return(0);
00220 }

int C2F() clearexit ( integer n  ) 

void CloseGraphMacros ( struct BCG ScilabGC  ) 

Definition at line 480 of file wgmenu.c.

Referenced by DeleteWindowToList(), and RefreshMenus().

00481 {
00482   int i;
00483   HGLOBAL hglobal;
00484   if (ScilabGC->lpmw.macro != (BYTE **) NULL)
00485     {
00486       hglobal = GlobalHandle (ScilabGC->lpmw.macro);
00487       if (hglobal)
00488         {
00489           for (i = 0; i < NUMMENU; i++)
00490             if (ScilabGC->lpmw.macro[i] != (BYTE *) 0)
00491               {
00492                 LocalFree (ScilabGC->lpmw.macro[i]);
00493                 ScilabGC->lpmw.macro[i] = (BYTE *) 0;
00494               }
00495           GlobalUnlock (hglobal);
00496           GlobalFree (hglobal);
00497           ScilabGC->lpmw.macro = (BYTE **) NULL;
00498         }
00499     }
00500 
00501     if ( ScilabGC->lpmw.szMenuName != NULL )
00502     {
00503       FREE( ScilabGC->lpmw.szMenuName ) ;
00504       ScilabGC->lpmw.szMenuName = NULL ;
00505     }
00506 }

Here is the caller graph for this function:

void CloseMacros ( LPTW  lptw  ) 

Definition at line 1559 of file wmenu.c.

Referenced by ReLoadMenus(), and TextClose().

01560 {
01561   int i;
01562   HGLOBAL hglobal;
01563   LPMW lpmw;
01564   lpmw = lptw->lpmw;
01565   
01566   
01567   if (lpmw->macro != (BYTE **) NULL)
01568     {
01569       hglobal = GlobalHandle (lpmw->macro);
01570       if (hglobal)
01571         {
01572           for (i = 0; i < NUMMENU; i++)
01573             if (lpmw->macro[i] != (BYTE *) 0)
01574               {
01575                 LocalFree (lpmw->macro[i]);
01576                 lpmw->macro[i] = (BYTE *) 0;
01577               }
01578           GlobalUnlock (hglobal);
01579           GlobalFree (hglobal);
01580           lpmw->macro = (BYTE **) NULL;
01581         }
01582     }
01583   if (lpmw->szPrompt != (char *) NULL)
01584     {
01585       LocalFree (lpmw->szPrompt);
01586       lpmw->szPrompt = (char *) NULL;
01587     }
01588   if (lpmw->szAnswer != (char *) NULL)
01589     {
01590       LocalFree (lpmw->szAnswer);
01591       lpmw->szAnswer = (char *) NULL;
01592     }
01593 }

Here is the caller graph for this function:

int com_line ( void   ) 

int CopyPrint ( struct BCG ScilabGC  ) 

Definition at line 44 of file FigureToPrint.c.

References BCG::CurWindow, BCG::CWindow, FALSE, GetCurrentFigureWindows(), GetPrinterDC(), hdllInstance, HORZRES, int, L, MSG_ERROR34, MSG_SCIMSG12, MyGetProcAddress, NULL, pr, PrintAbortProc(), PrintDlgProc(), printer, Printer_XRes, Printer_YRes, PrintRegister(), PrintUnregister(), scig_replay_hdc(), sciprint(), SetCurrentFigureWindows(), Setscig_buzyState(), tagGW::Title, TRUE, TryToGetDC(), VERTRES, and WindowsPrintScreen.

Referenced by FigureToPrint(), and SendGraphMacro().

00045 {
00046         int xPage, yPage;
00047         static DOCINFO di = {sizeof (DOCINFO), MSG_SCIMSG12, NULL};
00048         BOOL bError = FALSE;
00049         HDC hDCfromhWnd=NULL;
00050         HDC printer=NULL;
00051         LPGW lpgw;
00052         ABORTPROC lpfnAbortProc;
00053         DLGPROC lpfnPrintDlgProc;
00054         static PRINTDLG pd;
00055         HWND hwnd;
00056         RECT rect,RectRestore;
00057         PRINT pr;
00058 
00059         integer SaveCurrentWindow=0;
00060 
00061         SaveCurrentWindow=GetCurrentFigureWindows();
00062 
00063         Setscig_buzyState(TRUE);
00064 
00065         SetCurrentFigureWindows (ScilabGC->CurWindow);
00066 
00067         lpgw = ScilabGC->lpgw;
00068         hwnd = ScilabGC->CWindow;
00069         hDCfromhWnd=TryToGetDC (hwnd);
00070 
00071         printer = (HDC)GetPrinterDC();
00072 
00073         if (NULL == printer)
00074         {
00075                 /* Redessine si Cancel Impression */
00076                 GetClientRect (hwnd, &RectRestore);
00077                 scig_replay_hdc ('W', ScilabGC->CurWindow, hDCfromhWnd,RectRestore.right - RectRestore.left, RectRestore.bottom - RectRestore.top, 1);
00078                 Setscig_buzyState(FALSE);
00079                 return TRUE;            /* abort */
00080         }
00081 
00082         pr.hdcPrn = printer;
00083         xPage = GetDeviceCaps (pr.hdcPrn, HORZRES);
00084         yPage = GetDeviceCaps (pr.hdcPrn, VERTRES);
00085 
00086         GetClientRect (hwnd, &rect);
00087         SetLastError (0);
00088         if (SetWindowLong (hwnd, 4, (LONG) ((LP_PRINT) & pr)) == 0 && GetLastError () != 0)
00089         {
00090                 sciprint (MSG_ERROR34);
00091                 Setscig_buzyState(FALSE);
00092                 return TRUE;
00093         }
00094         if (SetWindowLong(ScilabGC->hWndParent, 4, (LONG) ((LP_PRINT) & pr)) == 0       && GetLastError () != 0)
00095         {
00096                 sciprint (MSG_ERROR34);
00097                 Setscig_buzyState(FALSE);
00098                 return TRUE;
00099         }
00100         PrintRegister ((LP_PRINT) & pr);
00101         EnableWindow (hwnd, FALSE);
00102 
00103         pr.bUserAbort = FALSE;
00104         lpfnPrintDlgProc = (DLGPROC) MyGetProcAddress ("PrintDlgProc",PrintDlgProc);
00105         lpfnAbortProc = (ABORTPROC) MyGetProcAddress ("PrintAbortProc",PrintAbortProc);
00106         pr.hDlgPrint = CreateDialogParam (hdllInstance, "PrintDlgBox", hwnd, lpfnPrintDlgProc, (LPARAM) lpgw->Title);
00107         SetAbortProc (pr.hdcPrn, lpfnAbortProc);
00108 
00109         if (StartDoc (pr.hdcPrn, &di) > 0)
00110         {
00111                 if (StartPage (pr.hdcPrn) > 0)
00112                 {
00113                         int scalef = 1;
00114                         SetMapMode (pr.hdcPrn, MM_TEXT);
00115                         SetBkMode (pr.hdcPrn, TRANSPARENT);
00116                         SetTextAlign (pr.hdcPrn, TA_LEFT | TA_BOTTOM);
00117                         scalef = (int) (10.0 * ((double) xPage * yPage) / (6800.0 * 4725.0));
00118                         GetClientRect (hwnd, &RectRestore);
00119                         /* Evite bug lorsque l'on selectionne la fenetre & que l'on imprime apres */
00120                         scig_replay_hdc ('P', ScilabGC->CurWindow, hDCfromhWnd,RectRestore.right - RectRestore.left, RectRestore.bottom - RectRestore.top, 1);
00121                         WindowsPrintScreen = 1;
00122                         Printer_XRes = GetDeviceCaps (pr.hdcPrn, LOGPIXELSX);
00123                         Printer_YRes = GetDeviceCaps (pr.hdcPrn, LOGPIXELSY);
00124                         scig_replay_hdc ('P', ScilabGC->CurWindow, printer,xPage, yPage, scalef);
00125                         WindowsPrintScreen = 0;
00126                         /* Redessine à l'ecran apres l'impression */
00127                         scig_replay_hdc ('W', ScilabGC->CurWindow,hDCfromhWnd,RectRestore.right - RectRestore.left, RectRestore.bottom - RectRestore.top, 1);
00128                         if (EndPage (pr.hdcPrn) > 0)  EndDoc (pr.hdcPrn);
00129                         else bError = TRUE;
00130                 }
00131         }
00132         else bError = TRUE;
00133 
00134         if (!pr.bUserAbort)
00135         {
00136                 EnableWindow (hwnd, TRUE);
00137                 DestroyWindow (pr.hDlgPrint);
00138         }
00139         if (printer) {DeleteDC (printer); printer=NULL;}
00140         SetWindowLong (hwnd, 4, (LONG) (0L));
00141         SetWindowLong (ScilabGC->hWndParent, 4, (LONG) (0L));
00142         PrintUnregister ((LP_PRINT) & pr);
00143 
00144         ReleaseDC (hwnd, hDCfromhWnd);
00145         SetCurrentFigureWindows (SaveCurrentWindow);
00146 
00147         Setscig_buzyState(FALSE);
00148         InvalidateRect(hwnd,NULL,TRUE);
00149 
00150         return bError || pr.bUserAbort;
00151 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CopyToClipboardBitmap ( struct BCG ScilabGC  ) 

Definition at line 113 of file ExportBmpEmf.c.

00114 {
00115         LPGW lpgw;
00116         HDC hmemDC;
00117         HBITMAP hBitmap;
00118         
00119         HWND hwnd;
00120         HDC hdc=NULL;
00121         integer SaveCurrentWindow=0;
00122 
00123         SaveCurrentWindow=GetCurrentFigureWindows();
00124 
00125         Setscig_buzyState(TRUE);
00126 
00127         SetCurrentFigureWindows (ScilabGC->CurWindow);
00128 
00129         /* view the window */
00130         lpgw = ScilabGC->lpgw;
00131         hwnd = ScilabGC->CWindow;
00132 
00133         if (IsIconic (hwnd))   ShowWindow (hwnd, SW_SHOWNORMAL);
00134         BringWindowToTop (hwnd);
00135         UpdateWindow (hwnd);
00136 
00137         /* get the context */
00138         hdc = TryToGetDC (hwnd);
00139 
00140         /* make a bitmap and copy it there */
00141         if (hdc)
00142         {
00144                 scig_replay_hdc ('C', ScilabGC->CurWindow, hdc, ScilabGC->CWindowWidth,ScilabGC->CWindowHeight, 1);
00145                 ReleaseDC (hwnd, hdc);
00146 
00147                 hmemDC = CreateCompatibleDC (hdc);
00148                 hBitmap = CreateCompatibleBitmap (hdc, ScilabGC->CWindowWidth,ScilabGC->CWindowHeight);
00149 
00150                 if (hBitmap)
00151                 {
00152                         SelectBitmap (hmemDC, hBitmap);
00153                         scig_replay_hdc ('C', ScilabGC->CurWindow, hmemDC,ScilabGC->CWindowWidth,ScilabGC->CWindowHeight, 1);
00154 
00155                         OpenClipboard (hwnd);
00156                         EmptyClipboard ();
00157                         SetClipboardData (CF_BITMAP, hBitmap);
00158                         CloseClipboard ();
00159 
00160                         DeleteDC(hmemDC);
00161                         DeleteBitmap(hBitmap);
00162                 }
00163                 else
00164                 {
00165                         MessageBeep (MB_ICONHAND);
00166                         MessageBox (hwnd, MSG_WARNING16,lpgw->Title, MB_ICONHAND | MB_OK);
00167                 }
00168         }
00169         else
00170         {
00171                 MessageBox(NULL,MSG_ERROR36,MSG_ERROR20,MB_ICONWARNING);
00172         }
00173 
00174         SetCurrentFigureWindows (SaveCurrentWindow);
00175 
00176         Setscig_buzyState(FALSE);
00177 
00178         return;
00179 }

void CopyToClipboardEMF ( struct BCG ScilabGC  ) 

Definition at line 53 of file ExportBmpEmf.c.

00054 {
00055         TCHAR szDesc[] = "Scilab\0Image\0\0";
00056         LPGW lpgw;
00057 
00058         HANDLE hmf;
00059 
00060         HWND hwnd;
00061         HDC hdcEMF=NULL;
00062         HDC hDCtmp=NULL;
00063         integer SaveCurrentWindow=0;
00064 
00065         SaveCurrentWindow=GetCurrentFigureWindows();
00066 
00067         lpgw = ScilabGC->lpgw;
00068         hwnd = ScilabGC->CWindow;
00069 
00070         Setscig_buzyState(TRUE);
00071 
00072         SetCurrentFigureWindows (ScilabGC->CurWindow);
00073 
00074         hDCtmp = TryToGetDC (hwnd);
00075         if (hDCtmp) hdcEMF = CreateEnhMetaFile (hDCtmp, NULL, NULL, szDesc);
00076 
00077         if (hdcEMF)
00078         {
00079                 /* view the window */
00080                 if (IsIconic (hwnd)) ShowWindow (hwnd, SW_SHOWNORMAL);
00081                 BringWindowToTop (hwnd);
00082                 UpdateWindow (hwnd);
00083 
00084                 SetMapMode (hdcEMF, MM_TEXT);
00085                 SetTextAlign (hdcEMF, TA_LEFT | TA_BOTTOM);
00086                 SetWindowExtEx (hdcEMF, ScilabGC->CWindowWidth,ScilabGC->CWindowHeight,(LPSIZE) NULL);
00087                 Rectangle (hdcEMF, 0, 0, ScilabGC->CWindowWidth,ScilabGC->CWindowHeight);
00088 
00090                 scig_replay_hdc ('C', ScilabGC->CurWindow, hDCtmp, ScilabGC->CWindowWidth,ScilabGC->CWindowHeight, 1);
00091                 ReleaseDC(hwnd,hDCtmp);
00092 
00093                 scig_replay_hdc ('C', ScilabGC->CurWindow, hdcEMF, ScilabGC->CWindowWidth,ScilabGC->CWindowHeight, 1);
00094                 hmf = CloseEnhMetaFile (hdcEMF);  
00095                 ReleaseDC(hwnd,hdcEMF);
00096 
00097 
00098                 OpenClipboard (hwnd);
00099                 EmptyClipboard ();
00100                 SetClipboardData (CF_ENHMETAFILE, hmf);
00101                 CloseClipboard ();
00102         }
00103 
00104         SetCurrentFigureWindows (SaveCurrentWindow);
00105         Setscig_buzyState(FALSE);
00106         return;
00107 }

int CtrlCHit ( LPTW  lptw  ) 

Definition at line 867 of file wtext.c.

Referenced by ExposeChooseWindow(), SciClick(), and TextMessage1().

00868 {
00869   int ch;
00870   
00871   if (TextKBHit (lptw))
00872     {
00873       ch = *lptw->KeyBufOut++;
00874       if (lptw->KeyBufOut - lptw->KeyBuf >= (int) lptw->KeyBufSize)
00875         lptw->KeyBufOut = lptw->KeyBuf;         /* wrap around */
00876       if (ch == 3)
00877         {
00878         
00879           if ( HasAZoneTextSelected(lptw) )
00880           {
00881                 TextCopyClip(lptw);
00882           }
00883           else
00884           {
00885                 SignalCtrC ();
00886           }
00887           
00888           
00889           return (1);
00890         }
00891     }
00892   return (0);
00893 }

Here is the caller graph for this function:

void DebugGW ( char *  fmt,
  ... 
)

wgraph

Definition at line 59 of file wgraph.c.

References args, buf, count, tagTW::hWndParent, MAXPRINTF, textwin, and tagTW::Title.

00060 {
00061 #ifdef DEBUG
00062   int count;
00063   char buf[MAXPRINTF];
00064   va_list args;
00065   va_start (args, fmt);
00066   count = vsprintf (buf, fmt, args);
00067   MessageBox (textwin.hWndParent, (LPSTR) buf,
00068               textwin.Title, MB_ICONEXCLAMATION);
00069   va_end (args);
00070 #endif
00071 }

int C2F() delbtn ( integer ,
char *   
)

Definition at line 658 of file wgmenu.c.

References args, FALSE, GetChilds(), h, i, iargs, int, nc, NULL, pos, v, w, XawChainTop, XtNbottom, XtNfromHoriz, XtNfromVert, and XtNtop.

00659 {
00660   struct BCG *ScilabGC;
00661   if (*win_num == -1)
00662     {
00663       SciDelMenu (textwin.lpmw, button_name);
00664       DrawMenuBar (textwin.hWndParent);
00665     }
00666   else
00667     {
00668       ScilabGC = getWindowXgcNumber (*win_num);
00669       if (ScilabGC != (struct BCG *) 0)
00670         {
00671           SciDelMenu (&(ScilabGC->lpmw), button_name);
00672           DrawMenuBar (ScilabGC->hWndParent);
00673         }
00674     }
00675   return (0);
00676 }

Here is the call graph for this function:

int C2F() deletewin ( integer number  ) 

Definition at line 1008 of file SGraph.c.

01008                                     {
01009   Delete((Widget) 0,(XtPointer) *number,(XtPointer) 0);
01010   return(0);
01011 }

BOOL DialogWindow (  ) 

Definition at line 76 of file wmen_dialog.c.

00077 {
00078   char *c=NULL;
00079   int i=0;
00080   int lenStr=0;
00081   HWND hwndOwner ;
00082   DLGPROC lpfnSciDialogDlgProc ;
00083 
00084   lpfnSciDialogDlgProc = (DLGPROC) MyGetProcAddress("SciDialogDlgProc", SciDialogDlgProc);
00085 
00086   c=ScilabDialog.description;
00087   
00088   while ( *c != '\0')
00089   {
00090         if ( *c == '\n' )
00091                 {
00092                         i++;
00093                         if (lenStr>40)
00094                         {
00095                                 i++;
00096                                 
00097                         }
00098                         lenStr=0;
00099                 }
00100         c++;
00101         lenStr++;
00102   }
00103 
00104   if ( i >= 3 ) 
00105   {
00106           c="SciBigDialogDlgBox";
00107   }
00108   else 
00109   {
00110           c="SciDialogDlgBox";
00111   }
00112 
00113   hwndOwner=NULL;
00114   if (DialogBox(hdllInstance,c,hwndOwner,lpfnSciDialogDlgProc)  == IDOK) return(TRUE);
00115   else return(FALSE);
00116 }

int C2F() dr (  ) 

void DragFunc ( LPTW  lptw,
HDROP  hdrop 
)

Definition at line 13 of file DragnDrop.c.

00014 {
00015         static char szFile[MAX_PATH];
00016         int i, cFiles;
00017         
00018         cFiles = DragQueryFile (hdrop, 0xffffffff, (LPSTR) NULL, 0);
00019 
00020         lptw->bGetCh =FALSE;
00021 
00022         for (i = 0; i < cFiles; i++)
00023         {
00024                 DragQueryFile (hdrop, i, szFile, MAX_PATH);
00025                 LaunchFilebyExtension(szFile);  
00026         }
00027         DragFinish (hdrop);
00028 }

void C2F() fbutn ( char *  buf,
int win,
int ent 
)

int get_is_reading ( void   ) 

handle function when scilab waits for commands get the mode

Returns:
the reading mode

Definition at line 28 of file flags.c.

00029 {
00030     return(reading);
00031 }

int GetCommand ( char *   ) 

Definition at line 161 of file dynamic_menus.c.

00162 {
00163   int flag;
00164   flag = 0;     
00165   if (commandQueue != NULL)
00166     {
00167 
00168       CommandRec *p;
00169 
00170                 
00171       p = commandQueue;
00172       strcpy (str, p->command);
00173       flag=p->flag;
00174 
00175       commandQueue = p->next;
00176       FREE (p->command);
00177       FREE (p);
00178       if (C2F(iop).ddt==-1) {
00179         if (flag==0) { sciprint_full("   Unqueuing %s - No option\r\n",str); }
00180         else         { sciprint_full("   Unqueuing %s - seq\r\n",str); }
00181       }
00182     }
00183   return flag;
00184 }

int GetLine ( char *  buffer,
int  len,
GFILE gfile 
)

Definition at line 1031 of file wmenu.c.

Referenced by LoadGraphMacros(), and LoadMacros().

01032 {
01033   BOOL status;
01034   int nLine = 0;
01035 
01036   status = (Gfgets (buffer, len, gfile) != 0);
01037   nLine++;
01038   while (status && (buffer[0] == '\0' || buffer[0] == '\n' || buffer[0] == ';'))
01039     {
01040       /* blank line or comment - ignore */
01041       status = (Gfgets (buffer, len, gfile) != 0);
01042       nLine++;
01043     }
01044   if (lstrlen (buffer) > 0)
01045     buffer[lstrlen (buffer) - 1] = '\0';        /* remove trailing \n */
01046   if (!status)
01047     nLine = 0;                  /* zero lines if file error */
01048   return nLine;
01049 }

Here is the caller graph for this function:

int C2F() getmen ( char *  ,
integer ,
integer  
)

Definition at line 204 of file dynamic_menus.c.

References C2F, GetCommand(), and ismenu().

Referenced by parse(), run(), SciClick(), and xclick_any().

00205 {
00206   int flag;
00207   if (C2F(ismenu)()==1) 
00208     {
00209       flag=GetCommand(btn_cmd);
00210       *lb=(integer)strlen(btn_cmd);
00211       *entry=0;  /* This parameter entry seems to be unused. Probably a very old thing... */
00212     }
00213   else
00214     { 
00215       flag=0;
00216       *lb =0;
00217       *entry=0;  /* This parameter entry seems to be unused. Probably a very old thing... */
00218     }
00219   return flag;
00220 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Gfclose ( GFILE gfile  ) 

Definition at line 990 of file wmenu.c.

00991 {
00992   _lclose (gfile->hfile);
00993   LocalFree (gfile);
00994   return;
00995 }

int Gfgets ( LPSTR  lp,
int  size,
GFILE gfile 
)

Definition at line 998 of file wmenu.c.

Referenced by GetLine().

00999 {
01000   int i;
01001   int ch;
01002   for (i = 0; i < size; i++)
01003     {
01004       if (gfile->getleft <= 0)
01005         {
01006           if ((gfile->getleft
01007                = _lread (gfile->hfile, gfile->getbuf, GBUFSIZE)) == 0)
01008             break;
01009           gfile->getnext = 0;
01010         }
01011       ch = *lp++ = gfile->getbuf[gfile->getnext++];
01012       gfile->getleft--;
01013       if (ch == '\r')
01014         {
01015           i--;
01016           lp--;
01017         }
01018       if (ch == '\n')
01019         {
01020           i++;
01021           break;
01022         }
01023     }
01024   if (i < size)
01025     *lp++ = '\0';
01026   return i;
01027 }

Here is the caller graph for this function:

GFILE* Gfopen ( LPSTR  lpszFileName,
int  fnOpenMode 
)

Definition at line 973 of file wmenu.c.

Referenced by LoadGraphMacros(), and LoadMacros().

00974 {
00975   GFILE *gfile;
00976   gfile = (GFILE *) LocalAlloc (LPTR, sizeof (GFILE));
00977   if (!gfile)
00978     return NULL;
00979   gfile->hfile = _lopen (lpszFileName, fnOpenMode);
00980   if (gfile->hfile == HFILE_ERROR)
00981     {
00982       LocalFree (gfile);
00983       return NULL;
00984     }
00985   gfile->getleft = 0;
00986   gfile->getnext = 0;
00987   return gfile;
00988 }

Here is the caller graph for this function:

int gp_printfile ( HINSTANCE  hInstance,
HWND  hwnd,
char *  filename,
char *  port 
)

Definition at line 54 of file gvwprn.c.

References buffer, count, f(), FALSE, FREE, get_queuename(), MALLOC, MAXSTR, MSG_ERROR71, MSG_ERROR72, MSG_ERROR73, MSG_ERROR74, NULL, PRINT_BUF_SIZE, printer, sciprint(), and TRUE.

00055 {
00056   DWORD count;
00057   char *buffer;
00058   char portname[MAXSTR];
00059   FILE *f;
00060   HANDLE printer;
00061   DOC_INFO_1 di;
00062   DWORD written;
00063 
00064   if (!get_queuename (hInstance, hwnd, portname, port))    return FALSE;
00065   port = portname + 8;          /* skip over \\spool\ */
00066 
00067   if ((buffer = MALLOC (PRINT_BUF_SIZE)) == (char *) NULL) return FALSE;
00068   if (filename != (char *) 0)
00069     {
00070       if ((f = fopen (filename, "rb")) == (FILE *) NULL)
00071         {
00072           FREE (buffer);
00073           return FALSE;
00074         }
00075     }
00076   else
00077     f = stdin;
00078 
00079   /* open a printer */
00080   if (!OpenPrinter (port, &printer, NULL))
00081     {
00082       sciprint (MSG_ERROR71, port, GetLastError ());
00083       FREE (buffer);
00084       return FALSE;
00085     }
00086   /* from here until ClosePrinter, should AbortPrinter on error */
00087 
00088   di.pDocName = filename;
00089   di.pOutputFile = NULL;
00090   di.pDatatype = "RAW";         /* for available types see EnumPrintProcessorDatatypes */
00091   if (!StartDocPrinter (printer, 1, (LPBYTE) & di))
00092     {
00093       sciprint (MSG_ERROR72, GetLastError ());
00094       AbortPrinter (printer);
00095       FREE (buffer);
00096       return FALSE;
00097     }
00098 
00099   while ((count = fread (buffer, 1, PRINT_BUF_SIZE, f)) != 0)
00100     {
00101       if (!WritePrinter (printer, (LPVOID) buffer, count, &written))
00102         {
00103           FREE (buffer);
00104           fclose (f);
00105           AbortPrinter (printer);
00106           return FALSE;
00107         }
00108     }
00109   fclose (f);
00110   FREE (buffer);
00111 
00112   if (!EndDocPrinter (printer))
00113     {
00114       sciprint (MSG_ERROR73, GetLastError ());
00115       AbortPrinter (printer);
00116       return FALSE;
00117     }
00118 
00119   if (!ClosePrinter (printer))
00120     {
00121       sciprint (MSG_ERROR74, GetLastError ());
00122       return FALSE;
00123     }
00124   return TRUE;
00125 }

Here is the call graph for this function:

HWND InitStatusBar ( HWND  hwndParent  ) 

Definition at line 44 of file wstatbar.c.

References dwStatusBarStyles, and MSG_SCIMSG55.

Referenced by initgraphic().

00045 {
00046   HWND hwndSB;
00047   /* Initialize values for WM_MENUSELECT message handling */
00048   hwndSB = CreateStatusWindow (dwStatusBarStyles,
00049                                MSG_SCIMSG55,
00050                                hwndParent,
00051                                2);
00052   return hwndSB;
00053 }

Here is the caller graph for this function:

int instring ( char *  str,
char  c 
)

Definition at line 95 of file misc.c.

References NULL, and pos.

00096 {
00097   int pos = 0;
00098   while (str != NULL && *str != '\0' && c != *str)
00099     {
00100       str++;
00101       pos++;
00102     }
00103   return (pos);
00104 }

void int_error ( char *  str,
int  t_num 
)

Definition at line 109 of file misc.c.

References env, input_line, NO_CARET, sciprint(), SCIPROMPT, and TRUE.

Referenced by alloc(), and read_line().

00110 {
00111   /* reprint line if screen has been written to */
00112   if (t_num != NO_CARET)
00113     {                           /* put caret under error */
00114       sciprint ("\n%s%s\n", SCIPROMPT, input_line);
00115     }
00116   sciprint ("\t%s\n\n", str);
00117   longjmp (env, TRUE);          /* bail out to command line */
00118 }

Here is the call graph for this function:

Here is the caller graph for this function:

int InteractiveMode ( void   ) 

Definition at line 565 of file winmain.c.

00566 {
00567         return nointeractive;
00568 }

integer C2F() ismenu ( void   ) 

Definition at line 191 of file dynamic_menus.c.

00192 {
00193   /* Do not manage comands while compiling scilab function */
00194   if ( (commandQueue == NULL) || (C2F(com).comp[0] != 0)) 
00195     return(0) ;
00196   else 
00197     return(1);
00198 }

void LeftJustify ( char *  d,
char *  s 
)

Definition at line 1052 of file wmenu.c.

Referenced by LoadGraphMacros(), and LoadMacros().

01053 {
01054   while (*s && (*s == ' ' || *s == '\t'))
01055     s++;                        /* skip over space */
01056   do
01057     {
01058       *d++ = *s;
01059     }
01060   while (*s++);
01061 }

Here is the caller graph for this function:

void LoadGraphMacros ( struct BCG ScilabGC  ) 

Definition at line 308 of file wgmenu.c.

Referenced by CreateGedMenus().

00309 {
00310   GFILE *menufile;
00311   BYTE *macroptr;
00312   char *buf;
00313   HMENU hMenu[MENUDEPTH + 1];
00314   int nLine = 1, nInc, i, nMenuLevel, nCountMenu;
00315   HGLOBAL hmacro;
00316   /* mark all buffers and menu file as unused */
00317   buf = (char *) NULL;
00318   hmacro = 0;
00319   ScilabGC->lpmw.macro = (BYTE **) NULL;
00320   menufile = (GFILE *) NULL;
00321 
00322   /* open menu file */
00323   if ((menufile = Gfopen (ScilabGC->lpgw->szMenuName, OF_READ)) == (GFILE *) NULL)
00324     goto errorcleanup;
00325 
00326   /* allocate buffers */
00327   if ((buf = LocalAlloc (LPTR, MAXSTR)) == (char *) NULL)
00328     goto nomemory;
00329   hmacro = GlobalAlloc (GHND, (NUMMENU) * sizeof (BYTE *));
00330   if ((ScilabGC->lpmw.macro = (BYTE **) GlobalLock (hmacro)) == (BYTE **) NULL)
00331     goto nomemory;
00332 
00333   /* Initialize macro array * */
00334   for (i = 0; i < NUMMENU; i++)
00335     {
00336       ScilabGC->lpmw.macro[i] = (BYTE *) 0;
00337     }
00340   ScilabGC->lpmw.nCountMenu = 0;
00341   ScilabGC->lpmw.nButton = 0;
00342   ScilabGC->lpmw.hMenu = hMenu[0] = CreateMenu ();
00343   nMenuLevel = 0;
00344 
00345   while ((nInc = GetLine (buf, MAXSTR, menufile)) != 0)
00346     {
00347       nLine += nInc;
00348       LeftJustify (buf, buf);
00349       if (buf[0] == '\0')
00350         {
00351           /* ignore blank lines */
00352         }
00353       else if (!lstrcmpi (buf, "[Menu]"))
00354         {
00355           /* new menu */
00356           if (!(nInc = GetLine (buf, MAXSTR, menufile)))
00357             {
00358               nLine += nInc;
00359               BUGGOTOCLEAN (MSG_WARNING5);
00360             }
00361           LeftJustify (buf, buf);
00362           if (nMenuLevel < MENUDEPTH)
00363             {
00364               nMenuLevel++;
00365             }
00366           else
00367             {
00368               BUGGOTOCLEAN (MSG_WARNING6);
00369             }
00370           hMenu[nMenuLevel] = CreateMenu ();
00371           AppendMenu (hMenu[nMenuLevel > 0 ? nMenuLevel - 1 : 0],
00372                       MF_STRING | MF_POPUP, (UINT) hMenu[nMenuLevel],
00373                       (LPCSTR) buf);
00374         }
00375       else if (!lstrcmpi (buf, "[EndMenu]"))
00376         {
00377           if (nMenuLevel > 0)
00378             nMenuLevel--;       /* back up one menu */
00379         }
00380       else
00381         {
00382           nCountMenu = WGFindMenuPos (ScilabGC->lpmw.macro);
00383           /* menu item */
00384           if (nCountMenu >= NUMMENU)
00385             {
00386               BUGGOTOCLEAN ( MSG_WARNING7 );
00387             }
00388           LeftJustify (buf, buf);
00389           if (buf[0] == '-')
00390             {
00391               if (nMenuLevel == 0)
00392                 AppendMenu (hMenu[0], MF_MENUBREAK, 0, (LPSTR) NULL);
00393               else
00394                 AppendMenu (hMenu[nMenuLevel], MF_SEPARATOR, 0, (LPSTR) NULL);
00395             }
00396           else if (buf[0] == '|')
00397             {
00398               AppendMenu (hMenu[nMenuLevel], MF_MENUBARBREAK, 0, (LPSTR) NULL);
00399             }
00400           else
00401             {
00402               AppendMenu (hMenu[nMenuLevel], MF_STRING, nCountMenu, (LPSTR) buf);
00403               ScilabGC->lpmw.nCountMenu++;
00404               if (!(nInc = GetLine (buf, MAXSTR, menufile)))
00405                 {
00406                   nLine += nInc;
00407                   BUGGOTOCLEAN (MSG_WARNING8);
00408                 }
00409               LeftJustify (buf, buf);
00410               TranslateMacro (buf);
00411               if ((macroptr = LocalAlloc (LPTR, lstrlen (buf) + 1)) != (BYTE *) NULL)
00412                 {
00413                   lstrcpy ((char *) macroptr, buf);
00414                 }
00415               else
00416                 {
00417                   BUGGOTOCLEAN (MSG_WARNING9);
00418                 }
00419               ScilabGC->lpmw.macro[nCountMenu] = macroptr;
00420             }
00421         }
00422     }
00423   nCountMenu = WGFindMenuPos (ScilabGC->lpmw.macro);
00424   if ((nCountMenu - ScilabGC->lpmw.nButton) > 0)
00425     {
00426       /* we have a menu bar so put it on the window */
00427       SetMenu (ScilabGC->hWndParent, ScilabGC->lpmw.hMenu);
00428       DrawMenuBar (ScilabGC->hWndParent);
00429     }
00430 
00431   goto cleanup;
00432 
00433  nomemory:
00434   MessageBox (ScilabGC->hWndParent, MSG_ERROR77,
00435               ScilabGC->lpgw->Title, MB_ICONEXCLAMATION);
00436 
00437  errorcleanup:
00438   if (hmacro)
00439     {
00440       for (i = 0; i < NUMMENU; i++)
00441         {
00442           if (ScilabGC->lpmw.macro[i] != (BYTE *) 0)
00443             {
00444               LocalFree (ScilabGC->lpmw.macro[i]);
00445               ScilabGC->lpmw.macro[i] = (BYTE *) 0;
00446             }
00447         }
00448       GlobalUnlock (hmacro);
00449       GlobalFree (hmacro);
00450       ScilabGC->lpmw.macro = (BYTE **) NULL;
00451     }
00452 
00453  cleanup:
00454   if (buf != (char *) NULL)
00455     LocalFree (buf);
00456   if (menufile != (GFILE *) NULL)
00457     Gfclose (menufile);
00458   return;
00459 }

Here is the caller graph for this function:

void LoadMacros ( LPTW  lptw  ) 

Definition at line 1083 of file wmenu.c.

Referenced by ReLoadMenus(), and TextInit().

01084 {
01085   GFILE *menufile;
01086   BYTE *macroptr;
01087   char *buf;
01088   int nMenuLevel;
01089   HMENU hMenu[MENUDEPTH + 1+1];
01090   LPMW lpmw;
01091   int nLine = 1;
01092   int nInc;
01093   int nCountMenu;
01094   HGLOBAL hmacro;
01095   int i;
01096   HDC hdc;
01097   TEXTMETRIC tm;
01098   RECT rect;
01099   int ButtonX, ButtonY;
01100   char *ButtonText[BUTTONMAX];
01101 
01102   lpmw = lptw->lpmw;
01103 
01104   /* mark all buffers and menu file as unused */
01105   buf = (char *) NULL;
01106   hmacro = 0;
01107   lpmw->macro = (BYTE **) NULL;
01108   lpmw->szPrompt = (char *) NULL;
01109   lpmw->szAnswer = (char *) NULL;
01110   menufile = (GFILE *) NULL;
01111 
01112   /* open menu file */
01113   if ((menufile = Gfopen (lpmw->szMenuName, OF_READ)) == (GFILE *) NULL)
01114     goto errorcleanup;
01115 
01116   /* allocate buffers */
01117   if ((buf = LocalAlloc (LPTR, MAXSTR)) == (char *) NULL)
01118     goto nomemory;
01119   hmacro = GlobalAlloc (GHND, (NUMMENU) * sizeof (BYTE *));
01120   if ((lpmw->macro = (BYTE **) GlobalLock (hmacro)) == (BYTE **) NULL)
01121     goto nomemory;
01122   if ((lpmw->szPrompt = LocalAlloc (LPTR, MAXSTR)) == (char *) NULL)
01123     goto nomemory;
01124   if ((lpmw->szAnswer = LocalAlloc (LPTR, MAXSTR)) == (char *) NULL)
01125     goto nomemory;
01126 
01127   /* Initialize macro array * */
01128   for (i = 0; i < NUMMENU; i++)
01129     {
01130       lpmw->macro[i] = (BYTE *) 0;
01131     }
01132   lpmw->nCountMenu = 0;         /* counts predefined menus * */
01133   lpmw->nButton = 0;
01134   lpmw->hMenu = hMenu[0] = CreateMenu ();
01135   nMenuLevel = 0;
01136 
01137   while ((nInc = GetLine (buf, MAXSTR, menufile)) != 0)
01138     {
01139       nLine += nInc;
01140       LeftJustify (buf, buf);
01141       if (buf[0] == '\0')
01142         {
01143           /* ignore blank lines */
01144         }
01145       else if (!lstrcmpi (buf, "[Menu]"))
01146         {
01147           /* new menu */
01148           if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01149             {
01150               nLine += nInc;
01151               BUGGOTOCLEAN ("Problem on line %d of %s\n");
01152             }
01153           LeftJustify (buf, buf);
01154           if (nMenuLevel < MENUDEPTH+1)
01155             nMenuLevel++;
01156           else
01157             {
01158               BUGGOTOCLEAN (MSG_ERROR43);
01159             }
01160           hMenu[nMenuLevel] = CreateMenu ();
01161           AppendMenu (hMenu[nMenuLevel > 0 ? nMenuLevel - 1 : 0],
01162                       MF_STRING | MF_POPUP, (UINT) hMenu[nMenuLevel],
01163                       (LPCSTR) buf);
01164         }
01165       else if (!lstrcmpi (buf, "[EndMenu]"))
01166         {
01167           if (nMenuLevel > 0)
01168             nMenuLevel--;       /* back up one menu */
01169         }
01170       else if (!lstrcmpi (buf, "[Button]"))
01171         {
01172           /* button macro */
01173           if (lpmw->nButton >= BUTTONMAX)
01174             {
01175               BUGGOTOCLEAN (MSG_ERROR44);
01176             }
01177           if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01178             {
01179               nLine += nInc;
01180               BUGGOTOCLEAN (MSG_ERROR45);
01181             }
01182           LeftJustify (buf, buf);
01183           if ((macroptr = LocalAlloc (LPTR, lstrlen (buf) + 1)) != (BYTE *) NULL)
01184             {
01185               lstrcpy ((char *) macroptr, buf);
01186             }
01187           else
01188             {
01189               BUGGOTOCLEAN (MSG_ERROR46);
01190             }
01191           ButtonText[lpmw->nButton] = (char *) macroptr;
01192           if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01193             {
01194               nLine += nInc;
01195               BUGGOTOCLEAN (MSG_ERROR45);
01196             }
01197           LeftJustify (buf, buf);
01198           TranslateMacro (buf);
01199           if ((macroptr = LocalAlloc (LPTR, lstrlen (buf) + 1)) != (BYTE *) NULL)
01200             lstrcpy ((char *) macroptr, buf);
01201           else
01202             {
01203               BUGGOTOCLEAN (MSG_ERROR46);
01204             }
01205           nCountMenu = WGFindMenuPos (lpmw->macro);
01206           lpmw->nCountMenu++;
01207           lpmw->hButtonID[lpmw->nButton] = nCountMenu;
01208           lpmw->macro[nCountMenu] = macroptr;
01209           lpmw->nButton++;
01210         }
01211       else
01212         {
01213           nCountMenu = WGFindMenuPos (lpmw->macro);
01214           /* menu item */
01215           if (nCountMenu >= NUMMENU)
01216             {
01217               BUGGOTOCLEAN (MSG_ERROR44);
01218             }
01219           LeftJustify (buf, buf);
01220           if (buf[0] == '-')
01221             {
01222               if (nMenuLevel == 0)
01223                 AppendMenu (hMenu[0], MF_MENUBREAK, 0, (LPSTR) NULL);
01224               else
01225                 AppendMenu (hMenu[nMenuLevel], MF_SEPARATOR, 0, (LPSTR) NULL);
01226             }
01227           else if (buf[0] == '|')
01228             {
01229               AppendMenu (hMenu[nMenuLevel], MF_MENUBARBREAK, 0, (LPSTR) NULL);
01230             }
01231           else
01232             {
01233               AppendMenu (hMenu[nMenuLevel], MF_STRING, nCountMenu, (LPSTR) buf);
01234               if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01235                 {
01236                   nLine += nInc;
01237                   BUGGOTOCLEAN (MSG_ERROR45);
01238                 }
01239               LeftJustify (buf, buf);
01240               TranslateMacro (buf);
01241               if ((macroptr = LocalAlloc (LPTR, lstrlen (buf) + 1)) != (BYTE *) NULL)
01242                 {
01243                   lstrcpy ((char *) macroptr, buf);
01244                 }
01245               else
01246                 {
01247                   BUGGOTOCLEAN ("Out of space for storing menu macros\n at line %d of %s\n");
01248                 }
01249               lpmw->macro[nCountMenu] = macroptr;
01250               lpmw->nCountMenu++;
01251             }
01252         }
01253     }
01254   nCountMenu = WGFindMenuPos (lpmw->macro);
01255   if ((nCountMenu - lpmw->nButton) > 0)
01256     {
01257       /* we have a menu bar so put it on the window */
01258       SetMenu (lptw->hWndParent, lpmw->hMenu);
01259       DrawMenuBar (lptw->hWndParent);
01260     }
01261 
01262   if (!lpmw->nButton)  goto cleanup;            /* no buttons */
01263     
01264 
01265 
01266   /* calculate size of buttons */
01267   hdc = (HDC)TryToGetDC (lptw->hWndParent);
01268   
01269   SelectFont (hdc, GetStockFont (SYSTEM_FIXED_FONT));
01270   GetTextMetrics (hdc, &tm);
01271   ButtonX = 10 * tm.tmAveCharWidth;
01272   //ButtonY = 6 * (tm.tmHeight + tm.tmExternalLeading) / 4;
01273   ButtonY = 24;
01274   ReleaseDC (lptw->hWndParent, hdc);
01275 
01276   /* move top of client text window down to allow space for buttons */
01277   lptw->ButtonHeight = ButtonY + 1;
01278   GetClientRect (lptw->hWndParent, &rect);
01279   SetWindowPos (lptw->hWndText, (HWND) NULL, 0, lptw->ButtonHeight,
01280                 rect.right, rect.bottom - lptw->ButtonHeight,
01281                 SWP_NOZORDER | SWP_NOACTIVATE);
01282 
01283   /* create the buttons */
01284 
01285   lpmw->lpfnMenuButtonProc = (WNDPROC) MyGetProcAddress ("MenuButtonProc", MenuButtonProc);
01286   for (i = 0; i < lpmw->nButton; i++)
01287     {
01288         CreateButton(lptw,ButtonText, i,ButtonX, ButtonY);
01289     }
01290    
01291 
01292   goto cleanup;
01293 
01294 nomemory:
01295   MessageBox (lptw->hWndParent, MSG_ERROR40, lptw->Title, MB_ICONEXCLAMATION);
01296 
01297 errorcleanup:
01298   if (hmacro)
01299     {
01300       for (i = 0; i < NUMMENU; i++)
01301         {
01302           if (lpmw->macro[i] != (BYTE *) 0)
01303             {
01304               LocalFree (lpmw->macro[i]);
01305               lpmw->macro[i] = (BYTE *) 0;
01306             }
01307         }
01308       GlobalUnlock (hmacro);
01309       GlobalFree (hmacro);
01310       lpmw->macro = (BYTE **) NULL;
01311     }
01312   if (lpmw->szPrompt != (char *) NULL)
01313     {
01314       LocalFree (lpmw->szPrompt);
01315       lpmw->szPrompt = (char *) NULL;
01316     }
01317   if (lpmw->szAnswer != (char *) NULL)
01318     {
01319       LocalFree (lpmw->szAnswer);
01320       lpmw->szAnswer = (char *) NULL;
01321     }
01322 
01323 cleanup:
01324   if (buf != (char *) NULL)
01325     LocalFree (buf);
01326   if (menufile != (GFILE *) NULL)
01327     Gfclose (menufile);
01328   return;
01329 }

Here is the caller graph for this function:

void lower_case ( char *  s  ) 

Definition at line 126 of file misc.c.

References p.

00127 {
00128   register char *p = s;
00129   while (*p != '\0')
00130     {
00131       if (isupper ((int) *p))
00132         *p = tolower (*p);
00133       p++;
00134     }
00135 }

int C2F() mainsci ( int ,
char *  ,
int ,
integer   
)

void MenuFixCurrentWin ( int  ivalue  ) 

Definition at line 929 of file wmenu.c.

Referenced by Countm(), Countp(), setcurwin(), and xset_curwin().

00930 {
00931   static int firstentry = 0, top = -1;
00932   int i;
00933   if (firstentry == 0)
00934     {
00935       strcpy (gwin_name, "&Graphic Window 0");
00936       firstentry++;
00937     }
00938   if (lab_count != ivalue)
00939     {
00940       C2F (xscion) (&i);
00941       if (i == 1)
00942         {
00943           lab_count = ivalue;
00944           strcpy (gwin_name1, gwin_name);
00945           sprintf (gwin_name, "&Graphic Window %d", (int) ivalue);
00946           C2F (chmenu) (&top, gwin_name1, gwin_name);
00947         }
00948     }
00949 }

Here is the caller graph for this function:

void NewLine ( LPTW   ) 

Definition at line 359 of file wtext.c.

Referenced by TextPutCh(), TextPutStr(), and UpdateText().

00360 {
00361         lptw->CursorPos.x = 0;
00362         lptw->CursorPos.y++;
00363         if (lptw->CursorPos.y >= lptw->ScreenSize.y) {
00364             int i =  lptw->ScreenSize.x * (lptw->ScreenSize.y - 1);
00365                 _fmemmove(lptw->ScreenBuffer, lptw->ScreenBuffer+lptw->ScreenSize.x, i);
00366                 _fmemset(lptw->ScreenBuffer + i, ' ', lptw->ScreenSize.x);
00367                 _fmemmove(lptw->AttrBuffer, lptw->AttrBuffer+lptw->ScreenSize.x, i);
00368                 _fmemset(lptw->AttrBuffer + i, NOTEXT, lptw->ScreenSize.x);
00369                 lptw->CursorPos.y--;
00370                 ScrollWindow(lptw->hWndText,0,-lptw->CharSize.y,NULL,NULL);
00371                 lptw->MarkBegin.y--;
00372                 lptw->MarkEnd.y--;
00373                 LimitMark(lptw, &lptw->MarkBegin);
00374                 LimitMark(lptw, &lptw->MarkEnd);
00375                 UpdateWindow(lptw->hWndText);
00376         }
00377         if (lptw->CursorFlag) TextToCursor(lptw);
00378         
00379 }

Here is the caller graph for this function:

void os_error ( char *  str,
int  t_num 
)

int Pause ( LPSTR  mess  ) 

EXPORT BOOL CALLBACK PrintAbortProc ( HDC  hdcPrn,
int  code 
)

Definition at line 107 of file wprinter.c.

References tagPRINT::bUserAbort, tagPRINT::hDlgPrint, and PrintFind().

Referenced by CopyPrint().

00108 {
00109   MSG msg;
00110   LP_PRINT lpr;
00111   lpr = PrintFind (hdcPrn);
00112   while (!lpr->bUserAbort && PeekMessage (&msg, 0, 0, 0, PM_REMOVE))
00113     {
00114       if (!lpr->hDlgPrint || !IsDialogMessage (lpr->hDlgPrint, &msg))
00115         {
00116           TranslateMessage (&msg);
00117           DispatchMessage (&msg);
00118         }
00119     }
00120   return (!lpr->bUserAbort);
00121 }

Here is the call graph for this function:

Here is the caller graph for this function:

EXPORT BOOL CALLBACK PrintDlgProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 84 of file wprinter.c.

References tagPRINT::bUserAbort, FALSE, tagPRINT::hDlgPrint, and TRUE.

Referenced by CopyPrint().

00085 {
00086   LP_PRINT lpr;
00087   HWND parent;
00088   parent = GetParent (hDlg);
00089   lpr = (LP_PRINT) GetWindowLong (parent, 4);
00090   switch (message)
00091     {
00092     case WM_INITDIALOG:
00093       lpr->hDlgPrint = hDlg;
00094       SetWindowText (hDlg, (LPSTR) lParam);
00095       EnableMenuItem (GetSystemMenu (hDlg, FALSE), SC_CLOSE, MF_GRAYED);
00096       return TRUE;
00097     case WM_COMMAND:
00098       lpr->bUserAbort = TRUE;
00099       lpr->hDlgPrint = 0;
00100       EnableWindow (GetParent (hDlg), TRUE);
00101       EndDialog (hDlg, FALSE);
00102       return TRUE;
00103     }
00104   return FALSE;
00105 }

Here is the caller graph for this function:

void PrintRegister ( LP_PRINT  lpr  ) 

Definition at line 42 of file wprinter.c.

References tagPRINT::next, and prlist.

Referenced by CopyPrint().

00043 {
00044   LP_PRINT next;
00045   next = prlist;
00046   prlist = lpr;
00047   lpr->next = next;
00048 }

Here is the caller graph for this function:

BOOL PrintSize ( HDC  printer,
HWND  hwnd,
LPRECT  lprect 
)

void PrintUnregister ( LP_PRINT  lpr  ) 

Definition at line 61 of file wprinter.c.

References tagPRINT::next, NULL, and prlist.

Referenced by CopyPrint().

00062 {
00063   LP_PRINT this, prev;
00064   prev = (LP_PRINT) NULL;
00065   this = prlist;
00066   while (this && (this != lpr))
00067     {
00068       prev = this;
00069       this = this->next;
00070     }
00071   if (this && (this == lpr))
00072     {
00073       /* unhook it */
00074       if (prev)
00075         prev->next = this->next;
00076       else
00077         prlist = this->next;
00078     }
00079 }

Here is the caller graph for this function:

int PushClickQueue ( int  win,
int  x,
int  y,
int  ibut,
int  motion,
int  release 
)

Definition at line 126 of file Events.c.

00127 {
00128   /* first let a click_handler do the job  */
00129   if ( ( wait_for_click == 0 ) && ( scig_click_handler(win,x,y,ibut,motion,release) == 1 ) ) return 0;
00130   if (  event_select==0 &&(motion == 1 || release == 1) ) return 0;
00131                 
00132   if (((event_select&2)&&motion)||((event_select&4)&&release)||(motion==0&&release==0))
00133         {
00134                 /* store click event in a queue */
00135           if ( lastc == MaxCB ) 
00136     {
00137       int i;
00138       for ( i= 1 ; i < MaxCB ; i ++ ) 
00139                         {
00140                                 ClickBuf[i-1]=ClickBuf[i];
00141                         }
00142       ClickBuf[lastc-1].win = win;
00143       ClickBuf[lastc-1].x = x;
00144       ClickBuf[lastc-1].y = y;
00145       ClickBuf[lastc-1].ibutton = ibut;
00146       ClickBuf[lastc-1].motion = motion;
00147       ClickBuf[lastc-1].release = release;
00148     }
00149                 else 
00150     {
00151       ClickBuf[lastc].win = win;
00152       ClickBuf[lastc].x = x;
00153       ClickBuf[lastc].y = y;
00154       ClickBuf[lastc].ibutton = ibut;
00155       ClickBuf[lastc].motion = motion;
00156       ClickBuf[lastc].release = release;
00157       lastc++;
00158     }
00159   }
00160   return(0);
00161 }

int read_line ( char *  prompt,
int  interrupt 
)

Definition at line 118 of file command.c.

References i, ilen, inline_num, input_line, int_error(), last, MAX_LINE_LEN, MSG_ERROR68, NO_CARET, NULL, p, rlgets_def, sciprint(), strchr(), and void().

Referenced by zzledt().

00119 {
00120   
00121   int start = 0, ilen = 0;
00122   int last;
00123   char *p;
00124   ilen = MAX_LINE_LEN - start - 1;
00125   input_line[start] = ilen > 126 ? 126 : ilen;
00126   input_line[start + 2] = 0;
00127   
00128   (void) (*rlgets_def) (&(input_line[start+2]), ilen, prompt, interrupt);
00129 
00130   if (input_line[start + 2] == -2) /* dynamic menu canceled read SS */
00131   {
00132       return (-1);
00133     }
00134   if ((p = strchr (&(input_line[start + 2]), '\r')) != NULL)
00135     *p = 0;
00136   if ((p = strchr (&(input_line[start + 2]), '\n')) != NULL)
00137     *p = 0;
00138   input_line[start + 1] = strlen (&(input_line[start + 2]));
00139 
00140   if (input_line[start + 2] == 26 || input_line[start + 2] == -1)
00141     {
00142       /* XXX 26 XXXX */
00143       /* end-of-file or end reached in pipe */
00144     input_line[start] = '\0';
00145       inline_num++;
00146    if (start <= 0)              /* don't quit yet - process what we have */
00147         {
00148           sciprint ("\n");
00149           return (1);           /* exit scilab */
00150         }
00151     }
00152   else
00153     {
00154       /* normal line input */
00155     register int i = start;
00156       while ((input_line[i] = input_line[i + 2]) != (char) NULL)
00157         i++;                    /* yuck!  move everything down two characters */
00158 
00159   inline_num++;
00160       last = strlen (input_line) - 1;
00161       if (last < 0)
00162         last = 0;               /* stop UAE in Windows */
00163       if (last + 1 >= MAX_LINE_LEN)
00164         int_error (MSG_ERROR68, NO_CARET);
00165     }
00166     
00167   return (0);
00168   
00169 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* readline_nw ( char *  prompt,
int  interrupt 
)

Referenced by rlgets_nw().

Here is the caller graph for this function:

char* readline_win ( char *  prompt,
int  interrupt 
)

Definition at line 472 of file readline.c.

References alloc(), backspace(), C2F, clear_eoline(), clear_line(), copy_line(), cur_entry, fix_line(), history, ismenu(), sci_hist::line, max_pos, MAXBUF, MyFPutC(), MyFPutS(), sci_hist::next, P, sci_hist::prev, redraw_line(), SearchBackwardInHistory(), sendprompt, SPACE, user_putc(), and Windows_getch().

Referenced by rlgets().

00473 {
00474   unsigned char cur_char;
00475   char *new_line;  /* unsigned char *new_line; */
00476   
00477   /* print the prompt */
00478   if (sendprompt) MyFPutS (prompt, stdout);
00479   sendprompt=1;
00480 
00481   cur_line[0] = '\0';
00482   cur_pos = 0;
00483   max_pos = 0;
00484   cur_entry = NULL;
00485   
00486   /* get characters */
00487   for (;;)
00488     {
00489          /* Moved below (Francois VOGEL, bug 1052) */
00490          if (interrupt && (C2F(ismenu) () == 1))
00491         {/* abort current line aquisition SS */
00492                 sendprompt=0;
00493                 new_line = (char *) alloc ((unsigned long) 2, "history");
00494                 new_line[0] = -2;
00495                 new_line[1] = '\0';
00496 
00497                 return (new_line);
00498         }
00499 
00500      cur_char = Windows_getch();
00501 
00502          if (interrupt && (C2F(ismenu) () == 1))
00503         {/* abort current line aquisition SS */
00504                 sendprompt=0;
00505                 new_line = (char *) alloc ((unsigned long) 2, "history");
00506                 new_line[0] = -2;
00507                 new_line[1] = '\0';
00508 
00509                 return (new_line);
00510         }
00511         
00512         if ((isprint (cur_char)  || ((unsigned char) cur_char > 0x7f)  ) && max_pos < MAXBUF - 1)
00513         {
00514           int i;
00515  
00516           for (i = max_pos; i > cur_pos; i--)
00517             {
00518               cur_line[i] = cur_line[i - 1];
00519             }
00520           user_putc (cur_char);
00521           cur_line[cur_pos] = cur_char;
00522           cur_pos += 1;
00523           max_pos += 1;
00524           if (cur_pos < max_pos)    fix_line ();
00525           
00526           cur_line[max_pos] = '\0';
00527           
00528         }
00529       else
00530         {
00531           /* do normal editing commands */
00532           /* some of these are also done above */
00533           int i;
00534         
00535           switch (cur_char)
00536             {
00537             case 255:           /* jpc eof quand on fait un pipe */
00538               new_line = (char *) alloc ((unsigned long) 2, "history");
00539               new_line[0] = -1;
00540               new_line[1] = '\0';
00541       
00542               return (new_line);
00543             case EOF:
00544               return ((char *) NULL);
00545             case 001:           /* ^A */
00546               while (cur_pos > 0)
00547                 {
00548                   cur_pos -= 1;
00549                   backspace ();
00550                 }
00551               break;
00552             case 002:           /* ^B */
00553               if (cur_pos > 0)
00554                 {
00555                   cur_pos -= 1;
00556                   backspace ();
00557                 }
00558               break;
00559     
00560             case 005:           /* ^E */
00561               while (cur_pos < max_pos)
00562                 {
00563                   user_putc (cur_line[cur_pos]);
00564                   cur_pos += 1;
00565                 }
00566               break;
00567             case 006:           /* ^F */
00568               if (cur_pos < max_pos)
00569                 {
00570                   user_putc (cur_line[cur_pos]);
00571                   cur_pos += 1;
00572                 }
00573               break;
00574             case 013:           /* ^K */
00575               clear_eoline ();
00576               max_pos = cur_pos;
00577               break;
00578              case 020:          /* ^P */
00579               if (history != NULL)
00580                 {
00581                   if (cur_entry == NULL)
00582                     {
00583                       cur_entry = history;
00584                       clear_line (prompt);
00585                       copy_line (cur_entry->line);
00586                     }
00587                   else if (cur_entry->prev != NULL)
00588                     {
00589                       cur_entry = cur_entry->prev;
00590                       clear_line (prompt);
00591                       copy_line (cur_entry->line);
00592                     }
00593                 }
00594               break;
00595             case 016:           /* ^N */
00596               if (cur_entry != NULL)
00597                 {
00598                   cur_entry = cur_entry->next;
00599                   clear_line (prompt);
00600                   if (cur_entry != NULL)
00601                     copy_line (cur_entry->line);
00602                   else
00603                     cur_pos = max_pos = 0;
00604                 }
00605               break;
00606             case 014:           /* ^L */
00607             case 022:           /* ^R */
00608               MyFPutC ('\n', stdout);   /* go to a fresh line */
00609               MyFPutC ('\n', stdout);
00610               redraw_line (prompt);
00611               break;
00612             case 0177:          /* DEL */
00613             case 010:           /* ^H */
00614               if (cur_pos > 0)
00615                 {
00616                   cur_pos -= 1;
00617                   backspace ();
00618                   for (i = cur_pos; i < max_pos; i++)
00619                     cur_line[i] = cur_line[i + 1];
00620                   max_pos -= 1;
00621                   fix_line ();
00622                 }
00623               break;
00624             case 004:           /* ^D */
00625               if (max_pos == 0)
00626                 {
00627                   clear_line (prompt);
00628                   break;
00629                 }
00630               if (cur_pos < max_pos)
00631                 {
00632                   for (i = cur_pos; i < max_pos; i++)
00633                     cur_line[i] = cur_line[i + 1];
00634                   max_pos -= 1;
00635                   fix_line ();
00636                 }
00637               break;
00638             case 025:           /* ^U */
00639               clear_line (prompt);
00640               break;
00641             case 027:           /* ^W */
00642               while ((cur_pos > 0) &&
00643                      (cur_line[cur_pos - 1] == SPACE))
00644                 {
00645                   cur_pos -= 1;
00646                   backspace ();
00647                 }
00648               while ((cur_pos > 0) &&
00649                      (cur_line[cur_pos - 1] != SPACE))
00650                 {
00651                   cur_pos -= 1;
00652                   backspace ();
00653                 }
00654               clear_eoline ();
00655               max_pos = cur_pos;
00656               break;
00657             case '\n':          /* ^J */
00658             case '\r':          /* ^M */
00659                         cur_line[max_pos + 1] = '\0';
00660                 if (cur_line[0]=='!')
00661                         { 
00662                                 struct sci_hist *P=NULL;
00663                                 P=SearchBackwardInHistory(&cur_line[1]);
00664                                 clear_line (prompt);
00665                                 if (P != NULL) copy_line (P->line);
00666                         }
00667                     else
00668                         {
00669                                 MyFPutC ('\n', stdout);
00670                                 new_line = (char *) alloc ((unsigned long) (strlen (cur_line) + 1), "history");
00671                                 strcpy (new_line, cur_line);
00672                                 return (new_line);
00673                         }
00674                 break;
00675 
00676             default:
00677  
00678               break;
00679             }
00680         }
00681     }
00682       
00683 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ReadRegistryGraph ( struct BCG ScilabGC  ) 

Definition at line 315 of file registry.c.

References FALSE, MAX_PATH, NULL, result, SCI_VERSION_STRING, SetDefaultShowToolBar(), size, and TRUE.

Referenced by initgraphic().

00316 {
00317         /* Modification Restauration depuis la base de registre dans 
00318                         HKEY_CURRENT_USER\\SOFTWARE\\Scilab\\"VERSION"\\Graph Settings
00319         "Version" correspondant à la version de Scilab
00320         */
00321         HKEY key;
00322         DWORD result,size=4;
00323         long GraphSizeX,GraphSizeY;
00324         char Clef[MAX_PATH];
00325         int Toolbar;
00326         
00327         RECT rect;
00328 
00329         wsprintf(Clef,"SOFTWARE\\Scilab\\%s\\Graph Settings",SCI_VERSION_STRING);
00330         result=RegOpenKeyEx(HKEY_CURRENT_USER, Clef, 0, KEY_QUERY_VALUE , &key);
00331 
00332         if ( RegQueryValueEx(key, "GraphOriginX", 0, NULL, (LPBYTE)&rect.left, &size) !=  ERROR_SUCCESS )
00333         {
00334                 ScilabGC->lpgw->Origin.x = CW_USEDEFAULT;
00335         }
00336         else
00337         {
00338                 ScilabGC->lpgw->Origin.x = rect.left;
00339         }
00340 
00341         if ( RegQueryValueEx(key, "GraphOriginY", 0, NULL, (LPBYTE)&rect.top, &size) !=  ERROR_SUCCESS )
00342         {
00343                 ScilabGC->lpgw->Origin.y = CW_USEDEFAULT;
00344         }
00345         else
00346         {
00347                 ScilabGC->lpgw->Origin.y = rect.top;
00348         }
00349 
00350         if ( RegQueryValueEx(key, "GraphSizeX", 0, NULL, (LPBYTE)&GraphSizeX, &size) !=  ERROR_SUCCESS )
00351         {
00352                 ScilabGC->lpgw->Size.x = CW_USEDEFAULT;
00353         }
00354         else
00355         {
00356         ScilabGC->lpgw->Size.x = GraphSizeX;
00357         }
00358 
00359         if ( RegQueryValueEx(key, "GraphSizeY", 0, NULL, (LPBYTE)&GraphSizeY, &size) !=  ERROR_SUCCESS )
00360         {
00361                 ScilabGC->lpgw->Size.y = CW_USEDEFAULT;
00362         }
00363         else
00364         {
00365                 ScilabGC->lpgw->Size.y = GraphSizeY;
00366         }
00367 
00368         if ( RegQueryValueEx(key, "ToolBar", 0, NULL, (LPBYTE)&Toolbar, &size) !=  ERROR_SUCCESS )
00369         {
00370                 ScilabGC->lpmw.ShowToolBar = TRUE;
00371         }
00372         else
00373         {
00374                 ScilabGC->lpmw.ShowToolBar  = Toolbar;
00375         }
00376 
00377     SetDefaultShowToolBar(ScilabGC->lpmw.ShowToolBar);
00378         ScilabGC->lpmw.LockToolBar=FALSE;
00379 
00380         if ( result == ERROR_SUCCESS ) RegCloseKey(key);
00381 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ReadRegistryTxt ( LPTW  lptw  ) 

Definition at line 22 of file registry.c.

00023 {
00024         /* Modification Restauration depuis la base de registre dans 
00025                         HKEY_CURRENT_USER\\SOFTWARE\\Scilab\\"VERSION"\\Settings
00026         "Version" correspondant à la version de Scilab
00027         */
00028         HKEY key;
00029         DWORD result,Length,size=4;
00030         char Clef[MAX_PATH];
00031         int Iconic,iconic;
00032         int SizeX;
00033         int SizeY;
00034         int SysColors;
00035         DWORD TextColor;
00036     DWORD BackgroundColor;
00037         int Toolbar;
00038 //      int Language;
00039         char TextFontName[MAX_PATH];
00040         int TextFontSize;
00041         RECT rect;
00042         
00043         Length=MAX_PATH;
00044         
00045         wsprintf(Clef,"SOFTWARE\\Scilab\\%s\\Settings",SCI_VERSION_STRING);
00046         result=RegOpenKeyEx(HKEY_CURRENT_USER, Clef, 0, KEY_QUERY_VALUE , &key);
00047 
00048         if ( RegQueryValueEx(key, "TextOriginX", 0, NULL, (LPBYTE)&rect.left, &size) !=  ERROR_SUCCESS )
00049         {
00050                 lptw->Origin.x = CW_USEDEFAULT;
00051         }
00052         else
00053         {
00054                 lptw->Origin.x = rect.left;
00055         }
00056         
00057         if ( RegQueryValueEx(key, "TextOriginY", 0, NULL, (LPBYTE)&rect.top, &size) !=  ERROR_SUCCESS )
00058         {
00059                 lptw->Origin.y = CW_USEDEFAULT;
00060         }
00061         else
00062         {
00063                 lptw->Origin.y = rect.top;
00064         }
00065         
00066         if ( RegQueryValueEx(key, "TextSizeX", 0, NULL, (LPBYTE)&SizeX, &size) !=  ERROR_SUCCESS )
00067         {
00068                 lptw->Size.x = CW_USEDEFAULT;
00069         }
00070         else
00071         {
00072                 lptw->Size.x = SizeX;
00073         }
00074         
00075         if ( RegQueryValueEx(key, "TextSizeY", 0, NULL, (LPBYTE)&SizeY, &size) !=  ERROR_SUCCESS )
00076         {
00077                 lptw->Size.y = CW_USEDEFAULT;
00078         }
00079         else
00080         {
00081                 lptw->Size.y = SizeY;
00082         }
00083         
00084         if ( RegQueryValueEx(key, "TextMinimized", 0, NULL, (LPBYTE)&Iconic, &size) !=  ERROR_SUCCESS )
00085         {
00086                         iconic = 0;
00087         }
00088         else
00089         {
00090                         iconic = Iconic;
00091         }
00092         
00093         if ( RegQueryValueEx(key, "TextFontName", 0, NULL,(LPBYTE)TextFontName,&Length) !=  ERROR_SUCCESS )
00094         {
00095                 strcpy (lptw->fontname, TEXTFONTNAME);
00096         }
00097         else
00098         {
00099                 strcpy (lptw->fontname, TextFontName);
00100         }
00101         
00102         if ( RegQueryValueEx(key, "TextFontSize", 0, NULL, (LPBYTE)&TextFontSize, &size) !=  ERROR_SUCCESS )
00103         {
00104                 lptw->fontsize = TEXTFONTSIZE;
00105         }
00106         else
00107         {
00108                 lptw->fontsize = TextFontSize;
00109         }
00110         
00111         if ( RegQueryValueEx(key, "SysColors", 0, NULL, (LPBYTE)&SysColors, &size) !=  ERROR_SUCCESS )
00112         {
00113                 lptw->bSysColors = 1;
00114         }
00115         else
00116         {
00117                 lptw->bSysColors = SysColors;
00118         }
00119         
00120         if (lptw->bSysColors == 0)
00121         {
00122                 if ( RegQueryValueEx(key, "TextColor", 0, NULL, (LPBYTE)&TextColor, &size) !=  ERROR_SUCCESS )
00123                 {
00124                         int R,G,B;
00125                         R=GetRValue(GetSysColor (COLOR_WINDOW));
00126                         G=GetGValue(GetSysColor (COLOR_WINDOW));
00127                         B=GetBValue(GetSysColor (COLOR_WINDOW));
00128                         
00129                         SetIhmTextColor(R,G,B,FALSE);
00130                 }
00131                 else
00132                 {
00133                         int R,G,B;
00134                         R=GetRValue(TextColor);
00135                         G=GetGValue(TextColor);
00136                         B=GetBValue(TextColor);
00137 
00138                         SetIhmTextColor(R,G,B,FALSE);
00139                 }
00140 
00141                 if ( RegQueryValueEx(key, "BackgroundColor", 0, NULL, (LPBYTE)&BackgroundColor, &size) !=  ERROR_SUCCESS )
00142                 {
00143                         int R,G,B;
00144                         R=GetRValue(GetSysColor (COLOR_WINDOW));
00145                         G=GetGValue(GetSysColor (COLOR_WINDOW));
00146                         B=GetBValue(GetSysColor (COLOR_WINDOW));
00147 
00148                         SetIhmTextBackgroundColor(R,G,B,FALSE);
00149                 }
00150                 else
00151                 {
00152                         int R,G,B;
00153                         R=GetRValue(BackgroundColor);
00154                         G=GetGValue(BackgroundColor);
00155                         B=GetBValue(BackgroundColor);
00156 
00157                         SetIhmTextBackgroundColor(R,G,B,FALSE);
00158                 }
00159         }
00160         
00161         if ( RegQueryValueEx(key, "ToolBar", 0, NULL, (LPBYTE)&Toolbar, &size) !=  ERROR_SUCCESS )
00162         {
00163                 lptw->lpmw->ShowToolBar = TRUE;
00164         }
00165         else
00166         {
00167                 lptw->lpmw->ShowToolBar = Toolbar;
00168         }
00169 
00170         //if ( RegQueryValueEx(key, "Language", 0, NULL, (LPBYTE)&Language, &size) !=  ERROR_SUCCESS )
00171  //     {
00172         //      int CodeLanguageInScilabDotStar=GetLanguageCodeInScilabDotStar();
00173 
00174         //      if (CodeLanguageInScilabDotStar != -1)
00175         //      {
00176         //              lptw->lpmw->CodeLanguage = CodeLanguageInScilabDotStar;
00177         //      }
00178         //      else lptw->lpmw->CodeLanguage = 0; /* English Default*/
00179         //}
00180         //else
00181         //{
00182         //      int CodeLanguageInScilabDotStar=GetLanguageCodeInScilabDotStar();
00183 
00184         //      if (Language != CodeLanguageInScilabDotStar)
00185         //      {
00186         //              lptw->lpmw->CodeLanguage = CodeLanguageInScilabDotStar; 
00187         //      }
00188         //      else
00189         //      if  ( (Language == 0) || (Language == 1) )      lptw->lpmw->CodeLanguage = Language;
00190         //      else lptw->lpmw->CodeLanguage = 0; /* English Default*/
00191         //}
00192                 
00193         lptw->lpmw->LockToolBar=FALSE;
00194 
00195         if ( result == ERROR_SUCCESS ) RegCloseKey(key);
00196 
00197         if (iconic) lptw->nCmdShow = SW_SHOWMINIMIZED;
00198 
00199 }

void sci_windows_main ( int  ,
int ,
char *  ,
int  ,
int ,
int   
)

Definition at line 89 of file wtloop.c.

References env, interrupt_setup(), NULL, and realmain().

Referenced by Console_Main(), and Windows_Main().

00090 {
00091   setbuf (stderr, (char *) NULL);
00092   if (!setjmp (env))
00093     {
00094       /* first time */
00095       interrupt_setup ();
00096     }
00097   else
00098     {
00099       /* come back here from int_error() */
00100       if (nowin != 1)
00101         SetCursor (LoadCursor ((HINSTANCE) NULL, IDC_ARROW));
00102     }
00103   /* take commands from stdin */
00104   realmain(nowin,*nos,path,pathtype,memory);
00105 
00106 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ScilabMenuAction ( char *  buf  ) 

Definition at line 197 of file wgmenu.c.

Referenced by SendGraphMacro(), and SendMacro().

00198 {
00199         if (strlen (buf) > 2 && buf[0] == '@')
00200         {
00202             if (buf[1] == '0')
00203                 {
00204                   /* Interpreted mode : we store the action on a queue */
00205                   StoreCommand1 (buf + 2, 0);
00206                 }
00207             else
00208                 {
00209                         /* hard coded mode */
00210                         int rep, win, entry;
00211                         char *tmp=NULL;
00212                         char *LocalBuf=(char*)MALLOC((strlen(buf)+1)*sizeof(char));
00213                         char *FunctionName=(char*)MALLOC((strlen(buf)+1)*sizeof(char));
00214                         wsprintf(LocalBuf,"%s",buf+strlen("@1")+strlen("execstr("));
00215                         /*remove last char ')' */
00216                         LocalBuf[strlen(LocalBuf)-1]='\0';
00217 
00218                         if ( ( tmp = strchr (LocalBuf, '_') ) != NULL )
00219                         {
00220                                 sscanf (tmp + 1, "%d(%d)", &win, &entry);
00221                                 entry--;
00222                                 strncpy(FunctionName,LocalBuf,strlen(LocalBuf)-strlen(tmp));
00223                                 *tmp = '\0';
00224                         }
00225                         else
00226                         {
00227                                 win = -1;
00228                                 if ((tmp = strchr (LocalBuf, '(')) != NULL)
00229                                 {
00230                                         char *tmpbis=NULL;
00231                                         sscanf (tmp, "(%d)", &entry);
00232                                         
00233                                         if ( ( tmpbis = strchr (LocalBuf, '(') ) != NULL )
00234                                         {
00235                                                 strncpy(FunctionName,LocalBuf,strlen(LocalBuf)-strlen(tmpbis));
00236                                         }
00237 
00238                                         entry--;
00239                                         *tmp = '\0';
00240                                 }
00241                         }
00242 
00243                         C2F (setfbutn) (FunctionName, &rep);
00244                         if (rep == 0)
00245                         {
00246                                 F2C (fbutn) (FunctionName, &(win), &(entry));
00247                         }
00248 
00249                         if (FunctionName) {FREE(FunctionName);FunctionName=NULL;}
00250                         if (LocalBuf) {FREE(LocalBuf);LocalBuf=NULL;}
00251                 }
00252         }
00253         else 
00254         {
00255                 if (buf[0] != '\0')
00256                 {
00258                         if (strlen (buf) == 1 && buf[0] <= 31 && buf[0] >= 1) 
00259                         {
00260                                 StoreCommand1 (buf, 0);
00261                         }
00262                         else
00263                         {
00264                                 StoreCommand1 (buf, 1);
00265                         }
00266                 }
00267         }
00268 }

Here is the caller graph for this function:

int ScilabPsToEps ( char  orientation,
char *  filenamein,
char *  filenameout 
)

Definition at line 131 of file SEpsf.c.

References ConvertName(), env, get_dims(), getenv(), h, Min, NULL, rep, sciprint(), Sed(), and w.

Referenced by main(), PrintPs(), and SavePs().

00132 {
00133   /* A4 paper in mm */
00134   double ccm = 28.346457;
00135   double wp = ccm*210;
00136   double hp = ccm*297;
00137   double ws,hs,sc,marg= ccm*5; /* margin 5mm */
00138 
00139   int flag = 0,rep, w=0,h=0;
00140   FILE *fo;
00141   char *env;
00142   env = getenv("SCI");
00143   if (env == NULL) 
00144     {
00145       sciprint("Environment variable SCI must be defined\r\n");
00146       return(1);
00147     }
00148   sprintf(entete,"%s/tools/printer/NperiPos.ps",env);
00149 
00150   ConvertName(filein,fileout);
00151   if ( strcmp(fileout,filein) == 0 ) 
00152     {
00153       flag = 1;
00154       strcat(fileout,".temp");
00155     }
00156   
00157   if ( (fo = fopen(fileout,"w"))== 0 ) 
00158     {
00159       sciprint(" Can't open file %s\r\n",fileout);
00160       exit(1);
00161     }
00162   /* see if the postscript file was generated with non standard sizes */
00163 
00164   get_dims(filein,&w,&h);
00165 
00166   if ( w == 0 || h == 0 ) 
00167     {
00168       w= 6000; h = 4240; /* default dimensions */
00169     }
00170     
00171   /* The Postscript dimension will (w,h) proportions */
00172   fprintf(fo,"%%!PS-Adobe-2.0 EPSF-2.0\n");
00173   if ( orientation == 'p' ) 
00174     {
00175       ws = (wp-2*marg)/((double) w);
00176       hs = (hp-2*marg)/((double) h);
00177       sc = Min(ws,hs);
00178       ws = w*sc;
00179       hs = h*sc; 
00180       fprintf(fo,"%%%%BoundingBox: %d %d %d %d \n", 
00181               (int) ((wp - ws)/(2*10.0)),
00182               (int) ((hp - hs)/(2*10.0)),
00183               (int) (ws/10.0 + (wp - ws)/(2*10.0)),
00184               (int) (hs/10.0 + (hp - hs)/(2*10.0))
00185               );
00186     }
00187   else 
00188     {
00189       ws = (hp-2*marg)/((double) w);
00190       hs = (wp-2*marg)/((double) h);
00191       sc = Min(ws,hs);
00192       ws = w*sc;
00193       hs = h*sc; 
00194       fprintf(fo,"%%%%BoundingBox: %d %d %d %d \n", 
00195               (int) ((wp - hs)/(2*10.0)),
00196               (int) ((hp - ws)/(2*10.0)),
00197               (int) (hs/10.0 + (wp - hs)/(2*10.0)) ,
00198               (int) (ws/10.0 + (hp - ws)/(2*10.0))
00199               );
00200       
00201     }
00202   
00203   Sed(0,entete,fo,"%!PS-ADOBE","%%",(char*) 0,(char *)0,(char*) 0,(char *)0);
00204   
00205   if ( orientation == 'p' )
00206     {
00207       char cc[512];
00208       sprintf(cc,"[%f 20 div 0 0 %f 20 div neg %d 10 div %d 10 div] concat",
00209               sc,sc,(int) ((wp - ws)/(2)), (int) ((hp - hs)/(2) + hs));
00210       rep=Sed(1,filein,fo,"[0.5 10 div 0 0 0.5 10 div neg",
00211               cc,
00212               (char*) 0,(char *)0,(char*) 0,(char *)0);
00213     }
00214   else 
00215     {
00216       char cc[512];
00217       sprintf(cc,"90 rotate 0 neg %d neg 10 div translate\n[%f 20 div 0 0 %f 20 div neg %d 10 div %d 10 div] concat",
00218               h + (int) ((wp - hs)/(2.0)) ,  sc,sc,(int) ((hp - ws)/2), h ); 
00219       rep=Sed(1,filein,fo,"[0.5 10 div 0 0 0.5 10 div neg",
00220               cc,
00221               (char*) 0,(char *)0,(char*) 0,(char *)0);
00222     }
00223 
00224   fclose(fo);
00225 
00226   if ( rep >= 1 ) 
00227     {
00228       if ( rep == 1) 
00229         sciprint("input file doesn't need to be changed to epsf \r\n");
00230       remove(fileout);
00231       exit(0);
00232     }
00233   
00234   if ( flag == 1) 
00235     {
00237       fo = fopen(filein,"w");
00238       Sed(0,fileout,fo,(char*) 0,(char *)0,(char*) 0,(char *)0,(char*) 0,(char *)0);
00239       fclose(fo);
00240     }
00241   else
00242     {
00243       remove(filein);
00244     }
00245   return(0);
00246 }

Here is the call graph for this function:

Here is the caller graph for this function:

int ScilabPsToTeX ( char  orientation,
char *  filenamein,
char *  filenameout,
double  xs,
double  ys 
)

Definition at line 28 of file wmtex.c.

References env, FileNameChange(), getenv(), NULL, rep, sciprint(), and Sed().

Referenced by main(), and SavePs().

00029 {
00030   double wide, high, widecm, highcm, hscale, vscale;
00031   int flag = 0, rep;
00032   FILE *fo;
00033   char *env;
00034   env = getSCIpath();
00035   if (env == NULL)
00036     {
00037       sciprint (MSG_ERROR49);
00038       return (1);
00039     }
00040 
00044   sprintf (entete, "%s/tools/printer/NperiPos.ps", env);
00045 
00046   FileNameChange (filein, fileout, base, "eps");
00047   if (strcmp (fileout, filein) == 0)
00048     {
00049       flag = 1;
00050       strcat (fileout, ".temp");
00051     }
00052 
00053   if ((fo = fopen (fileout, "w")) == 0)
00054     {
00055       sciprint (MSG_ERROR50, fileout);
00056       return 1;
00057     }
00058 
00059   fprintf (fo, "%%!PS-Adobe-2.0 EPSF-2.0\n");
00060   if (orientation == 'p')
00061     fprintf (fo, "%%%%BoundingBox:  0 0 300 212\n");
00062   else
00063     fprintf (fo, "%%%%BoundingBox:  0 0 212 300\n");
00064 
00065   Sed (0, entete, fo, "%!PS-ADOBE", "%%", (char *) 0, (char *) 0, (char *) 0, (char *) 0);
00066 
00067   if (orientation == 'p')
00068     rep = Sed (1, filein, fo, (char *) 0, (char *) 0, (char *) 0, (char *) 0,
00069                (char *) 0, (char *) 0);
00070   else
00071     rep = Sed (1, filein, fo, "[0.5 10 div 0 0 0.5 10 div neg  0 2120 10 div] concat",
00072                "90 rotate 0 600 neg translate [0.5 10 div 0 0 0.5 10 div neg  0 3000 5 div] concat",
00073                (char *) 0, (char *) 0, (char *) 0, (char *) 0);
00074   fclose (fo);
00075 
00076   if (rep >= 1)
00077     {
00078       if (rep == 1)
00079         sciprint (MSG_ERROR51);
00080       remove (fileout);
00081       return 0;
00082     }
00083 
00084   if (flag == 1)
00085     {
00087       fo = fopen (filein, "w");
00088       Sed (0, fileout, fo, (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0);
00089       fclose (fo);
00090     }
00091   else
00092     {
00093       remove (filein);
00094     }
00095 
00098   if (orientation == 'p')
00099     {
00100       wide = 300 * xs;
00101       high = 212 * ys;
00102     }
00103   else
00104     {
00105       wide = 212 * xs;
00106       high = 300 * ys;
00107     }
00108   widecm = wide * 2.835;
00109   highcm = high * 2.835;
00110   hscale = xs * 100;
00111   vscale = ys * 100;
00112 
00113   FileNameChange (filein, fileout, base, "tex");
00114   if ((fo = fopen (fileout, "w")) == 0)
00115     {
00116       sciprint (MSG_ERROR51, fileout);
00117       return 1;
00118     }
00119 #ifndef DOC
00120 
00121   fprintf (fo, "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");
00122   fprintf (fo, MSG_SCIMSG46);
00123   fprintf (fo, MSG_SCIMSG47);
00124   fprintf (fo, MSG_SCIMSG48);
00125   fprintf (fo, MSG_SCIMSG49);
00126   fprintf (fo, MSG_SCIMSG50);
00127   fprintf (fo, MSG_SCIMSG51);
00128   fprintf (fo, "%%          \n");
00129   fprintf (fo, "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");
00130 
00131   fprintf (fo, " \n");
00132 
00133 
00134   fprintf (fo, " \\long\\def\\Checksifdef#1#2#3{%%\n");
00135   fprintf (fo, "\\expandafter\\ifx\\csname #1\\endcsname\\relax#2\\else#3\\fi}\n");
00136   fprintf (fo, "\\Checksifdef{Figdir}{\\gdef\\Figdir{}}{}\n");
00137   fprintf (fo, "\\def\\dessin#1#2{\n");
00138 #endif
00139   fprintf (fo, "\\begin{figure}[hbtp]\n");
00140   fprintf (fo, "\\begin{center}\n");
00141   fprintf (fo, MSG_SCIMSG52);
00142   fprintf (fo, "%%\\setlength{\\unitlength}{1mm}\n");
00143   fprintf (fo, "%%\\fbox{\\begin{picture}(%.2f,%.2f)\n", widecm, highcm);
00144   fprintf (fo, "\\fbox{\\begin{picture}(%.2f,%.2f)\n", wide, high);
00145   FileNameChange (filein, fileout, base, "eps");
00146 #ifdef EPSFIG
00147   fprintf (fo, "\\epsfig{file=\\Figdir %s.eps,width=%.2fpt,height=%.2fpt}\n",
00148            base, wide.high);
00149 #else
00150   fprintf (fo, "%% if you want to use epsfig uncomment the following line \n");
00151   fprintf (fo, "%% and comment the special line \n");
00152   fprintf (fo, "%%\\epsfig{file=\\Figdir %s.eps,width=%.2fpt,height=%.2fpt}\n",
00153            base, wide, high);
00154   fprintf (fo, "\\special{psfile=\\Figdir %s.eps hscale=%.2f vscale=%.2f}\n",
00155            base, hscale, vscale);
00156 #endif
00157   fprintf (fo, "\\end{picture}}\n");
00158   fprintf (fo, "\\end{center}\n");
00159 #ifndef DOC
00160   fprintf (fo, "\\caption{\\label{#2}#1}\n");
00161   fprintf (fo, "\\end{figure}}\n");
00162 #endif
00163   fclose (fo);
00164   return (0);
00165 }

Here is the call graph for this function:

Here is the caller graph for this function:

void SciMenuSelect ( char *  Name  ) 

BOOL SciOpenSave ( HWND  hWndParent,
BYTE **  s,
BOOL  save,
char **  d,
int ierr 
)

Definition at line 1709 of file wmenu.c.

Referenced by SavePs(), and SendGraphMacro().

01710 {
01711   int i, nChar;
01712   OPENFILENAME ofn;
01713   char *szTitle;
01714   char *szFile;
01715   char *szFileTitle;
01716   char *szFilter;
01717   BOOL flag;
01718 
01719   NEWSTRING (szTitle);
01720   NEWSTRING (szFile);
01721   NEWSTRING (szFileTitle);
01722   NEWSTRING (szFilter);
01723 
01724   (*s)++;
01725   for (i = 0; (**s >= 32 && **s <= 126); i++)
01726   {
01727     szTitle[i] = **s;
01728    (*s)++;
01729   }                             /* get dialog box title */
01730   szTitle[i] = '\0';
01731   (*s)++;
01732   for (i = 0; (**s >= 32 && **s <= 126); i++)
01733   {
01734     szFile[i] = **s;
01735     (*s)++;
01736   }                             /* temporary copy of filter */
01737   szFile[i++] = '\0';
01738   lstrcpy (szFilter, "Default (");
01739   lstrcat (szFilter, szFile);
01740   lstrcat (szFilter, ")");
01741   i = lstrlen (szFilter);
01742   i++;                          /* move past NULL */
01743   lstrcpy (szFilter + i, szFile);
01744   i += lstrlen (szFilter + i);
01745   i++;                          /* move past NULL */
01746   lstrcpy (szFilter + i, "All Files (*.*)");
01747   i += lstrlen (szFilter + i);
01748   i++;                          /* move past NULL */
01749   lstrcpy (szFilter + i, "*.*");
01750   i += lstrlen (szFilter + i);
01751   i++;                          /* move past NULL */
01752   szFilter[i++] = '\0';         /* add a second NULL */
01753   /* the Windows 3.1 implentation - MC */
01754   szFile[0] = '\0';
01755 
01756   /* clear the structrure */
01757         ZeroMemory(&ofn, sizeof(ofn));
01758   ofn.lStructSize = sizeof (ofn);
01759   ofn.hwndOwner = hWndParent;
01760   ofn.lpstrFilter = szFilter;
01761   ofn.nFilterIndex = 1;
01762   ofn.lpstrFile = szFile;
01763   ofn.nMaxFile = MAXSTR;
01764   ofn.lpstrFileTitle = szFileTitle;
01765   ofn.nMaxFileTitle = MAXSTR;
01766   ofn.lpstrTitle = szTitle;
01767   ofn.lpstrInitialDir = (LPSTR) NULL;
01768 
01769         if (save)
01770         {
01771                 ofn.Flags = OFN_PATHMUSTEXIST;
01772                 flag=GetSaveFileName (&ofn);
01773         }
01774         else
01775         {
01776                 ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
01777                 flag=GetOpenFileName (&ofn);
01778         }
01779 
01780         if (flag)
01781         {
01782                 nChar = lstrlen (ofn.lpstrFile);
01783                 for (i = 0; i < nChar; i++)
01784                 {
01785                         **d = ofn.lpstrFile[i];
01786                         (*d)++;
01787                 }
01788         }
01789   
01790   FREE (szTitle);
01791   FREE (szFilter);
01792   FREE (szFile);
01793   FREE (szFileTitle);
01794 
01795   return (flag);
01796 }

Here is the caller graph for this function:

void sciprint ( char *  fmt,
  ... 
)

int sciprint2 ( int  v,
char *  fmt,
  ... 
)

void sciprint_nd ( char *  fmt,
  ... 
)

Definition at line 97 of file printf.c.

00098 {
00099         int i, count, lstr;
00100         char buf[MAXPRINTF];
00101         va_list args;
00102         va_start (args, fmt);
00103 
00104         /* next three lines added for diary SS */
00105         count = _vsnprintf (buf,MAXPRINTF-1, fmt, args);
00106         if (count == -1)
00107         {
00108                 buf[MAXPRINTF-1]='\0';
00109         }
00110         lstr = strlen (buf);
00111 
00112         C2F (xscion) (&i);
00113         if (i == 0)
00114         {
00115                 /*count = vfprintf(stdout, fmt, args ); */
00116                 printf ("%s", buf);
00117         }
00118         else
00119         {
00120                 /*count = vsprintf(buf,fmt,args); SS */
00121                 TextPutS (&textwin, buf);
00122                 PutString(buf);
00123         }
00124         va_end (args);
00126 }

void Scistring ( char *  str  ) 

synonym for scilab but without the

Definition at line 79 of file printf.c.

00080 {
00081         int i;
00082         C2F (xscion) (&i);
00083         if (i == 0)
00084         fprintf (stdout, "%s", str);
00085         else
00086         {
00087                 TextPutS (&textwin, str);
00088                 PutString(str);
00089                 PutString("\n");
00090                 MyPutCh ('\n');
00091         }
00092 }

void SendGraphMacro ( struct BCG ScilabGC,
UINT  m 
)

Definition at line 38 of file wgmenu.c.

Referenced by ON_WND_GRAPH_WM_COMMAND().

00039 {
00040   BYTE *s;
00041   char *d;
00042   char *buf;
00043   BOOL flag = TRUE;
00044   wininfo (" ");
00045   if ((buf = LocalAlloc (LPTR, MAXSTR + 1)) == (char *) NULL)
00046     return;
00047   if (m >= NUMMENU || (int)m < 0)
00048     return;
00049   s = ScilabGC->lpmw.macro[m];
00050   d = buf;
00051   *d = '\0';
00052   while (s && *s && (d - buf < MAXSTR))
00053     {
00054       if (*s >= CMDMIN && *s <= CMDMAX)
00055         {
00056           int ierr = 0;
00057           
00059           switch (*s)
00060             {
00061             case TOOLBARGRAPH:
00062               if (ScilabGC->lpmw.LockToolBar == FALSE)
00063                 {
00064                   if (ScilabGC->lpmw.ShowToolBar)       HideGraphToolBar(ScilabGC);
00065                   else ShowGraphToolBar(ScilabGC);
00066                 }
00067               s++;
00068               break;
00069             case NEWFIG:
00070               SaveCurrentLine(TRUE);
00071               NewFigure(ScilabGC);
00072               s++;
00073               break;
00074             case ZOOM:
00075               scig_2dzoom (ScilabGC->CurWindow);
00076                   
00077               s++;
00078               break;
00079             case UNZOOM:
00080               scig_unzoom (ScilabGC->CurWindow);
00081                   
00082               s++;
00083               break;
00084             case ROT3D:
00085               scig_3drot (ScilabGC->CurWindow);
00086                   
00087               s++;
00088               break;
00089                 case PRINTSETUP:
00090                         Callback_PRINTSETUP();
00091                         s++;
00092                         break;
00093             case PRINT:
00094               CopyPrint (ScilabGC);
00095               s++;
00096               break;
00097             case COPYCLIP:
00098               {
00099                 CopyToClipboardEMF (ScilabGC);
00100                 s++;
00101               }
00102               break;
00103             case COPYCLIP1:
00104               CopyToClipboardBitmap (ScilabGC);
00105               s++;
00106               break;
00107             case REDRAW:
00108               scig_replay (ScilabGC->CurWindow);
00109               s++;
00110               break;
00111             case CLEARWG:
00112               scig_erase (ScilabGC->CurWindow);
00113               s++;
00114               break;
00115             case SCIPS:
00116                 {
00117                         char *SaveCurrentPath=NULL;
00118                         SaveCurrentPath=_getcwd( NULL, 0 );
00119                         SavePs (ScilabGC);
00120                         if (SaveCurrentPath)
00121                         {
00122                                 _chdir(SaveCurrentPath);
00123                                 free(SaveCurrentPath); /* here must be a "little" free with _getcwd*/
00124                                 SaveCurrentPath=NULL;
00125                         }
00126                         s++;
00127                 }
00128               break;
00129             case SCIPR:
00130               PrintPs (ScilabGC);
00131               s++;
00132               break;
00133             case SCIGSEL:
00134               scig_sel (ScilabGC->CurWindow);
00135               s++;
00136               break;
00137             case LOADSCG:
00138               flag = SciOpenSave (ScilabGC->hWndParent, &s,FALSE,&d, &ierr);
00139               if (flag == 0 || ierr == 1)
00140                 {
00141                   LocalFree (buf);
00142                   return;
00143                 }
00144               *d = '\0';
00145               scig_loadsg (ScilabGC->CurWindow, buf);
00146               break;
00147             case SAVESCG:
00148               flag = SciOpenSave (ScilabGC->hWndParent, &s,TRUE,&d, &ierr);
00149               if (flag == 0 || ierr == 1)
00150                 {
00151                   LocalFree (buf);
00152                   return;
00153                 }
00154               *d = '\0';
00155               /*C2F (xsaveplots) (&(ScilabGC->CurWindow), buf, 0L);*/
00156               scig_savesg( ScilabGC->CurWindow, buf ) ;
00157               break;
00158             case UPDINI:
00159               SendMessage (ScilabGC->CWindow, WM_COMMAND, M_WRITEINI, 0L);
00160               s++;
00161               break;
00162             case CLOSE:
00163               C2F (deletewin) (&(ScilabGC->CurWindow));
00164               s++;
00165               break;
00166             default:
00167               s++;
00168               break;
00169             }
00173           d = buf;
00174           s = (BYTE *) "";
00175         }
00176       else
00177         {
00178           *d++ = *s++;
00179         }
00180     }
00181   *d = '\0';
00186   ScilabMenuAction (buf);
00187   LocalFree (buf);
00188 
00189 }

Here is the caller graph for this function:

void SendMacro ( LPTW  lptw,
UINT  m 
)

Definition at line 637 of file wmenu.c.

Referenced by ON_WND_TEXT_WM_COMMAND().

00638 {
00639 
00640   BYTE *s;
00641   char *d;
00642   char *buf;
00643   BOOL flag = TRUE;
00644  
00645   LPMW lpmw = lptw->lpmw;
00646 
00647   if ((buf = LocalAlloc (LPTR, MAXSTR + 1)) == (char *) NULL) return;
00648 
00649   if (m >= NUMMENU || (int)m < 0) return;
00650 
00651   s = lpmw->macro[m];
00652   d = buf;
00653   *d = '\0';
00654   while (s && *s && (d - buf < MAXSTR))
00655     {
00656       if (*s >= CMDMIN && *s <= CMDMAX)
00657         {
00658           /* int ierr = 0; */
00660           switch (*s)
00661             {
00662                 case NEWSCILAB:
00663                         Callback_NEWSCILAB();
00664                         return;
00665                 break;
00666                         case OPEN:
00667                                 SaveCurrentLine(TRUE);
00668                                 Callback_OPEN();
00669                                 return;
00670                 case EXEC:
00671                                 Callback_EXEC();
00672                         return;
00673                         break;
00674                 case GETF:
00675                         Callback_GETF();
00676                         return;
00677                 break;
00678                 case LOAD:
00679                         Callback_LOAD();
00680                         return;
00681                 break;  
00682                 case SAVE:
00683                         Callback_SAVE();
00684                         return;
00685                 break;
00686                 case CHDIR:
00687                         Callback_CHDIR();
00688                         return;
00689                 break;
00690                 case GETCWD:
00691                         Callback_GETCWD();
00692                         return;
00693                 break;
00694                 case EXIT:
00695                         ExitWindow();
00696                         return;
00697                 break;
00698                         case SELECTALL:
00699                                 Callback_SELECTALL();
00700                                 return;
00701                         break;
00702                 case MCOPY:
00703                         Callback_MCOPY();
00704                         s++;
00705                 break;
00706                 case PASTE:
00707                         Callback_PASTE();
00708                         return;
00709                 break; 
00710                 case EMPTYCLIPBOARD:
00711                                 Callback_EMPTYCLIPBOARD();
00712                                 return;
00713                         break;
00714                         case PRINTSETUP:
00715                                 Callback_PRINTSETUP();
00716                                 return;
00717                                 break;
00718                 case PRINT:
00719                         Callback_PRINT();
00720                         return;
00721                 break;
00722                 case TOOLBAR:
00723                         Callback_TOOLBAR();
00724                         return;
00725                 break;
00726                 case FRENCH:
00727                         Callback_FRENCH();
00728                         return;
00729                 break;
00730                 case ENGLISH:
00731                         Callback_ENGLISH();
00732                         return;
00733                 break;
00734                         case TEXTCOLOR:
00735                                 Callback_TEXTCOLOR();
00736                                 return;
00737                         case BACKGROUNDCOLOR:
00738                                 Callback_BACKGROUNDCOLOR();
00739                                 return;
00740                         case SYSTEMCOLOR:
00741                                 Callback_SYSTEMCOLOR();
00742                                 return;
00743                         case FILESASSOCIATION:
00744                                 Callback_FILESASSOCIATIONBOX();
00745                                 return;
00746                 case CHOOSETHEFONT:
00747                         Callback_CHOOSETHEFONT();
00748                         s++;
00749                 break;
00750                 case RESTART:
00751                         Callback_RESTART();
00752                         return;
00753                 break;
00754                 case ABORT:
00755                         Callback_ABORT();
00756                         return;
00757                 break;
00758                 case PAUSE:
00759                         Callback_PAUSE();
00760                         return;
00761                 break;
00762                 case RESUME:
00763                         Callback_RESUME();                      
00764                         return;
00765                 break;
00766                 case CONSOLE:
00767                         Callback_CONSOLE();
00768                         return;
00769                 break;
00770                 case SCIPAD:
00771                                 SaveCurrentLine(TRUE);
00772                         Callback_SCIPAD();
00773                         return;
00774                 break;
00775                 case HELP:
00776                                 SaveCurrentLine(TRUE);
00777                                 Callback_HELP();
00778                         return;
00779                 break;
00780                         case CONFIGBROWSER:
00781                                 SaveCurrentLine(TRUE);
00782                                 Callback_CONFIGUREBROWSER();
00783                                 return;
00784                         break;
00785                         case CLEARHISTORY:
00786                                 Callback_CLEARHISTORY();
00787                                 return;
00788                         break;
00789                 case DEMOS:
00790                         Callback_DEMOS();
00791                         return;
00792                 break;
00793                 case WEB:
00794                         Callback_WEB();
00795                         return;
00796                 break;
00797                         case CONTRIBUTIONS:
00798                         Callback_CONTRIBUTIONS();
00799                         return;
00800                 break;
00801                 case BUGZILLA:
00802                         Callback_BUGZILLA();
00803                         return;
00804                 break;
00805                 case EMAIL:
00806                         Callback_EMAIL();
00807                         return;
00808                 break;
00809                 case NEWSGROUP:
00810                         Callback_NEWSGROUP();
00811                         return;
00812                 break;
00813                 case ABOUT:
00814                         Callback_ABOUT();
00815                         return;
00816                 break;
00817                 case M_CTRL_C:
00818                 {
00819                         SignalCtrC ();
00820                         write_scilab("\n");
00821                 }
00822                         return;
00823                 break;
00824                 
00825                 case M_CTRL_U:
00826                 {
00827                          SendCTRLandAKey(CTRLU);
00828                 }
00829                         return;
00830                 break;
00831                 
00832                 case M_CTRL_P:
00833                 {
00834                          SendCTRLandAKey(CTRLP);
00835                 }
00836                         return;
00837                 break;
00838                 case M_CTRL_B:
00839                 {
00840                          SendCTRLandAKey(CTRLB);
00841                 }
00842                         return;
00843                 break;  
00844                 case M_CTRL_F:
00845                 {
00846                          SendCTRLandAKey(CTRLF);
00847                 }
00848                         return;
00849                 break;  
00850                 case M_CTRL_A:
00851                 {
00852                          SendCTRLandAKey(CTRLA);
00853                 }
00854                         return;
00855                 break;  
00856                 case M_CTRL_E:
00857                 {
00858                          SendCTRLandAKey(CTRLE);
00859                 }
00860                         return;
00861                 break;  
00862                 case M_CTRL_H:
00863                 {
00864                          SendCTRLandAKey(CTRLH);
00865                 }
00866                         return;
00867                 break;  
00868                 case M_CTRL_D:
00869                 {
00870                          SendCTRLandAKey(CTRLD);
00871                 }
00872                         return;
00873                 break;  
00874                 case M_CTRL_W:
00875                 {
00876                          SendCTRLandAKey(CTRLW);
00877                 }
00878                         return;
00879                 break;  
00880                 case M_CTRL_K:
00881                 {
00882                          SendCTRLandAKey(CTRLK);
00883                 }
00884                         return;
00885                 break;  
00886                 case M_CTRL_L:
00887                 {
00888                          SendCTRLandAKey(CTRLL);
00889                 }
00890                 return;
00891                 break;  
00892                 case CLEARCOMMANDWINDOW:
00893                 {
00894                         Callback_CLEARCOMMANDWINDOW();
00895                 }
00896                 return;
00897                 break;  
00898                 
00899                 return;
00900                 break;  
00901                 case EOS:               /* [EOS] - End Of String - do nothing */
00902                 default:
00903                         s++;
00904                 break;
00905         
00906             
00907             }
00908           if (!flag)
00909             {                   /* abort */
00910               d = buf;
00911               s = (BYTE *) "";
00912             }
00913         }
00914       else
00915         {
00916           *d++ = *s++;
00917         }
00918     }
00919   *d = '\0';
00921   ScilabMenuAction (buf);
00922   LocalFree (buf);
00923 }

Here is the caller graph for this function:

void set_is_reading ( int   ) 

handle function when scilab waits for commands set the mode

Parameters:
mode the mode wanted

Definition at line 23 of file flags.c.

00024 {
00025     reading = mode;
00026 }

void C2F() SetDriver (  ) 

void C2F() setfbutn ( char *  name,
int rep 
)

fixes the function associated to name

Definition at line 285 of file x_test_loop.c.

00288 {
00289   
00290 }

int C2F() setmen ( integer win_num,
char *  button_name,
integer entries,
integer ptrentries,
integer ne,
integer ierr 
)

activate a menu (scilab interface)

Definition at line 541 of file wgmenu.c.

00544 {
00545   struct BCG *ScilabGC;
00546   if (*win_num == -1)
00547     {
00548       SciSetMenu (textwin.lpmw->hMenu, button_name, *ne, MF_ENABLED);
00549       DrawMenuBar (textwin.hWndParent);
00550     }
00551   else
00552     {
00553       ScilabGC = getWindowXgcNumber (*win_num);
00554       if (ScilabGC != (struct BCG *) 0)
00555         {
00556           SciSetMenu (ScilabGC->lpmw.hMenu, button_name, *ne, MF_ENABLED);
00557           DrawMenuBar (ScilabGC->hWndParent);
00558         }
00559     }
00560   return (0);
00561 }

void SetXsciOn (  ) 

Definition at line 19 of file xscion.c.

References INXscilab, and switch_rlgets().

00020 {
00021         #ifdef _MSC_VER
00022          switch_rlgets (1);
00023         #endif
00024         INXscilab = 1;
00025 }

Here is the call graph for this function:

int C2F() sigbas ( integer  ) 

void SignalCtrC ( void   ) 

Definition at line 66 of file wtloop.c.

References C2F, j, and sigbas().

Referenced by CtrlCHit(), msdos_getch(), SendMacro(), and Windows_getch().

00067 {
00068   int j = 2;
00070   C2F (sigbas) (&j);
00071 
00072 }

Here is the call graph for this function:

Here is the caller graph for this function:

void squash_spaces ( char *  s  ) 

Definition at line 144 of file misc.c.

References FALSE, TRUE, and w.

00145 {
00146   register char *r = s;         /* reading point */
00147   register char *w = s;         /* writing point */
00148   int space = FALSE;            /* TRUE if we've already copied a space */
00149 
00150   for (w = r = s; *r != '\0'; r++)
00151     {
00152       if (isspace ((int) *r))
00153         {
00154           /* white space; only copy if we haven't just copied a space */
00155           if (!space)
00156             {
00157               space = TRUE;
00158               *w++ = ' ';
00159             }                   /* else ignore multiple spaces */
00160         }
00161       else
00162         {
00163           /* non-space character; copy it and clear flag */
00164           *w++ = *r;
00165           space = FALSE;
00166         }
00167     }
00168   *w = '\0';                    /* null terminate string */
00169 }

int C2F() stimer ( void   ) 

int StoreCommand ( char *   ) 

Definition at line 82 of file dynamic_menus.c.

00083 {
00084         return (StoreCommand1 (command, 0)); /* jpc 1->0 */
00085 }

int StoreCommand1 ( char *  ,
int   
)

Definition at line 93 of file dynamic_menus.c.

00094 {
00095 #ifdef _MSC_VER
00096  if ( (flag == 1) && ( !IsToThePrompt () ) ) flag=0;
00097 #endif
00098  switch (flag)
00099  {
00100  case 1: /* the command is shown in scilab window (if at prompt) */
00101                 {
00102                         write_scilab (command);
00103                         return (0);
00104                 }
00105                 break;
00106          case 0: 
00107          default : /* the command is not shown in Scilab */
00108                 {
00109                           CommandRec *p, *q, *r;
00110 
00112                           if (scig_command_handler (command) == 1)  return 0;
00113 
00114                           p = (CommandRec *) MALLOC (sizeof (CommandRec));
00115                           if (p == (CommandRec *) 0)
00116                                 {
00117                                         sciprint ("send_command : No more memory \r\n");
00118                                         return (1);
00119                                 }
00120                           p->flag = 0;
00121                           p->command = (char *) MALLOC ((strlen (command) + 1) * sizeof (char));
00122                           if (p->command == (char *) 0)
00123                                 {
00124                                   FREE(p);
00125                                   sciprint ("send_command : No more memory \r\n");
00126                                   return (1);
00127                                 }
00128                           strcpy (p->command, command);
00129                           p->next = NULL;
00130                           if (!commandQueue) commandQueue = p;
00131                           else
00132                                 {
00133                                         q = commandQueue;
00134                                         while ((r = q->next))   q = r;
00135                                         q->next = p;
00136                                 }
00137 #ifdef _MSC_VER
00138                         if (IsToThePrompt ()) write_scilab ("\n");
00139 #endif
00140                         return (0);
00141                         
00142                 break;
00143                 }
00144  }
00145 }

void switch_rlgets ( int   ) 

Definition at line 105 of file command.c.

References rlgets(), rlgets_def, and rlgets_nw().

Referenced by SetXsciOn().

00106 {
00107   if (i == 1)
00108     rlgets_def = rlgets;
00109   else
00110     rlgets_def = rlgets_nw;
00111 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() sxevents (  ) 

Definition at line 72 of file ScilabXloop.c.

00073 {
00074   if ( GetWITH_GUI() )
00075   {
00076 #ifdef WITH_TK
00077           if (getINXscilab() == 1 || BasicScilab == 0 )
00078 #else
00079           if (getINXscilab() == 1 )
00080 #endif
00081           {
00082                   TextMessage1 (1);
00083           }
00084   }
00085   return (0);
00086 }

void Tape_Replay ( char *  ,
integer ,
integer ,
integer ,
integer ,
integer ,
integer ,
double *  ,
double *  ,
double *  ,
double *   
)

../graphics*

void TextCopyClip ( LPTW  lptw  ) 

Definition at line 206 of file clipboard.c.

00207 {
00208         int size, count;
00209         HGLOBAL hGMem;
00210         LPSTR cbuf, cp;
00211         POINT pt, end;
00212         TEXTMETRIC tm;
00213         UINT type;
00214         HDC hdc;
00215 
00216         if ((lptw->MarkBegin.x == lptw->MarkEnd.x) && 
00217             (lptw->MarkBegin.y == lptw->MarkEnd.y) ) {
00218                 /* copy user text */
00219                 return;
00220         }
00221 
00222         size = (lptw->MarkEnd.y - lptw->MarkBegin.y + 1) 
00223                 * (lptw->ScreenSize.x + 2) + 1;
00224         hGMem = GlobalAlloc(GMEM_MOVEABLE, (DWORD)size);
00225         cbuf = cp = (LPSTR)GlobalLock(hGMem);
00226         if (cp == (LPSTR)NULL)
00227                 return;
00228         
00229         pt.x = lptw->MarkBegin.x;
00230         pt.y = lptw->MarkBegin.y;
00231         end.x   = lptw->MarkEnd.x;
00232         end.y   = lptw->MarkEnd.y;
00233 
00234         while (pt.y < end.y) {
00235                 /* copy to global buffer */
00236                 count = lptw->ScreenSize.x - pt.x;
00237                 _fmemcpy(cp, lptw->ScreenBuffer + lptw->ScreenSize.x*pt.y+pt.x, count);
00238                 /* remove trailing spaces */
00239                 for (count=count-1; count>=0; count--) {
00240                         if (cp[count]!=' ')
00241                                 break;
00242                         cp[count] = '\0';
00243                 }
00244                 cp[++count] = '\r';
00245                 cp[++count] = '\n';
00246                 cp[++count] = '\0';
00247                 cp += count;
00248                 pt.y++;
00249                 pt.x=0;
00250         }
00251         /* partial line */
00252         count = end.x - pt.x;
00253         if (end.y != lptw->ScreenSize.y) {
00254                 _fmemcpy(cp, lptw->ScreenBuffer + lptw->ScreenSize.x*pt.y+pt.x, count);
00255                 cp[count] = '\0';
00256         }
00257         size = _fstrlen(cbuf) + 1;
00258         GlobalUnlock(hGMem);
00259         hGMem = GlobalReAlloc(hGMem, (DWORD)size, GMEM_MOVEABLE);
00260         /* find out what type to put into clipboard */
00261         hdc = (HDC)TryToGetDC(lptw->hWndText);
00262         SelectObject(hdc, lptw->hfont);
00263         GetTextMetrics(hdc,(TEXTMETRIC FAR *)&tm);
00264         if (tm.tmCharSet == OEM_CHARSET)
00265                 type = CF_OEMTEXT;
00266         else
00267                 type = CF_TEXT;
00268         ReleaseDC(lptw->hWndText, hdc);
00269         /* give buffer to clipboard */
00270         OpenClipboard(lptw->hWndParent);
00271         EmptyClipboard();
00272         SetClipboardData(type, hGMem);
00273         CloseClipboard();
00274 }

void TextPutStr ( LPTW  lptw,
LPSTR  str 
)

Definition at line 461 of file wtext.c.

Referenced by TextPutS().

00462 {
00463   BYTE FAR *p, FAR * pa;
00464   int count, limit;
00465   while (*str)
00466     {
00467       p = lptw->ScreenBuffer + lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
00468       pa = lptw->AttrBuffer + lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
00469       limit = lptw->ScreenSize.x - lptw->CursorPos.x;
00470 
00471       for (count = 0; (count < limit) && *str && (iswprint ((int) str[0]) || *str == '\t'); count++)
00472         {
00473           if (*str == '\t')
00474             {
00475               int n;
00476               for (n = 8 - ((lptw->CursorPos.x + count) % 8); (count < limit) & (n > 0); n--, count++)
00477                 {
00478                   *p++ = ' ';
00479                   *pa++ = lptw->Attr;
00480                 }
00481               str++;
00482               count--;
00483             }
00484           else
00485             {
00486               *p++ = *str++;
00487               *pa++ = lptw->Attr;
00488             }
00489         }
00490       if (count > 0)
00491         {
00492           UpdateText (lptw, count);
00493         }
00494       if (*str == '\n')
00495         {
00496           NewLine (lptw);
00497           str++;
00498         }
00499       else if (*str && !iswprint ((int) str[0]) && *str != '\t')
00500         {
00501           TextPutCh (lptw, *str++);
00502         }
00503     }
00504 }

Here is the caller graph for this function:

void TextSelectFont ( LPTW  lptw  ) 

Definition at line 738 of file wtext.c.

Referenced by Callback_CHOOSETHEFONT(), and ON_WND_TEXT_WM_COMMAND().

00739 {
00740   LOGFONT lf;
00741   CHOOSEFONT cf;
00742   HDC hdc;
00743   char lpszStyle[LF_FACESIZE];
00744   LPSTR p;
00745   /* Set all structure fields to zero. */
00746   memset (&cf, 0, sizeof (CHOOSEFONT));
00747   memset (&lf, 0, sizeof (LOGFONT));
00748   cf.lStructSize = sizeof (CHOOSEFONT);
00749   cf.hwndOwner = lptw->hWndParent;
00750   strncpy (lf.lfFaceName, lptw->fontname, LF_FACESIZE);
00751   if ((p = strstr (lptw->fontname, " Bold")) != (LPSTR) NULL)
00752     {
00753       strncpy (lpszStyle, p + 1, LF_FACESIZE);
00754       lf.lfFaceName[(unsigned int) (p - lptw->fontname)] = '\0';
00755     }
00756   else if ((p = strstr (lptw->fontname, " Italic")) != (LPSTR) NULL)
00757     {
00758       strncpy (lpszStyle, p + 1, LF_FACESIZE);
00759       lf.lfFaceName[(unsigned int) (p - lptw->fontname)] = '\0';
00760     }
00761   else
00762     strcpy (lpszStyle, "Regular");
00763   cf.lpszStyle = lpszStyle;
00764   hdc = GetDC (lptw->hWndText);
00765   lf.lfHeight = -MulDiv (lptw->fontsize, GetDeviceCaps (hdc, LOGPIXELSY), 72);
00766   ReleaseDC (lptw->hWndText, hdc);
00767   lf.lfPitchAndFamily = FIXED_PITCH;
00768   cf.lpLogFont = &lf;
00769   cf.nFontType = SCREEN_FONTTYPE;
00770   cf.Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY | CF_INITTOLOGFONTSTRUCT | CF_USESTYLE;
00771   if (ChooseFont (&cf))
00772     {
00773       RECT rect;
00774       strcpy (lptw->fontname, lf.lfFaceName);
00775       lptw->fontsize = cf.iPointSize / 10;
00776       if (cf.nFontType & BOLD_FONTTYPE)
00777         lstrcat (lptw->fontname, " Bold");
00778       if (cf.nFontType & ITALIC_FONTTYPE)
00779         lstrcat (lptw->fontname, " Italic");
00780       TextMakeFont (lptw);
00781       /* force a window update */
00782       GetClientRect (lptw->hWndText, (LPRECT) & rect);
00783       SendMessage (lptw->hWndText, WM_SIZE, SIZE_RESTORED,
00784                MAKELPARAM (rect.right - rect.left, rect.bottom - rect.top));
00785       GetClientRect (lptw->hWndText, (LPRECT) & rect);
00786       InvalidateRect (lptw->hWndText, (LPRECT) & rect, 1);
00787       UpdateWindow (lptw->hWndText);
00788     }
00789 }

Here is the caller graph for this function:

int C2F() timer ( double *   ) 

Definition at line 30 of file timer.c.

Referenced by C2F(), and GetCommentDateSession().

00031 {
00032 #ifdef _MSC_VER 
00033   /* NT */
00034         /* Return CPU Time */
00035         FILETIME  ftCreation, ftExit, ftKernel,  ftUser;
00036   __int64 i64UserTick2;
00037         
00038         GetProcessTimes(GetCurrentProcess(), &ftCreation, &ftExit, &ftKernel, &ftUser);
00039         i64UserTick2=*((__int64 *) &ftUser);
00040         if (init_clock == 1) {init_clock = 0; i64UserTick1 = i64UserTick2;}
00041         *etime=(double) ((double)(i64UserTick2 - i64UserTick1)/(double)10000000U);
00042         i64UserTick1 = i64UserTick2;
00043 #else
00044   clock_t t2;
00045   t2 = clock();
00046   if (init_clock == 1) {init_clock = 0; t1 = t2;}
00047   *etime=(double)((double)(t2 - t1)/(double)CLOCKS_PER_SEC);
00048   t1 = t2;
00049 #endif
00050   return(0);
00051 }

Here is the caller graph for this function:

int C2F() unsmen ( integer ,
char *  ,
integer ,
integer ,
integer ,
integer  
)

Definition at line 563 of file wgmenu.c.

00565 {
00566   struct BCG *ScilabGC;
00567   if (*win_num == -1)
00568     {
00569       SciSetMenu (textwin.lpmw->hMenu, button_name, *ne, MF_GRAYED);
00570       DrawMenuBar (textwin.hWndParent);
00571     }
00572   else
00573     {
00574       ScilabGC = getWindowXgcNumber (*win_num);
00575       if (ScilabGC != (struct BCG *) 0)
00576         {
00577           SciSetMenu (ScilabGC->lpmw.hMenu, button_name, *ne, MF_GRAYED);
00578           DrawMenuBar (ScilabGC->hWndParent);
00579         }
00580     }
00581   return (0);
00582 }

void UpdateText ( LPTW  ,
int   
)

Definition at line 384 of file wtext.c.

Referenced by TextPutCh(), and TextPutStr().

00385 {
00386   HDC hdc;
00387         
00388   int xpos, ypos;
00389   xpos = lptw->CursorPos.x * lptw->CharSize.x - lptw->ScrollPos.x;
00390   ypos = lptw->CursorPos.y * lptw->CharSize.y - lptw->ScrollPos.y;
00391   hdc = GetDC (lptw->hWndText);
00392 
00393   SetTextColor (hdc, GetIhmTextColor());
00394   SetBkColor (hdc, GetIhmTextBackgroundColor());
00395 
00396   SelectFont (hdc, lptw->hfont);
00397   TextOut (hdc, xpos, ypos,(LPSTR) (lptw->ScreenBuffer + lptw->CursorPos.y * lptw->ScreenSize.x +  lptw->CursorPos.x), count);
00398   ReleaseDC (lptw->hWndText, hdc);
00399   lptw->CursorPos.x += count;
00400   if (lptw->CursorPos.x >= lptw->ScreenSize.x)  NewLine (lptw);
00401         else
00402         {
00403                 RECT RectZone;
00404 
00405                 RectZone.left=0;
00406                 RectZone.top=ypos;
00407                 RectZone.bottom=ypos+lptw->CharSize.y;
00408                 RectZone.right=xpos+lptw->CharSize.x;
00409 
00410                 InvalidateRect(lptw->hWndText,&RectZone,TRUE);
00411         }
00412 }

Here is the caller graph for this function:

int WGFindMenuPos ( BYTE **  macros  ) 

Definition at line 465 of file wgmenu.c.

Referenced by AddMenu(), LoadGraphMacros(), and LoadMacros().

00466 {
00467   int i;
00468   for (i = 0; i < NUMMENU; i++)
00469     {
00470       if (macros[i] == (BYTE *) 0)
00471         return (i);
00472     }
00473   return (NUMMENU);
00474 }

Here is the caller graph for this function:

void WinExit ( void   ) 

void write_scilab ( char *  buf  ) 

Definition at line 274 of file wgmenu.c.

Referenced by Callback_RESTART(), Do_Stop(), DoIt(), exec_file(), getf_file(), getfc_file(), linkf_file(), load_file(), SendMacro(), StoreCommand1(), WriteTextThread(), and zzledt().

00275 {
00276   if ( IsWindowInterface() ) Write_Scilab_Window(buf);
00277   else Write_Scilab_Console(buf);
00278   
00279 }

Here is the caller graph for this function:

void WriteRegistryGraph ( struct BCG ScilabGC  ) 

Definition at line 273 of file registry.c.

References MAX_PATH, NULL, result, SCI_VERSION_STRING, and SW_SHOWNORMAL.

00274 {
00275         /* Modification Sauvegarde dans la base de registre dans 
00276                         HKEY_CURRENT_USER\\SOFTWARE\\Scilab\\"VERSION"\\Graph Settings
00277         "Version" correspondant à la version de Scilab
00278         Sauvegarde dans HKEY_CURRENT_USER car données dépendant de l'utilisateur
00279         */
00280 
00281         HKEY key;
00282         DWORD result,dwsize=4;
00283         char Clef[MAX_PATH];
00284 
00285         RECT rect;
00286         long GraphSizeX,GraphSizeY;
00287         int iconic;
00288         LONG TstRegCreateKeyEx=0;
00289 
00290 
00291         wsprintf(Clef,"SOFTWARE\\Scilab\\%s\\Graph Settings",SCI_VERSION_STRING);       
00292         TstRegCreateKeyEx=RegCreateKeyEx(HKEY_CURRENT_USER, Clef, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &result);
00293         if (TstRegCreateKeyEx == ERROR_SUCCESS)
00294         {
00295                 iconic = IsIconic (ScilabGC->hWndParent);
00296                 if (iconic) ShowWindow (ScilabGC->hWndParent, SW_SHOWNORMAL);
00297 
00298                 GetWindowRect (ScilabGC->hWndParent, &rect);
00299                 RegSetValueEx(key, "GraphOriginX", 0, REG_DWORD, (LPBYTE)&rect.left, dwsize);
00300                 RegSetValueEx(key, "GraphOriginY", 0, REG_DWORD, (LPBYTE)&rect.top, dwsize);
00301 
00302                 GraphSizeX=rect.right - rect.left;
00303                 GraphSizeY=rect.bottom - rect.top;
00304                 RegSetValueEx(key, "GraphSizeX", 0, REG_DWORD,(LPBYTE)&GraphSizeX, dwsize);
00305                 RegSetValueEx(key, "GraphSizeY", 0, REG_DWORD,(LPBYTE)&GraphSizeY, dwsize);
00306                 RegSetValueEx(key, "ToolBar", 0, REG_DWORD, (LPBYTE)&ScilabGC->lpmw.ShowToolBar, dwsize);
00307 
00308                 RegCloseKey(key);
00309         }
00310         
00311         if (iconic) ShowWindow (ScilabGC->hWndParent, SW_SHOWMINIMIZED);
00312   
00313 }

void WriteRegistryTxt ( LPTW  lptw  ) 

Definition at line 202 of file registry.c.

00203 {
00204         /* Modification Sauvegarde dans la base de registre dans 
00205                         HKEY_CURRENT_USER\\SOFTWARE\\Scilab\\"VERSION"\\Settings
00206         "Version" correspondant à la version de Scilab
00207         Sauvegarde dans HKEY_CURRENT_USER car données dépendant de l'utilisateur
00208         */
00209 
00210         HKEY key = NULL;
00211         DWORD result,dwsize=4;
00212         RECT rect;
00213         int iconic;
00214         char Clef[MAX_PATH];
00215         int SizeX;
00216         int SizeY;
00217         int SysColors;
00218         DWORD TextColor;
00219     DWORD BackgroundColor;
00220         char TextFontName[MAX_PATH];
00221         int TextFontSize;
00222         BOOL ShowButtons;
00223 //      int LanguageCode;
00224         LONG TstRegCreateKeyEx=0;
00225 
00226         wsprintf(Clef,"SOFTWARE\\Scilab\\%s\\Settings",SCI_VERSION_STRING);     
00227         TstRegCreateKeyEx = RegCreateKeyEx(HKEY_CURRENT_USER, Clef, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &result);
00228         if (TstRegCreateKeyEx == ERROR_SUCCESS)
00229         {
00230                 iconic = IsIconic (lptw->hWndParent);
00231                 if (iconic) ShowWindow (lptw->hWndParent, SW_SHOWNORMAL);
00232 
00233                 GetWindowRect (lptw->hWndParent, &rect);
00234                 RegSetValueEx(key, "TextOriginX", 0, REG_DWORD, (LPBYTE)&rect.left, dwsize);
00235                 RegSetValueEx(key, "TextOriginY", 0, REG_DWORD, (LPBYTE)&rect.top, dwsize);
00236 
00237                 SizeX=rect.right - rect.left;
00238                 SizeY=rect.bottom - rect.top;
00239                 RegSetValueEx(key, "TextSizeX", 0, REG_DWORD, (LPBYTE)&SizeX, dwsize);
00240                 RegSetValueEx(key, "TextSizeY", 0, REG_DWORD, (LPBYTE)&SizeY, dwsize);
00241 
00242                 RegSetValueEx(key, "TextMinimized", 0, REG_DWORD, (LPBYTE)&iconic, dwsize);
00243 
00244                 strcpy(TextFontName,lptw->fontname);
00245                 RegSetValueEx(key, "TextFontName", 0, REG_SZ, (LPBYTE)TextFontName, strlen(TextFontName)+1);
00246 
00247                 TextFontSize=lptw->fontsize;
00248                 RegSetValueEx(key, "TextFontSize", 0, REG_DWORD, (LPBYTE)&TextFontSize, dwsize);
00249 
00250                 SysColors=lptw->bSysColors;
00251                 RegSetValueEx(key, "SysColors", 0, REG_DWORD, (LPBYTE)&SysColors, dwsize);
00252 
00253                 TextColor=GetIhmTextColor();
00254                 RegSetValueEx(key, "TextColor", 0, REG_DWORD, (LPBYTE)&TextColor, dwsize);
00255 
00256                 BackgroundColor= GetIhmTextBackgroundColor();
00257                 RegSetValueEx(key, "BackgroundColor", 0, REG_DWORD, (LPBYTE)&BackgroundColor, dwsize);
00258 
00259                 ShowButtons=lptw->lpmw->ShowToolBar;
00260                 RegSetValueEx(key, "ToolBar", 0, REG_DWORD, (LPBYTE)&ShowButtons, dwsize);
00261 
00262                 /*LanguageCode=lptw->lpmw->CodeLanguage;
00263                 RegSetValueEx(key, "Language", 0, REG_DWORD, (LPBYTE)&LanguageCode, dwsize);
00264                 */
00265 
00266                 RegCloseKey(key);
00267         }
00268         
00269         if (iconic) ShowWindow (lptw->hWndParent, SW_SHOWMINIMIZED);
00270   
00271 }

int C2F() xscion ( int i  ) 

Definition at line 13 of file xscion.c.

00014 {
00015   *i = INXscilab;
00016   return (0);
00017 }


Generated on Sun Mar 4 15:58:24 2007 for Scilab [trunk] by  doxygen 1.5.1