Can Any One Tell Me

If the X11 app is fullscreen, it will automatically become the
topmost=20
window, so even “Always On Top” windows will end up under it.

If you run the X11 app in windowed mode, you could make the SDL
window=20
"Always On Top". SDL doesn’t support that, AFAIK, so you have to
deal=20
directly with X11 for this.

Another solution might be to make sure the X11 app doesn’t cover the=20
area of the screen where you want to put your SDL window. That way,=20
window Z order doesn’t matter. You also avoid the performance issues=20
caused by overlapping windows with some drivers.

//David Olofson - Programmer, Composer, Open Source Advocate

=2E- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se

Thanks David For suggestion,
David Sorry to say that the program that I made ,I am running under X mode not in windowed mode,so I want to run my program on bottom ,I read in mailing list some time before that it is possible to put your sdl screen on any existing area but I am not sure about it,as I am not expert about it,I am passing the some source code that is making window/screen in my non-sdl program on which I want to run my sdl program.please suggest me,as this source is not written by me so I have to suggest to the guy who written this code how i can put my sdl screen on bottom,and one more thing for setting up my sdl window postion on bottom I have to set one enveironment variable,will it affect the non-sdl program screen position and as you told me about performence issue how it can be affect the performence .please suggest me,given below is the code that is making screen for non-sdl program…

