当前位置: 首页>>代码示例>>C++>>正文


C++ Browser类代码示例

本文整理汇总了C++中Browser的典型用法代码示例。如果您正苦于以下问题:C++ Browser类的具体用法?C++ Browser怎么用?C++ Browser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Browser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pageControlCB

void Browser::pageControlCB(Widget w, XtPointer client, XtPointer )
{
    Browser *browser = (Browser *)client;
    int max;
    int value;
    int slider_size;

    if(browser->ignore_cb) return;

    theIBMApplication->setBusyCursor(TRUE);
    XtVaGetValues(w, 
		  XmNmaximum, &max,
		  XmNvalue, &value,
		  XmNsliderSize, &slider_size,
		  NULL);
    if(value == 0)
    {
	if(browser->prevPage())
	    browser->adjustScrollBar(False);
    }
    else if(value == (max - slider_size))
    {
	if(browser->nextPage())
	    browser->adjustScrollBar(True);
    }
    theIBMApplication->setBusyCursor(FALSE);
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:27,代码来源:Browser.C

示例2: main_message_loop

void ChromeMain::Run()
{
    base::EnableTerminationOnHeapCorruption();

    FilePath res_dll;
    PathService::Get(base::DIR_EXE, &res_dll);
    res_dll = res_dll.Append(L"wanui_res.dll");
    ui::ResourceBundle::InitSharedInstance(res_dll);

    MessageLoop main_message_loop(MessageLoop::TYPE_UI);
	
	process_init();
	CmdLineHandler::GetInstance()->handleCmd();

    // Show Main Window...
    Browser* chrome = Browser::Create();

	TabContentsWrapper* tabContent = 
		CmdLineHandler::GetInstance()->isLeaderStartWithCmd() ? chrome->AddTabWithGlobalCfg(true)
			: chrome->AddBlankTab(true);
    if (tabContent){
		chrome->window()->Show();
		view::AcceleratorHandler accelerator_handler;
		MessageLoopForUI::current()->Run(&accelerator_handler);
	}
	process_fini();
    ui::ResourceBundle::CleanupSharedInstance();
}
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:28,代码来源:chrome_main.cpp

示例3: motionCB

void Browser::motionCB(Widget , XtPointer client, XtPointer call)
{
XmTextVerifyCallbackStruct *cbs = (XmTextVerifyCallbackStruct *)call;
Browser *browser = (Browser *)client;

    browser->updateOffsets((unsigned long)cbs->newInsert);
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:7,代码来源:Browser.C

示例4: ThrowException

Handle<Value>
Browser::DoStart(const Arguments & args) {
    HandleScope scope;
    Browser * browser = ObjectWrap::Unwrap<Browser>(args.This());

    if ( 1 > args.Length() || ! args[0]->IsString()) {
        return ThrowException(Exception::Error(
                String::New("argument mismatch.")));
    }

    String::Utf8Value regtype(args[0]->ToString());

    DNSServiceFlags flags = 0;
    uint32_t interface_index = 0;
    char * domain = NULL;
    
    bool r = browser->DoStart(flags, interface_index, *regtype, domain);

    if (!r) {
        // XXX
        /*
        return ThrowException(Exception::Error(
            String::New(ad->ErrorMessage())));
        */
    }
    return Undefined();
}
开发者ID:createdotnet,项目名称:ipad-ardrone-controller,代码行数:27,代码来源:browser.cpp

示例5: gotoByteMarkOffsetCB

void Browser::gotoByteMarkOffsetCB(Widget w, XtPointer client, XtPointer)
{
    Browser *browser = (Browser *)client;
    XmTextPosition pos;

    theIBMApplication->setBusyCursor(TRUE);
    char *str = XmTextGetString(w);
    if(STRLEN(str) > 0)
    {
	pos = atoi(str) + browser->marker_pos;
    }
    else
    {
	theIBMApplication->setBusyCursor(FALSE);
	return;
    }
    if(!(pos >= browser->page_start) &&
	(pos < (browser->page_start + browser->page_size)) )
    {
	browser->page_start = browser->marker_pos - browser->page_size/2;
	if(browser->page_start + browser->page_size > browser->file_size)
	    browser->page_start = browser->file_size - browser->page_size;
	/*if(browser->page_start < 0) browser->page_start = 0;*/
	browser->loadBuffer(browser->page_start);
    }
    pos = pos - browser->page_start;
    XmTextShowPosition(browser->text, pos);
    XmTextSetInsertionPosition(browser->text, pos);

    theIBMApplication->setBusyCursor(FALSE);
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:31,代码来源:Browser.C

示例6: assert

    void Browser::resolve_callback(AvahiServiceResolver *r,
				   AvahiIfIndex,
				   AvahiProtocol,
				   AvahiResolverEvent event,
				   const char *name,
				   const char *type,
				   const char *,
				   const char *host_name,
				   const AvahiAddress *address,
				   uint16_t port,
				   AvahiStringList *txt,
				   AvahiLookupResultFlags,
				   void *data)
    {
	assert(data);
	Browser *browser = static_cast<Browser *>(data);
	assert(r);

	switch (event) {
	case AVAHI_RESOLVER_FAILURE:
	    //cerr << "[Resolver] Failed to resolve service '" << name << "' of type '" << type << "' in domain '" << domain
	    //	 << "': " << avahi_strerror(avahi_client_errno(avahi_service_resolver_get_client(r))) << endl;
	    break;

	case AVAHI_RESOLVER_FOUND:
	    //cerr << "[Resolver] Service '" << name << " (" << host_name << ":" << port << ")"
	    //     << "' of type '" << type <<"' in domain '" << domain << "'" << endl;

	    //cout << a->browse_services_.size() << endl;
	    browser->add_service(name, Service(type, host_name, address, port, txt));
	    // XXX cache service, broadcast

#if 0
            avahi_address_snprint(a, sizeof(a), address);
            t = avahi_string_list_to_string(txt);
            fprintf(stderr,
                    "\t%s:%u (%s)\n"
                    "\tTXT=%s\n"
                    "\tcookie is %u\n"
                    "\tis_local: %i\n"
                    "\tour_own: %i\n"
                    "\twide_area: %i\n"
                    "\tmulticast: %i\n"
                    "\tcached: %i\n",
                    host_name, port, a,
                    t,
                    avahi_string_list_get_service_cookie(txt),
                    !!(flags & AVAHI_LOOKUP_RESULT_LOCAL),
                    !!(flags & AVAHI_LOOKUP_RESULT_OUR_OWN),
                    !!(flags & AVAHI_LOOKUP_RESULT_WIDE_AREA),
                    !!(flags & AVAHI_LOOKUP_RESULT_MULTICAST),
                    !!(flags & AVAHI_LOOKUP_RESULT_CACHED));

            avahi_free(t);
#endif
	}

	avahi_service_resolver_free(r);
    }
开发者ID:mhaberler,项目名称:directoryd,代码行数:59,代码来源:Browser.cpp

示例7: AP_MSG_HANDLER_METHOD

AP_MSG_HANDLER_METHOD(BrowserInfoModule, Timer_Event)
{
  for (BrowserListNode* pNode = 0; (pNode = browsers_.Next(pNode)) != 0; ) {
    Browser* pBrowser = pNode->Value();
    if (pBrowser) {
      pBrowser->OnTimer();
    }
  }
}
开发者ID:wolfspelz,项目名称:Apollo,代码行数:9,代码来源:BrowserInfoModule.cpp

示例8: Browser

Handle<Value>
Browser::New(const Arguments & args) {
    HandleScope scope;

    Browser * browser = new Browser();
    browser->Wrap(args.This());

    return args.This();
}
开发者ID:createdotnet,项目名称:ipad-ardrone-controller,代码行数:9,代码来源:browser.cpp

示例9: main

int main(int c, char **v)
{
  QApplication app(c,v);

  Browser b;

  b.show();

  return app.exec();
}
开发者ID:krinkin,项目名称:qtrain,代码行数:10,代码来源:main.cpp

示例10:

void
Browser::on_service_changed(DNSServiceRef /*sdRef*/, DNSServiceFlags flags,
        uint32_t interface_index, DNSServiceErrorType errorCode,
        const char * serviceName, const char * regtype,
        const char * replyDomain, void * context)
{
    Browser * browser = static_cast<Browser*>(context);
    browser->on_service_changed(flags, interface_index, errorCode,
            serviceName, regtype, replyDomain);
}
开发者ID:createdotnet,项目名称:ipad-ardrone-controller,代码行数:10,代码来源:browser.cpp

示例11: pushService

 void pushService(Service *service) {
   lua_State *L = master_->dub_L;
   if (!master_->dub_pushcallback("browseCallback")) {
     // This is really bad...
     throw dub::Exception("'browseCallback' callback not set for mdns.Browser !");
   }
   // <func> <self>
   service->pushobject(L, service, "mdns.Service", true);
   // <func> <self> <service>
   master_->dub_call(2, 0);
   // The service will be garbage collected by Lua.
 }
开发者ID:johnjohndoe,项目名称:lubyk,代码行数:12,代码来源:Browser.cpp

示例12: NotifyAndTerminate

// static
void BrowserList::CloseAllBrowsers()
{
    bool session_ending =
        browser_shutdown::GetShutdownType() == browser_shutdown::END_SESSION;
    bool force_exit = false;
    // Tell everyone that we are shutting down.
    browser_shutdown::SetTryingToQuit(true);

    // Before we close the browsers shutdown all session services. That way an
    // exit can restore all browsers open before exiting.
    //ProfileManager::ShutdownSessionServices();

    // If there are no browsers, send the APP_TERMINATING action here. Otherwise,
    // it will be sent by RemoveBrowser() when the last browser has closed.
    if(force_exit || browsers_.empty())
    {
        NotifyAndTerminate(true);
        return;
    }
    for(BrowserList::const_iterator i=BrowserList::begin();
        i!=BrowserList::end();)
    {
        Browser* browser = *i;
        browser->window()->Close();
        if(!session_ending)
        {
            ++i;
        }
        else
        {
            // This path is hit during logoff/power-down. In this case we won't get
            // a final message and so we force the browser to be deleted.
            // Close doesn't immediately destroy the browser
            // (Browser::TabStripEmpty() uses invoke later) but when we're ending the
            // session we need to make sure the browser is destroyed now. So, invoke
            // DestroyBrowser to make sure the browser is deleted and cleanup can
            // happen.
            while(browser->tab_count())
            {
                delete browser->GetTabContentsWrapperAt(0);
            }
            browser->window()->DestroyBrowser();
            i = BrowserList::begin();
            if(i!=BrowserList::end() && browser==*i)
            {
                // Destroying the browser should have removed it from the browser list.
                // We should never get here.
                NOTREACHED();
                return;
            }
        }
    }
}
开发者ID:noodle1983,项目名称:putty-nd3.x,代码行数:54,代码来源:browser_list.cpp

示例13: FindBrowserWithWindow

// static
Browser* BrowserList::FindBrowserWithWindow(HWND window)
{
    for(BrowserList::const_iterator it=BrowserList::begin();
        it!=BrowserList::end(); ++it)
    {
        Browser* browser = *it;
        if(browser->window() && browser->window()->GetNativeHandle()==window)
        {
            return browser;
        }
    }
    return NULL;
}
开发者ID:noodle1983,项目名称:putty-nd3.x,代码行数:14,代码来源:browser_list.cpp

示例14: gotoLineMarkOffsetCB

void Browser::gotoLineMarkOffsetCB(Widget w, XtPointer client, XtPointer)
{
    Browser *browser = (Browser *)client;
    unsigned long line_num;

    theIBMApplication->setBusyCursor(TRUE);
    char *str = XmTextGetString(w);
    if(STRLEN(str) > 0)
	line_num = atoi(str) + browser->marker_line_no;
    else
	return;
    browser->gotoLine(line_num);
    theIBMApplication->setBusyCursor(FALSE);
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:14,代码来源:Browser.C

示例15: FindBrowserByContext

Browser* BrowserInfoModule::FindBrowserByContext(const ApHandle& hContext)
{
  Browser* pResult = 0;

  for (BrowserListNode* pNode = 0; (pNode = browsers_.Next(pNode)) != 0; ) {
    Browser* pBrowser = pNode->Value();
    if (pBrowser->HasContext(hContext)) {
      pResult = pBrowser;
      break;
    }
  }

  return pResult;
}
开发者ID:wolfspelz,项目名称:Apollo,代码行数:14,代码来源:BrowserInfoModule.cpp


注:本文中的Browser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。