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


C++ Manager函数代码示例

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


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

示例1: m

void Transfer::ret_status(const Uuid& tranId, unsigned int step, int status)
{
	//
	P_STATUS data;
	data.status = status;

	//
	Message m(TRANSFER_RET_STATUS, sizeof(data), &data);

	//
	Manager()->Result(tranId, step, Id(), &m);

}
开发者ID:zzilla,项目名称:Homework,代码行数:13,代码来源:Transfer.cpp

示例2: NS_ENSURE_TRUE

NS_IMETHODIMP
SmsRequestParent::NotifySendMessageFailed(int32_t aError, nsISupports *aMessage)
{
  NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);

  ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager());
  MobileMessageData data;
  if (!GetMobileMessageDataFromMessage(parent, aMessage, data)) {
    return SendReply(ReplyMessageSendFail(aError, OptionalMobileMessageData(void_t())));
  }

  return SendReply(ReplyMessageSendFail(aError, OptionalMobileMessageData(data)));
}
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:13,代码来源:SmsParent.cpp

示例3: gfxRect

gfxRect
ThebesLayerComposite::GetCompositionBounds()
{
  // Walk up the tree, looking for a display-port - if we find one, we know
  // that this layer represents a content node and we can use its first
  // scrollable child, in conjunction with its content area and viewport offset
  // to establish the screen coordinates to which the content area will be
  // rendered.
  gfxRect compositionBounds;
  ContainerLayer* scrollableLayer = nullptr;
  for (ContainerLayer* parent = GetParent(); parent; parent = parent->GetParent()) {
    const FrameMetrics& parentMetrics = parent->GetFrameMetrics();
    if (parentMetrics.IsScrollable())
      scrollableLayer = parent;
    if (!parentMetrics.mDisplayPort.IsEmpty() && scrollableLayer) {
      // Get the composition bounds, so as not to waste rendering time.
      compositionBounds = gfxRect(parentMetrics.mCompositionBounds.x,
                                  parentMetrics.mCompositionBounds.y,
                                  parentMetrics.mCompositionBounds.width,
                                  parentMetrics.mCompositionBounds.height);

      // Calculate the scale transform applied to the root layer to determine
      // the content resolution.
      Layer* rootLayer = Manager()->GetRoot();
      const gfx3DMatrix& rootTransform = rootLayer->GetTransform();
      LayerToCSSScale scale(rootTransform.GetXScale(),
                            rootTransform.GetYScale());

      // Get the content document bounds, in screen-space.
      const FrameMetrics& metrics = scrollableLayer->GetFrameMetrics();
      const LayerIntRect content = RoundedToInt(metrics.mScrollableRect / scale);
      // !!! WTF. this code is just wrong. See bug 881451.
      gfx::Point scrollOffset =
        gfx::Point((metrics.mScrollOffset.x * metrics.LayersPixelsPerCSSPixel().scale) / scale.scale,
                   (metrics.mScrollOffset.y * metrics.LayersPixelsPerCSSPixel().scale) / scale.scale);
      const nsIntPoint contentOrigin(
        content.x - NS_lround(scrollOffset.x),
        content.y - NS_lround(scrollOffset.y));
      gfxRect contentRect = gfxRect(contentOrigin.x, contentOrigin.y,
                                    content.width, content.height);
      gfxRect contentBounds = scrollableLayer->GetEffectiveTransform().
        TransformBounds(contentRect);

      // Clip the composition bounds to the content bounds
      compositionBounds.IntersectRect(compositionBounds, contentBounds);
      break;
    }
  }

  return compositionBounds;
}
开发者ID:matyapiro31,项目名称:instantbird-1.5,代码行数:51,代码来源:ThebesLayerComposite.cpp

示例4: OuterDocOfRemoteBrowser

void
DocAccessibleParent::MaybeInitWindowEmulation()
{
  if (!nsWinUtils::IsWindowEmulationStarted()) {
    return;
  }

  // XXX get the bounds from the tabParent instead of poking at accessibles
  // which might not exist yet.
  Accessible* outerDoc = OuterDocOfRemoteBrowser();
  if (!outerDoc) {
    return;
  }

  RootAccessible* rootDocument = outerDoc->RootAccessible();
  MOZ_ASSERT(rootDocument);

  bool isActive = true;
  nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0);
  if (Compatibility::IsDolphin()) {
    rect = Bounds();
    nsIntRect rootRect = rootDocument->Bounds();
    rect.x = rootRect.x - rect.x;
    rect.y -= rootRect.y;

    auto tab = static_cast<dom::TabParent*>(Manager());
    tab->GetDocShellIsActive(&isActive);
  }

  IAccessibleHolder hWndAccHolder;
  HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow());
  HWND hWnd = nsWinUtils::CreateNativeWindow(kClassNameTabContent,
                                             parentWnd, rect.x, rect.y,
                                             rect.width, rect.height,
                                             isActive);
  if (hWnd) {
    // Attach accessible document to the emulated native window
    ::SetPropW(hWnd, kPropNameDocAccParent, (HANDLE)this);
    SetEmulatedWindowHandle(hWnd);
    IAccessible* rawHWNDAcc = nullptr;
    if (SUCCEEDED(::AccessibleObjectFromWindow(hWnd, OBJID_WINDOW,
                                               IID_IAccessible,
                                               (void**)&rawHWNDAcc))) {
      hWndAccHolder.Set(IAccessibleHolder::COMPtrType(rawHWNDAcc));
    }
  }

  Unused << SendEmulatedWindow(reinterpret_cast<uintptr_t>(mEmulatedWindowHandle),
                               hWndAccHolder);
}
开发者ID:jorendorff,项目名称:gecko-dev,代码行数:50,代码来源:DocAccessibleParent.cpp

示例5: Destroy

mozilla::ipc::IPCResult
DocAccessibleParent::RecvShutdown()
{
  Destroy();

  auto mgr = static_cast<dom::TabParent*>(Manager());
  if (!mgr->IsDestroyed()) {
    if (!PDocAccessibleParent::Send__delete__(this)) {
      return IPC_FAIL_NO_REASON(mgr);
    }
  }

  return IPC_OK();
}
开发者ID:jorendorff,项目名称:gecko-dev,代码行数:14,代码来源:DocAccessibleParent.cpp

示例6: FireInteralError

bool
TCPSocketParent::RecvOpen(const nsString& aHost, const uint16_t& aPort, const bool& aUseSSL,
                          const nsString& aBinaryType)
{
  // We don't have browser actors in xpcshell, and hence can't run automated
  // tests without this loophole.
  if (net::UsingNeckoIPCSecurity() &&
      !AssertAppProcessPermission(Manager()->Manager(), "tcp-socket")) {
    FireInteralError(this, __LINE__);
    return true;
  }

  // Obtain App ID
  uint32_t appId = nsIScriptSecurityManager::NO_APP_ID;
  const PContentParent *content = Manager()->Manager();
  const InfallibleTArray<PBrowserParent*>& browsers = content->ManagedPBrowserParent();
  if (browsers.Length() > 0) {
    TabParent *tab = static_cast<TabParent*>(browsers[0]);
    appId = tab->OwnAppId();
  }

  nsresult rv;
  mIntermediary = do_CreateInstance("@mozilla.org/tcp-socket-intermediary;1", &rv);
  if (NS_FAILED(rv)) {
    FireInteralError(this, __LINE__);
    return true;
  }

  rv = mIntermediary->Open(this, aHost, aPort, aUseSSL, aBinaryType, appId,
                           getter_AddRefs(mSocket));
  if (NS_FAILED(rv) || !mSocket) {
    FireInteralError(this, __LINE__);
    return true;
  }

  return true;
}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:37,代码来源:TCPSocketParent.cpp

示例7: UNREFERENCED_PARAMETER

