本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: NPN_GetURL
NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
return NPNFuncs.geturl(instance, url, target);
}
示例5: NPN_GetURL
NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
NPError rv = NPNFuncs.geturl(instance, url, target);
return rv;
}
示例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);
}
示例7: doLoadFullSize
void StBrowserPlugin::doLoadFullSize() {
if(!myFullUrl.isEmpty() && NPNFuncs.geturl != NULL) {
myToLoadFull = true;
NPNFuncs.geturl(nppInstance, myFullUrl.toCString(), NULL);
}
}