Fix direct-casting BOOL / int or BOOL / bool 58/4258/2
Clément DAVID [Tue, 21 Jun 2011 10:23:15 +0000 (12:23 +0200)]
Use helpers from BOOL.h

Change-Id: Iaf8e286854e63ad30d0c3714c71819f02dc82c34

scilab/modules/console/src/cpp/ConsoleIsWaitingForInput.cpp
scilab/modules/dynamic_link/includes/dynamic_link.h
scilab/modules/graphic_export/src/cpp/JoGLInterface.cpp
scilab/modules/gui/sci_gateway/cpp/sci_toprint.cpp
scilab/modules/gui/src/cpp/CallFontChooser.cpp
scilab/modules/gui/src/cpp/Toolbar.cpp
scilab/modules/renderer/src/cpp/GetJavaProperty.cpp

index 1aca35c..e0a0371 100644 (file)
 #include "ConsoleIsWaitingForInput.hxx"
 /*--------------------------------------------------------------------------*/
 #include "CallScilabBridge.hxx"
-using namespace  org_scilab_modules_gui_bridge;
+using namespace org_scilab_modules_gui_bridge;
 BOOL ConsoleIsWaitingForInput(void)
 {
-       if (getScilabJavaVM())
-       {
-               return CallScilabBridge::isWaitingForInput(getScilabJavaVM());
-       }
-       return FALSE;
+    if (getScilabJavaVM())
+    {
+        return booltoBOOL(CallScilabBridge::isWaitingForInput(getScilabJavaVM()));
+    }
+    return FALSE;
 }
-/*--------------------------------------------------------------------------*/
 
+/*--------------------------------------------------------------------------*/
index d61981a..8fcf94b 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "dynlib_dynamic_link.h"
 #include "BOOL.h"
-#include "machine.h" /* C2F */
+#include "machine.h"            /* C2F */
 
 #define ENTRYMAX 500
 
@@ -37,7 +37,7 @@ DYNAMIC_LINK_IMPEXP void initializeLink(void);
 * @param[in/out] ilib number in the function table (-1 if FALSE)
 * @return a BOOL
 */
-DYNAMIC_LINK_IMPEXP BOOL c_link(char *routinename,int *ilib);
+DYNAMIC_LINK_IMPEXP BOOL c_link(char *routinename, int *ilib);
 
 /**
 * OBSOLETE 
@@ -49,8 +49,7 @@ DYNAMIC_LINK_IMPEXP BOOL c_link(char *routinename,int *ilib);
 * @param[in] routinename
 * @param[in/out] ilib
 */
-DYNAMIC_LINK_IMPEXP void C2F(iislink)(char *routinename, int *ilib);
-
+DYNAMIC_LINK_IMPEXP void C2F(iislink) (char *routinename, int *ilib);
 
 /**
 * returns the ii functions 
@@ -83,21 +82,20 @@ DYNAMIC_LINK_IMPEXP void unlinkallsharedlib(void);
 */
 DYNAMIC_LINK_IMPEXP void unlinksharedlib(int *i);
 
-
 /**
 * load a shared archive and call LoadDynLibrary
 * the shared lib handler is stored in a Table 
 * return value is == -1 if the LoadDynLibrary failed 
 * @param loaded_file
 */
-DYNAMIC_LINK_IMPEXP int Sci_dlopen( char *loaded_file);
+DYNAMIC_LINK_IMPEXP int Sci_dlopen(char *loaded_file);
 
 /**
 * This routine load the entryname ename 
 * from shared lib ishared 
 * @return TRUE or FALSE
 */
-DYNAMIC_LINK_IMPEXP BOOL Sci_dlsym(char *ename,int ishared,char *strf);
+DYNAMIC_LINK_IMPEXP int Sci_dlsym(char *ename, int ishared, char *strf);
 
 /**
 * Delete entry points associated with shared lib ishared
@@ -122,10 +120,7 @@ DYNAMIC_LINK_IMPEXP char **getNamesOfFunctionsInSharedLibraries(int *sizearray);
 * @param ierr (last error)
 * @return id 
 */
