View | Details | Raw Unified | Return to bug 96394 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT PI/cocoa/library/os.c (+479 lines)
Lines 890-895 Link Here
890
}
890
}
891
#endif
891
#endif
892
892
893
#ifndef NO_CFArrayGetCount
894
JNIEXPORT jintLong JNICALL OS_NATIVE(CFArrayGetCount)
895
	(JNIEnv *env, jclass that, jint arg0)
896
{
897
	jintLong rc = 0;
898
	OS_NATIVE_ENTER(env, that, CFArrayGetCount_FUNC);
899
	rc = (jintLong)CFArrayGetCount((CFArrayRef)arg0);
900
	OS_NATIVE_EXIT(env, that, CFArrayGetCount_FUNC);
901
	return rc;
902
}
903
#endif
904
905
#ifndef NO_CFArrayGetValueAtIndex
906
JNIEXPORT jintLong JNICALL OS_NATIVE(CFArrayGetValueAtIndex)
907
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
908
{
909
	jintLong rc = 0;
910
	OS_NATIVE_ENTER(env, that, CFArrayGetValueAtIndex_FUNC);
911
	rc = (jintLong)CFArrayGetValueAtIndex((CFArrayRef)arg0, (CFIndex)arg1);
912
	OS_NATIVE_EXIT(env, that, CFArrayGetValueAtIndex_FUNC);
913
	return rc;
914
}
915
#endif
916
893
#ifndef NO_CFAttributedStringCreate
917
#ifndef NO_CFAttributedStringCreate
894
JNIEXPORT jintLong JNICALL OS_NATIVE(CFAttributedStringCreate)
918
JNIEXPORT jintLong JNICALL OS_NATIVE(CFAttributedStringCreate)
895
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
919
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
Lines 948-953 Link Here
948
}
972
}
949
#endif
973
#endif
950
974
975
#ifndef NO_CFNumberCreate
976
JNIEXPORT jintLong JNICALL OS_NATIVE(CFNumberCreate)
977
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintArray arg2)
978
{
979
	jint *lparg2=NULL;
980
	jintLong rc = 0;
981
	OS_NATIVE_ENTER(env, that, CFNumberCreate_FUNC);
982
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
983
	rc = (jintLong)CFNumberCreate((CFAllocatorRef)arg0, (CFNumberType)arg1, (const void *)lparg2);
984
fail:
985
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
986
	OS_NATIVE_EXIT(env, that, CFNumberCreate_FUNC);
987
	return rc;
988
}
989
#endif
990
991
#ifndef NO_CFNumberGetValue
992
JNIEXPORT jboolean JNICALL OS_NATIVE(CFNumberGetValue)
993
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintArray arg2)
994
{
995
	jint *lparg2=NULL;
996
	jboolean rc = 0;
997
	OS_NATIVE_ENTER(env, that, CFNumberGetValue_FUNC);
998
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
999
	rc = (jboolean)CFNumberGetValue((CFNumberRef)arg0, (CFNumberType)arg1, (void *)lparg2);
1000
fail:
1001
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
1002
	OS_NATIVE_EXIT(env, that, CFNumberGetValue_FUNC);
1003
	return rc;
1004
}
1005
#endif
1006
951
#ifndef NO_CFRange_1sizeof
1007
#ifndef NO_CFRange_1sizeof
952
JNIEXPORT jint JNICALL OS_NATIVE(CFRange_1sizeof)
1008
JNIEXPORT jint JNICALL OS_NATIVE(CFRange_1sizeof)
953
	(JNIEnv *env, jclass that)
1009
	(JNIEnv *env, jclass that)
Lines 4320-4325 Link Here
4320
}
4376
}
4321
#endif
4377
#endif
4322
4378
4379
#ifndef NO_NSPrintPagesAcross
4380
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPagesAcross)
4381
	(JNIEnv *env, jclass that)
4382
{
4383
	jintLong rc = 0;
4384
	OS_NATIVE_ENTER(env, that, NSPrintPagesAcross_FUNC);
4385
	rc = (jintLong)NSPrintPagesAcross;
4386
	OS_NATIVE_EXIT(env, that, NSPrintPagesAcross_FUNC);
4387
	return rc;
4388
}
4389
#endif
4390
4391
#ifndef NO_NSPrintPagesDown
4392
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPagesDown)
4393
	(JNIEnv *env, jclass that)
4394
{
4395
	jintLong rc = 0;
4396
	OS_NATIVE_ENTER(env, that, NSPrintPagesDown_FUNC);
4397
	rc = (jintLong)NSPrintPagesDown;
4398
	OS_NATIVE_EXIT(env, that, NSPrintPagesDown_FUNC);
4399
	return rc;
4400
}
4401
#endif
4402
4323
#ifndef NO_NSPrintPreviewJob
4403
#ifndef NO_NSPrintPreviewJob
4324
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPreviewJob)
4404
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPreviewJob)
4325
	(JNIEnv *env, jclass that)
4405
	(JNIEnv *env, jclass that)
Lines 4332-4337 Link Here
4332
}
4412
}
4333
#endif
4413
#endif
4334
4414
4415
#ifndef NO_NSPrintPrinterName
4416
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPrinterName)
4417
	(JNIEnv *env, jclass that)
4418
{
4419
	jintLong rc = 0;
4420
	OS_NATIVE_ENTER(env, that, NSPrintPrinterName_FUNC);
4421
	rc = (jintLong)NSPrintPrinterName;
4422
	OS_NATIVE_EXIT(env, that, NSPrintPrinterName_FUNC);
4423
	return rc;
4424
}
4425
#endif
4426
4335
#ifndef NO_NSPrintSaveJob
4427
#ifndef NO_NSPrintSaveJob
4336
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintSaveJob)
4428
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintSaveJob)
4337
	(JNIEnv *env, jclass that)
4429
	(JNIEnv *env, jclass that)
Lines 4760-4765 Link Here
4760
}
4852
}
4761
#endif
4853
#endif
4762
4854
4855
#ifndef NO_PMCopyPageFormat
4856
JNIEXPORT jintLong JNICALL OS_NATIVE(PMCopyPageFormat)
4857
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
4858
{
4859
	jintLong rc = 0;
4860
	OS_NATIVE_ENTER(env, that, PMCopyPageFormat_FUNC);
4861
	rc = (jintLong)PMCopyPageFormat((PMPageFormat)arg0, (PMPageFormat)arg1);
4862
	OS_NATIVE_EXIT(env, that, PMCopyPageFormat_FUNC);
4863
	return rc;
4864
}
4865
#endif
4866
4867
#ifndef NO_PMCreatePageFormatWithPMPaper
4868
JNIEXPORT jintLong JNICALL OS_NATIVE(PMCreatePageFormatWithPMPaper)
4869
	(JNIEnv *env, jclass that, jintArray arg0, jintLong arg1)
4870
{
4871
	jint *lparg0=NULL;
4872
	jintLong rc = 0;
4873
	OS_NATIVE_ENTER(env, that, PMCreatePageFormatWithPMPaper_FUNC);
4874
	if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
4875
	rc = (jintLong)PMCreatePageFormatWithPMPaper((PMPageFormat*)lparg0, (PMPaper)arg1);
4876
fail:
4877
	if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
4878
	OS_NATIVE_EXIT(env, that, PMCreatePageFormatWithPMPaper_FUNC);
4879
	return rc;
4880
}
4881
#endif
4882
4883
#ifndef NO_PMCreatePrintSettings
4884
JNIEXPORT jintLong JNICALL OS_NATIVE(PMCreatePrintSettings)
4885
	(JNIEnv *env, jclass that, jintArray arg0)
4886
{
4887
	jint *lparg0=NULL;
4888
	jintLong rc = 0;
4889
	OS_NATIVE_ENTER(env, that, PMCreatePrintSettings_FUNC);
4890
	if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
4891
	rc = (jintLong)PMCreatePrintSettings((PMPrintSettings*)lparg0);
4892
fail:
4893
	if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
4894
	OS_NATIVE_EXIT(env, that, PMCreatePrintSettings_FUNC);
4895
	return rc;
4896
}
4897
#endif
4898
4899
#ifndef NO_PMCreateSession
4900
JNIEXPORT jint JNICALL OS_NATIVE(PMCreateSession)
4901
	(JNIEnv *env, jclass that, jintArray arg0)
4902
{
4903
	jint *lparg0=NULL;
4904
	jint rc = 0;
4905
	OS_NATIVE_ENTER(env, that, PMCreateSession_FUNC);
4906
	if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
4907
	rc = (jint)PMCreateSession((PMPrintSession*)lparg0);
4908
fail:
4909
	if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
4910
	OS_NATIVE_EXIT(env, that, PMCreateSession_FUNC);
4911
	return rc;
4912
}
4913
#endif
4914
4915
#ifndef NO_PMGetDuplex
4916
JNIEXPORT void JNICALL OS_NATIVE(PMGetDuplex)
4917
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
4918
{
4919
	jint *lparg1=NULL;
4920
	OS_NATIVE_ENTER(env, that, PMGetDuplex_FUNC);
4921
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4922
	PMGetDuplex((PMPrintSettings)arg0, (PMDuplexMode*)lparg1);
4923
fail:
4924
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4925
	OS_NATIVE_EXIT(env, that, PMGetDuplex_FUNC);
4926
}
4927
#endif
4928
4929
#ifndef NO_PMGetPageFormatPaper
4930
JNIEXPORT jintLong JNICALL OS_NATIVE(PMGetPageFormatPaper)
4931
	(JNIEnv *env, jclass that, jint arg0, jintArray arg1)
4932
{
4933
	jint *lparg1=NULL;
4934
	jintLong rc = 0;
4935
	OS_NATIVE_ENTER(env, that, PMGetPageFormatPaper_FUNC);
4936
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4937
	rc = (jintLong)PMGetPageFormatPaper((PMPageFormat)arg0, (PMPaper*)lparg1);
4938
fail:
4939
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4940
	OS_NATIVE_EXIT(env, that, PMGetPageFormatPaper_FUNC);
4941
	return rc;
4942
}
4943
#endif
4944
4945
#ifndef NO_PMPageFormatGetPrinterID
4946
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPageFormatGetPrinterID)
4947
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
4948
{
4949
	jint *lparg1=NULL;
4950
	jintLong rc = 0;
4951
	OS_NATIVE_ENTER(env, that, PMPageFormatGetPrinterID_FUNC);
4952
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4953
	rc = (jintLong)PMPageFormatGetPrinterID((PMPageFormat)arg0, (CFStringRef*)lparg1);
4954
fail:
4955
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4956
	OS_NATIVE_EXIT(env, that, PMPageFormatGetPrinterID_FUNC);
4957
	return rc;
4958
}
4959
#endif
4960
4961
#ifndef NO_PMPaperCreateCustom
4962
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperCreateCustom)
4963
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jdouble arg3, jdouble arg4, jdoubleArray arg5, jintArray arg6)
4964
{
4965
	jdouble *lparg5=NULL;
4966
	jint *lparg6=NULL;
4967
	jintLong rc = 0;
4968
	OS_NATIVE_ENTER(env, that, PMPaperCreateCustom_FUNC);
4969
	if (arg5) if ((lparg5 = (*env)->GetDoubleArrayElements(env, arg5, NULL)) == NULL) goto fail;
4970
	if (arg6) if ((lparg6 = (*env)->GetIntArrayElements(env, arg6, NULL)) == NULL) goto fail;
4971
	rc = (jintLong)PMPaperCreateCustom((PMPrinter)arg0, (CFStringRef)arg1, (CFStringRef)arg2, (double)arg3, (double)arg4, (const PMPaperMargins*)lparg5, (PMPaper*)lparg6);
4972
fail:
4973
	if (arg6 && lparg6) (*env)->ReleaseIntArrayElements(env, arg6, lparg6, 0);
4974
	if (arg5 && lparg5) (*env)->ReleaseDoubleArrayElements(env, arg5, lparg5, 0);
4975
	OS_NATIVE_EXIT(env, that, PMPaperCreateCustom_FUNC);
4976
	return rc;
4977
}
4978
#endif
4979
4980
#ifndef NO_PMPaperCreateLocalizedName
4981
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperCreateLocalizedName)
4982
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2)
4983
{
4984
	jint *lparg2=NULL;
4985
	jintLong rc = 0;
4986
	OS_NATIVE_ENTER(env, that, PMPaperCreateLocalizedName_FUNC);
4987
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
4988
	rc = (jintLong)PMPaperCreateLocalizedName((PMPaper)arg0, (PMPrinter)arg1, (CFStringRef*)lparg2);
4989
fail:
4990
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
4991
	OS_NATIVE_EXIT(env, that, PMPaperCreateLocalizedName_FUNC);
4992
	return rc;
4993
}
4994
#endif
4995
4996
#ifndef NO_PMPaperGetHeight
4997
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetHeight)
4998
	(JNIEnv *env, jclass that, jintLong arg0, jdoubleArray arg1)
4999
{
5000
	jdouble *lparg1=NULL;
5001
	jintLong rc = 0;
5002
	OS_NATIVE_ENTER(env, that, PMPaperGetHeight_FUNC);
5003
	if (arg1) if ((lparg1 = (*env)->GetDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail;
5004
	rc = (jintLong)PMPaperGetHeight((PMPaper)arg0, (double*)lparg1);
5005
fail:
5006
	if (arg1 && lparg1) (*env)->ReleaseDoubleArrayElements(env, arg1, lparg1, 0);
5007
	OS_NATIVE_EXIT(env, that, PMPaperGetHeight_FUNC);
5008
	return rc;
5009
}
5010
#endif
5011
5012
#ifndef NO_PMPaperGetID
5013
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetID)
5014
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5015
{
5016
	jint *lparg1=NULL;
5017
	jintLong rc = 0;
5018
	OS_NATIVE_ENTER(env, that, PMPaperGetID_FUNC);
5019
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5020
	rc = (jintLong)PMPaperGetID((PMPaper)arg0, (CFStringRef*)lparg1);
5021
fail:
5022
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5023
	OS_NATIVE_EXIT(env, that, PMPaperGetID_FUNC);
5024
	return rc;
5025
}
5026
#endif
5027
5028
#ifndef NO_PMPaperGetName
5029
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetName)
5030
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5031
{
5032
	jint *lparg1=NULL;
5033
	jintLong rc = 0;
5034
	OS_NATIVE_ENTER(env, that, PMPaperGetName_FUNC);
5035
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5036
	rc = (jintLong)PMPaperGetName((PMPaper)arg0, (CFStringRef*)lparg1);
5037
fail:
5038
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5039
	OS_NATIVE_EXIT(env, that, PMPaperGetName_FUNC);
5040
	return rc;
5041
}
5042
#endif
5043
5044
#ifndef NO_PMPaperGetWidth
5045
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetWidth)
5046
	(JNIEnv *env, jclass that, jintLong arg0, jdoubleArray arg1)
5047
{
5048
	jdouble *lparg1=NULL;
5049
	jintLong rc = 0;
5050
	OS_NATIVE_ENTER(env, that, PMPaperGetWidth_FUNC);
5051
	if (arg1) if ((lparg1 = (*env)->GetDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail;
5052
	rc = (jintLong)PMPaperGetWidth((PMPaper)arg0, (double*)lparg1);
5053
fail:
5054
	if (arg1 && lparg1) (*env)->ReleaseDoubleArrayElements(env, arg1, lparg1, 0);
5055
	OS_NATIVE_EXIT(env, that, PMPaperGetWidth_FUNC);
5056
	return rc;
5057
}
5058
#endif
5059
5060
#ifndef NO_PMPaperIsCustom
5061
JNIEXPORT jboolean JNICALL OS_NATIVE(PMPaperIsCustom)
5062
	(JNIEnv *env, jclass that, jintLong arg0)
5063
{
5064
	jboolean rc = 0;
5065
	OS_NATIVE_ENTER(env, that, PMPaperIsCustom_FUNC);
5066
	rc = (jboolean)PMPaperIsCustom((PMPaper)arg0);
5067
	OS_NATIVE_EXIT(env, that, PMPaperIsCustom_FUNC);
5068
	return rc;
5069
}
5070
#endif
5071
5072
#ifndef NO_PMPrintSettingsCopyKeys
5073
JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsCopyKeys)
5074
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5075
{
5076
	jint *lparg1=NULL;
5077
	jint rc = 0;
5078
	OS_NATIVE_ENTER(env, that, PMPrintSettingsCopyKeys_FUNC);
5079
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5080
	rc = (jint)PMPrintSettingsCopyKeys((PMPrintSettings)arg0, (CFArrayRef*)lparg1);
5081
fail:
5082
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5083
	OS_NATIVE_EXIT(env, that, PMPrintSettingsCopyKeys_FUNC);
5084
	return rc;
5085
}
5086
#endif
5087
5088
#ifndef NO_PMPrintSettingsGetValue
5089
JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsGetValue)
5090
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2)
5091
{
5092
	jint *lparg2=NULL;
5093
	jint rc = 0;
5094
	OS_NATIVE_ENTER(env, that, PMPrintSettingsGetValue_FUNC);
5095
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
5096
	rc = (jint)PMPrintSettingsGetValue((PMPrintSettings)arg0, (CFStringRef)arg1, (CFTypeRef*)lparg2);
5097
fail:
5098
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
5099
	OS_NATIVE_EXIT(env, that, PMPrintSettingsGetValue_FUNC);
5100
	return rc;
5101
}
5102
#endif
5103
5104
#ifndef NO_PMPrintSettingsSetValue
5105
JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsSetValue)
5106
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jboolean arg3)
5107
{
5108
	jint rc = 0;
5109
	OS_NATIVE_ENTER(env, that, PMPrintSettingsSetValue_FUNC);
5110
	rc = (jint)PMPrintSettingsSetValue((PMPrintSettings)arg0, (CFStringRef)arg1, (CFTypeRef)arg2, (Boolean)arg3);
5111
	OS_NATIVE_EXIT(env, that, PMPrintSettingsSetValue_FUNC);
5112
	return rc;
5113
}
5114
#endif
5115
5116
#ifndef NO_PMPrinterCreateFromPrinterID
5117
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterCreateFromPrinterID)
5118
	(JNIEnv *env, jclass that, jintLong arg0)
5119
{
5120
	jintLong rc = 0;
5121
	OS_NATIVE_ENTER(env, that, PMPrinterCreateFromPrinterID_FUNC);
5122
	rc = (jintLong)PMPrinterCreateFromPrinterID((CFStringRef)arg0);
5123
	OS_NATIVE_EXIT(env, that, PMPrinterCreateFromPrinterID_FUNC);
5124
	return rc;
5125
}
5126
#endif
5127
5128
#ifndef NO_PMPrinterGetMimeTypes
5129
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetMimeTypes)
5130
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2)
5131
{
5132
	jint *lparg2=NULL;
5133
	jintLong rc = 0;
5134
	OS_NATIVE_ENTER(env, that, PMPrinterGetMimeTypes_FUNC);
5135
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
5136
	rc = (jintLong)PMPrinterGetMimeTypes((PMPrinter)arg0, (PMPrintSettings)arg1, (CFArrayRef*)lparg2);
5137
fail:
5138
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
5139
	OS_NATIVE_EXIT(env, that, PMPrinterGetMimeTypes_FUNC);
5140
	return rc;
5141
}
5142
#endif
5143
5144
#ifndef NO_PMPrinterGetName
5145
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetName)
5146
	(JNIEnv *env, jclass that, jintLong arg0)
5147
{
5148
	jintLong rc = 0;
5149
	OS_NATIVE_ENTER(env, that, PMPrinterGetName_FUNC);
5150
	rc = (jintLong)PMPrinterGetName((PMPrinter)arg0);
5151
	OS_NATIVE_EXIT(env, that, PMPrinterGetName_FUNC);
5152
	return rc;
5153
}
5154
#endif
5155
5156
#ifndef NO_PMPrinterGetOutputResolution
5157
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetOutputResolution)
5158
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdoubleArray arg2)
5159
{
5160
	jdouble *lparg2=NULL;
5161
	jintLong rc = 0;
5162
	OS_NATIVE_ENTER(env, that, PMPrinterGetOutputResolution_FUNC);
5163
	if (arg2) if ((lparg2 = (*env)->GetDoubleArrayElements(env, arg2, NULL)) == NULL) goto fail;
5164
	rc = (jintLong)PMPrinterGetOutputResolution((PMPrinter)arg0, (PMPrintSettings)arg1, (PMResolution*)lparg2);
5165
fail:
5166
	if (arg2 && lparg2) (*env)->ReleaseDoubleArrayElements(env, arg2, lparg2, 0);
5167
	OS_NATIVE_EXIT(env, that, PMPrinterGetOutputResolution_FUNC);
5168
	return rc;
5169
}
5170
#endif
5171
5172
#ifndef NO_PMPrinterGetPaperList
5173
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetPaperList)
5174
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5175
{
5176
	jint *lparg1=NULL;
5177
	jintLong rc = 0;
5178
	OS_NATIVE_ENTER(env, that, PMPrinterGetPaperList_FUNC);
5179
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5180
	rc = (jintLong)PMPrinterGetPaperList((PMPrinter)arg0, (CFArrayRef*)lparg1);
5181
fail:
5182
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5183
	OS_NATIVE_EXIT(env, that, PMPrinterGetPaperList_FUNC);
5184
	return rc;
5185
}
5186
#endif
5187
5188
#ifndef NO_PMPrinterSetOutputResolution
5189
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterSetOutputResolution)
5190
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdoubleArray arg2)
5191
{
5192
	jdouble *lparg2=NULL;
5193
	jintLong rc = 0;
5194
	OS_NATIVE_ENTER(env, that, PMPrinterSetOutputResolution_FUNC);
5195
	if (arg2) if ((lparg2 = (*env)->GetDoubleArrayElements(env, arg2, NULL)) == NULL) goto fail;
5196
	rc = (jintLong)PMPrinterSetOutputResolution((PMPrinter)arg0, (PMPrintSettings)arg1, (PMResolution*)lparg2);
5197
fail:
5198
	if (arg2 && lparg2) (*env)->ReleaseDoubleArrayElements(env, arg2, lparg2, 0);
5199
	OS_NATIVE_EXIT(env, that, PMPrinterSetOutputResolution_FUNC);
5200
	return rc;
5201
}
5202
#endif
5203
5204
#ifndef NO_PMRelease
5205
JNIEXPORT jint JNICALL OS_NATIVE(PMRelease)
5206
	(JNIEnv *env, jclass that, jintLong arg0)
5207
{
5208
	jint rc = 0;
5209
	OS_NATIVE_ENTER(env, that, PMRelease_FUNC);
5210
	rc = (jint)PMRelease((PMObject)arg0);
5211
	OS_NATIVE_EXIT(env, that, PMRelease_FUNC);
5212
	return rc;
5213
}
5214
#endif
5215
5216
#ifndef NO_PMSessionGetCurrentPrinter
5217
JNIEXPORT jint JNICALL OS_NATIVE(PMSessionGetCurrentPrinter)
5218
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5219
{
5220
	jint *lparg1=NULL;
5221
	jint rc = 0;
5222
	OS_NATIVE_ENTER(env, that, PMSessionGetCurrentPrinter_FUNC);
5223
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5224
	rc = (jint)PMSessionGetCurrentPrinter((PMPrintSession)arg0, (PMPrinter*)lparg1);
5225
fail:
5226
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5227
	OS_NATIVE_EXIT(env, that, PMSessionGetCurrentPrinter_FUNC);
5228
	return rc;
5229
}
5230
#endif
5231
5232
#ifndef NO_PMSetDuplex
5233
JNIEXPORT void JNICALL OS_NATIVE(PMSetDuplex)
5234
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
5235
{
5236
	OS_NATIVE_ENTER(env, that, PMSetDuplex_FUNC);
5237
	PMSetDuplex((PMPrintSettings)arg0, (PMDuplexMode)arg1);
5238
	OS_NATIVE_EXIT(env, that, PMSetDuplex_FUNC);
5239
}
5240
#endif
5241
4763
#ifndef NO_PtInRgn
5242
#ifndef NO_PtInRgn
4764
JNIEXPORT jboolean JNICALL OS_NATIVE(PtInRgn)
5243
JNIEXPORT jboolean JNICALL OS_NATIVE(PtInRgn)
4765
	(JNIEnv *env, jclass that, jshortArray arg0, jintLong arg1)
5244
	(JNIEnv *env, jclass that, jshortArray arg0, jintLong arg1)
(-)Eclipse SWT PI/cocoa/library/os_stats.c (-2 / +35 lines)
Lines 14-21 Link Here
14
14
15
#ifdef NATIVE_STATS
15
#ifdef NATIVE_STATS
16
16
17
int OS_nativeFunctionCount = 554;
17
int OS_nativeFunctionCount = 587;
18
int OS_nativeFunctionCallCount[554];
18
int OS_nativeFunctionCallCount[587];
19
char * OS_nativeFunctionNames[] = {
19
char * OS_nativeFunctionNames[] = {
20
	"ATSFontActivateFromFileReference",
20
	"ATSFontActivateFromFileReference",
21
	"AcquireRootMenu",
21
	"AcquireRootMenu",
Lines 56-66 Link Here
56
	"CALLBACK_1titleRectForBounds_1",
56
	"CALLBACK_1titleRectForBounds_1",
57
	"CALLBACK_1view_1stringForToolTip_1point_1userData_1",
57
	"CALLBACK_1view_1stringForToolTip_1point_1userData_1",
58
	"CALLBACK_1webView_1setFrame_1",
58
	"CALLBACK_1webView_1setFrame_1",
59
	"CFArrayGetCount",
60
	"CFArrayGetValueAtIndex",
59
	"CFAttributedStringCreate",
61
	"CFAttributedStringCreate",
60
	"CFDataGetBytePtr",
62
	"CFDataGetBytePtr",
61
	"CFDataGetLength",
63
	"CFDataGetLength",
62
	"CFDictionaryAddValue",
64
	"CFDictionaryAddValue",
63
	"CFDictionaryCreateMutable",
65
	"CFDictionaryCreateMutable",
66
	"CFNumberCreate",
67
	"CFNumberGetValue",
64
	"CFRange_1sizeof",
68
	"CFRange_1sizeof",
65
	"CFRelease",
69
	"CFRelease",
66
	"CFRunLoopAddObserver",
70
	"CFRunLoopAddObserver",
Lines 333-339 Link Here
333
	"NSPrintJobDisposition",
337
	"NSPrintJobDisposition",
334
	"NSPrintLastPage",
338
	"NSPrintLastPage",
335
	"NSPrintMustCollate",
339
	"NSPrintMustCollate",
340
	"NSPrintPagesAcross",
341
	"NSPrintPagesDown",
336
	"NSPrintPreviewJob",
342
	"NSPrintPreviewJob",
343
	"NSPrintPrinterName",
337
	"NSPrintSaveJob",
344
	"NSPrintSaveJob",
338
	"NSPrintSavePath",
345
	"NSPrintSavePath",
339
	"NSPrintScalingFactor",
346
	"NSPrintScalingFactor",
Lines 368-373 Link Here
368
	"NewRgn",
375
	"NewRgn",
369
	"OffsetRgn",
376
	"OffsetRgn",
370
	"OpenRgn",
377
	"OpenRgn",
378
	"PMCopyPageFormat",
379
	"PMCreatePageFormatWithPMPaper",
380
	"PMCreatePrintSettings",
381
	"PMCreateSession",
382
	"PMGetDuplex",
383
	"PMGetPageFormatPaper",
384
	"PMPageFormatGetPrinterID",
385
	"PMPaperCreateCustom",
386
	"PMPaperCreateLocalizedName",
387
	"PMPaperGetHeight",
388
	"PMPaperGetID",
389
	"PMPaperGetName",
390
	"PMPaperGetWidth",
391
	"PMPaperIsCustom",
392
	"PMPrintSettingsCopyKeys",
393
	"PMPrintSettingsGetValue",
394
	"PMPrintSettingsSetValue",
395
	"PMPrinterCreateFromPrinterID",
396
	"PMPrinterGetMimeTypes",
397
	"PMPrinterGetName",
398
	"PMPrinterGetOutputResolution",
399
	"PMPrinterGetPaperList",
400
	"PMPrinterSetOutputResolution",
401
	"PMRelease",
402
	"PMSessionGetCurrentPrinter",
403
	"PMSetDuplex",
371
	"PtInRgn",
404
	"PtInRgn",
372
	"QDRegionToRects",
405
	"QDRegionToRects",
373
	"RectInRgn",
406
	"RectInRgn",
(-)Eclipse SWT PI/cocoa/library/os_stats.h (+33 lines)
Lines 64-74 Link Here
64
	CALLBACK_1titleRectForBounds_1_FUNC,
64
	CALLBACK_1titleRectForBounds_1_FUNC,
65
	CALLBACK_1view_1stringForToolTip_1point_1userData_1_FUNC,
65
	CALLBACK_1view_1stringForToolTip_1point_1userData_1_FUNC,
66
	CALLBACK_1webView_1setFrame_1_FUNC,
66
	CALLBACK_1webView_1setFrame_1_FUNC,
67
	CFArrayGetCount_FUNC,
68
	CFArrayGetValueAtIndex_FUNC,
67
	CFAttributedStringCreate_FUNC,
69
	CFAttributedStringCreate_FUNC,
68
	CFDataGetBytePtr_FUNC,
70
	CFDataGetBytePtr_FUNC,
69
	CFDataGetLength_FUNC,
71
	CFDataGetLength_FUNC,
70
	CFDictionaryAddValue_FUNC,
72
	CFDictionaryAddValue_FUNC,
71
	CFDictionaryCreateMutable_FUNC,
73
	CFDictionaryCreateMutable_FUNC,
74
	CFNumberCreate_FUNC,
75
	CFNumberGetValue_FUNC,
72
	CFRange_1sizeof_FUNC,
76
	CFRange_1sizeof_FUNC,
73
	CFRelease_FUNC,
77
	CFRelease_FUNC,
74
	CFRunLoopAddObserver_FUNC,
78
	CFRunLoopAddObserver_FUNC,
Lines 341-347 Link Here
341
	NSPrintJobDisposition_FUNC,
345
	NSPrintJobDisposition_FUNC,
342
	NSPrintLastPage_FUNC,
346
	NSPrintLastPage_FUNC,
343
	NSPrintMustCollate_FUNC,
347
	NSPrintMustCollate_FUNC,
348
	NSPrintPagesAcross_FUNC,
349
	NSPrintPagesDown_FUNC,
344
	NSPrintPreviewJob_FUNC,
350
	NSPrintPreviewJob_FUNC,
351
	NSPrintPrinterName_FUNC,
345
	NSPrintSaveJob_FUNC,
352
	NSPrintSaveJob_FUNC,
346
	NSPrintSavePath_FUNC,
353
	NSPrintSavePath_FUNC,
347
	NSPrintScalingFactor_FUNC,
354
	NSPrintScalingFactor_FUNC,
Lines 376-381 Link Here
376
	NewRgn_FUNC,
383
	NewRgn_FUNC,
377
	OffsetRgn_FUNC,
384
	OffsetRgn_FUNC,
378
	OpenRgn_FUNC,
385
	OpenRgn_FUNC,
386
	PMCopyPageFormat_FUNC,
387
	PMCreatePageFormatWithPMPaper_FUNC,
388
	PMCreatePrintSettings_FUNC,
389
	PMCreateSession_FUNC,
390
	PMGetDuplex_FUNC,
391
	PMGetPageFormatPaper_FUNC,
392
	PMPageFormatGetPrinterID_FUNC,
393
	PMPaperCreateCustom_FUNC,
394
	PMPaperCreateLocalizedName_FUNC,
395
	PMPaperGetHeight_FUNC,
396
	PMPaperGetID_FUNC,
397
	PMPaperGetName_FUNC,
398
	PMPaperGetWidth_FUNC,
399
	PMPaperIsCustom_FUNC,
400
	PMPrintSettingsCopyKeys_FUNC,
401
	PMPrintSettingsGetValue_FUNC,
402
	PMPrintSettingsSetValue_FUNC,
403
	PMPrinterCreateFromPrinterID_FUNC,
404
	PMPrinterGetMimeTypes_FUNC,
405
	PMPrinterGetName_FUNC,
406
	PMPrinterGetOutputResolution_FUNC,
407
	PMPrinterGetPaperList_FUNC,
408
	PMPrinterSetOutputResolution_FUNC,
409
	PMRelease_FUNC,
410
	PMSessionGetCurrentPrinter_FUNC,
411
	PMSetDuplex_FUNC,
379
	PtInRgn_FUNC,
412
	PtInRgn_FUNC,
380
	QDRegionToRects_FUNC,
413
	QDRegionToRects_FUNC,
381
	RectInRgn_FUNC,
414
	RectInRgn_FUNC,
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java (-1 / +49 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 24-29 Link Here
24
	super(id);
24
	super(id);
25
}
25
}
26
26
27
public int /*long*/ PMPrintSession() {
28
	return OS.objc_msgSend(this.id, OS.sel_PMPrintSession);
29
}
30
31
public int /*long*/ PMPrintSettings() {
32
	return OS.objc_msgSend(this.id, OS.sel_PMPrintSettings);
33
}
34
27
public static NSPrinter defaultPrinter() {
35
public static NSPrinter defaultPrinter() {
28
	int /*long*/ result = OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_defaultPrinter);
36
	int /*long*/ result = OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_defaultPrinter);
29
	return result != 0 ? new NSPrinter(result) : null;
37
	return result != 0 ? new NSPrinter(result) : null;
Lines 45-50 Link Here
45
	return result == this.id ? this : (result != 0 ? new NSPrintInfo(result) : null);
53
	return result == this.id ? this : (result != 0 ? new NSPrintInfo(result) : null);
46
}
54
}
47
55
56
public void setPaperName (NSString paperName) {
57
	OS.objc_msgSend(this.id, OS.sel_setPaperName, paperName != null ? paperName.id : 0);
58
}
59
60
public void setPaperSize (NSSize paperSize) {
61
	OS.objc_msgSend(this.id, OS.sel_setPaperSize, paperSize != null ? paperSize : null);
62
}
63
48
public NSString jobDisposition() {
64
public NSString jobDisposition() {
49
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_jobDisposition);
65
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_jobDisposition);
50
	return result != 0 ? new NSString(result) : null;
66
	return result != 0 ? new NSString(result) : null;
Lines 60-65 Link Here
60
	return result;
76
	return result;
61
}
77
}
62
78
79
public NSString paperName() {
80
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_paperName);
81
	return result != 0 ? new NSString(result) : null;
82
}
83
84
public int /*long*/ pmPageFormat() {
85
	return OS.objc_msgSend(this.id, OS.sel_pmPageFormat);
86
}
87
88
public float bottomMargin () {
89
	return OS.objc_msgSend(this.id, OS.sel_bottomMargin);
90
}
91
92
public float topMargin () {
93
	return OS.objc_msgSend(this.id, OS.sel_topMargin);
94
}
95
96
public float leftMargin () {
97
	return OS.objc_msgSend(this.id, OS.sel_leftMargin);
98
}
99
100
public float rightMargin () {
101
	return OS.objc_msgSend(this.id, OS.sel_rightMargin);
102
}
103
104
public void updateFromPMPageFormat() {
105
	OS.objc_msgSend(this.id, OS.sel_updateFromPMPageFormat);
106
}
63
public NSPrinter printer() {
107
public NSPrinter printer() {
64
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_printer);
108
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_printer);
65
	return result != 0 ? new NSPrinter(result) : null;
109
	return result != 0 ? new NSPrinter(result) : null;
Lines 86-89 Link Here
86
	return result != 0 ? new NSPrintInfo(result) : null;
130
	return result != 0 ? new NSPrintInfo(result) : null;
87
}
131
}
88
132
133
public void updateFromPMPrintSettings() {
134
	OS.objc_msgSend(this.id, OS.sel_updateFromPMPrintSettings);
135
}
136
89
}
137
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java (+167 lines)
Lines 686-691 Link Here
686
public static final int /*long*/ sel_CGEvent = sel_registerName("CGEvent");
686
public static final int /*long*/ sel_CGEvent = sel_registerName("CGEvent");
687
public static final int /*long*/ sel_DOMDocument = sel_registerName("DOMDocument");
687
public static final int /*long*/ sel_DOMDocument = sel_registerName("DOMDocument");
688
public static final int /*long*/ sel_IBeamCursor = sel_registerName("IBeamCursor");
688
public static final int /*long*/ sel_IBeamCursor = sel_registerName("IBeamCursor");
689
public static final int /*long*/ sel_PMPrintSettings = sel_registerName("PMPrintSettings");
690
public static final int /*long*/ sel_PMPrintSession = sel_registerName("PMPrintSession");
689
public static final int /*long*/ sel_TIFFRepresentation = sel_registerName("TIFFRepresentation");
691
public static final int /*long*/ sel_TIFFRepresentation = sel_registerName("TIFFRepresentation");
690
public static final int /*long*/ sel_URL = sel_registerName("URL");
692
public static final int /*long*/ sel_URL = sel_registerName("URL");
691
public static final int /*long*/ sel_URLFromPasteboard_ = sel_registerName("URLFromPasteboard:");
693
public static final int /*long*/ sel_URLFromPasteboard_ = sel_registerName("URLFromPasteboard:");
Lines 1211-1216 Link Here
1211
public static final int /*long*/ sel_itemObjectValueAtIndex_ = sel_registerName("itemObjectValueAtIndex:");
1213
public static final int /*long*/ sel_itemObjectValueAtIndex_ = sel_registerName("itemObjectValueAtIndex:");
1212
public static final int /*long*/ sel_itemTitleAtIndex_ = sel_registerName("itemTitleAtIndex:");
1214
public static final int /*long*/ sel_itemTitleAtIndex_ = sel_registerName("itemTitleAtIndex:");
1213
public static final int /*long*/ sel_jobDisposition = sel_registerName("jobDisposition");
1215
public static final int /*long*/ sel_jobDisposition = sel_registerName("jobDisposition");
1216
public static final int /*long*/ sel_setPaperName = sel_registerName("setPaperName:");
1217
public static final int /*long*/ sel_setPaperSize = sel_registerName("setPaperSize:");
1218
public static final int /*long*/ sel_paperName = sel_registerName("PaperName");
1219
public static final int /*long*/ sel_pmPageFormat = sel_registerName("PMPageFormat");
1220
public static final int /*long*/ sel_bottomMargin = sel_registerName("bottomMargin");
1221
public static final int /*long*/ sel_topMargin = sel_registerName("topMargin");
1222
public static final int /*long*/ sel_leftMargin = sel_registerName("leftMargin");
1223
public static final int /*long*/ sel_rightMargin = sel_registerName("rightMargin");
1224
public static final int /*long*/ sel_updateFromPMPageFormat = sel_registerName("updateFromPMPageFormat");
1214
public static final int /*long*/ sel_keyCode = sel_registerName("keyCode");
1225
public static final int /*long*/ sel_keyCode = sel_registerName("keyCode");
1215
public static final int /*long*/ sel_keyDown_ = sel_registerName("keyDown:");
1226
public static final int /*long*/ sel_keyDown_ = sel_registerName("keyDown:");
1216
public static final int /*long*/ sel_keyEquivalent = sel_registerName("keyEquivalent");
1227
public static final int /*long*/ sel_keyEquivalent = sel_registerName("keyEquivalent");
Lines 1866-1871 Link Here
1866
public static final int /*long*/ sel_unmarkText = sel_registerName("unmarkText");
1877
public static final int /*long*/ sel_unmarkText = sel_registerName("unmarkText");
1867
public static final int /*long*/ sel_unregisterDraggedTypes = sel_registerName("unregisterDraggedTypes");
1878
public static final int /*long*/ sel_unregisterDraggedTypes = sel_registerName("unregisterDraggedTypes");
1868
public static final int /*long*/ sel_update = sel_registerName("update");
1879
public static final int /*long*/ sel_update = sel_registerName("update");
1880
public static final int /*long*/ sel_updateFromPMPrintSettings = sel_registerName("updateFromPMPrintSettings");
1869
public static final int /*long*/ sel_updateTrackingAreas = sel_registerName("updateTrackingAreas");
1881
public static final int /*long*/ sel_updateTrackingAreas = sel_registerName("updateTrackingAreas");
1870
public static final int /*long*/ sel_use = sel_registerName("use");
1882
public static final int /*long*/ sel_use = sel_registerName("use");
1871
public static final int /*long*/ sel_useCredential_forAuthenticationChallenge_ = sel_registerName("useCredential:forAuthenticationChallenge:");
1883
public static final int /*long*/ sel_useCredential_forAuthenticationChallenge_ = sel_registerName("useCredential:forAuthenticationChallenge:");
Lines 1949-1954 Link Here
1949
public static final int /*long*/ sel_yearOfCommonEra = sel_registerName("yearOfCommonEra");
1961
public static final int /*long*/ sel_yearOfCommonEra = sel_registerName("yearOfCommonEra");
1950
public static final int /*long*/ sel_zoom_ = sel_registerName("zoom:");
1962
public static final int /*long*/ sel_zoom_ = sel_registerName("zoom:");
1951
1963
1964
/**
1965
 * @param printSettings cast=(PMPrintSettings)
1966
 * @param duplexSetting cast=(PMDuplexMode)
1967
 * */
1968
public static final native void PMSetDuplex(int /*long*/ printSettings, int duplexSetting);
1969
/**
1970
 * @param printSettings cast=(PMPrintSettings)
1971
 * @param duplexSetting cast=(PMDuplexMode*)
1972
 * */
1973
public static final native void PMGetDuplex(int /*long*/ printSettings, int[] duplexSetting);
1974
/**
1975
 * @param printSettings cast=(PMPrintSettings)
1976
 * @param key cast=(CFStringRef)
1977
 * @param value cast=(CFTypeRef)
1978
 * @param locked cast=(Boolean)
1979
 * */
1980
public static final native int PMPrintSettingsSetValue(int /*long*/ printSettings, int /*long*/ key, int value, boolean locked);
1981
/**
1982
 * @param printSettings cast=(PMPrintSettings)
1983
 * @param key cast=(CFStringRef)
1984
 * @param value cast=(CFTypeRef*)
1985
 * */
1986
public static final native int PMPrintSettingsGetValue(int /*long*/ printSettings, int /*long*/ key, int[] value);
1987
/**
1988
 * @param printSettings cast=(PMPrintSettings)
1989
 * @param settingsKeys cast=(CFArrayRef*)
1990
 */
1991
public static final native int PMPrintSettingsCopyKeys(int /*long*/ printSettings, int[] settingsKeys);
1992
1993
/** @param printSession cast=(PMPrintSession*) */
1994
public static final native int PMCreateSession(int[] printSession);
1995
/**
1996
 * @param printSession cast=(PMPrintSession)
1997
 * @param currentPrinter cast=(PMPrinter*)
1998
 */
1999
public static final native int PMSessionGetCurrentPrinter(int /*long*/ printSession, int[] currentPrinter);
2000
/**
2001
 * @param printer cast=(PMPrinter)
2002
 * @param paperList cast=(CFArrayRef*)
2003
 */
2004
public static final native int /*long*/ PMPrinterGetPaperList (int /*long*/ printer, int[] paperList);
2005
/** @param object cast =(PMObject) */
2006
public static final native int PMRelease (int /*long*/ object);
2007
/**
2008
 * @param pageFormat cast=(PMPageFormat)
2009
 * @param printerID cast=(CFStringRef*)
2010
 */
2011
public static final native int /*long*/ PMPageFormatGetPrinterID (int /*long*/ pageFormat, int[] printerID);
2012
/**
2013
 * @param pageFormat cast=(PMPageFormat*)
2014
 * @param paper cast=(PMPaper)
2015
 */
2016
public static final native int /*long*/ PMCreatePageFormatWithPMPaper (int[] pageFormat, int /*long*/ paper);
2017
/**
2018
 * @param format cast=(PMPageFormat)
2019
 * @param paper cast=(PMPaper*)
2020
 */
2021
public static final native int /*long*/ PMGetPageFormatPaper (int/*long*/ format, int[] /*long*/ paper);
2022
/** 
2023
 * @param paper cast=(PMPaper) 
2024
 * @param paperWidth cast=(double*)
2025
 */
2026
public static final native int /*long*/ PMPaperGetWidth (int /*long*/ paper, double[] paperWidth);
2027
/** 
2028
 * @param paper cast=(PMPaper) 
2029
 * @param paperHeight cast=(double*)
2030
 */
2031
public static final native int /*long*/ PMPaperGetHeight (int /*long*/ paper, double[] paperHeight);
2032
/**
2033
 * @param formatSrc cast=(PMPageFormat)
2034
 * @param formatDest cast=(PMPageFormat)
2035
 */
2036
public static final native int /*long*/ PMCopyPageFormat (int /*long*/ formatSrc, int /*long*/ formatDest);
2037
/**
2038
 * @param paper cast=(PMPaper)
2039
 * @param paperName cast=(CFStringRef*)
2040
 */
2041
public static final native int /*long*/ PMPaperGetName (int /*long*/ paper, int[] paperName);
2042
/**
2043
 * @param printer cast=(PMPrinter)
2044
 * @param id cast=(CFStringRef)
2045
 * @param name cast=(CFStringRef)
2046
 * @param width cast=(double)
2047
 * @param height cast=(double)
2048
 * @param margins cast=(const PMPaperMargins*)
2049
 * @param paperP cast=(PMPaper*)
2050
 */
2051
public static final native int /*long*/ PMPaperCreateCustom (int /*long*/ printer, int /*long*/ id, int /*long*/ name, double width, double height, double[] margins, int[] paperP);
2052
/**
2053
 * @param paper cast=(PMPaper)
2054
 * @param printer cast=(PMPrinter)
2055
 * @param paperName cast=(CFStringRef*)
2056
 */
2057
public static final native int /*long*/ PMPaperCreateLocalizedName (int /*long*/ paper, int /*long*/ printer, int[] /*long*/ paperName);
2058
/** @param paper cast=(PMPaper) */
2059
public static final native boolean PMPaperIsCustom (int /*long*/ paper);
2060
/** @param printer cast=(PMPrinter)*/
2061
public static final native int /*long*/ PMPrinterGetName (int /*long*/ printer);
2062
/** 
2063
 * @param paper cast=(PMPaper)
2064
 * @param paperID cast=(CFStringRef*)
2065
 */
2066
public static final native int /*long*/ PMPaperGetID (int /*long*/ paper, int[] paperID);
2067
/**
2068
 * @param printer cast=(PMPrinter)
2069
 * @param settings cast=(PMPrintSettings)
2070
 * @param mimeTypes cast=(CFArrayRef*)
2071
 */
2072
public static final native int /*long*/ PMPrinterGetMimeTypes(int /*long*/ printer, int /*long*/ settings, int[] mimeTypes);
2073
/**
2074
 * @param printer cast=(PMPrinter)
2075
 * @param printSettings cast=(PMPrintSettings)
2076
 * @param resolutionP cast=(PMResolution*)
2077
 */
2078
public static final native int /*long*/ PMPrinterGetOutputResolution(int /*long*/ printer, int /*long*/ printSettings, double[] resolutionP);
2079
/**
2080
 * @param printer cast=(PMPrinter)
2081
 * @param printSettings cast=(PMPrintSettings)
2082
 * @param resolutionP cast=(PMResolution*)
2083
 */
2084
public static final native int /*long*/ PMPrinterSetOutputResolution(int /*long*/ printer, int /*long*/ printSettings, double[] resolutionP);
2085
/** @param printerID cast=(CFStringRef) */
2086
public static final native int /*long*/ PMPrinterCreateFromPrinterID(int /*long*/ printerID);
2087
/** @param printSettings cast=(PMPrintSettings*) */
2088
public static final native int /*long*/ PMCreatePrintSettings (int[] printSettings);
2089
/**
2090
 * @param allocator cast=(CFAllocatorRef)
2091
 * @param theType cast=(CFNumberType)
2092
 * @param valuePtr cast=(const void *)
2093
 */
2094
public static final native int /*long*/ CFNumberCreate (int /*long*/ allocator,int theType, int[] valuePtr);
2095
/**
2096
 * @param number cast=(CFNumberRef)
2097
 * @param theType cast=(CFNumberType)
2098
 * @param valuePtr cast=(void *)
2099
 */
2100
public static final native boolean CFNumberGetValue(int /*long*/ number, int theType, int[] valuePtr);
2101
/** @param theArray cast=(CFArrayRef) */
2102
public static final native int /*long*/ CFArrayGetCount (int theArray);
2103
/**
2104
 * @param theArray cast=(CFArrayRef)
2105
 * @param idx cast=(CFIndex)
2106
 */
2107
public static final native int /*long*/ CFArrayGetValueAtIndex (int /*long*/ theArray, int idx);
2108
1952
/** Constants */
2109
/** Constants */
1953
public static final int NSAlertFirstButtonReturn = 1000;
2110
public static final int NSAlertFirstButtonReturn = 1000;
1954
public static final int NSAlertSecondButtonReturn = 1001;
2111
public static final int NSAlertSecondButtonReturn = 1001;
Lines 2062-2067 Link Here
2062
public static final int NSPageUpFunctionKey = 63276;
2219
public static final int NSPageUpFunctionKey = 63276;
2063
public static final int NSPortraitOrientation = 0;
2220
public static final int NSPortraitOrientation = 0;
2064
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
2221
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
2222
public static final int NSPrintPanelShowsPrintSelection = 1 << 5;
2065
public static final int NSProgressIndicatorPreferredThickness = 14;
2223
public static final int NSProgressIndicatorPreferredThickness = 14;
2066
public static final int NSPushOnPushOffButton = 1;
2224
public static final int NSPushOnPushOffButton = 1;
2067
public static final int NSRadioButton = 4;
2225
public static final int NSRadioButton = 4;
Lines 2570-2578 Link Here
2570
public static final native int /*long*/ NSPrintSavePath();
2728
public static final native int /*long*/ NSPrintSavePath();
2571
public static final NSString NSPrintSavePath = new NSString(NSPrintSavePath());
2729
public static final NSString NSPrintSavePath = new NSString(NSPrintSavePath());
2572
/** @method flags=const */
2730
/** @method flags=const */
2731
public static final native int /*long*/ NSPrintPrinterName();
2732
public static final NSString NSPrintPrinterName = new NSString(NSPrintPrinterName());
2733
/** @method flags=const */
2573
public static final native int /*long*/ NSPrintScalingFactor();
2734
public static final native int /*long*/ NSPrintScalingFactor();
2574
public static final NSString NSPrintScalingFactor = new NSString(NSPrintScalingFactor());
2735
public static final NSString NSPrintScalingFactor = new NSString(NSPrintScalingFactor());
2575
/** @method flags=const */
2736
/** @method flags=const */
2737
public static final native int /*long*/ NSPrintPagesAcross();
2738
public static final NSString NSPrintPagesAcross = new NSString(NSPrintPagesAcross());
2739
/** @method flags=const */
2740
public static final native int /*long*/ NSPrintPagesDown();
2741
public static final NSString NSPrintPagesDown = new NSString(NSPrintPagesDown());
2742
/** @method flags=const */
2576
public static final native int /*long*/ NSPrintSpoolJob();
2743
public static final native int /*long*/ NSPrintSpoolJob();
2577
public static final NSString NSPrintSpoolJob = new NSString(NSPrintSpoolJob());
2744
public static final NSString NSPrintSpoolJob = new NSString(NSPrintSpoolJob());
2578
/** @method flags=const */
2745
/** @method flags=const */
(-)Eclipse SWT PI/gtk/library/os.c (+484 lines)
Lines 11209-11214 Link Here
11209
}
11209
}
11210
#endif
11210
#endif
11211
11211
11212
#ifndef NO__1gtk_1paper_1size_1get_1paper_1sizes
11213
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1paper_1sizes)
11214
	(JNIEnv *env, jclass that, jboolean arg0)
11215
{
11216
	jintLong rc = 0;
11217
	OS_NATIVE_ENTER(env, that, _1gtk_1paper_1size_1get_1paper_1sizes_FUNC);
11218
/*
11219
	rc = (jintLong)gtk_paper_size_get_paper_sizes(arg0);
11220
*/
11221
	{
11222
		LOAD_FUNCTION(fp, gtk_paper_size_get_paper_sizes)
11223
		if (fp) {
11224
			rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jboolean))fp)(arg0);
11225
		}
11226
	}
11227
	OS_NATIVE_EXIT(env, that, _1gtk_1paper_1size_1get_1paper_1sizes_FUNC);
11228
	return rc;
11229
}
11230
#endif
11231
11212
#ifndef NO__1gtk_1paper_1size_1get_1ppd_1name
11232
#ifndef NO__1gtk_1paper_1size_1get_1ppd_1name
11213
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1ppd_1name)
11233
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1ppd_1name)
11214
	(JNIEnv *env, jclass that, jintLong arg0)
11234
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 11606-11611 Link Here
11606
}
11626
}
11607
#endif
11627
#endif
11608
11628
11629
#ifndef NO__1gtk_1print_1settings_1get_1default_1source
11630
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1default_1source)
11631
	(JNIEnv *env, jclass that, jintLong arg0)
11632
{
11633
	jint rc = 0;
11634
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1default_1source_FUNC);
11635
/*
11636
	rc = (jint)gtk_print_settings_get_default_source(arg0);
11637
*/
11638
	{
11639
		LOAD_FUNCTION(fp, gtk_print_settings_get_default_source)
11640
		if (fp) {
11641
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11642
		}
11643
	}
11644
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1default_1source_FUNC);
11645
	return rc;
11646
}
11647
#endif
11648
11649
#ifndef NO__1gtk_1print_1settings_1get_1duplex
11650
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1duplex)
11651
	(JNIEnv *env, jclass that, jintLong arg0)
11652
{
11653
	jint rc = 0;
11654
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1duplex_FUNC);
11655
/*
11656
	rc = (jint)gtk_print_settings_get_duplex(arg0);
11657
*/
11658
	{
11659
		LOAD_FUNCTION(fp, gtk_print_settings_get_duplex)
11660
		if (fp) {
11661
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11662
		}
11663
	}
11664
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1duplex_FUNC);
11665
	return rc;
11666
}
11667
#endif
11668
11669
#ifndef NO__1gtk_1print_1settings_1get_1media_1type
11670
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1media_1type)
11671
	(JNIEnv *env, jclass that, jintLong arg0)
11672
{
11673
	jint rc = 0;
11674
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1media_1type_FUNC);
11675
/*
11676
	rc = (jint)gtk_print_settings_get_media_type(arg0);
11677
*/
11678
	{
11679
		LOAD_FUNCTION(fp, gtk_print_settings_get_media_type)
11680
		if (fp) {
11681
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11682
		}
11683
	}
11684
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1media_1type_FUNC);
11685
	return rc;
11686
}
11687
#endif
11688
11609
#ifndef NO__1gtk_1print_1settings_1get_1n_1copies
11689
#ifndef NO__1gtk_1print_1settings_1get_1n_1copies
11610
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1n_1copies)
11690
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1n_1copies)
11611
	(JNIEnv *env, jclass that, jintLong arg0)
11691
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 11646-11651 Link Here
11646
}
11726
}
11647
#endif
11727
#endif
11648
11728
11729
#ifndef NO__1gtk_1print_1settings_1get_1output_1bin
11730
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1output_1bin)
11731
	(JNIEnv *env, jclass that, jintLong arg0)
11732
{
11733
	jint rc = 0;
11734
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1output_1bin_FUNC);
11735
/*
11736
	rc = (jint)gtk_print_settings_get_output_bin(arg0);
11737
*/
11738
	{
11739
		LOAD_FUNCTION(fp, gtk_print_settings_get_output_bin)
11740
		if (fp) {
11741
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11742
		}
11743
	}
11744
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1output_1bin_FUNC);
11745
	return rc;
11746
}
11747
#endif
11748
11649
#ifndef NO__1gtk_1print_1settings_1get_1page_1ranges
11749
#ifndef NO__1gtk_1print_1settings_1get_1page_1ranges
11650
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1page_1ranges)
11750
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1page_1ranges)
11651
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
11751
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
Lines 11750-11755 Link Here
11750
}
11850
}
11751
#endif
11851
#endif
11752
11852
11853
#ifndef NO__1gtk_1print_1settings_1get_1quality
11854
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1quality)
11855
	(JNIEnv *env, jclass that, jintLong arg0)
11856
{
11857
	jint rc = 0;
11858
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1quality_FUNC);
11859
/*
11860
	rc = (jint)gtk_print_settings_get_quality(arg0);
11861
*/
11862
	{
11863
		LOAD_FUNCTION(fp, gtk_print_settings_get_quality)
11864
		if (fp) {
11865
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11866
		}
11867
	}
11868
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1quality_FUNC);
11869
	return rc;
11870
}
11871
#endif
11872
11753
#ifndef NO__1gtk_1print_1settings_1get_1resolution
11873
#ifndef NO__1gtk_1print_1settings_1get_1resolution
11754
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution)
11874
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution)
11755
	(JNIEnv *env, jclass that, jintLong arg0)
11875
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 11770-11775 Link Here
11770
}
11890
}
11771
#endif
11891
#endif
11772
11892
11893
#ifndef NO__1gtk_1print_1settings_1get_1resolution_1x
11894
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution_1x)
11895
	(JNIEnv *env, jclass that, jintLong arg0)
11896
{
11897
	jint rc = 0;
11898
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1resolution_1x_FUNC);
11899
/*
11900
	rc = (jint)gtk_print_settings_get_resolution_x(arg0);
11901
*/
11902
	{
11903
		LOAD_FUNCTION(fp, gtk_print_settings_get_resolution_x)
11904
		if (fp) {
11905
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11906
		}
11907
	}
11908
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1resolution_1x_FUNC);
11909
	return rc;
11910
}
11911
#endif
11912
11913
#ifndef NO__1gtk_1print_1settings_1get_1resolution_1y
11914
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution_1y)
11915
	(JNIEnv *env, jclass that, jintLong arg0)
11916
{
11917
	jint rc = 0;
11918
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1resolution_1y_FUNC);
11919
/*
11920
	rc = (jint)gtk_print_settings_get_resolution_y(arg0);
11921
*/
11922
	{
11923
		LOAD_FUNCTION(fp, gtk_print_settings_get_resolution_y)
11924
		if (fp) {
11925
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11926
		}
11927
	}
11928
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1resolution_1y_FUNC);
11929
	return rc;
11930
}
11931
#endif
11932
11933
#ifndef NO__1gtk_1print_1settings_1get_1reverse
11934
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1reverse)
11935
	(JNIEnv *env, jclass that, jintLong arg0)
11936
{
11937
	jint rc = 0;
11938
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC);
11939
/*
11940
	rc = (jint)gtk_print_settings_get_reverse(arg0);
11941
*/
11942
	{
11943
		LOAD_FUNCTION(fp, gtk_print_settings_get_reverse)
11944
		if (fp) {
11945
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11946
		}
11947
	}
11948
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC);
11949
	return rc;
11950
}
11951
#endif
11952
11953
#ifndef NO__1gtk_1print_1settings_1get_1scale
11954
JNIEXPORT jdouble JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1scale)
11955
	(JNIEnv *env, jclass that, jintLong arg0)
11956
{
11957
	jdouble rc = 0;
11958
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1scale_FUNC);
11959
/*
11960
	rc = (jdouble)gtk_print_settings_get_scale(arg0);
11961
*/
11962
	{
11963
		LOAD_FUNCTION(fp, gtk_print_settings_get_scale)
11964
		if (fp) {
11965
			rc = (jdouble)((jdouble (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11966
		}
11967
	}
11968
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1scale_FUNC);
11969
	return rc;
11970
}
11971
#endif
11972
11973
#ifndef NO__1gtk_1print_1settings_1get_1use_1color
11974
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1use_1color)
11975
	(JNIEnv *env, jclass that, jintLong arg0)
