⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ota.c

📁 WAP browser is based on the Wireless Application Protocol web browser, WAP1.3 will enable mobile pho
💻 C
📖 第 1 页 / 共 3 页
字号:
					width = TxtCharWidth(wmldck->strTable+j);
                	renderLn3(width,g);
                }
                wmldck->offset=startoffset;
                if (!attr){*/
                	renderLn(g);
                /*}
                wmldck->offset=startoffset;
                }
                }*/
	            attr = getAttributes(wmldck,END,g);
				break;
			case WML_img:
				attr = getAttributes(wmldck,WML_localsrc,g);
				if (attr){
				//we have a localsrc, img and alt should be blank
				}
				else {
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_src,g);
					if (attr) {
						renderImage(wmldck,attr,g);
					}
					else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_alt,g);
						if (attr) {
							//have attr
						}
					}
				}
				wmldck->offset=startoffset;
				if (isLink == true){//if image was embeded into a hyperlink then reset the hyperlink.
						WinSetTextColor( indexedColor );
	    				WinSetForeColor( indexedColor );
						WinSetUnderlineMode(grayUnderline);
				}
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_u:
				g->needSpace=1;
				underline(true);
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_em:
				g->needSpace=1;
				em(true);
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_b:
				g->needSpace=1;
				bold(true);
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_strong:
				g->needSpace=1;
				strong(true);
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_big:
				g->needSpace=1;
				big(true);
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_small:
				g->needSpace=1;
				small(true);
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_i:
				g->needSpace=1;
				italic(true);
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_prev:
				if (isLink == true){
					hyperLink(false,"","<PREV/>",g);
				}
				break;
			case WML_refresh:
				if (isLink == true){
					hyperLink(false,"","<REFRESH/>",g);
				}
				break;
			case WML_do:
				g->needSpace=1;
				isLink = true;
				attr = getAttributes(wmldck,WML_type,g);
				if (attr){
					hyperLink(true,NULL,NULL,g);
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_label,g);
					if (attr){
						drawDo (attr, g);
					} else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_name,g);
						if (attr){
							drawDo (attr, g);
						}  else {
							wmldck->offset=startoffset;
							attr = getAttributes(wmldck,WML_type,g);
							if (attr){
								drawDo (attr, g);
							} else {
								drawDo ("unknown", g);
							}
						}
					}
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,WML_type_options,g);
				if (attr){
					hyperLink(true,NULL,NULL,g);
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_label,g);
					if (attr){
						drawDo (attr, g);
					} else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_name,g);
						if (attr){
							drawDo (attr, g);
						} else {
							drawDo ("options", g);
						}
					}
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,WML_type_accept,g);
				if (attr){
					hyperLink(true,NULL,NULL,g);
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_label,g);
					if (attr){
						drawDo (attr, g);
					} else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_name,g);
						if (attr){
							drawDo (attr, g);
						} else {
							drawDo ("accept", g);
						}
					}
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,WML_type_prev,g);
				if (attr){
					hyperLink(true,NULL,NULL,g);
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_label,g);
					if (attr){
						drawDo (attr, g);
					} else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_name,g);
						if (attr){
							drawDo (attr, g);
						} else {
							drawDo ("prev", g);
						}
					}
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,WML_type_help,g);
				if (attr){
					hyperLink(true,NULL,NULL,g);
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_label,g);
					if (attr){
						drawDo (attr, g);
					} else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_name,g);
						if (attr){
							drawDo (attr, g);
						} else {
							drawDo ("help", g);
						}
					}
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,WML_type_reset,g);
				if (attr){
					hyperLink(true,NULL,NULL,g);
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_label,g);
					if (attr){
						drawDo (attr, g);
					} else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_name,g);
						if (attr){
							drawDo (attr, g);
						} else {
							drawDo ("reset", g);
						}
					}
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,WML_type_delete,g);
				if (attr){
					hyperLink(true,NULL,NULL,g);
					wmldck->offset=startoffset;
					attr = getAttributes(wmldck,WML_label,g);
					if (attr){
						drawDo (attr, g);
					} else {
						wmldck->offset=startoffset;
						attr = getAttributes(wmldck,WML_name,g);
						if (attr){
							drawDo (attr, g);
						} else {
							drawDo ("delete", g);
						}
					}
				}
				wmldck->offset=startoffset;
				/*attr = getAttributes(wmldck,WML_label,g);
				if (attr){
					WinPopDrawState();
					WinSetUnderlineMode(noUnderline);
					palmprintf("[", g);
					WinPushDrawState();
					WinSetTextColor( indexedColor );
    				WinSetForeColor( indexedColor );
					WinSetUnderlineMode(grayUnderline);
					palmprintf(attr, g);
					WinPopDrawState();
					WinSetUnderlineMode(noUnderline);
					palmprintf("]", g);
					WinPushDrawState();
				}
				wmldck->offset=startoffset;*/
				attr = getAttributes(wmldck,END,g);			
				break;				
			case WML_anchor:
				g->needSpace=1;
				isLink = true;
				isAnchor = true;
				
					hyperLink(true,NULL,NULL,g);
					
				/*if ( (attr = getAttributes(wmldck,WML_href_http,g))){
			    	hyperLink(true,"http://",attr,g);
				}else {
					wmldck->offset=startoffset;
	 				if ( (attr = getAttributes(wmldck,WML_href,g))){
				    	hyperLink(true,"",attr,g);				
					}else{
						wmldck->offset=startoffset;
	 				    if ( (attr = getAttributes(wmldck,WML_href_https,g))){
				    	    hyperLink(true,"https://",attr,g);				
					    }
					}
				}*/
				wmldck->offset=startoffset;
				if ( (attr = getAttributes(wmldck,WML_accesskey,g))){
				//This will come soon as we start to implement WML 1.2
				//There will be a function like: setAccessKey(unsigned char key, char URL);
					palmprintf("[", g);
					palmprintf(attr, g);
					palmprintf("]", g);
					palmprintf(": ", g);
					//setAccessKey(attr, g->HyperLinks->url);
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_noop:
				//Do not do anything. This is a "NO" "OP"eration.//Well, this is really not nothing
				if (isLink == true){
					hyperLink(false,"","<NOOP/>",g);
				}
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_go:
				isLink = true;
				if ( (attr = getAttributes(wmldck,WML_method_post,g))){
		        		/*g->HyperLinks->postBuf = Malloc(500);
		        		ErrFatalDisplayIf (!g->HyperLinks->postBuf, "Malloc Failed");*/
		        		g->post = true;
		        		g->HyperLinks->post = true;
		        		postStart = true;
				}
				else {
				wmldck->offset=startoffset;
					if ( (attr = getAttributes(wmldck,WML_method_get,g))){
			        		g->post = false;
					}
					else {
					wmldck->offset=startoffset;
						g->post = false;
					}
				}
				wmldck->offset=startoffset;
				if ( (attr = getAttributes(wmldck,WML_href_http,g))){
					if (g->onEvent == 1) {
					  if (needTimer == true) {
			    		if (wmldck->ontimerUrl)
							free(wmldck->ontimerUrl);
						wmldck->ontimerUrl = Malloc(StrLen(attr)+1);
						ErrFatalDisplayIf (!wmldck->ontimerUrl, "Malloc Failed");
						StrCopy(wmldck->ontimerUrl,attr);
						g->onEvent = 0;
					  }
					}
					else {
						if (g->onEvent == 2){
							//setHyperLinkUrl("http://", attr, g);
							//followLink(g->HyperLinks->url, g);
							//g->onEvent = 0;
							//return true;
						}
						else {
							if (g->onEvent == 3){
								palmWmlSelectOptionOnPick(attr, g);
							}
							else {
								hyperLink(false,"http://",attr,g);
							}
						}
					}

				}else {
					wmldck->offset=startoffset;
	 				if ( (attr = getAttributes(wmldck,WML_href,g))){
				    	if (g->onEvent == 1) {
				    	  if (needTimer == true) {
				    		if (wmldck->ontimerUrl)
								free(wmldck->ontimerUrl);
							wmldck->ontimerUrl = Malloc(StrLen(attr)+1);
							ErrFatalDisplayIf (!wmldck->ontimerUrl, "Malloc Failed");
							StrCopy(wmldck->ontimerUrl,attr);
							g->onEvent = 0;
						  }
						}
						else {
							if (g->onEvent == 2){
								//setHyperLinkUrl("", attr, g);
								//followLink(g->HyperLinks->url, g);
								//g->onEvent = 0;
								//return true;
							}
							else {
								if (g->onEvent == 3){
								palmWmlSelectOptionOnPick(attr, g);
								}
								else {
									hyperLink(false,"",attr,g);
								}
							}
						}
	
					}else{
						wmldck->offset=startoffset;
	 				    if ( (attr = getAttributes(wmldck,WML_href_https,g))){
				    	    if (g->onEvent == 1) {
				    	      if (needTimer == true) {
					    		if (wmldck->ontimerUrl)
									free(wmldck->ontimerUrl);
								wmldck->ontimerUrl = Malloc(StrLen(attr)+1);
								ErrFatalDisplayIf (!wmldck->ontimerUrl, "Malloc Failed");
								StrCopy(wmldck->ontimerUrl,attr);
								g->onEvent = 0;
							  }
							}
							else {
								if (g->onEvent == 2){
									//setHyperLinkUrl("https://", attr, g);
									//followLink(g->HyperLinks->url, g);
									//g->onEvent = 0;
									//return true;
								}
								else {
									if (g->onEvent == 3){
										palmWmlSelectOptionOnPick(attr, g);
									}
									else {
										hyperLink(false,"https://",attr,g);
									}
								}
							}
	
					    }
					    wmldck->offset=startoffset;
					}
				}
				wmldck->offset=startoffset;
				attr = getAttributes(wmldck,END,g);
				break;
			case WML_a:	
				g->needSpace=1;
				isLink = true;
				if ( (attr = getAttributes(wmldck,WML_href_http,g))){
			    	hyperLink(true,"http://",attr,g);
				}else {
					wmldck->offset=startoffset;
	 				if ( (attr = getAttributes(wmldck,WML_href,g))){
				    	hyperLink(true,"",attr,g);				
					}else{
						wmldck->offset=startoffset;
	 				    if ( (attr = getAttributes(wmldck,WML_href_https,g))){
				    	    hyperLink(true,"https://",attr,g);				
					    }
					}
				}
				wmldck->offset=startoffset;
				if ( (attr = getAttributes(wmldck,WML_accesskey,g))){
				//This will come soon as we start to implement WML 1.2
				//There will be a function like: setAccessKey(unsigned char key, char URL);
					palmprintf("[", g);
					palmprintf(attr, g);
					palmprintf("]", g);
					palmprintf(": ", g);
					//setAccessKey(attr, g->HyperLinks->url);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -