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


C++ NPNetscapeFuncs::geturl方法代码示例

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


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

示例1: init

bool StBrowserPlugin::init(NPWindow* theWindow) {
    if(theWindow == NULL || theWindow->window == NULL) {
#ifdef _WIN32
        if(myProcOrig  != NULL
                && myParentWin != NULL) {
            SetWindowLongPtr(myParentWin, GWLP_WNDPROC,  (LONG_PTR )myProcOrig);
            SetWindowLongPtr(myParentWin, GWLP_USERDATA, NULL);
            myProcOrig = NULL;
        }
#endif
        return false;
    }

    myParentWin = (StNativeWin_t )theWindow->window;
#ifdef _WIN32
    if(GetWindowLongPtr(myParentWin, GWLP_USERDATA) == NULL) {
        myProcOrig = (WNDPROC )GetWindowLongPtr(myParentWin, GWLP_WNDPROC);
        SetWindowLongPtr(myParentWin, GWLP_WNDPROC,  (LONG_PTR )stWndProcWrapper);
        SetWindowLongPtr(myParentWin, GWLP_USERDATA, (LONG_PTR )this);
    }
#endif
    myThread = new StThread(stThreadFunction, this, "StBrowserPlugin");

    if(!myPreviewUrl.isEmpty() && NPNFuncs.geturl != NULL) {
        NPNFuncs.geturl(nppInstance, myPreviewUrl.toCString(), NULL);
    }

    return true;
}
开发者ID:gkv311,项目名称:sview,代码行数:29,代码来源:StBrowserPlugin.cpp

示例2: MyNPN_GetURL

static
NPError MyNPN_GetURL(NPP instance, const char* url,
               const char* target)
{
	NPError err;	
	DEB(ef, "-> NPN_GetURL( %x, %s, %s )\n", instance, url, target );	
	
	err = gNetscapeFuncs.geturl( instance, url, target );		
	DEB(ef, "<- NPN_GetURL = %d\n", err);
	return err;
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:11,代码来源:wrapper.c

示例3: NPN_GetURL

NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
    if(logger)
        logger->logCall(action_npn_get_url, (DWORD)instance, (DWORD)url, (DWORD)target);

    NPError rv = NPNFuncs.geturl(instance, url, target);

    if(logger)
        logger->logReturn();

    return rv;
}
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:12,代码来源:npn_gate.cpp

示例4: NPN_GetURL

NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
  return NPNFuncs.geturl(instance, url, target);
}
开发者ID:gfunkmonk2,项目名称:mate-movie-player,代码行数:4,代码来源:idolNPNGlue.cpp

示例5: NPN_GetURL

NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
    NPError rv = NPNFuncs.geturl(instance, url, target);
    return rv;
}
开发者ID:Acidburn0zzz,项目名称:gecko-mediaplayer,代码行数:5,代码来源:npn_gate.cpp

示例6: PluginWndProc

LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
    NPP instance = (NPP)GetWindowLongPtr(hWnd, GWLP_USERDATA);
    
    if (uiMsg == WM_PAINT)
    {
        InstanceData *data = (InstanceData *)instance->pdata;
        
        PAINTSTRUCT ps;
        HDC hDC = BeginPaint(hWnd, &ps);
        HBRUSH brushBg = CreateSolidBrush(COL_WINDOW_BG);
        HFONT hFont = GetSimpleFont(hDC, L"MS Shell Dlg", 14);
        bool isRtL = IsLanguageRtL(gTranslationIdx);
        
        // set up double buffering
        RectI rcClient = ClientRect(hWnd);
        DoubleBuffer buffer(hWnd, rcClient);
        HDC hDCBuffer = buffer.GetDC();
        
        // display message centered in the window
        RECT rectClient = rcClient.ToRECT();
        FillRect(hDCBuffer, &rectClient, brushBg);
        hFont = (HFONT)SelectObject(hDCBuffer, hFont);
        SetTextColor(hDCBuffer, RGB(0, 0, 0));
        SetBkMode(hDCBuffer, TRANSPARENT);
        DrawCenteredText(hDCBuffer, rcClient, data->message, isRtL);
        
        // draw a progress bar, if a download is in progress
        if (0 < data->progress && data->progress <= 1)
        {
            SIZE msgSize;
            RectI rcProgress = rcClient;
            
            HBRUSH brushProgress = CreateSolidBrush(RGB(0x80, 0x80, 0xff));
            GetTextExtentPoint32(hDCBuffer, data->message, (int)str::Len(data->message), &msgSize);
            rcProgress.Inflate(-(rcProgress.dx - msgSize.cx) / 2, -(rcProgress.dy - msgSize.cy) / 2 + 2);
            rcProgress.Offset(0, msgSize.cy + 4 + 2);
            RECT rectProgress = rcProgress.ToRECT();
            FillRect(hDCBuffer, &rectProgress, GetStockBrush(WHITE_BRUSH));
            RectI rcProgressAll = rcProgress;
            rcProgress.dx = (int)(data->progress * rcProgress.dx);
            rectProgress = rcProgress.ToRECT();
            FillRect(hDCBuffer, &rectProgress, brushProgress);
            DeleteObject(brushProgress);
            
            ScopedMem<WCHAR> currSize(FormatSizeSuccint(data->currSize));
            if (0 == data->totalSize || data->currSize > data->totalSize)
            {
                // total size unknown or bogus => show just the current size
                DrawCenteredText(hDCBuffer, rcProgressAll, currSize, isRtL);
            }
            else
            {
                ScopedMem<WCHAR> totalSize(FormatSizeSuccint(data->totalSize));
                ScopedMem<WCHAR> s(str::Format(_TR("%s of %s"), currSize, totalSize));
                DrawCenteredText(hDCBuffer, rcProgressAll, s, isRtL);
            }
        }
        
        // draw the buffer on screen
        buffer.Flush(hDC);
        
        DeleteObject(SelectObject(hDCBuffer, hFont));
        DeleteObject(brushBg);
        EndPaint(hWnd, &ps);
        
        HWND hChild = FindWindowEx(hWnd, NULL, NULL, NULL);
        if (hChild)
            InvalidateRect(hChild, NULL, FALSE);
    }
    else if (uiMsg == WM_SIZE)
    {
        HWND hChild = FindWindowEx(hWnd, NULL, NULL, NULL);
        if (hChild)
        {
            ClientRect rcClient(hWnd);
            MoveWindow(hChild, rcClient.x, rcClient.y, rcClient.dx, rcClient.dy, FALSE);
        }
    }
    else if (uiMsg == WM_COPYDATA)
    {
        COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam;
        if (cds && 0x4C5255 /* URL */ == cds->dwData)
        {
            plogf("sp: NPN_GetURL %s", cds->dwData, (const char *)cds->lpData);
            gNPNFuncs.geturl(instance, (const char *)cds->lpData, "_blank");
            return TRUE;
        }
    }
    
    return DefWindowProc(hWnd, uiMsg, wParam, lParam);
}
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:92,代码来源:npPdfViewer.cpp

示例7: doLoadFullSize

void StBrowserPlugin::doLoadFullSize() {
    if(!myFullUrl.isEmpty() && NPNFuncs.geturl != NULL) {
        myToLoadFull = true;
        NPNFuncs.geturl(nppInstance, myFullUrl.toCString(), NULL);
    }
}
开发者ID:gkv311,项目名称:sview,代码行数:6,代码来源:StBrowserPlugin.cpp


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