00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "tabview.h"
00015
00016 #include <stdlib.h>
00017 #include <qtabwidget.h>
00018 #include <qstringlist.h>
00019 #include <qlistbox.h>
00020 #include <qcursor.h>
00021 #include <qvgroupbox.h>
00022 #include <qlayout.h>
00023
00024 #include <kglobal.h>
00025 #include <klocale.h>
00026 #include <kaccel.h>
00027 #include <kio/netaccess.h>
00028 #include <kconfig.h>
00029 #include <kurl.h>
00030 #include <kurlrequesterdlg.h>
00031 #include <kstdaccel.h>
00032 #include <kaction.h>
00033 #include <kstdaction.h>
00034 #include <khtml_part.h>
00035 #include <khtmlview.h>
00036
00037 #include "mythtv/mythcontext.h"
00038 #include "mythtv/mythdbcon.h"
00039 #include "mythtv/mythwidgets.h"
00040 #include "mythtv/virtualkeyboard.h"
00041 #include "mythtv/mythdialogs.h"
00042
00043 using namespace std;
00044
00045 TabView::TabView(MythMainWindow *parent, const char *name, QStringList urls,
00046 int zoom, int width, int height, WFlags flags)
00047 :MythDialog(parent, name)
00048 {
00049 setNoErase();
00050 menuIsOpen = false;
00051 menu = NULL;
00052
00053 mytab = new QTabWidget(this);
00054 mytab->setGeometry(0, 0, width, height);
00055 QRect rect = mytab->childrenRect();
00056
00057 z = zoom;
00058 w = width;
00059 h = height - rect.height();
00060 f = flags;
00061
00062
00063
00064 lastButtonState = (ButtonState)0;
00065
00066 inputToggled = false;
00067 lastPosX = -1;
00068 lastPosY = -1;
00069 scrollSpeed = gContext->GetNumSetting("WebBrowserScrollSpeed", 4);
00070 scrollPage = gContext->GetNumSetting("WebBrowserScrollMode", 1);
00071 hideScrollbars = gContext->GetNumSetting("WebBrowserHideScrollbars", 0);
00072 if (scrollPage == 1)
00073 scrollSpeed *= -1;
00074
00075 urlHistory.setAutoDelete(true);
00076
00077 for (QStringList::Iterator it = urls.begin(); it != urls.end(); ++it)
00078 {
00079 WebPage *page = new WebPage(*it, z, f);
00080
00081 connect(page,SIGNAL(newUrlRequested(const KURL &,const KParts::URLArgs &)),
00082 this, SLOT(newUrlRequested(const KURL &,const KParts::URLArgs &)));
00083
00084 connect(page, SIGNAL(newWindowRequested( const KURL &, const KParts::URLArgs &,
00085 const KParts::WindowArgs &, KParts::ReadOnlyPart *&)),
00086 this, SLOT(newWindowRequested( const KURL &, const KParts::URLArgs &,
00087 const KParts::WindowArgs &, KParts::ReadOnlyPart *&)));
00088 connect(page, SIGNAL(pageCompleted(WebPage *)),
00089 this, SLOT(pageCompleted(WebPage *)));
00090
00091 mytab->addTab(page, tr("Loading..."));
00092
00093 QValueStack<QString> *currUrlHistory = new QValueStack<QString>;
00094 urlHistory.append(currUrlHistory);
00095 }
00096
00097
00098 connect(this, SIGNAL(menuPressed()), this, SLOT(openMenu()));
00099 connect(this, SIGNAL(closeMenu()), this, SLOT(cancelMenu()));
00100
00101 qApp->restoreOverrideCursor();
00102 qApp->installEventFilter(this);
00103 }
00104
00105 TabView::~TabView()
00106 {
00107 }
00108
00109 void TabView::pageCompleted(WebPage *page)
00110 {
00111
00112 QString title =
00113 page->browser->htmlDocument().title().string().stripWhiteSpace();
00114
00115 if (title.isEmpty())
00116 {
00117
00118
00119 mytab->setTabLabel(page,
00120 page->browser->toplevelURL().prettyURL(-1));
00121 }
00122 else
00123 {
00124
00125
00126 mytab->setTabLabel(page,
00127 title.replace( QRegExp("\\s+"), " ") );
00128 }
00129 }
00130
00131 void TabView::openMenu()
00132 {
00133 QButton *temp = NULL;
00134
00135 hadFocus = qApp->focusWidget();
00136
00137 menu = new MythPopupBox(GetMythMainWindow(), "popupMenu");
00138 menu->addLabel(tr("MythBrowser Menu"));
00139
00140 int index = mytab->currentPageIndex();
00141 QValueStack<QString> *curUrlHistory = urlHistory.at(index);
00142
00143 if (mytab->count() == 1)
00144 {
00145 if (curUrlHistory->size() > 0)
00146 temp = menu->addButton(tr("Back"), this, SLOT(actionBack()));
00147 }
00148 else
00149 {
00150 temp = menu->addButton(tr("Next Tab"), this, SLOT(actionNextTab()));
00151 menu->addButton(tr("Prev Tab"), this, SLOT(actionPrevTab()));
00152 menu->addButton(tr("Remove Tab"), this, SLOT(actionRemoveTab()));
00153 if (curUrlHistory->size() > 0)
00154 menu->addButton(tr("Back"), this, SLOT(actionBack()));
00155 }
00156
00157 if (temp)
00158 menu->addButton(tr("Save Link in Bookmarks"), this, SLOT(actionAddBookmark()));
00159 else
00160 temp = menu->addButton(tr("Save Link in Bookmarks"), this, SLOT(actionAddBookmark()));
00161
00162 menu->addButton(tr("Zoom Out"), this, SLOT(actionZoomOut()));
00163 menu->addButton(tr("Zoom In"), this, SLOT(actionZoomIn()));
00164
00165 temp->setFocus();
00166
00167 menu->ShowPopup(this, SLOT(cancelMenu()));
00168 menuIsOpen = true;
00169 }
00170
00171 void TabView::cancelMenu(void)
00172 {
00173 if (!menuIsOpen)
00174 return;
00175
00176 if (menu)
00177 {
00178 menu->deleteLater();
00179 menu = NULL;
00180 }
00181
00182 menuIsOpen = false;
00183
00184 if (hadFocus)
00185 hadFocus->setFocus();
00186 }
00187
00188 void TabView::handleMouseAction(QString action)
00189 {
00190 int step = 5;
00191
00192
00193 if (action == lastMouseAction &&
00194 lastMouseActionTime.msecsTo(QTime::currentTime()) < 500)
00195 {
00196 lastMouseActionTime = QTime::currentTime();
00197 mouseKeyCount++;
00198 if (mouseKeyCount > 5)
00199 step = 25;
00200 }
00201 else
00202 {
00203 lastMouseAction = action;
00204 lastMouseActionTime = QTime::currentTime();
00205 mouseKeyCount = 1;
00206 }
00207
00208 if (action == "MOUSEUP")
00209 {
00210 QPoint curPos = QCursor::pos();
00211 QCursor::setPos(curPos.x(), curPos.y() - step);
00212 }
00213 else if (action == "MOUSELEFT")
00214 {
00215 QPoint curPos = QCursor::pos();
00216 QCursor::setPos(curPos.x() - step, curPos.y());
00217 }
00218 else if (action == "MOUSERIGHT")
00219 {
00220 QPoint curPos = QCursor::pos();
00221 QCursor::setPos(curPos.x() + step, curPos.y());
00222 }
00223 else if (action == "MOUSEDOWN")
00224 {
00225 QPoint curPos = QCursor::pos();
00226 QCursor::setPos(curPos.x(), curPos.y() + step);
00227 }
00228 else if (action == "MOUSELEFTBUTTON")
00229 {
00230 QPoint curPos = mouse->pos();
00231 QWidget *widget = QApplication::widgetAt(curPos, TRUE);
00232
00233 if (widget)
00234 {
00235 curPos = widget->mapFromGlobal(curPos);
00236
00237 QMouseEvent *me = new QMouseEvent(QEvent::MouseButtonPress, curPos,
00238 Qt::LeftButton, Qt::LeftButton);
00239 QApplication::postEvent(widget, me);
00240
00241 me = new QMouseEvent(QEvent::MouseButtonRelease, curPos,
00242 Qt::LeftButton, Qt::NoButton);
00243 QApplication::postEvent(widget, me);
00244 }
00245 }
00246 }
00247
00248 void TabView::actionNextTab()
00249 {
00250 cancelMenu();
00251
00252 int nextpage = mytab->currentPageIndex() + 1;
00253 if(nextpage >= mytab->count())
00254 nextpage = 0;
00255 mytab->setCurrentPage(nextpage);
00256 }
00257
00258 void TabView::actionPrevTab()
00259 {
00260 cancelMenu();
00261
00262 int nextpage = mytab->currentPageIndex() - 1;
00263 if(nextpage < 0)
00264 nextpage = mytab->count() - 1;
00265 mytab->setCurrentPage(nextpage);
00266 }
00267
00268 void TabView::actionRemoveTab()
00269 {
00270 cancelMenu();
00271
00272
00273 if (mytab->count() <= 1)
00274 return;
00275
00276 int index = mytab->currentPageIndex();
00277
00278
00279 urlHistory.remove(index);
00280
00281
00282 QWidget *curr = mytab->currentPage();
00283 mytab->removePage(curr);
00284 delete curr;
00285
00286
00287 if (index >= mytab->count())
00288 index = mytab->count() - 1;
00289 mytab->setCurrentPage(index);
00290 }
00291
00292 void TabView::actionZoomOut()
00293 {
00294 cancelMenu();
00295
00296 ((WebPage*)mytab->currentPage())->zoomOut();
00297 }
00298
00299 void TabView::actionZoomIn()
00300 {
00301 cancelMenu();
00302
00303 ((WebPage*)mytab->currentPage())->zoomIn();
00304 }
00305
00306 void TabView::actionAddBookmark()
00307 {
00308 cancelMenu();
00309 hadFocus = qApp->focusWidget();
00310
00311 MythPopupBox *popup = new MythPopupBox(GetMythMainWindow(),
00312 "addbookmark_popup");
00313
00314 QLabel *caption = popup->addLabel(tr("Add New Bookmark"), MythPopupBox::Medium);
00315 caption->setAlignment(Qt::AlignCenter);
00316
00317 popup->addLabel(tr("Group:"), MythPopupBox::Small);
00318 MythRemoteLineEdit *group = new MythRemoteLineEdit(popup);
00319 popup->addWidget(group);
00320
00321 popup->addLabel(tr("Description:"), MythPopupBox::Small);
00322 MythRemoteLineEdit *desc = new MythRemoteLineEdit(popup);
00323 popup->addWidget(desc);
00324
00325 popup->addLabel(tr("URL:"), MythPopupBox::Small);
00326 MythRemoteLineEdit *url = new MythRemoteLineEdit(popup);
00327 url->setText(((WebPage*)mytab->currentPage())->browser->baseURL().htmlURL());
00328 popup->addWidget(url);
00329
00330 popup->addButton(tr("OK"), popup, SLOT(accept()));
00331 popup->addButton(tr("Cancel"), popup, SLOT(reject()));
00332
00333 qApp->removeEventFilter(this);
00334 DialogCode res = popup->ExecPopup();
00335 qApp->installEventFilter(this);
00336
00337 if (kDialogCodeAccepted == res)
00338 {
00339 QString sGroup = group->text();
00340 QString sDesc = desc->text();
00341 QString sUrl = url->text();
00342
00343 finishAddBookmark(sGroup, sDesc, sUrl);
00344 }
00345
00346 popup->deleteLater();
00347
00348 hadFocus->setFocus();
00349 }
00350
00351 void TabView::finishAddBookmark(const char* group, const char* desc, const char* url)
00352 {
00353 QString groupStr = QString(group);
00354 QString descStr = QString(desc);
00355 QString urlStr = QString(url);
00356 urlStr.stripWhiteSpace();
00357 if( !urlStr.startsWith("http://") && !urlStr.startsWith("https://") &&
00358 !urlStr.startsWith("file:/") )
00359 urlStr.prepend("http://");
00360
00361 if(groupStr.isEmpty() || urlStr.isEmpty())
00362 return;
00363
00364 urlStr.replace("&","&");
00365
00366 MSqlQuery query(MSqlQuery::InitCon());
00367 query.prepare("INSERT INTO websites (grp, dsc, url) VALUES(:GROUP, :DESC, :URL);");
00368 query.bindValue(":GROUP",groupStr.utf8());
00369 query.bindValue(":DESC",descStr.utf8());
00370 query.bindValue(":URL",urlStr.utf8());
00371 if (!query.exec()) {
00372 cerr << "MythBookmarksConfig: Error in inserting in DB" << endl;
00373 }
00374 }
00375
00376 void TabView::actionBack()
00377 {
00378 cancelMenu();
00379
00380 int index = mytab->currentPageIndex();
00381 QValueStack<QString> *curUrlHistory = urlHistory.at(index);
00382
00383 if (curUrlHistory->size() == 0)
00384 return;
00385
00386 ((WebPage*)mytab->currentPage())->openURL(curUrlHistory->pop());
00387 mytab->setTabLabel(mytab->currentPage(), tr("Loading..."));
00388 }
00389
00390 void TabView::showEnterURLDialog()
00391 {
00392 hadFocus = qApp->focusWidget();
00393
00394 MythPopupBox *popup = new MythPopupBox(GetMythMainWindow(), "enterURL");
00395 popup->addLabel(tr("Enter URL"));
00396
00397 MythRemoteLineEdit *editor = new MythRemoteLineEdit(popup);
00398 popup->addWidget(editor);
00399 editor->setFocus();
00400
00401 popup->addButton(tr("OK"), popup, SLOT(accept()));
00402 popup->addButton(tr("Cancel"), popup, SLOT(reject()));
00403
00404 qApp->removeEventFilter(this);
00405 DialogCode res = popup->ExecPopup();
00406 qApp->installEventFilter(this);
00407
00408 if (kDialogCodeAccepted == res)
00409 {
00410 QString sURL = editor->text();
00411 if (!sURL.startsWith("http://") && !sURL.startsWith("https://") &&
00412 !sURL.startsWith("file:/"))
00413 sURL = "http://" + sURL;
00414
00415 newPage(sURL);
00416 }
00417
00418 popup->deleteLater();
00419
00420 hadFocus->setFocus();
00421 }
00422
00423 void TabView::newPage(QString sURL)
00424 {
00425 int index = mytab->currentPageIndex();
00426
00427 WebPage *page = new WebPage(sURL,z,f);
00428
00429 connect(page,SIGNAL( newUrlRequested(const KURL &,const KParts::URLArgs&)),
00430 this, SLOT( newUrlRequested(const KURL &,const KParts::URLArgs &)));
00431
00432 connect(page, SIGNAL( newWindowRequested( const KURL &, const KParts::URLArgs &,
00433 const KParts::WindowArgs &, KParts::ReadOnlyPart *&) ),
00434 this, SLOT( newWindowRequested( const KURL &, const KParts::URLArgs &,
00435 const KParts::WindowArgs &, KParts::ReadOnlyPart *&) ) );
00436 connect(page, SIGNAL( pageCompleted(WebPage *) ),
00437 this, SLOT( pageCompleted(WebPage *) ) );
00438
00439 mytab->insertTab(page, tr("Loading..."), index);
00440 mytab->setCurrentPage(index);
00441
00442 QValueStack<QString> *currUrlHistory = new QValueStack<QString>;
00443 urlHistory.append(currUrlHistory);
00444
00445 hadFocus = page;
00446 }
00447
00448 void TabView::newUrlRequested(const KURL &url, const KParts::URLArgs &args)
00449 {
00450 (void) args;
00451
00452 int index = mytab->currentPageIndex();
00453
00454 if (mytab->tabLabel(mytab->currentPage()) == "")
00455 {
00456
00457
00458 ((WebPage*)mytab->currentPage())->openURL(url.url());
00459
00460 mytab->setTabLabel(mytab->currentPage(), tr("Loading..."));
00461
00462 connect(((WebPage*)mytab->currentPage()), SIGNAL( pageCompleted(WebPage *)),
00463 this, SLOT(pageCompleted(WebPage *)));
00464 }
00465 else
00466 {
00467 QValueStack<QString> *curUrlHistory = urlHistory.at(index);
00468
00469 ((WebPage*)mytab->currentPage())->browser->toplevelURL();
00470 curUrlHistory->push(((WebPage*)mytab->currentPage())->browser->toplevelURL().url());
00471
00472 ((WebPage*)mytab->currentPage())->openURL(url.url());
00473
00474 mytab->setTabLabel(mytab->currentPage(), tr("Loading..."));
00475 }
00476 }
00477
00478 void TabView::newWindowRequested(const KURL &, const KParts::URLArgs &,
00479 const KParts::WindowArgs &,
00480 KParts::ReadOnlyPart *&part)
00481 {
00482 newPage("");
00483 part = ((WebPage*)mytab->currentPage())->browser->currentFrame();
00484 }
00485
00486 bool TabView::eventFilter(QObject* object, QEvent* event)
00487 {
00488 object = object;
00489
00490 if (event->type() == QEvent::MouseButtonPress)
00491 {
00492 QMouseEvent* me = (QMouseEvent*)event;
00493
00494 lastButtonState = me->stateAfter();
00495 if (me->button() == Qt::RightButton)
00496 {
00497 if (menuIsOpen)
00498 emit closeMenu();
00499 else
00500 emit menuPressed();
00501 return true;
00502 }
00503 }
00504
00505 if (event->type() == QEvent::MouseButtonRelease)
00506 {
00507 QMouseEvent* me = (QMouseEvent*)event;
00508 lastButtonState = me->stateAfter();
00509 }
00510
00511 QScrollView *view=((WebPage*)mytab->currentPage())->browser->view();
00512 if (event->type() == QEvent::Show)
00513 {
00514
00515
00516
00517 if (hideScrollbars)
00518 {
00519 QScrollView *view=((WebPage*)mytab->currentPage())->browser->view();
00520 view->setVScrollBarMode(QScrollView::AlwaysOff);
00521 view->setHScrollBarMode(QScrollView::AlwaysOff);
00522 }
00523 }
00524
00525
00526 int deltax = 0, deltay = 0;
00527 if (event->type() == QEvent::MouseMove)
00528 {
00529 QMouseEvent* me = (QMouseEvent*)event;
00530 lastButtonState = me->stateAfter();
00531 deltax = me->globalX() - lastPosX;
00532 deltay = me->globalY() - lastPosY;
00533 deltax *= scrollSpeed;
00534 deltay *= scrollSpeed;
00535 if (lastPosX != -1
00536
00537 && (lastButtonState & (MidButton|AltButton))
00538 && !view->isHorizontalSliderPressed()
00539 && !view->isVerticalSliderPressed() )
00540 {
00541 view->scrollBy(deltax, deltay);
00542 }
00543 lastPosX = me->globalX();
00544 lastPosY = me->globalY();
00545 }
00546
00547
00548 if (event->type() == QEvent::Wheel)
00549 {
00550 QWheelEvent* we = (QWheelEvent*)event;
00551 if (lastButtonState & MidButton || we->state() & AltButton)
00552 {
00553 if (we->delta() > 0)
00554 {
00555 we->accept();
00556 ((WebPage*)mytab->currentPage())->zoomIn();
00557 return true;
00558 }
00559 else if (we->delta() < 0)
00560 {
00561 we->accept();
00562 ((WebPage*)mytab->currentPage())->zoomOut();
00563 return true;
00564 }
00565 }
00566 else if (we->orientation()==Qt::Horizontal)
00567 {
00568
00569 if (we->delta() > 0)
00570 {
00571 actionBack();
00572 return(true);
00573 }
00574 }
00575 }
00576
00577 if (menuIsOpen)
00578 return false;
00579
00580 if (event->type() == QEvent::KeyPress)
00581 {
00582 QKeyEvent* ke = (QKeyEvent*)event;
00583
00584 QKeyEvent tabKey(ke->type(), Key_Tab, '\t', ke->state(), QString::null,
00585 ke->isAutoRepeat(), ke->count());
00586
00587 QKeyEvent shiftTabKey(ke->type(), Key_Tab, '\t',
00588 ke->state()|Qt::ShiftButton,QString::null,
00589 ke->isAutoRepeat(), ke->count());
00590
00591 QKeyEvent returnKey(ke->type(), Key_Return, '\r', ke->state(),
00592 QString::null, ke->isAutoRepeat(), ke->count());
00593
00594 QStringList actions;
00595 GetMythMainWindow()->TranslateKeyPress("Browser", ke, actions);
00596
00597 bool handled = false;
00598 for (unsigned int i = 0; i < actions.size() && !handled; i++)
00599 {
00600 QString action = actions[i];
00601 handled = true;
00602
00603 if (action == "TOGGLEINPUT")
00604 {
00605 if (gContext->GetNumSetting("UseVirtualKeyboard", 1) == 1)
00606 {
00607 if (inputToggled)
00608 return true;
00609
00610 inputToggled = true;
00611 VirtualKeyboard *keyboard = new VirtualKeyboard(
00612 gContext->GetMainWindow(),
00613 ((WebPage*)mytab->currentPage())->browser->view());
00614 gContext->GetMainWindow()->detach(keyboard);
00615 keyboard->exec();
00616 keyboard->deleteLater();
00617
00618 inputToggled = false;
00619 }
00620 else
00621 {
00622 inputToggled = !inputToggled;
00623 }
00624
00625 return true;
00626 }
00627
00628
00629 if (inputToggled)
00630 return false;
00631
00632 if (action == "NEXTTAB")
00633 {
00634 actionNextTab();
00635 return true;
00636 }
00637 else if (action == "PREVTAB")
00638 {
00639 actionPrevTab();
00640 return true;
00641 }
00642 else if (action == "DELETETAB")
00643 {
00644 actionRemoveTab();
00645 return true;
00646 }
00647 else if (action == "BACK")
00648 {
00649 actionBack();
00650 return true;
00651 }
00652 else if (action == "FOLLOWLINK")
00653 {
00654 *ke = returnKey;
00655 }
00656 else if (action == "ZOOMIN")
00657 {
00658 actionZoomIn();
00659 return true;
00660 }
00661 else if (action == "ZOOMOUT")
00662 {
00663 actionZoomOut();
00664 return true;
00665 }
00666 else if (action == "MOUSEUP" || action == "MOUSEDOWN" ||
00667 action == "MOUSELEFT" || action == "MOUSERIGHT" ||
00668 action == "MOUSELEFTBUTTON") {
00669 handleMouseAction(action);
00670 return true;
00671 }
00672 else if (action == "PREVIOUSLINK")
00673 *ke = shiftTabKey;
00674 else if (action == "NEXTLINK")
00675 *ke = tabKey;
00676 else if (action == "ESCAPE")
00677 exit(0);
00678 else if (action == "INFO")
00679 {
00680 showEnterURLDialog();
00681 return true;
00682 }
00683 else if (action == "MENU")
00684 {
00685 emit menuPressed();
00686 return true;
00687 }
00688 else if (action == "UP")
00689 {
00690 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00691 view->scrollBy(0, -view->visibleHeight() / 10);
00692 return true;
00693 }
00694 else if (action == "DOWN")
00695 {
00696 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00697 view->scrollBy(0, view->visibleHeight() / 10);
00698 return true;
00699 }
00700 else if (action == "LEFT")
00701 {
00702 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00703 view->scrollBy(-view->visibleWidth() / 10, 0);
00704 return true;
00705 }
00706 else if (action == "RIGHT")
00707 {
00708 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00709 view->scrollBy(view->visibleWidth() / 10, 0);
00710 return true;
00711 }
00712 else if (action == "PAGEUP")
00713 {
00714 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00715 view->scrollBy(0, -view->visibleHeight() / 2);
00716 return true;
00717 }
00718 else if (action == "PAGEDOWN")
00719 {
00720 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00721 view->scrollBy(0, view->visibleHeight() / 2);
00722 return true;
00723 }
00724 else if (action == "PAGELEFT")
00725 {
00726 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00727 view->scrollBy(-view->visibleWidth() / 2, 0);
00728 return true;
00729 }
00730 else if (action == "PAGERIGHT")
00731 {
00732 KHTMLView *view = ((WebPage*)mytab->currentPage())->browser->view();
00733 view->scrollBy(view->visibleWidth() / 2, 0);
00734 return true;
00735 }
00736 }
00737 }
00738
00739 return false;
00740 }