本文整理汇总了C++中Display类的典型用法代码示例。如果您正苦于以下问题:C++ Display类的具体用法?C++ Display怎么用?C++ Display使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Display类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void Dispatcher::updateDisplay()
{
QString artist;
QString album;
QString title;
QTime length;
QTime currentTime;
if (m_currentHandler != NULL) {
artist = m_currentHandler->artist();
album = m_currentHandler->album();
title = m_currentHandler->title();
length = m_currentHandler->length();
currentTime = m_currentHandler->currentTime();
}
QListIterator<Display*> it = m_loader->displaysIterator();
while (it.hasNext()) {
Display* display = it.next();
display->setMediaInfo(artist, album, title, length);
display->setCurrentTime(currentTime);
}
}
示例2: DefaultRootWindow
Window::Window (Display& display, int width, int height, ::Visual* visual)
: m_display (display)
, m_colormap (None)
, m_window (None)
, m_visible (false)
{
XSetWindowAttributes swa;
::Display* const dpy = m_display.getXDisplay();
::Window root = DefaultRootWindow(dpy);
unsigned long mask = CWBorderPixel | CWEventMask;
// If redirect is enabled, window size can't be guaranteed and it is up to
// the window manager to decide whether to honor sizing requests. However,
// overriding that causes window to appear as an overlay, which causes
// other issues, so this is disabled by default.
const bool overrideRedirect = false;
if (overrideRedirect)
{
mask |= CWOverrideRedirect;
swa.override_redirect = true;
}
if (visual == DE_NULL)
visual = CopyFromParent;
else
{
XVisualInfo info = XVisualInfo();
bool succ = display.getVisualInfo(XVisualIDFromVisual(visual), info);
TCU_CHECK_INTERNAL(succ);
root = RootWindow(dpy, info.screen);
m_colormap = XCreateColormap(dpy, root, visual, AllocNone);
swa.colormap = m_colormap;
mask |= CWColormap;
}
swa.border_pixel = 0;
swa.event_mask = ExposureMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask;
if (width == glu::RenderConfig::DONT_CARE)
width = DEFAULT_WINDOW_WIDTH;
if (height == glu::RenderConfig::DONT_CARE)
height = DEFAULT_WINDOW_HEIGHT;
m_window = XCreateWindow(dpy, root, 0, 0, width, height, 0,
CopyFromParent, InputOutput, visual, mask, &swa);
TCU_CHECK(m_window);
Atom deleteAtom = m_display.getDeleteAtom();
XSetWMProtocols(dpy, m_window, &deleteAtom, 1);
}
示例3: Colormap
Colormap(const Display& display, const VisualInfo& vi)
: DisplayObject< ::Colormap>(
display,
::XCreateColormap(
display,
RootWindow(display.Get(), vi->screen),
vi->visual,
AllocNone
),
::XFreeColormap,
"Error creating X Colormap"
){ }
示例4: checkKeys
bool checkKeys(KeyPress key, Display display, Notification notification, vector<int> keyCodeArray, bool isMenu) {
display.updateDisplay(key);
system("CLS");
cout << display.toString();
while (true) {
for (int i = 0; i < keyCodeArray.size(); i++) {
if (key.isPressed(keyCodeArray.at(i))) {
display.updateDisplay(key);
system("CLS");
cout << display.toString();
};
}
//extra logic for if the display is not a menu:
if (!isMenu) {
if (key.timedUpdate(1)) {
display.updateDisplay(key);
system("CLS");
cout << display.toString();
}
key.isHeld(VK_SPACE);
notification.lockedScreen(stoi(key.getLockedScreenPercent()), key.getSecondsLocked());
key.incrementLoopCount();
}
//reset counter and key presses
if (key.checkIfRequiresReset()) break;
Sleep(10);
}
return 0;
}
示例5: main
int main(int argc, char **argv) {
al_init();
al_init_image_addon();
Display d (500, 500);
Engine g (&d);
ALLEGRO_BITMAP *bmp = al_load_bitmap("m.png");
if (!bmp) {
printf("Could not load bmp!\n");
return -1;
}
BaseSprite s (bmp);
g.display->addRenderable(&s);
g.setState(ERUNNING);
while (1) {
while (g.getState() == ERUNNING) {
g.engineTick();
g.engineRender();
g.engineSleep();
}
printf("BREAK\n");
if (g.getState() == EPAUSED) {
while (g.getState() == EPAUSED) {
g.engineTick();
g.engineSleep(1);
}
}
if (g.getState() == EQUIT) {
g.engineQuit();
break;
}
}
d.del();
return 0;
}
示例6: main
int main(int argc, const char * argv[])
{
//create buffer and display
BufferManager *buffer = new BufferManager();
Display *display = new Display(buffer);
//setup curses
initscr();
noecho();
keypad(stdscr, true);
cbreak();
//display initial status
display->redisplay(buffer);
//run
run(buffer, display);
//finish
endwin();
return 0;
}
示例7: removeAllDisplays
void DisplayGroup::removeAllDisplays()
{
int num_non_display_children = Display::numChildren();
if( model_ )
{
model_->beginRemove( this, num_non_display_children, displays_.size() );
}
for( int i = displays_.size() - 1; i >= 0; i-- )
{
// printf(" displaygroup2 displays_.takeAt( %d )\n", i );
Display* child = displays_.takeAt( i );
Q_EMIT displayRemoved( child );
child->setParent( NULL ); // prevent child destructor from calling getParent()->takeChild().
delete child;
}
if( model_ )
{
model_->endRemove();
}
Q_EMIT childListChanged( this );
}
示例8: main
int main() {
int fil[6][8];
int i,j;
//inisialisasi
for (i = 0;i <= 5;i++) {
for (j = 0;j <= 7;j++) {
fil[i][j] = 1;
}
}
Display LCD;
LCD.SetJudul(3, 5, 4, 10, 2, 2, 4, "PANAS", "TERANG");
LCD.SetWarna(1,15);
//UBAH NAMA
LCD.SetStrPanel(1,0,"FIDEL CASTRO");
//UBAH STATUS
LCD.SetStrPanel(1,1,"NORMAL");
//UBAH UANG
LCD.SetStrPanel(1,2,"65.000 BUCK");
//UBAH NAMA TANAMAN
LCD.SetStrPanel(2,0,"CANABIS");
LCD.ClearScr();
//string jud;
/*jud = "TT/BB HH:MM RUMAH< , > MUSIM CUACA";
a[1]= "COBAA" ; b[1]= "ABISA";
a[2]= "AJAA" ; b[2]= "INIA";
a[3]= "NIHA" ; b[3]= "COBAA";
a[4]= "TESTINGA" ; b[4]= "TRUAS";
a[5]= "YUHUA" ; b[5]= "MAMPUAS";*/
LCD << fil;
LCD.PrintJudul();
LCD.PrintUtama();
return 0;
}
示例9: main
void main(int argc, char* argv[])
{
std::cout << "\n Test Display.\n "
<< std::string(30, '=') << std::endl;
try
{
for (auto file : files){
Parser* pParser = configure.Build(file);
std::cout << "\n --- " << file << " --- \n" << std::endl;
if (pParser){
if (!configure.Attach(file)){
std::cout << "\n could not open file " << file << std::endl;
continue;
}
}
else{
std::cout << "\n\n Parser not built\n\n";
return;
}
while (pParser->next())
pParser->parse();
Display dp;
Repository* p_Repos = configure.ReturnRepos();
if (cp.GetHideDetail())
dp.DisplayBrief(p_Repos);
else
dp.DisplayDetail(p_Repos);
dp.WalkTree(p_Repos->p_Node, false);
std::cout << "\n\n";
}
}
catch (std::exception& ex)
{
std::cout << "\n\n " << ex.what() << "\n\n";
}
}
示例10: UpdateRunnable
void CommandContributionItem::UpdateCommandProperties(const SmartPointer<
const CommandEvent> commandEvent)
{
if (commandEvent->IsHandledChanged())
{
dropDownMenuOverride = "";
}
if (!action)
{
return;
}
Display* display = Display::GetDefault();
typedef AsyncRunnable<SmartPointer<const CommandEvent>, CommandContributionItem > UpdateRunnable;
Poco::Runnable* update = new UpdateRunnable(this, &CommandContributionItem::UpdateCommandPropertiesInUI, commandEvent);
if (display->InDisplayThread())
{
update->run();
}
else
{
display->AsyncExec(update);
}
}
示例11: internalCreate
void ImageLoader::internalCreate(std::string key, std::string fileName, int x1, int y1, int x2, int y2)
{
Display* display = Display::Acquire();
if (x1 < 0)
{
x1 = 0;
}
if (x2 < 0)
{
x2 = display->GetWidth(fileName);
}
if (y1 < 0)
{
y1 = 0;
}
if (y2 < 0)
{
y2 = display->GetHeight(fileName);
}
display->LoadImageFromFile(fileName, key, x1, y1, x2, y2);
}
示例12:
Seat::Seat(const Display& display)
: display_(display)
, wl_seat_(display.bind<wl_seat>("wl_seat", &wl_seat_interface, 1))
, capabilities_(0)
{
ASSERT(wl_seat_ != NULL);
wl_seat_set_user_data(*this, this);
static const wl_seat_listener listener = {capabilities};
wl_seat_add_listener(*this, &listener, this);
display.roundtrip();
}
示例13: removeDisplay
void DaemonApp::removeDisplay() {
Display *display = qobject_cast<Display *>(sender());
// log message
qDebug() << " DAEMON: Removing display" << display->name() << "...";
// remove display from list
m_displays.removeAll(display);
// delete display
display->deleteLater();
#if TEST
// quit if no display remained
if (m_displays.isEmpty()) {
// log message
qDebug() << " DAEMON: Stopping...";
// quit application
qApp->quit();
}
#endif
}
示例14: fprintf
bt::Color bt::Color::namedColor(const Display &display, unsigned int screen,
const std::string &colorname) {
if (colorname.empty()) {
fprintf(stderr, "bt::Color::namedColor: empty colorname\n");
return Color();
}
// get rgb values from colorname
XColor xcol;
xcol.red = 0;
xcol.green = 0;
xcol.blue = 0;
xcol.pixel = 0;
Colormap colormap = display.screenInfo(screen).colormap();
if (!XParseColor(display.XDisplay(), colormap, colorname.c_str(), &xcol)) {
fprintf(stderr, "bt::Color::namedColor: invalid color '%s'\n",
colorname.c_str());
return Color();
}
return Color(xcol.red >> 8, xcol.green >> 8, xcol.blue >> 8);
}
示例15: impl
MasterRenderer::MasterRenderer(
Project& project,
const ParamArray& params,
const SearchPaths& resource_search_paths,
IRendererController* renderer_controller,
ITileCallbackFactory* tile_callback_factory)
: impl(new Impl(project, params, resource_search_paths))
{
impl->m_renderer_controller = renderer_controller;
impl->m_tile_callback_factory = tile_callback_factory;
if (impl->m_tile_callback_factory == nullptr)
{
// Try to use the display if there is one in the project
// and no tile callback factory was specified.
Display* display = impl->m_project.get_display();
if (display != nullptr && display->open(impl->m_project))
{
impl->m_tile_callback_factory = display->get_tile_callback_factory();
impl->m_display = display;
}
}
}