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

Collapse All | Expand All

(-)Eclipse SWT PI/gtk/library/os.c (+408 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_1reverse
11866
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1reverse)
11867
	(JNIEnv *env, jclass that, jintLong arg0)
11868
{
11869
	jint rc = 0;
11870
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC);
11871
/*
11872
	rc = (jint)gtk_print_settings_get_reverse(arg0);
11873
*/
11874
	{
11875
		LOAD_FUNCTION(fp, gtk_print_settings_get_reverse)
11876
		if (fp) {
11877
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11878
		}
11879
	}
11880
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1reverse_FUNC);
11881
	return rc;
11882
}
11883
#endif
11884
11885
#ifndef NO__1gtk_1print_1settings_1get_1scale
11886
JNIEXPORT jdouble JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1scale)
11887
	(JNIEnv *env, jclass that, jintLong arg0)
11888
{
11889
	jdouble rc = 0;
11890
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1scale_FUNC);
11891
/*
11892
	rc = (jdouble)gtk_print_settings_get_scale(arg0);
11893
*/
11894
	{
11895
		LOAD_FUNCTION(fp, gtk_print_settings_get_scale)
11896
		if (fp) {
11897
			rc = (jdouble)((jdouble (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11898
		}
11899
	}
11900
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1scale_FUNC);
11901
	return rc;
11902
}
11903
#endif
11904
11905
#ifndef NO__1gtk_1print_1settings_1get_1use_1color
11906
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1settings_1get_1use_1color)
11907
	(JNIEnv *env, jclass that, jintLong arg0)
11908
{
11909
	jint rc = 0;
11910
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC);
11911
/*
11912
	rc = (jint)gtk_print_settings_get_use_color(arg0);
11913
*/
11914
	{
11915
		LOAD_FUNCTION(fp, gtk_print_settings_get_use_color)
11916
		if (fp) {
11917
			rc = (jint)((jint (CALLING_CONVENTION*)(jintLong))fp)(arg0);
11918
		}
11919
	}
11920
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1get_1use_1color_FUNC);
11921
	return rc;
11922
}
11923
#endif
11924
11745
#ifndef NO__1gtk_1print_1settings_1new
11925
#ifndef NO__1gtk_1print_1settings_1new
11746
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1new)
11926
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1print_1settings_1new)
11747
	(JNIEnv *env, jclass that)
11927
	(JNIEnv *env, jclass that)
Lines 11805-11810 Link Here
11805
}
11985
}
11806
#endif
11986
#endif
11807
11987
11988
#ifndef NO__1gtk_1print_1settings_1set_1default_1source
11989
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1default_1source)
11990
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
11991
{
11992
	jbyte *lparg1=NULL;
11993
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC);
11994
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
11995
/*
11996
	gtk_print_settings_set_default_source(arg0, lparg1);
11997
*/
11998
	{
11999
		LOAD_FUNCTION(fp, gtk_print_settings_set_default_source)
12000
		if (fp) {
12001
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12002
		}
12003
	}
12004
fail:
12005
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12006
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1default_1source_FUNC);
12007
}
12008
#endif
12009
12010
#ifndef NO__1gtk_1print_1settings_1set_1duplex
12011
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1duplex)
12012
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12013
{
12014
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC);
12015
/*
12016
	gtk_print_settings_set_duplex(arg0, arg1);
12017
*/
12018
	{
12019
		LOAD_FUNCTION(fp, gtk_print_settings_set_duplex)
12020
		if (fp) {
12021
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12022
		}
12023
	}
12024
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1duplex_FUNC);
12025
}
12026
#endif
12027
12028
#ifndef NO__1gtk_1print_1settings_1set_1media_1type
12029
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1media_1type)
12030
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12031
{
12032
	jbyte *lparg1=NULL;
12033
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1media_1type_FUNC);
12034
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12035
/*
12036
	gtk_print_settings_set_media_type(arg0, lparg1);
12037
*/
12038
	{
12039
		LOAD_FUNCTION(fp, gtk_print_settings_set_media_type)
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_1media_1type_FUNC);
12047
}
12048
#endif
12049
11808
#ifndef NO__1gtk_1print_1settings_1set_1n_1copies
12050
#ifndef NO__1gtk_1print_1settings_1set_1n_1copies
11809
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1n_1copies)
12051
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1n_1copies)
11810
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12052
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11823-11828 Link Here
11823
}
12065
}
11824
#endif
12066
#endif
11825
12067
12068
#ifndef NO__1gtk_1print_1settings_1set_1number_1up
12069
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1number_1up)
12070
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12071
{
12072
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC);
12073
/*
12074
	gtk_print_settings_set_number_up(arg0, arg1);
12075
*/
12076
	{
12077
		LOAD_FUNCTION(fp, gtk_print_settings_set_number_up)
12078
		if (fp) {
12079
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12080
		}
12081
	}
12082
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1number_1up_FUNC);
12083
}
12084
#endif
12085
12086
#ifndef NO__1gtk_1print_1settings_1set_1number_1up_1layout
12087
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1number_1up_1layout)
12088
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12089
{
12090
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1number_1up_1layout_FUNC);
12091
/*
12092
	gtk_print_settings_set_number_up_layout(arg0, arg1);
12093
*/
12094
	{
12095
		LOAD_FUNCTION(fp, gtk_print_settings_set_number_up_layout)
12096
		if (fp) {
12097
			((void (CALLING_CONVENTION*)(jintLong, jintLong))fp)(arg0, arg1);
12098
		}
12099
	}
