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 834-839 Link Here
834
}
834
}
835
#endif
835
#endif
836
836
837
#ifndef NO_CFArrayGetCount
838
JNIEXPORT jintLong JNICALL OS_NATIVE(CFArrayGetCount)
839
	(JNIEnv *env, jclass that, jint arg0)
840
{
841
	jintLong rc = 0;
842
	OS_NATIVE_ENTER(env, that, CFArrayGetCount_FUNC);
843
	rc = (jintLong)CFArrayGetCount((CFArrayRef)arg0);
844
	OS_NATIVE_EXIT(env, that, CFArrayGetCount_FUNC);
845
	return rc;
846
}
847
#endif
848
849
#ifndef NO_CFArrayGetValueAtIndex
850
JNIEXPORT jintLong JNICALL OS_NATIVE(CFArrayGetValueAtIndex)
851
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
852
{
853
	jintLong rc = 0;
854
	OS_NATIVE_ENTER(env, that, CFArrayGetValueAtIndex_FUNC);
855
	rc = (jintLong)CFArrayGetValueAtIndex((CFArrayRef)arg0, (CFIndex)arg1);
856
	OS_NATIVE_EXIT(env, that, CFArrayGetValueAtIndex_FUNC);
857
	return rc;
858
}
859
#endif
860
837
#ifndef NO_CFAttributedStringCreate
861
#ifndef NO_CFAttributedStringCreate
838
JNIEXPORT jintLong JNICALL OS_NATIVE(CFAttributedStringCreate)
862
JNIEXPORT jintLong JNICALL OS_NATIVE(CFAttributedStringCreate)
839
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
863
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
Lines 892-897 Link Here
892
}
916
}
893
#endif
917
#endif
894
918
919
#ifndef NO_CFNumberCreate
920
JNIEXPORT jintLong JNICALL OS_NATIVE(CFNumberCreate)
921
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintArray arg2)
922
{
923
	jint *lparg2=NULL;
924
	jintLong rc = 0;
925
	OS_NATIVE_ENTER(env, that, CFNumberCreate_FUNC);
926
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
927
	rc = (jintLong)CFNumberCreate((CFAllocatorRef)arg0, (CFNumberType)arg1, (const void *)lparg2);
928
fail:
929
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
930
	OS_NATIVE_EXIT(env, that, CFNumberCreate_FUNC);
931
	return rc;
932
}
933
#endif
934
935
#ifndef NO_CFNumberGetValue
936
JNIEXPORT jboolean JNICALL OS_NATIVE(CFNumberGetValue)
937
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintArray arg2)
938
{
939
	jint *lparg2=NULL;
940
	jboolean rc = 0;
941
	OS_NATIVE_ENTER(env, that, CFNumberGetValue_FUNC);
942
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
943
	rc = (jboolean)CFNumberGetValue((CFNumberRef)arg0, (CFNumberType)arg1, (void *)lparg2);
944
fail:
945
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
946
	OS_NATIVE_EXIT(env, that, CFNumberGetValue_FUNC);
947
	return rc;
948
}
949
#endif
950
895
#ifndef NO_CFRange_1sizeof
951
#ifndef NO_CFRange_1sizeof
896
JNIEXPORT jint JNICALL OS_NATIVE(CFRange_1sizeof)
952
JNIEXPORT jint JNICALL OS_NATIVE(CFRange_1sizeof)
897
	(JNIEnv *env, jclass that)
953
	(JNIEnv *env, jclass that)
Lines 4264-4269 Link Here
4264
}
4320
}
4265
#endif
4321
#endif
4266
4322
4323
#ifndef NO_NSPrintPagesAcross
4324
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPagesAcross)
4325
	(JNIEnv *env, jclass that)
4326
{
4327
	jintLong rc = 0;
4328
	OS_NATIVE_ENTER(env, that, NSPrintPagesAcross_FUNC);
4329
	rc = (jintLong)NSPrintPagesAcross;
4330
	OS_NATIVE_EXIT(env, that, NSPrintPagesAcross_FUNC);
4331
	return rc;
4332
}
4333
#endif
4334
4335
#ifndef NO_NSPrintPagesDown
4336
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPagesDown)
4337
	(JNIEnv *env, jclass that)
4338
{
4339
	jintLong rc = 0;
4340
	OS_NATIVE_ENTER(env, that, NSPrintPagesDown_FUNC);
4341
	rc = (jintLong)NSPrintPagesDown;
4342
	OS_NATIVE_EXIT(env, that, NSPrintPagesDown_FUNC);
4343
	return rc;
4344
}
4345
#endif
4346
4267
#ifndef NO_NSPrintPreviewJob
4347
#ifndef NO_NSPrintPreviewJob
4268
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPreviewJob)
4348
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPreviewJob)
4269
	(JNIEnv *env, jclass that)
4349
	(JNIEnv *env, jclass that)
Lines 4276-4281 Link Here
4276
}
4356
}
4277
#endif
4357
#endif
4278
4358
4359
#ifndef NO_NSPrintPrinterName
4360
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintPrinterName)
4361
	(JNIEnv *env, jclass that)
4362
{
4363
	jintLong rc = 0;
4364
	OS_NATIVE_ENTER(env, that, NSPrintPrinterName_FUNC);
4365
	rc = (jintLong)NSPrintPrinterName;
4366
	OS_NATIVE_EXIT(env, that, NSPrintPrinterName_FUNC);
4367
	return rc;
4368
}
4369
#endif
4370
4279
#ifndef NO_NSPrintSaveJob
4371
#ifndef NO_NSPrintSaveJob
4280
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintSaveJob)
4372
JNIEXPORT jintLong JNICALL OS_NATIVE(NSPrintSaveJob)
4281
	(JNIEnv *env, jclass that)
4373
	(JNIEnv *env, jclass that)
Lines 4704-4709 Link Here
4704
}
4796
}
4705
#endif
4797
#endif
4706
4798
4799
#ifndef NO_PMCopyPageFormat
4800
JNIEXPORT jintLong JNICALL OS_NATIVE(PMCopyPageFormat)
4801
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
4802
{
4803
	jintLong rc = 0;
4804
	OS_NATIVE_ENTER(env, that, PMCopyPageFormat_FUNC);
4805
	rc = (jintLong)PMCopyPageFormat((PMPageFormat)arg0, (PMPageFormat)arg1);
4806
	OS_NATIVE_EXIT(env, that, PMCopyPageFormat_FUNC);
4807
	return rc;
4808
}
4809
#endif
4810
4811
#ifndef NO_PMCreatePageFormatWithPMPaper
4812
JNIEXPORT jintLong JNICALL OS_NATIVE(PMCreatePageFormatWithPMPaper)
4813
	(JNIEnv *env, jclass that, jintArray arg0, jintLong arg1)
4814
{
4815
	jint *lparg0=NULL;
4816
	jintLong rc = 0;
4817
	OS_NATIVE_ENTER(env, that, PMCreatePageFormatWithPMPaper_FUNC);
4818
	if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
4819
	rc = (jintLong)PMCreatePageFormatWithPMPaper((PMPageFormat*)lparg0, (PMPaper)arg1);
4820
fail:
4821
	if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
4822
	OS_NATIVE_EXIT(env, that, PMCreatePageFormatWithPMPaper_FUNC);
4823
	return rc;
4824
}
4825
#endif
4826
4827
#ifndef NO_PMCreatePrintSettings
4828
JNIEXPORT jintLong JNICALL OS_NATIVE(PMCreatePrintSettings)
4829
	(JNIEnv *env, jclass that, jintArray arg0)
4830
{
4831
	jint *lparg0=NULL;
4832
	jintLong rc = 0;
4833
	OS_NATIVE_ENTER(env, that, PMCreatePrintSettings_FUNC);
4834
	if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
4835
	rc = (jintLong)PMCreatePrintSettings((PMPrintSettings*)lparg0);
4836
fail:
4837
	if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
4838
	OS_NATIVE_EXIT(env, that, PMCreatePrintSettings_FUNC);
4839
	return rc;
4840
}
4841
#endif
4842
4843
#ifndef NO_PMCreateSession
4844
JNIEXPORT jint JNICALL OS_NATIVE(PMCreateSession)
4845
	(JNIEnv *env, jclass that, jintArray arg0)
4846
{
4847
	jint *lparg0=NULL;
4848
	jint rc = 0;
4849
	OS_NATIVE_ENTER(env, that, PMCreateSession_FUNC);
4850
	if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
4851
	rc = (jint)PMCreateSession((PMPrintSession*)lparg0);
4852
fail:
4853
	if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
4854
	OS_NATIVE_EXIT(env, that, PMCreateSession_FUNC);
4855
	return rc;
4856
}
4857
#endif
4858
4859
#ifndef NO_PMGetDuplex
4860
JNIEXPORT void JNICALL OS_NATIVE(PMGetDuplex)
4861
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
4862
{
4863
	jint *lparg1=NULL;
4864
	OS_NATIVE_ENTER(env, that, PMGetDuplex_FUNC);
4865
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4866
	PMGetDuplex((PMPrintSettings)arg0, (PMDuplexMode*)lparg1);
4867
fail:
4868
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4869
	OS_NATIVE_EXIT(env, that, PMGetDuplex_FUNC);
4870
}
4871
#endif
4872
4873
#ifndef NO_PMGetPageFormatPaper
4874
JNIEXPORT jintLong JNICALL OS_NATIVE(PMGetPageFormatPaper)
4875
	(JNIEnv *env, jclass that, jint arg0, jintArray arg1)
4876
{
4877
	jint *lparg1=NULL;
4878
	jintLong rc = 0;
4879
	OS_NATIVE_ENTER(env, that, PMGetPageFormatPaper_FUNC);
4880
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4881
	rc = (jintLong)PMGetPageFormatPaper((PMPageFormat)arg0, (PMPaper*)lparg1);
4882
fail:
4883
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4884
	OS_NATIVE_EXIT(env, that, PMGetPageFormatPaper_FUNC);
4885
	return rc;
4886
}
4887
#endif
4888
4889
#ifndef NO_PMPageFormatGetPrinterID
4890
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPageFormatGetPrinterID)
4891
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
4892
{
4893
	jint *lparg1=NULL;
4894
	jintLong rc = 0;
4895
	OS_NATIVE_ENTER(env, that, PMPageFormatGetPrinterID_FUNC);
4896
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4897
	rc = (jintLong)PMPageFormatGetPrinterID((PMPageFormat)arg0, (CFStringRef*)lparg1);
4898
fail:
4899
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4900
	OS_NATIVE_EXIT(env, that, PMPageFormatGetPrinterID_FUNC);
4901
	return rc;
4902
}
4903
#endif
4904
4905
#ifndef NO_PMPaperCreateCustom
4906
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperCreateCustom)
4907
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jdouble arg3, jdouble arg4, jdoubleArray arg5, jintArray arg6)
4908
{
4909
	jdouble *lparg5=NULL;
4910
	jint *lparg6=NULL;
4911
	jintLong rc = 0;
4912
	OS_NATIVE_ENTER(env, that, PMPaperCreateCustom_FUNC);
4913
	if (arg5) if ((lparg5 = (*env)->GetDoubleArrayElements(env, arg5, NULL)) == NULL) goto fail;
4914
	if (arg6) if ((lparg6 = (*env)->GetIntArrayElements(env, arg6, NULL)) == NULL) goto fail;
4915
	rc = (jintLong)PMPaperCreateCustom((PMPrinter)arg0, (CFStringRef)arg1, (CFStringRef)arg2, (double)arg3, (double)arg4, (const PMPaperMargins*)lparg5, (PMPaper*)lparg6);
4916
fail:
4917
	if (arg6 && lparg6) (*env)->ReleaseIntArrayElements(env, arg6, lparg6, 0);
4918
	if (arg5 && lparg5) (*env)->ReleaseDoubleArrayElements(env, arg5, lparg5, 0);
4919
	OS_NATIVE_EXIT(env, that, PMPaperCreateCustom_FUNC);
4920
	return rc;
4921
}
4922
#endif
4923
4924
#ifndef NO_PMPaperCreateLocalizedName
4925
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperCreateLocalizedName)
4926
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2)
4927
{
4928
	jint *lparg2=NULL;
4929
	jintLong rc = 0;
4930
	OS_NATIVE_ENTER(env, that, PMPaperCreateLocalizedName_FUNC);
4931
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
4932
	rc = (jintLong)PMPaperCreateLocalizedName((PMPaper)arg0, (PMPrinter)arg1, (CFStringRef*)lparg2);
4933
fail:
4934
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
4935
	OS_NATIVE_EXIT(env, that, PMPaperCreateLocalizedName_FUNC);
4936
	return rc;
4937
}
4938
#endif
4939
4940
#ifndef NO_PMPaperGetHeight
4941
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetHeight)
4942
	(JNIEnv *env, jclass that, jintLong arg0, jdoubleArray arg1)
4943
{
4944
	jdouble *lparg1=NULL;
4945
	jintLong rc = 0;
4946
	OS_NATIVE_ENTER(env, that, PMPaperGetHeight_FUNC);
4947
	if (arg1) if ((lparg1 = (*env)->GetDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail;
4948
	rc = (jintLong)PMPaperGetHeight((PMPaper)arg0, (double*)lparg1);
4949
fail:
4950
	if (arg1 && lparg1) (*env)->ReleaseDoubleArrayElements(env, arg1, lparg1, 0);
4951
	OS_NATIVE_EXIT(env, that, PMPaperGetHeight_FUNC);
4952
	return rc;
4953
}
4954
#endif
4955
4956
#ifndef NO_PMPaperGetID
4957
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetID)
4958
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
4959
{
4960
	jint *lparg1=NULL;
4961
	jintLong rc = 0;
4962
	OS_NATIVE_ENTER(env, that, PMPaperGetID_FUNC);
4963
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4964
	rc = (jintLong)PMPaperGetID((PMPaper)arg0, (CFStringRef*)lparg1);
4965
fail:
4966
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4967
	OS_NATIVE_EXIT(env, that, PMPaperGetID_FUNC);
4968
	return rc;
4969
}
4970
#endif
4971
4972
#ifndef NO_PMPaperGetName
4973
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetName)
4974
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
4975
{
4976
	jint *lparg1=NULL;
4977
	jintLong rc = 0;
4978
	OS_NATIVE_ENTER(env, that, PMPaperGetName_FUNC);
4979
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
4980
	rc = (jintLong)PMPaperGetName((PMPaper)arg0, (CFStringRef*)lparg1);
4981
fail:
4982
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
4983
	OS_NATIVE_EXIT(env, that, PMPaperGetName_FUNC);
4984
	return rc;
4985
}
4986
#endif
4987
4988
#ifndef NO_PMPaperGetWidth
4989
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPaperGetWidth)
4990
	(JNIEnv *env, jclass that, jintLong arg0, jdoubleArray arg1)
4991
{
4992
	jdouble *lparg1=NULL;
4993
	jintLong rc = 0;
4994
	OS_NATIVE_ENTER(env, that, PMPaperGetWidth_FUNC);
4995
	if (arg1) if ((lparg1 = (*env)->GetDoubleArrayElements(env, arg1, NULL)) == NULL) goto fail;
4996
	rc = (jintLong)PMPaperGetWidth((PMPaper)arg0, (double*)lparg1);
4997
fail:
4998
	if (arg1 && lparg1) (*env)->ReleaseDoubleArrayElements(env, arg1, lparg1, 0);
4999
	OS_NATIVE_EXIT(env, that, PMPaperGetWidth_FUNC);
5000
	return rc;
5001
}
5002
#endif
5003
5004
#ifndef NO_PMPaperIsCustom
5005
JNIEXPORT jboolean JNICALL OS_NATIVE(PMPaperIsCustom)
5006
	(JNIEnv *env, jclass that, jintLong arg0)
