summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2006-07-05 16:31:12 +0000
committerFelipe Heidrich <fheidric>2006-07-05 16:31:12 +0000
commit7f9fed93a58407b1534210fdee982a8ba5e1eacf (patch)
treefb5b2d2dbd070ca43fe4c01c59968f2741fc2fa6 /bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c
parent0054e44bae79888fe8fb634f4b01c2321d00ad18 (diff)
downloadeclipse.platform.swt-7f9fed93a58407b1534210fdee982a8ba5e1eacf.tar.gz
eclipse.platform.swt-7f9fed93a58407b1534210fdee982a8ba5e1eacf.tar.xz
eclipse.platform.swt-7f9fed93a58407b1534210fdee982a8ba5e1eacf.zip
fixing structures
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c76
1 files changed, 61 insertions, 15 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c
index 4eaa020d1c..4e9e9f6a07 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_structs.c
@@ -35,33 +35,33 @@ void cachecairo_font_extents_tFields(JNIEnv *env, jobject lpObject)
{
if (cairo_font_extents_tFc.cached) return;
cairo_font_extents_tFc.clazz = (*env)->GetObjectClass(env, lpObject);
- cairo_font_extents_tFc.ascent = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "ascent", "F");
- cairo_font_extents_tFc.descent = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "descent", "F");
- cairo_font_extents_tFc.height = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "height", "F");
- cairo_font_extents_tFc.max_x_advance = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "max_x_advance", "F");
- cairo_font_extents_tFc.max_y_advance = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "max_y_advance", "F");
+ cairo_font_extents_tFc.ascent = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "ascent", "D");
+ cairo_font_extents_tFc.descent = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "descent", "D");
+ cairo_font_extents_tFc.height = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "height", "D");
+ cairo_font_extents_tFc.max_x_advance = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "max_x_advance", "D");
+ cairo_font_extents_tFc.max_y_advance = (*env)->GetFieldID(env, cairo_font_extents_tFc.clazz, "max_y_advance", "D");
cairo_font_extents_tFc.cached = 1;
}
cairo_font_extents_t *getcairo_font_extents_tFields(JNIEnv *env, jobject lpObject, cairo_font_extents_t *lpStruct)
{
if (!cairo_font_extents_tFc.cached) cachecairo_font_extents_tFields(env, lpObject);
- lpStruct->ascent = (*env)->GetFloatField(env, lpObject, cairo_font_extents_tFc.ascent);
- lpStruct->descent = (*env)->GetFloatField(env, lpObject, cairo_font_extents_tFc.descent);
- lpStruct->height = (*env)->GetFloatField(env, lpObject, cairo_font_extents_tFc.height);
- lpStruct->max_x_advance = (*env)->GetFloatField(env, lpObject, cairo_font_extents_tFc.max_x_advance);
- lpStruct->max_y_advance = (*env)->GetFloatField(env, lpObject, cairo_font_extents_tFc.max_y_advance);
+ lpStruct->ascent = (*env)->GetDoubleField(env, lpObject, cairo_font_extents_tFc.ascent);
+ lpStruct->descent = (*env)->GetDoubleField(env, lpObject, cairo_font_extents_tFc.descent);
+ lpStruct->height = (*env)->GetDoubleField(env, lpObject, cairo_font_extents_tFc.height);
+ lpStruct->max_x_advance = (*env)->GetDoubleField(env, lpObject, cairo_font_extents_tFc.max_x_advance);
+ lpStruct->max_y_advance = (*env)->GetDoubleField(env, lpObject, cairo_font_extents_tFc.max_y_advance);
return lpStruct;
}
void setcairo_font_extents_tFields(JNIEnv *env, jobject lpObject, cairo_font_extents_t *lpStruct)
{
if (!cairo_font_extents_tFc.cached) cachecairo_font_extents_tFields(env, lpObject);
- (*env)->SetFloatField(env, lpObject, cairo_font_extents_tFc.ascent, (jfloat)lpStruct->ascent);
- (*env)->SetFloatField(env, lpObject, cairo_font_extents_tFc.descent, (jfloat)lpStruct->descent);
- (*env)->SetFloatField(env, lpObject, cairo_font_extents_tFc.height, (jfloat)lpStruct->height);
- (*env)->SetFloatField(env, lpObject, cairo_font_extents_tFc.max_x_advance, (jfloat)lpStruct->max_x_advance);
- (*env)->SetFloatField(env, lpObject, cairo_font_extents_tFc.max_y_advance, (jfloat)lpStruct->max_y_advance);
+ (*env)->SetDoubleField(env, lpObject, cairo_font_extents_tFc.ascent, (jdouble)lpStruct->ascent);
+ (*env)->SetDoubleField(env, lpObject, cairo_font_extents_tFc.descent, (jdouble)lpStruct->descent);
+ (*env)->SetDoubleField(env, lpObject, cairo_font_extents_tFc.height, (jdouble)lpStruct->height);
+ (*env)->SetDoubleField(env, lpObject, cairo_font_extents_tFc.max_x_advance, (jdouble)lpStruct->max_x_advance);
+ (*env)->SetDoubleField(env, lpObject, cairo_font_extents_tFc.max_y_advance, (jdouble)lpStruct->max_y_advance);
}
#endif
@@ -136,3 +136,49 @@ void setcairo_path_tFields(JNIEnv *env, jobject lpObject, cairo_path_t *lpStruct
}
#endif
+#ifndef NO_cairo_text_extents_t
+typedef struct cairo_text_extents_t_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID x_bearing, y_bearing, width, height, x_advance, y_advance;
+} cairo_text_extents_t_FID_CACHE;
+
+cairo_text_extents_t_FID_CACHE cairo_text_extents_tFc;
+
+void cachecairo_text_extents_tFields(JNIEnv *env, jobject lpObject)
+{
+ if (cairo_text_extents_tFc.cached) return;
+ cairo_text_extents_tFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ cairo_text_extents_tFc.x_bearing = (*env)->GetFieldID(env, cairo_text_extents_tFc.clazz, "x_bearing", "D");
+ cairo_text_extents_tFc.y_bearing = (*env)->GetFieldID(env, cairo_text_extents_tFc.clazz, "y_bearing", "D");
+ cairo_text_extents_tFc.width = (*env)->GetFieldID(env, cairo_text_extents_tFc.clazz, "width", "D");
+ cairo_text_extents_tFc.height = (*env)->GetFieldID(env, cairo_text_extents_tFc.clazz, "height", "D");
+ cairo_text_extents_tFc.x_advance = (*env)->GetFieldID(env, cairo_text_extents_tFc.clazz, "x_advance", "D");
+ cairo_text_extents_tFc.y_advance = (*env)->GetFieldID(env, cairo_text_extents_tFc.clazz, "y_advance", "D");
+ cairo_text_extents_tFc.cached = 1;
+}
+
+cairo_text_extents_t *getcairo_text_extents_tFields(JNIEnv *env, jobject lpObject, cairo_text_extents_t *lpStruct)
+{
+ if (!cairo_text_extents_tFc.cached) cachecairo_text_extents_tFields(env, lpObject);
+ lpStruct->x_bearing = (*env)->GetDoubleField(env, lpObject, cairo_text_extents_tFc.x_bearing);
+ lpStruct->y_bearing = (*env)->GetDoubleField(env, lpObject, cairo_text_extents_tFc.y_bearing);
+ lpStruct->width = (*env)->GetDoubleField(env, lpObject, cairo_text_extents_tFc.width);
+ lpStruct->height = (*env)->GetDoubleField(env, lpObject, cairo_text_extents_tFc.height);
+ lpStruct->x_advance = (*env)->GetDoubleField(env, lpObject, cairo_text_extents_tFc.x_advance);
+ lpStruct->y_advance = (*env)->GetDoubleField(env, lpObject, cairo_text_extents_tFc.y_advance);
+ return lpStruct;
+}
+
+void setcairo_text_extents_tFields(JNIEnv *env, jobject lpObject, cairo_text_extents_t *lpStruct)
+{
+ if (!cairo_text_extents_tFc.cached) cachecairo_text_extents_tFields(env, lpObject);
+ (*env)->SetDoubleField(env, lpObject, cairo_text_extents_tFc.x_bearing, (jdouble)lpStruct->x_bearing);
+ (*env)->SetDoubleField(env, lpObject, cairo_text_extents_tFc.y_bearing, (jdouble)lpStruct->y_bearing);
+ (*env)->SetDoubleField(env, lpObject, cairo_text_extents_tFc.width, (jdouble)lpStruct->width);
+ (*env)->SetDoubleField(env, lpObject, cairo_text_extents_tFc.height, (jdouble)lpStruct->height);
+ (*env)->SetDoubleField(env, lpObject, cairo_text_extents_tFc.x_advance, (jdouble)lpStruct->x_advance);
+ (*env)->SetDoubleField(env, lpObject, cairo_text_extents_tFc.y_advance, (jdouble)lpStruct->y_advance);
+}
+#endif
+