12100
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1number_1up_1layout_FUNC);
12101
}
12102
#endif
12103
11826
#ifndef NO__1gtk_1print_1settings_1set_1orientation
12104
#ifndef NO__1gtk_1print_1settings_1set_1orientation
11827
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1orientation)
12105
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1orientation)
11828
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12106
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11841-11846 Link Here
11841
}
12119
}
11842
#endif
12120
#endif
11843
12121
12122
#ifndef NO__1gtk_1print_1settings_1set_1output_1bin
12123
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1output_1bin)
12124
	(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
12125
{
12126
	jbyte *lparg1=NULL;
12127
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC);
12128
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
12129
/*
12130
	gtk_print_settings_set_output_bin(arg0, lparg1);
12131
*/
12132
	{
12133
		LOAD_FUNCTION(fp, gtk_print_settings_set_output_bin)
12134
		if (fp) {
12135
			((void (CALLING_CONVENTION*)(jintLong, jbyte *))fp)(arg0, lparg1);
12136
		}
12137
	}
12138
fail:
12139
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
12140
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1output_1bin_FUNC);
12141
}
12142
#endif
12143
11844
#ifndef NO__1gtk_1print_1settings_1set_1page_1ranges
12144
#ifndef NO__1gtk_1print_1settings_1set_1page_1ranges
11845
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1page_1ranges)
12145
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1page_1ranges)
11846
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jint arg2)
12146
	(JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jint arg2)
Lines 11863-11868 Link Here
11863
}
12163
}
11864
#endif
12164
#endif
11865
12165
12166
#ifndef NO__1gtk_1print_1settings_1set_1paper_1size
12167
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1paper_1size)
12168
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12169
{
12170
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC);
12171
/*
12172
	gtk_print_settings_set_paper_size(arg0, arg1);
12173
*/
12174
	{
12175
		LOAD_FUNCTION(fp, gtk_print_settings_set_paper_size)
12176
		if (fp) {
12177
			((void (CALLING_CONVENTION*)(jintLong, jintLong))fp)(arg0, arg1);
12178
		}
12179
	}
12180
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1paper_1size_FUNC);
12181
}
12182
#endif
12183
11866
#ifndef NO__1gtk_1print_1settings_1set_1print_1pages
12184
#ifndef NO__1gtk_1print_1settings_1set_1print_1pages
11867
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1print_1pages)
12185
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1print_1pages)
11868
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12186
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
Lines 11903-11908 Link Here
11903
}
12221
}
11904
#endif
12222
#endif
11905
12223
12224
#ifndef NO__1gtk_1print_1settings_1set_1quality
12225
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1quality)
12226
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
12227
{
12228
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1quality_FUNC);
12229
/*
12230
	gtk_print_settings_set_quality(arg0, arg1);
12231
*/
12232
	{
12233
		LOAD_FUNCTION(fp, gtk_print_settings_set_quality)
12234
		if (fp) {
12235
			((void (CALLING_CONVENTION*)(jintLong, jint))fp)(arg0, arg1);
12236
		}
12237
	}
12238
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1quality_FUNC);
12239
}
12240
#endif
12241
12242
#ifndef NO__1gtk_1print_1settings_1set_1reverse
12243
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1reverse)
12244
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12245
{
12246
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC);
12247
/*
12248
	gtk_print_settings_set_reverse(arg0, arg1);
12249
*/
12250
	{
12251
		LOAD_FUNCTION(fp, gtk_print_settings_set_reverse)
12252
		if (fp) {
12253
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12254
		}
12255
	}
12256
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1reverse_FUNC);
12257
}
12258
#endif
12259
12260
#ifndef NO__1gtk_1print_1settings_1set_1scale
12261
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1scale)
12262
	(JNIEnv *env, jclass that, jintLong arg0, jdouble arg1)
12263
{
12264
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1scale_FUNC);
12265
/*
12266
	gtk_print_settings_set_scale(arg0, arg1);
12267
*/
12268
	{
12269
		LOAD_FUNCTION(fp, gtk_print_settings_set_scale)
12270
		if (fp) {
12271
			((void (CALLING_CONVENTION*)(jintLong, jdouble))fp)(arg0, arg1);
12272
		}
12273
	}
12274
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1scale_FUNC);
12275
}
12276
#endif
12277
12278
#ifndef NO__1gtk_1print_1settings_1set_1use_1color
12279
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1settings_1set_1use_1color)
12280
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12281
{
12282
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC);
12283
/*
12284
	gtk_print_settings_set_use_color(arg0, arg1);
12285
*/
12286
	{
12287
		LOAD_FUNCTION(fp, gtk_print_settings_set_use_color)
12288
		if (fp) {
12289
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12290
		}
12291
	}
12292
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1settings_1set_1use_1color_FUNC);
12293
}
12294
#endif
12295
11906
#ifndef NO__1gtk_1print_1unix_1dialog_1get_1current_1page
12296
#ifndef NO__1gtk_1print_1unix_1dialog_1get_1current_1page
11907
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1get_1current_1page)
12297
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1get_1current_1page)
11908
	(JNIEnv *env, jclass that, jintLong arg0)