11976
{
11977
	jint rc = 0;
11978
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC);
11979
/*
11980
	rc = (jint)gtk_print_settings_get_use_color(arg0);
11981
*/
11982
	{
11983
		LOAD_FUNCTION(fp, gtk_print_settings_get_use_color)
11984
		if (fp) {
11985
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11986
		}
11987
	}
11988
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC);
11989
	return rc;
11990
}
11991
#endif
11992
11773
#ifndef NO__1gtk_1print_1settings_1new
11993
#ifndef NO__1gtk_1print_1settings_1new
11774
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1new)
11994
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1new)
11775
	(JNIEnv *env, jclass that)
11995
	(JNIEnv *env, jclass that)
Lines 11833-11838 Link Here
11833
}
12053
}
11834
#endif
12054
#endif
11835
12055
12056
#ifndef NO__1gtk_1print_1settings_1set_1default_1source
12057
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1default_1source)
12058
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12059
{
12060
	jbyte *lparg1=NULL;
12061
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC);
12062
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12063
/*
12064
	gtk_print_settings_set_default_source(arg0, lparg1);
12065
*/
12066
	{
12067
		LOAD_FUNCTION(fp, gtk_print_settings_set_default_source)
12068
		if (fp) {
12069
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12070
		}
12071
	}
12072
fail:
12073
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12074
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC);
12075
}
12076
#endif
12077
12078
#ifndef NO__1gtk_1print_1settings_1set_1duplex
12079
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1duplex)
12080
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12081
{
12082
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC);
12083
/*
12084
	gtk_print_settings_set_duplex(arg0, arg1);
12085
*/
12086
	{
12087
		LOAD_FUNCTION(fp, gtk_print_settings_set_duplex)
12088
		if (fp) {
12089
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12090
		}
12091
	}
12092
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC);
12093
}
12094
#endif
12095
12096
#ifndef NO__1gtk_1print_1settings_1set_1media_1type
12097
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1media_1type)
12098
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12099
{
12100
	jbyte *lparg1=NULL;
12101
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1media_1type_FUNC);
12102
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12103
/*
12104
	gtk_print_settings_set_media_type(arg0, lparg1);
12105
*/
12106
	{
12107
		LOAD_FUNCTION(fp, gtk_print_settings_set_media_type)
12108
		if (fp) {
12109
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12110
		}
12111
	}
12112
fail:
12113
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12114
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1media_1type_FUNC);
12115
}
12116
#endif
12117
11836
#ifndef NO__1gtk_1print_1settings_1set_1n_1copies
12118
#ifndef NO__1gtk_1print_1settings_1set_1n_1copies
11837
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1n_1copies)
12119
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1n_1copies)
11838
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12120
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11851-11856 Link Here
11851
}
12133
}
11852
#endif
12134
#endif
11853
12135
12136
#ifndef NO__1gtk_1print_1settings_1set_1number_1up
12137
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1number_1up)
12138
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12139
{
12140
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC);
12141
/*
12142
	gtk_print_settings_set_number_up(arg0, arg1);
12143
*/
12144
	{
12145
		LOAD_FUNCTION(fp, gtk_print_settings_set_number_up)
12146
		if (fp) {
12147
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12148
		}
12149
	}
12150
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC);
12151
}
12152
#endif
12153
11854
#ifndef NO__1gtk_1print_1settings_1set_1orientation
12154
#ifndef NO__1gtk_1print_1settings_1set_1orientation
11855
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1orientation)
12155
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1orientation)
11856
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12156
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11869-11874 Link Here
11869
}
12169
}
11870
#endif
12170
#endif
11871
12171
12172
#ifndef NO__1gtk_1print_1settings_1set_1output_1bin
12173
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1output_1bin)
12174
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12175
{
12176
	jbyte *lparg1=NULL;
12177
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC);
12178
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12179
/*
12180
	gtk_print_settings_set_output_bin(arg0, lparg1);
12181
*/
12182
	{
12183
		LOAD_FUNCTION(fp, gtk_print_settings_set_output_bin)
12184
		if (fp) {
12185
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12186
		}
12187
	}
12188
fail:
12189
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12190
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC);
12191
}
12192
#endif
12193
11872
#ifndef NO__1gtk_1print_1settings_1set_1page_1ranges
12194
#ifndef NO__1gtk_1print_1settings_1set_1page_1ranges
11873
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1page_1ranges)
12195
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1page_1ranges)
11874
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jint arg2)
12196
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jint arg2)
Lines 11891-11896 Link Here
11891
}
12213
}
11892
#endif
12214
#endif
11893
12215
12216
#ifndef NO__1gtk_1print_1settings_1set_1paper_1size
12217
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1paper_1size)
12218
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12219
{
12220
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC);
12221
/*
12222
	gtk_print_settings_set_paper_size(arg0, arg1);
12223
*/
12224
	{
12225
		LOAD_FUNCTION(fp, gtk_print_settings_set_paper_size)
12226
		if (fp) {
12227
			((void (CALLING_CONVENTION*)(jintLong, jintLong))fp)(arg0, arg1);
12228
		}
12229
	}
12230
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC);
12231
}
12232
#endif
12233
11894
#ifndef NO__1gtk_1print_1settings_1set_1print_1pages
12234
#ifndef NO__1gtk_1print_1settings_1set_1print_1pages
11895
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1print_1pages)
12235
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1print_1pages)
11896
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12236
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11931-11936 Link Here
11931
}
12271
}
11932
#endif
12272
#endif
11933
12273
12274
#ifndef NO__1gtk_1print_1settings_1set_1quality
12275
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1quality)
12276
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12277
{
12278
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1quality_FUNC);
12279
/*
12280
	gtk_print_settings_set_quality(arg0, arg1);
12281
*/
12282
	{
12283
		LOAD_FUNCTION(fp, gtk_print_settings_set_quality)
12284
		if (fp) {
12285
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12286
		}
12287
	}
12288
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1quality_FUNC);
12289
}
12290
#endif
12291
12292
#ifndef NO__1gtk_1print_1settings_1set_1resolution_1xy
12293
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1resolution_1xy)
12294
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2)
12295
{
12296
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1resolution_1xy_FUNC);
12297
/*
12298
	gtk_print_settings_set_resolution_xy(arg0, arg1, arg2);
12299
*/
12300
	{
12301
		LOAD_FUNCTION(fp, gtk_print_settings_set_resolution_xy)
12302
		if (fp) {
12303
			((void (CALLING_CONVENTION*)(jintLong, jint, jint))fp)(arg0, arg1, arg2);
12304
		}
12305
	}
12306
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1resolution_1xy_FUNC);
12307
}
12308
#endif
12309
12310
#ifndef NO__1gtk_1print_1settings_1set_1reverse
12311
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1reverse)
12312
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12313
{
12314
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC);
12315
/*
12316
	gtk_print_settings_set_reverse(arg0, arg1);
12317
*/
12318
	{
12319
		LOAD_FUNCTION(fp, gtk_print_settings_set_reverse)
12320
		if (fp) {
12321
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12322
		}
12323
	}
12324
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC);
12325
}
12326
#endif
12327
12328
#ifndef NO__1gtk_1print_1settings_1set_1scale
12329
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1scale)
12330
	(JNIEnv *env, jclass that, jintLong arg0, jdouble arg1)
12331
{
12332
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1scale_FUNC);
12333
/*
12334
	gtk_print_settings_set_scale(arg0, arg1);
12335
*/
12336
	{
12337
		LOAD_FUNCTION(fp, gtk_print_settings_set_scale)
12338
		if (fp) {
12339
			((void (CALLING_CONVENTION*)(jintLong, jdouble))fp)(arg0, arg1);
12340
		}
12341
	}
12342
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1scale_FUNC);
12343
}
12344
#endif
12345
12346
#ifndef NO__1gtk_1print_1settings_1set_1use_1color
12347
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1use_1color)
12348
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12349
{
12350
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC);
12351
/*
12352
	gtk_print_settings_set_use_color(arg0, arg1);
12353
*/
12354
	{
12355
		LOAD_FUNCTION(fp, gtk_print_settings_set_use_color)
12356
		if (fp) {
12357
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12358
		}
12359
	}
12360
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC);
12361
}
12362
#endif
12363
11934
#ifndef NO__1gtk_1print_1unix_1dialog_1get_1current_1page
12364
#ifndef NO__1gtk_1print_1unix_1dialog_1get_1current_1page
11935
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1get_1current_1page)
12365
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1get_1current_1page)
11936
	(JNIEnv *env, jclass that, jintLong arg0)
12366
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 12053-12058 Link Here
12053
}
12483
}
12054
#endif
12484
#endif
12055
12485
12486
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup
12487
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup)
12488
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12489
{
12490
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC);
12491
/*
12492
	gtk_print_unix_dialog_set_embed_page_setup(arg0, arg1);
12493
*/
12494
	{
12495
		LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_embed_page_setup)
12496
		if (fp) {
12497
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12498
		}
12499
	}
12500
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC);
12501
}
12502
#endif
12503
12504
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1has_1selection
12505
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1has_1selection)
12506
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12507
{
12508
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC);
12509
/*
12510
	gtk_print_unix_dialog_set_has_selection(arg0, arg1);
12511
*/
12512
	{
12513
		LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_has_selection)
12514
		if (fp) {
12515
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12516
		}
12517
	}
12518
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC);
12519
}
12520
#endif
12521
12056
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1manual_1capabilities
12522
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1manual_1capabilities
12057
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities)
12523
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities)
12058
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12524
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
Lines 12107-12112 Link Here
12107
}
12573
}
12108
#endif
12574
#endif
12109
12575
12576
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1support_1selection
12577
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1support_1selection)
12578
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12579
{
12580
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC);
12581
/*
12582
	gtk_print_unix_dialog_set_support_selection(arg0, arg1);
12583
*/
12584
	{
12585
		LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_support_selection)
12586
		if (fp) {
12587
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12588
		}
12589
	}
12590
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC);
12591
}
12592
#endif
12593
12110
#ifndef NO__1gtk_1printer_1get_1backend
12594
#ifndef NO__1gtk_1printer_1get_1backend
12111
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1printer_1get_1backend)
12595
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1printer_1get_1backend)
12112
	(JNIEnv *env, jclass that, jintLong arg0)
12596
	(JNIEnv *env, jclass that, jintLong arg0)
(-)Eclipse SWT PI/gtk/library/os_custom.h (-3 / +28 lines)
Lines 150-155 Link Here
150
#define gdk_cairo_region_LIB "libgdk-x11-2.0.so.0"
150
#define gdk_cairo_region_LIB "libgdk-x11-2.0.so.0"
151
#define gdk_cairo_create_LIB "libgdk-x11-2.0.so.0"
151
#define gdk_cairo_create_LIB "libgdk-x11-2.0.so.0"
152
#define gtk_enumerate_printers_LIB "libgtk-x11-2.0.so.0"
152
#define gtk_enumerate_printers_LIB "libgtk-x11-2.0.so.0"
153
#define gtk_printer_get_backend_LIB "libgtk-x11-2.0.so.0"
154
#define gtk_printer_get_name_LIB "libgtk-x11-2.0.so.0"
155
#define gtk_printer_is_default_LIB "libgtk-x11-2.0.so.0"
153
#define gtk_page_setup_get_bottom_margin_LIB "libgtk-x11-2.0.so.0"
156
#define gtk_page_setup_get_bottom_margin_LIB "libgtk-x11-2.0.so.0"
154
#define gtk_page_setup_get_left_margin_LIB "libgtk-x11-2.0.so.0"
157
#define gtk_page_setup_get_left_margin_LIB "libgtk-x11-2.0.so.0"
155
#define gtk_page_setup_get_orientation_LIB "libgtk-x11-2.0.so.0"
158
#define gtk_page_setup_get_orientation_LIB "libgtk-x11-2.0.so.0"
Lines 177-182 Link Here
177
#define gtk_paper_size_new_LIB "libgtk-x11-2.0.so.0"
180
#define gtk_paper_size_new_LIB "libgtk-x11-2.0.so.0"
178
#define gtk_paper_size_new_custom_LIB "libgtk-x11-2.0.so.0"
181
#define gtk_paper_size_new_custom_LIB "libgtk-x11-2.0.so.0"
179
#define gtk_paper_size_new_from_ppd_LIB "libgtk-x11-2.0.so.0"
182
#define gtk_paper_size_new_from_ppd_LIB "libgtk-x11-2.0.so.0"
183
#define gtk_paper_size_get_paper_sizes_LIB "libgtk-x11-2.0.so.0"
180
#define gtk_print_job_get_printer_LIB "libgtk-x11-2.0.so.0"
184
#define gtk_print_job_get_printer_LIB "libgtk-x11-2.0.so.0"
181
#define gtk_print_job_get_settings_LIB "libgtk-x11-2.0.so.0"
185
#define gtk_print_job_get_settings_LIB "libgtk-x11-2.0.so.0"
182
#define gtk_print_job_get_status_LIB "libgtk-x11-2.0.so.0"
186
#define gtk_print_job_get_status_LIB "libgtk-x11-2.0.so.0"
Lines 204-209 Link Here
204
#define gtk_print_settings_set_page_ranges_LIB "libgtk-x11-2.0.so.0"
208
#define gtk_print_settings_set_page_ranges_LIB "libgtk-x11-2.0.so.0"
205
#define gtk_print_settings_set_print_pages_LIB "libgtk-x11-2.0.so.0"
209
#define gtk_print_settings_set_print_pages_LIB "libgtk-x11-2.0.so.0"
206
#define gtk_print_settings_set_printer_LIB "libgtk-x11-2.0.so.0"
210
#define gtk_print_settings_set_printer_LIB "libgtk-x11-2.0.so.0"
211
#define gtk_print_settings_set_number_up_LIB "libgtk-x11-2.0.so.0"
212
#define gtk_print_settings_set_scale_LIB "libgtk-x11-2.0.so.0"
213
#define gtk_print_settings_get_scale_LIB "libgtk-x11-2.0.so.0"
214
#define gtk_print_settings_set_paper_size_LIB "libgtk-x11-2.0.so.0"
215
#define gtk_print_settings_set_duplex_LIB "libgtk-x11-2.0.so.0"
216
#define gtk_print_settings_get_duplex_LIB "libgtk-x11-2.0.so.0"
217
#define gtk_print_settings_get_reverse_LIB "libgtk-x11-2.0.so.0"
218
#define gtk_print_settings_set_reverse_LIB "libgtk-x11-2.0.so.0"
219
#define gtk_print_settings_get_default_source_LIB "libgtk-x11-2.0.so.0"
220
#define gtk_print_settings_set_default_source_LIB "libgtk-x11-2.0.so.0"
221
#define gtk_print_settings_get_media_type_LIB "libgtk-x11-2.0.so.0"
222
#define gtk_print_settings_set_media_type_LIB "libgtk-x11-2.0.so.0"
223
#define gtk_print_settings_get_output_bin_LIB "libgtk-x11-2.0.so.0"
224
#define gtk_print_settings_set_output_bin_LIB "libgtk-x11-2.0.so.0"
225
#define gtk_print_settings_get_use_color_LIB "libgtk-x11-2.0.so.0"
226
#define gtk_print_settings_set_use_color_LIB "libgtk-x11-2.0.so.0"
227
#define gtk_print_settings_get_quality_LIB "libgtk-x11-2.0.so.0"
228
#define gtk_print_settings_set_quality_LIB "libgtk-x11-2.0.so.0"
229
#define gtk_print_settings_set_resolution_xy_LIB "libgtk-x11-2.0.so.0"
230
#define gtk_print_settings_get_resolution_x_LIB "libgtk-x11-2.0.so.0"
231
#define gtk_print_settings_get_resolution_y_LIB "libgtk-x11-2.0.so.0"
207
#define gtk_print_unix_dialog_get_current_page_LIB "libgtk-x11-2.0.so.0"
232
#define gtk_print_unix_dialog_get_current_page_LIB "libgtk-x11-2.0.so.0"
208
#define gtk_print_unix_dialog_get_page_setup_LIB "libgtk-x11-2.0.so.0"
233
#define gtk_print_unix_dialog_get_page_setup_LIB "libgtk-x11-2.0.so.0"
209
#define gtk_print_unix_dialog_get_selected_printer_LIB "libgtk-x11-2.0.so.0"
234
#define gtk_print_unix_dialog_get_selected_printer_LIB "libgtk-x11-2.0.so.0"
Lines 213-221 Link Here
213
#define gtk_print_unix_dialog_set_manual_capabilities_LIB "libgtk-x11-2.0.so.0"
238
#define gtk_print_unix_dialog_set_manual_capabilities_LIB "libgtk-x11-2.0.so.0"
214
#define gtk_print_unix_dialog_set_page_setup_LIB "libgtk-x11-2.0.so.0"
239
#define gtk_print_unix_dialog_set_page_setup_LIB "libgtk-x11-2.0.so.0"
215
#define gtk_print_unix_dialog_set_settings_LIB "libgtk-x11-2.0.so.0"
240
#define gtk_print_unix_dialog_set_settings_LIB "libgtk-x11-2.0.so.0"
216
#define gtk_printer_get_backend_LIB "libgtk-x11-2.0.so.0"
241
#define gtk_print_unix_dialog_set_embed_page_setup_LIB "libgtk-x11-2.0.so.0"
217
#define gtk_printer_get_name_LIB "libgtk-x11-2.0.so.0"
242
#define gtk_print_unix_dialog_set_has_selection_LIB "libgtk-x11-2.0.so.0"
218
#define gtk_printer_is_default_LIB "libgtk-x11-2.0.so.0"
243
#define gtk_print_unix_dialog_set_support_selection_LIB "libgtk-x11-2.0.so.0"
219
#define FcConfigAppFontAddFile_LIB "libfontconfig.so.1"
244
#define FcConfigAppFontAddFile_LIB "libfontconfig.so.1"
220
245
221
#define g_app_info_create_from_commandline_LIB "libgio-2.0.so.0"
246
#define g_app_info_create_from_commandline_LIB "libgio-2.0.so.0"
(-)Eclipse SWT PI/gtk/library/os_stats.c (-2 / +27 lines)
Lines 18-25 Link Here
18
18
19
#ifdef NATIVE_STATS
19
#ifdef NATIVE_STATS
20
20
21
int OS_nativeFunctionCount = 1355;
21
int OS_nativeFunctionCount = 1380;
22
int OS_nativeFunctionCallCount[1355];
22
int OS_nativeFunctionCallCount[1380];
23
char * OS_nativeFunctionNames[] = {
23
char * OS_nativeFunctionNames[] = {
24
#ifndef JNI64
24
#ifndef JNI64
25
	"Call__IIII",
25
	"Call__IIII",
Lines 894-899 Link Here
894
	"_1gtk_1paper_1size_1get_1display_1name",
894
	"_1gtk_1paper_1size_1get_1display_1name",
895
	"_1gtk_1paper_1size_1get_1height",
895
	"_1gtk_1paper_1size_1get_1height",
896
	"_1gtk_1paper_1size_1get_1name",
896
	"_1gtk_1paper_1size_1get_1name",
897
	"_1gtk_1paper_1size_1get_1paper_1sizes",
897
	"_1gtk_1paper_1size_1get_1ppd_1name",
898
	"_1gtk_1paper_1size_1get_1ppd_1name",
898
	"_1gtk_1paper_1size_1get_1width",
899
	"_1gtk_1paper_1size_1get_1width",
899
	"_1gtk_1paper_1size_1is_1custom",
900
	"_1gtk_1paper_1size_1is_1custom",
Lines 913-943 Link Here
913
	"_1gtk_1print_1settings_1foreach",
914
	"_1gtk_1print_1settings_1foreach",
914
	"_1gtk_1print_1settings_1get",
915
	"_1gtk_1print_1settings_1get",
915
	"_1gtk_1print_1settings_1get_1collate",
916
	"_1gtk_1print_1settings_1get_1collate",
917
	"_1gtk_1print_1settings_1get_1default_1source",
918
	"_1gtk_1print_1settings_1get_1duplex",
919
	"_1gtk_1print_1settings_1get_1media_1type",
916
	"_1gtk_1print_1settings_1get_1n_1copies",
920
	"_1gtk_1print_1settings_1get_1n_1copies",
917
	"_1gtk_1print_1settings_1get_1orientation",
921
	"_1gtk_1print_1settings_1get_1orientation",
922
	"_1gtk_1print_1settings_1get_1output_1bin",
918
	"_1gtk_1print_1settings_1get_1page_1ranges",
923
	"_1gtk_1print_1settings_1get_1page_1ranges",
919
	"_1gtk_1print_1settings_1get_1paper_1height",
924
	"_1gtk_1print_1settings_1get_1paper_1height",
920
	"_1gtk_1print_1settings_1get_1paper_1width",
925
	"_1gtk_1print_1settings_1get_1paper_1width",
921
	"_1gtk_1print_1settings_1get_1print_1pages",
926
	"_1gtk_1print_1settings_1get_1print_1pages",
922
	"_1gtk_1print_1settings_1get_1printer",
927
	"_1gtk_1print_1settings_1get_1printer",
928
	"_1gtk_1print_1settings_1get_1quality",
923
	"_1gtk_1print_1settings_1get_1resolution",
929
	"_1gtk_1print_1settings_1get_1resolution",
930
	"_1gtk_1print_1settings_1get_1resolution_1x",
931
	"_1gtk_1print_1settings_1get_1resolution_1y",
932
	"_1gtk_1print_1settings_1get_1reverse",
933
	"_1gtk_1print_1settings_1get_1scale",
934
	"_1gtk_1print_1settings_1get_1use_1color",
924
	"_1gtk_1print_1settings_1new",
935
	"_1gtk_1print_1settings_1new",
925
	"_1gtk_1print_1settings_1set",
936
	"_1gtk_1print_1settings_1set",
926
	"_1gtk_1print_1settings_1set_1collate",
937
	"_1gtk_1print_1settings_1set_1collate",
938
	"_1gtk_1print_1settings_1set_1default_1source",
939
	"_1gtk_1print_1settings_1set_1duplex",
940
	"_1gtk_1print_1settings_1set_1media_1type",
927
	"_1gtk_1print_1settings_1set_1n_1copies",
941
	"_1gtk_1print_1settings_1set_1n_1copies",
942
	"_1gtk_1print_1settings_1set_1number_1up",
928
	"_1gtk_1print_1settings_1set_1orientation",
943
	"_1gtk_1print_1settings_1set_1orientation",
944
	"_1gtk_1print_1settings_1set_1output_1bin",
929
	"_1gtk_1print_1settings_1set_1page_1ranges",
945
	"_1gtk_1print_1settings_1set_1page_1ranges",
946
	"_1gtk_1print_1settings_1set_1paper_1size",
930
	"_1gtk_1print_1settings_1set_1print_1pages",
947
	"_1gtk_1print_1settings_1set_1print_1pages",
931
	"_1gtk_1print_1settings_1set_1printer",
948
	"_1gtk_1print_1settings_1set_1printer",
949
	"_1gtk_1print_1settings_1set_1quality",
950
	"_1gtk_1print_1settings_1set_1resolution_1xy",
951
	"_1gtk_1print_1settings_1set_1reverse",
952
	"_1gtk_1print_1settings_1set_1scale",
953
	"_1gtk_1print_1settings_1set_1use_1color",
932
	"_1gtk_1print_1unix_1dialog_1get_1current_1page",
954
	"_1gtk_1print_1unix_1dialog_1get_1current_1page",
933
	"_1gtk_1print_1unix_1dialog_1get_1page_1setup",
955
	"_1gtk_1print_1unix_1dialog_1get_1page_1setup",
934
	"_1gtk_1print_1unix_1dialog_1get_1selected_1printer",
956
	"_1gtk_1print_1unix_1dialog_1get_1selected_1printer",
935
	"_1gtk_1print_1unix_1dialog_1get_1settings",
957
	"_1gtk_1print_1unix_1dialog_1get_1settings",
936
	"_1gtk_1print_1unix_1dialog_1new",
958
	"_1gtk_1print_1unix_1dialog_1new",
937
	"_1gtk_1print_1unix_1dialog_1set_1current_1page",
959
	"_1gtk_1print_1unix_1dialog_1set_1current_1page",
960
	"_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup",
961
	"_1gtk_1print_1unix_1dialog_1set_1has_1selection",
938
	"_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities",
962
	"_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities",
939
	"_1gtk_1print_1unix_1dialog_1set_1page_1setup",
963
	"_1gtk_1print_1unix_1dialog_1set_1page_1setup",
940
	"_1gtk_1print_1unix_1dialog_1set_1settings",
964
	"_1gtk_1print_1unix_1dialog_1set_1settings",
965
	"_1gtk_1print_1unix_1dialog_1set_1support_1selection",
941
	"_1gtk_1printer_1get_1backend",
966
	"_1gtk_1printer_1get_1backend",
942
	"_1gtk_1printer_1get_1name",
967
	"_1gtk_1printer_1get_1name",
943
	"_1gtk_1printer_1is_1default",
968
	"_1gtk_1printer_1is_1default",
(-)Eclipse SWT PI/gtk/library/os_stats.h (+25 lines)
Lines 902-907 Link Here
902
	_1gtk_1paper_1size_1get_1display_1name_FUNC,
902
	_1gtk_1paper_1size_1get_1display_1name_FUNC,
903
	_1gtk_1paper_1size_1get_1height_FUNC,
903
	_1gtk_1paper_1size_1get_1height_FUNC,
904
	_1gtk_1paper_1size_1get_1name_FUNC,
904
	_1gtk_1paper_1size_1get_1name_FUNC,
905
	_1gtk_1paper_1size_1get_1paper_1sizes_FUNC,
905
	_1gtk_1paper_1size_1get_1ppd_1name_FUNC,
906
	_1gtk_1paper_1size_1get_1ppd_1name_FUNC,
906
	_1gtk_1paper_1size_1get_1width_FUNC,
907
	_1gtk_1paper_1size_1get_1width_FUNC,
907
	_1gtk_1paper_1size_1is_1custom_FUNC,
908
	_1gtk_1paper_1size_1is_1custom_FUNC,
Lines 921-951 Link Here
921
	_1gtk_1print_1settings_1foreach_FUNC,
922
	_1gtk_1print_1settings_1foreach_FUNC,
922
	_1gtk_1print_1settings_1get_FUNC,
923
	_1gtk_1print_1settings_1get_FUNC,
923
	_1gtk_1print_1settings_1get_1collate_FUNC,
924
	_1gtk_1print_1settings_1get_1collate_FUNC,
925
	_1gtk_1print_1settings_1get_1default_1source_FUNC,
926
	_1gtk_1print_1settings_1get_1duplex_FUNC,
927
	_1gtk_1print_1settings_1get_1media_1type_FUNC,
924
	_1gtk_1print_1settings_1get_1n_1copies_FUNC,
928
	_1gtk_1print_1settings_1get_1n_1copies_FUNC,
925
	_1gtk_1print_1settings_1get_1orientation_FUNC,
929
	_1gtk_1print_1settings_1get_1orientation_FUNC,
930
	_1gtk_1print_1settings_1get_1output_1bin_FUNC,
926
	_1gtk_1print_1settings_1get_1page_1ranges_FUNC,
931
	_1gtk_1print_1settings_1get_1page_1ranges_FUNC,
927
	_1gtk_1print_1settings_1get_1paper_1height_FUNC,
932
	_1gtk_1print_1settings_1get_1paper_1height_FUNC,
928
	_1gtk_1print_1settings_1get_1paper_1width_FUNC,
933
	_1gtk_1print_1settings_1get_1paper_1width_FUNC,
929
	_1gtk_1print_1settings_1get_1print_1pages_FUNC,
934
	_1gtk_1print_1settings_1get_1print_1pages_FUNC,
930
	_1gtk_1print_1settings_1get_1printer_FUNC,
935
	_1gtk_1print_1settings_1get_1printer_FUNC,
936
	_1gtk_1print_1settings_1get_1quality_FUNC,
931
	_1gtk_1print_1settings_1get_1resolution_FUNC,
937
	_1gtk_1print_1settings_1get_1resolution_FUNC,
938
	_1gtk_1print_1settings_1get_1resolution_1x_FUNC,
939
	_1gtk_1print_1settings_1get_1resolution_1y_FUNC,
940
	_1gtk_1print_1settings_1get_1reverse_FUNC,
941
	_1gtk_1print_1settings_1get_1scale_FUNC,
942
	_1gtk_1print_1settings_1get_1use_1color_FUNC,
932
	_1gtk_1print_1settings_1new_FUNC,
943
	_1gtk_1print_1settings_1new_FUNC,
933
	_1gtk_1print_1settings_1set_FUNC,
944
	_1gtk_1print_1settings_1set_FUNC,
934
	_1gtk_1print_1settings_1set_1collate_FUNC,
945
	_1gtk_1print_1settings_1set_1collate_FUNC,
946
	_1gtk_1print_1settings_1set_1default_1source_FUNC,
947
	_1gtk_1print_1settings_1set_1duplex_FUNC,
948
	_1gtk_1print_1settings_1set_1media_1type_FUNC,
935
	_1gtk_1print_1settings_1set_1n_1copies_FUNC,
949
	_1gtk_1print_1settings_1set_1n_1copies_FUNC,
950
	_1gtk_1print_1settings_1set_1number_1up_FUNC,
936
	_1gtk_1print_1settings_1set_1orientation_FUNC,
951
	_1gtk_1print_1settings_1set_1orientation_FUNC,
952
	_1gtk_1print_1settings_1set_1output_1bin_FUNC,
937
	_1gtk_1print_1settings_1set_1page_1ranges_FUNC,
953
	_1gtk_1print_1settings_1set_1page_1ranges_FUNC,
954
	_1gtk_1print_1settings_1set_1paper_1size_FUNC,
938
	_1gtk_1print_1settings_1set_1print_1pages_FUNC,
955
	_1gtk_1print_1settings_1set_1print_1pages_FUNC,
939
	_1gtk_1print_1settings_1set_1printer_FUNC,
956
	_1gtk_1print_1settings_1set_1printer_FUNC,
957
	_1gtk_1print_1settings_1set_1quality_FUNC,
958
	_1gtk_1print_1settings_1set_1resolution_1xy_FUNC,
959
	_1gtk_1print_1settings_1set_1reverse_FUNC,
960
	_1gtk_1print_1settings_1set_1scale_FUNC,
961
	_1gtk_1print_1settings_1set_1use_1color_FUNC,
940
	_1gtk_1print_1unix_1dialog_1get_1current_1page_FUNC,
962
	_1gtk_1print_1unix_1dialog_1get_1current_1page_FUNC,
941
	_1gtk_1print_1unix_1dialog_1get_1page_1setup_FUNC,
963
	_1gtk_1print_1unix_1dialog_1get_1page_1setup_FUNC,
942
	_1gtk_1print_1unix_1dialog_1get_1selected_1printer_FUNC,
964
	_1gtk_1print_1unix_1dialog_1get_1selected_1printer_FUNC,
943
	_1gtk_1print_1unix_1dialog_1get_1settings_FUNC,
965
	_1gtk_1print_1unix_1dialog_1get_1settings_FUNC,
944
	_1gtk_1print_1unix_1dialog_1new_FUNC,
966
	_1gtk_1print_1unix_1dialog_1new_FUNC,
945
	_1gtk_1print_1unix_1dialog_1set_1current_1page_FUNC,
967
	_1gtk_1print_1unix_1dialog_1set_1current_1page_FUNC,
968
	_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC,
969
	_1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC,
946
	_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities_FUNC,
970
	_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities_FUNC,
947
	_1gtk_1print_1unix_1dialog_1set_1page_1setup_FUNC,
971
	_1gtk_1print_1unix_1dialog_1set_1page_1setup_FUNC,
948
	_1gtk_1print_1unix_1dialog_1set_1settings_FUNC,
972
	_1gtk_1print_1unix_1dialog_1set_1settings_FUNC,
973
	_1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC,
949
	_1gtk_1printer_1get_1backend_FUNC,
974
	_1gtk_1printer_1get_1backend_FUNC,
950
	_1gtk_1printer_1get_1name_FUNC,
975
	_1gtk_1printer_1get_1name_FUNC,
951
	_1gtk_1printer_1is_1default_FUNC,
976
	_1gtk_1printer_1is_1default_FUNC,
(-)Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java (+253 lines)
Lines 307-315 Link Here
307
	public static final int GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5;
307
	public static final int GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5;
308
	public static final int GTK_PRINT_CAPABILITY_GENERATE_PS  = 1 << 6;
308
	public static final int GTK_PRINT_CAPABILITY_GENERATE_PS  = 1 << 6;
309
	public static final int GTK_PRINT_CAPABILITY_PREVIEW      = 1 << 7;
309
	public static final int GTK_PRINT_CAPABILITY_PREVIEW      = 1 << 7;
310
	public static final int GTK_PRINT_CAPABILITY_NUMBER_UP    = 1 << 8;
310
	public static final int GTK_PRINT_PAGES_ALL = 0;
311
	public static final int GTK_PRINT_PAGES_ALL = 0;
311
	public static final int GTK_PRINT_PAGES_CURRENT = 1;
312
	public static final int GTK_PRINT_PAGES_CURRENT = 1;
312
	public static final int GTK_PRINT_PAGES_RANGES = 2;
313
	public static final int GTK_PRINT_PAGES_RANGES = 2;
314
	public static final int GTK_PRINT_PAGES_SELECTION = 3;
313
	public static final int GTK_PROGRESS_CONTINUOUS = 0x0;
315
	public static final int GTK_PROGRESS_CONTINUOUS = 0x0;
314
	public static final int GTK_PROGRESS_DISCRETE = 0x1;
316
	public static final int GTK_PROGRESS_DISCRETE = 0x1;
315
	public static final int GTK_PROGRESS_LEFT_TO_RIGHT = 0x0;
317
	public static final int GTK_PROGRESS_LEFT_TO_RIGHT = 0x0;
Lines 9063-9068 Link Here
9063
	}
9065
	}