void ErrorPopUpScreen::Draw(float totalTime, float elapsedTime)
{
    UNREFERENCED_PARAMETER(totalTime);
    UNREFERENCED_PARAMETER(elapsedTime);

    auto screenManager = Manager();
    auto spriteBatch = screenManager->GetSpriteBatch();
    auto spriteFont = screenManager->GetSpriteFont();
    auto blendStates = screenManager->GetCommonStates();
    auto viewportBounds = screenManager->GetScreenBounds();
    float viewportWidth = float(viewportBounds.right);
    float viewportHeight = float(viewportBounds.bottom);
    auto scaleMatrix = DX::GetScaleMatrixForWindow(screenManager->GetWindowBounds());

    // calculate position and size of error message
    XMFLOAT2 errorMsgPosition = XMFLOAT2(0, viewportHeight / 2.0f);
    XMVECTORF32 errorMsgColor = Colors::Yellow;
    XMFLOAT2 origin = XMFLOAT2(0, spriteFont->GetLineSpacing() / 2.0f);
    XMVECTOR size = spriteFont->MeasureString(m_errorMessage.c_str());
    errorMsgPosition.x = viewportWidth / 2.0f - XMVectorGetX(size) / 2.0f;

    // create a rectangle representing the screen dimensions of the error message background rectangle
    long rectangleWidth = long(std::min(std::max(XMVectorGetX(size) + 100.0f, 600.0f), viewportWidth));
    long rectangleHeight = long(spriteFont->GetLineSpacing() * 6.0f);
    long rectangleLeft = long(viewportWidth / 2.0f) - (rectangleWidth / 2);
    long rectangleTop = long(errorMsgPosition.y + spriteFont->GetLineSpacing()) - (rectangleHeight / 2);
    RECT backgroundRectangle = { rectangleLeft, rectangleTop, rectangleLeft + rectangleWidth, rectangleTop + rectangleHeight };

    spriteBatch->Begin(SpriteSortMode_Deferred, blendStates->NonPremultiplied(), nullptr, nullptr, nullptr, nullptr, scaleMatrix);

    // draw a background color for the rectangle
    spriteBatch->Draw(m_backgroundTexture->GetResourceViewTemporary(), backgroundRectangle, BackgroundColor);

    // draw error message in the middle of the screen
    spriteFont->DrawString(spriteBatch.get(), m_errorMessage.c_str(), errorMsgPosition, errorMsgColor, 0, origin);

    // draw continuation prompt
    winrt::hstring continuePrompt = L"Press (A) to Continue";
    if (!InputState::IsAnyGamepadConnected())
    {
        continuePrompt = L"Press Enter to Continue";
    }
    errorMsgPosition.y += spriteFont->GetLineSpacing();
    size = spriteFont->MeasureString(continuePrompt.c_str());
    errorMsgPosition.x = viewportWidth / 2.0f - XMVectorGetX(size) / 2.0f;
    spriteFont->DrawString(spriteBatch.get(), continuePrompt.c_str(), errorMsgPosition, Colors::Yellow, 0, origin);

    spriteBatch->End();
}
开发者ID:facybenbook,项目名称:xbox-live-samples,代码行数:49,代码来源:ErrorPopUpScreen.cpp

示例8: GetTransform

