Commit 866a32b5f503c6dda77b2bb782fdda44e7d1e2d4
1 parent
b0fa314d
Exists in
master
and in
3 other branches
Updating sf.
Showing
1 changed file
with
22 additions
and
29 deletions
Show diff stats
src/core/sf.c
... | ... | @@ -62,11 +62,18 @@ |
62 | 62 | #include "utilc.h" |
63 | 63 | |
64 | 64 | /* Screen globals. */ |
65 | -static const int cw = 7; | |
65 | +/* | |
66 | +static const int cw = 0x09; | |
66 | 67 | static const int * char_width = &cw; |
67 | 68 | |
68 | -static const int ch = 7; | |
69 | +static const int ch = 0x0C; | |
69 | 70 | static const int * char_height = &ch; |
71 | +*/ | |
72 | + | |
73 | +#define SW_3279_2 0x09 | |
74 | +#define SH_3279_2 0x0c | |
75 | +#define Xr_3279_2 0x000a02e5 | |
76 | +#define Yr_3279_2 0x0002006f | |
70 | 77 | |
71 | 78 | /* Globals */ |
72 | 79 | static const Boolean sfont = False; |
... | ... | @@ -610,13 +617,14 @@ static enum pds sf_create_partition(H3270 *hSession, unsigned char buf[], int bu |
610 | 617 | GET16(pw, &buf[26]); |
611 | 618 | trace_ds(hSession,",pw=%d", pw); |
612 | 619 | } else |
613 | - pw = *char_width; | |
620 | + pw = SW_3279_2; | |
614 | 621 | |
615 | 622 | if (buflen > 29) { |
616 | 623 | GET16(ph, &buf[28]); |
617 | 624 | trace_ds(hSession,",ph=%d", ph); |
618 | 625 | } else |
619 | - ph = *char_height; | |
626 | + ph = SH_3279_2; | |
627 | + | |
620 | 628 | trace_ds(hSession,")\n"); |
621 | 629 | |
622 | 630 | cursor_move(hSession,0); |
... | ... | @@ -784,39 +792,24 @@ static void do_qr_summary(H3270 *hSession) |
784 | 792 | |
785 | 793 | static void do_qr_usable_area(H3270 *hSession) |
786 | 794 | { |
787 | - unsigned short num, denom; | |
788 | - | |
789 | 795 | trace_ds(hSession,"> QueryReply(UsableArea)\n"); |
790 | 796 | space3270out(hSession,19); |
791 | 797 | *hSession->output.ptr++ = 0x01; /* 12/14-bit addressing */ |
792 | 798 | *hSession->output.ptr++ = 0x00; /* no special character features */ |
793 | 799 | SET16(hSession->output.ptr, hSession->max.cols); /* usable width */ |
794 | 800 | SET16(hSession->output.ptr, hSession->max.rows); /* usable height */ |
795 | - *hSession->output.ptr++ = 0x01; /* units (mm) */ | |
796 | 801 | |
797 | - num = display_widthMM(); | |
798 | - denom = display_width(); | |
799 | - while (!(num %2) && !(denom % 2)) | |
800 | - { | |
801 | - num /= 2; | |
802 | - denom /= 2; | |
803 | - } | |
804 | - SET16(hSession->output.ptr, (int)num); /* Xr numerator */ | |
805 | - SET16(hSession->output.ptr, (int)denom); /* Xr denominator */ | |
802 | + *hSession->output.ptr++ = 0x01; /* units (mm) */ | |
806 | 803 | |
807 | - num = display_heightMM(); | |
808 | - denom = display_height(); | |
809 | - while (!(num %2) && !(denom % 2)) | |
810 | - { | |
811 | - num /= 2; | |
812 | - denom /= 2; | |
813 | - } | |
804 | + // | |
805 | + // Got from C3270 source code. | |
806 | + // | |
814 | 807 | |
815 | - SET16(hSession->output.ptr, (int)num); /* Yr numerator */ | |
816 | - SET16(hSession->output.ptr, (int)denom); /* Yr denominator */ | |
808 | + SET32(hSession->output.ptr, Xr_3279_2); // Xr, canned from 3279-2 | |
809 | + SET32(hSession->output.ptr, Yr_3279_2); // Yr, canned from 3279-2 | |
817 | 810 | |
818 | - *hSession->output.ptr++ = *char_width; /* AW */ | |
819 | - *hSession->output.ptr++ = *char_height; /* AH */ | |
811 | + *hSession->output.ptr++ = SW_3279_2; // AW, canned from 3279-2 | |
812 | + *hSession->output.ptr++ = SH_3279_2; // AH, canned from 3279-2 | |
820 | 813 | |
821 | 814 | SET16(hSession->output.ptr, hSession->max.cols * hSession->max.rows); /* buffer, questionable */ |
822 | 815 | |
... | ... | @@ -922,8 +915,8 @@ static void do_qr_charsets(H3270 *hSession) |
922 | 915 | *hSession->output.ptr++ = 0x82; /* flags: GE, CGCSGID present */ |
923 | 916 | |
924 | 917 | *hSession->output.ptr++ = 0x00; /* more flags */ |
925 | - *hSession->output.ptr++ = *char_width; /* SDW */ | |
926 | - *hSession->output.ptr++ = *char_height; /* SDW */ | |
918 | + *hSession->output.ptr++ = SW_3279_2; /* SDW */ | |
919 | + *hSession->output.ptr++ = SH_3279_2; /* SDW */ | |
927 | 920 | *hSession->output.ptr++ = 0x00; /* no load PS */ |
928 | 921 | *hSession->output.ptr++ = 0x00; |
929 | 922 | *hSession->output.ptr++ = 0x00; | ... | ... |