您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxGetDisplay函数代码示例

51自学网 2021-06-03 10:10:01
  C++
这篇教程C++ wxGetDisplay函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了wxGetDisplay函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,


示例2: wxWindowDCImpl

// Create a DC representing the whole screenwxScreenDCImpl::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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例10: wxGetDisplay

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


示例11: return

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


示例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,


示例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,


示例14: wxFlushEvents

// Consume all events until no more leftvoid wxFlushEvents(){    Display *display = (Display*) wxGetDisplay();    XSync (display, FALSE);    // TODO for X11    // ??}
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:10,


示例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,


示例16: XDestroyWindow

bool wxScreenDCImpl::EndDrawingOnTop(){    if (sm_overlayWindow)    {        XDestroyWindow((Display*) wxGetDisplay(), (Window) sm_overlayWindow);        sm_overlayWindow = 0;        return true;    }    else        return false;}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:11,


示例17: defined

void WXAppBar::OnTimer(wxTimerEvent& event){#if defined(__WXGTK__)	long x, y;		m_pMouseControl->GetPointerLocation (x, y);	wxRect barRect = GetRect();		if (m_autohide && m_currentDockingMode != NON_DOCKED && m_isAutohideWindowShown && !barRect.Contains(x,y))	{		// Get X11 display		Display* dd= (Display *) wxGetDisplay(); assert (dd);				// Get desktop working area dimensions		int xDesktop, yDesktop, widthDesktop, heightDesktop, screenWidth, screenHeight;		GetDesktopDimensions (dd, xDesktop, yDesktop, widthDesktop, heightDesktop, screenWidth, screenHeight);		// Get original dimensions of the bar		wxSize proposedSize= GetBestSize();		// Compute bar position and size depending on docking mode		m_Width= proposedSize.GetWidth();		m_Height= proposedSize.GetHeight();			switch (m_currentDockingMode) {			case TOP_DOCKED:				m_X= (screenWidth - proposedSize.GetWidth())/2;				m_Y= 0 - proposedSize.GetHeight() + AUTOHIDE_FLANGE;				break;			case BOTTOM_DOCKED:				m_X= (screenWidth - proposedSize.GetWidth())/2;				m_Y= screenHeight - AUTOHIDE_FLANGE;				break;			case LEFT_DOCKED:				m_X= 0 - proposedSize.GetWidth() + AUTOHIDE_FLANGE;				m_Y= (screenHeight - proposedSize.GetHeight())/2;				break; 			case RIGHT_DOCKED:				m_X= screenWidth - AUTOHIDE_FLANGE;				m_Y= (screenHeight - proposedSize.GetHeight())/2;				break;			case NON_DOCKED:			default:				assert (false);		}				// Set desired location and dimensions		SetSize(m_X, m_Y, m_Width, m_Height);				m_isAutohideWindowShown= false;	}#endif	event.Skip(false);}
开发者ID:rkvsraman,项目名称:eviacam,代码行数:54,


示例18: GetColourIndex

int wxGLCanvas::GetColourIndex(const wxColour& col_){    wxColour& col = const_cast<wxColour&>(col_);#ifdef __WXMOTIF__    col.AllocColour(GetXDisplay());#else    col.CalcPixel(wxTheApp->GetMainColormap(wxGetDisplay()));#endif    return col.GetPixel();}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:12,


示例19:

wxClipboard::wxClipboard(){    m_open = false;    m_ownsClipboard = false;    m_ownsPrimarySelection = false;    m_data = NULL;    m_receivedData = NULL;    /* we use m_targetsWidget to query what formats are available */    /* we use m_clipboardWidget to get and to offer data */#if !wxUSE_NANOX    if (!g_clipboardAtom) g_clipboardAtom = XInternAtom( (Display*) wxGetDisplay(), "CLIPBOARD", False );    if (!g_targetsAtom) g_targetsAtom = XInternAtom( (Display*) wxGetDisplay(), "TARGETS", False );#endif    m_formatSupported = false;    m_targetRequested = 0;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:21,


示例20: GetXPixArray

bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz,                                void *dest, unsigned int bpp){    int pix_array_n;    unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n);    switch(bpp) {    case 8: {        unsigned char *dptr = (unsigned char *)dest;        while(sz-- > 0) {            if((int)*data < pix_array_n)                *dptr = (unsigned char)pix_array[*data];            data++;            dptr++;        }        break;            }    case 16: {        unsigned short *dptr = (unsigned short *)dest;        while(sz-- > 0) {            if((int)*data < pix_array_n)                *dptr = (unsigned short)pix_array[*data];            data++;            dptr++;        }        break;             }    case 24: {        struct rgb24 { unsigned char r, g, b; } *dptr = (struct rgb24 *)dest;        while(sz-- > 0) {            if((int)*data < pix_array_n) {                dptr->r = pix_array[*data] & 0xFF;                dptr->g = (pix_array[*data] >> 8) & 0xFF;                dptr->b = (pix_array[*data] >> 16) & 0xFF;            }            data++;            dptr++;        }        break;             }    case 32: {        unsigned long *dptr = (unsigned long *)dest;        while(sz-- > 0) {            if((int)*data < pix_array_n)                *dptr = pix_array[*data];            data++;            dptr++;        }        break;             }    default:        return false;    }
开发者ID:gitrider,项目名称:wxsj2,代码行数:52,


示例21: wxGetDisplay

WXWidget wxApp::GetTopLevelRealizedWidget(){    WXDisplay* display = wxGetDisplay();    wxPerDisplayDataMap::iterator it = m_perDisplayData->find( display );    if( it != m_perDisplayData->end() && it->second->m_topLevelRealizedWidget )        return (WXWidget)it->second->m_topLevelRealizedWidget;    WXWidget rTlw = wxCreateTopLevelRealizedWidget( display );    SetTopLevelRealizedWidget( display, rTlw );    return rTlw;}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:13,


示例22: WXUNUSED

wxGLContext::wxGLContext(                bool WXUNUSED(isRGB), wxWindow *win,                const wxPalette& WXUNUSED(palette),               const wxGLContext *other        /* for sharing display lists */){    m_window = win;    // m_widget = win->m_wxwindow;    wxGLCanvas *gc = (wxGLCanvas*) win;    XVisualInfo *vi = (XVisualInfo *) gc->m_vi;        wxCHECK_RET( vi, wxT("invalid visual for OpenGL") );        if( other != 0 )        m_glContext = glXCreateContext( (Display *)wxGetDisplay(), vi,                                         other->m_glContext, GL_TRUE );    else        m_glContext = glXCreateContext( (Display *)wxGetDisplay(), vi,                                        None, GL_TRUE );        wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGL context") );}
开发者ID:gitrider,项目名称:wxsj2,代码行数:23,


示例23: m_enabled

CPointerAction::CPointerAction() : m_enabled(false){	m_pClickSound= new wxSound (eviacam::GetDataDir() + _T("/click.wav"));	m_pLeftUpClickSound= new wxSound (eviacam::GetDataDir() + _T("/click2.wav"));#if defined(__WXGTK__)	m_pMouseControl= new CMouseControl ((void *) wxGetDisplay());#else	m_pMouseControl= new CMouseControl ();#endif	m_pDwellClick= new CDwellClick (*m_pMouseControl);	m_pGestureClick= new CGestureClick (*m_pMouseControl);		InitDefaults ();}
开发者ID:rkvsraman,项目名称:eviacam,代码行数:16,


示例24: wxGetKeyState

bool wxGetKeyState(wxKeyCode key){    wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=        WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));    Display *pDisplay = (Display*) wxGetDisplay();    int iKey = wxCharCodeWXToX(key);    int          iKeyMask = 0;    Window       wDummy1, wDummy2;    int          iDummy3, iDummy4, iDummy5, iDummy6;    unsigned int iMask;    KeyCode keyCode = XKeysymToKeycode(pDisplay,iKey);    if (keyCode == NoSymbol)        return false;    if ( IsModifierKey(iKey) )  // If iKey is a modifier key, use a different method    {        XModifierKeymap *map = XGetModifierMapping(pDisplay);        wxCHECK_MSG( map, false, wxT("failed to get X11 modifiers map") );        for (int i = 0; i < 8; ++i)        {            if ( map->modifiermap[map->max_keypermod * i] == keyCode)            {                iKeyMask = 1 << i;            }        }        XQueryPointer(pDisplay, DefaultRootWindow(pDisplay), &wDummy1, &wDummy2,                        &iDummy3, &iDummy4, &iDummy5, &iDummy6, &iMask );        XFreeModifiermap(map);        return (iMask & iKeyMask) != 0;    }    // From the XLib manual:    // The XQueryKeymap() function returns a bit vector for the logical state of the keyboard,    // where each bit set to 1 indicates that the corresponding key is currently pressed down.    // The vector is represented as 32 bytes. Byte N (from 0) contains the bits for keys 8N to 8N + 7    // with the least-significant bit in the byte representing key 8N.    char key_vector[32];    XQueryKeymap(pDisplay, key_vector);    return key_vector[keyCode >> 3] & (1 << (keyCode & 7));}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:44,


示例25: UnRef

bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue){    UnRef();    if (!n) {        return false;    }    m_refData = new wxPaletteRefData;    XColor xcol;    Display* display = (Display*) wxGetDisplay();    unsigned long *pix_array;    Colormap cmap;    int pix_array_n;    cmap = (Colormap) wxTheApp->GetMainColormap(display);    pix_array = new unsigned long[n];    if (!pix_array)        return false;    pix_array_n = n;    xcol.flags = DoRed | DoGreen | DoBlue;    for(int i = 0; i < n; i++) {        xcol.red = (unsigned short)red[i] << 8;        xcol.green = (unsigned short)green[i] << 8;        xcol.blue = (unsigned short)blue[i] << 8;        pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel;    }    wxXPalette *c = new wxXPalette;    c->m_pix_array_n = pix_array_n;    c->m_pix_array = pix_array;    c->m_cmap = (WXColormap) cmap;    c->m_display = (WXDisplay*) display;    c->m_destroyable = false;    M_PALETTEDATA->m_palettes.Append(c);    return true;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:43,



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


C++ wxGetEnv函数代码示例
C++ wxGetCwd函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。