5007
{
5008
	jboolean rc = 0;
5009
	OS_NATIVE_ENTER(env, that, PMPaperIsCustom_FUNC);
5010
	rc = (jboolean)PMPaperIsCustom((PMPaper)arg0);
5011
	OS_NATIVE_EXIT(env, that, PMPaperIsCustom_FUNC);
5012
	return rc;
5013
}
5014
#endif
5015
5016
#ifndef NO_PMPrintSettingsCopyKeys
5017
JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsCopyKeys)
5018
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5019
{
5020
	jint *lparg1=NULL;
5021
	jint rc = 0;
5022
	OS_NATIVE_ENTER(env, that, PMPrintSettingsCopyKeys_FUNC);
5023
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5024
	rc = (jint)PMPrintSettingsCopyKeys((PMPrintSettings)arg0, (CFArrayRef*)lparg1);
5025
fail:
5026
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5027
	OS_NATIVE_EXIT(env, that, PMPrintSettingsCopyKeys_FUNC);
5028
	return rc;
5029
}
5030
#endif
5031
5032
#ifndef NO_PMPrintSettingsGetValue
5033
JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsGetValue)
5034
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2)
5035
{
5036
	jint *lparg2=NULL;
5037
	jint rc = 0;
5038
	OS_NATIVE_ENTER(env, that, PMPrintSettingsGetValue_FUNC);
5039
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
5040
	rc = (jint)PMPrintSettingsGetValue((PMPrintSettings)arg0, (CFStringRef)arg1, (CFTypeRef*)lparg2);
5041
fail:
5042
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
5043
	OS_NATIVE_EXIT(env, that, PMPrintSettingsGetValue_FUNC);
5044
	return rc;
5045
}
5046
#endif
5047
5048
#ifndef NO_PMPrintSettingsSetValue
5049
JNIEXPORT jint JNICALL OS_NATIVE(PMPrintSettingsSetValue)
5050
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jboolean arg3)
5051
{
5052
	jint rc = 0;
5053
	OS_NATIVE_ENTER(env, that, PMPrintSettingsSetValue_FUNC);
5054
	rc = (jint)PMPrintSettingsSetValue((PMPrintSettings)arg0, (CFStringRef)arg1, (CFTypeRef)arg2, (Boolean)arg3);
5055
	OS_NATIVE_EXIT(env, that, PMPrintSettingsSetValue_FUNC);
5056
	return rc;
5057
}
5058
#endif
5059
5060
#ifndef NO_PMPrinterCreateFromPrinterID
5061
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterCreateFromPrinterID)
5062
	(JNIEnv *env, jclass that, jintLong arg0)
5063
{
5064
	jintLong rc = 0;
5065
	OS_NATIVE_ENTER(env, that, PMPrinterCreateFromPrinterID_FUNC);
5066
	rc = (jintLong)PMPrinterCreateFromPrinterID((CFStringRef)arg0);
5067
	OS_NATIVE_EXIT(env, that, PMPrinterCreateFromPrinterID_FUNC);
5068
	return rc;
5069
}
5070
#endif
5071
5072
#ifndef NO_PMPrinterGetMimeTypes
5073
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetMimeTypes)
5074
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintArray arg2)
5075
{
5076
	jint *lparg2=NULL;
5077
	jintLong rc = 0;
5078
	OS_NATIVE_ENTER(env, that, PMPrinterGetMimeTypes_FUNC);
5079
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
5080
	rc = (jintLong)PMPrinterGetMimeTypes((PMPrinter)arg0, (PMPrintSettings)arg1, (CFArrayRef*)lparg2);
5081
fail:
5082
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
5083
	OS_NATIVE_EXIT(env, that, PMPrinterGetMimeTypes_FUNC);
5084
	return rc;
5085
}
5086
#endif
5087
5088
#ifndef NO_PMPrinterGetName
5089
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetName)
5090
	(JNIEnv *env, jclass that, jintLong arg0)
5091
{
5092
	jintLong rc = 0;
5093
	OS_NATIVE_ENTER(env, that, PMPrinterGetName_FUNC);
5094
	rc = (jintLong)PMPrinterGetName((PMPrinter)arg0);
5095
	OS_NATIVE_EXIT(env, that, PMPrinterGetName_FUNC);
5096
	return rc;
5097
}
5098
#endif
5099
5100
#ifndef NO_PMPrinterGetOutputResolution
5101
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetOutputResolution)
5102
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdoubleArray arg2)
5103
{
5104
	jdouble *lparg2=NULL;
5105
	jintLong rc = 0;
5106
	OS_NATIVE_ENTER(env, that, PMPrinterGetOutputResolution_FUNC);
5107
	if (arg2) if ((lparg2 = (*env)->GetDoubleArrayElements(env, arg2, NULL)) == NULL) goto fail;
5108
	rc = (jintLong)PMPrinterGetOutputResolution((PMPrinter)arg0, (PMPrintSettings)arg1, (PMResolution*)lparg2);
5109
fail:
5110
	if (arg2 && lparg2) (*env)->ReleaseDoubleArrayElements(env, arg2, lparg2, 0);
5111
	OS_NATIVE_EXIT(env, that, PMPrinterGetOutputResolution_FUNC);
5112
	return rc;
5113
}
5114
#endif
5115
5116
#ifndef NO_PMPrinterGetPaperList
5117
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterGetPaperList)
5118
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5119
{
5120
	jint *lparg1=NULL;
5121
	jintLong rc = 0;
5122
	OS_NATIVE_ENTER(env, that, PMPrinterGetPaperList_FUNC);
5123
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5124
	rc = (jintLong)PMPrinterGetPaperList((PMPrinter)arg0, (CFArrayRef*)lparg1);
5125
fail:
5126
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5127
	OS_NATIVE_EXIT(env, that, PMPrinterGetPaperList_FUNC);
5128
	return rc;
5129
}
5130
#endif
5131
5132
#ifndef NO_PMPrinterSetOutputResolution
5133
JNIEXPORT jintLong JNICALL OS_NATIVE(PMPrinterSetOutputResolution)
5134
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdoubleArray arg2)
5135
{
5136
	jdouble *lparg2=NULL;
5137
	jintLong rc = 0;
5138
	OS_NATIVE_ENTER(env, that, PMPrinterSetOutputResolution_FUNC);
5139
	if (arg2) if ((lparg2 = (*env)->GetDoubleArrayElements(env, arg2, NULL)) == NULL) goto fail;
5140
	rc = (jintLong)PMPrinterSetOutputResolution((PMPrinter)arg0, (PMPrintSettings)arg1, (PMResolution*)lparg2);
5141
fail:
5142
	if (arg2 && lparg2) (*env)->ReleaseDoubleArrayElements(env, arg2, lparg2, 0);
5143
	OS_NATIVE_EXIT(env, that, PMPrinterSetOutputResolution_FUNC);
5144
	return rc;
5145
}
5146
#endif
5147
5148
#ifndef NO_PMRelease
5149
JNIEXPORT jint JNICALL OS_NATIVE(PMRelease)
5150
	(JNIEnv *env, jclass that, jintLong arg0)
5151
{
5152
	jint rc = 0;
5153
	OS_NATIVE_ENTER(env, that, PMRelease_FUNC);
5154
	rc = (jint)PMRelease((PMObject)arg0);
5155
	OS_NATIVE_EXIT(env, that, PMRelease_FUNC);
5156
	return rc;
5157
}
5158
#endif
5159
5160
#ifndef NO_PMSessionGetCurrentPrinter
5161
JNIEXPORT jint JNICALL OS_NATIVE(PMSessionGetCurrentPrinter)
5162
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
5163
{
5164
	jint *lparg1=NULL;
5165
	jint rc = 0;
5166
	OS_NATIVE_ENTER(env, that, PMSessionGetCurrentPrinter_FUNC);
5167
	if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
5168
	rc = (jint)PMSessionGetCurrentPrinter((PMPrintSession)arg0, (PMPrinter*)lparg1);
5169
fail:
5170
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0);
5171
	OS_NATIVE_EXIT(env, that, PMSessionGetCurrentPrinter_FUNC);
5172
	return rc;
5173
}
5174
#endif
5175
5176
#ifndef NO_PMSetDuplex
5177
JNIEXPORT void JNICALL OS_NATIVE(PMSetDuplex)
5178
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
5179
{
5180
	OS_NATIVE_ENTER(env, that, PMSetDuplex_FUNC);
5181
	PMSetDuplex((PMPrintSettings)arg0, (PMDuplexMode)arg1);
5182
	OS_NATIVE_EXIT(env, that, PMSetDuplex_FUNC);
5183
}
5184
#endif
5185
4707
#ifndef NO_PtInRgn
5186
#ifndef NO_PtInRgn
4708
JNIEXPORT jboolean JNICALL OS_NATIVE(PtInRgn)
5187
JNIEXPORT jboolean JNICALL OS_NATIVE(PtInRgn)
4709
	(JNIEnv *env, jclass that, jshortArray arg0, jintLong arg1)
