• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

mfiler4のgitリポジトリ


コミットメタ情報

リビジョン916725e807bdd6f4fdf0b26ba6985a20928bc1b5 (tree)
日時2012-12-14 15:19:13
作者ab25cq <ab25cq@gmai...>
コミッターab25cq

ログメッセージ

1.0.5b

変更サマリ

差分

--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,12 @@
11
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+
210 2012 14th December version 1.0.5a
311
412 1. Maybe got good way to refresh screen on cygwin.
--- a/src/commands.c
+++ b/src/commands.c
@@ -2991,7 +2991,7 @@ BOOL cmd_mclear_immediately(sObject* nextin, sObject* nextout, sRunInfo* runinfo
29912991 return FALSE;
29922992 }
29932993
2994- mclear_immediately();
2994+ xclear_immediately();
29952995 runinfo->mRCode = 0;
29962996
29972997 return TRUE;
--- a/src/common.h
+++ b/src/common.h
@@ -127,6 +127,9 @@ void ISearchClear();
127127 int xgetch(int* meta);
128128 void xinitscr();
129129 void xendwin();
130+void xclear();
131+void xclear_immediately();
132+void mclear_lastline();
130133 char* choise(char* msg, char* str[], int len, int cancel);
131134 void merr_msg(char* msg, ...);
132135 void msg_nonstop(char* msg, ...);
--- a/src/gui.c
+++ b/src/gui.c
@@ -18,7 +18,7 @@ void xinitscr()
1818 raw();
1919 noecho();
2020 keypad(stdscr, TRUE);
21- curs_set(0);
21+ //curs_set(0);
2222
2323 int background = COLOR_BLACK;
2424
@@ -98,6 +98,12 @@ void merr_msg(char* msg, ...)
9898 refresh();
9999
100100 (void)getch();
101+
102+#if defined(__CYGWIN__)
103+ xclear_immediately(); // 画面の再描写
104+ view();
105+ refresh();
106+#endif
101107 }
102108 else {
103109 fprintf(stderr, "%s", msg2);
@@ -129,7 +135,7 @@ void msg_nonstop(char* msg, ...)
129135 const int maxy = mgetmaxy();
130136 const int maxx = mgetmaxx();
131137
132- clear();
138+ xclear();
133139 view();
134140 mclear_online(maxy-2);
135141 mclear_online(maxy-1);
@@ -192,7 +198,7 @@ char* choise(char* msg, char* str[], int len, int cancel)
192198 if(cursor < 0) cursor= 0;
193199 }
194200 else if(key == 12) { // CTRL-L
195- mclear_immediately();
201+ xclear_immediately();
196202 }
197203 else if(key == 3 || key == 7 || key == 27) { // CTRL-C -G Escape
198204 return NULL;
@@ -209,6 +215,12 @@ char* choise(char* msg, char* str[], int len, int cancel)
209215 }
210216 finished:
211217
218+#if defined(__CYGWIN__)
219+ xclear_immediately(); // 画面の再描写
220+ view();
221+ refresh();
222+#endif
223+
212224 return str[cursor];
213225 }
214226
@@ -391,7 +403,7 @@ int input_box(char* msg, char* result, int result_size, char* def_input, int def
391403 break;
392404 }
393405 else if(key == 12) { // CTRL-L
394- mclear_immediately();
406+ xclear_immediately();
395407 }
396408 else {
397409 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
413425
414426 mmove_immediately(maxy -2, 0);
415427
428+#if defined(__CYGWIN__)
429+ xclear_immediately(); // 画面の再描写
430+ view();
431+ refresh();
432+#endif
433+
416434 return result2;
417435 }
418436
@@ -488,7 +506,7 @@ int select_str(char* msg, char* str[], int len, int cancel)
488506 if(gSelectStrCursor < 0) gSelectStrCursor= 0;
489507 }
490508 else if(key == 12) { // CTRL-L
491- mclear_immediately();
509+ xclear_immediately();
492510 }
493511 else if(key == 3 || key == 7 | key == 27) { // CTRL-C -G Escape
494512 gSelectStrCursor = cancel;
@@ -508,6 +526,12 @@ finished:
508526
509527 gView = NULL;
510528
529+#if defined(__CYGWIN__)
530+ xclear_immediately(); // 画面の再描写
531+ view();
532+ refresh();
533+#endif
534+
511535 return gSelectStrCursor;
512536 }
513537
@@ -542,7 +566,7 @@ int select_str2(char* msg, char* str[], int len, int cancel)
542566 if(gSelectStrCursor < 0) gSelectStrCursor= 0;
543567 }
544568 else if(key == 12) { // CTRL-L
545- mclear_immediately();
569+ xclear_immediately();
546570 }
547571 else if(key == 3 || key == 7 || key == 27) { // CTRL-C -G Escape
548572 gSelectStrCursor = cancel;
@@ -562,5 +586,55 @@ finished:
562586
563587 gView = NULL;
564588
589+#if defined(__CYGWIN__)
590+ xclear_immediately(); // 画面の再描写
591+ view();
592+ refresh();
593+#endif
594+
565595 return gSelectStrCursor;
566596 }
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+
--- a/src/isearch.c
+++ b/src/isearch.c
@@ -619,6 +619,16 @@ void isearch_input(int meta, int key)
619619 ///////////////////////////////////////////////////
620620 // インクリメンタルサーチ描写
621621 ///////////////////////////////////////////////////
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
622632 void isearch_view()
623633 {
624634 const int maxx = mgetmaxx();
@@ -644,4 +654,5 @@ void isearch_view()
644654 buf[i] = 0;
645655 printw(buf);
646656 }
657+#endif
647658
--- a/src/main.c
+++ b/src/main.c
@@ -280,6 +280,9 @@ void view()
280280 job_view();
281281
282282 isearch_view();
283+#if defined(__CYGWIN__)
284+ cmdline_view_filer();
285+#endif
283286 }
284287 else if(gActiveMenu) {
285288 filer_view(0);
@@ -341,7 +344,7 @@ static void atexit_fun()
341344 static void sig_winch(int s)
342345 {
343346 if(gMainLoop == -1) {
344- mclear_immediately(); // 画面の再描写
347+ xclear_immediately(); // 画面の再描写
345348 view();
346349 refresh();
347350 }
@@ -350,7 +353,7 @@ static void sig_winch(int s)
350353 static void sig_cont(int s)
351354 {
352355 if(gMainLoop == -1) {
353- mclear_immediately(); // 画面の再描写
356+ xclear_immediately(); // 画面の再描写
354357 view();
355358 refresh();
356359 }
@@ -908,7 +911,7 @@ int main(int argc, char* argv[])
908911 CHECKML_BEGIN(FALSE);
909912
910913 /// ファイラでもスクリプトでも共通の環境変数を初期化 ///
911- setenv("VERSION", "1.0.5a", 1);
914+ setenv("VERSION", "1.0.5b", 1);
912915 setenv("MFILER4_DATAROOTDIR", DATAROOTDIR, 1);
913916
914917 /// mfiler4のホームディレクトリを保存しておく ///
@@ -1133,7 +1136,7 @@ int main(int argc, char* argv[])
11331136
11341137 while(gMainLoop == -1) {
11351138 /// 描写 ///
1136- clear();
1139+ xclear();
11371140 view();
11381141 refresh();
11391142
--- a/src/menu.c
+++ b/src/menu.c
@@ -205,7 +205,7 @@ void menu_input(sMenu* self, int meta, int key)
205205 clear();
206206 }
207207 else if(key == 12) {// CTRL-L
208- mclear_immediately();
208+ xclear_immediately();
209209 }
210210 else {
211211 gActiveMenu = NULL;