12298
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 12025-12030 Link Here
12025
}
12415
}
12026
#endif
12416
#endif
12027
12417
12418
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup
12419
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup)
12420
	(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
12421
{
12422
	OS_NATIVE_ENTER(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC);
12423
/*
12424
	gtk_print_unix_dialog_set_embed_page_setup(arg0, arg1);
12425
*/
12426
	{
12427
		LOAD_FUNCTION(fp, gtk_print_unix_dialog_set_embed_page_setup)
12428
		if (fp) {
12429
			((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
12430
		}
12431
	}
12432
	OS_NATIVE_EXIT(env, that, _1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC);
12433
}
12434
#endif
12435
12028
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1manual_1capabilities
12436
#ifndef NO__1gtk_1print_1unix_1dialog_1set_1manual_1capabilities
12029
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities)
12437
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities)
12030
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
12438
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
(-)Eclipse SWT PI/gtk/library/os_custom.h (+21 lines)
Lines 213-218 Link Here
213
#define gtk_print_unix_dialog_set_manual_capabilities_LIB "libgtk-x11-2.0.so.0"
213
#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"
214
#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"
215
#define gtk_print_unix_dialog_set_settings_LIB "libgtk-x11-2.0.so.0"
216
#define gtk_print_settings_set_number_up_layout_LIB "libgtk-x11-2.0.so.0"
217
#define gtk_print_settings_set_number_up_LIB "libgtk-x11-2.0.so.0"
218
#define gtk_print_settings_set_scale_LIB "libgtk-x11-2.0.so.0"
219
#define gtk_print_settings_get_scale_LIB "libgtk-x11-2.0.so.0"
220
#define gtk_print_unix_dialog_set_embed_page_setup_LIB "libgtk-x11-2.0.so.0"
221
#define gtk_print_settings_set_paper_size_LIB "libgtk-x11-2.0.so.0"
222
#define gtk_print_settings_set_duplex_LIB "libgtk-x11-2.0.so.0"
223
#define gtk_print_settings_get_duplex_LIB "libgtk-x11-2.0.so.0"
224
#define gtk_paper_size_get_paper_sizes_LIB "libgtk-x11-2.0.so.0"
225
#define gtk_print_settings_get_reverse_LIB "libgtk-x11-2.0.so.0"
226
#define gtk_print_settings_set_reverse_LIB "libgtk-x11-2.0.so.0"
227
#define gtk_print_settings_get_default_source_LIB "libgtk-x11-2.0.so.0"
228
#define gtk_print_settings_set_default_source_LIB "libgtk-x11-2.0.so.0"
229
#define gtk_print_settings_get_media_type_LIB "libgtk-x11-2.0.so.0"
230
#define gtk_print_settings_set_media_type_LIB "libgtk-x11-2.0.so.0"
231
#define gtk_print_settings_get_output_bin_LIB "libgtk-x11-2.0.so.0"
232
#define gtk_print_settings_set_output_bin_LIB "libgtk-x11-2.0.so.0"
233
#define gtk_print_settings_get_use_color_LIB "libgtk-x11-2.0.so.0"
234
#define gtk_print_settings_set_use_color_LIB "libgtk-x11-2.0.so.0"
235
#define gtk_print_settings_get_quality_LIB "libgtk-x11-2.0.so.0"
236
#define gtk_print_settings_set_quality_LIB "libgtk-x11-2.0.so.0"
216
#define gtk_printer_get_backend_LIB "libgtk-x11-2.0.so.0"
237
#define gtk_printer_get_backend_LIB "libgtk-x11-2.0.so.0"
217
#define gtk_printer_get_name_LIB "libgtk-x11-2.0.so.0"
238
#define gtk_printer_get_name_LIB "libgtk-x11-2.0.so.0"
218
#define gtk_printer_is_default_LIB "libgtk-x11-2.0.so.0"
239
#define gtk_printer_is_default_LIB "libgtk-x11-2.0.so.0"
(-)Eclipse SWT PI/gtk/library/os_stats.c (-2 / +23 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 = 1375;
22
int OS_nativeFunctionCallCount[1354];
22
int OS_nativeFunctionCallCount[1375];
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-935 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_1reverse",
926
	"_1gtk_1print_1settings_1get_1scale",
927
	"_1gtk_1print_1settings_1get_1use_1color",
919
	"_1gtk_1print_1settings_1new",
928
	"_1gtk_1print_1settings_1new",
920
	"_1gtk_1print_1settings_1set",
929
	"_1gtk_1print_1settings_1set",
921
	"_1gtk_1print_1settings_1set_1collate",
930
	"_1gtk_1print_1settings_1set_1collate",
931
	"_1gtk_1print_1settings_1set_1default_1source",
932
	"_1gtk_1print_1settings_1set_1duplex",
933
	"_1gtk_1print_1settings_1set_1media_1type",
922
	"_1gtk_1print_1settings_1set_1n_1copies",
934
	"_1gtk_1print_1settings_1set_1n_1copies",
935
	"_1gtk_1print_1settings_1set_1number_1up",
936
	"_1gtk_1print_1settings_1set_1number_1up_1layout",
923
	"_1gtk_1print_1settings_1set_1orientation",
937
	"_1gtk_1print_1settings_1set_1orientation",
938
	"_1gtk_1print_1settings_1set_1output_1bin",
924
	"_1gtk_1print_1settings_1set_1page_1ranges",
939
	"_1gtk_1print_1settings_1set_1page_1ranges",
940
	"_1gtk_1print_1settings_1set_1paper_1size",
925
	"_1gtk_1print_1settings_1set_1print_1pages",
941
	"_1gtk_1print_1settings_1set_1print_1pages",
926
	"_1gtk_1print_1settings_1set_1printer",
942
	"_1gtk_1print_1settings_1set_1printer",
943
	"_1gtk_1print_1settings_1set_1quality",
944
	"_1gtk_1print_1settings_1set_1reverse",
945
	"_1gtk_1print_1settings_1set_1scale",
946
	"_1gtk_1print_1settings_1set_1use_1color",
927
	"_1gtk_1print_1unix_1dialog_1get_1current_1page",
947
	"_1gtk_1print_1unix_1dialog_1get_1current_1page",
928
	"_1gtk_1print_1unix_1dialog_1get_1page_1setup",
948
	"_1gtk_1print_1unix_1dialog_1get_1page_1setup",
929
	"_1gtk_1print_1unix_1dialog_1get_1selected_1printer",
949
	"_1gtk_1print_1unix_1dialog_1get_1selected_1printer",
930
	"_1gtk_1print_1unix_1dialog_1get_1settings",
950
	"_1gtk_1print_1unix_1dialog_1get_1settings",
931
	"_1gtk_1print_1unix_1dialog_1new",
951
	"_1gtk_1print_1unix_1dialog_1new",
932
	"_1gtk_1print_1unix_1dialog_1set_1current_1page",
952
	"_1gtk_1print_1unix_1dialog_1set_1current_1page",
953
	"_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup",
933
	"_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities",
954
	"_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities",
934
	"_1gtk_1print_1unix_1dialog_1set_1page_1setup",
955
	"_1gtk_1print_1unix_1dialog_1set_1page_1setup",
935
	"_1gtk_1print_1unix_1dialog_1set_1settings",
956
	"_1gtk_1print_1unix_1dialog_1set_1settings",
(-)Eclipse SWT PI/gtk/library/os_stats.h (+21 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-943 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_1reverse_FUNC,
934
	_1gtk_1print_1settings_1get_1scale_FUNC,
935
	_1gtk_1print_1settings_1get_1use_1color_FUNC,
927
	_1gtk_1print_1settings_1new_FUNC,
936
	_1gtk_1print_1settings_1new_FUNC,
928
	_1gtk_1print_1settings_1set_FUNC,
937
	_1gtk_1print_1settings_1set_FUNC,
929
	_1gtk_1print_1settings_1set_1collate_FUNC,
938
	_1gtk_1print_1settings_1set_1collate_FUNC,
939
	_1gtk_1print_1settings_1set_1default_1source_FUNC,
940
	_1gtk_1print_1settings_1set_1duplex_FUNC,
941
	_1gtk_1print_1settings_1set_1media_1type_FUNC,
930
	_1gtk_1print_1settings_1set_1n_1copies_FUNC,
942
	_1gtk_1print_1settings_1set_1n_1copies_FUNC,
943
	_1gtk_1print_1settings_1set_1number_1up_FUNC,
944
	_1gtk_1print_1settings_1set_1number_1up_1layout_FUNC,
931
	_1gtk_1print_1settings_1set_1orientation_FUNC,
945
	_1gtk_1print_1settings_1set_1orientation_FUNC,
946
	_1gtk_1print_1settings_1set_1output_1bin_FUNC,
932
	_1gtk_1print_1settings_1set_1page_1ranges_FUNC,
947
	_1gtk_1print_1settings_1set_1page_1ranges_FUNC,
948
	_1gtk_1print_1settings_1set_1paper_1size_FUNC,
933
	_1gtk_1print_1settings_1set_1print_1pages_FUNC,
949
	_1gtk_1print_1settings_1set_1print_1pages_FUNC,
934
	_1gtk_1print_1settings_1set_1printer_FUNC,
950
	_1gtk_1print_1settings_1set_1printer_FUNC,
951
	_1gtk_1print_1settings_1set_1quality_FUNC,
952
	_1gtk_1print_1settings_1set_1reverse_FUNC,
953
	_1gtk_1print_1settings_1set_1scale_FUNC,
954
	_1gtk_1print_1settings_1set_1use_1color_FUNC,
935
	_1gtk_1print_1unix_1dialog_1get_1current_1page_FUNC,
955
	_1gtk_1print_1unix_1dialog_1get_1current_1page_FUNC,
936
	_1gtk_1print_1unix_1dialog_1get_1page_1setup_FUNC,
956
	_1gtk_1print_1unix_1dialog_1get_1page_1setup_FUNC,
937
	_1gtk_1print_1unix_1dialog_1get_1selected_1printer_FUNC,
957
	_1gtk_1print_1unix_1dialog_1get_1selected_1printer_FUNC,
938
	_1gtk_1print_1unix_1dialog_1get_1settings_FUNC,
958
	_1gtk_1print_1unix_1dialog_1get_1settings_FUNC,
939
	_1gtk_1print_1unix_1dialog_1new_FUNC,
959
	_1gtk_1print_1unix_1dialog_1new_FUNC,
940
	_1gtk_1print_1unix_1dialog_1set_1current_1page_FUNC,
960
	_1gtk_1print_1unix_1dialog_1set_1current_1page_FUNC,
961
	_1gtk_1print_1unix_1dialog_1set_1embed_1page_1setup_FUNC,
941
	_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities_FUNC,
962
	_1gtk_1print_1unix_1dialog_1set_1manual_1capabilities_FUNC,
942
	_1gtk_1print_1unix_1dialog_1set_1page_1setup_FUNC,
963
	_1gtk_1print_1unix_1dialog_1set_1page_1setup_FUNC,
943
	_1gtk_1print_1unix_1dialog_1set_1settings_FUNC,
964
	_1gtk_1print_1unix_1dialog_1set_1settings_FUNC,
(-)Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java (+213 lines)
Lines 307-312 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;
311
	public static final int GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT = 1 << 9;
310
	public static final int GTK_PRINT_PAGES_ALL = 0;
312
	public static final int GTK_PRINT_PAGES_ALL = 0;
311
	public static final int GTK_PRINT_PAGES_CURRENT = 1;
313
	public static final int GTK_PRINT_PAGES_CURRENT = 1;
312
	public static final int GTK_PRINT_PAGES_RANGES = 2;
314
	public static final int GTK_PRINT_PAGES_RANGES = 2;
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 custom);
9056
public static final int /*long*/ gtk_paper_size_get_paper_sizes(boolean custom) {
9057
	lock.lock();
9058
	try {
9059
		return _gtk_paper_size_get_paper_sizes(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 num_up);
9179
public static final void gtk_print_settings_set_number_up(int /*long*/ settings, int num_up) {
9180
	lock.lock();
9181
	try {
9182
		_gtk_print_settings_set_number_up(settings, num_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 */
9208
public static final native void _gtk_print_settings_set_number_up_layout(int /*long*/ settings, int /*long*/ layout);
9209
public static final void gtk_print_settings_set_number_up_layout(int /*long*/ settings, int /*long*/ layout) {
9210
	lock.lock();
9211
	try {
9212
		_gtk_print_settings_set_number_up_layout(settings, layout);
9213
	} finally {
9214
		lock.unlock();
9215
	}
9216
}
9217
/** @method flags=dynamic */
9166
public static final native int _gtk_print_settings_get_n_copies(int /*long*/ settings);
9218
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) {
9219
public static final int gtk_print_settings_get_n_copies(int /*long*/ settings) {
9168
	lock.lock();
9220
	lock.lock();
Lines 9196-9201 Link Here
9196
	}
9248
	}
9197
}
9249
}
9198
/** @method flags=dynamic */
9250
/** @method flags=dynamic */
9251
public static final native double _gtk_print_settings_get_scale(int /*long*/ settings);
9252
public static final double gtk_print_settings_get_scale(int /*long*/ settings) {
9253
	lock.lock();
9254
	try {
9255
		return _gtk_print_settings_get_scale(settings);
9256
	} finally {
9257
		lock.unlock();
9258
	}
9259
}
9260
/** @method flags=dynamic 
9261
 * @param num_ranges cast=(gdouble)*/
9262
public static final native void _gtk_print_settings_set_scale(int /*long*/ settings, double scale);
9263
public static final void gtk_print_settings_set_scale(int /*long*/ settings, double scale) {
9264
	lock.lock();
9265
	try {
9266
		_gtk_print_settings_set_scale(settings, scale);
9267
	} finally {
9268
		lock.unlock();
9269
	}
9270
}
9271
/** @method flags=dynamic */
9199
public static final native void _gtk_print_settings_set_print_pages(int /*long*/ settings, int pages);
9272
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) {
9273
public static final void gtk_print_settings_set_print_pages(int /*long*/ settings, int pages) {
9201
	lock.lock();
9274
	lock.lock();
Lines 9218-9223 Link Here
9218
		lock.unlock();
9291
		lock.unlock();
9219
	}
9292
	}
9220
}
9293
}
9294
/** @method flags=dynamic */
9295
public static final native void _gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size);
9296
public static final void gtk_print_settings_set_paper_size(int /*long*/ settings, int /*long*/ paper_size) {
9297
	lock.lock();
9298
	try {
9299
		_gtk_print_settings_set_paper_size(settings, paper_size);
9300
	} finally {
9301
		lock.unlock();
9302
	}
9303
}
9221
/**
9304
/**
9222
 * @method flags=dynamic
9305
 * @method flags=dynamic
9223
 * @param num_ranges cast=(gint)
9306
 * @param num_ranges cast=(gint)
Lines 9261-9266 Link Here
9261
		lock.unlock();
9344
		lock.unlock();
9262
	}
9345
	}
9263
}
9346
}
9347
/** @method flags=dynamic */
9348
public static final native int _gtk_print_settings_get_reverse(int /*long*/ settings);
9349
public static final int gtk_print_settings_get_reverse(int /*long*/ settings) {
9350
	lock.lock();
9351
	try {
9352
		return _gtk_print_settings_get_reverse(settings);
9353
	} finally {
9354
		lock.unlock();
9355
	}
9356
}
9357
/** @method flags=dynamic */
9358
public static final native void _gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse);
9359
public static final void gtk_print_settings_set_reverse(int /*long*/ settings, boolean reverse) {
9360
	lock.lock();
9361
	try {
9362
		_gtk_print_settings_set_reverse(settings, reverse);
9363
	} finally {
9364
		lock.unlock();
9365
	}
9366
}
9367
/** @method flags=dynamic */
9368
public static final native int _gtk_print_settings_get_default_source(int /*long*/ settings);
9369
public static final int gtk_print_settings_get_default_source(int /*long*/ settings) {
9370
	lock.lock();
9371
	try {
9372
		return _gtk_print_settings_get_default_source(settings);
9373
	} finally {
9374
		lock.unlock();
9375
	}
9376
}
9377
/** @method flags=dynamic */
9378
public static final native void _gtk_print_settings_set_default_source(int /*long*/ settings, byte[] source);
9379
public static final void gtk_print_settings_set_default_source(int /*long*/ settings, byte[] source) {
9380
	lock.lock();
9381
	try {
9382
		_gtk_print_settings_set_default_source(settings, source);
9383
	} finally {
9384
		lock.unlock();
9385
	}
9386
}
9387
/** @method flags=dynamic */
9388
public static final native int _gtk_print_settings_get_media_type(int /*long*/ settings);
9389
public static final int gtk_print_settings_get_media_type(int /*long*/ settings) {
9390
	lock.lock();
9391
	try {
9392
		return _gtk_print_settings_get_media_type(settings);
9393
	} finally {
9394
		lock.unlock();
9395
	}
9396
}
9397
/** @method flags=dynamic */
9398
public static final native void _gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type);
9399
public static final void gtk_print_settings_set_media_type(int /*long*/ settings, byte[] media_type) {
9400
	lock.lock();
9401
	try {
9402
		_gtk_print_settings_set_media_type(settings, media_type);
9403
	} finally {
9404
		lock.unlock();
9405
	}
9406
}
9407
/** @method flags=dynamic */
9408
public static final native int _gtk_print_settings_get_output_bin(int /*long*/ settings);
9409
public static final int gtk_print_settings_get_output_bin(int /*long*/ settings) {
9410
	lock.lock();
9411
	try {
9412
		return _gtk_print_settings_get_output_bin(settings);
9413
	} finally {
9414
		lock.unlock();
9415
	}
9416
}
9417
/** @method flags=dynamic */
9418
public static final native void _gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin);
9419
public static final void gtk_print_settings_set_output_bin(int /*long*/ settings, byte[] output_bin) {
9420
	lock.lock();
9421
	try {
9422
		_gtk_print_settings_set_output_bin(settings, output_bin);
9423
	} finally {
9424
		lock.unlock();
9425
	}
9426
}
9427
/** @method flags=dynamic */
9428
public static final native int _gtk_print_settings_get_use_color(int /*long*/ settings);
9429
public static final int gtk_print_settings_get_use_color(int /*long*/ settings) {
9430
	lock.lock();
9431
	try {
9432
		return _gtk_print_settings_get_use_color(settings);
9433
	} finally {
9434
		lock.unlock();
9435
	}
9436
}
9437
/** @method flags=dynamic */
9438
public static final native void _gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color);
9439
public static final void gtk_print_settings_set_use_color(int /*long*/ settings, boolean use_color) {
9440
	lock.lock();
9441
	try {
9442
		_gtk_print_settings_set_use_color(settings, use_color);
9443
	} finally {
9444
		lock.unlock();
9445
	}
9446
}
9447
/** @method flags=dynamic */
9448
public static final native int _gtk_print_settings_get_quality(int /*long*/ settings);
9449
public static final int gtk_print_settings_get_quality(int /*long*/ settings) {
9450
	lock.lock();
9451
	try {
9452
		return _gtk_print_settings_get_quality(settings);
9453
	} finally {
9454
		lock.unlock();
9455
	}
9456
}
9457
/** @method flags=dynamic */
9458
public static final native void _gtk_print_settings_set_quality(int /*long*/ settings, int quality);
9459
public static final void gtk_print_settings_set_quality(int /*long*/ settings, int quality) {
9460
	lock.lock();
9461
	try {
9462
		_gtk_print_settings_set_quality(settings, quality);
9463
	} finally {
9464
		lock.unlock();
9465
	}
9466
}
9264
/**
9467
/**
9265
 * @method flags=dynamic
9468
 * @method flags=dynamic
9266
 * @param title cast=(const gchar *)
9469
 * @param title cast=(const gchar *)
Lines 9276-9281 Link Here
9276
	}
9479
	}
9277
}
9480
}
9278
/** @method flags=dynamic */
9481
/** @method flags=dynamic */
9482
public static final native void _gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed);
9483
public static final void gtk_print_unix_dialog_set_embed_page_setup(int /*long*/ dialog, boolean embed) {
9484
	lock.lock();
9485
	try {
9486
		_gtk_print_unix_dialog_set_embed_page_setup(dialog, embed);
9487
	} finally {
9488
		lock.unlock();
9489
	}
9490
}
9491
/** @method flags=dynamic */
9279
public static final native void _gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup);
9492
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) {
9493
public static final void gtk_print_unix_dialog_set_page_setup(int /*long*/ dialog, int /*long*/ page_setup) {
9281
	lock.lock();
9494
	lock.lock();
(-)Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java (-1 / +205 lines)
Lines 111-118 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;
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;
114
189
115
	/**
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
	/**
116
	 * <code>scope</code> field value indicating that
210
	 * <code>scope</code> field value indicating that
117
	 * all pages should be printed
211
	 * all pages should be printed
118
	 */	
212
	 */	
Lines 148-153 Link Here
148
	public static final int LANDSCAPE = 2;
242
	public static final int LANDSCAPE = 2;
149
	
243
	
150
	/**
244
	/**
245
	 * <code>duplex</code> field value indicating
246
	 * one-sided printing
247
	 * 
248
	 * @since 3.6
249
	 */
250
	public static final int DUPLEX_SIMPLEX = 1;
251
	
252
	/**
253
	 * <code>duplex</code> field value indicating
254
	 * double sided printing on short edge
255
	 * 
256
	 * @since 3.6
257
	 */
258
	public static final int DUPLEX_HORIZONTAL = 2;
259
	
260
	/**
261
	 * <code>duplex</code> field value indicating
262
	 * double sided printing on long edge
263
	 * 
264
	 * @since 3.6
265
	 */
266
	public static final int DUPLEX_VERTICAL = 3;
267
	
268
	/**
269
	 * <code>paperSize</code> field value indicating
270
	 * the paper size as LETTER
271
	 * 
272
	 * @since 3.6
273
	 */
274
	public static final String PAPER_LETTER = "LETTER";
275
276
	/**
277
	 * <code>paperSize</code> field value indicating
278
	 * the paper size as LEGAL
279
	 * 
280
	 * @since 3.6
281
	 */
282
	public static final String PAPER_LEGAL = "LEGAL";
283
	
284
	/**
285
	 * <code>paperSize</code> field value indicating
286
	 * the paper size as A4 sheet
287
	 * 
288
	 * @since 3.6
289
	 */
290
	public static final String PAPER_A2 = "A2";
291
292
	/**
293
	 * <code>paperSize</code> field value indicating
294
	 * the paper size as A4 sheet
295
	 * 
296
	 * @since 3.6
297
	 */
298
	public static final String PAPER_A4 = "A4";
299
	
300
	/**
301
	 * <code>paperSize</code> field value indicating
302
	 * the paper size as A4 sheet
303
	 * 
304
	 * @since 3.6
305
	 */
306
	public static final String PAPER_A5 = "A5";
307
308
	/**
309
	 * <code>paperSize</code> field value indicating
310
	 * the paper size as A4 sheet
311
	 * 
312
	 * @since 3.6
313
	 */
314
	public static final String PAPER_A6 = "A6";
315
316
	/**
317
	 * <code>paperSize</code> field value indicating
318
	 * the paper size as B5 sheet
319
	 * 
320
	 * @since 3.6
321
	 */
322
	public static final String PAPER_B5 = "B5";
323
	
324
	/**
325
	 * <code>paperSize</code> field value indicating
326
	 * the paper size as JB5 sheet
327
	 * 
328
	 * @since 3.6
329
	 */
330
	public static final String PAPER_JB5 = "JB5";
331
	
332
	/**
333
	 * <code>paperSize</code> field value indicating
334
	 * the paper size as EXECUTIVE
335
	 * 
336
	 * @since 3.6
337
	 */
338
	public static final String PAPER_EXECUTIVE = "EXECUTIVE";
339
	
340
	/**
341
	 * <code>paperSize</code> field value indicating the paper 
342
	 * size as Custom. When this field is specified, the values 
343
	 * for <code>customPaperHeight</code> and <code>customPaperWidth</code>
344
	 * are required to create a custom paper size and optionally, 
345
	 * <code>customPaperName</code> <code>customPaperDisplayName</code>.
346
	 * 
347
	 * Note that customPaperHeight and customPaperWidth are ignored
348
	 * when the field has not specified this value.
349
	 * 
350
	 * @since 3.6
351
	 */
352
	public static final String PAPER_CUSTOM = "CUSTOM";
353
354
	/**
151
	 * private, platform-specific data
355
	 * private, platform-specific data
152
	 * On Windows, this contains a copy of the DEVMODE struct
356
	 * On Windows, this contains a copy of the DEVMODE struct
153
	 * returned from the <code>PrintDialog</code>.
357
	 * returned from the <code>PrintDialog</code>.
Lines 158-164 Link Here
158
	 * This field is not currently used on the X/Window System.
362
	 * This field is not currently used on the X/Window System.
159
	 */	
363
	 */	
160
	byte [] otherData;
364
	byte [] otherData;
161
365
	
162
	/**
366
	/**
163
	 * Constructs an instance of this class that can be
367
	 * Constructs an instance of this class that can be
164
	 * used to print to the default printer.
368
	 * used to print to the default printer.
(-)Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java (-29 / +89 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
				OS.GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT | OS.GTK_PRINT_CAPABILITY_PREVIEW);
307
		
308
		
308
		/* Set state into print dialog settings. */
309
		/* Set state into print dialog settings. */
309
		int /*long*/ settings = OS.gtk_print_settings_new();
310
		int /*long*/ settings = OS.gtk_print_settings_new();
Lines 312-317 Link Here
312
		if (printerData.otherData != null) {
313
		if (printerData.otherData != null) {
313
			Printer.restore(printerData.otherData, settings, page_setup);
314
			Printer.restore(printerData.otherData, settings, page_setup);
314
		}
315
		}
316
		
315
		/* Set values of print_settings and page_setup from PrinterData. */
317
		/* Set values of print_settings and page_setup from PrinterData. */
316
		switch (printerData.scope) {
318
		switch (printerData.scope) {
317
			case PrinterData.ALL_PAGES:
319
			case PrinterData.ALL_PAGES:
Lines 329-357 Link Here
329
				OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_ALL);
331
				OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_ALL);
330
				break;
332
				break;
331
		}
333
		}