9064
}
9066
}
9065
/** @method flags=dynamic */
9067
/** @method flags=dynamic */
9068
public static final native int /*long*/ _gtk_paper_size_get_paper_sizes(boolean include_custom);
9069
public static final int /*long*/ gtk_paper_size_get_paper_sizes(boolean include_custom) {
9070
	lock.lock();
9071
	try {
9072
		return _gtk_paper_size_get_paper_sizes(include_custom);
9073
	} finally {
9074
		lock.unlock();
9075
	}
9076
}
9077
/** @method flags=dynamic */
9066
public static final native int /*long*/ _gtk_print_settings_new();
9078
public static final native int /*long*/ _gtk_print_settings_new();
9067
public static final int /*long*/ gtk_print_settings_new() {
9079
public static final int /*long*/ gtk_print_settings_new() {
9068
	lock.lock();
9080
	lock.lock();
Lines 9176-9181 Link Here
9176
	}
9188
	}
9177
}
9189
}
9178
/** @method flags=dynamic */
9190
/** @method flags=dynamic */
9191
public static final native void _gtk_print_settings_set_number_up(int /*long*/ settings, int number_up);
9192
public static final void gtk_print_settings_set_number_up(int /*long*/ settings, int number_up) {
9193
	lock.lock();
9194
	try {
9195
		_gtk_print_settings_set_number_up(settings, number_up);
9196
	} finally {
9197
		lock.unlock();
9198
	}
9199
}
9200
/** @method flags=dynamic */
9201
public static final native void _gtk_print_settings_set_duplex(int /*long*/ settings, int duplex);
9202
public static final void gtk_print_settings_set_duplex(int /*long*/ settings, int duplex) {
9203
	lock.lock();
9204
	try {
9205
		_gtk_print_settings_set_duplex(settings, duplex);
9206
	} finally {
9207
		lock.unlock();
9208
	}
9209
}
9210
/** @method flags=dynamic */
9211
public static final native int _gtk_print_settings_get_duplex(int /*long*/ settings);
9212
public static final int gtk_print_settings_get_duplex(int /*long*/ settings) {
9213
	lock.lock();
9214
	try {
9215
		return _gtk_print_settings_get_duplex(settings);
9216
	} finally {
9217
		lock.unlock();
9218
	}
9219
}
9220
/** @method flags=dynamic */
9179
public static final native int _gtk_print_settings_get_n_copies(int /*long*/ settings);
9221
public static final native int _gtk_print_settings_get_n_copies(int /*long*/ settings);
9180
public static final int gtk_print_settings_get_n_copies(int /*long*/ settings) {
9222
public static final int gtk_print_settings_get_n_copies(int /*long*/ settings) {
9181
	lock.lock();
9223
	lock.lock();
Lines 9209-9214 Link Here
9209
	}
9251
	}
9210
}
9252
}
9211
/** @method flags=dynamic */
9253
/** @method flags=dynamic */
9254
public static final native double _gtk_print_settings_get_scale(int /*long*/ settings);
9255
public static final double gtk_print_settings_get_scale(int /*long*/ settings) {
9256
	lock.lock();
9257
	try {
9258
		return _gtk_print_settings_get_scale(settings);
9259
	} finally {
9260
		lock.unlock();
9261
	}
9262
}
9263
/** @method flags=dynamic 
9264
 * @param num_ranges cast=(gdouble)*/
9265
public static final native void _gtk_print_settings_set_scale(int /*long*/ settings, double scale);
9266
public static final void gtk_print_settings_set_scale(int /*long*/ settings, double scale) {
9267
	lock.lock();
9268
	try {
9269
		_gtk_print_settings_set_scale(settings, scale);
9270
	} finally {
9271
		lock.unlock();
9272
	}
9273
}
9274
/** @method flags=dynamic */
9212
public static final native void _gtk_print_settings_set_print_pages(int /*long*/ settings, int pages);
9275
public static final native void _gtk_print_settings_set_print_pages(int /*long*/ settings, int pages);
9213
public static final void gtk_print_settings_set_print_pages(int /*long*/ settings, int pages) {
9276
public static final void gtk_print_settings_set_print_pages(int /*long*/ settings, int pages) {
9214
	lock.lock();
9277
	lock.lock();
Lines 9231-9236 Link Here
9231
		lock.unlock();
9294
		lock.unlock();
9232
	}
9295
	}
9233
}
9296
}
9297
/** @method flags=dynamic */
9298
public static final native void _gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size);
9299
public static final void gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size) {
9300
	lock.lock();
9301
	try {
9302
		_gtk_print_settings_set_paper_size(settings, paper_size);
9303
	} finally {
9304
		lock.unlock();
9305
	}
9306
}
9234
/**
9307
/**
9235
 * @method flags=dynamic
9308
 * @method flags=dynamic
9236
 * @param num_ranges cast=(gint)
9309
 * @param num_ranges cast=(gint)
Lines 9274-9279 Link Here
9274
		lock.unlock();
9347
		lock.unlock();
9275
	}
9348
	}
9276
}
9349
}
9350
/** @method flags=dynamic */
9351
public static final native int _gtk_print_settings_get_reverse(int /*long*/ settings);
9352
public static final int gtk_print_settings_get_reverse(int /*long*/ settings) {
9353
	lock.lock();
9354
	try {
9355
		return _gtk_print_settings_get_reverse(settings);
9356
	} finally {
9357
		lock.unlock();
9358
	}
9359
}
9360
/** @method flags=dynamic */
9361
public static final native void _gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse);
9362
public static final void gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse) {
9363
	lock.lock();
9364
	try {
9365
		_gtk_print_settings_set_reverse(settings, reverse);
9366
	} finally {
9367
		lock.unlock();
9368
	}
9369
}
9370
/** @method flags=dynamic */
9371
public static final native void _gtk_print_settings_set_resolution_xy(int /*long*/ settings, int resolution_x, int resolution_y);
9372
public static final void gtk_print_settings_set_resolution_xy(int /*long*/ settings, int resolution_x, int resolution_y) {
9373
	lock.lock();
9374
	try {
9375
		_gtk_print_settings_set_resolution_xy(settings, resolution_x, resolution_y);
9376
	} finally {
9377
		lock.unlock();
9378
	}
9379
}
9380
/** @method flags=dynamic */
9381
public static final native int _gtk_print_settings_get_resolution_x(int /*long*/ settings);
9382
public static final int gtk_print_settings_get_resolution_x(int /*long*/ settings) {
9383
	lock.lock();
9384
	try {
9385
		return _gtk_print_settings_get_resolution_x(settings);
9386
	} finally {
9387
		lock.unlock();
9388
	}
9389
}
9390
/** @method flags=dynamic */
9391
public static final native int _gtk_print_settings_get_resolution_y(int /*long*/ settings);
9392
public static final int gtk_print_settings_get_resolution_y(int /*long*/ settings) {
9393
	lock.lock();
9394
	try {
9395
		return _gtk_print_settings_get_resolution_y(settings);
9396
	} finally {
9397
		lock.unlock();
9398
	}
9399
}
9400
/** @method flags=dynamic */
9401
public static final native int _gtk_print_settings_get_default_source(int /*long*/ settings);
9402
public static final int gtk_print_settings_get_default_source(int /*long*/ settings) {
9403
	lock.lock();
9404
	try {
9405
		return _gtk_print_settings_get_default_source(settings);
9406
	} finally {
9407
		lock.unlock();
9408
	}
9409
}
9410
/** @method flags=dynamic */
9411
public static final native void _gtk_print_settings_set_default_source(int /*long*/ settings, byte[] default_source);
9412
public static final void gtk_print_settings_set_default_source(int /*long*/ settings, byte[] default_source) {
9413
	lock.lock();
9414
	try {
9415
		_gtk_print_settings_set_default_source(settings, default_source);
9416
	} finally {
9417
		lock.unlock();
9418
	}
9419
}
9420
/** @method flags=dynamic */
9421
public static final native int _gtk_print_settings_get_media_type(int /*long*/ settings);
9422
public static final int gtk_print_settings_get_media_type(int /*long*/ settings) {
9423
	lock.lock();
9424
	try {
9425
		return _gtk_print_settings_get_media_type(settings);
9426
	} finally {
9427
		lock.unlock();
9428
	}
9429
}
9430
/** @method flags=dynamic */
9431
public static final native void _gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type);
9432
public static final void gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type) {
9433
	lock.lock();
9434
	try {
9435
		_gtk_print_settings_set_media_type(settings, media_type);
9436
	} finally {
9437
		lock.unlock();
9438
	}
9439
}
9440
/** @method flags=dynamic */
9441
public static final native int _gtk_print_settings_get_output_bin(int /*long*/ settings);
9442
public static final int gtk_print_settings_get_output_bin(int /*long*/ settings) {
9443
	lock.lock();
9444
	try {
9445
		return _gtk_print_settings_get_output_bin(settings);
9446
	} finally {
9447
		lock.unlock();
9448
	}
9449
}
9450
/** @method flags=dynamic */
9451
public static final native void _gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin);
9452
public static final void gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin) {
9453
	lock.lock();
9454
	try {
9455
		_gtk_print_settings_set_output_bin(settings, output_bin);
9456
	} finally {
9457
		lock.unlock();
9458
	}
9459
}
9460
/** @method flags=dynamic */
9461
public static final native int _gtk_print_settings_get_use_color(int /*long*/ settings);
9462
public static final int gtk_print_settings_get_use_color(int /*long*/ settings) {
9463
	lock.lock();
9464
	try {
9465
		return _gtk_print_settings_get_use_color(settings);
9466
	} finally {
9467
		lock.unlock();
9468
	}
9469
}
9470
/** @method flags=dynamic */
9471
public static final native void _gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color);
9472
public static final void gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color) {
9473
	lock.lock();
9474
	try {
9475
		_gtk_print_settings_set_use_color(settings, use_color);
9476
	} finally {
9477
		lock.unlock();
9478
	}
9479
}
9480
/** @method flags=dynamic */
9481
public static final native int _gtk_print_settings_get_quality(int /*long*/ settings);
9482
public static final int gtk_print_settings_get_quality(int /*long*/ settings) {
9483
	lock.lock();
9484
	try {
9485
		return _gtk_print_settings_get_quality(settings);
9486
	} finally {
9487
		lock.unlock();
9488
	}
9489
}
9490
/** @method flags=dynamic */
9491
public static final native void _gtk_print_settings_set_quality(int /*long*/ settings, int quality);
9492
public static final void gtk_print_settings_set_quality(int /*long*/ settings, int quality) {
9493
	lock.lock();
9494
	try {
9495
		_gtk_print_settings_set_quality(settings, quality);
9496
	} finally {
9497
		lock.unlock();
9498
	}
9499
}
9277
/**
9500
/**
9278
 * @method flags=dynamic
9501
 * @method flags=dynamic
9279
 * @param title cast=(const gchar *)
9502
 * @param title cast=(const gchar *)
Lines 9289-9294 Link Here
9289
	}
9512
	}
9290
}
9513
}
9291
/** @method flags=dynamic */
9514
/** @method flags=dynamic */
9515
public static final native void _gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed);
9516
public static final void gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed) {
9517
	lock.lock();
9518
	try {
9519
		_gtk_print_unix_dialog_set_embed_page_setup(dialog, embed);
9520
	} finally {
9521
		lock.unlock();
9522
	}
9523
}
9524
/** @method flags=dynamic */
9292
public static final native void _gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup);
9525
public static final native void _gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup);
9293
public static final void gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup) {
9526
public static final void gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup) {
9294
	lock.lock();
9527
	lock.lock();
Lines 9299-9304 Link Here
9299
	}
9532
	}
9300
}
9533
}
9301
/** @method flags=dynamic */
9534
/** @method flags=dynamic */
9535
public static final native void _gtk_print_unix_dialog_set_has_selection(int /*long*/ dialog, boolean has_selection);
9536
public static final void gtk_print_unix_dialog_set_has_selection(int /*long*/ dialog, boolean has_selection) {
9537
	lock.lock();
9538
	try {
9539
		_gtk_print_unix_dialog_set_has_selection(dialog, has_selection);
9540
	} finally {
9541
		lock.unlock();
9542
	}
9543
}
9544
/** @method flags=dynamic */
9545
public static final native void _gtk_print_unix_dialog_set_support_selection(int /*long*/ dialog, boolean support_selection);
9546
public static final void gtk_print_unix_dialog_set_support_selection(int /*long*/ dialog, boolean support_selection) {
9547
	lock.lock();
9548
	try {
9549
		_gtk_print_unix_dialog_set_support_selection(dialog, support_selection);
9550
	} finally {
9551
		lock.unlock();
9552
	}
9553
}
9554
/** @method flags=dynamic */
9302
public static final native int /*long*/ _gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog);
9555
public static final native int /*long*/ _gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog);
9303
public static final int /*long*/ gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog) {
9556
public static final int /*long*/ gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog) {
9304
	lock.lock();
9557
	lock.lock();
(-)Eclipse SWT PI/win32/library/os.c (+279 lines)
Lines 135-140 Link Here
135
}
135
}
136
#endif
136
#endif
137
137
138
#ifndef NO_AddForm
139
JNIEXPORT jboolean JNICALL OS_NATIVE(AddForm)
140
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLong arg2)
141
{
142
	jboolean rc = 0;
143
	OS_NATIVE_ENTER(env, that, AddForm_FUNC);
144
	rc = (jboolean)AddForm((HANDLE)arg0, (DWORD)arg1, (LPBYTE)arg2);
145
	OS_NATIVE_EXIT(env, that, AddForm_FUNC);
146
	return rc;
147
}
148
#endif
149
138
#ifndef NO_AdjustWindowRectEx
150
#ifndef NO_AdjustWindowRectEx
139
JNIEXPORT jboolean JNICALL OS_NATIVE(AdjustWindowRectEx)
151
JNIEXPORT jboolean JNICALL OS_NATIVE(AdjustWindowRectEx)
140
	(JNIEnv *env, jclass that, jobject arg0, jint arg1, jboolean arg2, jint arg3)
152
	(JNIEnv *env, jclass that, jobject arg0, jint arg1, jboolean arg2, jint arg3)
Lines 2040-2045 Link Here
2040
}
2052
}
2041
#endif
2053
#endif
2042
2054
2055
#ifndef NO_DeviceCapabilitiesA
2056
JNIEXPORT jint JNICALL OS_NATIVE(DeviceCapabilitiesA)
2057
	(JNIEnv *env, jclass that, jbyteArray arg0, jbyteArray arg1, jint arg2, jintLong arg3, jintLong arg4)
2058
{
2059
	jbyte *lparg0=NULL;
2060
	jbyte *lparg1=NULL;
2061
	jint rc = 0;
2062
	OS_NATIVE_ENTER(env, that, DeviceCapabilitiesA_FUNC);
2063
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
2064
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
2065
	rc = (jint)DeviceCapabilitiesA((LPCTSTR)lparg0, (LPCTSTR)lparg1, (WORD)arg2, (LPTSTR)arg3, (const DEVMODEA *)arg4);
2066
fail:
2067
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
2068
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
2069
	OS_NATIVE_EXIT(env, that, DeviceCapabilitiesA_FUNC);
2070
	return rc;
2071
}
2072
#endif
2073
2074
#ifndef NO_DeviceCapabilitiesW
2075
JNIEXPORT jint JNICALL OS_NATIVE(DeviceCapabilitiesW)
2076
	(JNIEnv *env, jclass that, jcharArray arg0, jcharArray arg1, jint arg2, jintLong arg3, jintLong arg4)
2077
{
2078
	jchar *lparg0=NULL;
2079
	jchar *lparg1=NULL;
2080
	jint rc = 0;
2081
	OS_NATIVE_ENTER(env, that, DeviceCapabilitiesW_FUNC);
2082
	if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail;
2083
	if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail;
2084
	rc = (jint)DeviceCapabilitiesW((LPCWSTR)lparg0, (LPCWSTR)lparg1, (WORD)arg2, (LPWSTR)arg3, (const DEVMODEW *)arg4);
2085
fail:
2086
	if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0);
2087
	if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0);
2088
	OS_NATIVE_EXIT(env, that, DeviceCapabilitiesW_FUNC);
2089
	return rc;
2090
}
2091
#endif
2092
2043
#ifndef NO_DispatchMessageA
2093
#ifndef NO_DispatchMessageA
2044
JNIEXPORT jintLong JNICALL OS_NATIVE(DispatchMessageA)
2094
JNIEXPORT jintLong JNICALL OS_NATIVE(DispatchMessageA)
2045
	(JNIEnv *env, jclass that, jobject arg0)
2095
	(JNIEnv *env, jclass that, jobject arg0)
Lines 2072-2077 Link Here
2072
}
2122
}
2073
#endif
2123
#endif
2074
2124
2125
#ifndef NO_DocumentPropertiesA
2126
JNIEXPORT jint JNICALL OS_NATIVE(DocumentPropertiesA)
2127
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jbyteArray arg2, jintLong arg3, jintLong arg4, jint arg5)
2128
{
2129
	jbyte *lparg2=NULL;
2130
	jint rc = 0;
2131
	OS_NATIVE_ENTER(env, that, DocumentPropertiesA_FUNC);
2132
	if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail;
2133
	rc = (jint)DocumentPropertiesA((HWND)arg0, (HANDLE)arg1, (LPTSTR)lparg2, (PDEVMODE)arg3, (PDEVMODE)arg4, (DWORD)arg5);
2134
fail:
2135
	if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
2136
	OS_NATIVE_EXIT(env, that, DocumentPropertiesA_FUNC);
2137
	return rc;
2138
}
2139
#endif
2140
2141
#ifndef NO_DocumentPropertiesW
2142
JNIEXPORT jint JNICALL OS_NATIVE(DocumentPropertiesW)
2143
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jcharArray arg2, jintLong arg3, jintLong arg4, jint arg5)
2144
{
2145
	jchar *lparg2=NULL;
2146
	jint rc = 0;
2147
	OS_NATIVE_ENTER(env, that, DocumentPropertiesW_FUNC);
2148
	if (arg2) if ((lparg2 = (*env)->GetCharArrayElements(env, arg2, NULL)) == NULL) goto fail;
2149
	rc = (jint)DocumentPropertiesW((HWND)arg0, (HANDLE)arg1, (LPWSTR)lparg2, (PDEVMODEW)arg3, (PDEVMODEW)arg4, (DWORD)arg5);
2150
fail:
2151
	if (arg2 && lparg2) (*env)->ReleaseCharArrayElements(env, arg2, lparg2, 0);
2152
	OS_NATIVE_EXIT(env, that, DocumentPropertiesW_FUNC);
2153
	return rc;
2154
}
2155
#endif
2156
2075
#ifndef NO_DragDetect
2157
#ifndef NO_DragDetect
2076
JNIEXPORT jboolean JNICALL OS_NATIVE(DragDetect)
2158
JNIEXPORT jboolean JNICALL OS_NATIVE(DragDetect)
2077
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
2159
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
Lines 3099-3104 Link Here
3099
}
3181
}
3100
#endif
3182
#endif
3101
3183
3184
#ifndef NO_FORM_1INFO_11_1sizeof
3185
JNIEXPORT jint JNICALL OS_NATIVE(FORM_1INFO_11_1sizeof)
3186
	(JNIEnv *env, jclass that)
3187
{
3188
	jint rc = 0;
3189
	OS_NATIVE_ENTER(env, that, FORM_1INFO_11_1sizeof_FUNC);
3190
	rc = (jint)FORM_INFO_1_sizeof();
3191
	OS_NATIVE_EXIT(env, that, FORM_1INFO_11_1sizeof_FUNC);
3192
	return rc;
3193
}
3194
#endif
3195
3102
#ifndef NO_FillPath
3196
#ifndef NO_FillPath
3103
JNIEXPORT jboolean JNICALL OS_NATIVE(FillPath)
3197
JNIEXPORT jboolean JNICALL OS_NATIVE(FillPath)
3104
	(JNIEnv *env, jclass that, jintLong arg0)
3198
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 3940-3945 Link Here
3940
}
4034
}
3941
#endif
4035
#endif
3942
4036
4037
#ifndef NO_GetDefaultPrinterA
4038
JNIEXPORT jboolean JNICALL OS_NATIVE(GetDefaultPrinterA)
4039
	(JNIEnv *env, jclass that, jbyteArray arg0, jintArray arg1)
4040
{
4041
	jbyte *lparg0=NULL;
4042
	jint *lparg1=NULL;
4043
	jboolean rc = 0;
4044
	OS_NATIVE_ENTER(env, that, GetDefaultPrinterA_FUNC);
4045
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
4046
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4047
	rc = (jboolean)GetDefaultPrinterA((LPTSTR)lparg0, (LPDWORD)lparg1);
4048
fail:
4049
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4050
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
4051
	OS_NATIVE_EXIT(env, that, GetDefaultPrinterA_FUNC);
4052
	return rc;
4053
}
4054
#endif
4055
4056
#ifndef NO_GetDefaultPrinterW
4057
JNIEXPORT jboolean JNICALL OS_NATIVE(GetDefaultPrinterW)
4058
	(JNIEnv *env, jclass that, jcharArray arg0, jintArray arg1)
4059
{
4060
	jchar *lparg0=NULL;
4061
	jint *lparg1=NULL;
4062
	jboolean rc = 0;
4063
	OS_NATIVE_ENTER(env, that, GetDefaultPrinterW_FUNC);
4064
	if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail;
4065
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4066
	rc = (jboolean)GetDefaultPrinterW((LPWSTR)lparg0, (LPDWORD)lparg1);
4067
fail:
4068
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4069
	if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0);
4070
	OS_NATIVE_EXIT(env, that, GetDefaultPrinterW_FUNC);
4071
	return rc;
4072
}
4073
#endif
4074
3943
#ifndef NO_GetDesktopWindow
4075
#ifndef NO_GetDesktopWindow
3944
JNIEXPORT jintLong JNICALL OS_NATIVE(GetDesktopWindow)
4076
JNIEXPORT jintLong JNICALL OS_NATIVE(GetDesktopWindow)
3945
	(JNIEnv *env, jclass that)
4077
	(JNIEnv *env, jclass that)
Lines 8534-8539 Link Here
8534
}
8666
}
8535
#endif
8667
#endif
8536
8668
8669
#if (!defined(NO_MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I) && !defined(JNI64)) || (!defined(NO_MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I) && defined(JNI64))
8670
#ifndef JNI64
8671
JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2)
8672
#else
8673
JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2)
8674
#endif
8675
{
8676
	FORM_INFO_1 _arg1, *lparg1=NULL;
8677
#ifndef JNI64
8678
	OS_NATIVE_ENTER(env, that, MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC);
8679
#else
8680
	OS_NATIVE_ENTER(env, that, MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC);
8681
#endif
8682
	if (arg1) if ((lparg1 = getFORM_INFO_1Fields(env, arg1, &_arg1)) == NULL) goto fail;
8683
	MoveMemory((PVOID)arg0, lparg1, arg2);
8684
fail:
8685
	if (arg1 && lparg1) setFORM_INFO_1Fields(env, arg1, lparg1);
8686
#ifndef JNI64
8687
	OS_NATIVE_EXIT(env, that, MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC);
8688
#else
8689
	OS_NATIVE_EXIT(env, that, MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC);
8690
#endif
8691
}
8692
#endif
8693
8537
#if (!defined(NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && !defined(JNI64)) || (!defined(NO_MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && defined(JNI64))
8694
#if (!defined(NO_MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && !defined(JNI64)) || (!defined(NO_MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I) && defined(JNI64))
8538
#ifndef JNI64
8695
#ifndef JNI64
8539
JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2)
8696
JNIEXPORT void JNICALL OS_NATIVE(MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2)
Lines 11572-11577 Link Here
11572
}
11729
}
11573
#endif
11730
#endif
11574
11731
11732
#ifndef NO_OpenPrinterA
11733
JNIEXPORT jboolean JNICALL OS_NATIVE(OpenPrinterA)
11734
	(JNIEnv *env, jclass that, jbyteArray arg0, jintLongArray arg1, jintLongArray arg2)
11735
{
11736
	jbyte *lparg0=NULL;
11737
	jintLong *lparg1=NULL;
11738
	jintLong *lparg2=NULL;
11739
	jboolean rc = 0;
11740
	OS_NATIVE_ENTER(env, that, OpenPrinterA_FUNC);
11741
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
11742
	if (arg1) if ((lparg1 = (*env)->GetIntLongArrayElements(env, arg1, NULL)) == NULL) goto fail;
11743
	if (arg2) if ((lparg2 = (*env)->GetIntLongArrayElements(env, arg2, NULL)) == NULL) goto fail;
11744
	rc = (jboolean)OpenPrinterA((LPTSTR)lparg0, (LPHANDLE)lparg1, (LPPRINTER_DEFAULTS)lparg2);
11745
fail:
11746
	if (arg2 && lparg2) (*env)->ReleaseIntLongArrayElements(env, arg2, lparg2, 0);
11747
	if (arg1 && lparg1) (*env)->ReleaseIntLongArrayElements(env, arg1, lparg1, 0);
11748
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
11749
	OS_NATIVE_EXIT(env, that, OpenPrinterA_FUNC);
11750
	return rc;
11751
}
11752
#endif
11753
11754
#ifndef NO_OpenPrinterW
11755
JNIEXPORT jboolean JNICALL OS_NATIVE(OpenPrinterW)
11756
	(JNIEnv *env, jclass that, jcharArray arg0, jintLongArray arg1, jintLongArray arg2)
