本文整理汇总了C++中wxGetDisplay函数的典型用法代码示例。如果您正苦于以下问题:C++ wxGetDisplay函数的具体用法?C++ wxGetDisplay怎么用?C++ wxGetDisplay使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxGetDisplay函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glXMakeCurrent
wxGLContext::~wxGLContext()
{
if (!m_glContext) return;
if (m_glContext == glXGetCurrentContext())
{
glXMakeCurrent( (Display*) wxGetDisplay(), None, NULL);
}
glXDestroyContext( (Display*) wxGetDisplay(), m_glContext );
}
示例2: wxWindowDCImpl
// Create a DC representing the whole screen
wxScreenDCImpl::wxScreenDCImpl(wxScreenDC *owner)
: wxWindowDCImpl(owner)
{
m_display = wxGetDisplay();
Display* display = (Display*) m_display;
if (sm_overlayWindow)
{
m_pixmap = sm_overlayWindow;
m_deviceOriginX = - sm_overlayWindowX;
m_deviceOriginY = - sm_overlayWindowY;
}
else
m_pixmap = (WXPixmap) RootWindow(display, DefaultScreen(display));
XGCValues gcvalues;
gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
gcvalues.background = WhitePixel (display, DefaultScreen (display));
gcvalues.graphics_exposures = False;
gcvalues.subwindow_mode = IncludeInferiors;
gcvalues.line_width = 1;
m_gc = XCreateGC (display, RootWindow (display, DefaultScreen (display)),
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues);
m_backgroundPixel = gcvalues.background;
m_ok = true;
}
示例3: glGetBooleanv
void wxGLContext::SetColour(const wxChar *colour)
{
wxColour the_colour = wxTheColourDatabase->Find(colour);
if(the_colour.Ok())
{
GLboolean b;
glGetBooleanv(GL_RGBA_MODE, &b);
if(b)
{
glColor3ub(the_colour.Red(),
the_colour.Green(),
the_colour.Blue());
}
else
{
#ifdef __WXMOTIF__
the_colour.AllocColour(m_window->GetXDisplay());
#else
the_colour.CalcPixel(wxTheApp->GetMainColormap(wxGetDisplay()));
#endif
GLint pix = (GLint)the_colour.GetPixel();
if(pix == -1)
{
wxLogError(wxT("wxGLCanvas: cannot allocate color\n"));
return;
}
glIndexi(pix);
}
}
}
示例4: wxWindowDCImpl
wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC *owner, wxDC* dc)
: wxWindowDCImpl(owner)
{
m_ok = true;
if (dc && dc->IsKindOf(CLASSINFO(wxWindowDC)))
m_display = ((wxWindowDCImpl *)dc->GetImpl())->GetDisplay();
else
m_display = wxGetDisplay();
Display* display = (Display*) m_display;
XGCValues gcvalues;
gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
gcvalues.background = WhitePixel (display, DefaultScreen (display));
gcvalues.graphics_exposures = False;
gcvalues.subwindow_mode = IncludeInferiors;
gcvalues.line_width = 1;
m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)),
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues);
m_backgroundPixel = gcvalues.background;
SetBrush (* wxWHITE_BRUSH);
SetPen (* wxBLACK_PEN);
}
示例5: wxGetDisplay
void WXAppBar::UnSetDockedModeStep2()
{
Display *dd= (Display *) wxGetDisplay();
// Window X11 handle
GtkWidget *gtkWidget= (GtkWidget *) this->GetHandle();
Window w= GDK_WINDOW_XWINDOW (gtkWidget->window);
Refresh();
Update();
//
// Set window style back to normal again
//
Atom atomTmp= XInternAtom (dd, "_NET_WM_WINDOW_TYPE", False);
Atom atom_NET_WM_WINDOW_TYPE_NORMAL= XInternAtom (dd, "_NET_WM_WINDOW_TYPE_NORMAL", False);
unsigned long propInfo= atom_NET_WM_WINDOW_TYPE_NORMAL;
XChangeProperty (dd, w, atomTmp, XA_ATOM, 32, PropModeReplace, (unsigned char *) &propInfo, 1);
XSync(dd, False);
// The code above disables the sticky property, so we enable it again
SetSticky(true);
// Restore decorations when needed
SetBorderDecorations(m_dialogHadBorderDecorations);
// Restore original size
wxSize proposedSize= DoGetBestSize();
//SetSize (0, 0, proposedSize.GetWidth(), proposedSize.GetHeight());
SetSize (proposedSize.GetWidth(), proposedSize.GetHeight());
}
示例6: wxGetWindowParent
Window wxGetWindowParent(Window window)
{
wxASSERT_MSG( window, wxT("invalid window") );
return (Window) 0;
#ifndef __VMS
// VMS chokes on unreacheable code
Window parent, root = 0;
#if wxUSE_NANOX
int noChildren = 0;
#else
unsigned int noChildren = 0;
#endif
Window* children = NULL;
// #define XQueryTree(d,w,r,p,c,nc) GrQueryTree(w,p,c,nc)
int res = 1;
#if !wxUSE_NANOX
res =
#endif
XQueryTree((Display*) wxGetDisplay(), window, & root, & parent,
& children, & noChildren);
if (children)
XFree(children);
if (res)
return parent;
else
return (Window) 0;
#endif
}
示例7: switch
bool wxPalette::TransferBitmap(void *data, int depth, int size)
{
switch(depth) {
case 8:
{
unsigned char *uptr = (unsigned char *)data;
int pix_array_n;
unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n);
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
while(size-- > 0)
{
if((int)*uptr < pix_array_n)
*uptr = (unsigned char)pix_array[*uptr];
uptr++;
}
return true;
}
default:
return false;
}
}
示例8: PrepareFormats
void wxDataFormat::SetId( const wxString& id )
{
#if !wxUSE_NANOX
PrepareFormats();
m_type = wxDF_PRIVATE;
m_format = XInternAtom( (Display*) wxGetDisplay(), id.ToAscii(), FALSE );
#endif
}
示例9: XGetAtomName
wxString wxDataFormat::GetId() const
{
char *t = XGetAtomName ((Display*) wxGetDisplay(), m_format);
wxString ret( t ); // this will convert from ascii to Unicode
if (t)
XFree( t );
return ret;
}
示例10: wxGetDisplay
void wxGLContext::SwapBuffers()
{
if (m_glContext)
{
Display* display = (Display*) wxGetDisplay();
glXSwapBuffers(display, (Window) wxGetClientAreaWindow(m_window));
}
}
示例11: return
MO_DISPLAY
moGLCanvas::GetDisplay() {
#ifdef MO_WIN32
return NULL;
#else
return (MO_DISPLAY)wxGetDisplay(); //default display;
#endif
}
示例12: long
// Find an existing, or create a new, XFontStruct
// based on this wxFont and the given scale. Append the
// font to list in the private data for future reference.
wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
{
if ( !IsOk() )
return NULL;
long intScale = long(scale * 100.0 + 0.5); // key for wxXFont
int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
// search existing fonts first
wxList::compatibility_iterator node = M_FONTDATA->m_fonts.GetFirst();
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
while (node)
{
wxXFont* f = (wxXFont*) node->GetData();
if ((!display || (f->m_display == display)) && (f->m_scale == intScale))
return f;
node = node->GetNext();
}
wxString xFontName = M_FONTDATA->m_nativeFontInfo.GetXFontName();
if (xFontName == "-*-*-*-*-*--*-*-*-*-*-*-*-*")
// wxFont constructor not called with native font info parameter => take M_FONTDATA values
xFontName.Clear();
// not found, create a new one
XFontStruct *font = (XFontStruct *)
wxLoadQueryNearestFont(pointSize,
M_FONTDATA->m_family,
M_FONTDATA->m_style,
M_FONTDATA->m_weight,
M_FONTDATA->m_underlined,
wxT(""),
M_FONTDATA->m_encoding,
& xFontName);
if ( !font )
{
wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") );
return NULL;
}
wxXFont* f = new wxXFont;
f->m_fontStruct = (WXFontStructPtr)font;
f->m_display = ( display ? display : wxGetDisplay() );
f->m_scale = intScale;
M_FONTDATA->m_fonts.Append(f);
return f;
}
示例13: wxDisplaySizeMM
void wxDisplaySizeMM(int *width, int *height)
{
Display *dpy = (Display*) wxGetDisplay();
if ( width )
*width = DisplayWidthMM(dpy, DefaultScreen (dpy));
if ( height )
*height = DisplayHeightMM(dpy, DefaultScreen (dpy));
}
示例14: wxFlushEvents
// Consume all events until no more left
void wxFlushEvents()
{
Display *display = (Display*) wxGetDisplay();
XSync (display, FALSE);
// TODO for X11
// ??
}
示例15: wxGetMousePosition
void wxGetMousePosition( int* x, int* y )
{
#if wxUSE_NANOX
// TODO
*x = 0;
*y = 0;
#else
XMotionEvent xev;
Window root, child;
XQueryPointer((Display*) wxGetDisplay(),
DefaultRootWindow((Display*) wxGetDisplay()),
&root, &child,
&(xev.x_root), &(xev.y_root),
&(xev.x), &(xev.y),
&(xev.state));
*x = xev.x_root;
*y = xev.y_root;
#endif
};