332
		if (printerData.fileName != null) {
334
		//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) {
335
		if (printerData.printToFile) {
346
			byte [] buffer = Converter.wcsToMbcs (null, "Print to File", true); //$NON-NLS-1$
336
			byte [] buffer = Converter.wcsToMbcs (null, "Print to File", true); //$NON-NLS-1$
347
			OS.gtk_print_settings_set_printer(settings, buffer);
337
			OS.gtk_print_settings_set_printer(settings, buffer);
338
			if (printerData.fileName != null) {
339
				buffer = Converter.wcsToMbcs (null, printerData.fileName, true);
340
				OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI, buffer);
341
			}
342
		} else if (printerData.name != null){
343
			/* Selecting Printer */
344
			byte [] buffer = Converter.wcsToMbcs (null, printerData.name, true);
345
			OS.gtk_print_settings_set_printer(settings, buffer);
348
		}
346
		}
347
		/* Copy Count */
349
		OS.gtk_print_settings_set_n_copies(settings, printerData.copyCount);
348
		OS.gtk_print_settings_set_n_copies(settings, printerData.copyCount);
349
		/* Collate */
350
		OS.gtk_print_settings_set_collate(settings, printerData.collate);
350
		OS.gtk_print_settings_set_collate(settings, printerData.collate);