5188
	(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 = 552;
17
int OS_nativeFunctionCount = 585;
18
int OS_nativeFunctionCallCount[552];
18
int OS_nativeFunctionCallCount[585];
19
char * OS_nativeFunctionNames[] = {
19
char * OS_nativeFunctionNames[] = {
20
	"ATSFontActivateFromFileReference",
20
	"ATSFontActivateFromFileReference",
21
	"AcquireRootMenu",
21
	"AcquireRootMenu",
Lines 54-64 Link Here
54
	"CALLBACK_1titleRectForBounds_1",
54
	"CALLBACK_1titleRectForBounds_1",
55
	"CALLBACK_1view_1stringForToolTip_1point_1userData_1",
55
	"CALLBACK_1view_1stringForToolTip_1point_1userData_1",
56
	"CALLBACK_1webView_1setFrame_1",
56
	"CALLBACK_1webView_1setFrame_1",
57
	"CFArrayGetCount",
58
	"CFArrayGetValueAtIndex",
57
	"CFAttributedStringCreate",
59
	"CFAttributedStringCreate",
58
	"CFDataGetBytePtr",
60
	"CFDataGetBytePtr",
59
	"CFDataGetLength",
61
	"CFDataGetLength",
60
	"CFDictionaryAddValue",
62
	"CFDictionaryAddValue",
61
	"CFDictionaryCreateMutable",
63
	"CFDictionaryCreateMutable",
64
	"CFNumberCreate",
65
	"CFNumberGetValue",
62
	"CFRange_1sizeof",
66
	"CFRange_1sizeof",
63
	"CFRelease",
67
	"CFRelease",
64
	"CFRunLoopAddObserver",
68
	"CFRunLoopAddObserver",
Lines 331-337 Link Here
331
	"NSPrintJobDisposition",
335
	"NSPrintJobDisposition",
332
	"NSPrintLastPage",
336
	"NSPrintLastPage",
333
	"NSPrintMustCollate",
337
	"NSPrintMustCollate",
338
	"NSPrintPagesAcross",
339
	"NSPrintPagesDown",
334
	"NSPrintPreviewJob",
340
	"NSPrintPreviewJob",
341
	"NSPrintPrinterName",
335
	"NSPrintSaveJob",
342
	"NSPrintSaveJob",
336
	"NSPrintSavePath",
343
	"NSPrintSavePath",
337
	"NSPrintScalingFactor",
344
	"NSPrintScalingFactor",
Lines 366-371 Link Here
366
	"NewRgn",
373
	"NewRgn",
367
	"OffsetRgn",
374
	"OffsetRgn",
368
	"OpenRgn",
375
	"OpenRgn",
376
	"PMCopyPageFormat",
377
	"PMCreatePageFormatWithPMPaper",
378
	"PMCreatePrintSettings",
379
	"PMCreateSession",
380
	"PMGetDuplex",
381
	"PMGetPageFormatPaper",
382
	"PMPageFormatGetPrinterID",
383
	"PMPaperCreateCustom",
384
	"PMPaperCreateLocalizedName",
385
	"PMPaperGetHeight",
386
	"PMPaperGetID",
387
	"PMPaperGetName",
388
	"PMPaperGetWidth",
389
	"PMPaperIsCustom",
390
	"PMPrintSettingsCopyKeys",
391
	"PMPrintSettingsGetValue",
392
	"PMPrintSettingsSetValue",
393
	"PMPrinterCreateFromPrinterID",
394
	"PMPrinterGetMimeTypes",
395
	"PMPrinterGetName",
396
	"PMPrinterGetOutputResolution",
397
	"PMPrinterGetPaperList",
398
	"PMPrinterSetOutputResolution",
399
	"PMRelease",
400
	"PMSessionGetCurrentPrinter",
401
	"PMSetDuplex",
369
	"PtInRgn",
402
	"PtInRgn",
370
	"QDRegionToRects",
403
	"QDRegionToRects",
371
	"RectInRgn",
404
	"RectInRgn",
(-)Eclipse SWT PI/cocoa/library/os_stats.h (+33 lines)
Lines 62-72 Link Here
62
	CALLBACK_1titleRectForBounds_1_FUNC,
62
	CALLBACK_1titleRectForBounds_1_FUNC,
63
	CALLBACK_1view_1stringForToolTip_1point_1userData_1_FUNC,
63
	CALLBACK_1view_1stringForToolTip_1point_1userData_1_FUNC,
64
	CALLBACK_1webView_1setFrame_1_FUNC,
64
	CALLBACK_1webView_1setFrame_1_FUNC,
65
	CFArrayGetCount_FUNC,
66
	CFArrayGetValueAtIndex_FUNC,
65
	CFAttributedStringCreate_FUNC,
67
	CFAttributedStringCreate_FUNC,
66
	CFDataGetBytePtr_FUNC,
68
	CFDataGetBytePtr_FUNC,
67
	CFDataGetLength_FUNC,
69
	CFDataGetLength_FUNC,
68
	CFDictionaryAddValue_FUNC,
70
	CFDictionaryAddValue_FUNC,
69
	CFDictionaryCreateMutable_FUNC,
71
	CFDictionaryCreateMutable_FUNC,
72
	CFNumberCreate_FUNC,
73
	CFNumberGetValue_FUNC,
70
	CFRange_1sizeof_FUNC,
74
	CFRange_1sizeof_FUNC,
71
	CFRelease_FUNC,
75
	CFRelease_FUNC,
72
	CFRunLoopAddObserver_FUNC,
76
	CFRunLoopAddObserver_FUNC,
Lines 339-345 Link Here
339
	NSPrintJobDisposition_FUNC,
343
	NSPrintJobDisposition_FUNC,
340
	NSPrintLastPage_FUNC,
344
	NSPrintLastPage_FUNC,
341
	NSPrintMustCollate_FUNC,
345
	NSPrintMustCollate_FUNC,
346
	NSPrintPagesAcross_FUNC,
347
	NSPrintPagesDown_FUNC,
342
	NSPrintPreviewJob_FUNC,
348
	NSPrintPreviewJob_FUNC,
349
	NSPrintPrinterName_FUNC,
343
	NSPrintSaveJob_FUNC,
350
	NSPrintSaveJob_FUNC,
344
	NSPrintSavePath_FUNC,
351
	NSPrintSavePath_FUNC,
345
	NSPrintScalingFactor_FUNC,
352
	NSPrintScalingFactor_FUNC,
Lines 374-379 Link Here
374
	NewRgn_FUNC,
381
	NewRgn_FUNC,
375
	OffsetRgn_FUNC,
382
	OffsetRgn_FUNC,
376
	OpenRgn_FUNC,
383
	OpenRgn_FUNC,
384
	PMCopyPageFormat_FUNC,
385
	PMCreatePageFormatWithPMPaper_FUNC,
386
	PMCreatePrintSettings_FUNC,
387
	PMCreateSession_FUNC,
388
	PMGetDuplex_FUNC,
389
	PMGetPageFormatPaper_FUNC,
390
	PMPageFormatGetPrinterID_FUNC,
391
	PMPaperCreateCustom_FUNC,
392
	PMPaperCreateLocalizedName_FUNC,
393
	PMPaperGetHeight_FUNC,
394
	PMPaperGetID_FUNC,
395
	PMPaperGetName_FUNC,
396
	PMPaperGetWidth_FUNC,
397
	PMPaperIsCustom_FUNC,
398
	PMPrintSettingsCopyKeys_FUNC,
399
	PMPrintSettingsGetValue_FUNC,
400
	PMPrintSettingsSetValue_FUNC,
401
	PMPrinterCreateFromPrinterID_FUNC,
402
	PMPrinterGetMimeTypes_FUNC,
403
	PMPrinterGetName_FUNC,
404
	PMPrinterGetOutputResolution_FUNC,
405
	PMPrinterGetPaperList_FUNC,
406
	PMPrinterSetOutputResolution_FUNC,
407
	PMRelease_FUNC,
408
	PMSessionGetCurrentPrinter_FUNC,
409
	PMSetDuplex_FUNC,
377
	PtInRgn_FUNC,
410
	PtInRgn_FUNC,
378
	QDRegionToRects_FUNC,
411
	QDRegionToRects_FUNC,
379
	RectInRgn_FUNC,
412
	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 674-679 Link Here
674
public static final int /*long*/ sel_CGEvent = sel_registerName("CGEvent");
674
public static final int /*long*/ sel_CGEvent = sel_registerName("CGEvent");
675
public static final int /*long*/ sel_DOMDocument = sel_registerName("DOMDocument");
675
public static final int /*long*/ sel_DOMDocument = sel_registerName("DOMDocument");
676
public static final int /*long*/ sel_IBeamCursor = sel_registerName("IBeamCursor");
676
public static final int /*long*/ sel_IBeamCursor = sel_registerName("IBeamCursor");
677
public static final int /*long*/ sel_PMPrintSettings = sel_registerName("PMPrintSettings");
678
public static final int /*long*/ sel_PMPrintSession = sel_registerName("PMPrintSession");
677
public static final int /*long*/ sel_TIFFRepresentation = sel_registerName("TIFFRepresentation");
679
public static final int /*long*/ sel_TIFFRepresentation = sel_registerName("TIFFRepresentation");
678
public static final int /*long*/ sel_URL = sel_registerName("URL");
680
public static final int /*long*/ sel_URL = sel_registerName("URL");
679
public static final int /*long*/ sel_URLFromPasteboard_ = sel_registerName("URLFromPasteboard:");
681
public static final int /*long*/ sel_URLFromPasteboard_ = sel_registerName("URLFromPasteboard:");
Lines 1200-1205 Link Here
1200
public static final int /*long*/ sel_itemObjectValueAtIndex_ = sel_registerName("itemObjectValueAtIndex:");
1202
public static final int /*long*/ sel_itemObjectValueAtIndex_ = sel_registerName("itemObjectValueAtIndex:");
1201
public static final int /*long*/ sel_itemTitleAtIndex_ = sel_registerName("itemTitleAtIndex:");
1203
public static final int /*long*/ sel_itemTitleAtIndex_ = sel_registerName("itemTitleAtIndex:");
1202
public static final int /*long*/ sel_jobDisposition = sel_registerName("jobDisposition");
1204
public static final int /*long*/ sel_jobDisposition = sel_registerName("jobDisposition");
1205
public static final int /*long*/ sel_setPaperName = sel_registerName("setPaperName:");
1206
public static final int /*long*/ sel_setPaperSize = sel_registerName("setPaperSize:");
1207
public static final int /*long*/ sel_paperName = sel_registerName("PaperName");
1208
public static final int /*long*/ sel_pmPageFormat = sel_registerName("PMPageFormat");
1209
public static final int /*long*/ sel_bottomMargin = sel_registerName("bottomMargin");
1210
public static final int /*long*/ sel_topMargin = sel_registerName("topMargin");
1211
public static final int /*long*/ sel_leftMargin = sel_registerName("leftMargin");
1212
public static final int /*long*/ sel_rightMargin = sel_registerName("rightMargin");
1213
public static final int /*long*/ sel_updateFromPMPageFormat = sel_registerName("updateFromPMPageFormat");
1203
public static final int /*long*/ sel_keyCode = sel_registerName("keyCode");
1214
public static final int /*long*/ sel_keyCode = sel_registerName("keyCode");
1204
public static final int /*long*/ sel_keyDown_ = sel_registerName("keyDown:");
1215
public static final int /*long*/ sel_keyDown_ = sel_registerName("keyDown:");
1205
public static final int /*long*/ sel_keyEquivalent = sel_registerName("keyEquivalent");
1216
public static final int /*long*/ sel_keyEquivalent = sel_registerName("keyEquivalent");
Lines 1853-1858 Link Here
1853
public static final int /*long*/ sel_unmarkText = sel_registerName("unmarkText");
1864
public static final int /*long*/ sel_unmarkText = sel_registerName("unmarkText");
1854
public static final int /*long*/ sel_unregisterDraggedTypes = sel_registerName("unregisterDraggedTypes");
1865
public static final int /*long*/ sel_unregisterDraggedTypes = sel_registerName("unregisterDraggedTypes");
1855
public static final int /*long*/ sel_update = sel_registerName("update");
1866
public static final int /*long*/ sel_update = sel_registerName("update");
1867
public static final int /*long*/ sel_updateFromPMPrintSettings = sel_registerName("updateFromPMPrintSettings");
1856
public static final int /*long*/ sel_updateTrackingAreas = sel_registerName("updateTrackingAreas");
1868
public static final int /*long*/ sel_updateTrackingAreas = sel_registerName("updateTrackingAreas");
1857
public static final int /*long*/ sel_use = sel_registerName("use");
1869
public static final int /*long*/ sel_use = sel_registerName("use");
1858
public static final int /*long*/ sel_useCredential_forAuthenticationChallenge_ = sel_registerName("useCredential:forAuthenticationChallenge:");
1870
public static final int /*long*/ sel_useCredential_forAuthenticationChallenge_ = sel_registerName("useCredential:forAuthenticationChallenge:");
Lines 1936-1941 Link Here
1936
public static final int /*long*/ sel_yearOfCommonEra = sel_registerName("yearOfCommonEra");
1948
public static final int /*long*/ sel_yearOfCommonEra = sel_registerName("yearOfCommonEra");
1937
public static final int /*long*/ sel_zoom_ = sel_registerName("zoom:");
1949
public static final int /*long*/ sel_zoom_ = sel_registerName("zoom:");
1938
1950
1951
/**
1952
 * @param printSettings cast=(PMPrintSettings)
1953
 * @param duplexSetting cast=(PMDuplexMode)
1954
 * */
1955
public static final native void PMSetDuplex(int /*long*/ printSettings, int duplexSetting);
1956
/**
1957
 * @param printSettings cast=(PMPrintSettings)
1958
 * @param duplexSetting cast=(PMDuplexMode*)
1959
 * */
1960
public static final native void PMGetDuplex(int /*long*/ printSettings, int[] duplexSetting);
1961
/**
1962
 * @param printSettings cast=(PMPrintSettings)
1963
 * @param key cast=(CFStringRef)
1964
 * @param value cast=(CFTypeRef)
1965
 * @param locked cast=(Boolean)
1966
 * */
1967
public static final native int PMPrintSettingsSetValue(int /*long*/ printSettings, int /*long*/ key, int value, boolean locked);
1968
/**
1969
 * @param printSettings cast=(PMPrintSettings)
1970
 * @param key cast=(CFStringRef)
1971
 * @param value cast=(CFTypeRef*)
1972
 * */
1973
public static final native int PMPrintSettingsGetValue(int /*long*/ printSettings, int /*long*/ key, int[] value);
1974
/**
1975
 * @param printSettings cast=(PMPrintSettings)
1976
 * @param settingsKeys cast=(CFArrayRef*)
1977
 */
1978
public static final native int PMPrintSettingsCopyKeys(int /*long*/ printSettings, int[] settingsKeys);
1979
1980
/** @param printSession cast=(PMPrintSession*) */
1981
public static final native int PMCreateSession(int[] printSession);
1982
/**
1983
 * @param printSession cast=(PMPrintSession)
1984
 * @param currentPrinter cast=(PMPrinter*)
1985
 */
1986
public static final native int PMSessionGetCurrentPrinter(int /*long*/ printSession, int[] currentPrinter);
1987
/**
1988
 * @param printer cast=(PMPrinter)
1989
 * @param paperList cast=(CFArrayRef*)
1990
 */
1991
public static final native int /*long*/ PMPrinterGetPaperList (int /*long*/ printer, int[] paperList);
1992
/** @param object cast =(PMObject) */
1993
public static final native int PMRelease (int /*long*/ object);
1994
/**
1995
 * @param pageFormat cast=(PMPageFormat)
1996
 * @param printerID cast=(CFStringRef*)
1997
 */
1998
public static final native int /*long*/ PMPageFormatGetPrinterID (int /*long*/ pageFormat, int[] printerID);
1999
/**
2000
 * @param pageFormat cast=(PMPageFormat*)
2001
 * @param paper cast=(PMPaper)
2002
 */
2003
public static final native int /*long*/ PMCreatePageFormatWithPMPaper (int[] pageFormat, int /*long*/ paper);
2004
/**
2005
 * @param format cast=(PMPageFormat)
2006
 * @param paper cast=(PMPaper*)
2007
 */
2008
public static final native int /*long*/ PMGetPageFormatPaper (int/*long*/ format, int[] /*long*/ paper);
2009
/** 
2010
 * @param paper cast=(PMPaper) 
2011
 * @param paperWidth cast=(double*)
2012
 */
2013
public static final native int /*long*/ PMPaperGetWidth (int /*long*/ paper, double[] paperWidth);
2014
/** 
2015
 * @param paper cast=(PMPaper) 
2016
 * @param paperHeight cast=(double*)
2017
 */
2018
public static final native int /*long*/ PMPaperGetHeight (int /*long*/ paper, double[] paperHeight);
2019
/**
2020
 * @param formatSrc cast=(PMPageFormat)
2021
 * @param formatDest cast=(PMPageFormat)
2022
 */
2023
public static final native int /*long*/ PMCopyPageFormat (int /*long*/ formatSrc, int /*long*/ formatDest);
2024
/**
2025
 * @param paper cast=(PMPaper)
2026
 * @param paperName cast=(CFStringRef*)
2027
 */
2028
public static final native int /*long*/ PMPaperGetName (int /*long*/ paper, int[] paperName);
2029
/**
2030
 * @param printer cast=(PMPrinter)
2031
 * @param id cast=(CFStringRef)
2032
 * @param name cast=(CFStringRef)
2033
 * @param width cast=(double)
2034
 * @param height cast=(double)
2035
 * @param margins cast=(const PMPaperMargins*)
2036
 * @param paperP cast=(PMPaper*)
2037
 */
2038
public static final native int /*long*/ PMPaperCreateCustom (int /*long*/ printer, int /*long*/ id, int /*long*/ name, double width, double height, double[] margins, int[] paperP);
2039
/**
2040
 * @param paper cast=(PMPaper)
2041
 * @param printer cast=(PMPrinter)
2042
 * @param paperName cast=(CFStringRef*)
2043
 */
2044
public static final native int /*long*/ PMPaperCreateLocalizedName (int /*long*/ paper, int /*long*/ printer, int[] /*long*/ paperName);
2045
/** @param paper cast=(PMPaper) */
2046
public static final native boolean PMPaperIsCustom (int /*long*/ paper);
2047
/** @param printer cast=(PMPrinter)*/
2048
public static final native int /*long*/ PMPrinterGetName (int /*long*/ printer);
2049
/** 
2050
 * @param paper cast=(PMPaper)
2051
 * @param paperID cast=(CFStringRef*)
2052
 */
2053
public static final native int /*long*/ PMPaperGetID (int /*long*/ paper, int[] paperID);
2054
/**
2055
 * @param printer cast=(PMPrinter)
2056
 * @param settings cast=(PMPrintSettings)
2057
 * @param mimeTypes cast=(CFArrayRef*)
2058
 */
2059
public static final native int /*long*/ PMPrinterGetMimeTypes(int /*long*/ printer, int /*long*/ settings, int[] mimeTypes);
2060
/**
2061
 * @param printer cast=(PMPrinter)
2062
 * @param printSettings cast=(PMPrintSettings)
2063
 * @param resolutionP cast=(PMResolution*)
2064
 */
2065
public static final native int /*long*/ PMPrinterGetOutputResolution(int /*long*/ printer, int /*long*/ printSettings, double[] resolutionP);
2066
/**
2067
 * @param printer cast=(PMPrinter)
2068
 * @param printSettings cast=(PMPrintSettings)
2069
 * @param resolutionP cast=(PMResolution*)
2070
 */
2071
public static final native int /*long*/ PMPrinterSetOutputResolution(int /*long*/ printer, int /*long*/ printSettings, double[] resolutionP);
2072
/** @param printerID cast=(CFStringRef) */
2073
public static final native int /*long*/ PMPrinterCreateFromPrinterID(int /*long*/ printerID);
2074
/** @param printSettings cast=(PMPrintSettings*) */
2075
public static final native int /*long*/ PMCreatePrintSettings (int[] printSettings);
2076
/**
2077
 * @param allocator cast=(CFAllocatorRef)
2078
 * @param theType cast=(CFNumberType)
2079
 * @param valuePtr cast=(const void *)
2080
 */
2081
public static final native int /*long*/ CFNumberCreate (int /*long*/ allocator,int theType, int[] valuePtr);
2082
/**
2083
 * @param number cast=(CFNumberRef)
2084
 * @param theType cast=(CFNumberType)
2085
 * @param valuePtr cast=(void *)
2086
 */
2087
public static final native boolean CFNumberGetValue(int /*long*/ number, int theType, int[] valuePtr);
2088
/** @param theArray cast=(CFArrayRef) */
2089
public static final native int /*long*/ CFArrayGetCount (int theArray);
2090
/**
2091
 * @param theArray cast=(CFArrayRef)
2092
 * @param idx cast=(CFIndex)
2093
 */
2094
public static final native int /*long*/ CFArrayGetValueAtIndex (int /*long*/ theArray, int idx);
2095
1939
/** Constants */
2096
/** Constants */
1940
public static final int NSAlertFirstButtonReturn = 1000;
2097
public static final int NSAlertFirstButtonReturn = 1000;
1941
public static final int NSAlertSecondButtonReturn = 1001;
2098
public static final int NSAlertSecondButtonReturn = 1001;
Lines 2049-2054 Link Here
2049
public static final int NSPageUpFunctionKey = 63276;
2206
public static final int NSPageUpFunctionKey = 63276;
2050
public static final int NSPortraitOrientation = 0;
2207
public static final int NSPortraitOrientation = 0;
2051
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
2208
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
2209
public static final int NSPrintPanelShowsPrintSelection = 1 << 5;
2052
public static final int NSProgressIndicatorPreferredThickness = 14;
2210
public static final int NSProgressIndicatorPreferredThickness = 14;
2053
public static final int NSPushOnPushOffButton = 1;
2211
public static final int NSPushOnPushOffButton = 1;
2054
public static final int NSRadioButton = 4;
2212
public static final int NSRadioButton = 4;
Lines 2554-2562 Link Here
2554
public static final native int /*long*/ NSPrintSavePath();
2712
public static final native int /*long*/ NSPrintSavePath();
2555
public static final NSString NSPrintSavePath = new NSString(NSPrintSavePath());
2713
public static final NSString NSPrintSavePath = new NSString(NSPrintSavePath());
2556
/** @method flags=const */
2714
/** @method flags=const */
2715
public static final native int /*long*/ NSPrintPrinterName();
2716
public static final NSString NSPrintPrinterName = new NSString(NSPrintPrinterName());
2717
/** @method flags=const */
2557
public static final native int /*long*/ NSPrintScalingFactor();
2718
public static final native int /*long*/ NSPrintScalingFactor();
2558
public static final NSString NSPrintScalingFactor = new NSString(NSPrintScalingFactor());
2719
public static final NSString NSPrintScalingFactor = new NSString(NSPrintScalingFactor());
2559
/** @method flags=const */
2720
/** @method flags=const */
2721
public static final native int /*long*/ NSPrintPagesAcross();
2722
public static final NSString NSPrintPagesAcross = new NSString(NSPrintPagesAcross());
2723
/** @method flags=const */
2724
public static final native int /*long*/ NSPrintPagesDown();
2725
public static final NSString NSPrintPagesDown = new NSString(NSPrintPagesDown());
2726
/** @method flags=const */
2560
public static final native int /*long*/ NSPrintSpoolJob();
2727
public static final native int /*long*/ NSPrintSpoolJob();
2561
public static final NSString NSPrintSpoolJob = new NSString(NSPrintSpoolJob());
2728
public static final NSString NSPrintSpoolJob = new NSString(NSPrintSpoolJob());
2562
/** @method flags=const */
2729
/** @method flags=const */
(-)Eclipse SWT PI/gtk/library/os.c (+484 lines)
Lines 11181-11186 Link Here
11181
}
11181
}
11182
#endif
11182
#endif
11183
11183
11184
#ifndef NO__1gtk_1paper_1size_1get_1paper_1sizes
11185
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1paper_1sizes)
11186
	(JNIEnv *env, jclass that, jboolean arg0)
11187
{
11188
	jintLong rc = 0;
11189
	OS_NATIVE_ENTER(env, that, _1gtk_1paper_1size_1get_1paper_1sizes_FUNC);
11190
/*
11191
	rc = (jintLong)gtk_paper_size_get_paper_sizes(arg0);
11192
*/
11193
	{
11194
		LOAD_FUNCTION(fp, gtk_paper_size_get_paper_sizes)
11195
		if (fp) {
11196
			rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jboolean))fp)(arg0);
11197
		}
11198
	}