gfxRect
ThebesLayerComposite::GetDisplayPort()
{
  // We use GetTransform instead of GetEffectiveTransform in this function
  // as we want the transform of the shadowable layers and not that of the
  // shadow layers, which may have been modified due to async scrolling/
  // zooming.
  gfx3DMatrix transform = GetTransform();

  // Find out the area of the nearest display-port to invalidate retained
  // tiles.
  gfxRect displayPort;
  gfxSize parentResolution = GetEffectiveResolution();
  for (ContainerLayer* parent = GetParent(); parent; parent = parent->GetParent()) {
    const FrameMetrics& metrics = parent->GetFrameMetrics();
    if (displayPort.IsEmpty()) {
      if (!metrics.mDisplayPort.IsEmpty()) {
          // We use the bounds to cut down on complication/computation time.
          // This will be incorrect when the transform involves rotation, but
          // it'd be quite hard to retain invalid tiles correctly in this
          // situation anyway.
          displayPort = gfxRect(metrics.mDisplayPort.x,
                                metrics.mDisplayPort.y,
                                metrics.mDisplayPort.width,
                                metrics.mDisplayPort.height);
          displayPort.ScaleRoundOut(parentResolution.width, parentResolution.height);
      }
      parentResolution.width /= metrics.mResolution.scale;
      parentResolution.height /= metrics.mResolution.scale;
    }
    if (parent->UseIntermediateSurface()) {
      transform.PreMultiply(parent->GetTransform());
    }
  }

  // If no display port was found, use the widget size from the layer manager.
  if (displayPort.IsEmpty()) {
    LayerManagerComposite* manager = static_cast<LayerManagerComposite*>(Manager());
    const nsIntSize& widgetSize = manager->GetWidgetSize();
    displayPort.width = widgetSize.width;
    displayPort.height = widgetSize.height;
  }

  // Transform the display port into layer space.
  displayPort = transform.Inverse().TransformBounds(displayPort);

  return displayPort;
}
开发者ID:matyapiro31,项目名称:instantbird-1.5,代码行数:48,代码来源:ThebesLayerComposite.cpp

示例9: main

int main(int argc, char **argv)
{
    PoleaxeManager = Manager(new manager());
    Alleg::Init();
    Mouse m = Mouse(new mouse());
    Keyboard k = Keyboard(new keyboard());
	Display disp = Display(new display());
	Timer t = Timer(new timer());
	disp->SetDisplayMode(840, 525, 32);
	Window w = Window(new window("test window", 10, 10, 300, 200, 0));
	PoleaxeManager->AddWindow(w);
	disp->SetBackground("background.bmp");
	w->Draw();
	PoleaxeManager->MessageLoop();
	return 0;
}
开发者ID:halberd-project,项目名称:Poleaxe,代码行数:16,代码来源:main.cpp

示例10: NS_ERROR

mozilla::ipc::IPCResult
BrowserStreamParent::RecvStreamDestroyed()
{
  if (DYING != mState) {
    NS_ERROR("Unexpected state");
    return IPC_FAIL_NO_REASON(this);
  }

  mStreamPeer = nullptr;

  mState = DELETING;
  IProtocol* mgr = Manager();
  if (!Send__delete__(this)) {
    return IPC_FAIL_NO_REASON(mgr);
  }
  return IPC_OK();
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:17,代码来源:BrowserStreamParent.cpp

示例11: SendObserve

nsresult
DOMStorageDBParent::Observe(const char* aTopic,
                            const nsACString& aScopePrefix)
{
    if (mIPCOpen) {
#ifdef MOZ_NUWA_PROCESS
        if (!(static_cast<ContentParent*>(Manager())->IsNuwaProcess() &&
                ContentParent::IsNuwaReady())) {
#endif
            mozilla::unused << SendObserve(nsDependentCString(aTopic),
                                           nsCString(aScopePrefix));
#ifdef MOZ_NUWA_PROCESS
        }
#endif
    }

    return NS_OK;
}
开发者ID:ashishrana7,项目名称:firefox,代码行数:18,代码来源:DOMStorageIPC.cpp

示例12: CreateChannelLoadContext

PFTPChannelParent*
NeckoParent::AllocPFTPChannelParent(PBrowserParent* aBrowser,
                                    const SerializedLoadContext& aSerialized,
                                    const FTPChannelCreationArgs& aOpenArgs)
{
  nsCOMPtr<nsILoadContext> loadContext;
  const char *error = CreateChannelLoadContext(aBrowser, Manager(),
                                               aSerialized, loadContext);
  if (error) {
    printf_stderr("NeckoParent::AllocPFTPChannelParent: "
                  "FATAL error: %s: KILLING CHILD PROCESS\n",
                  error);
    return nullptr;
  }
  PBOverrideStatus overrideStatus = PBOverrideStatusFromLoadContext(aSerialized);
  FTPChannelParent *p = new FTPChannelParent(loadContext, overrideStatus);
  p->AddRef();
  return p;
}
开发者ID:drexler,项目名称:releases-mozilla-aurora,代码行数:19,代码来源:NeckoParent.cpp

示例13: MOZ_ASSERT

void
WebBrowserPersistDocumentChild::Start(nsIWebBrowserPersistDocument* aDocument)
{
    MOZ_ASSERT(!mDocument);
    if (!aDocument) {
        SendInitFailure(NS_ERROR_FAILURE);
        return;
    }

    nsCOMPtr<nsIPrincipal> principal;
    WebBrowserPersistDocumentAttrs attrs;
    nsCOMPtr<nsIInputStream> postDataStream;
#define ENSURE(e) do {           \
        nsresult rv = (e);       \
        if (NS_FAILED(rv)) {     \
            SendInitFailure(rv); \
            return;              \
        }                        \
    } while(0)
    ENSURE(aDocument->GetIsPrivate(&(attrs.isPrivate())));
    ENSURE(aDocument->GetDocumentURI(attrs.documentURI()));
    ENSURE(aDocument->GetBaseURI(attrs.baseURI()));
    ENSURE(aDocument->GetContentType(attrs.contentType()));
    ENSURE(aDocument->GetCharacterSet(attrs.characterSet()));
    ENSURE(aDocument->GetTitle(attrs.title()));
    ENSURE(aDocument->GetReferrer(attrs.referrer()));
    ENSURE(aDocument->GetContentDisposition(attrs.contentDisposition()));
    ENSURE(aDocument->GetCacheKey(&(attrs.cacheKey())));
    ENSURE(aDocument->GetPersistFlags(&(attrs.persistFlags())));

    ENSURE(aDocument->GetPrincipal(getter_AddRefs(principal)));
    ENSURE(ipc::PrincipalToPrincipalInfo(principal, &(attrs.principal())));

    ENSURE(aDocument->GetPostData(getter_AddRefs(postDataStream)));
#undef ENSURE

    mozilla::ipc::AutoIPCStream autoStream;
    autoStream.Serialize(postDataStream,
                         static_cast<mozilla::dom::ContentChild*>(Manager()));

    mDocument = aDocument;
    SendAttributes(attrs, autoStream.TakeOptionalValue());
}
开发者ID:marcoscaceres,项目名称:gecko-dev,代码行数:43,代码来源:WebBrowserPersistDocumentChild.cpp