11757
{
11758
	jchar *lparg0=NULL;
11759
	jintLong *lparg1=NULL;
11760
	jintLong *lparg2=NULL;
11761
	jboolean rc = 0;
11762
	OS_NATIVE_ENTER(env, that, OpenPrinterW_FUNC);
11763
	if (arg0) if ((lparg0 = (*env)->GetCharArrayElements(env, arg0, NULL)) == NULL) goto fail;
11764
	if (arg1) if ((lparg1 = (*env)->GetIntLongArrayElements(env, arg1, NULL)) == NULL) goto fail;
11765
	if (arg2) if ((lparg2 = (*env)->GetIntLongArrayElements(env, arg2, NULL)) == NULL) goto fail;
11766
	rc = (jboolean)OpenPrinterW((LPWSTR)lparg0, (LPHANDLE)lparg1, (LPPRINTER_DEFAULTSW)lparg2);
11767
fail:
11768
	if (arg2 && lparg2) (*env)->ReleaseIntLongArrayElements(env, arg2, lparg2, 0);
11769
	if (arg1 && lparg1) (*env)->ReleaseIntLongArrayElements(env, arg1, lparg1, 0);
11770
	if (arg0 && lparg0) (*env)->ReleaseCharArrayElements(env, arg0, lparg0, 0);
11771
	OS_NATIVE_EXIT(env, that, OpenPrinterW_FUNC);
11772
	return rc;
11773
}
11774
#endif
11775
11575
#ifndef NO_OpenProcess
11776
#ifndef NO_OpenProcess
11576
JNIEXPORT jintLong JNICALL OS_NATIVE(OpenProcess)
11777
JNIEXPORT jintLong JNICALL OS_NATIVE(OpenProcess)
11577
	(JNIEnv *env, jclass that, jint arg0, jboolean arg1, jint arg2)
11778
	(JNIEnv *env, jclass that, jint arg0, jboolean arg1, jint arg2)
Lines 12014-12019 Link Here
12014
}
12215
}
12015
#endif
12216
#endif
12016
12217
12218
#ifndef NO_RECTL_1sizeof
12219
JNIEXPORT jint JNICALL OS_NATIVE(RECTL_1sizeof)
12220
	(JNIEnv *env, jclass that)
12221
{
12222
	jint rc = 0;
12223
	OS_NATIVE_ENTER(env, that, RECTL_1sizeof_FUNC);
12224
	rc = (jint)RECTL_sizeof();
12225
	OS_NATIVE_EXIT(env, that, RECTL_1sizeof_FUNC);
12226
	return rc;
12227
}
12228
#endif
12229
12017
#ifndef NO_RECT_1sizeof
12230
#ifndef NO_RECT_1sizeof
12018
JNIEXPORT jint JNICALL OS_NATIVE(RECT_1sizeof)
12231
JNIEXPORT jint JNICALL OS_NATIVE(RECT_1sizeof)
12019
	(JNIEnv *env, jclass that)
12232
	(JNIEnv *env, jclass that)
Lines 12579-12584 Link Here
12579
}
12792
}
12580
#endif
12793
#endif
12581
12794
12795
#ifndef NO_ResetDCA
12796
JNIEXPORT jintLong JNICALL OS_NATIVE(ResetDCA)
12797
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12798
{
12799
	jintLong rc = 0;
12800
	OS_NATIVE_ENTER(env, that, ResetDCA_FUNC);
12801
	rc = (jintLong)ResetDCA((HDC)arg0, (CONST VOID *)arg1);
12802
	OS_NATIVE_EXIT(env, that, ResetDCA_FUNC);
12803
	return rc;
12804
}
12805
#endif
12806
12807
#ifndef NO_ResetDCW
12808
JNIEXPORT jintLong JNICALL OS_NATIVE(ResetDCW)
12809
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12810
{
12811
	jintLong rc = 0;
12812
	OS_NATIVE_ENTER(env, that, ResetDCW_FUNC);
12813
	rc = (jintLong)ResetDCW((HDC)arg0, (CONST VOID *)arg1);
12814
	OS_NATIVE_EXIT(env, that, ResetDCW_FUNC);
12815
	return rc;
12816
}
12817
#endif
12818
12582
#ifndef NO_RestoreDC
12819
#ifndef NO_RestoreDC
12583
JNIEXPORT jboolean JNICALL OS_NATIVE(RestoreDC)
12820
JNIEXPORT jboolean JNICALL OS_NATIVE(RestoreDC)
12584
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12821
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 15631-15636 Link Here
15631
}
15868
}
15632
#endif
15869
#endif
15633
15870
15871
#ifndef NO_SetFormA
15872
JNIEXPORT jboolean JNICALL OS_NATIVE(SetFormA)
15873
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1, jint arg2, jintLong arg3)
15874
{
15875
	jbyte *lparg1=NULL;
15876
	jboolean rc = 0;
15877
	OS_NATIVE_ENTER(env, that, SetFormA_FUNC);
15878
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
15879
	rc = (jboolean)SetFormA((HANDLE)arg0, (LPSTR)lparg1, (DWORD)arg2, (LPBYTE)arg3);
15880
fail:
15881
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
15882
	OS_NATIVE_EXIT(env, that, SetFormA_FUNC);
15883
	return rc;
15884
}
15885
#endif
15886
15887
#ifndef NO_SetFormW
15888
JNIEXPORT jboolean JNICALL OS_NATIVE(SetFormW)
15889
	(JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jint arg2, jintLong arg3)
15890
{
15891
	jchar *lparg1=NULL;
15892
	jboolean rc = 0;
15893
	OS_NATIVE_ENTER(env, that, SetFormW_FUNC);
15894
	if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail;
15895
	rc = (jboolean)SetFormW((HANDLE)arg0, (LPWSTR)lparg1, (DWORD)arg2, (LPBYTE)arg3);
15896
fail:
15897
	if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0);
15898
	OS_NATIVE_EXIT(env, that, SetFormW_FUNC);
15899
	return rc;
15900
}
15901
#endif
15902
15634
#ifndef NO_SetGraphicsMode
15903
#ifndef NO_SetGraphicsMode
15635
JNIEXPORT jint JNICALL OS_NATIVE(SetGraphicsMode)
15904
JNIEXPORT jint JNICALL OS_NATIVE(SetGraphicsMode)
15636
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
15905
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 18091-18096 Link Here
18091
}
18360
}
18092
#endif
18361
#endif
18093
18362
18363
#ifndef NO_updateNup
18364
JNIEXPORT void JNICALL OS_NATIVE(updateNup)
18365
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
18366
{
18367
	OS_NATIVE_ENTER(env, that, updateNup_FUNC);
18368
	updateNup((CONST VOID *)arg0, arg1);
18369
	OS_NATIVE_EXIT(env, that, updateNup_FUNC);
18370
}
18371
#endif
18372
18094
#ifndef NO_wcslen
18373
#ifndef NO_wcslen
18095
JNIEXPORT jint JNICALL OS_NATIVE(wcslen)
18374
JNIEXPORT jint JNICALL OS_NATIVE(wcslen)
18096
	(JNIEnv *env, jclass that, jintLong arg0)
18375
	(JNIEnv *env, jclass that, jintLong arg0)
(-)Eclipse SWT PI/win32/library/os_custom.h (+1 lines)
Lines 82-84 Link Here
82
#define SHCreateItemInKnownFolder_LIB "shell32.dll"
82
#define SHCreateItemInKnownFolder_LIB "shell32.dll"
83
#define TransparentBlt_LIB "msimg32.dll"
83
#define TransparentBlt_LIB "msimg32.dll"
84
#define UpdateLayeredWindow_LIB "user32.dll"
84
#define UpdateLayeredWindow_LIB "user32.dll"
85
#define updateNup(arg0, arg1) ((PBYTE) (((BYTE *)arg0) + ((LPDEVMODE)arg0)->dmSize))[24] = arg1
(-)Eclipse SWT PI/win32/library/os_stats.c (-2 / +23 lines)
Lines 14-21 Link Here
14
14
15
#ifdef NATIVE_STATS
15
#ifdef NATIVE_STATS
16
16
17
int OS_nativeFunctionCount = 1008;
17
int OS_nativeFunctionCount = 1025;
18
int OS_nativeFunctionCallCount[1008];
18
int OS_nativeFunctionCallCount[1025];
19
char * OS_nativeFunctionNames[] = {
19
char * OS_nativeFunctionNames[] = {
20
	"ACCEL_1sizeof",
20
	"ACCEL_1sizeof",
21
	"ACTCTX_1sizeof",
21
	"ACTCTX_1sizeof",
Lines 24-29 Link Here
24
	"ActivateKeyboardLayout",
24
	"ActivateKeyboardLayout",
25
	"AddFontResourceExA",
25
	"AddFontResourceExA",
26
	"AddFontResourceExW",
26
	"AddFontResourceExW",
27
	"AddForm",
27
	"AdjustWindowRectEx",
28
	"AdjustWindowRectEx",
28
	"AllowSetForegroundWindow",
29
	"AllowSetForegroundWindow",
29
	"AlphaBlend",
30
	"AlphaBlend",
Lines 162-169 Link Here
162
	"DestroyIcon",
163
	"DestroyIcon",
163
	"DestroyMenu",
164
	"DestroyMenu",
164
	"DestroyWindow",
165
	"DestroyWindow",
166
	"DeviceCapabilitiesA",
167
	"DeviceCapabilitiesW",
165
	"DispatchMessageA",
168
	"DispatchMessageA",
166
	"DispatchMessageW",
169
	"DispatchMessageW",
170
	"DocumentPropertiesA",
171
	"DocumentPropertiesW",
167
	"DragDetect",
172
	"DragDetect",
168
	"DragFinish",
173
	"DragFinish",
169
	"DragQueryFileA",
174
	"DragQueryFileA",
Lines 222-227 Link Here
222
	"ExtractIconExA",
227
	"ExtractIconExA",
223
	"ExtractIconExW",
228
	"ExtractIconExW",
224
	"FILETIME_1sizeof",
229
	"FILETIME_1sizeof",
230
	"FORM_1INFO_11_1sizeof",
225
	"FillPath",
231
	"FillPath",
226
	"FillRect",
232
	"FillRect",
227
	"FindWindowA",
233
	"FindWindowA",
Lines 271-276 Link Here
271
	"GetDIBits",
277
	"GetDIBits",
272
	"GetDateFormatA",
278
	"GetDateFormatA",
273
	"GetDateFormatW",
279
	"GetDateFormatW",
280
	"GetDefaultPrinterA",
281
	"GetDefaultPrinterW",
274
	"GetDesktopWindow",
282
	"GetDesktopWindow",
275
	"GetDeviceCaps",
283
	"GetDeviceCaps",
276
	"GetDialogBaseUnits",
284
	"GetDialogBaseUnits",
Lines 678-683 Link Here
678
	"MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I",
686
	"MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I",
679
#endif
687
#endif
680
#ifndef JNI64
688
#ifndef JNI64
689
	"MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I",
690
#else
691
	"MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I",
692
#endif
693
#ifndef JNI64
681
	"MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I",
694
	"MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I",
682
#else
695
#else
683
	"MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I",
696
	"MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I",
Lines 1159-1164 Link Here
1159
	"OleInitialize",
1172
	"OleInitialize",
1160
	"OleUninitialize",
1173
	"OleUninitialize",
1161
	"OpenClipboard",
1174
	"OpenClipboard",
1175
	"OpenPrinterA",
1176
	"OpenPrinterW",
1162
	"OpenProcess",
1177
	"OpenProcess",
1163
	"OpenThemeData",
1178
	"OpenThemeData",
1164
	"PAINTSTRUCT_1sizeof",
1179
	"PAINTSTRUCT_1sizeof",
Lines 1188-1193 Link Here
1188
	"PtInRect",
1203
	"PtInRect",
1189
	"PtInRegion",
1204
	"PtInRegion",
1190
	"REBARBANDINFO_1sizeof",
1205
	"REBARBANDINFO_1sizeof",
1206
	"RECTL_1sizeof",
1191
	"RECT_1sizeof",
1207
	"RECT_1sizeof",
1192
	"RealizePalette",
1208
	"RealizePalette",
1193
	"RectInRegion",
1209
	"RectInRegion",
Lines 1232-1237 Link Here
1232
	"RemovePropA",
1248
	"RemovePropA",
1233
	"RemovePropW",
1249
	"RemovePropW",
1234
	"ReplyMessage",
1250
	"ReplyMessage",
1251
	"ResetDCA",
1252
	"ResetDCW",
1235
	"RestoreDC",
1253
	"RestoreDC",
1236
	"RoundRect",
1254
	"RoundRect",
1237
	"SAFEARRAYBOUND_1sizeof",
1255
	"SAFEARRAYBOUND_1sizeof",
Lines 1651-1656 Link Here
1651
	"SetErrorMode",
1669
	"SetErrorMode",
1652
	"SetFocus",
1670
	"SetFocus",
1653
	"SetForegroundWindow",
1671
	"SetForegroundWindow",
1672
	"SetFormA",
1673
	"SetFormW",
1654
	"SetGraphicsMode",
1674
	"SetGraphicsMode",
1655
	"SetLayeredWindowAttributes",
1675
	"SetLayeredWindowAttributes",
1656
	"SetLayout",
1676
	"SetLayout",
Lines 1912-1917 Link Here
1912
	"WideCharToMultiByte__II_3CI_3BI_3B_3Z",
1932
	"WideCharToMultiByte__II_3CI_3BI_3B_3Z",
1913
	"WindowFromDC",
1933
	"WindowFromDC",
1914
	"WindowFromPoint",
1934
	"WindowFromPoint",
1935
	"updateNup",
1915
	"wcslen",
1936
	"wcslen",
1916
};
1937
};
1917
1938
(-)Eclipse SWT PI/win32/library/os_stats.h (+21 lines)
Lines 32-37 Link Here
32
	ActivateKeyboardLayout_FUNC,
32
	ActivateKeyboardLayout_FUNC,
33
	AddFontResourceExA_FUNC,
33
	AddFontResourceExA_FUNC,
34
	AddFontResourceExW_FUNC,
34
	AddFontResourceExW_FUNC,
35
	AddForm_FUNC,
35
	AdjustWindowRectEx_FUNC,
36
	AdjustWindowRectEx_FUNC,
36
	AllowSetForegroundWindow_FUNC,
37
	AllowSetForegroundWindow_FUNC,
37
	AlphaBlend_FUNC,
38
	AlphaBlend_FUNC,
Lines 170-177 Link Here
170
	DestroyIcon_FUNC,
171
	DestroyIcon_FUNC,
171
	DestroyMenu_FUNC,
172
	DestroyMenu_FUNC,
172
	DestroyWindow_FUNC,
173
	DestroyWindow_FUNC,
174
	DeviceCapabilitiesA_FUNC,
175
	DeviceCapabilitiesW_FUNC,
173
	DispatchMessageA_FUNC,
176
	DispatchMessageA_FUNC,
174
	DispatchMessageW_FUNC,
177
	DispatchMessageW_FUNC,
178
	DocumentPropertiesA_FUNC,
179
	DocumentPropertiesW_FUNC,
175
	DragDetect_FUNC,
180
	DragDetect_FUNC,
176
	DragFinish_FUNC,
181
	DragFinish_FUNC,
177
	DragQueryFileA_FUNC,
182
	DragQueryFileA_FUNC,
Lines 230-235 Link Here
230
	ExtractIconExA_FUNC,
235
	ExtractIconExA_FUNC,
231
	ExtractIconExW_FUNC,
236
	ExtractIconExW_FUNC,
232
	FILETIME_1sizeof_FUNC,
237
	FILETIME_1sizeof_FUNC,
238
	FORM_1INFO_11_1sizeof_FUNC,
233
	FillPath_FUNC,
239
	FillPath_FUNC,
234
	FillRect_FUNC,
240
	FillRect_FUNC,
235
	FindWindowA_FUNC,
241
	FindWindowA_FUNC,
Lines 279-284 Link Here
279
	GetDIBits_FUNC,
285
	GetDIBits_FUNC,
280
	GetDateFormatA_FUNC,
286
	GetDateFormatA_FUNC,
281
	GetDateFormatW_FUNC,
287
	GetDateFormatW_FUNC,
288
	GetDefaultPrinterA_FUNC,
289
	GetDefaultPrinterW_FUNC,
282
	GetDesktopWindow_FUNC,
290
	GetDesktopWindow_FUNC,
283
	GetDeviceCaps_FUNC,
291
	GetDeviceCaps_FUNC,
284
	GetDialogBaseUnits_FUNC,
292
	GetDialogBaseUnits_FUNC,
Lines 686-691 Link Here
686
	MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I_FUNC,
694
	MoveMemory__JLorg_eclipse_swt_internal_win32_DROPFILES_2I_FUNC,
687
#endif
695
#endif
688
#ifndef JNI64
696
#ifndef JNI64
697
	MoveMemory__ILorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC,
698
#else
699
	MoveMemory__JLorg_eclipse_swt_internal_win32_FORM_1INFO_11_2I_FUNC,
700
#endif
701
#ifndef JNI64
689
	MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC,
702
	MoveMemory__ILorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC,
690
#else
703
#else
691
	MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC,
704
	MoveMemory__JLorg_eclipse_swt_internal_win32_GRADIENT_1RECT_2I_FUNC,
Lines 1167-1172 Link Here
1167
	OleInitialize_FUNC,
1180
	OleInitialize_FUNC,
1168
	OleUninitialize_FUNC,
1181
	OleUninitialize_FUNC,
1169
	OpenClipboard_FUNC,
1182
	OpenClipboard_FUNC,
1183
	OpenPrinterA_FUNC,
1184
	OpenPrinterW_FUNC,
1170
	OpenProcess_FUNC,
1185
	OpenProcess_FUNC,
1171
	OpenThemeData_FUNC,
1186
	OpenThemeData_FUNC,
1172
	PAINTSTRUCT_1sizeof_FUNC,
1187
	PAINTSTRUCT_1sizeof_FUNC,
Lines 1196-1201 Link Here
1196
	PtInRect_FUNC,
1211
	PtInRect_FUNC,
1197
	PtInRegion_FUNC,
1212
	PtInRegion_FUNC,
1198
	REBARBANDINFO_1sizeof_FUNC,
1213
	REBARBANDINFO_1sizeof_FUNC,
1214
	RECTL_1sizeof_FUNC,
1199
	RECT_1sizeof_FUNC,
1215
	RECT_1sizeof_FUNC,
1200
	RealizePalette_FUNC,
1216
	RealizePalette_FUNC,
1201
	RectInRegion_FUNC,
1217
	RectInRegion_FUNC,
Lines 1240-1245 Link Here
1240
	RemovePropA_FUNC,
1256
	RemovePropA_FUNC,
1241
	RemovePropW_FUNC,
1257
	RemovePropW_FUNC,
1242
	ReplyMessage_FUNC,
1258
	ReplyMessage_FUNC,
1259
	ResetDCA_FUNC,
1260
	ResetDCW_FUNC,
1243
	RestoreDC_FUNC,
1261
	RestoreDC_FUNC,
1244
	RoundRect_FUNC,
1262
	RoundRect_FUNC,
1245
	SAFEARRAYBOUND_1sizeof_FUNC,
1263
	SAFEARRAYBOUND_1sizeof_FUNC,
Lines 1659-1664 Link Here
1659
	SetErrorMode_FUNC,
1677
	SetErrorMode_FUNC,
1660
	SetFocus_FUNC,
1678
	SetFocus_FUNC,
1661
	SetForegroundWindow_FUNC,
1679
	SetForegroundWindow_FUNC,
1680
	SetFormA_FUNC,
1681
	SetFormW_FUNC,
1662
	SetGraphicsMode_FUNC,
1682
	SetGraphicsMode_FUNC,
1663
	SetLayeredWindowAttributes_FUNC,
1683
	SetLayeredWindowAttributes_FUNC,
1664
	SetLayout_FUNC,
1684
	SetLayout_FUNC,
Lines 1920-1924 Link Here
1920
	WideCharToMultiByte__II_3CI_3BI_3B_3Z_FUNC,
1940
	WideCharToMultiByte__II_3CI_3BI_3B_3Z_FUNC,
1921
	WindowFromDC_FUNC,
1941
	WindowFromDC_FUNC,
1922
	WindowFromPoint_FUNC,
1942
	WindowFromPoint_FUNC,
1943
	updateNup_FUNC,
1923
	wcslen_FUNC,
1944
	wcslen_FUNC,
1924
} OS_FUNCS;
1945
} OS_FUNCS;
(-)Eclipse SWT PI/win32/library/os_structs.c (+92 lines)
Lines 1721-1726 Link Here
1721
}
1721
}
1722
#endif
1722
#endif
1723
1723
1724
#ifndef NO_FORM_INFO_1
1725
typedef struct FORM_INFO_1_FID_CACHE {
1726
	int cached;
1727
	jclass clazz;
1728
	jfieldID Flags, pName, Size, ImageableArea;
1729
} FORM_INFO_1_FID_CACHE;
1730
1731
FORM_INFO_1_FID_CACHE FORM_INFO_1Fc;
1732
1733
void cacheFORM_INFO_1Fields(JNIEnv *env, jobject lpObject)
1734
{
1735
	if (FORM_INFO_1Fc.cached) return;
1736
	FORM_INFO_1Fc.clazz = (*env)->GetObjectClass(env, lpObject);
1737
	FORM_INFO_1Fc.Flags = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "Flags", "I");
1738
	FORM_INFO_1Fc.pName = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "pName", I_J);
1739
	FORM_INFO_1Fc.Size = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "Size", "Lorg/eclipse/swt/internal/win32/SIZE;");
1740
	FORM_INFO_1Fc.ImageableArea = (*env)->GetFieldID(env, FORM_INFO_1Fc.clazz, "ImageableArea", "Lorg/eclipse/swt/internal/win32/RECTL;");
1741
	FORM_INFO_1Fc.cached = 1;
1742
}
1743
1744
FORM_INFO_1 *getFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct)
1745
{
1746
	if (!FORM_INFO_1Fc.cached) cacheFORM_INFO_1Fields(env, lpObject);
1747
	lpStruct->Flags = (*env)->GetIntField(env, lpObject, FORM_INFO_1Fc.Flags);
1748
	lpStruct->pName = (LPTSTR)(*env)->GetIntLongField(env, lpObject, FORM_INFO_1Fc.pName);
1749
	{
1750
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.Size);
1751
	if (lpObject1 != NULL) getSIZEFields(env, lpObject1, &lpStruct->Size);
1752
	}
1753
	{
1754
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.ImageableArea);
1755
	if (lpObject1 != NULL) getRECTLFields(env, lpObject1, &lpStruct->ImageableArea);
1756
	}
1757
	return lpStruct;
1758
}
1759
1760
void setFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct)
1761
{
1762
	if (!FORM_INFO_1Fc.cached) cacheFORM_INFO_1Fields(env, lpObject);
1763
	(*env)->SetIntField(env, lpObject, FORM_INFO_1Fc.Flags, (jint)lpStruct->Flags);
1764
	(*env)->SetIntLongField(env, lpObject, FORM_INFO_1Fc.pName, (jintLong)lpStruct->pName);
1765
	{
1766
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.Size);
1767
	if (lpObject1 != NULL) setSIZEFields(env, lpObject1, &lpStruct->Size);
1768
	}
1769
	{
1770
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, FORM_INFO_1Fc.ImageableArea);
1771
	if (lpObject1 != NULL) setRECTLFields(env, lpObject1, &lpStruct->ImageableArea);
1772
	}
1773
}
1774
#endif
1775
1724
#ifndef NO_GCP_RESULTS
1776
#ifndef NO_GCP_RESULTS
1725
typedef struct GCP_RESULTS_FID_CACHE {
1777
typedef struct GCP_RESULTS_FID_CACHE {
1726
	int cached;
1778
	int cached;
Lines 6449-6454 Link Here
6449
}
6501
}
6450
#endif
6502
#endif
6451
6503
6504
#ifndef NO_RECTL
6505
typedef struct RECTL_FID_CACHE {
6506
	int cached;
6507
	jclass clazz;
6508
	jfieldID left, top, right, bottom;
6509
} RECTL_FID_CACHE;
6510
6511
RECTL_FID_CACHE RECTLFc;
6512
6513
void cacheRECTLFields(JNIEnv *env, jobject lpObject)
6514
{
6515
	if (RECTLFc.cached) return;
6516
	RECTLFc.clazz = (*env)->GetObjectClass(env, lpObject);
6517
	RECTLFc.left = (*env)->GetFieldID(env, RECTLFc.clazz, "left", "I");
6518
	RECTLFc.top = (*env)->GetFieldID(env, RECTLFc.clazz, "top", "I");
6519
	RECTLFc.right = (*env)->GetFieldID(env, RECTLFc.clazz, "right", "I");
6520
	RECTLFc.bottom = (*env)->GetFieldID(env, RECTLFc.clazz, "bottom", "I");
6521
	RECTLFc.cached = 1;
6522
}
6523
6524
RECTL *getRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct)
6525
{
6526
	if (!RECTLFc.cached) cacheRECTLFields(env, lpObject);
6527
	lpStruct->left = (*env)->GetIntField(env, lpObject, RECTLFc.left);
6528
	lpStruct->top = (*env)->GetIntField(env, lpObject, RECTLFc.top);
6529
	lpStruct->right = (*env)->GetIntField(env, lpObject, RECTLFc.right);
6530
	lpStruct->bottom = (*env)->GetIntField(env, lpObject, RECTLFc.bottom);
6531
	return lpStruct;
6532
}
6533
6534
void setRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct)
6535
{
6536
	if (!RECTLFc.cached) cacheRECTLFields(env, lpObject);
6537
	(*env)->SetIntField(env, lpObject, RECTLFc.left, (jint)lpStruct->left);
6538
	(*env)->SetIntField(env, lpObject, RECTLFc.top, (jint)lpStruct->top);
6539
	(*env)->SetIntField(env, lpObject, RECTLFc.right, (jint)lpStruct->right);
6540
	(*env)->SetIntField(env, lpObject, RECTLFc.bottom, (jint)lpStruct->bottom);
6541
}
6542
#endif
6543
6452
#ifndef NO_SAFEARRAY
6544
#ifndef NO_SAFEARRAY
6453
typedef struct SAFEARRAY_FID_CACHE {
6545
typedef struct SAFEARRAY_FID_CACHE {
6454
	int cached;
6546
	int cached;
(-)Eclipse SWT PI/win32/library/os_structs.h (+24 lines)
Lines 359-364 Link Here
359
#define FILETIME_sizeof() 0
359
#define FILETIME_sizeof() 0
360
#endif
360
#endif
361
361
362
#ifndef NO_FORM_INFO_1
363
void cacheFORM_INFO_1Fields(JNIEnv *env, jobject lpObject);
364
FORM_INFO_1 *getFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct);
365
void setFORM_INFO_1Fields(JNIEnv *env, jobject lpObject, FORM_INFO_1 *lpStruct);
366
#define FORM_INFO_1_sizeof() sizeof(FORM_INFO_1)
367
#else
368
#define cacheFORM_INFO_1Fields(a,b)
369
#define getFORM_INFO_1Fields(a,b,c) NULL
370
#define setFORM_INFO_1Fields(a,b,c)
371
#define FORM_INFO_1_sizeof() 0
372
#endif
373
362
#ifndef NO_GCP_RESULTS
374
#ifndef NO_GCP_RESULTS
363
void cacheGCP_RESULTSFields(JNIEnv *env, jobject lpObject);
375
void cacheGCP_RESULTSFields(JNIEnv *env, jobject lpObject);
364
GCP_RESULTS *getGCP_RESULTSFields(JNIEnv *env, jobject lpObject, GCP_RESULTS *lpStruct);
376
GCP_RESULTS *getGCP_RESULTSFields(JNIEnv *env, jobject lpObject, GCP_RESULTS *lpStruct);
Lines 1319-1324 Link Here
1319
#define RECT_sizeof() 0
1331
#define RECT_sizeof() 0
1320
#endif
1332
#endif
1321
1333
1334
#ifndef NO_RECTL
1335
void cacheRECTLFields(JNIEnv *env, jobject lpObject);
1336
RECTL *getRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct);
1337
void setRECTLFields(JNIEnv *env, jobject lpObject, RECTL *lpStruct);
1338
#define RECTL_sizeof() sizeof(RECTL)
1339
#else
1340
#define cacheRECTLFields(a,b)
1341
#define getRECTLFields(a,b,c) NULL
1342
#define setRECTLFields(a,b,c)
1343
#define RECTL_sizeof() 0
1344
#endif
1345
1322
#ifndef NO_SAFEARRAY
1346
#ifndef NO_SAFEARRAY
1323
void cacheSAFEARRAYFields(JNIEnv *env, jobject lpObject);
1347
void cacheSAFEARRAYFields(JNIEnv *env, jobject lpObject);
1324
SAFEARRAY *getSAFEARRAYFields(JNIEnv *env, jobject lpObject, SAFEARRAY *lpStruct);
1348
SAFEARRAY *getSAFEARRAYFields(JNIEnv *env, jobject lpObject, SAFEARRAY *lpStruct);
(-)Eclipse (+10 lines)
Added Link Here
1
package org.eclipse.swt.internal.win32;
2
3
	public class FORM_INFO_1 {
4
		public int Flags; //DWORD
5
		/** @field cast=(LPTSTR) */
6
		public int /*long*/ pName;
7
		public SIZE Size = new SIZE();
8
		public RECTL ImageableArea = new RECTL();
9
		public static final int sizeof = OS.FORM_INFO_1_sizeof ();
10
}
(-)Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java (+172 lines)
Lines 512-517 Link Here
512
	public static final int DATE_LONGDATE = 0x00000002;
512
	public static final int DATE_LONGDATE = 0x00000002;
513
	public static final int DATE_SHORTDATE = 0x00000001;
513
	public static final int DATE_SHORTDATE = 0x00000001;
514
	public static final int DATE_YEARMONTH = 0x00000008; //#if(WINVER >= 0x0500)
514
	public static final int DATE_YEARMONTH = 0x00000008; //#if(WINVER >= 0x0500)
515
	public static final int DC_PAPERS = 2;
516
	public static final int DC_PAPERNAMES = 16;
515
	public static final int DCX_CACHE = 0x2;
517
	public static final int DCX_CACHE = 0x2;
516
	public static final int DCX_CLIPCHILDREN = 0x8;
518
	public static final int DCX_CLIPCHILDREN = 0x8;
517
	public static final int DCX_CLIPSIBLINGS = 0x10;
519
	public static final int DCX_CLIPSIBLINGS = 0x10;
Lines 545-554 Link Here
545
	public static final short DMCOLLATE_TRUE = 1;
547
	public static final short DMCOLLATE_TRUE = 1;
546
	public static final int DM_SETDEFID = 0x401;
548
	public static final int DM_SETDEFID = 0x401;
547
	public static final int DM_COLLATE = 0x00008000;
549
	public static final int DM_COLLATE = 0x00008000;
550
	public static final int DM_FORMNAME = 0x00010000;
551
	public static final int DM_IN_BUFFER = 0x00000002;
552
	public static final int DM_SCALE = 0x00000010;
553
	public static final int DM_DUPLEX = 0x00001000;	
554
	public static final int DM_YRESOLUTION = 0x00002000;
555
	public static final int DM_PRINTQUALITY = 0x00000400;
556
	public static final int DM_NUP = 0x00000040;
548
	public static final int DM_COPIES = 0x00000100;
557
	public static final int DM_COPIES = 0x00000100;
549
	public static final int DM_ORIENTATION = 0x00000001;
558
	public static final int DM_ORIENTATION = 0x00000001;
559
	public static final int DM_PAPERSIZE = 0x00000002;
560
	public static final int DM_PAPERLENGTH = 0x00000004;
561
	public static final int DM_PAPERWIDTH = 0x00000008;
550
	public static final short DMORIENT_PORTRAIT = 1;
562
	public static final short DMORIENT_PORTRAIT = 1;
551
	public static final short DMORIENT_LANDSCAPE = 2;
563
	public static final short DMORIENT_LANDSCAPE = 2;
564
	public static final short DMPAPER_LETTER = 1;
565
	public static final short DMPAPER_LEGAL = 5;
566
	public static final short DMPAPER_USER = 256;
567
	public static final short DMPAPER_EXECUTIVE = 7;
568
	public static final short DMPAPER_A2 = 66;
569
	public static final short DMPAPER_A4 = 9;
570
	public static final short DMPAPER_A5 = 11;
571
	public static final short DMPAPER_A6 = 70;
572
	public static final short DMPAPER_B5 = 34;
573
	public static final short DMPAPER_JB5 = 13;
552
	public static final int DSS_DISABLED = 0x20;
574
	public static final int DSS_DISABLED = 0x20;
553
	public static final int DSTINVERT = 0x550009;
575
	public static final int DSTINVERT = 0x550009;
554
	public static final int DST_BITMAP = 0x4;
576
	public static final int DST_BITMAP = 0x4;
Lines 1288-1293 Link Here
1288
	public static final int PBST_PAUSED = 0x0003;
1310
	public static final int PBST_PAUSED = 0x0003;
1289
	public static final int PD_ALLPAGES = 0x0;
1311
	public static final int PD_ALLPAGES = 0x0;
1290
	public static final int PD_COLLATE = 0x10;
1312
	public static final int PD_COLLATE = 0x10;
1313
	public static final int PD_NOSELECTION = 0x4;
1291
	public static final int PD_PAGENUMS = 0x2;
1314
	public static final int PD_PAGENUMS = 0x2;
1292
	public static final int PD_PRINTTOFILE = 0x20;
1315
	public static final int PD_PRINTTOFILE = 0x20;
1293
	public static final int PD_RETURNDC = 0x100;
1316
	public static final int PD_RETURNDC = 0x100;
Lines 2205-2210 Link Here
2205
public static final native int DRAWITEMSTRUCT_sizeof ();
2228
public static final native int DRAWITEMSTRUCT_sizeof ();
2206
public static final native int DROPFILES_sizeof ();
2229
public static final native int DROPFILES_sizeof ();
2207
public static final native int DWM_BLURBEHIND_sizeof ();
2230
public static final native int DWM_BLURBEHIND_sizeof ();
2231
public static final native int FORM_INFO_1_sizeof ();
2208
public static final native int EMR_sizeof ();
2232
public static final native int EMR_sizeof ();
2209
public static final native int EMREXTCREATEFONTINDIRECTW_sizeof ();
2233
public static final native int EMREXTCREATEFONTINDIRECTW_sizeof ();
2210
public static final native int EXTLOGFONTW_sizeof ();
2234
public static final native int EXTLOGFONTW_sizeof ();
Lines 2286-2291 Link Here
2286
public static final native int PROPERTYKEY_sizeof ();
2310
public static final native int PROPERTYKEY_sizeof ();
2287
public static final native int REBARBANDINFO_sizeof ();
2311
public static final native int REBARBANDINFO_sizeof ();
2288
public static final native int RECT_sizeof ();
2312
public static final native int RECT_sizeof ();
2313
public static final native int RECTL_sizeof ();
2289
public static final native int SAFEARRAY_sizeof ();
2314
public static final native int SAFEARRAY_sizeof ();
2290
public static final native int SAFEARRAYBOUND_sizeof ();
2315
public static final native int SAFEARRAYBOUND_sizeof ();
2291
public static final native int SCRIPT_ANALYSIS_sizeof ();
2316
public static final native int SCRIPT_ANALYSIS_sizeof ();
Lines 2452-2462 Link Here
2452
	return DefWindowProcA (hWnd, Msg, wParam, lParam);
2477
	return DefWindowProcA (hWnd, Msg, wParam, lParam);
2453
}
2478
}
2454
2479
2480
public static final int DeviceCapabilities (TCHAR pDevice, TCHAR pPort, int fwCapability, int /*long*/ pOutput, int /*long*/ pDevMode) {
2481
	if (IsUnicode) {
2482
		char[] pPort1 = pPort == null ? null : pPort.chars;
2483
		return OS.DeviceCapabilitiesW (pDevice.chars, pPort1, fwCapability, pOutput, pDevMode);
2484
	} else {
2485
		byte[] pPort1 = pPort == null ? null : pPort.bytes;
2486
		return OS.DeviceCapabilitiesA (pDevice.bytes, pPort1, fwCapability, pOutput, pDevMode);
2487
	}
2488
}
2489
2455
public static final int /*long*/ DispatchMessage (MSG lpmsg) {
2490
public static final int /*long*/ DispatchMessage (MSG lpmsg) {
2456
	if (IsUnicode) return DispatchMessageW (lpmsg);
2491
	if (IsUnicode) return DispatchMessageW (lpmsg);
2457
	return DispatchMessageA (lpmsg);
2492
	return DispatchMessageA (lpmsg);
2458
}
2493
}
2459
2494
2495
public static final int DocumentProperties (int /*long*/ hWnd, int /*long*/ hPrinter, TCHAR pDeviceName, int /*long*/ pDevModeOutput, int /*long*/ pDevModeInput, int fMode) {
2496
	if (IsUnicode) {
2497
		char[] pDeviceName1 = pDeviceName == null ? null : pDeviceName.chars; 
2498
		return DocumentPropertiesW (hWnd, hPrinter, pDeviceName1, pDevModeOutput, pDevModeInput, fMode);
2499
	}
2500
	byte[] pDeviceName1 = pDeviceName == null ? null : pDeviceName.bytes;
2501
	return DocumentPropertiesA (hWnd, hPrinter, pDeviceName1, pDevModeOutput, pDevModeInput, fMode);
2502
}
2503
2460
public static final int DragQueryFile (int /*long*/ hDrop, int iFile, TCHAR lpszFile, int cch) {
2504
public static final int DragQueryFile (int /*long*/ hDrop, int iFile, TCHAR lpszFile, int cch) {
2461
	if (IsUnicode) {
2505
	if (IsUnicode) {
2462
		char [] lpszFile1 = lpszFile == null ? null : lpszFile.chars;
2506
		char [] lpszFile1 = lpszFile == null ? null : lpszFile.chars;
Lines 2608-2613 Link Here
2608
	return GetDateFormatA (Locale, dwFlags, lpDate, lpString1, lpString2, cchDate);
2652
	return GetDateFormatA (Locale, dwFlags, lpDate, lpString1, lpString2, cchDate);
2609
}
2653
}
2610
2654
2655
public static final boolean GetDefaultPrinter (TCHAR pszBuffer, int[] pcchBuffer) {
2656
	if (IsUnicode) {
2657
		char[] pszBuffer1 = pszBuffer == null ? null : pszBuffer.chars; 
2658
		return GetDefaultPrinterW(pszBuffer1, pcchBuffer);
2659
	}
2660
	byte[] pszBuffer1 = pszBuffer == null ? null : pszBuffer.bytes;
2661
	return GetDefaultPrinterA(pszBuffer1, pcchBuffer);
2662
}
2663
2611
public static final int GetKeyNameText (int lParam, TCHAR lpString, int nSize) {
2664
public static final int GetKeyNameText (int lParam, TCHAR lpString, int nSize) {
2612
	if (IsUnicode) {
2665
	if (IsUnicode) {
2613
		char [] lpString1 = lpString == null ? null : lpString.chars;
2666
		char [] lpString1 = lpString == null ? null : lpString.chars;
Lines 3017-3022 Link Here
3017
	}
3070
	}
3018
}
3071
}
3019
3072
3073
public static final boolean OpenPrinter (TCHAR pPrinterName, int /*long*/ [] phPrinter, int /*long*/ [] pDefault) {
3074
	if (IsUnicode) {
3075
		char [] pPrinterName1 = pPrinterName == null ? null : pPrinterName.chars;
3076
		return OpenPrinterW(pPrinterName1, phPrinter, pDefault);
3077
	}
3078
	byte [] pPrinterName1 = pPrinterName == null ? null : pPrinterName.bytes;
3079
	return OpenPrinterA(pPrinterName1, phPrinter, pDefault);
3080
}
3081
3020
public static final boolean PeekMessage (MSG lpMsg, int /*long*/ hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg) {
3082
public static final boolean PeekMessage (MSG lpMsg, int /*long*/ hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg) {
3021
	if (IsUnicode) return PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
3083
	if (IsUnicode) return PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
3022
	return PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
3084
	return PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
Lines 3110-3115 Link Here
3110
	return RemovePropA (hWnd, lpString);
3172
	return RemovePropA (hWnd, lpString);
3111
}
3173
}
3112
3174
3175
public static final int /*long*/ ResetDC (int /*long*/ hdc, int /*long*/ lpInitData) {
3176
	if (IsUnicode) {
3177
		return ResetDCW (hdc, lpInitData);
3178
	}
3179
	return ResetDCA (hdc, lpInitData);
3180
}
3181
3113
public static final int /*long*/ SendMessage (int /*long*/ hWnd, int Msg, int /*long*/ wParam, TCHAR lParam) {
3182
public static final int /*long*/ SendMessage (int /*long*/ hWnd, int Msg, int /*long*/ wParam, TCHAR lParam) {
3114
	if (IsUnicode) {
3183
	if (IsUnicode) {
3115
		char [] lParam1 = lParam == null ? null : lParam.chars;
3184
		char [] lParam1 = lParam == null ? null : lParam.chars;
Lines 3284-3289 Link Here
3284
	return SendMessageA (hWnd, Msg, wParam, lParam);
3353
	return SendMessageA (hWnd, Msg, wParam, lParam);
3285
}
3354
}
3286
3355
3356
public static final boolean SetForm (int /*long*/ hPrinter, TCHAR pFormName, int Level, int /*long*/ pForm) {
3357
	if (IsUnicode) {
3358
		return SetFormW(hPrinter, pFormName.chars, Level, pForm);
3359
	} else {
3360
		return SetFormA(hPrinter, pFormName.bytes, Level, pForm);
3361
	}
3362
}
3363
3287
public static final boolean SetMenuItemInfo (int /*long*/ hMenu, int uItem, boolean fByPosition, MENUITEMINFO lpmii) {
3364
public static final boolean SetMenuItemInfo (int /*long*/ hMenu, int uItem, boolean fByPosition, MENUITEMINFO lpmii) {
3288
	if (IsUnicode) return SetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii);
3365
	if (IsUnicode) return SetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii);
3289
	return SetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii);
3366
	return SetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii);
Lines 3614-3619 Link Here
3614
 */
3691
 */
3615
public static final native int /*long*/ CreateDCW (char [] lpszDriver, char [] lpszDevice, int /*long*/ lpszOutput, int /*long*/ lpInitData);  
3692
public static final native int /*long*/ CreateDCW (char [] lpszDriver, char [] lpszDevice, int /*long*/ lpszOutput, int /*long*/ lpInitData);  
3616
/**
3693
/**
3694
 * @param hdc cast=(HDC)
3695
 * @param lpInitData cast=(CONST VOID *)
3696
 */
3697
public static final native int /*long*/ ResetDCW (int /*long*/ hdc, int /*long*/ lpInitData);
3698
/**
3699
 * @param hdc cast=(HDC)
3700
 * @param lpInitData cast=(CONST VOID *)
3701
 */
3702
public static final native int /*long*/ ResetDCA (int /*long*/ hdc, int /*long*/ lpInitData);
3703
/**
3617
 * @param lpszDriver cast=(LPSTR)
3704
 * @param lpszDriver cast=(LPSTR)
3618
 * @param lpszDevice cast=(LPSTR)
3705
 * @param lpszDevice cast=(LPSTR)
3619
 * @param lpszOutput cast=(LPSTR)
3706
 * @param lpszOutput cast=(LPSTR)
Lines 3775-3780 Link Here
3775
public static final native boolean DestroyMenu (int /*long*/ hMenu);
3862
public static final native boolean DestroyMenu (int /*long*/ hMenu);
3776
/** @param hWnd cast=(HWND) */
3863
/** @param hWnd cast=(HWND) */
3777
public static final native boolean DestroyWindow (int /*long*/ hWnd);
3864
public static final native boolean DestroyWindow (int /*long*/ hWnd);
3865
/**
3866
 * @param pDevice cast=(LPCTSTR)
3867
 * @param pPort cast=(LPCTSTR)
3868
 * @param fwCapability cast=(WORD)
3869
 * @param pOutput cast=(LPTSTR)
3870
 * @param pDevMode cast=(const DEVMODEA *)
3871
 */
3872
public static native final int DeviceCapabilitiesA (byte[] pDevice, byte[] pPort, int fwCapability, int /*long*/ pOutput, int /*long*/ pDevMode);
3873
/**
3874
 * @param pDevice cast=(LPCWSTR)
3875
 * @param pPort cast=(LPCWSTR)
3876
 * @param fwCapability cast=(WORD)
3877
 * @param pOutput cast=(LPWSTR)
3878
 * @param pDevMode cast=(const DEVMODEW *)
3879
 */
3880
public static native final int DeviceCapabilitiesW (char[] pDevice, char[] pPort, int fwCapability, int /*long*/ pOutput, int /*long*/ pDevMode);
3778
public static final native int /*long*/ DispatchMessageW (MSG lpmsg);
3881
public static final native int /*long*/ DispatchMessageW (MSG lpmsg);
3779
public static final native int /*long*/ DispatchMessageA (MSG lpmsg);
3882
public static final native int /*long*/ DispatchMessageA (MSG lpmsg);
3780
/** @param hdc cast=(HDC) */
3883
/** @param hdc cast=(HDC) */
Lines 5010-5015 Link Here
5010
 * @param Destination cast=(PVOID)
5113
 * @param Destination cast=(PVOID)
5011
 * @param Source cast=(CONST VOID *),flags=no_out critical
5114
 * @param Source cast=(CONST VOID *),flags=no_out critical
5012
 */
5115
 */
5116
public static final native void MoveMemory (int /*long*/ Destination, FORM_INFO_1 form, int Length);
5117
/**
5118
 * @param Destination cast=(PVOID)
5119
 * @param Source cast=(CONST VOID *),flags=no_out critical
5120
 */
5013
public static final native void MoveMemory (int /*long*/ Destination, int [] Source, int Length);
5121
public static final native void MoveMemory (int /*long*/ Destination, int [] Source, int Length);
5014
/**
5122
/**
5015
 * @param Destination cast=(PVOID)
5123
 * @param Destination cast=(PVOID)
Lines 5773-5778 Link Here
5773
 * @param pwOutGlyphs cast=(WORD*)
5881
 * @param pwOutGlyphs cast=(WORD*)
5774
 */
5882
 */
5775
public static final native int ScriptGetCMap (int /*long*/ hdc, int /*long*/ psc, char[] pwcChars, int cChars, int dwFlags, short[] pwOutGlyphs);
5883
public static final native int ScriptGetCMap (int /*long*/ hdc, int /*long*/ psc, char[] pwcChars, int cChars, int dwFlags, short[] pwOutGlyphs);
5884
5885
/**
5886
 * @param pszBuffer cast=(LPTSTR)
5887
 * @param pcchBuffer cast=(LPDWORD)
5888
 */
5889
public static final native boolean GetDefaultPrinterA (byte[] pszBuffer, int[] pcchBuffer);
5890
/**
5891
 * @param pszBuffer cast=(LPWSTR)
5892
 * @param pcchBuffer cast=(LPDWORD)
5893
 */
5894
public static final native boolean GetDefaultPrinterW (char[] pszBuffer, int[] pcchBuffer);
5895
/**
5896
 * @param pPrinterName cast=(LPTSTR)
5897
 * @param phPrinter cast=(LPHANDLE)
5898
 * @param pDefault cast=(LPPRINTER_DEFAULTS)
5899
 */
5900
public static final native boolean OpenPrinterA (byte[] pPrinterName, int /*long*/ [] phPrinter, int /*long*/ [] pDefault);
5901
/**
5902
 * @param pPrinterName cast=(LPWSTR)
5903
 * @param phPrinter cast=(LPHANDLE)
5904
 * @param pDefault cast=(LPPRINTER_DEFAULTSW)
5905
 */
5906
public static final native boolean OpenPrinterW (char[] pPrinterName, int /*long*/ [] phPrinter, int /*long*/ [] pDefault);
5907
/**
5908
 * @param hPrinter cast=(HANDLE)
5909
 * @param Level cast=(DWORD)
5910
 * @param pForm cast=(LPBYTE)
5911
 */
5912
public static final native boolean AddForm (int /*long*/ hPrinter, int Level, int /*long*/ pForm);
5913
/**
5914
 * @param hPrinter cast=(HANDLE)
5915
 * @param pFormName cast=(LPWSTR)
5916
 * @param Level cast=(DWORD)
5917
 * @param pForm cast=(LPBYTE)
5918
 */
5919
public static final native boolean SetFormW (int /*long*/ hPrinter, char[] pFormName, int Level, int /*long*/ pForm);
5920
/**
5921
 * @param hPrinter cast=(HANDLE)
5922
 * @param pFormName cast=(LPSTR)
5923
 * @param Level cast=(DWORD)
5924
 * @param pForm cast=(LPBYTE)
5925
 */
5926
public static final native boolean SetFormA (int /*long*/ hPrinter, byte[] pFormName, int Level, int /*long*/ pForm);
5927
5776
/**
5928
/**
5777
 * @param hdc cast=(HDC)
5929
 * @param hdc cast=(HDC)
5778
 * @param psc cast=(SCRIPT_CACHE *)
5930
 * @param psc cast=(SCRIPT_CACHE *)
Lines 6290-6295 Link Here
6290
 * @param dwLayout cast=(DWORD)
6442
 * @param dwLayout cast=(DWORD)
6291
 */
6443
 */
6292
public static final native int SetLayout (int /*long*/ hdc, int dwLayout);
6444
public static final native int SetLayout (int /*long*/ hdc, int dwLayout);
6445
/**
6446
 * @param hWnd cast=(HWND)
6447
 * @param hPrinter cast=(HANDLE)
6448
 * @param pDeviceName cast=(LPWSTR)
6449
 * @param pDevModeOutput cast=(PDEVMODEW)
6450
 * @param pDevModeInput cast=(PDEVMODEW)
6451
 * @param fMode cast=(DWORD)
6452
 */
6453
public static final native int DocumentPropertiesW (int /*long*/ hWnd, int /*long*/ hPrinter, char[] pDeviceName, int /*long*/ pDevModeOutput, int /*long*/ pDevModeInput, int fMode);
6454
/**
6455
 * @param hWnd cast=(HWND)
6456
 * @param hPrinter cast=(HANDLE)
6457
 * @param pDeviceName cast=(LPTSTR)
6458
 * @param pDevModeOutput cast=(PDEVMODE)
6459
 * @param pDevModeInput cast=(PDEVMODE)
6460
 * @param fMode cast=(DWORD)
6461
 */
6462
public static final native int DocumentPropertiesA (int /*long*/ hWnd, int /*long*/ hPrinter, byte[] pDeviceName, int /*long*/ pDevModeOutput, int /*long*/ pDevModeInput, int fMode);
6293
/** @param hdc cast=(HDC) */
6463
/** @param hdc cast=(HDC) */
6294
public static final native int SetMapMode (int /*long*/ hdc, int fnMapMode);
6464
public static final native int SetMapMode (int /*long*/ hdc, int fnMapMode);
6295
/**
6465
/**
Lines 6599-6604 Link Here
6599
public static final native boolean UpdateLayeredWindow (int /*long*/ hwnd, int /*long*/ hdcDst, POINT pptDst, SIZE psize, int /*long*/ hdcSrc, POINT pptSrc, int crKey, BLENDFUNCTION pblend, int dwFlags);
6769
public static final native boolean UpdateLayeredWindow (int /*long*/ hwnd, int /*long*/ hdcDst, POINT pptDst, SIZE psize, int /*long*/ hdcSrc, POINT pptSrc, int crKey, BLENDFUNCTION pblend, int dwFlags);
6600
/** @param hWnd cast=(HWND) */
6770
/** @param hWnd cast=(HWND) */
6601
public static final native boolean UpdateWindow (int /*long*/ hWnd);
6771
public static final native boolean UpdateWindow (int /*long*/ hWnd);
6772
/** @param ptr cast=(CONST VOID *) */
6773
public static final native void updateNup (int /*long*/ ptr, int nup);
6602
/** @param hWnd cast=(HWND) */
6774
/** @param hWnd cast=(HWND) */
6603
public static final native boolean ValidateRect (int /*long*/ hWnd, RECT lpRect);
6775
public static final native boolean ValidateRect (int /*long*/ hWnd, RECT lpRect);
6604
/** @param ch cast=(WCHAR) */
6776
/** @param ch cast=(WCHAR) */
(-)Eclipse (+19 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.swt.internal.win32;
12
13
public class RECTL {
14
	public int left;
15
	public int top;
16
	public int right;
17
	public int bottom;
18
	public static final int sizeof = OS.RECTL_sizeof ();
19
}
(-)Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java (-9 / +134 lines)
Lines 155-176 Link Here
155
	PrinterData data = null;
155
	PrinterData data = null;
156
	NSPrintPanel panel = NSPrintPanel.printPanel();
156
	NSPrintPanel panel = NSPrintPanel.printPanel();
157
	NSPrintInfo printInfo = new NSPrintInfo(NSPrintInfo.sharedPrintInfo().copy());
157
	NSPrintInfo printInfo = new NSPrintInfo(NSPrintInfo.sharedPrintInfo().copy());
158
	printInfo.setOrientation(printerData.orientation == PrinterData.LANDSCAPE ? OS.NSLandscapeOrientation : OS.NSPortraitOrientation);
158
	NSMutableDictionary dict = printInfo.dictionary();
159
	NSMutableDictionary dict = printInfo.dictionary();	
159
	/* Settings */
160
	dict.setValue(NSNumber.numberWithBool(printerData.collate), OS.NSPrintMustCollate);
160
	int /*long*/ pmSettings = printInfo.PMPrintSettings();// Do not release unless retain it
161
	dict.setValue(NSNumber.numberWithInt(printerData.copyCount), OS.NSPrintCopies);
161
	/* Duplex setting */
162
	OS.PMSetDuplex(pmSettings, printerData.duplex);
163
	/* Updating the pmPrintSettings to printInfo overrides all the setting
164
	 * values contained in the printInfo dictionary. So, any changes to pmPrintSettings
165
	 * should be updated initially itself to avoid any accidental overriding.
166
	 * Similar cast applies to pmPageFormat as well.
167
	 */
168
	printInfo.updateFromPMPrintSettings();
169
	/* Print to File */
162
	if (printerData.printToFile) {
170
	if (printerData.printToFile) {
163
		dict.setValue(OS.NSPrintSaveJob, OS.NSPrintJobDisposition);
171
		dict.setValue(OS.NSPrintSaveJob, OS.NSPrintJobDisposition);
172
		if (printerData.fileName != null && printerData.fileName.length() > 0) {
173
			dict.setValue(NSString.stringWith(printerData.fileName), OS.NSPrintSavePath);
174
		}
175
	} else if (printerData.name != null){
176
		dict.setValue(NSString.stringWith(printerData.name), OS.NSPrintPrinterName);
164
	}
177
	}
165
	if (printerData.fileName != null && printerData.fileName.length() > 0) {
178
	int /*long*/ session = printInfo.PMPrintSession();// Do not release unless retain it
166
		dict.setValue(NSString.stringWith(printerData.fileName), OS.NSPrintSavePath);
179
	int[] pmPrinter = new int[1];
180
	int res = OS.PMSessionGetCurrentPrinter (session, pmPrinter);
181
	/* Paper Size Name */
182
	if (printerData.paperSizeName.intern() == PrinterData.PAPER_CUSTOM) {
183
		int[] pmPaper = new int[1];
184
		double[] margins = {printInfo.topMargin(), printInfo.leftMargin(), printInfo.bottomMargin(), printInfo.rightMargin()};
185
		String customNameStr = (printerData.customPaperDisplayName != null) ? printerData.customPaperDisplayName : "CustomPaper"; //$NON_NLS-1$
186
		char[] customNameChars = new char[customNameStr.length()];
187
		customNameStr.getChars(0, customNameChars.length, customNameChars, 0);
188
		int /*long*/ customNameCFStr = OS.CFStringCreateWithCharacters (0,customNameChars,customNameChars.length);
189
		String customIdStr = (printerData.customPaperName != null) ? printerData.customPaperName : "CustomPaper"; //$NON_NLS-1$
190
		char[] customIdChars = new char[customIdStr.length()];
191
		customIdStr.getChars(0, customIdChars.length, customIdChars, 0);
192
		int /*long*/ customIdCFStr = OS.CFStringCreateWithCharacters (0,customIdChars,customIdChars.length);
193
		
194
		int /*long*/ pmPageFormat = printInfo.pmPageFormat();// Do not release unless retain it
195
		res = OS.PMPaperCreateCustom (pmPrinter[0], customIdCFStr, customNameCFStr, printerData.customPaperWidth * 72, printerData.customPaperHeight * 72, margins, pmPaper);
196
		if (res == OS.noErr) {
197
			int[] /*long*/ newPageFormat = new int[1];
198
			OS.PMCreatePageFormatWithPMPaper (newPageFormat, pmPaper[0]);
199
			OS.PMCopyPageFormat (newPageFormat[0],pmPageFormat);
200
			printInfo.updateFromPMPageFormat();
201
			OS.PMRelease(newPageFormat[0]);
202
		}
203
		int[] pmPaperName = new int[1];
204
		OS.PMPaperGetName (pmPaper[0], pmPaperName);
205
		NSString paperNameStr = new NSString(pmPaperName[0]);
206
		printInfo.setPaperName (paperNameStr);
207
		
208
		OS.CFRelease (customNameCFStr);
209
		OS.CFRelease (customIdCFStr);
210
		OS.PMRelease (pmPaperName[0]);
211
	} else {
212
		String[] keys = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4, 
213
				PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE};
214
		String[] values = {"Legal", "Letter", "iso-a2-envelope", "A4", 
215
				"A5", "A6", "ISOB5", "JISB5", "Executive"}; //$NON_NLS-1$
216
		int index;
217
		for (index = 0; index < keys.length; index++) {
218
			if (printerData.paperSizeName.intern() == keys[index].intern()) break;
219
		}
220
		NSString paperNameStr = (NSString) new NSString().alloc();
221
		if (index < keys.length) {
222
			paperNameStr = paperNameStr.initWithString (values[index]);
223
		} else {
224
			paperNameStr = paperNameStr.initWithString (printerData.paperSizeName);
225
		}
226
		printInfo.setPaperName (paperNameStr);
167
	}
227
	}
228
	/* Orientation */
229
	printInfo.setOrientation(printerData.orientation == PrinterData.LANDSCAPE ? OS.NSLandscapeOrientation : OS.NSPortraitOrientation);
230
	/* Collate */
231
	dict.setValue(NSNumber.numberWithBool(printerData.collate), OS.NSPrintMustCollate);
232
	/* Copy count */
233
	dict.setValue(NSNumber.numberWithInt(printerData.copyCount), OS.NSPrintCopies);
234
	/* Page Scope */
168
	dict.setValue(NSNumber.numberWithBool(printerData.scope == PrinterData.ALL_PAGES), OS.NSPrintAllPages);
235
	dict.setValue(NSNumber.numberWithBool(printerData.scope == PrinterData.ALL_PAGES), OS.NSPrintAllPages);
236
	/* Page Range */
169
	if (printerData.scope == PrinterData.PAGE_RANGE) {
237
	if (printerData.scope == PrinterData.PAGE_RANGE) {
170
		dict.setValue(NSNumber.numberWithInt(printerData.startPage), OS.NSPrintFirstPage);
238
		dict.setValue(NSNumber.numberWithInt(printerData.startPage), OS.NSPrintFirstPage);
171
		dict.setValue(NSNumber.numberWithInt(printerData.endPage), OS.NSPrintLastPage);
239
		dict.setValue(NSNumber.numberWithInt(printerData.endPage), OS.NSPrintLastPage);
172
	}
240
	}
173
	panel.setOptions(OS.NSPrintPanelShowsPageSetupAccessory | panel.options());
241
	/* Scaling factor value */
242
	dict.setValue(NSNumber.numberWithDouble(printerData.scale/100.0),OS.NSPrintScalingFactor);
243
	/* Pages per sheet */