11199
	OS_NATIVE_EXIT(env, that, _1gtk_1paper_1size_1get_1paper_1sizes_FUNC);
11200
	return rc;
11201
}
11202
#endif
11203
11184
#ifndef NO__1gtk_1paper_1size_1get_1ppd_1name
11204
#ifndef NO__1gtk_1paper_1size_1get_1ppd_1name
11185
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1ppd_1name)
11205
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1paper_1size_1get_1ppd_1name)
11186
	(JNIEnv *env, jclass that, jintLong arg0)
11206
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 11578-11583 Link Here
11578
}
11598
}
11579
#endif
11599
#endif
11580
11600
11601
#ifndef NO__1gtk_1print_1settings_1get_1default_1source
11602
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1default_1source)
11603
	(JNIEnv *env, jclass that, jintLong arg0)
11604
{
11605
	jint rc = 0;
11606
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1default_1source_FUNC);
11607
/*
11608
	rc = (jint)gtk_print_settings_get_default_source(arg0);
11609
*/
11610
	{
11611
		LOAD_FUNCTION(fp, gtk_print_settings_get_default_source)
11612
		if (fp) {
11613
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11614
		}
11615
	}
11616
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1default_1source_FUNC);
11617
	return rc;
11618
}
11619
#endif
11620
11621
#ifndef NO__1gtk_1print_1settings_1get_1duplex
11622
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1duplex)
11623
	(JNIEnv *env, jclass that, jintLong arg0)
11624
{
11625
	jint rc = 0;
11626
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1duplex_FUNC);
11627
/*
11628
	rc = (jint)gtk_print_settings_get_duplex(arg0);
11629
*/
11630
	{
11631
		LOAD_FUNCTION(fp, gtk_print_settings_get_duplex)
11632
		if (fp) {
11633
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11634
		}
11635
	}
11636
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1duplex_FUNC);
11637
	return rc;
11638
}
11639
#endif
11640
11641
#ifndef NO__1gtk_1print_1settings_1get_1media_1type
11642
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1media_1type)
11643
	(JNIEnv *env, jclass that, jintLong arg0)
11644
{
11645
	jint rc = 0;
11646
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1media_1type_FUNC);
11647
/*
11648
	rc = (jint)gtk_print_settings_get_media_type(arg0);
11649
*/
11650
	{
11651
		LOAD_FUNCTION(fp, gtk_print_settings_get_media_type)
11652
		if (fp) {
11653
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11654
		}
11655
	}
11656
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1media_1type_FUNC);
11657
	return rc;
11658
}
11659
#endif
11660
11581
#ifndef NO__1gtk_1print_1settings_1get_1n_1copies
11661
#ifndef NO__1gtk_1print_1settings_1get_1n_1copies
11582
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1n_1copies)
11662
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1n_1copies)
11583
	(JNIEnv *env, jclass that, jintLong arg0)
11663
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 11618-11623 Link Here
11618
}
11698
}
11619
#endif
11699
#endif
11620
11700
11701
#ifndef NO__1gtk_1print_1settings_1get_1output_1bin
11702
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1output_1bin)
11703
	(JNIEnv *env, jclass that, jintLong arg0)
11704
{
11705
	jint rc = 0;
11706
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1output_1bin_FUNC);
11707
/*
11708
	rc = (jint)gtk_print_settings_get_output_bin(arg0);
11709
*/
11710
	{
11711
		LOAD_FUNCTION(fp, gtk_print_settings_get_output_bin)
11712
		if (fp) {
11713
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11714
		}
11715
	}
11716
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1output_1bin_FUNC);
11717
	return rc;
11718
}
11719
#endif
11720
11621
#ifndef NO__1gtk_1print_1settings_1get_1page_1ranges
11721
#ifndef NO__1gtk_1print_1settings_1get_1page_1ranges
11622
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1page_1ranges)
11722
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1page_1ranges)
11623
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
11723
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1)
Lines 11722-11727 Link Here
11722
}
11822
}
11723
#endif
11823
#endif
11724
11824
11825
#ifndef NO__1gtk_1print_1settings_1get_1quality
11826
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1quality)
11827
	(JNIEnv *env, jclass that, jintLong arg0)
11828
{
11829
	jint rc = 0;
11830
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1quality_FUNC);
11831
/*
11832
	rc = (jint)gtk_print_settings_get_quality(arg0);
11833
*/
11834
	{
11835
		LOAD_FUNCTION(fp, gtk_print_settings_get_quality)
11836
		if (fp) {
11837
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11838
		}
11839
	}
11840
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1quality_FUNC);
11841
	return rc;
11842
}
11843
#endif
11844
11725
#ifndef NO__1gtk_1print_1settings_1get_1resolution
11845
#ifndef NO__1gtk_1print_1settings_1get_1resolution
11726
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution)
11846
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution)
11727
	(JNIEnv *env, jclass that, jintLong arg0)
11847
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 11742-11747 Link Here
11742
}
11862
}
11743
#endif
11863
#endif
11744
11864
11865
#ifndef NO__1gtk_1print_1settings_1get_1resolution_1x
11866
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution_1x)
11867
	(JNIEnv *env, jclass that, jintLong arg0)
11868
{
11869
	jint rc = 0;
11870
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1resolution_1x_FUNC);
11871
/*
11872
	rc = (jint)gtk_print_settings_get_resolution_x(arg0);
11873
*/
11874
	{
11875
		LOAD_FUNCTION(fp, gtk_print_settings_get_resolution_x)
11876
		if (fp) {
11877
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11878
		}
11879
	}
11880
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1resolution_1x_FUNC);
11881
	return rc;
11882
}
11883
#endif
11884
11885
#ifndef NO__1gtk_1print_1settings_1get_1resolution_1y
11886
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1resolution_1y)
11887
	(JNIEnv *env, jclass that, jintLong arg0)
11888
{
11889
	jint rc = 0;
11890
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1resolution_1y_FUNC);
11891
/*
11892
	rc = (jint)gtk_print_settings_get_resolution_y(arg0);
11893
*/
11894
	{
11895
		LOAD_FUNCTION(fp, gtk_print_settings_get_resolution_y)
11896
		if (fp) {
11897
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11898
		}
11899
	}
11900
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1resolution_1y_FUNC);
11901
	return rc;
11902
}
11903
#endif
11904
11905
#ifndef NO__1gtk_1print_1settings_1get_1reverse
11906
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1reverse)
11907
	(JNIEnv *env, jclass that, jintLong arg0)
11908
{
11909
	jint rc = 0;
11910
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC);
11911
/*
11912
	rc = (jint)gtk_print_settings_get_reverse(arg0);
11913
*/
11914
	{
11915
		LOAD_FUNCTION(fp, gtk_print_settings_get_reverse)
11916
		if (fp) {
11917
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11918
		}
11919
	}
11920
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC);
11921
	return rc;
11922
}
11923
#endif
11924
11925
#ifndef NO__1gtk_1print_1settings_1get_1scale
11926
JNIEXPORT jdouble JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1scale)
11927
	(JNIEnv *env, jclass that, jintLong arg0)
11928
{
11929
	jdouble rc = 0;
11930
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1scale_FUNC);
11931
/*
11932
	rc = (jdouble)gtk_print_settings_get_scale(arg0);
11933
*/
11934
	{
11935
		LOAD_FUNCTION(fp, gtk_print_settings_get_scale)
11936
		if (fp) {
11937
			rc = (jdouble)((jdouble (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11938
		}
11939
	}
11940
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1scale_FUNC);
11941
	return rc;
11942
}
11943
#endif
11944
11945
#ifndef NO__1gtk_1print_1settings_1get_1use_1color
11946
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1use_1color)
11947
	(JNIEnv *env, jclass that, jintLong arg0)
11948
{
11949
	jint rc = 0;
11950
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC);
11951
/*
11952
	rc = (jint)gtk_print_settings_get_use_color(arg0);
11953
*/
11954
	{
11955
		LOAD_FUNCTION(fp, gtk_print_settings_get_use_color)
11956
		if (fp) {
11957
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11958
		}
11959
	}
11960
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC);
11961
	return rc;
11962
}
11963
#endif
11964
11745
#ifndef NO__1gtk_1print_1settings_1new
11965
#ifndef NO__1gtk_1print_1settings_1new
11746
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1new)
11966
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1new)
11747
	(JNIEnv *env, jclass that)
11967
	(JNIEnv *env, jclass that)
Lines 11805-11810 Link Here
11805
}
12025
}
11806
#endif
12026
#endif
11807
12027
12028
#ifndef NO__1gtk_1print_1settings_1set_1default_1source
12029
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1default_1source)
12030
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12031
{
12032
	jbyte *lparg1=NULL;
12033
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC);
12034
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12035
/*
12036
	gtk_print_settings_set_default_source(arg0, lparg1);
12037
*/
12038
	{
12039
		LOAD_FUNCTION(fp, gtk_print_settings_set_default_source)
12040
		if (fp) {
12041
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12042
		}
12043
	}
12044
fail:
12045
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12046
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC);
12047
}
12048
#endif
12049
12050
#ifndef NO__1gtk_1print_1settings_1set_1duplex
12051
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1duplex)
12052
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12053
{
12054
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC);
12055
/*
12056
	gtk_print_settings_set_duplex(arg0, arg1);
12057
*/
12058
	{
12059
		LOAD_FUNCTION(fp, gtk_print_settings_set_duplex)
12060
		if (fp) {
12061
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12062
		}
12063
	}
12064
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC);
12065
}
12066
#endif
12067
12068
#ifndef NO__1gtk_1print_1settings_1set_1media_1type
12069
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1media_1type)
12070
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12071
{
12072
	jbyte *lparg1=NULL;
12073
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1media_1type_FUNC);
12074
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12075
/*
12076
	gtk_print_settings_set_media_type(arg0, lparg1);
12077
*/
12078
	{
12079
		LOAD_FUNCTION(fp, gtk_print_settings_set_media_type)
12080
		if (fp) {
12081
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12082
		}
12083
	}
12084
fail:
12085
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12086
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1media_1type_FUNC);
12087
}
12088
#endif
12089
11808
#ifndef NO__1gtk_1print_1settings_1set_1n_1copies
12090
#ifndef NO__1gtk_1print_1settings_1set_1n_1copies
11809
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1n_1copies)
12091
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1n_1copies)
11810
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12092
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11823-11828 Link Here
11823
}
12105
}
11824
#endif
12106
#endif
11825
12107
12108
#ifndef NO__1gtk_1print_1settings_1set_1number_1up
12109
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1number_1up)
12110
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12111
{
12112
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC);
12113
/*
12114
	gtk_print_settings_set_number_up(arg0, arg1);
12115
*/
12116
	{
12117
		LOAD_FUNCTION(fp, gtk_print_settings_set_number_up)
12118
		if (fp) {
12119
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12120
		}
12121
	}
12122
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC);
12123
}
12124
#endif
12125
11826
#ifndef NO__1gtk_1print_1settings_1set_1orientation
12126
#ifndef NO__1gtk_1print_1settings_1set_1orientation
11827
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1orientation)
12127
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1orientation)
11828
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12128
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11841-11846 Link Here
11841
}
12141
}
11842
#endif
12142
#endif
11843
12143
12144
#ifndef NO__1gtk_1print_1settings_1set_1output_1bin
12145
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1output_1bin)
12146
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12147
{
12148
	jbyte *lparg1=NULL;
12149
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC);
12150
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12151
/*
12152
	gtk_print_settings_set_output_bin(arg0, lparg1);
12153
*/
12154
	{
12155
		LOAD_FUNCTION(fp, gtk_print_settings_set_output_bin)
12156
		if (fp) {
12157
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12158
		}
12159
	}
12160
fail:
12161
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12162
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC);
12163
}
12164
#endif
12165
11844
#ifndef NO__1gtk_1print_1settings_1set_1page_1ranges
12166
#ifndef NO__1gtk_1print_1settings_1set_1page_1ranges
11845
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1page_1ranges)
12167
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1page_1ranges)
11846
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jint arg2)
12168
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jint arg2)
Lines 11863-11868 Link Here
11863
}
12185
}
11864
#endif
12186
#endif
11865
12187
12188
#ifndef NO__1gtk_1print_1settings_1set_1paper_1size
12189
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1paper_1size)
12190
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12191
{
12192
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC);
12193
/*
12194
	gtk_print_settings_set_paper_size(arg0, arg1);
12195
*/
12196
	{
12197
		LOAD_FUNCTION(fp, gtk_print_settings_set_paper_size)
12198
		if (fp) {
12199
			((void (CALLING_CONVENTION*)(jintLong, jintLong))fp)(arg0, arg1);
12200
		}
12201
	}
12202
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC);
12203
}
12204
#endif
12205
11866
#ifndef NO__1gtk_1print_1settings_1set_1print_1pages
12206
#ifndef NO__1gtk_1print_1settings_1set_1print_1pages
11867
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1print_1pages)
12207
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1print_1pages)
11868
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12208
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11903-11908 Link Here
11903
}
12243
}
11904
#endif
12244
#endif
11905
12245
12246
#ifndef NO__1gtk_1print_1settings_1set_1quality
12247
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1quality)
12248
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12249
{
12250
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1quality_FUNC);
12251
/*
12252
	gtk_print_settings_set_quality(arg0, arg1);
12253
*/
12254
	{
12255
		LOAD_FUNCTION(fp, gtk_print_settings_set_quality)
12256
		if (fp) {
12257
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12258
		}
12259
	}
12260
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1quality_FUNC);
12261
}
12262
#endif
12263
12264
#ifndef NO__1gtk_1print_1settings_1set_1resolution_1xy
12265
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1resolution_1xy)
12266
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2)
12267
{
12268
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1resolution_1xy_FUNC);
12269
/*
12270
	gtk_print_settings_set_resolution_xy(arg0, arg1, arg2);
12271
*/
12272
	{
12273
		LOAD_FUNCTION(fp, gtk_print_settings_set_resolution_xy)
12274
		if (fp) {
12275
			((void (CALLING_CONVENTION*)(jintLong, jint, jint))fp)(arg0, arg1, arg2);
12276
		}
12277
	}
12278
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1resolution_1xy_FUNC);
12279
}
12280
#endif
12281
12282
#ifndef NO__1gtk_1print_1settings_1set_1reverse
12283
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1reverse)
12284
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12285
{
12286
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC);
12287
/*
12288
	gtk_print_settings_set_reverse(arg0, arg1);
12289
*/
12290
	{
12291
		LOAD_FUNCTION(fp, gtk_print_settings_set_reverse)
12292
		if (fp) {
12293
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12294
		}
12295
	}
12296
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC);
12297
}
12298
#endif
12299
12300
#ifndef NO__1gtk_1print_1settings_1set_1scale
12301
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1scale)
12302
	(JNIEnv *env, jclass that, jintLong arg0, jdouble arg1)
12303
{
12304
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1scale_FUNC);
12305
/*
12306
	gtk_print_settings_set_scale(arg0, arg1);
12307
*/
12308
	{
12309
		LOAD_FUNCTION(fp, gtk_print_settings_set_scale)
12310
		if (fp) {
12311
			((void (CALLING_CONVENTION*)(jintLong, jdouble))fp)(arg0, arg1);
12312
		}
12313
	}
12314
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1scale_FUNC);
12315
}
12316
#endif
12317
12318
#ifndef NO__1gtk_1print_1settings_1set_1use_1color
12319
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1use_1color)
12320
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12321
{
12322
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC);
12323
/*
12324
	gtk_print_settings_set_use_color(arg0, arg1);
12325
*/
12326
	{
12327
		LOAD_FUNCTION(fp, gtk_print_settings_set_use_color)
12328
		if (fp) {
12329
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12330
		}
12331
	}
12332
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC);
12333
}
12334
#endif
12335
11906
#ifndef NO__1gtk_1print_1unix_1dialog_1get_1current_1page
12336
#ifndef NO__1gtk_1print_1unix_1dialog_1get_1current_1page
11907
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1get_1current_1page)
12337
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1get_1current_1page)
11908
	(JNIEnv *env, jclass that, jintLong arg0)
12338
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 12025-12030 Link Here
12025
}
12455
}
12026
#endif
12456
#endif
12027
12457
12458
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup
12459
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup)
12460
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12461
{
12462
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC);
12463
/*
12464
	gtk_print_unix_dialog_set_embed_page_setup(arg0, arg1);
12465
*/
12466
	{
12467
		LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_embed_page_setup)
12468
		if (fp) {
12469
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12470
		}
12471
	}