int on_root=0,debug=0,malloc_trace=0,stdin_mode=0;
GC gc;
Window frame,window;
Display *dpy;
Widget widget;
int playFlag=0;
int width=640;
int height=480;
XWindowAttributes wattr;
Visual *visual;
Screen *scr;
int screen;
int prevFrame;
NPSavedData savedData,*ptrSavedData=&savedData;
NPWindow playerWindow;
NPSetWindowCallbackStruct ws_info;
XtAppContext context;
NPStream _stream,*stream=&_stream;
jmp_buf jmp_point;
XtIntervalId timer;
#define checkErr(a) if(err != NPERR_NO_ERROR){
fprintf(stderr,#a “: error code %d \n”,err);
return 1; }
void sig_handler(int);
extern “C” {
int dprintf(const char *s,…){
int i;
va_list ap;
if(debug){
va_start(ap,s);
i=vfprintf(stderr,s,ap);
va_end(ap);
}
return i;
}

void DumpMem(void* ptr,int count,char* s){
int i;
unsigned p=(unsigned)ptr;
for(i=0;i<(count/sizeof(unsigned));i++){
if((i&0x3) == 0)
dprintf("\n%s - %p(%04x): “,s,p,i);
dprintf(”%08x “,(unsigned)p);
p++;
}
dprintf("\n");
}
unsigned toWord(unsigned char c1,unsigned char c2){
return (((unsigned)c1)|((unsigned)c2)<<8);
}
NPError NPN_GetURL(NPP instance, const char
url, const char* window){
dprintf(“Geturl: %s Window:%s\n”,url,window);
return 0;
}
NPError NPN_PostURL(NPP instance, const char* url, const char* window,
uint32 len, const char* buf, NPBool file){
dprintf(“Unresolved call: posturl called\n”);
return 0;
}
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList){
dprintf(“Unresolved call: requestread called\n”);
return 0;
}
NPError newstream(NPP instance, NPMIMEType type, const char* window, NPStream** stream){
dprintf(“Unresolved call: newstream called\n”);
return 0;
}
int32 NP_Write(NPP instance, NPStream* stream, int32 len, void* buffer){
dprintf(“Unresolved call: write called\n”);
return 0;
}
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason){
dprintf(“Unresolved call: destroystream called\n”);
return 0;
}
void NPN_Status(NPP instance, const char* message){
dprintf(“status called : %s\n”,message);
}
const char* NPN_UserAgent(NPP instance){
dprintf(“UA Called:\n”);
return “Plugin viewer”;
}
void* NPN_MemAlloc(uint32 size){
char ptr=XtMalloc(size+64);
assert(ptr);
if(malloc_trace) dprintf(“malloc(%p,%d)\n”,ptr,size);
return ptr;
}
void NPN_MemFree(void
ptr){
if(malloc_trace) dprintf(“free(%p)”,ptr);
XtFree((char*)ptr);
if(malloc_trace) dprintf(”… Ok\n",ptr);
}
uint32 NPN_MemFlush(uint32 size){
dprintf(“Unresolved call: memflush called\n”);
return 0;
}
void NPN_ReloadPlugins(NPBool reloadPages){
dprintf(“Unresolved call: reloadplugins called\n”);
}
JRIEnv* NPN_GetJavaEnv(void){
dprintf(“Unresolved call: getjavaenv called\n”);
return NULL;
}
jref NPN_GetJavaPeer(NPP instance){
dprintf(“Unresolved call: getjavapeer called\n”);
return NULL;
}
NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData){
dprintf(“Unresolved call: geturlnotify called\n”);
return 0;
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window,
uint32 len, const char* buf, NPBool file, void* notifyData){
dprintf(“Unresolved call: posturlnotify called\n”);
return 0;
}
NPError NPN_SetValue(NPP instance, NPPVariable variable, void value){
dprintf(“Unresolved call:setvalue called\n”);
return 0;
}
void invalidaterect(NPP instance, NPRect rect){
dprintf(“Unresolved call:invalidaterect called\n”);
}
void NSGetFactory(){
dprintf(“Unresolved call:NSGetFactory called\n”);
}
NPError NPN_GetValue(NPP instance, NPNVariable variable, void value){
dprintf(“Unresolved call:getvalue called\n”);
return 0;
}
void NPN_Version(int
plugin_major, int
plugin_minor,
int
netscape_major, int* netscape_minor){
*plugin_major=NP_VERSION_MAJOR;
*plugin_minor=NP_VERSION_MINOR;
*netscape_major=NP_VERSION_MAJOR;
*netscape_minor=NP_VERSION_MINOR;
}
NPError NP_GetValue(NPP instance, NPPVariable variable, void *value);
};
NPNetscapeFuncs funcs = {
sizeof(NPNetscapeFuncs),
NP_VERSION,
NPN_GetURL,
NPN_PostURL,
NPN_RequestRead,
newstream,
NP_Write,
NPN_DestroyStream,
NPN_Status,
NPN_UserAgent,
NPN_MemAlloc,
NPN_MemFree,
NPN_MemFlush,
NPN_ReloadPlugins,
NPN_GetJavaEnv,
NPN_GetJavaPeer,
NPN_GetURLNotify,
NPN_PostURLNotify,
NPN_GetValue
};
static NPPluginFuncs plugin;
void CloseX11(){
FUNCTION_BEGIN “swfplay.cpp : CloseX11\n”);
dprintf(“Close X11 context “);
XtAppSetExitFlag(context);
dprintf(”!”);
XtDestroyApplicationContext(context);
dprintf("!");
XDestroyWindow(dpy,window);
dprintf("!");
XDestroyWindow(dpy,frame);
dprintf("!");
// XCloseDisplay(dpy);
dprintf("… Ok\n");
FUNCTION_END
}
int InitX11(){
FUNCTION_BEGIN “swfplay.cpp : InitX11\n”);
Arg args[2];
XPixmapFormatValues *pf;
int argc=1;
int n;
char * argv[2]={“swfplay”,NULL};
XSetWindowAttributes attr;
unsigned long mask;
XInitThreads();
XtToolkitThreadInitialize();
XtToolkitInitialize ();
context = XtCreateApplicationContext();
dpy = XtOpenDisplay (context,
getenv(“PLAYDPY”)?getenv(“PLAYDPY”):getenv(“DISPLAY”),
“SwfPlay”, “SwfPlay”, 0,0,
&argc, argv);
if (dpy == 0) {
fprintf(stderr,“Can’t open X display\n”);
exit(1);
}
if(!XShmQueryExtension(dpy)){
fprintf(stderr,“No SHM extension found”);
}

