Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 191532 Details for
Bug 340367
crashes with java exit code 1 on shared workspace after moving to new computer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
window manager part x11
window_x11.cpp (text/plain), 4.84 KB, created by
Missing name
on 2011-03-18 13:52:03 EDT
(
hide
)
Description:
window manager part x11
Filename:
MIME Type:
Creator:
Missing name
Created:
2011-03-18 13:52:03 EDT
Size:
4.84 KB
patch
obsolete
> >// ##### window_x11.cpp on Mar 15, 2011 >// ##### Used for X11 01 >// ##### Created by WeltEnSTurm > >#include "main.hpp" > >#ifdef SYSTEM_LINUX >#include "window.hpp" > >#include <iostream> > >#define CWX (1<<0) >#define CWY (1<<1) >#define CWWidth (1<<2) >#define CWHeight (1<<3) >#define CWBorderWidth (1<<4) >#define CWSibling (1<<5) >#define CWStackMode (1<<6) > >Display* RootDisplay = 0; > >std::vector<wm::window*> WindowList; >wm::window* ActiveWindow = 0; > >unsigned int WindowCount = 0; >unsigned int WindowCountActive = 0; > >void wm::Main(){ > ProcessEvents(); >} > >void wm::Cleanup(){ > XCloseDisplay(RootDisplay); >} > >bool wm::HasWindows(){ > return WindowCount>0; >} > >bool wm::HasActiveWindows(){ > return WindowCountActive>0; >} > >void wm::ProcessEvents(){ > XEvent ev; > XNextEvent(RootDisplay, &ev); > for(unsigned int i=0; i<WindowList.size(); i++){ > if(ev.xany.window == WindowList[i]->mWindow){ > ActiveWindow = WindowList[i]; > ActiveWindow->ProcessEvents(ev); > ActiveWindow=0; > break; > } > } >} > >// wm::window > >long DefaultMask = ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask; > >void wm::window::init(){ > mWindow=0; > mFuncOnThink=0; > mFuncOnKeyboard=0; > mFuncOnMouseButton=0; > mFuncOnMouseMove=0; > mFuncOnResize=0; > mFuncOnMove=0; > mFuncOnClose=0; > mIdentifier=mPosX=mPosY=0; > mWidth=mHeight=50; > mWindowReady=mDelayMove=false; > > mIdentifier = WindowList.size()+1; > WindowList.push_back(this); > WindowCount++; >} > >wm::window::~window(){ > if(WindowList[mIdentifier]){ > WindowList[mIdentifier] = 0; > XCloseDisplay(mDisplay); > WindowCount--; > } > if(WindowCount) return; > > XCloseDisplay(mDisplay); >} > >wm::window::window(){ > init(); >} > >wm::window::window(int x, int y, int w, int h, std::string name){ > init(); > SetTitle(name); > SetPos(x,y); > SetSize(w,h); > Show(); >} > >void wm::window::Show(){ > if(!mWindowReady){ > RootDisplay = RootDisplay ? RootDisplay : XOpenDisplay(NULL); > if(!RootDisplay) > errexit("ERROR: Could not retrieve XServer display"); > int background = BlackPixel(RootDisplay, DefaultScreen(RootDisplay)); > mDisplay = RootDisplay; > mWindow = XCreateSimpleWindow(mDisplay, DefaultRootWindow(mDisplay), 0, 0, mWidth, mHeight, 0, background, background); > > XSelectInput(mDisplay, mWindow, DefaultMask); > Atom wmDelete=XInternAtom(mDisplay, "WM_DELETE_WINDOW", True); > XSetWMProtocols(mDisplay, mWindow, &wmDelete, 1); > > XMapWindow(mDisplay, mWindow); > > mWindowReady=true; > if(mDelayMove) SetPos(mPosX, mPosY); > if(mDelayRename) SetTitle(mTitle); > WindowCountActive++; > } >} > >void wm::window::Hide(){ > if(mWindowReady){ > mWindowReady=false; > XUnmapWindow(mDisplay, mWindow); > WindowCountActive--; > } >} > >void wm::window::SetPos(int x, int y){ > mPosX=x; mPosY=y; > if(!mWindowReady){mDelayMove=true; return;} > XWindowChanges data = {x, y}; > XConfigureWindow(mDisplay, mWindow, CWX | CWY, &data); > mDelayMove=false; >} > >void wm::window::SetSize(int w, int h){ > mWidth=w; mHeight=h; > if(!mWindowReady) return; > XWindowChanges data = {0, 0, w, h}; > XConfigureWindow(mDisplay, mWindow, CWWidth | CWHeight, &data); >} > >void wm::window::SetTitle(std::string name){ > mTitle = name; > if(!mWindowReady){mDelayRename=true; return;} > XTextProperty t; > char* c=(char*)name.c_str(); > XStringListToTextProperty(&c, 1, &t); > XSetWMName(mDisplay, mWindow, &t); >} > >void wm::window::SetMode(WINDOW_MODE mode){ > if(mode == mWindowMode) return; > if(mWindowMode == WINDOW_WINDOWED){ > mPosXOld = mPosX; > mPosYOld = mPosY; > } >} > >void wm::window::ProcessEvents(XEvent ev){ > mFuncOnThink ? mFuncOnThink() : OnThink(); > switch(ev.type){ > case ConfigureNotify: > if(mWidth != ev.xconfigure.width || mHeight != ev.xconfigure.height){ > mFuncOnResize ? mFuncOnResize(ev.xconfigure.width, ev.xconfigure.height) : OnResize(ev.xconfigure.width, ev.xconfigure.height); > mWidth = ev.xconfigure.width; mHeight = ev.xconfigure.height; > } > if(mPosX != ev.xconfigure.x || mPosY != ev.xconfigure.y){ > mFuncOnMove ? mFuncOnMove(ev.xconfigure.x, ev.xconfigure.y) : OnMove(ev.xconfigure.x, ev.xconfigure.y); > mPosX = ev.xconfigure.x; mPosY = ev.xconfigure.y; > } > break; > > case ButtonPress: > mFuncOnMouseButton ? mFuncOnMouseButton(ev.xbutton.button, true) : OnMouseButton(ev.xbutton.button, true); > break; > case ButtonRelease: > mFuncOnMouseButton ? mFuncOnMouseButton(ev.xbutton.button, false) : OnMouseButton(ev.xbutton.button, false); > break; > > case KeyPress: > mFuncOnKeyboard ? mFuncOnKeyboard(ev.xkey.keycode, true) : OnKeyboard(ev.xkey.keycode, true); > break; > case KeyRelease: > mFuncOnKeyboard ? mFuncOnKeyboard(ev.xkey.keycode, false) : OnKeyboard(ev.xkey.keycode, false); > break; > > case ClientMessage: > mFuncOnClose ? mFuncOnClose() : OnClose(); > break; > } >} > >#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 340367
:
191512
| 191532