12472
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC);
12473
}
12474
#endif
12475
12476
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1has_1selection
12477
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1has_1selection)
12478
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12479
{
12480
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC);
12481
/*
12482
	gtk_print_unix_dialog_set_has_selection(arg0, arg1);
12483
*/
12484
	{
12485
		LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_has_selection)
12486
		if (fp) {
12487
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12488
		}
12489
	}
12490
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC);
12491
}
12492
#endif
12493
12028
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1manual_1capabilities
12494
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1manual_1capabilities
12029
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities)
12495
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities)
12030
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12496
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
Lines 12079-12084 Link Here
12079
}
12545
}
12080
#endif
12546
#endif
12081
12547
12548
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1support_1selection
12549
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1support_1selection)
12550
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12551
{
12552
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC);
12553
/*
12554
	gtk_print_unix_dialog_set_support_selection(arg0, arg1);
12555
*/
12556
	{
12557
		LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_support_selection)
12558
		if (fp) {
12559
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12560
		}
12561
	}
12562
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC);
12563
}
12564
#endif
12565
12082
#ifndef NO__1gtk_1printer_1get_1backend
12566
#ifndef NO__1gtk_1printer_1get_1backend
12083
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1printer_1get_1backend)
12567
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1printer_1get_1backend)
12084
	(JNIEnv *env, jclass that, jintLong arg0)
12568
	(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 = 1354;
21
int OS_nativeFunctionCount = 1379;
22
int OS_nativeFunctionCallCount[1354];
22
int OS_nativeFunctionCallCount[1379];
23
char * OS_nativeFunctionNames[] = {
23
char * OS_nativeFunctionNames[] = {
24
#ifndef JNI64
24
#ifndef JNI64
25
	"Call__IIII",
25
	"Call__IIII",
Lines 889-894 Link Here
889
	"_1gtk_1paper_1size_1get_1display_1name",
889
	"_1gtk_1paper_1size_1get_1display_1name",
890
	"_1gtk_1paper_1size_1get_1height",
890
	"_1gtk_1paper_1size_1get_1height",
891
	"_1gtk_1paper_1size_1get_1name",
891
	"_1gtk_1paper_1size_1get_1name",
892
	"_1gtk_1paper_1size_1get_1paper_1sizes",
892
	"_1gtk_1paper_1size_1get_1ppd_1name",
893
	"_1gtk_1paper_1size_1get_1ppd_1name",
893
	"_1gtk_1paper_1size_1get_1width",
894
	"_1gtk_1paper_1size_1get_1width",
894
	"_1gtk_1paper_1size_1is_1custom",
895
	"_1gtk_1paper_1size_1is_1custom",
Lines 908-938 Link Here
908
	"_1gtk_1print_1settings_1foreach",
909
	"_1gtk_1print_1settings_1foreach",
909
	"_1gtk_1print_1settings_1get",
910
	"_1gtk_1print_1settings_1get",
910
	"_1gtk_1print_1settings_1get_1collate",
911
	"_1gtk_1print_1settings_1get_1collate",
912
	"_1gtk_1print_1settings_1get_1default_1source",
913
	"_1gtk_1print_1settings_1get_1duplex",
914
	"_1gtk_1print_1settings_1get_1media_1type",
911
	"_1gtk_1print_1settings_1get_1n_1copies",
915
	"_1gtk_1print_1settings_1get_1n_1copies",
912
	"_1gtk_1print_1settings_1get_1orientation",
916
	"_1gtk_1print_1settings_1get_1orientation",
917
	"_1gtk_1print_1settings_1get_1output_1bin",
913
	"_1gtk_1print_1settings_1get_1page_1ranges",
918
	"_1gtk_1print_1settings_1get_1page_1ranges",
914
	"_1gtk_1print_1settings_1get_1paper_1height",
919
	"_1gtk_1print_1settings_1get_1paper_1height",
915
	"_1gtk_1print_1settings_1get_1paper_1width",
920
	"_1gtk_1print_1settings_1get_1paper_1width",
916
	"_1gtk_1print_1settings_1get_1print_1pages",
921
	"_1gtk_1print_1settings_1get_1print_1pages",
917
	"_1gtk_1print_1settings_1get_1printer",
922
	"_1gtk_1print_1settings_1get_1printer",
923
	"_1gtk_1print_1settings_1get_1quality",
918
	"_1gtk_1print_1settings_1get_1resolution",
924
	"_1gtk_1print_1settings_1get_1resolution",
925
	"_1gtk_1print_1settings_1get_1resolution_1x",
926
	"_1gtk_1print_1settings_1get_1resolution_1y",
927
	"_1gtk_1print_1settings_1get_1reverse",
928
	"_1gtk_1print_1settings_1get_1scale",
929
	"_1gtk_1print_1settings_1get_1use_1color",
919
	"_1gtk_1print_1settings_1new",
930
	"_1gtk_1print_1settings_1new",
920
	"_1gtk_1print_1settings_1set",
931
	"_1gtk_1print_1settings_1set",
921
	"_1gtk_1print_1settings_1set_1collate",
932
	"_1gtk_1print_1settings_1set_1collate",
933
	"_1gtk_1print_1settings_1set_1default_1source",
934
	"_1gtk_1print_1settings_1set_1duplex",
935
	"_1gtk_1print_1settings_1set_1media_1type",
922
	"_1gtk_1print_1settings_1set_1n_1copies",
936
	"_1gtk_1print_1settings_1set_1n_1copies",
937
	"_1gtk_1print_1settings_1set_1number_1up",
923
	"_1gtk_1print_1settings_1set_1orientation",
938
	"_1gtk_1print_1settings_1set_1orientation",
939
	"_1gtk_1print_1settings_1set_1output_1bin",
924
	"_1gtk_1print_1settings_1set_1page_1ranges",
940
	"_1gtk_1print_1settings_1set_1page_1ranges",
941
	"_1gtk_1print_1settings_1set_1paper_1size",
925
	"_1gtk_1print_1settings_1set_1print_1pages",
942
	"_1gtk_1print_1settings_1set_1print_1pages",
926
	"_1gtk_1print_1settings_1set_1printer",
943
	"_1gtk_1print_1settings_1set_1printer",
944
	"_1gtk_1print_1settings_1set_1quality",
945
	"_1gtk_1print_1settings_1set_1resolution_1xy",
946
	"_1gtk_1print_1settings_1set_1reverse",
947
	"_1gtk_1print_1settings_1set_1scale",
948
	"_1gtk_1print_1settings_1set_1use_1color",
927
	"_1gtk_1print_1unix_1dialog_1get_1current_1page",
949
	"_1gtk_1print_1unix_1dialog_1get_1current_1page",
928
	"_1gtk_1print_1unix_1dialog_1get_1page_1setup",
950
	"_1gtk_1print_1unix_1dialog_1get_1page_1setup",
929
	"_1gtk_1print_1unix_1dialog_1get_1selected_1printer",
951
	"_1gtk_1print_1unix_1dialog_1get_1selected_1printer",
930
	"_1gtk_1print_1unix_1dialog_1get_1settings",
952
	"_1gtk_1print_1unix_1dialog_1get_1settings",
931
	"_1gtk_1print_1unix_1dialog_1new",
953
	"_1gtk_1print_1unix_1dialog_1new",
932
	"_1gtk_1print_1unix_1dialog_1set_1current_1page",
954
	"_1gtk_1print_1unix_1dialog_1set_1current_1page",
955
	"_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup",
956
	"_1gtk_1print_1unix_1dialog_1set_1has_1selection",
933
	"_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities",
957
	"_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities",
934
	"_1gtk_1print_1unix_1dialog_1set_1page_1setup",
958
	"_1gtk_1print_1unix_1dialog_1set_1page_1setup",
935
	"_1gtk_1print_1unix_1dialog_1set_1settings",
959
	"_1gtk_1print_1unix_1dialog_1set_1settings",
960
	"_1gtk_1print_1unix_1dialog_1set_1support_1selection",
936
	"_1gtk_1printer_1get_1backend",
961
	"_1gtk_1printer_1get_1backend",
937
	"_1gtk_1printer_1get_1name",
962
	"_1gtk_1printer_1get_1name",
938
	"_1gtk_1printer_1is_1default",
963
	"_1gtk_1printer_1is_1default",
(-)Eclipse SWT PI/gtk/library/os_stats.h (+25 lines)
Lines 897-902 Link Here
897
	_1gtk_1paper_1size_1get_1display_1name_FUNC,
897
	_1gtk_1paper_1size_1get_1display_1name_FUNC,
898
	_1gtk_1paper_1size_1get_1height_FUNC,
898
	_1gtk_1paper_1size_1get_1height_FUNC,
899
	_1gtk_1paper_1size_1get_1name_FUNC,
899
	_1gtk_1paper_1size_1get_1name_FUNC,
900
	_1gtk_1paper_1size_1get_1paper_1sizes_FUNC,
900
	_1gtk_1paper_1size_1get_1ppd_1name_FUNC,
901
	_1gtk_1paper_1size_1get_1ppd_1name_FUNC,
901
	_1gtk_1paper_1size_1get_1width_FUNC,
902
	_1gtk_1paper_1size_1get_1width_FUNC,
902
	_1gtk_1paper_1size_1is_1custom_FUNC,
903
	_1gtk_1paper_1size_1is_1custom_FUNC,
Lines 916-946 Link Here
916
	_1gtk_1print_1settings_1foreach_FUNC,
917
	_1gtk_1print_1settings_1foreach_FUNC,
917
	_1gtk_1print_1settings_1get_FUNC,
918
	_1gtk_1print_1settings_1get_FUNC,
918
	_1gtk_1print_1settings_1get_1collate_FUNC,
919
	_1gtk_1print_1settings_1get_1collate_FUNC,
920
	_1gtk_1print_1settings_1get_1default_1source_FUNC,
921
	_1gtk_1print_1settings_1get_1duplex_FUNC,
922
	_1gtk_1print_1settings_1get_1media_1type_FUNC,
919
	_1gtk_1print_1settings_1get_1n_1copies_FUNC,
923
	_1gtk_1print_1settings_1get_1n_1copies_FUNC,
920
	_1gtk_1print_1settings_1get_1orientation_FUNC,
924
	_1gtk_1print_1settings_1get_1orientation_FUNC,
925
	_1gtk_1print_1settings_1get_1output_1bin_FUNC,
921
	_1gtk_1print_1settings_1get_1page_1ranges_FUNC,
926
	_1gtk_1print_1settings_1get_1page_1ranges_FUNC,
922
	_1gtk_1print_1settings_1get_1paper_1height_FUNC,
927
	_1gtk_1print_1settings_1get_1paper_1height_FUNC,
923
	_1gtk_1print_1settings_1get_1paper_1width_FUNC,
928
	_1gtk_1print_1settings_1get_1paper_1width_FUNC,
924
	_1gtk_1print_1settings_1get_1print_1pages_FUNC,
929
	_1gtk_1print_1settings_1get_1print_1pages_FUNC,
925
	_1gtk_1print_1settings_1get_1printer_FUNC,
930
	_1gtk_1print_1settings_1get_1printer_FUNC,
931
	_1gtk_1print_1settings_1get_1quality_FUNC,
926
	_1gtk_1print_1settings_1get_1resolution_FUNC,
932
	_1gtk_1print_1settings_1get_1resolution_FUNC,
933
	_1gtk_1print_1settings_1get_1resolution_1x_FUNC,
934
	_1gtk_1print_1settings_1get_1resolution_1y_FUNC,
935
	_1gtk_1print_1settings_1get_1reverse_FUNC,
936
	_1gtk_1print_1settings_1get_1scale_FUNC,
937
	_1gtk_1print_1settings_1get_1use_1color_FUNC,
927
	_1gtk_1print_1settings_1new_FUNC,
938
	_1gtk_1print_1settings_1new_FUNC,
928
	_1gtk_1print_1settings_1set_FUNC,
939
	_1gtk_1print_1settings_1set_FUNC,
929
	_1gtk_1print_1settings_1set_1collate_FUNC,
940
	_1gtk_1print_1settings_1set_1collate_FUNC,
941
	_1gtk_1print_1settings_1set_1default_1source_FUNC,
942
	_1gtk_1print_1settings_1set_1duplex_FUNC,
943
	_1gtk_1print_1settings_1set_1media_1type_FUNC,
930
	_1gtk_1print_1settings_1set_1n_1copies_FUNC,
944
	_1gtk_1print_1settings_1set_1n_1copies_FUNC,
945
	_1gtk_1print_1settings_1set_1number_1up_FUNC,
931
	_1gtk_1print_1settings_1set_1orientation_FUNC,
946
	_1gtk_1print_1settings_1set_1orientation_FUNC,
947
	_1gtk_1print_1settings_1set_1output_1bin_FUNC,
932
	_1gtk_1print_1settings_1set_1page_1ranges_FUNC,
948
	_1gtk_1print_1settings_1set_1page_1ranges_FUNC,
949
	_1gtk_1print_1settings_1set_1paper_1size_FUNC,
933
	_1gtk_1print_1settings_1set_1print_1pages_FUNC,
950
	_1gtk_1print_1settings_1set_1print_1pages_FUNC,
934
	_1gtk_1print_1settings_1set_1printer_FUNC,
951
	_1gtk_1print_1settings_1set_1printer_FUNC,
952
	_1gtk_1print_1settings_1set_1quality_FUNC,
953
	_1gtk_1print_1settings_1set_1resolution_1xy_FUNC,
954
	_1gtk_1print_1settings_1set_1reverse_FUNC,
955
	_1gtk_1print_1settings_1set_1scale_FUNC,
956
	_1gtk_1print_1settings_1set_1use_1color_FUNC,
935
	_1gtk_1print_1unix_1dialog_1get_1current_1page_FUNC,
957
	_1gtk_1print_1unix_1dialog_1get_1current_1page_FUNC,
936
	_1gtk_1print_1unix_1dialog_1get_1page_1setup_FUNC,
958
	_1gtk_1print_1unix_1dialog_1get_1page_1setup_FUNC,
937
	_1gtk_1print_1unix_1dialog_1get_1selected_1printer_FUNC,
959
	_1gtk_1print_1unix_1dialog_1get_1selected_1printer_FUNC,
938
	_1gtk_1print_1unix_1dialog_1get_1settings_FUNC,
960
	_1gtk_1print_1unix_1dialog_1get_1settings_FUNC,
939
	_1gtk_1print_1unix_1dialog_1new_FUNC,
961
	_1gtk_1print_1unix_1dialog_1new_FUNC,
940
	_1gtk_1print_1unix_1dialog_1set_1current_1page_FUNC,
962
	_1gtk_1print_1unix_1dialog_1set_1current_1page_FUNC,
963
	_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC,
964
	_1gtk_1print_1unix_1dialog_1set_1has_1selection_FUNC,
941
	_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities_FUNC,
965
	_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities_FUNC,
942
	_1gtk_1print_1unix_1dialog_1set_1page_1setup_FUNC,
966
	_1gtk_1print_1unix_1dialog_1set_1page_1setup_FUNC,
943
	_1gtk_1print_1unix_1dialog_1set_1settings_FUNC,
967
	_1gtk_1print_1unix_1dialog_1set_1settings_FUNC,
968
	_1gtk_1print_1unix_1dialog_1set_1support_1selection_FUNC,
944
	_1gtk_1printer_1get_1backend_FUNC,
969
	_1gtk_1printer_1get_1backend_FUNC,
945
	_1gtk_1printer_1get_1name_FUNC,
970
	_1gtk_1printer_1get_1name_FUNC,
946
	_1gtk_1printer_1is_1default_FUNC,
971
	_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 9050-9055 Link Here
9050
	}
9052
	}
9051
}
9053
}
9052
/** @method flags=dynamic */
9054
/** @method flags=dynamic */
9055
public static final native int /*long*/ _gtk_paper_size_get_paper_sizes(boolean include_custom);
9056
public static final int /*long*/ gtk_paper_size_get_paper_sizes(boolean include_custom) {
9057
	lock.lock();
9058
	try {
9059
		return _gtk_paper_size_get_paper_sizes(include_custom);
9060
	} finally {
9061
		lock.unlock();
9062
	}
9063
}
9064
/** @method flags=dynamic */
9053
public static final native int /*long*/ _gtk_print_settings_new();
9065
public static final native int /*long*/ _gtk_print_settings_new();
9054
public static final int /*long*/ gtk_print_settings_new() {
9066
public static final int /*long*/ gtk_print_settings_new() {
9055
	lock.lock();
9067
	lock.lock();
Lines 9163-9168 Link Here
9163
	}
9175
	}