scr = DefaultScreenOfDisplay(dpy);
screen = XScreenNumberOfScreen(scr);
gc = DefaultGC(dpy, DefaultScreen(dpy));
attr.bit_gravity = NorthWestGravity;
attr.event_mask =
// ButtonMotionMask |
// ButtonPressMask |
// ButtonReleaseMask |
EnterWindowMask |
ExposureMask |
// KeyPressMask |
// KeyReleaseMask |
// LeaveWindowMask |
// PointerMotionMask |
StructureNotifyMask |
VisibilityChangeMask |
FocusChangeMask;
mask = CWBitGravity | CWEventMask | CWBorderPixel | CWBackPixel;
if (on_root) {
//frame = VirtualRootWindowOfScreen(screen);
Window root = RootWindow(dpy, DefaultScreen(dpy));
XGetWindowAttributes(dpy, root, &wattr);
width = wattr.width;
height = wattr.height;
dprintf(“use root window\n”);
}
frame = XCreateSimpleWindow
(dpy, RootWindow(dpy, screen),
0, 0, width, height, 0,
BlackPixel(dpy, screen),
BlackPixel(dpy, screen));
XChangeWindowAttributes(dpy,frame,mask,&attr);
XMapWindow(dpy, frame);
XSetWindowBackground(dpy,frame,BlackPixel(dpy, screen));
XSetWindowBackgroundPixmap(dpy,frame,None);
XSelectInput(dpy, frame, ExposureMask);
XGetWindowAttributes(dpy, frame, &wattr);
visual = wattr.visual;
width = wattr.width;
height = wattr.height;
XFlush(dpy);
Widget topLevel =
XtAppCreateShell(“drawingArea”, “SwfPlay”,
topLevelShellWidgetClass, dpy, NULL, 0);
widget = XtVaCreateWidget(“form”, compositeWidgetClass, topLevel, NULL);
n = 0;
XtSetArg(args[n], XtNheight, height); n++;
XtSetArg(args[n], XtNwidth, width); n++;
XtSetValues(topLevel, args, n);
n = 0;
XtSetArg(args[n], XtNheight, height); n++;
XtSetArg(args[n], XtNwidth, width); n++;
XtSetValues(widget, args, n);
topLevel->core.window = frame;
XtRegisterDrawable(dpy,frame,topLevel);
XtRealizeWidget(widget);
XtRealizeWidget(topLevel);
window = XtWindow(widget);
XSetWindowBackground(dpy,window,BlackPixel(dpy, screen));
XSetWindowBackgroundPixmap(dpy,window,None);
XtManageChild(widget);
XFlush(dpy);
//Pixmap pixmap=XCreatePixmap(dpy,frame,1,1,1);
//static XColor black;
//Cursor cursor=XCreatePixmapCursor(dpy,pixmap,pixmap,&black,&black,0,0);
//Cursor dot=XCreateFontCursor(dpy,XC_man);
XDefineCursor(dpy,window,None);
XDefineCursor(dpy,frame,None);
XWarpPointer(dpy,window,window,0,0,0,0,width,height);
//XUnmapSubwindows(dpy,frame);
playerWindow.window = (void*) window;
playerWindow.x=0;
playerWindow.y=0;
playerWindow.width=width; /* Maximum window size */
playerWindow.height=height;
playerWindow.clipRect.top =10;
playerWindow.clipRect.left=10;
playerWindow.clipRect.right=width -20;
playerWindow.clipRect.bottom= height -20;
playerWindow.ws_info=&ws_info;
ws_info.type=0;
ws_info.display=dpy;
ws_info.visual=visual;
ws_info.colormap=DefaultColormap(dpy,screen);
ws_info.depth=DefaultDepth(dpy,screen);
XUnmapSubwindows(dpy,frame);
return 0;
FUNCTION_END
}

do’t confuse with NPN we are using Netscape plugin to play .swf file as this player can play mpeg,.avi,and .swf file . for mpeg and avi guy is using mplayer .
So now please suggest me how i can emmbed my scroller on the existing player should i make my scroll the part of existing player if yes then how? If no then how can I run sepratly.Bcoz I have to justify my project manager to do this.
Thanks in advance.On Thursday 06 November 2003 02.41, Sharad Bajaj wrote:

Hello,
I have one program running on linux made in X11,I want to
run one SDL program on bottom of screen that is scroller,How can i
put my sdl window on that existing screen,because whenever i run
both program that SDL window is being hide,please help me,I am
using Red hat 8.0 . Thanks in Advance.


Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard