• R/O
  • SSH
  • HTTPS

owata: Commit


Commit MetaInfo

Revision17 (tree)
Time2008-02-26 17:24:21
Authorbird_may_nike

Log Message

送信フォームに自動レスアンカー。メニューにLAN切断追加。

Change Summary

Incremental Difference

--- trunc/src/psp2ch.c (revision 16)
+++ trunc/src/psp2ch.c (revision 17)
@@ -35,7 +35,7 @@
3535
3636 int tateFlag = 0;
3737 int sel = 0;
38-const char* userAgent = "Monazilla/1.00 (Compatible; PSP; ja) owata\(^o^)/0.5.0";
38+const char* userAgent = "Monazilla/1.00 (Compatible; PSP; ja) owata\(^o^)/0.5.1";
3939 const char* logDir = "log";
4040 char cookie[128] = {0};
4141 char keyWords[128];
@@ -325,6 +325,11 @@
325325 return rMenu;
326326 }
327327
328+/*****************************
329+アナログパッドで横スクロール
330+xReverseを-1にするとスクロール方向が反転する
331+設定ファイル実装時に設定項目とする予定
332+*****************************/
328333 int psp2chPadSet(int scrollX)
329334 {
330335 static int xReverse = 1;
@@ -478,7 +483,7 @@
478483 setColor("MENU_WIN_TEXT", menuWinColor.text, GRAY);
479484 setColor("MENU_WIN_BG", menuWinColor.bg, BLACK);
480485 setColor("MENU_WIN_S_TEXT", menuWinColor.s_text, WHITE);
481- setColor("MENU_WIN_S_BG", menuWinColor.s_bg, RGB(0x33, 0x33, 0x33));
486+ setColor("MENU_WIN_S_BG", menuWinColor.s_bg, BLUE);
482487 free(buf);
483488 return;
484489 }
@@ -564,7 +569,7 @@
564569 menuWinColor.text = GRAY;
565570 menuWinColor.bg = BLACK;
566571 menuWinColor.s_text = WHITE;
567- menuWinColor.s_bg = RGB(0x33, 0x33, 0x33);
572+ menuWinColor.s_bg = BLUE;
568573 }
569574
570575 /***********************************
--- trunc/src/psp2chRes.c (revision 16)
+++ trunc/src/psp2chRes.c (revision 17)
@@ -50,9 +50,11 @@
5050 S_2CH_URL_ANCHOR urlAnchor[50];
5151 S_2CH_RES_ANCHOR resAnchor[50];
5252 S_2CH_ID_ANCHOR idAnchor[40];
53+S_2CH_NUM_ANCHOR numAnchor[40];
5354 int urlAnchorCount = 0;
5455 int resAnchorCount = 0;
5556 int idAnchorCount = 0;
57+int numAnchorCount = 0;
5658
5759 static char jmpHost[32], jmpDir[32], jmpTitle[32];
5860 static int jmpDat;
@@ -86,7 +88,7 @@
8688 char *p, *q;
8789 static char* menuStr = "";
8890 int i, j, tmp;
89- static int resMenu = -1, urlMenu = -1, idMenu = -1;
91+ static int resMenu = -1, urlMenu = -1, idMenu = -1, numMenu = -1;
9092 int lineEnd, rMenu;
9193
9294 if (tateFlag)
@@ -248,6 +250,10 @@
248250 sceCtrlPeekBufferPositive(&oldPad, 1);
249251 return 0;
250252 }
253+ if (numMenu >= 0 && message[0] == '\0')
254+ {
255+ sprintf(message, ">>%d\n", numAnchor[numMenu].num + 1);
256+ }
251257 if (psp2chForm(host, dir, dat, resList[0].title, message) == 1)
252258 {
253259 free(message);
@@ -400,6 +406,20 @@
400406 idMenu = -1;
401407 }
402408 }
409+ // 番号の場所か
410+ for (i = 0; i < 40; i++)
411+ {
412+ if (cursorY/LINE_PITCH+res.start == numAnchor[i].line &&
413+ cursorX > numAnchor[i].x1 && cursorX < numAnchor[i].x2)
414+ {
415+ numMenu = i;
416+ break;
417+ }
418+ else
419+ {
420+ numMenu = -1;
421+ }
422+ }
403423 if (resMenu >= 0)
404424 {
405425 menuStr = " ○ : レス表\示   △ : レスに移動";
@@ -412,6 +432,10 @@
412432 {
413433 menuStr = " ○ : ID抽出   □ : NGID登録";
414434 }
435+ else if (numMenu >= 0)
436+ {
437+ menuStr = " ○ : レスをする";
438+ }
415439 else if (rMenu)
416440 {
417441 // お気に入りリストにあるかチェック
@@ -638,7 +662,7 @@
638662 else
639663 {
640664 dL = 16;
641- dS = 8;
665+ dS = 2;
642666 }
643667 if (tateFlag)
644668 {
@@ -1283,6 +1307,9 @@
12831307 pgCursorX = startX;
12841308 if (--(*skip) == 0)
12851309 {
1310+ numAnchor[numAnchorCount].x1 = pgCursorX;
1311+ numAnchor[numAnchorCount].line = *drawLine;
1312+ numAnchor[numAnchorCount].num = resList[re].num;
12861313 pgFillvram(c.bg, startX, pgCursorY, endX-startX, LINE_PITCH);
12871314 line = psp2chDrawResStr(str, c, line, lineEnd, startX, endX, drawLine);
12881315 break;
@@ -1291,9 +1318,18 @@
12911318 }
12921319 else
12931320 {
1321+ numAnchor[numAnchorCount].x1 = pgCursorX;
1322+ numAnchor[numAnchorCount].line = *drawLine;
1323+ numAnchor[numAnchorCount].num = resList[re].num;
12941324 pgFillvram(c.bg, startX, pgCursorY, endX-startX, LINE_PITCH);
12951325 line = psp2chDrawResStr(str, c, line, lineEnd, startX, endX, drawLine);
12961326 }
1327+ numAnchor[numAnchorCount].x2 = pgCursorX;
1328+ numAnchorCount++;
1329+ if (numAnchorCount >= 40)
1330+ {
1331+ numAnchorCount = 0;
1332+ }
12971333 sprintf(buf, "名前:");
12981334 str = buf;
12991335 c.text = hc.name1;
@@ -1395,7 +1431,7 @@
13951431 c.text = hc.id1;
13961432 for (i = 0, j = 0; i < res.count; i++)
13971433 {
1398- if (resList[i].id && (strcmp(resList[i].id, resList[re].id) == 0))
1434+ if (resList[i].id && resList[i].id[0] != '?' && (strcmp(resList[i].id, resList[re].id) == 0))
13991435 {
14001436 if (++j == ID_COUNT)
14011437 {
@@ -1685,6 +1721,8 @@
16851721 {
16861722 idAnchor[i].x1 = 0;
16871723 idAnchor[i].x2 = 0;
1724+ numAnchor[i].x1 = 0;
1725+ numAnchor[i].x2 = 0;
16881726 }
16891727 line = 0;
16901728 while (line <= lineEnd)
--- trunc/src/psp2chRes.h (revision 16)
+++ trunc/src/psp2chRes.h (revision 17)
@@ -51,6 +51,13 @@
5151 char id[12];
5252 } S_2CH_ID_ANCHOR;
5353
54+typedef struct {
55+ int x1;
56+ int x2;
57+ int line;
58+ int num;
59+} S_2CH_NUM_ANCHOR;
60+
5461 int psp2chFavoriteRes(int ret);
5562 int psp2chThreadRes(int ret);
5663 int psp2chJumpRes(int ret);
--- trunc/src/psp2chMenu.c (revision 16)
+++ trunc/src/psp2chMenu.c (revision 17)
@@ -39,7 +39,7 @@
3939 #define MENU_ITEM (4)
4040 int psp2chMenu(int pixelsX, int pixelsY)
4141 {
42- const char* menuList[] = {"NG設定"};
42+ const char* menuList[] = {"NG 設定", "LAN 切断"};
4343 static char* menuStr = "";
4444 int lineEnd;
4545 static S_2CH_SCREEN menu;
@@ -57,7 +57,7 @@
5757 scrX = MENU_WIDTH;
5858 scrY = MENU_HEIGHT;
5959 lineEnd = MENU_ITEM;
60- menu.count = 1;
60+ menu.count = 2;
6161 printBuf = winPixels;
6262 while (running)
6363 {
@@ -75,6 +75,7 @@
7575 psp2chMenuNG(pixelsX, pixelsY);
7676 break;
7777 case 1:
78+ sceNetApctlDisconnect();
7879 break;
7980 }
8081 printBuf = pixels;
@@ -192,7 +193,8 @@
192193 }
193194
194195 /****************
195-NGファイルがあればバッファを確保し読み込んで返す
196+NGファイルがあればバッファを確保し
197+ファイル内容を読み込んで返す
196198 ****************/
197199 char* psp2chGetNGBuf(const char* file, char* buf)
198200 {
Show on old repository browser