351
		/* Orientation */
351
		int orientation = printerData.orientation == PrinterData.LANDSCAPE ? OS.GTK_PAGE_ORIENTATION_LANDSCAPE : OS.GTK_PAGE_ORIENTATION_PORTRAIT;
352
		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);
353
		OS.gtk_print_settings_set_orientation(settings, orientation);
353
		OS.gtk_page_setup_set_orientation(page_setup, orientation);
354
		OS.gtk_page_setup_set_orientation(page_setup, orientation);
354
		
355
		/* Paper Size */
356
		int /*long*/ paperSize = 0;
357
		if (printerData.paperSizeName == PrinterData.PAPER_CUSTOM) {
358
			if (printerData.customPaperName == null) printerData.customPaperName = "CustomPaper"; //$NON-NLS-1$
359
			if (printerData.customPaperDisplayName == null) printerData.customPaperDisplayName = "CustomPaper"; //$NON-NLS-1$
360
			byte [] name = Converter.wcsToMbcs (null, printerData.customPaperName, true);
361
			byte [] displayName = Converter.wcsToMbcs (null, printerData.customPaperDisplayName, true);
362
			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
363
		} else {
364
			/*
365
			* Since there are numerous paper size names, it might not be possible to provide
366
			* constant names for all the sizes. So, if the user selects any paperSizeName not
367
			* defined in SWT, then we should be able to restore it back when the dialog is opened.
368
			*/
369
			String[] keys = {PrinterData.PAPER_LEGAL, PrinterData.PAPER_LETTER, PrinterData.PAPER_A2, PrinterData.PAPER_A4, 
370
									PrinterData.PAPER_A5, PrinterData.PAPER_A6, PrinterData.PAPER_B5, PrinterData.PAPER_JB5, PrinterData.PAPER_EXECUTIVE};
371
			String[] values = {"na_legal", "na_letter", "iso_a2", "iso_a4", 
372
									"iso_a5", "iso_a6", "iso_b5", "jis_b5", "na_executive"}; //$NON-NLS-1$
373
			int index;
374
			for (index = 0; index < keys.length; index++) {
375
				if (printerData.paperSizeName.equals(keys[index])) break;
376
			}
377
			byte [] buffer;
378
			if (index < keys.length) {
379
				buffer = Converter.wcsToMbcs (null, values[index], true);
380
			} else {
381
				buffer = Converter.wcsToMbcs (null, printerData.paperSizeName, true);
382
			}
383
			paperSize = OS.gtk_paper_size_new(buffer);
384
		}
