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


C++ wxGetDisplay函数代码示例

本文整理汇总了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 );
}
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:11,代码来源:glcanvas.cpp

示例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;
}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:29,代码来源:dcscreen.cpp

示例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);
        }
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:30,代码来源:glcanvas.cpp

示例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);
}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:26,代码来源:dcmemory.cpp

示例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());
}
开发者ID:rkvsraman,项目名称:eviacam,代码行数:31,代码来源:wxappbar.cpp

示例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
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:31,代码来源:app.cpp

示例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;
    }
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:30,代码来源:palette.cpp

示例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
}
开发者ID:chromylei,项目名称:third_party,代码行数:8,代码来源:dataobj.cpp

示例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;
}
开发者ID:chromylei,项目名称:third_party,代码行数:8,代码来源:dataobj.cpp

示例10: wxGetDisplay

void wxGLContext::SwapBuffers()
{
    if (m_glContext)
    {
        Display* display = (Display*) wxGetDisplay();
        glXSwapBuffers(display, (Window) wxGetClientAreaWindow(m_window));
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:8,代码来源:glcanvas.cpp

示例11: return

MO_DISPLAY
moGLCanvas::GetDisplay() {
    #ifdef MO_WIN32
        return NULL;
    #else
        return (MO_DISPLAY)wxGetDisplay(); //default display;
    #endif
}
开发者ID:inaes-tic,项目名称:tv-moldeo,代码行数:8,代码来源:moGLCanvas.cpp

示例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;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:61,代码来源:font.cpp

示例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));
}
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:9,代码来源:utils.cpp

示例14: wxFlushEvents

// Consume all events until no more left
void wxFlushEvents()
{
    Display *display = (Display*) wxGetDisplay();

    XSync (display, FALSE);

    // TODO for X11
    // ??
}
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:10,代码来源:utils.cpp

示例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
};
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:19,代码来源:utils.cpp


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