-DYNAMIC_LINK_IMPEXP int scilabLink(int idsharedlibrary,
-                          char *filename,
-                          char **subnamesarray,int sizesubnamesarray,
-                          BOOL fflag,int *ierr);
+DYNAMIC_LINK_IMPEXP int scilabLink(int idsharedlibrary, char *filename, char **subnamesarray, int sizesubnamesarray, BOOL fflag, int *ierr);
 
 /**
 * get list of all Id of shared lib
index 511d09f..41d43a5 100644 (file)
@@ -30,291 +30,342 @@ using namespace org_scilab_modules_graphic_export;
 /*---------------------------------------------------------------------------------*/
 void joglFeedbackBuffer(int size, int type)
 {
-  GL2PSToJOGL::glFeedbackBuffer(getScilabJavaVM(), size, type);
+    GL2PSToJOGL::glFeedbackBuffer(getScilabJavaVM(), size, type);
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglReadFeedbackBuffer(int size, float * buffer)
+void joglReadFeedbackBuffer(int size, float *buffer)
 {
-       float * javaBuffer = GL2PSToJOGL::readFeedbackBuffer(getScilabJavaVM(), size);
-       
-        // copy the computed buffer into buffer
-  for (int i = 0; i < size; i++)
-  {
-    buffer[i] = javaBuffer[i];
-  }
-  delete[] javaBuffer;
+    float *javaBuffer = GL2PSToJOGL::readFeedbackBuffer(getScilabJavaVM(), size);
+
+    // copy the computed buffer into buffer
+    for (int i = 0; i < size; i++)
+    {
+        buffer[i] = javaBuffer[i];
+    }
+    delete[]javaBuffer;
 
 }
+
 /*---------------------------------------------------------------------------------*/
 BOOL joglIsEnabled(int cap)
 {
-  return (GL2PSToJOGL::glIsEnabled(getScilabJavaVM(), cap) == true);
+    return booltoBOOL((GL2PSToJOGL::glIsEnabled(getScilabJavaVM(), cap) == true));
 }
+
 /*---------------------------------------------------------------------------------*/
 void joglBegin(int mode)
 {
-  GL2PSToJOGL::glBegin(getScilabJavaVM(), mode);
+    GL2PSToJOGL::glBegin(getScilabJavaVM(), mode);
 }
+
 /*---------------------------------------------------------------------------------*/
 void joglVertex3f(float x, float y, float z)
 {
-  GL2PSToJOGL::glVertex3f(getScilabJavaVM(), x, y, z);
+    GL2PSToJOGL::glVertex3f(getScilabJavaVM(), x, y, z);
 }
+
 /*---------------------------------------------------------------------------------*/
 void joglEnd(void)
 {
-  GL2PSToJOGL::glEnd(getScilabJavaVM());
+    GL2PSToJOGL::glEnd(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 void joglGetCurrentRasterPositionValid(BOOL * value)
 {
-  *value =(GL2PSToJOGL::glGetCurrentRasterPositionValid(getScilabJavaVM()) == true);
+    *value = booltoBOOL((GL2PSToJOGL::glGetCurrentRasterPositionValid(getScilabJavaVM()) == true));
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglRenderMode(int mode)
 {
-  return GL2PSToJOGL::glRenderMode(getScilabJavaVM(), mode);
+    return GL2PSToJOGL::glRenderMode(getScilabJavaVM(), mode);
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetLineStipplePattern(int * value)
+void joglGetLineStipplePattern(int *value)
 {
-  *value = GL2PSToJOGL::glGetLineStipplePattern(getScilabJavaVM());
+    *value = GL2PSToJOGL::glGetLineStipplePattern(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetLineStippleRepeat(int * value)
+void joglGetLineStippleRepeat(int *value)
 {
-  *value = GL2PSToJOGL::glGetLineStippleRepeat(getScilabJavaVM());
+    *value = GL2PSToJOGL::glGetLineStippleRepeat(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetIndexClearValue(int * value)
+void joglGetIndexClearValue(int *value)
 {
-  *value = GL2PSToJOGL::glGetIndexClearValue(getScilabJavaVM());
+    *value = GL2PSToJOGL::glGetIndexClearValue(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetViewport(int * viewPort)
+void joglGetViewport(int *viewPort)
 {
-  int * javaViewPort = GL2PSToJOGL::glGetViewport(getScilabJavaVM());
+    int *javaViewPort = GL2PSToJOGL::glGetViewport(getScilabJavaVM());
 
-  for (int i = 0; i < VIEWPORT_SIZE; i++)
-  {
-    viewPort[i] = javaViewPort[i];
-  }
-  delete[] javaViewPort;
+    for (int i = 0; i < VIEWPORT_SIZE; i++)
+    {
+        viewPort[i] = javaViewPort[i];
+    }
+    delete[]javaViewPort;
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetBlendSrc(int * value)
+void joglGetBlendSrc(int *value)
 {
-  *value = GL2PSToJOGL::glGetBlendSrc(getScilabJavaVM());
+    *value = GL2PSToJOGL::glGetBlendSrc(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetBlendDst(int * value)
+void joglGetBlendDst(int *value)
 {
-  *value = GL2PSToJOGL::glGetBlendDst(getScilabJavaVM());
+    *value = GL2PSToJOGL::glGetBlendDst(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetColorClearValue(float * color)
+void joglGetColorClearValue(float *color)
 {
-  float * javaColor = GL2PSToJOGL::glGetColorClearValue(getScilabJavaVM());
+    float *javaColor = GL2PSToJOGL::glGetColorClearValue(getScilabJavaVM());
 
-  for (int i = 0; i < COLOR_CLEAR_VALUE_SIZE; i++)
-  {
-    color[i] = javaColor[i];
-  }
-  delete[] javaColor;
+    for (int i = 0; i < COLOR_CLEAR_VALUE_SIZE; i++)
+    {
+        color[i] = javaColor[i];
+    }
+    delete[]javaColor;
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetPolygonOffsetFactor(float * value)
+void joglGetPolygonOffsetFactor(float *value)
 {
-  *value = GL2PSToJOGL::glGetPolygonOffsetFactor(getScilabJavaVM());
+    *value = GL2PSToJOGL::glGetPolygonOffsetFactor(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetPolygonOffsetUnits(float * value)
+void joglGetPolygonOffsetUnits(float *value)
 {
-  *value = GL2PSToJOGL::glGetPolygonOffsetUnits(getScilabJavaVM());
+    *value = GL2PSToJOGL::glGetPolygonOffsetUnits(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetCurrentRasterPosition(float * position)
+void joglGetCurrentRasterPosition(float *position)
 {
-  float * javaPos = GL2PSToJOGL::glGetCurrentRasterPosition(getScilabJavaVM());
+    float *javaPos = GL2PSToJOGL::glGetCurrentRasterPosition(getScilabJavaVM());
 
-  for (int i = 0; i < CURRENT_RASTER_POSITION_SIZE; i++)
-  {
-    position[i] = javaPos[i];
-  }
-  delete[] javaPos;
+    for (int i = 0; i < CURRENT_RASTER_POSITION_SIZE; i++)
+    {
+        position[i] = javaPos[i];
+    }
+    delete[]javaPos;
 }
+
 /*---------------------------------------------------------------------------------*/
-void joglGetCurrentRasterColor(float * color)
+void joglGetCurrentRasterColor(float *color)
 {
-  float * javaColor = GL2PSToJOGL::glGetCurrentRasterColor(getScilabJavaVM());
+    float *javaColor = GL2PSToJOGL::glGetCurrentRasterColor(getScilabJavaVM());
 
-  for (int i = 0; i < CURRENT_RASTER_COLOR_SIZE; i++)
-  {
-    color[i] = javaColor[i];
-  }
-  delete[] javaColor;
+    for (int i = 0; i < CURRENT_RASTER_COLOR_SIZE; i++)
+    {
+        color[i] = javaColor[i];
+    }
+    delete[]javaColor;
 }
+
 /*---------------------------------------------------------------------------------*/
 void joglPassThrough(float token)
 {
-  GL2PSToJOGL::glPassThrough(getScilabJavaVM(), token);
+    GL2PSToJOGL::glPassThrough(getScilabJavaVM(), token);
 }
+
 /*---------------------------------------------------------------------------------*/
 
 /*---------------------------------------------------------------------------------*/
 int joglGL_RGBA(void)
 {
-  return JOGLConstant::get_GL_RGBA(getScilabJavaVM());
+    return JOGLConstant::get_GL_RGBA(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_RGB(void)
 {
-  return JOGLConstant::get_GL_RGB(getScilabJavaVM());
+    return JOGLConstant::get_GL_RGB(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_SRC_ALPHA(void)
 {
-  return JOGLConstant::get_GL_SRC_ALPHA(getScilabJavaVM());
+    return JOGLConstant::get_GL_SRC_ALPHA(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_ONE_MINUS_SRC_ALPHA(void)
 {
-  return JOGLConstant::get_GL_ONE_MINUS_SRC_ALPHA(getScilabJavaVM());
+    return JOGLConstant::get_GL_ONE_MINUS_SRC_ALPHA(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_ONE(void)
 {
-  return JOGLConstant::get_GL_ONE(getScilabJavaVM());
+    return JOGLConstant::get_GL_ONE(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_ZERO(void)
 {
-  return JOGLConstant::get_GL_ZERO(getScilabJavaVM());
+    return JOGLConstant::get_GL_ZERO(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_COLOR_INDEX(void)
 {
-  return JOGLConstant::get_GL_COLOR_INDEX(getScilabJavaVM());
+    return JOGLConstant::get_GL_COLOR_INDEX(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_POINT_TOKEN(void)
 {
-  return JOGLConstant::get_GL_POINT_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_POINT_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_LINE_TOKEN(void)
 {
-  return JOGLConstant::get_GL_LINE_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_LINE_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_LINE_RESET_TOKEN(void)
 {
-  return JOGLConstant::get_GL_LINE_RESET_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_LINE_RESET_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_POLYGON_TOKEN(void)
 {
-  return JOGLConstant::get_GL_POLYGON_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_POLYGON_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_BITMAP_TOKEN(void)
 {
-  return JOGLConstant::get_GL_BITMAP_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_BITMAP_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_DRAW_PIXEL_TOKEN(void)
 {
-  return JOGLConstant::get_GL_DRAW_PIXEL_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_DRAW_PIXEL_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_COPY_PIXEL_TOKEN(void)
 {
-  return JOGLConstant::get_GL_COPY_PIXEL_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_COPY_PIXEL_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_PASS_THROUGH_TOKEN(void)
 {
-  return JOGLConstant::get_GL_PASS_THROUGH_TOKEN(getScilabJavaVM());
+    return JOGLConstant::get_GL_PASS_THROUGH_TOKEN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_FEEDBACK(void)
 {
-  return JOGLConstant::get_GL_FEEDBACK(getScilabJavaVM());
+    return JOGLConstant::get_GL_FEEDBACK(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_COLOR_CLEAR_VALUE(void)
 {
-  return JOGLConstant::get_GL_COLOR_CLEAR_VALUE(getScilabJavaVM());
+    return JOGLConstant::get_GL_COLOR_CLEAR_VALUE(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_INDEX_CLEAR_VALUE(void)
 {
-  return JOGLConstant::get_GL_INDEX_CLEAR_VALUE(getScilabJavaVM());
+    return JOGLConstant::get_GL_INDEX_CLEAR_VALUE(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_RENDER(void)
 {
-  return JOGLConstant::get_GL_RENDER(getScilabJavaVM());
+    return JOGLConstant::get_GL_RENDER(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_VIEWPORT(void)
 {
-  return JOGLConstant::get_GL_VIEWPORT(getScilabJavaVM());
+    return JOGLConstant::get_GL_VIEWPORT(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_BLEND(void)
 {
-  return JOGLConstant::get_GL_BLEND(getScilabJavaVM());
+    return JOGLConstant::get_GL_BLEND(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_BLEND_SRC(void)
 {
-  return JOGLConstant::get_GL_BLEND_SRC(getScilabJavaVM());
+    return JOGLConstant::get_GL_BLEND_SRC(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_BLEND_DST(void)
 {
-  return JOGLConstant::get_GL_BLEND_DST(getScilabJavaVM());
+    return JOGLConstant::get_GL_BLEND_DST(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_3D_COLOR(void)
 {
-  return JOGLConstant::get_GL_3D_COLOR(getScilabJavaVM());
+    return JOGLConstant::get_GL_3D_COLOR(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_FLOAT(void)
 {
-  return JOGLConstant::get_GL_FLOAT(getScilabJavaVM());
+    return JOGLConstant::get_GL_FLOAT(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 /* Calixte */
 int joglGL_UNSIGNED_BYTE(void)
 {
-  return JOGLConstant::get_GL_UNSIGNED_BYTE(getScilabJavaVM());
+    return JOGLConstant::get_GL_UNSIGNED_BYTE(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_POINTS(void)
 {
-  return JOGLConstant::get_GL_POINTS(getScilabJavaVM());
+    return JOGLConstant::get_GL_POINTS(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_POLYGON_OFFSET_FACTOR(void)
 {
-  return JOGLConstant::get_GL_POLYGON_OFFSET_FACTOR(getScilabJavaVM());
+    return JOGLConstant::get_GL_POLYGON_OFFSET_FACTOR(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_POLYGON_OFFSET_UNITS(void)
 {
-  return JOGLConstant::get_GL_POLYGON_OFFSET_UNITS(getScilabJavaVM());
+    return JOGLConstant::get_GL_POLYGON_OFFSET_UNITS(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_LINE_STIPPLE_PATTERN(void)
 {
-  return JOGLConstant::get_GL_LINE_STIPPLE_PATTERN(getScilabJavaVM());
+    return JOGLConstant::get_GL_LINE_STIPPLE_PATTERN(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
 int joglGL_LINE_STIPPLE_REPEAT(void)
 {
-  return JOGLConstant::get_GL_LINE_STIPPLE_REPEAT(getScilabJavaVM());
+    return JOGLConstant::get_GL_LINE_STIPPLE_REPEAT(getScilabJavaVM());
 }
+
 /*---------------------------------------------------------------------------------*/
index 38a3c5a..6049379 100644 (file)
@@ -33,16 +33,19 @@ extern "C"
 }
 /*--------------------------------------------------------------------------*/
 static BOOL loadedDep = FALSE;
+
 /*--------------------------------------------------------------------------*/
 using namespace org_scilab_modules_gui_bridge;
+
 /*--------------------------------------------------------------------------*/
 static int sci_toprint_one_rhs(const char *fname);
 static int sci_toprint_two_rhs(const char *fname);
+
 /*--------------------------------------------------------------------------*/
-int sci_toprint(char *fname,unsigned long l)
+int sci_toprint(char *fname, unsigned long l)
 {
-    CheckRhs(1,2);
-    CheckLhs(0,1);
+    CheckRhs(1, 2);
+    CheckLhs(0, 1);
 
     if (!loadedDep)
     {
@@ -60,6 +63,7 @@ int sci_toprint(char *fname,unsigned long l)
     }
     return 0;
 }
+
 /*--------------------------------------------------------------------------*/
 static int sci_toprint_one_rhs(const char *fname)
 {
@@ -67,7 +71,7 @@ static int sci_toprint_one_rhs(const char *fname)
     int *piAddressVarOne = NULL;
 
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
-    if(sciErr.iErr)
+    if (sciErr.iErr)
     {
         printError(&sciErr, 0);
         return 0;
@@ -81,6 +85,7 @@ static int sci_toprint_one_rhs(const char *fname)
         if (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &fileName) == 0)
         {
             char *fullName = getFullFilename(fileName);
+
             freeAllocatedSingleString(fileName);
             if (fullName)
             {
@@ -88,13 +93,14 @@ static int sci_toprint_one_rhs(const char *fname)
                 {
                     try
                     {
-                        iRet = (int)CallScilabBridge::printFile(getScilabJavaVM(), fullName);
+                        iRet = booltoBOOL(CallScilabBridge::printFile(getScilabJavaVM(), fullName));
                     }
-                    catch (const GiwsException::JniException& e)
+                    catch(const GiwsException::JniException & e)
                     {
                         FREE(fullName);
                         fullName = NULL;
-                        Scierror(999,_("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(), e.getJavaExceptionName().c_str());
+                        Scierror(999, _("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(),
+                                 e.getJavaExceptionName().c_str());
                         return 0;
                     }
                 }
@@ -116,7 +122,7 @@ static int sci_toprint_one_rhs(const char *fname)
         }
         else
         {
-            Scierror(999,_("%s: Memory allocation error.\n"), fname);
+            Scierror(999, _("%s: Memory allocation error.\n"), fname);
         }
     }
     else if (isDoubleType(pvApiCtx, piAddressVarOne))
@@ -124,6 +130,7 @@ static int sci_toprint_one_rhs(const char *fname)
         if (isScalar(pvApiCtx, piAddressVarOne))
         {
             double dValue = 0.;
+
             if (!getScalarDouble(pvApiCtx, piAddressVarOne, &dValue))
             {
                 int num_win = (int)dValue;
@@ -131,23 +138,23 @@ static int sci_toprint_one_rhs(const char *fname)
 
                 if (num_win < 0)
                 {
-                    Scierror(999,_("%s: Wrong value for input argument #%d: Non-negative integers expected.\n"), fname);
+                    Scierror(999, _("%s: Wrong value for input argument #%d: Non-negative integers expected.\n"), fname);
                     return 0;
                 }
 
-                if (!sciIsExistingFigure((int) num_win))
+                if (!sciIsExistingFigure((int)num_win))
                 {
-                    Scierror(999, "%s: Figure with figure_id %d does not exist.\n",fname, (int) num_win);
+                    Scierror(999, "%s: Figure with figure_id %d does not exist.\n", fname, (int)num_win);
                     return 0;
                 }
 
                 try
                 {
-                    iRet = (int)CallScilabBridge::printFigure(getScilabJavaVM(), num_win, FALSE, FALSE);
+                    iRet = booltoBOOL(CallScilabBridge::printFigure(getScilabJavaVM(), num_win, FALSE, FALSE));
                 }
-                catch (const GiwsException::JniException& e)
+                catch(const GiwsException::JniException & e)
                 {
-                    Scierror(999,_("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(), e.getJavaExceptionName().c_str());
+                    Scierror(999, _("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(), e.getJavaExceptionName().c_str());
                     return 0;
                 }
 
@@ -157,20 +164,21 @@ static int sci_toprint_one_rhs(const char *fname)
             }
             else
             {
-                Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                Scierror(999, _("%s: Memory allocation error.\n"), fname);
             }
         }
         else
         {
-            Scierror(999,_("%s: Wrong size for input argument #%d: Non-negative integer expected.\n"),fname,1);
+            Scierror(999, _("%s: Wrong size for input argument #%d: Non-negative integer expected.\n"), fname, 1);
         }
     }
     else
     {
-        Scierror(999,_("%s: Wrong type for input argument #%d.\n"), fname, 1);
+        Scierror(999, _("%s: Wrong type for input argument #%d.\n"), fname, 1);
     }
     return 0;
 }
+
 /*--------------------------------------------------------------------------*/
 static int sci_toprint_two_rhs(const char *fname)
 {
@@ -179,14 +187,14 @@ static int sci_toprint_two_rhs(const char *fname)
     int *piAddressVarTwo = NULL;
 
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
-    if(sciErr.iErr)
+    if (sciErr.iErr)
     {
         printError(&sciErr, 0);
         return 0;
     }
 
     sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddressVarTwo);
-    if(sciErr.iErr)
+    if (sciErr.iErr)
     {
         printError(&sciErr, 0);
         return 0;
@@ -207,42 +215,41 @@ static int sci_toprint_two_rhs(const char *fname)
                 int i = 0;
                 char *lines = NULL;
 
-
-                sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne,&mOne, &nOne, NULL, NULL);
-                if(sciErr.iErr)
+                sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &mOne, &nOne, NULL, NULL);
+                if (sciErr.iErr)
                 {
                     printError(&sciErr, 0);
                     return 0;
                 }
 
-                if ( !((mOne == 1) || (nOne == 1)) )
+                if (!((mOne == 1) || (nOne == 1)))
                 {
-                    Scierror(999,_("%s: Wrong size for input argument #%d: A 1-by-n or m-by-1 array expected.\n"), fname, 1);
+                    Scierror(999, _("%s: Wrong size for input argument #%d: A 1-by-n or m-by-1 array expected.\n"), fname, 1);
                     return 0;
                 }
 
                 mnOne = mOne * nOne;
 
-                lenStVarOne = (int*)MALLOC(sizeof(int) * mnOne);
+                lenStVarOne = (int *)MALLOC(sizeof(int) * mnOne);
                 if (lenStVarOne == NULL)
                 {
                     Scierror(999, _("%s: No more memory.\n"), fname);
                     return 0;
                 }
 
-                sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne,&mOne, &nOne, lenStVarOne, NULL);
-                if(sciErr.iErr)
+                sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &mOne, &nOne, lenStVarOne, NULL);
+                if (sciErr.iErr)
                 {
                     printError(&sciErr, 0);
                     return 0;
                 }
 
-                for (i = 0; i <  mnOne; i++)
+                for (i = 0; i < mnOne; i++)
                 {
                     lenLineToPrint = lenLineToPrint + lenStVarOne[i] + (int)strlen("\n") + 1;
                 }
 
-                pStVarOne = (char**) MALLOC(sizeof(char*) * mnOne);
+                pStVarOne = (char **)MALLOC(sizeof(char *) * mnOne);
                 if (pStVarOne == NULL)
                 {
                     FREE(lenStVarOne);
@@ -253,26 +260,34 @@ static int sci_toprint_two_rhs(const char *fname)
 
                 for (i = 0; i < mnOne; i++)
                 {
-                    pStVarOne[i] = (char*)MALLOC(sizeof(char) * (lenStVarOne[i] + 1));
+                    pStVarOne[i] = (char *)MALLOC(sizeof(char) * (lenStVarOne[i] + 1));
                     if (pStVarOne[i] == NULL)
                     {
                         freeArrayOfString(pStVarOne, i);
-                        if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
+                        if (lenStVarOne)
+                        {
+                            FREE(lenStVarOne);
+                            lenStVarOne = NULL;
+                        }
                         Scierror(999, _("%s: No more memory.\n"), fname);
                         return 0;
                     }
                 }
 
                 sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &mOne, &nOne, lenStVarOne, pStVarOne);
-                if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-                if(sciErr.iErr)
+                if (lenStVarOne)
+                {
+                    FREE(lenStVarOne);
+                    lenStVarOne = NULL;
+                }
+                if (sciErr.iErr)
                 {
                     freeArrayOfString(pStVarOne, mnOne);
                     printError(&sciErr, 0);
                     return 0;
                 }
 
-                lines = (char*)MALLOC((lenLineToPrint + 1) * sizeof(char));
+                lines = (char *)MALLOC((lenLineToPrint + 1) * sizeof(char));
                 if (lines == NULL)
                 {
                     freeArrayOfString(pStVarOne, mnOne);
@@ -282,13 +297,13 @@ static int sci_toprint_two_rhs(const char *fname)
 
                 for (i = 0; i < mnOne; i++)
                 {
-                    if (i==0)
+                    if (i == 0)
                     {
                         sprintf(lines, "%s\n", pStVarOne[i]);
                     }
                     else
                     {
-                        sprintf(lines, "%s%s\n", lines,  pStVarOne[i]);
+                        sprintf(lines, "%s%s\n", lines, pStVarOne[i]);
                     }
                 }
                 freeArrayOfString(pStVarOne, mnOne);
@@ -296,12 +311,13 @@ static int sci_toprint_two_rhs(const char *fname)
                 if (getAllocatedSingleString(pvApiCtx, piAddressVarTwo, &pageHeader) == 0)
                 {
                     BOOL iRet = FALSE;
+
                     try
                     {
-                        iRet = (BOOL)CallScilabBridge::printString(getScilabJavaVM(), lines, pageHeader);
+                        iRet = booltoBOOL(CallScilabBridge::printString(getScilabJavaVM(), lines, pageHeader));
                     }
 
-                    catch (const GiwsException::JniException& e)
+                    catch(const GiwsException::JniException & e)
                     {
                         freeAllocatedSingleString(pageHeader);
                         if (lines)
@@ -309,7 +325,8 @@ static int sci_toprint_two_rhs(const char *fname)
                             FREE(lines);
                             lines = NULL;
                         }
-                        Scierror(999,_("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(), e.getJavaExceptionName().c_str());
+                        Scierror(999, _("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(),
+                                 e.getJavaExceptionName().c_str());
                         return 0;
                     }
 
@@ -331,19 +348,19 @@ static int sci_toprint_two_rhs(const char *fname)
                         FREE(lines);
                         lines = NULL;
                     }
-                    Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                    Scierror(999, _("%s: Memory allocation error.\n"), fname);
                     return 0;
                 }
             }
             else
             {
-                Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), fname, 2);
+                Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), fname, 2);
                 return 0;
             }
         }
         else
         {
-            Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 2);
+            Scierror(999, _("%s: Wrong size for input argument #%d: String expected.\n"), fname, 2);
             return 0;
         }
     }
@@ -360,19 +377,19 @@ static int sci_toprint_two_rhs(const char *fname)
 
                 if (num_win < 0)
                 {
-                    Scierror(999,_("%s: Wrong value for input argument #%d: Non-negative integers expected.\n"), fname);
+                    Scierror(999, _("%s: Wrong value for input argument #%d: Non-negative integers expected.\n"), fname);
                     return 0;
                 }
             }
             else
             {
-                Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                Scierror(999, _("%s: Memory allocation error.\n"), fname);
                 return 0;
             }
 
-            if (!sciIsExistingFigure((int) num_win))
+            if (!sciIsExistingFigure((int)num_win))
             {
-                Scierror(999, "%s: Figure with figure_id %d does not exist.\n",fname, (int) num_win);
+                Scierror(999, "%s: Figure with figure_id %d does not exist.\n", fname, (int)num_win);
                 return 0;
             }
 
@@ -383,6 +400,7 @@ static int sci_toprint_two_rhs(const char *fname)
                 if (isScalar(pvApiCtx, piAddressVarTwo))
                 {
                     char *outputType = NULL;
+
                     if (getAllocatedSingleString(pvApiCtx, piAddressVarTwo, &outputType) == 0)
                     {
                         if ((strcmp(outputType, "pos") == 0) || (strcmp(outputType, "gdi") == 0))
@@ -391,16 +409,17 @@ static int sci_toprint_two_rhs(const char *fname)
                             {
                                 if (strcmp(outputType, "pos") == 0)
                                 {
-                                    iRet = (BOOL)CallScilabBridge::printFigure(getScilabJavaVM(), num_win, TRUE, FALSE);
+                                    iRet = booltoBOOL(CallScilabBridge::printFigure(getScilabJavaVM(), num_win, TRUE, FALSE));
                                 }
                                 else
                                 {
-                                    iRet = (BOOL)(int)CallScilabBridge::printFigure(getScilabJavaVM(), num_win, FALSE, FALSE);
+                                    iRet = booltoBOOL((int)CallScilabBridge::printFigure(getScilabJavaVM(), num_win, FALSE, FALSE));
                                 }
                             }
-                            catch (const GiwsException::JniException& e)
+                            catch(const GiwsException::JniException & e)
                             {
-                                Scierror(999,_("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(), e.getJavaExceptionName().c_str());
+                                Scierror(999, _("%s: An exception occurred: %s\n%s\n"), fname, e.getJavaDescription().c_str(),
+                                         e.getJavaExceptionName().c_str());
                                 freeAllocatedSingleString(outputType);
                                 return 0;
                             }
@@ -411,34 +430,35 @@ static int sci_toprint_two_rhs(const char *fname)
                         }
                         else
                         {
-                            Scierror(999,_("%s: Wrong input argument #%d: '%s' or '%s' expected.\n"), fname, 2, "pos", "gdi");
+                            Scierror(999, _("%s: Wrong input argument #%d: '%s' or '%s' expected.\n"), fname, 2, "pos", "gdi");
                         }
                         freeAllocatedSingleString(outputType);
                     }
                     else
                     {
-                        Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                        Scierror(999, _("%s: Memory allocation error.\n"), fname);
                     }
                 }
                 else
                 {
-                    Scierror(999,_("%s: Wrong size for input argument #%d: 'pos' or 'gdi' value expected.\n"), fname, 2);
+                    Scierror(999, _("%s: Wrong size for input argument #%d: 'pos' or 'gdi' value expected.\n"), fname, 2);
                 }
             }
             else
             {
-                Scierror(999,_("%s: Wrong type for input argument #%d.\n"), fname, 2);
+                Scierror(999, _("%s: Wrong type for input argument #%d.\n"), fname, 2);
             }
         }
         else
         {
-            Scierror(999,_("%s: Wrong size for input argument #%d: Non-negative integer expected.\n"), fname, 1);
+            Scierror(999, _("%s: Wrong size for input argument #%d: Non-negative integer expected.\n"), fname, 1);
         }
     }
     else
     {
-        Scierror(999,_("%s: Wrong type for input argument #%d.\n"), fname, 1);
+        Scierror(999, _("%s: Wrong type for input argument #%d.\n"), fname, 1);
     }
     return 0;
 }
+
 /*--------------------------------------------------------------------------*/
index c674ac3..35b506e 100644 (file)
@@ -16,50 +16,50 @@ using namespace org_scilab_modules_gui_bridge;
 
 int createFontChooser()
 {
-  return CallScilabBridge::newFontChooser(getScilabJavaVM());
+    return CallScilabBridge::newFontChooser(getScilabJavaVM());
 }
 
 void setFontChooserFontName(int fontChooserID, char *fontName)
 {
-  CallScilabBridge::setFontChooserFontName(getScilabJavaVM(), fontChooserID, fontName);
+    CallScilabBridge::setFontChooserFontName(getScilabJavaVM(), fontChooserID, fontName);
 }
 
 void setFontChooserFontSize(int fontChooserID, int fontSize)
 {
-  CallScilabBridge::setFontChooserFontSize(getScilabJavaVM(), fontChooserID, fontSize);
+    CallScilabBridge::setFontChooserFontSize(getScilabJavaVM(), fontChooserID, fontSize);
 }
 
 void setFontChooserBold(int fontChooserID, BOOL bold)
 {
-  CallScilabBridge::setFontChooserBold(getScilabJavaVM(), fontChooserID, BOOLtobool(bold));
+    CallScilabBridge::setFontChooserBold(getScilabJavaVM(), fontChooserID, BOOLtobool(bold));
 }
 
 void setFontChooserItalic(int fontChooserID, BOOL italic)
 {
-  CallScilabBridge::setFontChooserItalic(getScilabJavaVM(), fontChooserID, BOOLtobool(italic));
+    CallScilabBridge::setFontChooserItalic(getScilabJavaVM(), fontChooserID, BOOLtobool(italic));
 }
 
 void fontChooserDisplayAndWait(int fontChooserID)
 {
-  CallScilabBridge::fontChooserDisplayAndWait(getScilabJavaVM(), fontChooserID);
+    CallScilabBridge::fontChooserDisplayAndWait(getScilabJavaVM(), fontChooserID);
 }
 
 char *getFontChooserFontName(int fontChooserID)
 {
-  return CallScilabBridge::getFontChooserFontName(getScilabJavaVM(), fontChooserID);
+    return CallScilabBridge::getFontChooserFontName(getScilabJavaVM(), fontChooserID);
 }
 
 int getFontChooserFontSize(int fontChooserID)
 {
-  return CallScilabBridge::getFontChooserFontSize(getScilabJavaVM(), fontChooserID);
+    return CallScilabBridge::getFontChooserFontSize(getScilabJavaVM(), fontChooserID);
 }
 
 BOOL getFontChooserBold(int fontChooserID)
 {
-  return CallScilabBridge::getFontChooserBold(getScilabJavaVM(), fontChooserID);
+    return booltoBOOL(CallScilabBridge::getFontChooserBold(getScilabJavaVM(), fontChooserID));
 }
 
 BOOL getFontChooserItalic(int fontChooserID)
 {
-  return CallScilabBridge::getFontChooserItalic(getScilabJavaVM(), fontChooserID);
+    return booltoBOOL(CallScilabBridge::getFontChooserItalic(getScilabJavaVM(), fontChooserID));
 }
index 50b6f5e..f4bee0f 100644 (file)
@@ -16,10 +16,10 @@ using namespace org_scilab_modules_gui_bridge;
 
 void setToolbarVisible(int figNum, BOOL status)
 {
-  CallScilabBridge::setToolbarVisible(getScilabJavaVM(), figNum, BOOLtobool(status));
+    CallScilabBridge::setToolbarVisible(getScilabJavaVM(), figNum, BOOLtobool(status));
 }
 
 BOOL isToolbarVisible(int figNum)
 {
-  return CallScilabBridge::isToolbarVisible(getScilabJavaVM(), figNum);
+    return booltoBOOL(CallScilabBridge::isToolbarVisible(getScilabJavaVM(), figNum));
 }
index f95dfc8..3a0909f 100644 (file)
@@ -22,178 +22,200 @@ extern "C"
 #include "BasicAlgos.h"
 }
 
-using namespace sciGraphics ;
+using namespace sciGraphics;
 
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaColormap( sciPointObj * pFigure, double rgbMat[] )
+void sciGetJavaColormap(sciPointObj * pFigure, double rgbMat[])
 {
-  getFigureDrawer(pFigure)->getColorMap( rgbMat ) ;
+    getFigureDrawer(pFigure)->getColorMap(rgbMat);
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaFigureSize( sciPointObj * pFigure, int size[2] )
+void sciGetJavaFigureSize(sciPointObj * pFigure, int size[2])
 {
-  getFigureDrawer(pFigure)->getSize(size) ;
+    getFigureDrawer(pFigure)->getSize(size);
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaWindowSize( sciPointObj * pFigure, int size[2] )
+void sciGetJavaWindowSize(sciPointObj * pFigure, int size[2])
 {
-  getFigureDrawer(pFigure)->getWindowSize(size) ;
+    getFigureDrawer(pFigure)->getWindowSize(size);
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaWindowPosition( sciPointObj * pFigure, int pos[2] )
+void sciGetJavaWindowPosition(sciPointObj * pFigure, int pos[2])
 {
-  getFigureDrawer(pFigure)->getWindowPosition(pos) ;
+    getFigureDrawer(pFigure)->getWindowPosition(pos);
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaInfoMessage(sciPointObj * pFigure, char * infoMessage)
+void sciGetJavaInfoMessage(sciPointObj * pFigure, char *infoMessage)
 {
-       getFigureDrawer(pFigure)->getInfoMessage(infoMessage);
+    getFigureDrawer(pFigure)->getInfoMessage(infoMessage);
 }
+
 /*---------------------------------------------------------------------------------*/
 int sciGetJavaInfoMessageLength(sciPointObj * pFigure)
 {
-       return getFigureDrawer(pFigure)->getInfoMessageLength();
+    return getFigureDrawer(pFigure)->getInfoMessageLength();
 }
+
 /*---------------------------------------------------------------------------------*/
 int sciGetJavaAntialiasingQuality(sciPointObj * pFigure)
 {
-       return getFigureDrawer(pFigure)->getAntialiasingQuality();
+    return getFigureDrawer(pFigure)->getAntialiasingQuality();
 }
+
 /*---------------------------------------------------------------------------------*/
 void sciGetJavaPixelCoordinates(sciPointObj * pSubwin, const double userCoord[3], int pixCoord[2])
 {
-  getSubwinDrawer(pSubwin)->getCamera()->getPixelCoordinates(userCoord, pixCoord);
+    getSubwinDrawer(pSubwin)->getCamera()->getPixelCoordinates(userCoord, pixCoord);
 }
+
 /*---------------------------------------------------------------------------------*/
 void sciGetJava2dViewPixelCoordinates(sciPointObj * pSubwin, const double userCoord[3], int pixCoord[2])
 {
-   getSubwinDrawer(pSubwin)->getCamera()->get2dViewPixelCoordinates(userCoord, pixCoord);
+    getSubwinDrawer(pSubwin)->getCamera()->get2dViewPixelCoordinates(userCoord, pixCoord);
 }
+
 /*---------------------------------------------------------------------------------*/
 void sciGetJava2dViewCoordinates(sciPointObj * pSubwin, const double userCoords3D[3], double userCoords2D[2])
 {
-  getSubwinDrawer(pSubwin)->getCamera()->get2dViewCoordinates(userCoords3D, userCoords2D);
+    getSubwinDrawer(pSubwin)->getCamera()->get2dViewCoordinates(userCoords3D, userCoords2D);
 }
+
 /*---------------------------------------------------------------------------------*/
 void sciGetJava2dViewCoordFromPixel(sciPointObj * pSubwin, const int pixCoords[2], double userCoords2D[2])
 {
-  getSubwinDrawer(pSubwin)->getCamera()->get2dViewCoordinates(pixCoords, userCoords2D);
+    getSubwinDrawer(pSubwin)->getCamera()->get2dViewCoordinates(pixCoords, userCoords2D);
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaBoundingBox(sciPointObj * pText, double corner1[3], double corner2[3],
-                           double corner3[3], double corner4[3])
+void sciGetJavaBoundingBox(sciPointObj * pText, double corner1[3], double corner2[3], double corner3[3], double corner4[3])
 {
-  getTextDrawer(pText)->getBoundingRectangle(corner1, corner2, corner3, corner4);
+    getTextDrawer(pText)->getBoundingRectangle(corner1, corner2, corner3, corner4);
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaPixelBoundingBox(sciPointObj * pText, int corner1[2], int corner2[2],
-                                int corner3[2], int corner4[2])
+void sciGetJavaPixelBoundingBox(sciPointObj * pText, int corner1[2], int corner2[2], int corner3[2], int corner4[2])
 {
-  getTextDrawer(pText)->getScreenBoundingBox(corner1, corner2, corner3, corner4);
+    getTextDrawer(pText)->getScreenBoundingBox(corner1, corner2, corner3, corner4);
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaViewingArea(sciPointObj * pSubwin, int * xPos, int * yPos,
-                           int * width, int * height)
+void sciGetJavaViewingArea(sciPointObj * pSubwin, int *xPos, int *yPos, int *width, int *height)
 {
-  getSubwinDrawer(pSubwin)->getCamera()->getViewingArea(xPos, yPos, width, height);
+    getSubwinDrawer(pSubwin)->getCamera()->getViewingArea(xPos, yPos, width, height);
 }
+
 /*---------------------------------------------------------------------------------*/
 void sciGetJavaSegsBoundingBox(sciPointObj * pSegs, double bounds[6])
 {
-  getSegsDrawer(pSegs)->getBoundingBox(bounds);
+    getSegsDrawer(pSegs)->getBoundingBox(bounds);
 }
+
 /*---------------------------------------------------------------------------------*/
 BOOL sciGetJavaAutoResizeMode(sciPointObj * pFigure)
 {
- if (getFigureDrawer(pFigure)->getAutoResizeMode())
- {
-   return TRUE;
- }
- else
- {
-   return FALSE;
- }
+    if (getFigureDrawer(pFigure)->getAutoResizeMode())
+    {
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
+
 /*---------------------------------------------------------------------------------*/
 void sciGetJavaViewport(sciPointObj * pFigure, int viewport[4])
 {
-  getFigureDrawer(pFigure)->getViewport(viewport);
+    getFigureDrawer(pFigure)->getViewport(viewport);
 }
+
 /*---------------------------------------------------------------------------------*/
 void sciGetJavaNbSubticks(sciPointObj * pSubwin, double nbsubtics[3])
 {
-  getSubwinDrawer(pSubwin)->getNbSubticksPerGrad( nbsubtics );
+    getSubwinDrawer(pSubwin)->getNbSubticksPerGrad(nbsubtics);
 }
+
 /*---------------------------------------------------------------------------------*/
 int sciGetJavaNbXTicks(sciPointObj * pSubwin)
 {
-  return getSubwinDrawer(pSubwin)->getNbXTicks();
+    return getSubwinDrawer(pSubwin)->getNbXTicks();
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaXTicksPos(sciPointObj * pSubwin, double ticksPos[], char ** ticksLabels)
+void sciGetJavaXTicksPos(sciPointObj * pSubwin, double ticksPos[], char **ticksLabels)
 {
-  // ticksLabels comes from graphics so is allocated with MALLOC
-  // however getTicksPos will use new to allocate
-  int nbTicks = sciGetJavaNbXTicks(pSubwin);
-  char ** javaLabels = BasicAlgos::createStringArray(nbTicks);
-  
-  getSubwinDrawer(pSubwin)->getXTicksPos(ticksPos, javaLabels);
+    // ticksLabels comes from graphics so is allocated with MALLOC
+    // however getTicksPos will use new to allocate
+    int nbTicks = sciGetJavaNbXTicks(pSubwin);
+    char **javaLabels = BasicAlgos::createStringArray(nbTicks);
+
+    getSubwinDrawer(pSubwin)->getXTicksPos(ticksPos, javaLabels);
 
-  // copy it into ticksLabels
-  stringArrayCopy(ticksLabels, javaLabels, nbTicks);
+    // copy it into ticksLabels
+    stringArrayCopy(ticksLabels, javaLabels, nbTicks);
 
-  BasicAlgos::destroyStringArray(javaLabels, nbTicks);
+    BasicAlgos::destroyStringArray(javaLabels, nbTicks);
 }
+
 /*---------------------------------------------------------------------------------*/
 int sciGetJavaNbYTicks(sciPointObj * pSubwin)
 {
-  return getSubwinDrawer(pSubwin)->getNbYTicks();
+    return getSubwinDrawer(pSubwin)->getNbYTicks();
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaYTicksPos(sciPointObj * pSubwin, double ticksPos[], char ** ticksLabels)
+void sciGetJavaYTicksPos(sciPointObj * pSubwin, double ticksPos[], char **ticksLabels)
 {
-  // ticksLabels comes from graphics so is allocated with MALLOC
-  // however getTicksPos will use new to allocate
-  int nbTicks = sciGetJavaNbYTicks(pSubwin);
-  char ** javaLabels = BasicAlgos::createStringArray(nbTicks);
-  
-  getSubwinDrawer(pSubwin)->getYTicksPos(ticksPos, javaLabels);
+    // ticksLabels comes from graphics so is allocated with MALLOC
+    // however getTicksPos will use new to allocate
+    int nbTicks = sciGetJavaNbYTicks(pSubwin);
+    char **javaLabels = BasicAlgos::createStringArray(nbTicks);
+
+    getSubwinDrawer(pSubwin)->getYTicksPos(ticksPos, javaLabels);
 
-  // copy it into ticksLabels
-  stringArrayCopy(ticksLabels, javaLabels, nbTicks);
+    // copy it into ticksLabels
+    stringArrayCopy(ticksLabels, javaLabels, nbTicks);
 
-  BasicAlgos::destroyStringArray(javaLabels, nbTicks);
+    BasicAlgos::destroyStringArray(javaLabels, nbTicks);
 }
+
 /*---------------------------------------------------------------------------------*/
 int sciGetJavaNbZTicks(sciPointObj * pSubwin)
 {
-  return getSubwinDrawer(pSubwin)->getNbZTicks();
+    return getSubwinDrawer(pSubwin)->getNbZTicks();
 }
+
 /*---------------------------------------------------------------------------------*/
-void sciGetJavaZTicksPos(sciPointObj * pSubwin, double ticksPos[], char ** ticksLabels)
+void sciGetJavaZTicksPos(sciPointObj * pSubwin, double ticksPos[], char **ticksLabels)
 {
-  // ticksLabels comes from graphics so is allocated with MALLOC
-  // however getTicksPos will use new to allocate
-  int nbTicks = sciGetJavaNbZTicks(pSubwin);
-  char ** javaLabels = BasicAlgos::createStringArray(nbTicks);
-  
-  getSubwinDrawer(pSubwin)->getZTicksPos(ticksPos, javaLabels);
+    // ticksLabels comes from graphics so is allocated with MALLOC
+    // however getTicksPos will use new to allocate
+    int nbTicks = sciGetJavaNbZTicks(pSubwin);
+    char **javaLabels = BasicAlgos::createStringArray(nbTicks);
 
-  // copy it into ticksLabels
-  stringArrayCopy(ticksLabels, javaLabels, nbTicks);
+    getSubwinDrawer(pSubwin)->getZTicksPos(ticksPos, javaLabels);
 
-  BasicAlgos::destroyStringArray(javaLabels, nbTicks);
+    // copy it into ticksLabels
+    stringArrayCopy(ticksLabels, javaLabels, nbTicks);
+
+    BasicAlgos::destroyStringArray(javaLabels, nbTicks);
 }
+
 /*---------------------------------------------------------------------------------*/
 BOOL sciGetJavaIsAbleToCreateWindow(void)
 {
-  if (DrawableFigure::isAbleToCreateFigure())
-  {
-    return true;
-  }
-  else
-  {
-    return false;
-  }
+    if (DrawableFigure::isAbleToCreateFigure())
+    {
+        return booltoBOOL(true);
+    }
+    else
+    {
+        return booltoBOOL(false);
+    }
 }
+
 /*---------------------------------------------------------------------------------*/