9164
}
9176
}
9165
/** @method flags=dynamic */
9177
/** @method flags=dynamic */
9178
public static final native void _gtk_print_settings_set_number_up(int /*long*/ settings, int number_up);
9179
public static final void gtk_print_settings_set_number_up(int /*long*/ settings, int number_up) {
9180
	lock.lock();
9181
	try {
9182
		_gtk_print_settings_set_number_up(settings, number_up);
9183
	} finally {
9184
		lock.unlock();
9185
	}
9186
}
9187
/** @method flags=dynamic */
9188
public static final native void _gtk_print_settings_set_duplex(int /*long*/ settings, int duplex);
9189
public static final void gtk_print_settings_set_duplex(int /*long*/ settings, int duplex) {
9190
	lock.lock();
9191
	try {
9192
		_gtk_print_settings_set_duplex(settings, duplex);
9193
	} finally {
9194
		lock.unlock();
9195
	}
9196
}
9197
/** @method flags=dynamic */
9198
public static final native int _gtk_print_settings_get_duplex(int /*long*/ settings);
9199
public static final int gtk_print_settings_get_duplex(int /*long*/ settings) {
9200
	lock.lock();
9201
	try {
9202
		return _gtk_print_settings_get_duplex(settings);
9203
	} finally {
9204
		lock.unlock();
9205
	}
9206
}
9207
/** @method flags=dynamic */
9166
public static final native int _gtk_print_settings_get_n_copies(int /*long*/ settings);
9208
public static final native int _gtk_print_settings_get_n_copies(int /*long*/ settings);
9167
public static final int gtk_print_settings_get_n_copies(int /*long*/ settings) {
9209
public static final int gtk_print_settings_get_n_copies(int /*long*/ settings) {
9168
	lock.lock();
9210
	lock.lock();
Lines 9196-9201 Link Here
9196
	}
9238
	}
9197
}
9239
}
9198
/** @method flags=dynamic */
9240
/** @method flags=dynamic */
9241
public static final native double _gtk_print_settings_get_scale(int /*long*/ settings);
9242
public static final double gtk_print_settings_get_scale(int /*long*/ settings) {
9243
	lock.lock();
9244
	try {
9245
		return _gtk_print_settings_get_scale(settings);
9246
	} finally {
9247
		lock.unlock();
9248
	}
9249
}
9250
/** @method flags=dynamic 
9251
 * @param num_ranges cast=(gdouble)*/
9252
public static final native void _gtk_print_settings_set_scale(int /*long*/ settings, double scale);
9253
public static final void gtk_print_settings_set_scale(int /*long*/ settings, double scale) {
9254
	lock.lock();
9255
	try {
9256
		_gtk_print_settings_set_scale(settings, scale);
9257
	} finally {
9258
		lock.unlock();
9259
	}
9260
}
9261
/** @method flags=dynamic */
9199
public static final native void _gtk_print_settings_set_print_pages(int /*long*/ settings, int pages);
9262
public static final native void _gtk_print_settings_set_print_pages(int /*long*/ settings, int pages);
9200
public static final void gtk_print_settings_set_print_pages(int /*long*/ settings, int pages) {
9263
public static final void gtk_print_settings_set_print_pages(int /*long*/ settings, int pages) {
9201
	lock.lock();
9264
	lock.lock();
Lines 9218-9223 Link Here
9218
		lock.unlock();
9281
		lock.unlock();
9219
	}
9282
	}
9220
}
9283
}
9284
/** @method flags=dynamic */
9285
public static final native void _gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size);
9286
public static final void gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size) {
9287
	lock.lock();
9288
	try {
9289
		_gtk_print_settings_set_paper_size(settings, paper_size);
9290
	} finally {
9291
		lock.unlock();
9292
	}
9293
}
9221
/**
9294
/**
9222
 * @method flags=dynamic
9295
 * @method flags=dynamic
9223
 * @param num_ranges cast=(gint)
9296
 * @param num_ranges cast=(gint)
Lines 9261-9266 Link Here
9261
		lock.unlock();
9334
		lock.unlock();
9262
	}
9335
	}
9263
}
9336
}
9337
/** @method flags=dynamic */
9338
public static final native int _gtk_print_settings_get_reverse(int /*long*/ settings);
9339
public static final int gtk_print_settings_get_reverse(int /*long*/ settings) {
9340
	lock.lock();
9341
	try {
9342
		return _gtk_print_settings_get_reverse(settings);
9343
	} finally {
9344
		lock.unlock();
9345
	}
9346
}
9347
/** @method flags=dynamic */
9348
public static final native void _gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse);
9349
public static final void gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse) {
9350
	lock.lock();
9351
	try {
9352
		_gtk_print_settings_set_reverse(settings, reverse);
9353
	} finally {
9354
		lock.unlock();
9355
	}
9356
}
9357
/** @method flags=dynamic */
9358
public static final native void _gtk_print_settings_set_resolution_xy(int /*long*/ settings, int resolution_x, int resolution_y);
9359
public static final void gtk_print_settings_set_resolution_xy(int /*long*/ settings, int resolution_x, int resolution_y) {
9360
	lock.lock();
9361
	try {
9362
		_gtk_print_settings_set_resolution_xy(settings, resolution_x, resolution_y);
9363
	} finally {
9364
		lock.unlock();
9365
	}
9366
}
9367
/** @method flags=dynamic */
9368
public static final native int _gtk_print_settings_get_resolution_x(int /*long*/ settings);
9369
public static final int gtk_print_settings_get_resolution_x(int /*long*/ settings) {
9370
	lock.lock();
9371
	try {
9372
		return _gtk_print_settings_get_resolution_x(settings);
9373
	} finally {
9374
		lock.unlock();
9375
	}
9376
}
9377
/** @method flags=dynamic */
9378
public static final native int _gtk_print_settings_get_resolution_y(int /*long*/ settings);
9379
public static final int gtk_print_settings_get_resolution_y(int /*long*/ settings) {
9380
	lock.lock();
9381
	try {
9382
		return _gtk_print_settings_get_resolution_y(settings);
9383
	} finally {
9384
		lock.unlock();
9385
	}
9386
}
9387
/** @method flags=dynamic */
9388
public static final native int _gtk_print_settings_get_default_source(int /*long*/ settings);
9389
public static final int gtk_print_settings_get_default_source(int /*long*/ settings) {
9390
	lock.lock();
9391
	try {
9392
		return _gtk_print_settings_get_default_source(settings);
9393
	} finally {
9394
		lock.unlock();
9395
	}
9396
}
9397
/** @method flags=dynamic */
9398
public static final native void _gtk_print_settings_set_default_source(int /*long*/ settings, byte[] default_source);
9399
public static final void gtk_print_settings_set_default_source(int /*long*/ settings, byte[] default_source) {
9400
	lock.lock();
9401
	try {
9402
		_gtk_print_settings_set_default_source(settings, default_source);
9403
	} finally {
9404
		lock.unlock();
9405
	}
9406
}
9407
/** @method flags=dynamic */
9408
public static final native int _gtk_print_settings_get_media_type(int /*long*/ settings);
9409
public static final int gtk_print_settings_get_media_type(int /*long*/ settings) {
9410
	lock.lock();
9411
	try {
9412
		return _gtk_print_settings_get_media_type(settings);
9413
	} finally {
9414
		lock.unlock();
9415
	}
9416
}
9417
/** @method flags=dynamic */
9418
public static final native void _gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type);
9419
public static final void gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type) {
9420
	lock.lock();
9421
	try {
9422
		_gtk_print_settings_set_media_type(settings, media_type);
9423
	} finally {
9424
		lock.unlock();
9425
	}
9426
}
9427
/** @method flags=dynamic */
9428
public static final native int _gtk_print_settings_get_output_bin(int /*long*/ settings);
9429
public static final int gtk_print_settings_get_output_bin(int /*long*/ settings) {
9430
	lock.lock();
9431
	try {
9432
		return _gtk_print_settings_get_output_bin(settings);
9433
	} finally {
9434
		lock.unlock();
9435
	}
9436
}
9437
/** @method flags=dynamic */
9438
public static final native void _gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin);
9439
public static final void gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin) {
9440
	lock.lock();
9441
	try {
9442
		_gtk_print_settings_set_output_bin(settings, output_bin);
9443
	} finally {
9444
		lock.unlock();
9445
	}
9446
}
9447
/** @method flags=dynamic */
9448
public static final native int _gtk_print_settings_get_use_color(int /*long*/ settings);
9449
public static final int gtk_print_settings_get_use_color(int /*long*/ settings) {
9450
	lock.lock();
9451
	try {
9452
		return _gtk_print_settings_get_use_color(settings);
9453
	} finally {
9454
		lock.unlock();
9455
	}
9456
}
9457
/** @method flags=dynamic */
9458
public static final native void _gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color);
9459
public static final void gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color) {
9460
	lock.lock();
9461
	try {
9462
		_gtk_print_settings_set_use_color(settings, use_color);
9463
	} finally {
9464
		lock.unlock();
9465
	}
9466
}
9467
/** @method flags=dynamic */
9468
public static final native int _gtk_print_settings_get_quality(int /*long*/ settings);
9469
public static final int gtk_print_settings_get_quality(int /*long*/ settings) {
9470
	lock.lock();
9471
	try {
9472
		return _gtk_print_settings_get_quality(settings);
9473
	} finally {
9474
		lock.unlock();
9475
	}
9476
}
9477
/** @method flags=dynamic */
9478
public static final native void _gtk_print_settings_set_quality(int /*long*/ settings, int quality);
9479
public static final void gtk_print_settings_set_quality(int /*long*/ settings, int quality) {
9480
	lock.lock();
9481
	try {
9482
		_gtk_print_settings_set_quality(settings, quality);
9483
	} finally {
9484
		lock.unlock();
9485
	}
9486
}
9264
/**
9487
/**
9265
 * @method flags=dynamic
9488
 * @method flags=dynamic
9266
 * @param title cast=(const gchar *)
9489
 * @param title cast=(const gchar *)
Lines 9276-9281 Link Here
9276
	}
9499
	}
9277
}
9500
}
9278
/** @method flags=dynamic */
9501
/** @method flags=dynamic */
9502
public static final native void _gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed);
9503
public static final void gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed) {
9504
	lock.lock();
9505
	try {
9506
		_gtk_print_unix_dialog_set_embed_page_setup(dialog, embed);
9507
	} finally {
9508
		lock.unlock();
9509
	}
9510
}
9511
/** @method flags=dynamic */
9279
public static final native void _gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup);
9512
public static final native void _gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup);
9280
public static final void gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup) {
9513
public static final void gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup) {
9281
	lock.lock();
9514
	lock.lock();
Lines 9286-9291 Link Here
9286
	}
9519
	}
9287
}
9520
}
9288
/** @method flags=dynamic */
9521
/** @method flags=dynamic */
9522
public static final native void _gtk_print_unix_dialog_set_has_selection(int /*long*/ dialog, boolean has_selection);
9523
public static final void gtk_print_unix_dialog_set_has_selection(int /*long*/ dialog, boolean has_selection) {
9524
	lock.lock();
9525
	try {
9526
		_gtk_print_unix_dialog_set_has_selection(dialog, has_selection);
9527
	} finally {
9528
		lock.unlock();
9529
	}
9530
}
9531
/** @method flags=dynamic */
9532
public static final native void _gtk_print_unix_dialog_set_support_selection(int /*long*/ dialog, boolean support_selection);
9533
public static final void gtk_print_unix_dialog_set_support_selection(int /*long*/ dialog, boolean support_selection) {
9534
	lock.lock();
9535
	try {
9536
		_gtk_print_unix_dialog_set_support_selection(dialog, support_selection);
9537
	} finally {
9538
		lock.unlock();
9539
	}
9540
}
9541
/** @method flags=dynamic */
9289
public static final native int /*long*/ _gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog);
9542
public static final native int /*long*/ _gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog);
9290
public static final int /*long*/ gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog) {
9543
public static final int /*long*/ gtk_print_unix_dialog_get_page_setup(int /*long*/ dialog) {
9291
	lock.lock();
9544
	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, jintArray arg1, jintArray arg2)
11735
{
11736
	jbyte *lparg0=NULL;
11737
	jint *lparg1=NULL;
11738
	jint *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)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
11743
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
11744
	rc = (jboolean)OpenPrinterA((LPTSTR)lparg0, (LPHANDLE)lparg1, (LPPRINTER_DEFAULTS)lparg2);
11745
fail:
11746
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
11747
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(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, jintArray arg1, jintArray arg2)
11757
{
11758
	jchar *lparg0=NULL;
11759
	jint *lparg1=NULL;
11760
	jint *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)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail;
11765
	if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
11766
	rc = (jboolean)OpenPrinterW((LPWSTR)lparg0, (LPHANDLE)lparg1, (LPPRINTER_DEFAULTSW)lparg2);
11767
fail:
11768
	if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
11769
	if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(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 (-2 / +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 661-669 Link Here
661
	public static final int ETS_READONLY = 6;
683
	public static final int ETS_READONLY = 6;
662
	public static final int EVENT_OBJECT_FOCUS = 0x8005;
684
	public static final int EVENT_OBJECT_FOCUS = 0x8005;
663
	public static final int EVENT_OBJECT_LOCATIONCHANGE = 0x800B;
685
	public static final int EVENT_OBJECT_LOCATIONCHANGE = 0x800B;
664
//	public static final int EVENT_OBJECT_SELECTION = 0x8006;
665
	public static final int EVENT_OBJECT_SELECTIONWITHIN = 0x8009;
686
	public static final int EVENT_OBJECT_SELECTIONWITHIN = 0x8009;
666
//	public static final int EVENT_OBJECT_STATECHANGE = 0x800A;
667
	public static final int EVENT_OBJECT_VALUECHANGE = 0x800E;
687
	public static final int EVENT_OBJECT_VALUECHANGE = 0x800E;
668
	public static final short FADF_FIXEDSIZE = 0x10;
688
	public static final short FADF_FIXEDSIZE = 0x10;
669
	public static final short FADF_HAVEVARTYPE = 0x80;
689
	public static final short FADF_HAVEVARTYPE = 0x80;
Lines 1290-1295 Link Here
1290
	public static final int PBST_PAUSED = 0x0003;
1310
	public static final int PBST_PAUSED = 0x0003;
1291
	public static final int PD_ALLPAGES = 0x0;
1311
	public static final int PD_ALLPAGES = 0x0;
1292
	public static final int PD_COLLATE = 0x10;
1312
	public static final int PD_COLLATE = 0x10;
1313
	public static final int PD_NOSELECTION = 0x4;
1293
	public static final int PD_PAGENUMS = 0x2;
1314
	public static final int PD_PAGENUMS = 0x2;
1294
	public static final int PD_PRINTTOFILE = 0x20;
1315
	public static final int PD_PRINTTOFILE = 0x20;
1295
	public static final int PD_RETURNDC = 0x100;
1316
	public static final int PD_RETURNDC = 0x100;
Lines 2207-2212 Link Here
2207
public static final native int DRAWITEMSTRUCT_sizeof ();
2228
public static final native int DRAWITEMSTRUCT_sizeof ();
2208
public static final native int DROPFILES_sizeof ();
2229
public static final native int DROPFILES_sizeof ();
2209
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 ();
2210
public static final native int EMR_sizeof ();
2232
public static final native int EMR_sizeof ();
2211
public static final native int EMREXTCREATEFONTINDIRECTW_sizeof ();
2233
public static final native int EMREXTCREATEFONTINDIRECTW_sizeof ();
2212
public static final native int EXTLOGFONTW_sizeof ();
2234
public static final native int EXTLOGFONTW_sizeof ();
Lines 2288-2293 Link Here
2288
public static final native int PROPERTYKEY_sizeof ();
2310
public static final native int PROPERTYKEY_sizeof ();
2289
public static final native int REBARBANDINFO_sizeof ();
2311
public static final native int REBARBANDINFO_sizeof ();
2290
public static final native int RECT_sizeof ();
2312
public static final native int RECT_sizeof ();
2313
public static final native int RECTL_sizeof ();
2291
public static final native int SAFEARRAY_sizeof ();
2314
public static final native int SAFEARRAY_sizeof ();
2292
public static final native int SAFEARRAYBOUND_sizeof ();
2315
public static final native int SAFEARRAYBOUND_sizeof ();
2293
public static final native int SCRIPT_ANALYSIS_sizeof ();
2316
public static final native int SCRIPT_ANALYSIS_sizeof ();
Lines 2454-2464 Link Here
2454
	return DefWindowProcA (hWnd, Msg, wParam, lParam);
2477
	return DefWindowProcA (hWnd, Msg, wParam, lParam);
2455
}
2478
}
2456
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
2457
public static final int /*long*/ DispatchMessage (MSG lpmsg) {
2490
public static final int /*long*/ DispatchMessage (MSG lpmsg) {
2458
	if (IsUnicode) return DispatchMessageW (lpmsg);
2491
	if (IsUnicode) return DispatchMessageW (lpmsg);
2459
	return DispatchMessageA (lpmsg);
2492
	return DispatchMessageA (lpmsg);
2460
}
2493
}
2461
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
2462
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) {
2463
	if (IsUnicode) {
2505
	if (IsUnicode) {
2464
		char [] lpszFile1 = lpszFile == null ? null : lpszFile.chars;
2506
		char [] lpszFile1 = lpszFile == null ? null : lpszFile.chars;
Lines 2610-2615 Link Here
2610
	return GetDateFormatA (Locale, dwFlags, lpDate, lpString1, lpString2, cchDate);
2652
	return GetDateFormatA (Locale, dwFlags, lpDate, lpString1, lpString2, cchDate);
2611
}
2653
}
2612
2654
2655
public static final boolean GetDefaultPrinter (TCHAR pszBuffer, int[] /*long*/ 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
2613
public static final int GetKeyNameText (int lParam, TCHAR lpString, int nSize) {
2664
public static final int GetKeyNameText (int lParam, TCHAR lpString, int nSize) {
2614
	if (IsUnicode) {
2665
	if (IsUnicode) {
2615
		char [] lpString1 = lpString == null ? null : lpString.chars;
2666
		char [] lpString1 = lpString == null ? null : lpString.chars;
Lines 3019-3024 Link Here
3019
	}
3070
	}
3020
}
3071
}
3021
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
3022
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) {
3023
	if (IsUnicode) return PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
3083
	if (IsUnicode) return PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
3024
	return PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
3084
	return PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
Lines 3112-3117 Link Here
3112
	return RemovePropA (hWnd, lpString);
3172
	return RemovePropA (hWnd, lpString);
3113
}
3173
}
3114
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
3115
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) {
3116
	if (IsUnicode) {
3183
	if (IsUnicode) {
3117
		char [] lParam1 = lParam == null ? null : lParam.chars;
3184
		char [] lParam1 = lParam == null ? null : lParam.chars;
Lines 3286-3291 Link Here
3286
	return SendMessageA (hWnd, Msg, wParam, lParam);
3353
	return SendMessageA (hWnd, Msg, wParam, lParam);
3287
}
3354
}
3288
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
3289
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) {
3290
	if (IsUnicode) return SetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii);
