mfiler4のgitリポジトリ
リビジョン | 916725e807bdd6f4fdf0b26ba6985a20928bc1b5 (tree) |
---|---|
日時 | 2012-12-14 15:19:13 |
作者 | ab25cq <ab25cq@gmai...> |
コミッター | ab25cq |
1.0.5b
@@ -1,4 +1,12 @@ | ||
1 | 1 | |
2 | +2012 14th December version 1.0.5b | |
3 | + | |
4 | + 1. Got good way to refresh screen on cygwin. | |
5 | + | |
6 | +2012 12月14日 1.0.5b | |
7 | + | |
8 | + 1. cygwinで画面のちらつきを抑えました。 | |
9 | + | |
2 | 10 | 2012 14th December version 1.0.5a |
3 | 11 | |
4 | 12 | 1. Maybe got good way to refresh screen on cygwin. |
@@ -2991,7 +2991,7 @@ BOOL cmd_mclear_immediately(sObject* nextin, sObject* nextout, sRunInfo* runinfo | ||
2991 | 2991 | return FALSE; |
2992 | 2992 | } |
2993 | 2993 | |
2994 | - mclear_immediately(); | |
2994 | + xclear_immediately(); | |
2995 | 2995 | runinfo->mRCode = 0; |
2996 | 2996 | |
2997 | 2997 | return TRUE; |
@@ -127,6 +127,9 @@ void ISearchClear(); | ||
127 | 127 | int xgetch(int* meta); |
128 | 128 | void xinitscr(); |
129 | 129 | void xendwin(); |
130 | +void xclear(); | |
131 | +void xclear_immediately(); | |
132 | +void mclear_lastline(); | |
130 | 133 | char* choise(char* msg, char* str[], int len, int cancel); |
131 | 134 | void merr_msg(char* msg, ...); |
132 | 135 | void msg_nonstop(char* msg, ...); |
@@ -18,7 +18,7 @@ void xinitscr() | ||
18 | 18 | raw(); |
19 | 19 | noecho(); |
20 | 20 | keypad(stdscr, TRUE); |
21 | - curs_set(0); | |
21 | + //curs_set(0); | |
22 | 22 | |
23 | 23 | int background = COLOR_BLACK; |
24 | 24 |
@@ -98,6 +98,12 @@ void merr_msg(char* msg, ...) | ||
98 | 98 | refresh(); |
99 | 99 | |
100 | 100 | (void)getch(); |
101 | + | |
102 | +#if defined(__CYGWIN__) | |
103 | + xclear_immediately(); // 画面の再描写 | |
104 | + view(); | |
105 | + refresh(); | |
106 | +#endif | |
101 | 107 | } |
102 | 108 | else { |
103 | 109 | fprintf(stderr, "%s", msg2); |
@@ -129,7 +135,7 @@ void msg_nonstop(char* msg, ...) | ||
129 | 135 | const int maxy = mgetmaxy(); |
130 | 136 | const int maxx = mgetmaxx(); |
131 | 137 | |
132 | - clear(); | |
138 | + xclear(); | |
133 | 139 | view(); |
134 | 140 | mclear_online(maxy-2); |
135 | 141 | mclear_online(maxy-1); |
@@ -192,7 +198,7 @@ char* choise(char* msg, char* str[], int len, int cancel) | ||
192 | 198 | if(cursor < 0) cursor= 0; |
193 | 199 | } |
194 | 200 | else if(key == 12) { // CTRL-L |
195 | - mclear_immediately(); | |
201 | + xclear_immediately(); | |
196 | 202 | } |
197 | 203 | else if(key == 3 || key == 7 || key == 27) { // CTRL-C -G Escape |
198 | 204 | return NULL; |
@@ -209,6 +215,12 @@ char* choise(char* msg, char* str[], int len, int cancel) | ||
209 | 215 | } |
210 | 216 | finished: |
211 | 217 | |
218 | +#if defined(__CYGWIN__) | |
219 | + xclear_immediately(); // 画面の再描写 | |
220 | + view(); | |
221 | + refresh(); | |
222 | +#endif | |
223 | + | |
212 | 224 | return str[cursor]; |
213 | 225 | } |
214 | 226 |
@@ -391,7 +403,7 @@ int input_box(char* msg, char* result, int result_size, char* def_input, int def | ||
391 | 403 | break; |
392 | 404 | } |
393 | 405 | else if(key == 12) { // CTRL-L |
394 | - mclear_immediately(); | |
406 | + xclear_immediately(); | |
395 | 407 | } |
396 | 408 | else { |
397 | 409 | if(meta == 0 && !(key >= 0 && key <= 27)) { |
@@ -413,6 +425,12 @@ int input_box(char* msg, char* result, int result_size, char* def_input, int def | ||
413 | 425 | |
414 | 426 | mmove_immediately(maxy -2, 0); |
415 | 427 | |
428 | +#if defined(__CYGWIN__) | |
429 | + xclear_immediately(); // 画面の再描写 | |
430 | + view(); | |
431 | + refresh(); | |
432 | +#endif | |
433 | + | |
416 | 434 | return result2; |
417 | 435 | } |
418 | 436 |
@@ -488,7 +506,7 @@ int select_str(char* msg, char* str[], int len, int cancel) | ||
488 | 506 | if(gSelectStrCursor < 0) gSelectStrCursor= 0; |
489 | 507 | } |
490 | 508 | else if(key == 12) { // CTRL-L |
491 | - mclear_immediately(); | |
509 | + xclear_immediately(); | |
492 | 510 | } |
493 | 511 | else if(key == 3 || key == 7 | key == 27) { // CTRL-C -G Escape |
494 | 512 | gSelectStrCursor = cancel; |
@@ -508,6 +526,12 @@ finished: | ||
508 | 526 | |
509 | 527 | gView = NULL; |
510 | 528 | |
529 | +#if defined(__CYGWIN__) | |
530 | + xclear_immediately(); // 画面の再描写 | |
531 | + view(); | |
532 | + refresh(); | |
533 | +#endif | |
534 | + | |
511 | 535 | return gSelectStrCursor; |
512 | 536 | } |
513 | 537 |
@@ -542,7 +566,7 @@ int select_str2(char* msg, char* str[], int len, int cancel) | ||
542 | 566 | if(gSelectStrCursor < 0) gSelectStrCursor= 0; |
543 | 567 | } |
544 | 568 | else if(key == 12) { // CTRL-L |
545 | - mclear_immediately(); | |
569 | + xclear_immediately(); | |
546 | 570 | } |
547 | 571 | else if(key == 3 || key == 7 || key == 27) { // CTRL-C -G Escape |
548 | 572 | gSelectStrCursor = cancel; |
@@ -562,5 +586,55 @@ finished: | ||
562 | 586 | |
563 | 587 | gView = NULL; |
564 | 588 | |
589 | +#if defined(__CYGWIN__) | |
590 | + xclear_immediately(); // 画面の再描写 | |
591 | + view(); | |
592 | + refresh(); | |
593 | +#endif | |
594 | + | |
565 | 595 | return gSelectStrCursor; |
566 | 596 | } |
597 | + | |
598 | +void xclear_immediately() | |
599 | +{ | |
600 | +#if defined(__CYGWIN__) | |
601 | + int y; | |
602 | + for(y=0; y<mgetmaxy(); y++) { | |
603 | + mclear_online(y); | |
604 | + } | |
605 | + refresh(); | |
606 | +#else | |
607 | + mclear_immediately(); | |
608 | +#endif | |
609 | +} | |
610 | + | |
611 | +void mclear_lastline() | |
612 | +{ | |
613 | + char space[1024]; | |
614 | + int x; | |
615 | + | |
616 | + const int maxx = mgetmaxx(); | |
617 | + const int maxy = mgetmaxy(); | |
618 | + | |
619 | + for(x=0; x<maxx-1; x++) { | |
620 | + space[x] = ' '; | |
621 | + } | |
622 | + space[x] = 0; | |
623 | + | |
624 | + attron(0); | |
625 | + mvprintw(maxy-1, 0, space); | |
626 | +} | |
627 | + | |
628 | +void xclear() | |
629 | +{ | |
630 | +#if defined(__CYGWIN__) | |
631 | + int y; | |
632 | + for(y=0; y<mgetmaxy()-1; y++) { | |
633 | + mclear_online(y); | |
634 | + } | |
635 | + mclear_lastline(); | |
636 | +#else | |
637 | + clear(); | |
638 | +#endif | |
639 | +} | |
640 | + |
@@ -619,6 +619,16 @@ void isearch_input(int meta, int key) | ||
619 | 619 | /////////////////////////////////////////////////// |
620 | 620 | // インクリメンタルサーチ描写 |
621 | 621 | /////////////////////////////////////////////////// |
622 | +#if defined(__CYGWIN__) | |
623 | +void isearch_view() | |
624 | +{ | |
625 | + const int maxx = mgetmaxx(); | |
626 | + const int maxy = mgetmaxy(); | |
627 | + | |
628 | + mbox(maxy/2, maxx/3, maxx/3, 3); | |
629 | + mvprintw(maxy/2+1, maxx/3+1, "/%s", string_c_str(gInputFileName)); | |
630 | +} | |
631 | +#else | |
622 | 632 | void isearch_view() |
623 | 633 | { |
624 | 634 | const int maxx = mgetmaxx(); |
@@ -644,4 +654,5 @@ void isearch_view() | ||
644 | 654 | buf[i] = 0; |
645 | 655 | printw(buf); |
646 | 656 | } |
657 | +#endif | |
647 | 658 |
@@ -280,6 +280,9 @@ void view() | ||
280 | 280 | job_view(); |
281 | 281 | |
282 | 282 | isearch_view(); |
283 | +#if defined(__CYGWIN__) | |
284 | + cmdline_view_filer(); | |
285 | +#endif | |
283 | 286 | } |
284 | 287 | else if(gActiveMenu) { |
285 | 288 | filer_view(0); |
@@ -341,7 +344,7 @@ static void atexit_fun() | ||
341 | 344 | static void sig_winch(int s) |
342 | 345 | { |
343 | 346 | if(gMainLoop == -1) { |
344 | - mclear_immediately(); // 画面の再描写 | |
347 | + xclear_immediately(); // 画面の再描写 | |
345 | 348 | view(); |
346 | 349 | refresh(); |
347 | 350 | } |
@@ -350,7 +353,7 @@ static void sig_winch(int s) | ||
350 | 353 | static void sig_cont(int s) |
351 | 354 | { |
352 | 355 | if(gMainLoop == -1) { |
353 | - mclear_immediately(); // 画面の再描写 | |
356 | + xclear_immediately(); // 画面の再描写 | |
354 | 357 | view(); |
355 | 358 | refresh(); |
356 | 359 | } |
@@ -908,7 +911,7 @@ int main(int argc, char* argv[]) | ||
908 | 911 | CHECKML_BEGIN(FALSE); |
909 | 912 | |
910 | 913 | /// ファイラでもスクリプトでも共通の環境変数を初期化 /// |
911 | - setenv("VERSION", "1.0.5a", 1); | |
914 | + setenv("VERSION", "1.0.5b", 1); | |
912 | 915 | setenv("MFILER4_DATAROOTDIR", DATAROOTDIR, 1); |
913 | 916 | |
914 | 917 | /// mfiler4のホームディレクトリを保存しておく /// |
@@ -1133,7 +1136,7 @@ int main(int argc, char* argv[]) | ||
1133 | 1136 | |
1134 | 1137 | while(gMainLoop == -1) { |
1135 | 1138 | /// 描写 /// |
1136 | - clear(); | |
1139 | + xclear(); | |
1137 | 1140 | view(); |
1138 | 1141 | refresh(); |
1139 | 1142 |
@@ -205,7 +205,7 @@ void menu_input(sMenu* self, int meta, int key) | ||
205 | 205 | clear(); |
206 | 206 | } |
207 | 207 | else if(key == 12) {// CTRL-L |
208 | - mclear_immediately(); | |
208 | + xclear_immediately(); | |
209 | 209 | } |
210 | 210 | else { |
211 | 211 | gActiveMenu = NULL; |