示例14: MOZ_ASSERT

bool
FlyWebPublishedServerParent::RecvFetchResponse(const IPCInternalResponse& aResponse,
                                               const uint64_t& aRequestId)
{
  MOZ_ASSERT(!mActorDestroyed);

  RefPtr<InternalRequest> request;
  mPendingRequests.Remove(aRequestId, getter_AddRefs(request));
  if (!request) {
     static_cast<ContentParent*>(Manager())->KillHard("unknown request id");
     return false;
  }

  RefPtr<InternalResponse> response = InternalResponse::FromIPC(aResponse);

  mPublishedServer->OnFetchResponse(request, response);

  return true;
}
开发者ID:bitwiseworks,项目名称:mozilla-os2,代码行数:19,代码来源:FlyWebPublishedServer.cpp

示例15: IAccessibleHolder

bool
DocAccessibleChild::ConstructChildDocInParentProcess(
                                        DocAccessibleChild* aNewChildDoc,
                                        uint64_t aUniqueID, uint32_t aMsaaID)
{
  if (IsConstructedInParentProcess()) {
    // We may send the constructor immediately
    auto tabChild = static_cast<dom::TabChild*>(Manager());
    MOZ_ASSERT(tabChild);
    bool result = tabChild->SendPDocAccessibleConstructor(aNewChildDoc, this,
                                                          aUniqueID, aMsaaID,
                                                          IAccessibleHolder());
    if (result) {
      aNewChildDoc->SetConstructedInParentProcess();
    }
    return result;
  }

  PushDeferredEvent(MakeUnique<SerializedChildDocConstructor>(aNewChildDoc, this,
                                                              aUniqueID, aMsaaID));
  return true;
}
开发者ID:jhector,项目名称:gecko-dev,代码行数:22,代码来源:DocAccessibleChild.cpp


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