本文整理汇总了C++中WindowManager类的典型用法代码示例。如果您正苦于以下问题:C++ WindowManager类的具体用法?C++ WindowManager怎么用?C++ WindowManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WindowManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: warning
Client *Client::create(const Rect& rect, int screenNumber, const String &clazz, const String &instance, bool movable)
{
WindowManager *wm = WindowManager::instance();
xcb_connection_t* conn = wm->connection();
xcb_screen_t* scr = wm->screens().at(screenNumber);
xcb_window_t window = xcb_generate_id(conn);
const uint32_t values[] = {
scr->black_pixel,
XCB_GRAVITY_NORTH_WEST,
XCB_GRAVITY_NORTH_WEST,
1,
(XCB_EVENT_MASK_STRUCTURE_NOTIFY
| XCB_EVENT_MASK_ENTER_WINDOW
| XCB_EVENT_MASK_LEAVE_WINDOW
| XCB_EVENT_MASK_EXPOSURE
| XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT
| XCB_EVENT_MASK_POINTER_MOTION
| XCB_EVENT_MASK_BUTTON_PRESS
| XCB_EVENT_MASK_BUTTON_RELEASE)
};
warning() << "creating client window" << rect;
xcb_create_window(conn, XCB_COPY_FROM_PARENT, window, scr->root,
rect.x, rect.y, rect.width, rect.height, 0,
XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,
XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY | XCB_CW_WIN_GRAVITY
| XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK, values);
xcb_icccm_wm_hints_t wmHints;
xcb_icccm_wm_hints_set_none(&wmHints);
xcb_icccm_wm_hints_set_input(&wmHints, 0);
xcb_icccm_set_wm_hints(conn, window, &wmHints);
xcb_size_hints_t wmNormalHints;
memset(&wmNormalHints, 0, sizeof(wmNormalHints));
xcb_icccm_size_hints_set_position(&wmNormalHints, 1, rect.x, rect.y);
xcb_icccm_size_hints_set_size(&wmNormalHints, 1, rect.width, rect.height);
xcb_icccm_set_wm_normal_hints(conn, window, &wmNormalHints);
String className = clazz + ' ' + instance;
className[clazz.size()] = '\0';
xcb_icccm_set_wm_class(conn, window, className.size(), className.constData());
Client *ptr = new Client(window);
ptr->mMovable = movable;
ptr->mRect = rect;
ptr->mOwned = true;
ptr->mScreenNumber = screenNumber;
ptr->init();
ptr->mNoFocus = true;
Workspace *ws = wm->activeWorkspace(screenNumber);
assert(ws);
ptr->mWorkspace = ws;
ws->addClient(ptr);
wm->js().onClient(ptr);
ptr->complete();
sClients[window] = ptr;
return ptr;
}
开发者ID:jhanssen,项目名称:nwm,代码行数:60,代码来源:Client.cpp
示例2: Close
bool WindowManager::Close()
{
QList<Window::Pointer> t = windows; // make iteration robust
for (QList<Window::Pointer>::iterator iter = t.begin();
iter != t.end(); ++iter)
{
bool closed = (*iter)->Close();
if (!closed)
{
return false;
}
}
if (!subManagers.empty())
{
for (QList<WindowManager*>::iterator iter = subManagers.begin();
iter != subManagers.end(); ++iter)
{
WindowManager* wm = *iter;
bool closed = wm->Close();
if (!closed)
{
return false;
}
}
}
return true;
}
开发者ID:dkuegler,项目名称:MITK,代码行数:28,代码来源:berryWindowManager.cpp
示例3: WindowBase
SelectAttributeDialog::SelectAttributeDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
: WindowBase("openmw_chargen_select_attribute_layout.xml", environment)
{
// Centre dialog
center();
WindowManager *wm = environment.mWindowManager;
setText("LabelT", wm->getGameSettingString("sAttributesMenu1", ""));
for (int i = 0; i < 8; ++i)
{
Widgets::MWAttributePtr attribute;
char theIndex = '0'+i;
getWidget(attribute, std::string("Attribute").append(1, theIndex));
attribute->setWindowManager(wm);
attribute->setAttributeId(ESM::Attribute::attributeIds[i]);
attribute->eventClicked = MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
}
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(wm->getGameSettingString("sCancel", ""));
cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
}
开发者ID:BogusCurry,项目名称:openmw,代码行数:27,代码来源:class.cpp
示例4: updateStats
void PickClassDialog::updateStats()
{
if (currentClassId.empty())
return;
WindowManager *wm = environment.mWindowManager;
ESMS::ESMStore &store = environment.mWorld->getStore();
const ESM::Class *klass = store.classes.search(currentClassId);
if (!klass)
return;
ESM::Class::Specialization specialization = static_cast<ESM::Class::Specialization>(klass->data.specialization);
static const char *specIds[3] = {
"sSpecializationCombat",
"sSpecializationMagic",
"sSpecializationStealth"
};
specializationName->setCaption(wm->getGameSettingString(specIds[specialization], specIds[specialization]));
favoriteAttribute[0]->setAttributeId(klass->data.attribute[0]);
favoriteAttribute[1]->setAttributeId(klass->data.attribute[1]);
for (int i = 0; i < 5; ++i)
{
majorSkill[i]->setSkillNumber(klass->data.skills[i][0]);
minorSkill[i]->setSkillNumber(klass->data.skills[i][1]);
}
classImage->setImageTexture(std::string("textures\\levelup\\") + currentClassId + ".dds");
}
开发者ID:BogusCurry,项目名称:openmw,代码行数:30,代码来源:class.cpp
示例5: while
void Helium::RendererInitializationWin::Shutdown()
{
DynamicDrawer::DestroyStaticInstance();
RenderResourceManager::DestroyStaticInstance();
Renderer* pRenderer = Renderer::GetStaticInstance();
if( pRenderer )
{
pRenderer->Shutdown();
Renderer::DestroyStaticInstance();
}
WindowManager* pWindowManager = WindowManager::GetStaticInstance();
if( pWindowManager )
{
if( m_pMainWindow )
{
m_pMainWindow->Destroy();
while( m_pMainWindow )
{
pWindowManager->Update();
}
}
pWindowManager->Shutdown();
WindowManager::DestroyStaticInstance();
}
}
开发者ID:kevindqc,项目名称:Helium,代码行数:28,代码来源:RendererInitializationWin.cpp
示例6: close
void Client::close()
{
WindowManager *wm = WindowManager::instance();
if (mOwned) {
EventLoop::eventLoop()->callLater([this, wm] {
delete this;
xcb_flush(wm->connection());
});
} else {
if (mProtocols.contains(Atoms::WM_DELETE_WINDOW)) {
// delete
xcb_client_message_event_t event;
memset(&event, '\0', sizeof(event));
event.response_type = XCB_CLIENT_MESSAGE;
event.window = mWindow;
event.format = 32;
event.type = Atoms::WM_PROTOCOLS;
event.data.data32[0] = Atoms::WM_DELETE_WINDOW;
event.data.data32[1] = wm->timestamp();
xcb_send_event(wm->connection(), false, mWindow, XCB_EVENT_MASK_NO_EVENT,
reinterpret_cast<char*>(&event));
} else {
xcb_kill_client(wm->connection(), mWindow);
}
}
}
开发者ID:jhanssen,项目名称:nwm,代码行数:28,代码来源:Client.cpp
示例7: SetLastError
LRESULT CALLBACK WindowManager::WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
WindowManager *view;
if (message == WM_NCCREATE)
{
CREATESTRUCT *cs = (CREATESTRUCT*) lParam;
view = (WindowManager*) cs->lpCreateParams;
SetLastError(0);
if (SetWindowLongPtr(hwnd, GWL_USERDATA, (LONG_PTR) view) == 0)
{
if (GetLastError() != 0)
return FALSE;
}
}
else
{
view = (WindowManager*) GetWindowLongPtr(hwnd, GWL_USERDATA);
}
if (view)
return view->WindowProc(hwnd, message, wParam, lParam);
return DefWindowProc(hwnd, message, wParam, lParam);
}
开发者ID:Feugel,项目名称:KB01,代码行数:26,代码来源:WindowManager.cpp
示例8: addSkills
void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
WindowManager *wm = environment.mWindowManager;
// Add a line separator if there are items above
if (!skillWidgets.empty())
{
addSeparator(coord1, coord2);
}
addGroup(wm->getGameSettingString(titleId, titleDefault), coord1, coord2);
SkillList::const_iterator end = skills.end();
for (SkillList::const_iterator it = skills.begin(); it != end; ++it)
{
int skillId = *it;
if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes
continue;
assert(skillId >= 0 && skillId < ESM::Skill::Length);
const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId];
const MWMechanics::Stat<float> &stat = skillValues.find(skillId)->second;
float base = stat.getBase();
float modified = stat.getModified();
ColorStyle style = CS_Normal;
if (modified > base)
style = CS_Super;
else if (modified < base)
style = CS_Sub;
MyGUI::StaticTextPtr widget = addValueItem(wm->getGameSettingString(skillNameId, skillNameId), boost::lexical_cast<std::string>(static_cast<int>(modified)), style, coord1, coord2);
skillWidgetMap[skillId] = widget;
}
}
开发者ID:dhardy,项目名称:openmw,代码行数:33,代码来源:layouts.cpp
示例9: clearActionReceivers
void FrameAttachmentPoint::showContextMenu(QPoint point)
{
//Show menus with all attached frames and submenu where to attach it to
clearActionReceivers();
WindowManager* windowManager = Carbon::get()->getWindowManager();
QMenu menu(windowManager->getMainWindow());
QMenu* submenu;
QAction* action;
//For all attached frames, add frame menu
int frame = 0;
for (auto it = mAttachedFrames.begin(); it != mAttachedFrames.end(); it++)
{
submenu = menu.addMenu((*it)->getCaption());
//for all possible targets, add commands
{
NumberedActionReceiver* receiver;
//Copy command
receiver = new NumberedActionReceiver(frame, COMMAND_COPY);
mActionReceivers.push_back(receiver);
connect(receiver, SIGNAL(actionReceived(int,int)), this, SLOT(onContextMenuClick(int,int)));
action = submenu->addAction(QIcon(":copy"), "Copy", receiver, SLOT(receiveAction()));
action->setToolTip("Create a copy of the plugin.");
if (!PluginFactory::getFactory().canCreatePlugin((*it)->getClassId())) //Disable copy if plugin cant be created anymore
action->setEnabled(false);
//Delete command
receiver = new NumberedActionReceiver(frame, COMMAND_DELETE);
mActionReceivers.push_back(receiver);
connect(receiver, SIGNAL(actionReceived(int,int)), this, SLOT(onContextMenuClick(int,int)));
action = submenu->addAction(QIcon(":delete"), "Delete", receiver, SLOT(receiveAction()));
action->setToolTip("Delete the plugin.");
}
submenu->addSeparator();
//for all possible targets, add target frames
int target = COMMAND_MAX_ID;
for (auto tar_it = windowManager->getFrameAttachmentPoints().begin(); tar_it != windowManager->getFrameAttachmentPoints().end(); tar_it++)
{
NumberedActionReceiver* receiver = new NumberedActionReceiver(frame, target);
mActionReceivers.push_back(receiver);
connect(receiver, SIGNAL(actionReceived(int,int)), this, SLOT(onContextMenuClick(int,int)));
if (tar_it->second == this)
action = submenu->addAction(QIcon(":accept"), tar_it->second->getName(), receiver, SLOT(receiveAction()));
else
action = submenu->addAction(tar_it->second->getName(), receiver, SLOT(receiveAction()));
target++;
}
frame++;
}
menu.exec(mAttachmentPoint->mapToGlobal(point));
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:60,代码来源:frameattachmentpoint.cpp
示例10: init
void Client::init()
{
WindowManager *wm = WindowManager::instance();
xcb_ewmh_connection_t* ewmhConn = wm->ewmhConnection();
updateState(ewmhConn);
wm->bindings().rebind(mWindow);
}
开发者ID:jhanssen,项目名称:nwm,代码行数:7,代码来源:Client.cpp
示例11: assert
Client *Client::manage(xcb_window_t window, int screenNumber)
{
assert(sClients.count(window) == 0);
Client *ptr = new Client(window);
ptr->mScreenNumber = screenNumber;
ptr->init();
WindowManager *wm = WindowManager::instance();
wm->js().onClient(ptr);
xcb_ewmh_connection_t* ewmhConn = wm->ewmhConnection();
bool focus = false;
if (!ptr->mEwmhState.contains(ewmhConn->_NET_WM_STATE_STICKY)) {
Workspace *ws = wm->activeWorkspace(screenNumber);
assert(ws);
ptr->mWorkspace = ws;
ws->addClient(ptr);
focus = true;
}
ptr->complete();
if (focus)
ptr->focus();
sClients[window] = ptr;
return ptr;
}
开发者ID:jhanssen,项目名称:nwm,代码行数:25,代码来源:Client.cpp
示例12: init
WindowManager::WindowManager (const WindowManager& other)
{
init ((unsigned int) other.getWindowPosition().x(),
(unsigned int) other.getWindowPosition().y(),
(unsigned int) other.getWindowDimension().x(),
(unsigned int) other.getWindowDimension().y());
}
开发者ID:nassimeblinlaas,项目名称:gepetto-viewer,代码行数:7,代码来源:window-manager.cpp
示例13: getWindowManager
ExampleApplication::ExampleApplication(const std::string& caption, int argc, const char* argv[])
{
std::string title = caption + " - Open Graphics Framework";
bool fullscreen = false;
int width = 800;
int height = 600;
int samples = 0;
for (int i = 1; i < argc; ++i)
{
if (std::strcmp(argv[i], "--fullscreen") == 0 || std::strcmp(argv[i], "-f") == 0)
{
fullscreen = true;
continue;
}
if (std::sscanf(argv[i], "--width=%d", &width) == 1)
continue;
if (std::sscanf(argv[i], "-w=%d", &width) == 1)
continue;
if (std::sscanf(argv[i], "--height=%d", &height) == 1)
continue;
if (std::sscanf(argv[i], "-h=%d", &height) == 1)
continue;
if (std::sscanf(argv[i], "--samples=%d", &samples) == 1)
continue;
std::sscanf(argv[i], "-s=%d", &samples);
}
WindowManager* windowManager = getWindowManager();
windowManager->setWindowHint(WindowHint::RESIZABLE, 1);
windowManager->setWindowHint(WindowHint::SAMPLES, samples);
const Display* display = windowManager->getDisplay(0);
window = windowManager->createWindow(title, width, height);
window->setDisplayMode(display->getMode(0));
window->setSwapInterval(1);
graphicsContext = window->getGraphicsContext();
resourceContext = new ResourceContext(graphicsContext);
// Create renderer
renderer = new Renderer(graphicsContext);
// Setup screen recording
screenRecorder.setGraphicsContext(graphicsContext);
window->addObserver(this);
getInputManager()->getKeyboard(0)->addObserver(this);
}
开发者ID:cjhoward,项目名称:ogf,代码行数:56,代码来源:example-application.cpp
示例14: edbeeApp
/// Deserializes the given application state
/// @param app a reference to the application
/// @param map the map with serialized data
void WorkspaceSerializer::deserializeWorkspace(Workspace* workspace, const QVariantMap& map)
{
WindowManager* winManager = edbeeApp()->windowManager();
QVariantList windows = map.value("windows").toList();
foreach( QVariant winVar, windows ) {
QVariantMap winMap = winVar.toMap();
MainWindow* win = winManager->createWindow( workspace );
deserializeMainWindow( win, winMap );
win->show();
}
开发者ID:edbee,项目名称:edbee-app,代码行数:13,代码来源:workspaceserializer.cpp
示例15:
Window * GroupBox::getContentPane() const
{
String paneName = d_name + ContentPaneNameSuffix;
WindowManager* winMgr = WindowManager::getSingletonPtr();
if (winMgr->isWindowPresent(paneName))
{
return winMgr->getWindow(paneName);
}
return 0;
}
开发者ID:Strongc,项目名称:game-ui-solution,代码行数:10,代码来源:CEGUIGroupBox.cpp
示例16: HELIUM_ASSERT
/// Callback executed when the main window is actually destroyed.
///
/// @param[in] pWindow Pointer to the destroyed Window instance.
void RendererInitializationWin::OnMainWindowDestroyed( Window* pWindow )
{
HELIUM_ASSERT( m_pMainWindow == pWindow );
HELIUM_UNREF( pWindow );
m_pMainWindow = NULL;
WindowManager* pWindowManager = WindowManager::GetStaticInstance();
HELIUM_ASSERT( pWindowManager );
pWindowManager->RequestQuit();
}
开发者ID:kevindqc,项目名称:Helium,代码行数:13,代码来源:RendererInitializationWin.cpp
示例17: PaintToolGL
PaintToolGL(const Gdk::Region& invalid_region, const WindowManager& wm) : PaintTool(invalid_region, wm)
{
_full_area_height = wm.get_height();
_full_area_width = wm.get_width();
glViewport(0.f, 0.f, _full_area_width, _full_area_height);
glDisable(GL_SCISSOR_TEST);
Gdk::Rectangle area;
/*get_invalid_region().get_clipbox(area);*/area = Gdk::Rectangle(0, 0, _full_area_width, _full_area_height);
g_assert(get_scissor_stack_depth()==0);
push_scissor(area);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.f, _full_area_width, _full_area_height, 0.f, -1.f, 1.f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
glDisable(GL_STENCIL_TEST);
glStencilFunc(GL_EQUAL, 1, 1);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
Glib::ArrayHandle<Gdk::Rectangle> invalid_rectangles = invalid_region.get_rectangles();
glBegin(GL_QUADS);
for(Glib::ArrayHandle<Gdk::Rectangle>::const_iterator r_iter = invalid_rectangles.begin(); r_iter != invalid_rectangles.end(); ++r_iter)
{
const Gdk::Rectangle& rect = *r_iter;
gfloat x = rect.get_x();
gfloat y = rect.get_y();
gfloat x2 = x+rect.get_width();
gfloat y2 = y+rect.get_height();
glVertex3f(x , y , 0.f);
glVertex3f(x , y2, 0.f);
glVertex3f(x2, y2, 0.f);
glVertex3f(x2, y , 0.f);
}
glEnd();
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glEnable(GL_STENCIL_TEST);
glClearColor(0.f, 0.f, 0.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_SCISSOR_TEST);
glDisable(GL_STENCIL_TEST);
}
开发者ID:MrBr3,项目名称:Space-Deminer,代码行数:55,代码来源:engine-opengl.cpp
示例18: InfoBoxDialog
ClassChoiceDialog::ClassChoiceDialog(MWWorld::Environment& environment)
: InfoBoxDialog(environment)
{
WindowManager *mw = environment.mWindowManager;
setText("");
ButtonList buttons;
buttons.push_back(mw->getGameSettingString("sClassChoiceMenu1", ""));
buttons.push_back(mw->getGameSettingString("sClassChoiceMenu2", ""));
buttons.push_back(mw->getGameSettingString("sClassChoiceMenu3", ""));
buttons.push_back(mw->getGameSettingString("sBack", ""));
setButtons(buttons);
}
开发者ID:BogusCurry,项目名称:openmw,代码行数:12,代码来源:class.cpp
示例19: Destroy
void LobbyEvent::Destroy()
{
if(gLobbyData.get()==NULL)
return;
gLobbyData->mLobbyContainer->SetListener(NULL);
WindowManager *aWindowMgr = WindowManager::GetDefaultWindowManager();
if(aWindowMgr!=NULL)
{
aWindowMgr->RemoveTimerEvent(gLobbyData->mTimerEvent);
aWindowMgr->ClearSubscriptions(); // FIXME, just clear lobby subscriptions
}
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:13,代码来源:LobbyEvent.cpp
示例20: main
int main(int argc,char** argv)
{
WindowManager *pWinManager = KaMiWindowManager::Instance(argc,argv);
WindowData winData("KaMiWindow",500,500,GLUT_SINGLE|GLUT_RGB |GLUT_DEPTH,GePoint2D(0.0,0.0));
winData.winName = "KamiWindow";
GeWindow *pWin = pWinManager->createWindow(winData);
pWin->setRender(new KaMiRender);
pWin->setBlankgroundColor(0.0,1.0,0.0);
pWin->moveTo(GePoint2D(200,200));
glClearColor(0.0, 0.0, 0.0, 1.0);
pWin->show();
}
开发者ID:labinxu,项目名称:openglstudy,代码行数:13,代码来源:KaMi_main.cpp
注:本文中的WindowManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论