3365
	if (IsUnicode) return SetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii);
3291
	return SetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii);
3366
	return SetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii);
Lines 3616-3621 Link Here
3616
 */
3691
 */
3617
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);  
3618
/**
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
/**
3619
 * @param lpszDriver cast=(LPSTR)
3704
 * @param lpszDriver cast=(LPSTR)
3620
 * @param lpszDevice cast=(LPSTR)
3705
 * @param lpszDevice cast=(LPSTR)
3621
 * @param lpszOutput cast=(LPSTR)
3706
 * @param lpszOutput cast=(LPSTR)
Lines 3777-3782 Link Here
3777
public static final native boolean DestroyMenu (int /*long*/ hMenu);
3862
public static final native boolean DestroyMenu (int /*long*/ hMenu);
3778
/** @param hWnd cast=(HWND) */
3863
/** @param hWnd cast=(HWND) */
3779
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);
3780
public static final native int /*long*/ DispatchMessageW (MSG lpmsg);
3881
public static final native int /*long*/ DispatchMessageW (MSG lpmsg);
3781
public static final native int /*long*/ DispatchMessageA (MSG lpmsg);
3882
public static final native int /*long*/ DispatchMessageA (MSG lpmsg);
3782
/** @param hdc cast=(HDC) */
3883
/** @param hdc cast=(HDC) */
Lines 5012-5017 Link Here
5012
 * @param Destination cast=(PVOID)
5113
 * @param Destination cast=(PVOID)
5013
 * @param Source cast=(CONST VOID *),flags=no_out critical
5114
 * @param Source cast=(CONST VOID *),flags=no_out critical
5014
 */
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
 */
5015
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);
5016
/**
5122
/**
5017
 * @param Destination cast=(PVOID)
5123
 * @param Destination cast=(PVOID)
Lines 5775-5780 Link Here
5775
 * @param pwOutGlyphs cast=(WORD*)
5881
 * @param pwOutGlyphs cast=(WORD*)
5776
 */
5882
 */
5777
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[] /*long*/ pcchBuffer);
5890
/**
5891
 * @param pszBuffer cast=(LPWSTR)
5892
 * @param pcchBuffer cast=(LPDWORD)
5893
 */
5894
public static final native boolean GetDefaultPrinterW (char[] pszBuffer, int[] /*long*/ 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
5778
/**
5928
/**
5779
 * @param hdc cast=(HDC)
5929
 * @param hdc cast=(HDC)
5780
 * @param psc cast=(SCRIPT_CACHE *)
5930
 * @param psc cast=(SCRIPT_CACHE *)
Lines 6292-6297 Link Here
6292
 * @param dwLayout cast=(DWORD)
6442
 * @param dwLayout cast=(DWORD)
6293
 */
6443
 */
6294
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);
6295
/** @param hdc cast=(HDC) */
6463
/** @param hdc cast=(HDC) */
6296
public static final native int SetMapMode (int /*long*/ hdc, int fnMapMode);
6464
public static final native int SetMapMode (int /*long*/ hdc, int fnMapMode);
6297
/**
6465
/**
Lines 6601-6606 Link Here
6601
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);
6602
/** @param hWnd cast=(HWND) */
6770
/** @param hWnd cast=(HWND) */
6603
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);
6604
/** @param hWnd cast=(HWND) */
6774
/** @param hWnd cast=(HWND) */
6605
public static final native boolean ValidateRect (int /*long*/ hWnd, RECT lpRect);
6775
public static final native boolean ValidateRect (int /*long*/ hWnd, RECT lpRect);
6606
/** @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 (-1 / +234 lines)
Lines 111-116 Link Here
111
	 * @since 3.5
111
	 * @since 3.5
112
	 */
112
	 */
113
	public int orientation = PORTRAIT;
113
	public int orientation = PORTRAIT;
114
	
115
	/**
116
	 * The scaling factor of the page and paper rectangle,
117
	 * expressed as a percentage by which the printed output 
118
	 * to be scaled. Default value is 100 indicating no scale.
119
	 * 
120
	 * @since 3.6
121
	 */
122
	public double scale = 100;//TODO: double ? int ?
123
124
	/**
125
	 * The number of logical pages to be tiled on a
126
	 * physical sheet of paper, whose value can be 
127
	 * expressed either of 1, 2, 4, 6, 9 or 16.
128
	 * 
129
	 * @since 3.6
130
	 */
131
	public int pagesPerSide = 1;
132
	
133
	/**
134
	 * specifies a print job that can print either single-sided or 
135
	 * double-sided printing, expressed as one of the following values: 
136
	 * <dl>
137
	 * <dt><code>DUPLEX_SIMPLEX</code></dt>
138
	 * <dd>Normal one-sided printing</dd>
139
	 * <dt><code>DUPLEX_HORIZONTAL</code></dt>
140
	 * <dd>Duplex printing with page being horizontal</dd>
141
	 * <dt><code>DUPLEX_VERTICAL</code></dt>
142
	 * <dd>Duplex printing with page being vertical</dd>
143
	 * </dl>
144
	 * 
145
	 * @since 3.6
146
	 */
147
	public int duplex = DUPLEX_SIMPLEX;
148
	
149
	/**
150
	 * Specifies the name for the paper size used in a 
151
	 * print job, expressed as one of the following values:
152
	 * <dl>
153
	 * <dt><code>PAPER_LETTER</code></dt>
154
	 * <dt><code>PAPER_LEGAL</code></dt>
155
	 * <dt><code>PAPER_A2</code></dt>
156
	 * <dt><code>PAPER_A4</code></dt>
157
	 * <dt><code>PAPER_A5</code></dt>
158
	 * <dt><code>PAPER_A6</code></dt>
159
	 * <dt><code>PAPER_B5</code></dt>
160
	 * <dt><code>PAPER_JB5</code></dt>
161
	 * <dt><code>PAPER_EXECUTIVE</code></dt>
162
	 * <dt><code>PAPER_CUSTOM</code></dt>
163
	 * </dl>
164
	 * 
165
	 * Also accepts any paper size from the list of available paper size
166
	 * names returned by method <code>Printer.getPaperSizeList</code>.
167
	 * 
168
	 * @since 3.6
169
	 */
170
	public String paperSizeName = PAPER_A4;
171
	
172
	/**
173
	 * The physical height of the custom paper name in inches. 
174
	 * Note that this field is ignored if <code>paperSize</code>
175
	 * is not specified as <code>PAPER_CUSTOM</code>.
176
	 * 
177
	 * @since 3.6
178
	 */
179
	public double customPaperHeight = 0;
180
181
	/**
182
	 * The physical width of the custom paper name in inches. 
183
	 * Note that this field is ignored if <code>paperSize</code>
184
	 * is not specified as <code>PAPER_CUSTOM</code>.
185
	 * 
186
	 * @since 3.6
187
	 */
188
	public double customPaperWidth = 0;
189
190
	/**
191
	 * The name of the custom paper size. 
192
	 * Note that this field is ignored if <code>paperSize</code>
193
	 * is not specified as <code>PAPER_CUSTOM</code>.
194
	 * 
195
	 * @since 3.6
196
	 */
197
	public String customPaperName;
198
199
	/**
200
	 * The human-readable name of the custom paper size to
201
	 * be displayed in print dialog. Note that this field 
202
	 * is ignored if <code>paperSize</code> is not 
203
	 * specified as <code>PAPER_CUSTOM</code>.
204
	 * 
205
	 * @since 3.6
206
	 */
207
	public String customPaperDisplayName;
208
	
209
	/**
210
	 * Specifies the x-resolution in dots-per-inch of the printer.
211
	 * This configures the print settings to the closest resolution
212
	 * setting that can be used for destination print job.
213
	 * 
214
	 * @since 3.6
215
	 */
216
	public double resolutionX;
217
218
	/**
219
	 * Specifies the y-resolution in dots-per-inch of the printer.
220
	 * This configures the print settings to the closest resolution
221
	 * setting that can be used for destination print job.
222
	 * 
223
	 * @since 3.6
224
	 */
225
	public double resolutionY;//TODO: double ? int ?
114
226
115
	/**
227
	/**
116
	 * <code>scope</code> field value indicating that
228
	 * <code>scope</code> field value indicating that
Lines 132-137 Link Here
132
	public static final int SELECTION = 2;
244
	public static final int SELECTION = 2;
133
		
245
		
134
	/**
246
	/**
247
	 * <code>scope</code> field value indicating that
248
	 * the print dialog does not allow the user to 
249
	 * print a selection. This must be built by 
250
	 * <em>bitwise OR</em>'ing together with the other
251
	 * fields.
252
	 * 
253
	 * @since 3.6
254
	 */
255
	public static final int NO_SELECTION = 4;
256
	
257
	/**
135
	 * <code>orientation</code> field value indicating
258
	 * <code>orientation</code> field value indicating
136
	 * portrait paper orientation
259
	 * portrait paper orientation
137
	 * 
260
	 * 
Lines 148-153 Link Here
148
	public static final int LANDSCAPE = 2;
271
	public static final int LANDSCAPE = 2;
149
	
272
	
150
	/**
273
	/**
274
	 * <code>duplex</code> field value indicating
275
	 * one-sided printing
276
	 * 
277
	 * @since 3.6
278
	 */
279
	public static final int DUPLEX_SIMPLEX = 1;
280
	
281
	/**
282
	 * <code>duplex</code> field value indicating
283
	 * double sided printing on short edge
284
	 * 
285
	 * @since 3.6
286
	 */
287
	public static final int DUPLEX_HORIZONTAL = 2;
288
	
289
	/**
290
	 * <code>duplex</code> field value indicating
291
	 * double sided printing on long edge
292
	 * 
293
	 * @since 3.6
294
	 */
295
	public static final int DUPLEX_VERTICAL = 3;
296
	
297
	/**
298
	 * <code>paperSize</code> field value indicating
299
	 * the paper size as LETTER
300
	 * 
301
	 * @since 3.6
302
	 */
303
	public static final String PAPER_LETTER = "LETTER";
304
305
	/**
306
	 * <code>paperSize</code> field value indicating
307
	 * the paper size as LEGAL
308
	 * 
309
	 * @since 3.6
310
	 */
311
	public static final String PAPER_LEGAL = "LEGAL";
312
	
313
	/**
314
	 * <code>paperSize</code> field value indicating
315
	 * the paper size as A4 sheet
316
	 * 
317
	 * @since 3.6
318
	 */
319
	public static final String PAPER_A2 = "A2";
320
321
	/**
322
	 * <code>paperSize</code> field value indicating
323
	 * the paper size as A4 sheet
324
	 * 
325
	 * @since 3.6
326
	 */
327
	public static final String PAPER_A4 = "A4";
328
	
329
	/**
330
	 * <code>paperSize</code> field value indicating
331
	 * the paper size as A4 sheet
332
	 * 
333
	 * @since 3.6
334
	 */
335
	public static final String PAPER_A5 = "A5";
336
337
	/**
338
	 * <code>paperSize</code> field value indicating
339
	 * the paper size as A4 sheet
340
	 * 
341
	 * @since 3.6
342
	 */
343
	public static final String PAPER_A6 = "A6";
344
345
	/**
346
	 * <code>paperSize</code> field value indicating
347
	 * the paper size as B5 sheet
348
	 * 
349
	 * @since 3.6
350
	 */
351
	public static final String PAPER_B5 = "B5";
352
	
353
	/**
354
	 * <code>paperSize</code> field value indicating
355
	 * the paper size as JB5 sheet
356
	 * 
357
	 * @since 3.6
358
	 */
359
	public static final String PAPER_JB5 = "JB5";
360
	
361
	/**
362
	 * <code>paperSize</code> field value indicating
363
	 * the paper size as EXECUTIVE
364
	 * 
365
	 * @since 3.6
366
	 */
367
	public static final String PAPER_EXECUTIVE = "EXECUTIVE";
368
	
369
	/**
370
	 * <code>paperSize</code> field value indicating the paper 
371
	 * size as Custom. When this field is specified, the values 
372
	 * for <code>customPaperHeight</code> and <code>customPaperWidth</code>
373
	 * are required to create a custom paper size and optionally, 
374
	 * <code>customPaperName</code> <code>customPaperDisplayName</code>.
375
	 * 
376
	 * Note that customPaperHeight and customPaperWidth are ignored
377
	 * when the field has not specified this value.
378
	 * 
379
	 * @since 3.6
380
	 */
381
	public static final String PAPER_CUSTOM = "CUSTOM";
382
383
	/**
151
	 * private, platform-specific data
384
	 * private, platform-specific data
152
	 * On Windows, this contains a copy of the DEVMODE struct
385
	 * On Windows, this contains a copy of the DEVMODE struct
153
	 * returned from the <code>PrintDialog</code>.
386
	 * returned from the <code>PrintDialog</code>.
Lines 158-164 Link Here
158
	 * This field is not currently used on the X/Window System.
391
	 * This field is not currently used on the X/Window System.
159
	 */	
392
	 */	
160
	byte [] otherData;
393
	byte [] otherData;
161
394
	