244
	int columns = (int) Math.sqrt(printerData.pagesPerSide);
245
	dict.setValue(NSNumber.numberWithInt(columns), OS.NSPrintPagesAcross);
246
	dict.setValue(NSNumber.numberWithInt(printerData.pagesPerSide / columns), OS.NSPrintPagesDown);
247
	/* Output Resolution */
248
	if (printerData.resolutionX != 0 && printerData.resolutionY != 0) {
249
		double[] resolution = {printerData.resolutionX, printerData.resolutionY};
250
		OS.PMPrinterSetOutputResolution(pmPrinter[0], pmSettings, resolution);
251
	}
252
	/* Set Panel Options */
253
	int panelOptions = (printerData.scope & PrinterData.NO_SELECTION) != 0 ? OS.NSPrintPanelShowsPrintSelection : 0;
254
	panelOptions |= OS.NSPrintPanelShowsPageSetupAccessory | panel.options();
255
	panel.setOptions(panelOptions);
174
	Shell parent = getParent();
256
	Shell parent = getParent();
175
	Display display = parent != null ? parent.getDisplay() : Display.getCurrent();
257
	Display display = parent != null ? parent.getDisplay() : Display.getCurrent();
176
	int response;
258
	int response;
Lines 208-217 Link Here
208
			data.endPage = new NSNumber(dict.objectForKey(OS.NSPrintLastPage)).intValue();
290
			data.endPage = new NSNumber(dict.objectForKey(OS.NSPrintLastPage)).intValue();
209
		}
291
		}
210
		data.collate = new NSNumber(dict.objectForKey(OS.NSPrintMustCollate)).intValue() != 0;
292
		data.collate = new NSNumber(dict.objectForKey(OS.NSPrintMustCollate)).intValue() != 0;
211
		data.collate = false; //TODO: Only set to false if the printer does the collate internally (most printers do)
212
		data.copyCount = new NSNumber(dict.objectForKey(OS.NSPrintCopies)).intValue();
293
		data.copyCount = new NSNumber(dict.objectForKey(OS.NSPrintCopies)).intValue();
213
		data.copyCount = 1; //TODO: Only set to 1 if the printer does the copy internally (most printers do)
214
		data.orientation = printInfo.orientation() == OS.NSLandscapeOrientation ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
294
		data.orientation = printInfo.orientation() == OS.NSLandscapeOrientation ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
295
		data.scale = new NSNumber(dict.objectForKey(OS.NSPrintScalingFactor)).doubleValue() * 100;
296
		/* Pages per Side */
297
		int pagesAcross = new NSNumber(dict.objectForKey(OS.NSPrintPagesAcross)).intValue();
298
		int pagesDown = new NSNumber(dict.objectForKey(OS.NSPrintPagesDown)).intValue();
299
		data.pagesPerSide = pagesAcross * pagesDown;
300
		/* Duplex */
301
		int /*long*/ pmPrintSettings = printInfo.PMPrintSettings();
302
		int[] duplexMode = new int[1];
303
		OS.PMGetDuplex (pmPrintSettings, duplexMode);
304
		data.duplex = (int) duplexMode[0];
305
		/* Paper Size TODO:// 
306
		 * It appears to be a bug in Mac that at instances,
307
		 * PaperName might not be recognized as Custom 
308
		 * though it is Custom.
309
		 */
310
		int /*long*/ pageFormat = printInfo.pmPageFormat();
311
		int[] pmPaper = new int[1];
312
		OS.PMGetPageFormatPaper (pageFormat, pmPaper);
313
		if (OS.PMPaperIsCustom (pmPaper[0])) {
314
			data.paperSizeName = PrinterData.PAPER_CUSTOM;
315
			double[] height = new double[1];
316
			double[] width = new double[1];
317
			OS.PMPaperGetHeight (pmPaper[0], height);
318
			OS.PMPaperGetWidth (pmPaper[0], width);
319
			data.customPaperHeight = height[0] / 72;
320
			data.customPaperWidth = width[0] / 72;
321
			int[] pmPaperName = new int[1];
322
			OS.PMPaperGetName (pmPaper[0], pmPaperName);
323
			data.customPaperDisplayName = new NSString (pmPaperName[0]).getString();
324
			int[] pmPaperId = new int[1];
325
			OS.PMPaperGetID (pmPaper[0], pmPaperId);
326
			data.customPaperName = new NSString (pmPaperId[0]).getString();
327
		} else {
328
			int[] /*long*/ pmPaperName = new int[1];
329
			OS.PMPaperGetName (pmPaper[0], pmPaperName);
330
			data.paperSizeName = new NSString (pmPaperName[0]).getString();			
331
		}
332
		/* Resolution */
333
		session = printInfo.PMPrintSession();// Do not release unless retain it
334
		OS.PMSessionGetCurrentPrinter(session, pmPrinter);
335
		double[] resolution = new double[2];
336
		OS.PMPrinterGetOutputResolution(pmPrinter[0], pmPrintSettings, resolution);
337
		data.resolutionX = (int) resolution[0];
338
		data.resolutionY = (int) resolution[1];
339
		
215
		NSData nsData = NSKeyedArchiver.archivedDataWithRootObject(printInfo);
340
		NSData nsData = NSKeyedArchiver.archivedDataWithRootObject(printInfo);
216
		data.otherData = new byte[(int)/*64*/nsData.length()];
341
		data.otherData = new byte[(int)/*64*/nsData.length()];
217
		OS.memmove(data.otherData, nsData.bytes(), data.otherData.length);
342
		OS.memmove(data.otherData, nsData.bytes(), data.otherData.length);
(-)Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java (+30 lines)
Lines 48-53 Link Here
48
	static final String DRIVER = "Mac";
48
	static final String DRIVER = "Mac";
49
49
50
/**
50
/**
51
 * Returns an array of String objects representing all paper
52
 * size names supported by printers on the platform.
53
 * Note that some platforms return only the paper size names
54
 * supported by the default printer.
55
 * 
56
 * @return a string array containing paper size names
57
 * 
58
 * @since 3.6
59
 */
60
public static String[] getPaperNameList () {
61
	int[] session = new int[1];
62
	int res = OS.PMCreateSession(session);
63
	if (res != OS.noErr) return null;
64
	int[] printer = new int[1];
65
	res = OS.PMSessionGetCurrentPrinter(session[0], printer);
66
	if (res != OS.noErr) return null;
67
	int[] paperList = new int[1];
68
	res = OS.PMPrinterGetPaperList(printer[0], paperList);
69
	int count = OS.CFArrayGetCount (paperList[0]);
70
	String[] result = new String[count];
71
	for (int i=0; i<count; i++) {
72
		int /*long*/ paper = OS.CFArrayGetValueAtIndex (paperList[0],i);
73
		int[] paperName = new int[1];
74
		OS.PMPaperGetName (paper, paperName);
75
		result[i] = new NSString(paperName[0]).getString();
76
	}
77
	return result;
78
}
79
80
/**
51
 * Returns an array of <code>PrinterData</code> objects
81
 * Returns an array of <code>PrinterData</code> objects
52
 * representing all available printers.  If there are no
82
 * representing all available printers.  If there are no
53
 * printers, the array will be empty.
83
 * printers, the array will be empty.
(-)Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java (-13 / +249 lines)
Lines 35-59 Link Here
35
public final class PrinterData extends DeviceData {
35
public final class PrinterData extends DeviceData {
36
	
36
	
37
	/**
37
	/**
38
	 * the printer driver
38
	 * The printer driver.
39
	 * <p>
39
	 * On Windows systems, this is the name of the driver (often "winspool").
40
	 * On Windows systems, this is the name of the driver (often "winspool").
40
	 * On Mac OSX, this is the destination type ("Printer", "Fax", "File", or "Preview").
41
	 * On Mac OSX, this is the destination type ("Printer", "Fax", "File", or "Preview").
41
	 * On X/Window systems, this is the name of a display connection to the
42
	 * On X/Window systems, this is the name of a display connection to the
42
	 * Xprt server (the default is ":1").
43
	 * Xprt server (the default is ":1").
43
	 * On GTK+, this is the backend type name (eg. GtkPrintBackendCups).
44
	 * On GTK+, this is the backend type name (eg. GtkPrintBackendCups).
45
	 * </p>
44
	 */
46
	 */
45
	// TODO: note that this api is not finalized for GTK+
47
	// TODO: note that this api is not finalized for GTK+
46
	public String driver;
48
	public String driver;
47
	
49
	
48
	/**
50
	/**
49
	 * the name of the printer
51
	 * The name of the printer.
52
	 * <p>
50
	 * On Windows systems, this is the name of the 'device'.
53
	 * On Windows systems, this is the name of the 'device'.
51
	 * On Mac OSX, X/Window systems, and GTK+, this is the printer's 'name'.
54
	 * On Mac OSX, X/Window systems, and GTK+, this is the printer's 'name'.
55
	 * </p>
52
	 */
56
	 */
53
	public String name;
57
	public String name;
54
	
58
	
55
	/**
59
	/**
56
	 * the scope of the print job, expressed as one of the following values:
60
	 * The scope of the print job, expressed as one of the following values:
57
	 * <dl>
61
	 * <dl>
58
	 * <dt><code>ALL_PAGES</code></dt>
62
	 * <dt><code>ALL_PAGES</code></dt>
59
	 * <dd>Print all pages in the current document</dd>
63
	 * <dd>Print all pages in the current document</dd>
Lines 66-116 Link Here
66
	public int scope = ALL_PAGES;
70
	public int scope = ALL_PAGES;
67
	
71
	
68
	/**
72
	/**
69
	 * the start page of a page range, used when scope is PAGE_RANGE.
73
	 * The start page of a page range, used when scope is PAGE_RANGE.
74
	 * <p>
70
	 * This value can be from 1 to the maximum number of pages for the platform.
75
	 * This value can be from 1 to the maximum number of pages for the platform.
76
	 * </p>
71
	 */
77
	 */
72
	public int startPage = 1;
78
	public int startPage = 1;
73
79
74
	/**
80
	/**
75
	 * the end page of a page range, used when scope is PAGE_RANGE.
81
	 * The end page of a page range, used when scope is PAGE_RANGE.
82
	 * <p>
76
	 * This value can be from 1 to the maximum number of pages for the platform.
83
	 * This value can be from 1 to the maximum number of pages for the platform.
84
	 * </p>
77
	 */
85
	 */
78
	public int endPage = 1;
86
	public int endPage = 1;
79
	
87
	
80
	/**
88
	/**
81
	 * whether or not the print job should go to a file
89
	 * Whether or not the print job should go to a file.
82
	 */
90
	 */
83
	public boolean printToFile = false;
91
	public boolean printToFile = false;
84
	
92
	
85
	/**
93
	/**
86
	 * the name of the file to print to if printToFile is true.
94
	 * The name of the file to print to if printToFile is true.
95
	 * <p>
87
	 * Note that this field is ignored if printToFile is false.
96
	 * Note that this field is ignored if printToFile is false.
97
	 * </p>
88
	 */
98
	 */
89
	public String fileName;
99
	public String fileName;
90
	
100
	
91
	/**
101
	/**
92
	 * the number of copies to print.
102
	 * The number of copies to print.
103
	 * <p>
104
	 * TODO: Need to decide whether or not the following comment should still apply. The function has currently been deleted from the code... should we change the API? SSQ thinks so.
93
	 * Note that this field may be controlled by the printer driver
105
	 * Note that this field may be controlled by the printer driver
94
	 * In other words, the printer itself may be capable of printing
106
	 * In other words, the printer itself may be capable of printing
95
	 * multiple copies, and if so, the value of this field will always be 1.
107
	 * multiple copies, and if so, the value of this field will always be 1.
108
	 * </p>
96
	 */
109
	 */
97
	public int copyCount = 1;
110
	public int copyCount = 1;
98
	
111
	
99
	/**
112
	/**
100
	 * whether or not the printer should collate the printed paper
113
	 * Whether or not the printer should collate the printed paper.
114
	 * <p>
115
	 * TODO: Need to decide whether or not the following comment should still apply. The function has currently been deleted from the code... should we change the API? SSQ thinks so.
101
	 * Note that this field may be controlled by the printer driver.
116
	 * Note that this field may be controlled by the printer driver.
102
	 * In other words, the printer itself may be capable of doing the
117
	 * In other words, the printer itself may be capable of doing the
103
	 * collation, and if so, the value of this field will always be false.
118
	 * collation, and if so, the value of this field will always be false.
119
	 * </p>
104
	 */
120
	 */
105
	public boolean collate = false;
121
	public boolean collate = false;
106
	
122
	
107
	/**
123
	/**
108
	 * The orientation of the paper, which can be either PORTRAIT
124
	 * The orientation of the paper, which can be either <code>PORTRAIT</code>
109
	 * or LANDSCAPE.
125
	 * or <code>LANDSCAPE</code>.
110
	 * 
126
	 * 
111
	 * @since 3.5
127
	 * @since 3.5
112
	 */
128
	 */
113
	public int orientation = PORTRAIT;
129
	public int orientation = PORTRAIT;
130
	
131
	/**
132
	 * The scaling factor of the page and paper rectangle,
133
	 * expressed as a percentage by which the printed output 
134
	 * is to be scaled. Default value is 100 indicating no scale.
135
	 * 
136
	 * @since 3.6
137
	 */
138
	public int scale = 100;
139
140
	/**
141
	 * The number of logical pages to be tiled on a
142
	 * physical sheet of paper, whose value can be 
143
	 * expressed either of 1, 2, 4, 6, 9 or 16.
144
	 * 
145
	 * @since 3.6
146
	 */
147
	public int pagesPerSide = 1;
148
	
149
	/**
150
	 * Specifies a print job that can print either single-sided or 
151
	 * double-sided printing, expressed as one of the following values: 
152
	 * <dl>
153
	 * <dt><code>DUPLEX_SIMPLEX</code></dt>
154
	 * <dd>Normal one-sided printing</dd>
155
	 * <dt><code>DUPLEX_HORIZONTAL</code></dt>
156
	 * <dd>Duplex printing with page being horizontal</dd>
157
	 * <dt><code>DUPLEX_VERTICAL</code></dt>
158
	 * <dd>Duplex printing with page being vertical</dd>
159
	 * </dl>
160
	 * 
161
	 * @since 3.6
162
	 */
163
	public int duplex = DUPLEX_SIMPLEX;
164
	
165
	/**
166
	 * Specifies the name for the paper size used in a 
167
	 * print job, expressed as one of the following values:
168
	 * <dl>
169
	 * <dt><code>PAPER_LETTER</code></dt>
170
	 * <dt><code>PAPER_LEGAL</code></dt>
171
	 * <dt><code>PAPER_A2</code></dt>
172
	 * <dt><code>PAPER_A4</code></dt>
173
	 * <dt><code>PAPER_A5</code></dt>
174
	 * <dt><code>PAPER_A6</code></dt>
175
	 * <dt><code>PAPER_B5</code></dt>
176
	 * <dt><code>PAPER_JB5</code></dt>
177
	 * <dt><code>PAPER_EXECUTIVE</code></dt>
178
	 * </dl>
179
	 * <p>
180
	 * Also accepts any paper size from the list of available paper size
181
	 * names returned by method <code>Printer.getPaperNameList</code>.
182
	 * </p><p>
183
	 * A value of null leaves the paper size unspecified.
184
	 * </p>
185
	 * 
186
	 * @since 3.6
187
	 */
188
	public String paperSizeName;
189
	
190
	/**
191
	 * The physical height of the paper in inches.
192
	 * <p>
193
	 * Note that this field is ignored if <code>paperSizeName</code>
194
	 * is one of the <code>PAPER_*</code> values.
195
	 * </p>
196
	 * 
197
	 * @since 3.6
198
	 */
199
	public double paperHeight;
200
201
	/**
202
	 * The physical width of the paper in inches. 
203
	 * <p>
204
	 * Note that this field is ignored if <code>paperSizeName</code>
205
	 * is one of the <code>PAPER_*</code> values.
206
	 * </p>
207
	 * 
208
	 * @since 3.6
209
	 */
210
	public double paperWidth;
211
212
	/**
213
	 * The human-readable name of the paper size to
214
	 * be displayed in print dialog.
215
	 * <p>
216
	 * Note that this field is ignored if <code>paperSizeName</code>
217
	 * is one of the <code>PAPER_*</code> values.
218
	 * </p>
219
	 * 
220
	 * @since 3.6
221
	 */
222
	public String paperDisplayName;
223
	
224
	/**
225
	 * Specifies the x-resolution in dots-per-inch of the printer.
226
	 * This configures the print settings to the closest resolution
227
	 * setting that can be used for the destination print job.
228
	 * 
229
	 * @since 3.6
230
	 */
231
	public int resolutionX;
232
233
	/**
234
	 * Specifies the y-resolution in dots-per-inch of the printer.
235
	 * This configures the print settings to the closest resolution
236
	 * setting that can be used for the destination print job.
237
	 * 
238
	 * @since 3.6
239
	 */
240
	public int resolutionY;
114
241
115
	/**
242
	/**
116
	 * <code>scope</code> field value indicating that
243
	 * <code>scope</code> field value indicating that
Lines 132-137 Link Here
132
	public static final int SELECTION = 2;
259
	public static final int SELECTION = 2;
133
		
260
		
134
	/**
261
	/**
262
	 * <code>scope</code> field value indicating that
263
	 * the print dialog does not allow the user to 
264
	 * print a selection. This must be built by 
265
	 * <em>bitwise OR</em>'ing together with the other
266
	 * fields.
267
	 * 
268
	 * @since 3.6
269
	 */
270
	public static final int NO_SELECTION = 4;
271
	
272
	/**
135
	 * <code>orientation</code> field value indicating
273
	 * <code>orientation</code> field value indicating
136
	 * portrait paper orientation
274
	 * portrait paper orientation
137
	 * 
275
	 * 
Lines 148-154 Link Here
148
	public static final int LANDSCAPE = 2;
286
	public static final int LANDSCAPE = 2;
149
	
287
	
150
	/**
288
	/**
151
	 * private, platform-specific data
289
	 * <code>duplex</code> field value indicating
290
	 * one-sided printing
291
	 * 
292
	 * @since 3.6
293
	 */
294
	public static final int DUPLEX_SIMPLEX = 1;
295
	
296
	/**
297
	 * <code>duplex</code> field value indicating
298
	 * double sided printing on short edge
299
	 * 
300
	 * @since 3.6
301
	 */
302
	public static final int DUPLEX_HORIZONTAL = 2;
303
	
304
	/**
305
	 * <code>duplex</code> field value indicating
306
	 * double sided printing on long edge
307
	 * 
308
	 * @since 3.6
309
	 */
310
	public static final int DUPLEX_VERTICAL = 3;
311
	
312
	/**
313
	 * <code>paperSize</code> field value indicating
314
	 * the paper size as LETTER
315
	 * 
316
	 * @since 3.6
317
	 */
318
	public static final String PAPER_LETTER = "LETTER";
319
320
	/**
321
	 * <code>paperSize</code> field value indicating
322
	 * the paper size as LEGAL
323
	 * 
324
	 * @since 3.6
325
	 */
326
	public static final String PAPER_LEGAL = "LEGAL";
327
	
328
	/**
329
	 * <code>paperSize</code> field value indicating
330
	 * the paper size as A2 sheet
331
	 * 
332
	 * @since 3.6
333
	 */
334
	public static final String PAPER_A2 = "A2";
335
336
	/**
337
	 * <code>paperSize</code> field value indicating
338
	 * the paper size as A4 sheet
339
	 * 
340
	 * @since 3.6
341
	 */
342
	public static final String PAPER_A4 = "A4";
343
	
344
	/**
345
	 * <code>paperSize</code> field value indicating
346
	 * the paper size as A5 sheet
347
	 * 
348
	 * @since 3.6
349
	 */
350
	public static final String PAPER_A5 = "A5";
351
352
	/**
353
	 * <code>paperSize</code> field value indicating
354
	 * the paper size as A6 sheet
355
	 * 
356
	 * @since 3.6
357
	 */
358
	public static final String PAPER_A6 = "A6";
359
360
	/**
361
	 * <code>paperSize</code> field value indicating
362
	 * the paper size as B5 sheet
363
	 * 
364
	 * @since 3.6
365
	 */
366
	public static final String PAPER_B5 = "B5";
367
	
368
	/**
369
	 * <code>paperSize</code> field value indicating
370
	 * the paper size as JB5 sheet
371
	 * 
372
	 * @since 3.6
373
	 */
374
	public static final String PAPER_JB5 = "JB5";
375
	
376
	/**
377
	 * <code>paperSize</code> field value indicating
378
	 * the paper size as EXECUTIVE
379
	 * 
380
	 * @since 3.6
381
	 */
382
	public static final String PAPER_EXECUTIVE = "EXECUTIVE";
383
	
384
	/**
385
	 * Private, platform-specific data.
386
	 * <p>
152
	 * On Windows, this contains a copy of the DEVMODE struct
387
	 * On Windows, this contains a copy of the DEVMODE struct
153
	 * returned from the <code>PrintDialog</code>.
388
	 * returned from the <code>PrintDialog</code>.
154
	 * On GTK, this contains a copy of the print_settings and page_setup
389
	 * On GTK, this contains a copy of the print_settings and page_setup
Lines 156-162 Link Here
156
	 * On OS X Carbon, this contains a copy of the PrintSettings and PageFormat
391
	 * On OS X Carbon, this contains a copy of the PrintSettings and PageFormat
157
	 * returned from the <code>PrintDialog</code>.
392
	 * returned from the <code>PrintDialog</code>.
158
	 * This field is not currently used on the X/Window System.
393
	 * This field is not currently used on the X/Window System.
159
	 */	
394
	 * </p>
395
	 */
160
	byte [] otherData;
396
	byte [] otherData;
161
397
162
	/**
398
	/**
(-)Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java (-33 / +100 lines)
Lines 302-309 Link Here
302
		//TODO: Not currently implemented. May need new API. For now, disable 'Current' in the dialog. (see gtk bug 344519)
302
		//TODO: Not currently implemented. May need new API. For now, disable 'Current' in the dialog. (see gtk bug 344519)
303
		OS.gtk_print_unix_dialog_set_current_page(handle, -1);
303
		OS.gtk_print_unix_dialog_set_current_page(handle, -1);
304
		
304
		
305
		OS.gtk_print_unix_dialog_set_manual_capabilities(handle,
305
		OS.gtk_print_unix_dialog_set_manual_capabilities(handle, OS.GTK_PRINT_CAPABILITY_COLLATE | OS.GTK_PRINT_CAPABILITY_COPIES | 
306
			OS.GTK_PRINT_CAPABILITY_COLLATE | OS.GTK_PRINT_CAPABILITY_COPIES | OS.GTK_PRINT_CAPABILITY_PAGE_SET);
306
				OS.GTK_PRINT_CAPABILITY_PAGE_SET | OS.GTK_PRINT_CAPABILITY_SCALE | OS.GTK_PRINT_CAPABILITY_NUMBER_UP);
307
		
307
		
308
		/* Set state into print dialog settings. */
308
		/* Set state into print dialog settings. */
309
		int /*long*/ settings = OS.gtk_print_settings_new();
309
		int /*long*/ settings = OS.gtk_print_settings_new();
Lines 312-317 Link Here
312
		if (printerData.otherData != null) {
312
		if (printerData.otherData != null) {
313
			Printer.restore(printerData.otherData, settings, page_setup);
313
			Printer.restore(printerData.otherData, settings, page_setup);
314
		}
314
		}
315
		/* display fields for Orientation, Paper size, Selection */
316
		if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
317
			OS.gtk_print_unix_dialog_set_embed_page_setup(handle, true);
318
			OS.gtk_print_unix_dialog_set_support_selection(handle, true);
319
			if ((printerData.scope & PrinterData.NO_SELECTION) == 0) {
320
				OS.gtk_print_unix_dialog_set_has_selection(handle, true);
321
			}
322
		}
315
		/* Set values of print_settings and page_setup from PrinterData. */
323
		/* Set values of print_settings and page_setup from PrinterData. */
316
		switch (printerData.scope) {
324
		switch (printerData.scope) {
317
			case PrinterData.ALL_PAGES:
325
			case PrinterData.ALL_PAGES:
Lines 325-357 Link Here
325
				OS.gtk_print_settings_set_page_ranges(settings, pageRange, 1);
333
				OS.gtk_print_settings_set_page_ranges(settings, pageRange, 1);
326
				break;
334
				break;
327
			case PrinterData.SELECTION:
335
			case PrinterData.SELECTION:
328
				//TODO: Not correctly implemented. May need new API. For now, set to ALL. (see gtk bug 344519)
336
				OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_SELECTION);
329
				OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_ALL);
330
				break;
337
				break;
331
		}
338
		}
332
		if (printerData.fileName != null) {
339
		//TODO: printerData.printToFile always take precedence over printerData.name ?
333
			//TODO: Should we look at printToFile, or driver/name for "Print to File", or both? (see gtk bug 345590)
334
			if (printerData.printToFile) {
335
				byte [] buffer = Converter.wcsToMbcs (null, printerData.fileName, true);
336
				OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI, buffer);
337
			}
338
			if (printerData.driver != null && printerData.name != null) {
339
				if (printerData.driver.equals("GtkPrintBackendFile") && printerData.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$
340
					byte [] buffer = Converter.wcsToMbcs (null, printerData.fileName, true);
341
					OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI, buffer);
342
				}
343
			}
344
		}
345
		if (printerData.printToFile) {
340
		if (printerData.printToFile) {
346
			byte [] buffer = Converter.wcsToMbcs (null, "Print to File", true); //$NON-NLS-1$
341
			byte [] buffer = Converter.wcsToMbcs (null, "Print to File", true); //$NON-NLS-1$
347
			OS.gtk_print_settings_set_printer(settings, buffer);
342
			OS.gtk_print_settings_set_printer(settings, buffer);
343
			if (printerData.fileName != null) {
344
				buffer = Converter.wcsToMbcs (null, printerData.fileName, true);
345
				OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI, buffer);
346
			}
347
		} else if (printerData.name != null){
348
			/* Selecting Printer */
349
			byte [] buffer = Converter.wcsToMbcs (null, printerData.name, true);
350
			OS.gtk_print_settings_set_printer(settings, buffer);
348
		}
351
		}
352
		/* Copy Count */
349
		OS.gtk_print_settings_set_n_copies(settings, printerData.copyCount);
353
		OS.gtk_print_settings_set_n_copies(settings, printerData.copyCount);
354
		/* Collate */
350
		OS.gtk_print_settings_set_collate(settings, printerData.collate);
355
		OS.gtk_print_settings_set_collate(settings, printerData.collate);
356
		/* Orientation */
351
		int orientation = printerData.orientation == PrinterData.LANDSCAPE ? OS.GTK_PAGE_ORIENTATION_LANDSCAPE : OS.GTK_PAGE_ORIENTATION_PORTRAIT;
357
		int orientation = printerData.orientation == PrinterData.LANDSCAPE ? OS.GTK_PAGE_ORIENTATION_LANDSCAPE : OS.GTK_PAGE_ORIENTATION_PORTRAIT;
352
		OS.gtk_print_settings_set_orientation(settings, orientation);
358
		OS.gtk_print_settings_set_orientation(settings, orientation);
353
		OS.gtk_page_setup_set_orientation(page_setup, orientation);
359
		OS.gtk_page_setup_set_orientation(page_setup, orientation);
354
		
360
		/* Paper Size */
361
		int /*long*/ paperSize = 0;
362
		if (printerData.paperSizeName == PrinterData.PAPER_CUSTOM) {
363
			if (printerData.customPaperName == null) printerData.customPaperName = "CustomPaper"; //$NON-NLS-1$
364
			if (printerData.customPaperDisplayName == null) printerData.customPaperDisplayName = "CustomPaper"; //$NON-NLS-1$
365
			byte [] name = Converter.wcsToMbcs (null, printerData.customPaperName, true);
366
			byte [] displayName = Converter.wcsToMbcs (null, printerData.customPaperDisplayName, true);
367
			paperSize = OS.gtk_paper_size_new_from_ppd (name, displayName, printerData.customPaperWidth * 72, printerData.customPaperHeight * 72); //It accepts in points..so convert from inch to Points
368
		} else {
369
			/*
370
			* Since there are numerous paper size names, it might not be possible to provide
371
			* constant names for all the sizes. So, if the user selects any paperSizeName not
372
			* defined in SWT, then we should be able to restore it back when the dialog is opened.
373
			*/
374
			String[] keys = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4, 
375
									PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE};
376
			String[] values = {"na_legal", "na_letter", "iso_a2", "iso_a4", 
377
									"iso_a5", "iso_a6", "iso_b5", "jis_b5", "na_executive"}; //$NON-NLS-1$
378
			int index;
379
			for (index = 0; index < keys.length; index++) {
380
				if (printerData.paperSizeName.equals(keys[index])) break;
381
			}
382
			byte [] buffer;
383
			if (index < keys.length) {
384
				buffer = Converter.wcsToMbcs (null, values[index], true);
385
			} else {
386
				buffer = Converter.wcsToMbcs (null, printerData.paperSizeName, true);
387
			}
388
			paperSize = OS.gtk_paper_size_new(buffer);
389
		}
390
		OS.gtk_page_setup_set_paper_size (page_setup, paperSize);
391
		OS.gtk_paper_size_free(paperSize);
392
		/* Pages Per Side */
393
		OS.gtk_print_settings_set_number_up (settings, printerData.pagesPerSide);
394
		/* Duplex */
395
		OS.gtk_print_settings_set_duplex (settings, printerData.duplex - 1);
396
		/* Scale */
397
		OS.gtk_print_settings_set_scale (settings, printerData.scale);
398
		/* Resolution */
399
		if (printerData.resolutionX != 0 && printerData.resolutionY != 0) {
400
			OS.gtk_print_settings_set_resolution_xy (settings, (int)printerData.resolutionX, (int)printerData.resolutionY);
401
		}
355
		OS.gtk_print_unix_dialog_set_settings(handle, settings);