385
		OS.gtk_page_setup_set_paper_size (page_setup, paperSize);
386
		OS.gtk_paper_size_free(paperSize);
387
		/* Pages Per Side */
388
		OS.gtk_print_settings_set_number_up (settings, printerData.pagesPerSide);
389
		/* Duplex */
390
		OS.gtk_print_settings_set_duplex (settings, printerData.duplex - 1);
391
		/* Scale */
392
		OS.gtk_print_settings_set_scale (settings, printerData.scale);
393
		/* display Orientation and Paper size fields */
394
		if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
395
			OS.gtk_print_unix_dialog_set_embed_page_setup(handle, true);
396
		}
397
355
		OS.gtk_print_unix_dialog_set_settings(handle, settings);
398
		OS.gtk_print_unix_dialog_set_settings(handle, settings);
356
		OS.gtk_print_unix_dialog_set_page_setup(handle, page_setup);
399
		OS.gtk_print_unix_dialog_set_page_setup(handle, page_setup);
357
		OS.g_object_unref(settings);
400
		OS.g_object_unref(settings);
Lines 417-432 Link Here
417
				
460
				
418
				data.printToFile = data.name.equals("Print to File"); //$NON-NLS-1$
461
				data.printToFile = data.name.equals("Print to File"); //$NON-NLS-1$
