[cairo-commit] CairoJava/jni CairoException.cpp,1.1,1.2

Soorya Kuloor commit at pdx.freedesktop.org
Tue May 11 12:50:37 PDT 2004


Committed by: skuloor

Update of /cvs/cairo/CairoJava/jni
In directory pdx:/tmp/cvs-serv704/jni

Modified Files:
	CairoException.cpp 
Log Message:
Changed the native method to take cairo_status_t as argument

Index: CairoException.cpp
===================================================================
RCS file: /cvs/cairo/CairoJava/jni/CairoException.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/CairoException.cpp	30 Apr 2004 17:47:39 -0000	1.1
--- b/CairoException.cpp	11 May 2004 19:50:35 -0000	1.2
***************
*** 25,29 ****
   * SOFTWARE.
   */
- #include <cairo.h>
  #include "CairoException.h"
  #include "utils.h"
--- 25,28 ----
***************
*** 35,41 ****
   */
  JNIEXPORT jstring JNICALL Java_org_cairographics_cairo_CairoException_cairo_1status_1string
! (JNIEnv * env, jclass me, jlong crp)
  {
!     return env->NewStringUTF(cairo_status_string(TO_PTR(cairo_t, crp)));
  }
  
--- 34,60 ----
   */
  JNIEXPORT jstring JNICALL Java_org_cairographics_cairo_CairoException_cairo_1status_1string
! (JNIEnv * env, jclass me, jshort status)
  {
!     const char* msg = "<unknown error status>";
!     switch (status) {
!         case CAIRO_STATUS_SUCCESS:
!             msg = "success";
!         case CAIRO_STATUS_NO_MEMORY:
!             msg = "out of memory";
!         case CAIRO_STATUS_INVALID_RESTORE:
! 	msg = "cairo_restore without matching cairo_save";
!         case CAIRO_STATUS_INVALID_POP_GROUP:
!             msg = "cairo_pop_group without matching cairo_push_group";
!         case CAIRO_STATUS_NO_CURRENT_POINT:
!             msg = "no current point defined";
!         case CAIRO_STATUS_INVALID_MATRIX:
!             msg = "invalid matrix (not invertible)";
!         case CAIRO_STATUS_NO_TARGET_SURFACE:
!             msg = "no target surface has been set";
!         case CAIRO_STATUS_NULL_POINTER:
!             msg = "NULL pointer";
!     }
! 
!     return env->NewStringUTF(msg);
  }
  





More information about the cairo-commit mailing list