402
		OS.gtk_print_unix_dialog_set_settings(handle, settings);
356
		OS.gtk_print_unix_dialog_set_page_setup(handle, page_setup);
403
		OS.gtk_print_unix_dialog_set_page_setup(handle, page_setup);
357
		OS.g_object_unref(settings);
404
		OS.g_object_unref(settings);
Lines 408-432 Link Here
408
						data.startPage = min == Integer.MAX_VALUE ? 1 : min;
455
						data.startPage = min == Integer.MAX_VALUE ? 1 : min;
409
						data.endPage = max == 0 ? 1 : max;
456
						data.endPage = max == 0 ? 1 : max;
410
						break;
457
						break;
458
					case OS.GTK_PRINT_PAGES_SELECTION:
459
						data.scope = PrinterData.SELECTION;
460
						break;
411
					case OS.GTK_PRINT_PAGES_CURRENT:
461
					case OS.GTK_PRINT_PAGES_CURRENT:
412
						//TODO: Disabled in dialog (see above). This code will not run. (see gtk bug 344519)
462
						//TODO: Disabled in dialog (see above). This code will not run. (see gtk bug 344519)
413
						data.scope = PrinterData.SELECTION;
463
						data.scope = PrinterData.SELECTION;
414
						data.startPage = data.endPage = OS.gtk_print_unix_dialog_get_current_page(handle);
464
						data.startPage = data.endPage = OS.gtk_print_unix_dialog_get_current_page(handle);
415
						break;
465
						break;
416
				}
466
				}
417
				
418
				data.printToFile = data.name.equals("Print to File"); //$NON-NLS-1$
467
				data.printToFile = data.name.equals("Print to File"); //$NON-NLS-1$
419
				if (data.printToFile) {
468
				if (data.printToFile) {
420
					int /*long*/ address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI);
469
					data.fileName = getString (OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI));
421
					int length = OS.strlen (address);
422
					byte [] buffer = new byte [length];
423
					OS.memmove (buffer, address, length);
424
					data.fileName = new String (Converter.mbcsToWcs (null, buffer));
425
				}
470
				}
426
427
				data.copyCount = OS.gtk_print_settings_get_n_copies(settings);
471
				data.copyCount = OS.gtk_print_settings_get_n_copies(settings);
428
				data.collate = OS.gtk_print_settings_get_collate(settings);
472
				data.collate = OS.gtk_print_settings_get_collate(settings);
429
				data.orientation = OS.gtk_page_setup_get_orientation(page_setup) == OS.GTK_PAGE_ORIENTATION_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
473
				data.orientation = OS.gtk_page_setup_get_orientation(page_setup) == OS.GTK_PAGE_ORIENTATION_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
474
				data.scale = OS.gtk_print_settings_get_scale(settings);
475
				data.duplex = OS.gtk_print_settings_get_duplex(settings) + 1;
476
				data.resolutionX = OS.gtk_print_settings_get_resolution_x(settings);
477
				data.resolutionY = OS.gtk_print_settings_get_resolution_y(settings);
478
				
479
				int /*long*/ paper_size = OS.gtk_page_setup_get_paper_size(page_setup);
480
				if (OS.gtk_paper_size_is_custom(paper_size)) {
481
					data.paperSizeName = PrinterData.PAPER_CUSTOM;
482
					data.customPaperHeight = OS.gtk_paper_size_get_height (paper_size, OS.GTK_UNIT_INCH);
483
					data.customPaperWidth = OS.gtk_paper_size_get_width (paper_size, OS.GTK_UNIT_INCH);
484
					data.customPaperName = getString (OS.gtk_paper_size_get_name(paper_size));
485
					data.customPaperDisplayName = getString (OS.gtk_paper_size_get_display_name(paper_size));
486
				} else {
487
					data.paperSizeName = getString (OS.gtk_paper_size_get_name(paper_size));
488
				}
430
489
431
				/* Save other print_settings data as key/value pairs in otherData. */
490
				/* Save other print_settings data as key/value pairs in otherData. */
432
				Callback printSettingsCallback = new Callback(this, "GtkPrintSettingsFunc", 3); //$NON-NLS-1$
491
				Callback printSettingsCallback = new Callback(this, "GtkPrintSettingsFunc", 3); //$NON-NLS-1$
Lines 441-458 Link Here
441
				/* Save page_setup data as key/value pairs in otherData.
500
				/* Save page_setup data as key/value pairs in otherData.
442
				 * Note that page_setup properties must be stored and restored in the same order.
501
				 * Note that page_setup properties must be stored and restored in the same order.
443
				 */
502
				 */
444
				store("orientation", OS.gtk_page_setup_get_orientation(page_setup)); //$NON-NLS-1$
445
				store("top_margin", OS.gtk_page_setup_get_top_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
503
				store("top_margin", OS.gtk_page_setup_get_top_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
446
				store("bottom_margin", OS.gtk_page_setup_get_bottom_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
504
				store("bottom_margin", OS.gtk_page_setup_get_bottom_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
447
				store("left_margin", OS.gtk_page_setup_get_left_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
505
				store("left_margin", OS.gtk_page_setup_get_left_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
448
				store("right_margin", OS.gtk_page_setup_get_right_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
506
				store("right_margin", OS.gtk_page_setup_get_right_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
449
				int /*long*/ paper_size = OS.gtk_page_setup_get_paper_size(page_setup); //$NON-NLS-1$
507
				store ("reverse",OS.gtk_print_settings_get_reverse (settings)); //$NON-NLS-1$
450
				storeBytes("paper_size_name", OS.gtk_paper_size_get_name(paper_size)); //$NON-NLS-1$
508
				store ("color_mode", OS.gtk_print_settings_get_use_color (settings)); //$NON-NLS-1$
451
				storeBytes("paper_size_display_name", OS.gtk_paper_size_get_display_name(paper_size)); //$NON-NLS-1$
509
				store ("print_quality",OS.gtk_print_settings_get_quality (settings)); //$NON-NLS-1$
452
				storeBytes("paper_size_ppd_name", OS.gtk_paper_size_get_ppd_name(paper_size)); //$NON-NLS-1$
510
				if (!data.printToFile) {
453
				store("paper_size_width", OS.gtk_paper_size_get_width(paper_size, OS.GTK_UNIT_MM)); //$NON-NLS-1$
511
					storeBytes ("paper_source", OS.gtk_print_settings_get_default_source (settings)); //$NON-NLS-1$
454
				store("paper_size_height", OS.gtk_paper_size_get_height(paper_size, OS.GTK_UNIT_MM)); //$NON-NLS-1$
512
					storeBytes ("media_type", OS.gtk_print_settings_get_media_type (settings)); //$NON-NLS-1$
455
				store("paper_size_is_custom", OS.gtk_paper_size_is_custom(paper_size)); //$NON-NLS-1$
513
					storeBytes ("output_bin", OS.gtk_print_settings_get_output_bin (settings)); //$NON-NLS-1$
514
				}
515
456
				data.otherData = settingsData;
516
				data.otherData = settingsData;
457
				OS.g_object_unref(settings);
517
				OS.g_object_unref(settings);
458
				printerData = data;
518
				printerData = data;
Lines 475-480 Link Here
475
	return 0;
535
	return 0;
476
}
536
}
477
537
538
String getString (int /*long*/ stringPtr) {
539
	int strLength = OS.strlen (stringPtr);
540
	byte[] buffer = new byte [strLength];
541
	OS.memmove (buffer, stringPtr, strLength);		
542
	return new String (Converter.mbcsToWcs (null, buffer));
543
}
544
478
void store(String key, int value) {
545
void store(String key, int value) {
479
	store(key, String.valueOf(value));
546
	store(key, String.valueOf(value));
480
}
547
}
(-)Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java (-19 / +32 lines)
Lines 67-72 Link Here
67
	static boolean disablePrinting = System.getProperty("org.eclipse.swt.internal.gtk.disablePrinting") != null; //$NON-NLS-1$
67
	static boolean disablePrinting = System.getProperty("org.eclipse.swt.internal.gtk.disablePrinting") != null; //$NON-NLS-1$
68
	
68
	
69
/**
69
/**
70
 * Returns an array of String objects representing all paper
71
 * size names supported by printers on the platform.
72
 * Note that the returned paper size names might be the
73
 * list supported by only default printer.
74
 * 
75
 * @return a string array containing paper size names
76
 * 
77
 * @since 3.6
78
 */
79
public static String[] getPaperNameList () {
80
	int /*long*/ list = OS.gtk_paper_size_get_paper_sizes (true);
81
	int count = OS.g_list_length(list);
82
	String[] result = new String[count];
83
	for (int i=0; i<count; i++) {
84
		int /*long*/ paper = OS.g_list_nth_data(list, i);
85
		int /*long*/ paperNamePtr = OS.gtk_paper_size_get_name (paper);
86
		int length = OS.strlen (paperNamePtr);
87
		byte [] buffer = new byte [length];
88
		OS.memmove (buffer, paperNamePtr, length);
89
		result[i] = new String (Converter.mbcsToWcs (null, buffer));
90
	}
91
	OS.g_list_free (list);
92
	return result;
93
}
94
95
/**
70
 * Returns an array of <code>PrinterData</code> objects
96
 * Returns an array of <code>PrinterData</code> objects
71
 * representing all available printers.  If there are no
97
 * representing all available printers.  If there are no
72
 * printers, the array will be empty.
98
 * printers, the array will be empty.
Lines 214-242 Link Here
214
	/* Retrieve stored page_setup data.
240
	/* Retrieve stored page_setup data.
215
	 * Note that page_setup properties must be stored (in PrintDialog) and restored (here) in the same order.
241
	 * Note that page_setup properties must be stored (in PrintDialog) and restored (here) in the same order.
216
	 */
242
	 */
217
	OS.gtk_page_setup_set_orientation(page_setup, restoreInt("orientation")); //$NON-NLS-1$
218
	OS.gtk_page_setup_set_top_margin(page_setup, restoreDouble("top_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
243
	OS.gtk_page_setup_set_top_margin(page_setup, restoreDouble("top_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
219
	OS.gtk_page_setup_set_bottom_margin(page_setup, restoreDouble("bottom_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
244
	OS.gtk_page_setup_set_bottom_margin(page_setup, restoreDouble("bottom_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
220
	OS.gtk_page_setup_set_left_margin(page_setup, restoreDouble("left_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
245
	OS.gtk_page_setup_set_left_margin(page_setup, restoreDouble("left_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
221
	OS.gtk_page_setup_set_right_margin(page_setup, restoreDouble("right_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
246
	OS.gtk_page_setup_set_right_margin(page_setup, restoreDouble("right_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
222
	byte [] name = restoreBytes("paper_size_name", true); //$NON-NLS-1$
247
	OS.gtk_print_settings_set_reverse (settings, restoreBoolean("reverse")); //$NON-NLS-1$
223
	byte [] display_name = restoreBytes("paper_size_display_name", true); //$NON-NLS-1$
248
	OS.gtk_print_settings_set_use_color (settings, restoreBoolean("color_mode")); //$NON-NLS-1$
224
	byte [] ppd_name = restoreBytes("paper_size_ppd_name", true); //$NON-NLS-1$
249
	OS.gtk_print_settings_set_quality (settings, restoreInt("print_quality")); //$NON-NLS-1$
225
	double width = restoreDouble("paper_size_width"); //$NON-NLS-1$
250
	OS.gtk_print_settings_set_default_source (settings, restoreBytes("paper_source",true)); //$NON-NLS-1$
226
	double height = restoreDouble("paper_size_height"); //$NON-NLS-1$
251
	OS.gtk_print_settings_set_media_type (settings, restoreBytes("media_type",true)); //$NON-NLS-1$
227
	boolean custom = restoreBoolean("paper_size_is_custom"); //$NON-NLS-1$
252
	OS.gtk_print_settings_set_output_bin (settings, restoreBytes("output_bin",true)); //$NON-NLS-1$
228
	int /*long*/ paper_size = 0;
229
	if (custom) {
230
		if (ppd_name.length > 0) {
231
			paper_size = OS.gtk_paper_size_new_from_ppd(ppd_name, display_name, width, height);
232
		} else {
233
			paper_size = OS.gtk_paper_size_new_custom(name, display_name, width, height, OS.GTK_UNIT_MM);
234
		}
235
	} else {
236
		paper_size = OS.gtk_paper_size_new(name);
237
	}
238
	OS.gtk_page_setup_set_paper_size(page_setup, paper_size);
239
	OS.gtk_paper_size_free(paper_size);
240
}
253
}
241
254
242
static DeviceData checkNull (PrinterData data) {
255
static DeviceData checkNull (PrinterData data) {
(-)Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java (-10 / +179 lines)
Lines 32-37 Link Here
32
32
33
public class PrintDialog extends Dialog {
33
public class PrintDialog extends Dialog {
34
	static final TCHAR DialogClass = new TCHAR (0, OS.IsWinCE ? "Dialog" : "#32770", true);
34
	static final TCHAR DialogClass = new TCHAR (0, OS.IsWinCE ? "Dialog" : "#32770", true);
35
	static final String standardPaperNames[] = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4,
36
			PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE};
37
	static final short[] standardPaperValues = {OS.DMPAPER_LEGAL, OS.DMPAPER_LETTER, OS.DMPAPER_A2, OS.DMPAPER_A4,
38
			OS.DMPAPER_A5, OS.DMPAPER_A6, OS.DMPAPER_B5, OS.DMPAPER_JB5, OS.DMPAPER_EXECUTIVE};
35
	PrinterData printerData = new PrinterData();
39
	PrinterData printerData = new PrinterData();
36
	
40
	
37
/**
41
/**
Lines 121-126 Link Here
121
	return checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
125
	return checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
122
}
126
}
123
127
128
static boolean standardPaperSize(String paperSize) {
129
	if (paperSize == null) return false;
130
	for (int i = 0; i < standardPaperNames.length; i++) {
131
		if (paperSize.equals(standardPaperNames[i])) return true;
132
	}
133
	return false;
134
}
135
136
short[] getPaperSizeList () {
137
	short[] resArray = null;
138
	int /*long*/ [] pOutput = new int /*long*/ [1];
139
	int paperNamesLen = Printer.getDeviceCapabilities(OS.DC_PAPERS, pOutput);
140
	if (paperNamesLen > 0) {
141
		resArray = new short[paperNamesLen];
142
		OS.MoveMemory(resArray, pOutput[0], paperNamesLen * 2);
143
		if (pOutput[0] != 0) OS.HeapFree(OS.GetProcessHeap(), 0, pOutput[0]);
144
	}
145
	return resArray;
146
}
147
148
short getSystemPaperSize (String paperSize) {
149
	if (paperSize == null) return -1;
150
	String[] paperList = Printer.getPaperNameList();
151
	int i;
152
	for (i=0; i<paperList.length; i++) {
153
		if (paperSize.equals(paperList[i])) break;
154
	}
155
	if (i == paperList.length) return -1;
156
	short[] paperSizeNumbers = getPaperSizeList();
157
	return paperSizeNumbers[i];
158
}
159
124
/**
160
/**
125
 * Sets the printer data that will be used when the dialog
161
 * Sets the printer data that will be used when the dialog
126
 * is opened.
162
 * is opened.
Lines 347-372 Link Here
347
		int /*long*/ ptr = OS.GlobalLock(hMem);
383
		int /*long*/ ptr = OS.GlobalLock(hMem);
348
		DEVMODE devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
384
		DEVMODE devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
349
		OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
385
		OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
386
		/* Printer Name */
387
		if (printerData.name != null) {
388
			String name = printerData.name;
389
			if (OS.IsUnicode) {
390
				char[] buffer = new char[OS.CCHDEVICENAME];
391
				int length = Math.min(name.length(), OS.CCHDEVICENAME); 
392
				name.getChars(0, length, buffer, 0);
393
				((DEVMODEW)devmode).dmDeviceName = buffer;
394
			} else {
395
				((DEVMODEA)devmode).dmDeviceName = name.getBytes();
396
			}
397
		}
398
		/* Orientation */
350
		devmode.dmFields |= OS.DM_ORIENTATION;
399
		devmode.dmFields |= OS.DM_ORIENTATION;
351
		devmode.dmOrientation = printerData.orientation == PrinterData.PORTRAIT ? OS.DMORIENT_PORTRAIT : OS.DMORIENT_LANDSCAPE;
400
		devmode.dmOrientation = printerData.orientation == PrinterData.PORTRAIT ? OS.DMORIENT_PORTRAIT : OS.DMORIENT_LANDSCAPE;
352
		if (printerData.copyCount != 1) {
401
		/* Copy Count */
353
			devmode.dmFields |= OS.DM_COPIES;
402
		devmode.dmFields |= OS.DM_COPIES;
354
			devmode.dmCopies = (short)printerData.copyCount;
403
		devmode.dmCopies = (short)printerData.copyCount;
355
		}
404
		/* Collate */
356
		if (printerData.collate != false) {
405
		devmode.dmFields |= OS.DM_COLLATE;
357
			devmode.dmFields |= OS.DM_COLLATE;
406
		devmode.dmCollate = OS.DMCOLLATE_TRUE;
358
			devmode.dmCollate = OS.DMCOLLATE_TRUE;
407
		/*Scale*/
408
		devmode.dmFields |= OS.DM_SCALE;
409
		devmode.dmScale = (short)printerData.scale;
410
		/* Duplex Mode */
411
		devmode.dmFields |= OS.DM_DUPLEX;
412
		devmode.dmDuplex = (short)(printerData.duplex + 1);
413
		/* Paper size*/
414
		TCHAR currentPrinter;
415
		if (printerData.name == null) {
416
			int[] nameLen = new int[1];
417
			OS.GetDefaultPrinter (null, nameLen);
418
			currentPrinter = new TCHAR (0, nameLen[0]);
419
			OS.GetDefaultPrinter (currentPrinter, nameLen);
420
		} else {
421
			currentPrinter = new TCHAR(0, printerData.name, true);
422
		}
423
		int /*long*/ [] printerHandle = new int /*long*/ [1];
424
		OS.OpenPrinter (currentPrinter, printerHandle, null);
425
		/* TODO: 
426
		 * Do we need to CreateDC and ResetDC for the changes of
427
		 * custom paperSize to get reflected in the public devmode 
428
		 * settings ?
429
		 */
430
/*		TCHAR driver1 = new TCHAR(0, "winspool", true); 
431
		TCHAR name = new TCHAR(0, ((DEVMODEW)devmode).dmDeviceName, true);
432
		int long hdc = OS.CreateDC(driver1, name, 0, ptr);*/
433
		if (printerData.paperSizeName != null) {
434
			int index;
435
			for (index=0; index < standardPaperNames.length; index++) {
436
				if (printerData.paperSizeName.equals(standardPaperNames[index])) break;
437
			}
438
			if (index < standardPaperNames.length) {
439
				devmode.dmFields |= OS.DM_PAPERSIZE;
440
				devmode.dmPaperSize = standardPaperValues [index];
441
			} else {
442
				devmode.dmFields |= OS.DM_PAPERSIZE | OS.DM_PAPERWIDTH | OS.DM_PAPERLENGTH; 
443
				// TODO: printerData.paperSizeName may still contain a String (not an int) representing an available size from Printer.getPaperNameList
444
				// i.e. still need to handle that here. (i.e. not just DMPAPER_USER... that is only if you do not recognize the String at all)
445
				devmode.dmPaperSize = OS.DMPAPER_USER;
446
				/* Conversion from Inches to tenths of mm */
447
				devmode.dmPaperLength = (short)(printerData.paperHeight * 25.40 * 10);
448
				devmode.dmPaperWidth = (short)(printerData.paperWidth * 25.40 * 10);
449
	
450
				/*TODO: We might need to add a new custom paper size to the existing
451
				 * set of forms. However, this doesn't work for unknown reasons for now.
452
				 */
453
				FORM_INFO_1 printForm = new FORM_INFO_1();
454
				printForm.Flags = 0;
455
				printForm.Size.cx = (int) printerData.paperHeight * 25400;
456
				printForm.Size.cy = (int) printerData.paperHeight * 25400;
457
				printForm.ImageableArea.left = 0;
458
				printForm.ImageableArea.top = 0;
459
				printForm.ImageableArea.bottom = printForm.Size.cx;
460
				printForm.ImageableArea.right = printForm.Size.cy;
461
				
462
				TCHAR buffer = new TCHAR (0, printerData.paperSizeName, true);
463
				int byteCount = buffer.length () * TCHAR.sizeof;
464
				printForm.pName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
465
				OS.MoveMemory (printForm.pName, buffer, byteCount);
466
				
467
				int /*long*/ formPtr =  OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, FORM_INFO_1.sizeof);
468
				OS.MoveMemory(formPtr, printForm, FORM_INFO_1.sizeof);
469
				boolean addRes = OS.AddForm (printerHandle[0], 1, formPtr);
470
				System.out.println("AddForm result:"+addRes);
471
				addRes = OS.SetForm (printerHandle[0], buffer, 1, formPtr);
472
				System.out.println("SetForm result:"+addRes);
473
				
474
				// TODO: I think you may need to use FORM_INFO_2 to set paperDisplayName
475
			}
476
		}
477
		/* Pages Per Side */
478
		if (devmode.dmNup == 1) {
479
			devmode.dmFields |= OS.DM_NUP;
480
			/*TODO: Currently there is no way of directly
481
			 * assigning the Nup value. 
482
			 * OS.updateNup(devmode.dmDriverExtra, 4);
483
			 */
359
		}
484
		}
485
		/* Resolution */
486
		if (printerData.resolutionX != 0) {
487
			devmode.dmFields |= OS.DM_PRINTQUALITY;
488
			devmode.dmPrintQuality = (short) printerData.resolutionX;
489
		}
490
		if (printerData.resolutionY != 0) {
491
			devmode.dmFields |= OS.DM_YRESOLUTION;
492
			devmode.dmYResolution = (short) printerData.resolutionY;
493
		}
494
		/* Sync with devmode settings for getting apt values of PaperSize */
360
		OS.MoveMemory(ptr, devmode, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
495
		OS.MoveMemory(ptr, devmode, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
496
		OS.DocumentProperties(0, printerHandle[0], currentPrinter, 0, ptr, OS.DM_IN_BUFFER);
497
		/*OS.ResetDC (hdc, ptr);*/
361
		OS.GlobalUnlock(hMem);
498
		OS.GlobalUnlock(hMem);
362
	
499
	
363
		pd.Flags = OS.PD_USEDEVMODECOPIESANDCOLLATE;
500
		pd.Flags = OS.PD_USEDEVMODECOPIESANDCOLLATE;
364
		if (printerData.printToFile) pd.Flags |= OS.PD_PRINTTOFILE;
365
		switch (printerData.scope) {
501
		switch (printerData.scope) {
366
			case PrinterData.PAGE_RANGE: pd.Flags |= OS.PD_PAGENUMS; break;
502
			case PrinterData.PAGE_RANGE: pd.Flags |= OS.PD_PAGENUMS; break;
367
			case PrinterData.SELECTION: pd.Flags |= OS.PD_SELECTION; break;
503
			case PrinterData.SELECTION: pd.Flags |= OS.PD_SELECTION; break;
368
			default: pd.Flags |= OS.PD_ALLPAGES;
504
			default: pd.Flags |= OS.PD_ALLPAGES;
369
		}
505
		}
506
		if ((printerData.scope & PrinterData.NO_SELECTION) != 0) pd.Flags |= OS.PD_NOSELECTION;
507
		String outputFileName = null;
508
		if (printerData.printToFile) {
509
			pd.Flags |= OS.PD_PRINTTOFILE;
510
			if (printerData.fileName != null) outputFileName = printerData.fileName;
511
		}
370
		pd.nMinPage = 1;
512
		pd.nMinPage = 1;
371
		pd.nMaxPage = -1;
513
		pd.nMaxPage = -1;
372
		pd.nFromPage = (short) Math.min (0xFFFF, Math.max (1, printerData.startPage));
514
		pd.nFromPage = (short) Math.min (0xFFFF, Math.max (1, printerData.startPage));
Lines 443-460 Link Here
443
				data.scope = PrinterData.SELECTION;
585
				data.scope = PrinterData.SELECTION;
444
			}
586
			}
445
			data.printToFile = (pd.Flags & OS.PD_PRINTTOFILE) != 0;
587
			data.printToFile = (pd.Flags & OS.PD_PRINTTOFILE) != 0;
446
			if (data.printToFile) data.fileName = output;
588
			if (data.printToFile) {
589
				String fullPath;
590
				if (outputFileName != null && !outputFileName.equals("")) {
591
					fullPath = outputFileName;
592
				} else {
593
					fullPath = output;
594
				}
595
				data.fileName = fullPath;
596
			}
447
			data.copyCount = pd.nCopies;
597
			data.copyCount = pd.nCopies;
448
			data.collate = (pd.Flags & OS.PD_COLLATE) != 0;
598
			data.collate = (pd.Flags & OS.PD_COLLATE) != 0;
449
	
599
	
450
			/* Bulk-save the printer-specific settings in the DEVMODE struct */
600
			/* Bulk-save the printer-specific settings in the DEVMODE struct to preserve all of the user's settings. */
451
			hMem = pd.hDevMode;
601
			hMem = pd.hDevMode;
452
			size = OS.GlobalSize(hMem);
602
			size = OS.GlobalSize(hMem);
453
			ptr = OS.GlobalLock(hMem);
603
			ptr = OS.GlobalLock(hMem);
454
			data.otherData = new byte[size];
604
			data.otherData = new byte[size];
455
			OS.MoveMemory(data.otherData, ptr, size);
605
			OS.MoveMemory(data.otherData, ptr, size);
606
			
456
			devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
607
			devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
457
			OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
608
			OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
609
			int index;
610
			for (index=0; index < standardPaperValues.length; index++) {
611
				if (devmode.dmPaperSize == standardPaperValues[index]) break;
612
			}
613
			if (index < standardPaperValues.length) {
614
				data.paperSizeName = standardPaperNames[index];
615
			} else {
616
				//if (devmode.dmPaperSize >= 256) { // TODO: Note: You still need the name even if < DMPAPER_USER.
617
					//TODO: data.paperSizeName = ;  // I think this is in FORM_INFO_1.pName?
618
					//TODO: Don't forget to set the paperDisplayName also (from FORM_INFO_2?)
619
					data.paperHeight = devmode.dmPaperLength;
620
					data.paperWidth = devmode.dmPaperWidth;
621
				//}
622
			}
623
			data.duplex = devmode.dmDuplex - 1;
624
			data.scale = devmode.dmScale;
625
			data.resolutionX = devmode.dmPrintQuality;
626
			data.resolutionY = devmode.dmYResolution;
458
			if ((devmode.dmFields & OS.DM_ORIENTATION) != 0) {
627
			if ((devmode.dmFields & OS.DM_ORIENTATION) != 0) {
459
				int dmOrientation = devmode.dmOrientation;
628
				int dmOrientation = devmode.dmOrientation;
460
				data.orientation = dmOrientation == OS.DMORIENT_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
629
				data.orientation = dmOrientation == OS.DMORIENT_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
(-)Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java (+55 lines)
Lines 150-155 Link Here
150
	return new PrinterData(driver, deviceName);
150
	return new PrinterData(driver, deviceName);
151
}
151
}
152
152
153
/**
154
 * Returns an array of String objects representing all
155
 * paper size names supported by printer on the platform.
156
 * Note that the returned paper size names might be the
157
 * list supported by only default printer.
158
 * 
159
 * @return a String array containing paper size names.
160
 * 
161
 * @since 3.6
162
 */
163
public static String[] getPaperNameList () {
164
	String[] resArray = null;
165
	int /*long*/ [] pOutput = new int /*long*/ [1];
166
	int paperNamesLen = getDeviceCapabilities(OS.DC_PAPERNAMES, pOutput);
167
	if (paperNamesLen > 0) {
168
		resArray = new String[paperNamesLen];
169
		for (int i=0; i< paperNamesLen; i++) {
170
			TCHAR buf = new TCHAR(0, 64);
171
			OS.MoveMemory(buf, pOutput[0] + (i * 64 * TCHAR.sizeof), 64);
172
			String fullString = String.valueOf(buf);
173
			resArray[i] = fullString.substring(0,fullString.indexOf('\0'));
174
		}
175
		if (pOutput[0] != 0) OS.HeapFree(OS.GetProcessHeap(), 0, pOutput[0]);
176
	}
177
	return resArray;
178
}
179
180
static int getDeviceCapabilities (int capability, int /*long*/ [] pOutput) {
181
	int[] nameLen = new int[1];
182
	OS.GetDefaultPrinter (null, nameLen);
183
	TCHAR printerName = new TCHAR(0, nameLen[0]);
184
	OS.GetDefaultPrinter (printerName, nameLen);
185
186
	int len = OS.DeviceCapabilities (printerName, null, capability, 0, 0);
187
	if (len > 0) {
188
		int /*long*/ hHeap = OS.GetProcessHeap();
189
		switch (capability) {
190
			case OS.DC_PAPERS:
191
				pOutput[0] = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, 2 * len);
192
				OS.DeviceCapabilities (printerName, null, capability, pOutput[0], 0);
193
				break;
194
			case OS.DC_PAPERNAMES /* String [] */ :
195
				/* 
196
				 * Each paper name string buffer returned is 64 chars long. If the name 
197
				 * is shorter than 64, then \0 is filled into the buffer, otherwise the
198
				 * name is truncated at 64 chars.
199
				 */
200
				pOutput[0] = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof * len * 64);
201
				OS.DeviceCapabilities (printerName, null, capability, pOutput[0], 0);
202
				break;
203
		}
204
	}
205
	return len;
206
}
207
153
static DeviceData checkNull (PrinterData data) {
208
static DeviceData checkNull (PrinterData data) {
154
	if (data == null) data = new PrinterData();
209
	if (data == null) data = new PrinterData();
155
	if (data.driver == null || data.name == null) {
210
	if (data.driver == null || data.name == null) {

Return to bug 96394