419
				if (data.printToFile) {
462
				if (data.printToFile) {
420
					int /*long*/ address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI);
463
					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
				}
464
				}
426
465
427
				data.copyCount = OS.gtk_print_settings_get_n_copies(settings);
466
				data.copyCount = OS.gtk_print_settings_get_n_copies(settings);
428
				data.collate = OS.gtk_print_settings_get_collate(settings);
467
				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;
468
				data.orientation = OS.gtk_page_setup_get_orientation(page_setup) == OS.GTK_PAGE_ORIENTATION_LANDSCAPE ? PrinterData.LANDSCAPE : PrinterData.PORTRAIT;
469
				data.scale = OS.gtk_print_settings_get_scale(settings);
470
				data.duplex = OS.gtk_print_settings_get_duplex(settings) + 1;
471
				
472
				int /*long*/ paper_size = OS.gtk_page_setup_get_paper_size(page_setup);
473
				if (OS.gtk_paper_size_is_custom(paper_size)) {
474
					data.paperSizeName = PrinterData.PAPER_CUSTOM;
475
					data.customPaperHeight = OS.gtk_paper_size_get_height (paper_size, OS.GTK_UNIT_INCH);
476
					data.customPaperWidth = OS.gtk_paper_size_get_width (paper_size, OS.GTK_UNIT_INCH);
477
					data.customPaperName = getString (OS.gtk_paper_size_get_name(paper_size));
478
					data.customPaperDisplayName = getString (OS.gtk_paper_size_get_display_name(paper_size));
479
				} else {
480
					data.paperSizeName = getString (OS.gtk_paper_size_get_name(paper_size));
481
				}