162
	/**
395
	/**
163
	 * Constructs an instance of this class that can be
396
	 * Constructs an instance of this class that can be
164
	 * used to print to the default printer.
397
	 * used to print to the default printer.
(-)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 (-17 / +167 lines)
Lines 121-126 Link Here
121
	return checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
121
	return checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
122
}
122
}
123
123
124
short[] getPaperSizeList () {
125
	short[] resArray = null;
126
	int[] pOutput = new int[1];
127
	int paperNamesLen = Printer.getDeviceCapabilities(OS.DC_PAPERS, pOutput);
128
	if (paperNamesLen > 0) {
129
		resArray = new short[paperNamesLen];
130
		OS.MoveMemory(resArray, pOutput[0], paperNamesLen * 2);
131
		if (pOutput[0] != 0) OS.HeapFree(OS.GetProcessHeap(), 0, pOutput[0]);
132
	}
133
	return resArray;
134
}
135
136
short getSystemPaperSize (String paperSize) {
137
	if (paperSize == null) return -1;
138
	String[] paperList = Printer.getPaperNameList();
139
	int i;
140
	for (i=0; i<paperList.length; i++) {
141
		if (paperSize.equals(paperList[i])) break;
142
	}
143
	if (i == paperList.length) return -1;
144
	short[] paperSizeNumbers = getPaperSizeList();
145
	return paperSizeNumbers[i];
146
}
147
124
/**
148
/**
125
 * Sets the printer data that will be used when the dialog
149
 * Sets the printer data that will be used when the dialog
126
 * is opened.
150
 * is opened.
Lines 290-296 Link Here
290
	int style = getStyle();
314
	int style = getStyle();
291
	int /*long*/ hwndOwner = parent.handle;
315
	int /*long*/ hwndOwner = parent.handle;
292
	int /*long*/ hwndParent = parent.handle;
316
	int /*long*/ hwndParent = parent.handle;
293
294
	/*
317
	/*
295
	* Feature in Windows.  There is no API to set the orientation of a
318
	* Feature in Windows.  There is no API to set the orientation of a
296
	* file dialog.  It is always inherited from the parent.  The fix is
319
	* file dialog.  It is always inherited from the parent.  The fix is
Lines 318-324 Link Here
318
			if (enabled) OS.EnableWindow (hwndParent, false);
341
			if (enabled) OS.EnableWindow (hwndParent, false);
319
		}
342
		}
320
	}
343
	}
321
322
	PrinterData data = null;
344
	PrinterData data = null;
323
	PRINTDLG pd = new PRINTDLG();
345
	PRINTDLG pd = new PRINTDLG();
324
	pd.lStructSize = PRINTDLG.sizeof;
346
	pd.lStructSize = PRINTDLG.sizeof;
Lines 327-333 Link Here
327
	/* Initialize PRINTDLG fields, including DEVMODE. */
349
	/* Initialize PRINTDLG fields, including DEVMODE. */
328
	pd.Flags = OS.PD_RETURNDEFAULT;
350
	pd.Flags = OS.PD_RETURNDEFAULT;
329
	if (OS.PrintDlg(pd)) {
351
	if (OS.PrintDlg(pd)) {
330
	
331
		/*
352
		/*
332
		 * If user setup info from a previous print dialog was specified,
353
		 * If user setup info from a previous print dialog was specified,
333
		 * then restore the previous DEVMODE struct.
354
		 * then restore the previous DEVMODE struct.
Lines 341-372 Link Here
341
			if (pd.hDevMode != 0) OS.GlobalFree(pd.hDevMode);
362
			if (pd.hDevMode != 0) OS.GlobalFree(pd.hDevMode);
342
			pd.hDevMode = lpInitData;
363
			pd.hDevMode = lpInitData;
343
		}
364
		}
344
		
345
		/* Initialize the DEVMODE struct's fields from the printerData. */
365
		/* Initialize the DEVMODE struct's fields from the printerData. */
346
		int /*long*/ hMem = pd.hDevMode;
366
		int /*long*/ hMem = pd.hDevMode;
347
		int /*long*/ ptr = OS.GlobalLock(hMem);
367
		int /*long*/ ptr = OS.GlobalLock(hMem);
348
		DEVMODE devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
368
		DEVMODE devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
349
		OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
369
		OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
370
		/* Printer Name */
371
		if (printerData.name != null) {
372
			String name = printerData.name;
373
			if (OS.IsUnicode) {
374
				char[] buffer = new char[32];
375
				name.getChars(0, name.length(), buffer, 0);
376
				((DEVMODEW)devmode).dmDeviceName = buffer;
377
			} else {
378
				((DEVMODEA)devmode).dmDeviceName = name.getBytes();
379
			}
380
		}
381
		/* Orientation */
350
		devmode.dmFields |= OS.DM_ORIENTATION;
382
		devmode.dmFields |= OS.DM_ORIENTATION;
351
		devmode.dmOrientation = printerData.orientation == PrinterData.PORTRAIT ? OS.DMORIENT_PORTRAIT : OS.DMORIENT_LANDSCAPE;
383
		devmode.dmOrientation = printerData.orientation == PrinterData.PORTRAIT ? OS.DMORIENT_PORTRAIT : OS.DMORIENT_LANDSCAPE;
352
		if (printerData.copyCount != 1) {
384
		/* Copy Count */
353
			devmode.dmFields |= OS.DM_COPIES;
385
		devmode.dmFields |= OS.DM_COPIES;
354
			devmode.dmCopies = (short)printerData.copyCount;
386
		devmode.dmCopies = (short)printerData.copyCount;
355
		}
387
		/* Collate */
356
		if (printerData.collate != false) {
388
		devmode.dmFields |= OS.DM_COLLATE;
357
			devmode.dmFields |= OS.DM_COLLATE;
389
		devmode.dmCollate = OS.DMCOLLATE_TRUE;
358
			devmode.dmCollate = OS.DMCOLLATE_TRUE;
390
		/*Scale*/
391
		devmode.dmFields |= OS.DM_SCALE;
392
		devmode.dmScale = (short)printerData.scale;
393
		/* Duplex Mode */
394
		devmode.dmFields |= OS.DM_DUPLEX;
395
		devmode.dmDuplex = (short)(printerData.duplex + 1);
396
		/* Paper size*/
397
		TCHAR currentPrinter;
398
		if (printerData.name == null) {
399
			int[] nameLen = new int[1];
400
			OS.GetDefaultPrinter (null, nameLen);
401
			currentPrinter = new TCHAR (0,nameLen[0]);
402
			OS.GetDefaultPrinter (currentPrinter, nameLen);
403
		} else {
404
			currentPrinter = new TCHAR(0, printerData.name, true);
405
		}
406
		int[] /*long*/ printerHandle = new int /*long*/ [1];
407
		OS.OpenPrinter (currentPrinter, printerHandle, null);
408
		/* TODO: 
409
		 * Do we need to CreateDC and ResetDC for the changes of
410
		 * custom paperSize to get reflected in the public devmode 
411
		 * settings ?
412
		 */
413
/*		TCHAR driver1 = new TCHAR(0, "winspool", true); 
414
		TCHAR name = new TCHAR(0, ((DEVMODEW)devmode).dmDeviceName, true);
415
		int long hdc = OS.CreateDC(driver1, name, 0, ptr);*/
416
		if (printerData.paperSizeName.intern() == PrinterData.PAPER_CUSTOM) {
417
			devmode.dmFields |= OS.DM_PAPERSIZE | OS.DM_PAPERWIDTH | OS.DM_PAPERLENGTH; 
418
			devmode.dmPaperSize = OS.DMPAPER_USER;
419
			/* Coversion from Inches -to- tenths of mm */
420
			devmode.dmPaperLength = (short)(printerData.customPaperHeight * 25.40 * 10);
421
			devmode.dmPaperWidth = (short)(printerData.customPaperWidth * 25.40 * 10);
422
423
			/*TODO: We might need to add a new custom paper size to the existing
424
			 * set of forms. However, this doesn't work for unknown reasons for now.
425
			 */
426
			FORM_INFO_1 printForm = new FORM_INFO_1();
427
			printForm.Flags = 0;
428
			printForm.Size.cx = (int) printerData.customPaperHeight * 25400;
429
			printForm.Size.cy = (int) printerData.customPaperHeight * 25400;
430
			printForm.ImageableArea.left = 0;
431
			printForm.ImageableArea.top = 0;
432
			printForm.ImageableArea.bottom = printForm.Size.cx;
433
			printForm.ImageableArea.right = printForm.Size.cy;
434
			
435
			TCHAR buffer = new TCHAR (0, printerData.customPaperName, true);
436
			int byteCount = buffer.length () * TCHAR.sizeof;
437
			printForm.pName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
438
			OS.MoveMemory (printForm.pName, buffer, byteCount);
439
			
440
			int /*long*/ formPtr =  OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, FORM_INFO_1.sizeof);
441
			OS.MoveMemory(formPtr, printForm, FORM_INFO_1.sizeof);
442
			boolean addRes = OS.AddForm (printerHandle[0], 1, formPtr);
443
			System.out.println("AddForm result:"+addRes);
444
			addRes = OS.SetForm (printerHandle[0], buffer, 1, formPtr);
445
			System.out.println("SetForm result:"+addRes);
446
		} else {
447
			devmode.dmFields |= OS.DM_PAPERSIZE;
448
			String keys[] = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4,
449
					PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE};
450
			short[] values = {OS.DMPAPER_LEGAL, OS.DMPAPER_LETTER, OS.DMPAPER_A2, OS.DMPAPER_A4,
451
					OS.DMPAPER_A5, OS.DMPAPER_A6, OS.DMPAPER_B5, OS.DMPAPER_JB5, OS.DMPAPER_EXECUTIVE};
452
			int index;
453
			for (index=0; index < keys.length; index++) {
454
				if (printerData.paperSizeName.equals(keys[index])) break;
455
			}
456
			if (index < keys.length) {
457
				devmode.dmPaperSize = values [index];
458
			} else {
459
				try {
460
					devmode.dmPaperSize = Short.parseShort(printerData.paperSizeName);
461
				} catch(NumberFormatException nfe) {
462
					short paperNumber = getSystemPaperSize (printerData.paperSizeName);
463
					if (paperNumber != -1) devmode.dmPaperSize = paperNumber;
464
					else devmode.dmPaperSize = OS.DMPAPER_A4;
465
				}
466
			}
467
		}
468
		/* Pages Per Side */
469
		if (devmode.dmNup == 1) {
470
			devmode.dmFields |= OS.DM_NUP;
471
			/*TODO: Currently there is no way of directly
472
			 * assigning the Nup value. 
473
			 * OS.updateNup(devmode.dmDriverExtra, 4);
474
			 */
359
		}
475
		}
476
		/* Resolution */
477
		if (printerData.resolutionX != 0) {
478
			devmode.dmFields |= OS.DM_PRINTQUALITY;
479
			devmode.dmYResolution = (short) printerData.resolutionY;
480
		}
481
		if (printerData.resolutionY != 0) {
482
			devmode.dmFields |= OS.DM_YRESOLUTION;
483
			devmode.dmPrintQuality = (short) printerData.resolutionX;
484
		}
485
		/* Sync with devmode settings for getting apt values of PaperSize */
360
		OS.MoveMemory(ptr, devmode, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
486
		OS.MoveMemory(ptr, devmode, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
487
		OS.DocumentProperties(0, printerHandle[0], currentPrinter, 0, ptr, OS.DM_IN_BUFFER);
488
		/*OS.ResetDC (hdc, ptr);*/
361
		OS.GlobalUnlock(hMem);
489
		OS.GlobalUnlock(hMem);
362
	
490
		
363
		pd.Flags = OS.PD_USEDEVMODECOPIESANDCOLLATE;
491
		pd.Flags = OS.PD_USEDEVMODECOPIESANDCOLLATE;
364
		if (printerData.printToFile) pd.Flags |= OS.PD_PRINTTOFILE;
365
		switch (printerData.scope) {
492
		switch (printerData.scope) {
366
			case PrinterData.PAGE_RANGE: pd.Flags |= OS.PD_PAGENUMS; break;
493
			case PrinterData.PAGE_RANGE: pd.Flags |= OS.PD_PAGENUMS; break;
367
			case PrinterData.SELECTION: pd.Flags |= OS.PD_SELECTION; break;
494
			case PrinterData.SELECTION: pd.Flags |= OS.PD_SELECTION; break;
368
			default: pd.Flags |= OS.PD_ALLPAGES;
495
			default: pd.Flags |= OS.PD_ALLPAGES;
369
		}
496
		}
497
		if ((printerData.scope & PrinterData.NO_SELECTION) != 0) pd.Flags |= OS.PD_NOSELECTION;
498
		String outputFileName = null;
499
		if (printerData.printToFile) {
500
			pd.Flags |= OS.PD_PRINTTOFILE;
501
			if (printerData.fileName != null) outputFileName = printerData.fileName;
502
		}
370
		pd.nMinPage = 1;
503
		pd.nMinPage = 1;
371
		pd.nMaxPage = -1;
504
		pd.nMaxPage = -1;
372
		pd.nFromPage = (short) Math.min (0xFFFF, Math.max (1, printerData.startPage));
505
		pd.nFromPage = (short) Math.min (0xFFFF, Math.max (1, printerData.startPage));
Lines 395-401 Link Here
395
				}
528
				}
396
			}
529
			}
397
		}
530
		}
398
		
399
		if (success) {
531
		if (success) {
400
			/* Get driver and device from the DEVNAMES struct */
532
			/* Get driver and device from the DEVNAMES struct */
401
			hMem = pd.hDevNames;
533
			hMem = pd.hDevNames;
Lines 405-411 Link Here
405
			short[] offsets = new short[4];
537
			short[] offsets = new short[4];
406
			OS.MoveMemory(offsets, ptr, 2 * offsets.length);
538
			OS.MoveMemory(offsets, ptr, 2 * offsets.length);
407
			TCHAR buffer = new TCHAR(0, size);
539
			TCHAR buffer = new TCHAR(0, size);
408
			OS.MoveMemory(buffer, ptr, size);	
540
			OS.MoveMemory(buffer, ptr, size);
409
			OS.GlobalUnlock(hMem);
541
			OS.GlobalUnlock(hMem);
410
			if (pd.hDevNames != 0) OS.GlobalFree(pd.hDevNames);
542
			if (pd.hDevNames != 0) OS.GlobalFree(pd.hDevNames);
411
	
543
	
Lines 416-422 Link Here
416
				i++;
548
				i++;
417
			}
549
			}
418
			String driver = buffer.toString(driverOffset, i);
550
			String driver = buffer.toString(driverOffset, i);
419
	
551
			
420
			int deviceOffset = offsets[1];
552
			int deviceOffset = offsets[1];
421
			i = 0;
553
			i = 0;
422
			while (deviceOffset + i < size) {
554
			while (deviceOffset + i < size) {
Lines 443-449 Link Here
443
				data.scope = PrinterData.SELECTION;
575
				data.scope = PrinterData.SELECTION;
444
			}
576
			}
445
			data.printToFile = (pd.Flags & OS.PD_PRINTTOFILE) != 0;
577
			data.printToFile = (pd.Flags & OS.PD_PRINTTOFILE) != 0;
446
			if (data.printToFile) data.fileName = output;
578
			if (data.printToFile) {
579
				String fullPath;
580
				if (outputFileName != null && !outputFileName.equals("")) {
581
					fullPath = outputFileName;
582
				} else {
583
					fullPath = output;
584
				}
585
				data.fileName = fullPath;
586
			}
447
			data.copyCount = pd.nCopies;
587
			data.copyCount = pd.nCopies;
448
			data.collate = (pd.Flags & OS.PD_COLLATE) != 0;
588
			data.collate = (pd.Flags & OS.PD_COLLATE) != 0;
449
	
589
	
Lines 455-460 Link Here
455
			OS.MoveMemory(data.otherData, ptr, size);
595
			OS.MoveMemory(data.otherData, ptr, size);
456
			devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
596
			devmode = OS.IsUnicode ? (DEVMODE)new DEVMODEW () : new DEVMODEA ();
457
			OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
597
			OS.MoveMemory(devmode, ptr, OS.IsUnicode ? OS.DEVMODEW_sizeof() : OS.DEVMODEA_sizeof());
598
			data.paperSizeName = String.valueOf(devmode.dmPaperSize);
599
			if (devmode.dmPaperSize >= 256) {
600
				data.paperSizeName = PrinterData.PAPER_CUSTOM;
601
				data.customPaperHeight = devmode.dmPaperLength;
602
				data.customPaperWidth = devmode.dmPaperWidth;
603
			}
604
			data.duplex = devmode.dmDuplex - 1;
605
			data.scale = devmode.dmScale;
606
			data.resolutionX = devmode.dmPrintQuality;
607
			data.resolutionY = devmode.dmYResolution;
458
			if ((devmode.dmFields & OS.DM_ORIENTATION) != 0) {
608
			if ((devmode.dmFields & OS.DM_ORIENTATION) != 0) {
459
				int dmOrientation = devmode.dmOrientation;
609
				int dmOrientation = devmode.dmOrientation;
460
				data.orientation = dmOrientation == OS.DMORIENT_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
610
				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[] pOutput = new int[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[] 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 of 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