430
482
431
				/* Save other print_settings data as key/value pairs in otherData. */
483
				/* Save other print_settings data as key/value pairs in otherData. */
432
				Callback printSettingsCallback = new Callback(this, "GtkPrintSettingsFunc", 3); //$NON-NLS-1$
484
				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.
493
				/* 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.
494
				 * Note that page_setup properties must be stored and restored in the same order.
443
				 */
495
				 */
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$
496
				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$
497
				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$
498
				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$
499
				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$
500
				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$
501
				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$
502
				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$
503
				if (!data.printToFile) {
453
				store("paper_size_width", OS.gtk_paper_size_get_width(paper_size, OS.GTK_UNIT_MM)); //$NON-NLS-1$
504
					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$
505
					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$
506
					storeBytes ("output_bin", OS.gtk_print_settings_get_output_bin (settings)); //$NON-NLS-1$
507
				}
508
456
				data.otherData = settingsData;
509
				data.otherData = settingsData;
457
				OS.g_object_unref(settings);
510
				OS.g_object_unref(settings);
458
				printerData = data;
511
				printerData = data;
Lines 475-480 Link Here
475
	return 0;
528
	return 0;
476
}
529
}
477
530
531
String getString (int /*long*/ stringPtr) {
532
	int strLength = OS.strlen (stringPtr);
533
	byte[] buffer = new byte [strLength];
534
	OS.memmove (buffer, stringPtr, strLength);		
535
	return new String (Converter.mbcsToWcs (null, buffer));
536
}
537
478
void store(String key, int value) {
538
void store(String key, int value) {
479
	store(key, String.valueOf(value));
539
	store(key, String.valueOf(value));
480
}
540
}
(-)Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java (-19 / +28 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
 * 
73
 * @return a string array containing paper size names
74
 */
75
public static String[] getPaperSizeList () {
76
	int /*long*/ list = OS.gtk_paper_size_get_paper_sizes (true);
77
	int count = OS.g_list_length(list);
78
	String[] result = new String[count];
79
	for (int i=0; i<count; i++) {
80
		int /*long*/ paper = OS.g_list_nth_data(list, i);
81
		int /*long*/ paperNamePtr = OS.gtk_paper_size_get_name (paper);
82
		int length = OS.strlen (paperNamePtr);
83
		byte [] buffer = new byte [length];
84
		OS.memmove (buffer, paperNamePtr, length);
85
		result[i] = new String (Converter.mbcsToWcs (null, buffer));
86
	}
87
	OS.g_list_free (list);
88
	return result;
89
}
90
91
/**
70
 * Returns an array of <code>PrinterData</code> objects
92
 * Returns an array of <code>PrinterData</code> objects
71
 * representing all available printers.  If there are no
93
 * representing all available printers.  If there are no
72
 * printers, the array will be empty.
94
 * printers, the array will be empty.
Lines 214-242 Link Here
214
	/* Retrieve stored page_setup data.
236
	/* Retrieve stored page_setup data.
215
	 * Note that page_setup properties must be stored (in PrintDialog) and restored (here) in the same order.
237
	 * Note that page_setup properties must be stored (in PrintDialog) and restored (here) in the same order.
216
	 */
238
	 */
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$
239
	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$
240
	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$
241
	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$
242
	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$
243
	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$
244
	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$
245
	OS.gtk_print_settings_set_quality (settings, restoreInt("print_quality")); //$NON-NLS-1$
225
	double width = restoreDouble("paper_size_width"); //$NON-NLS-1$
246
	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$
247
	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$
248
	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
}
249
}
241
250
242
static DeviceData checkNull (PrinterData data) {
251
static DeviceData checkNull (PrinterData data) {

Return to bug 96394