From: Dana Jansens Date: Mon, 26 May 2003 16:50:54 +0000 (+0000) Subject: let you retrieve the Window for a surface X-Git-Tag: gl2~117 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=bc99d9c78e51f697652e2d55eb0d80b5dc3c9b9c;p=dana%2Fopenbox.git let you retrieve the Window for a surface --- diff --git a/render2/render.h b/render2/render.h index 1eb682ca..8c0611ca 100644 --- a/render2/render.h +++ b/render2/render.h @@ -132,6 +132,7 @@ struct RrSurface *RrSurfaceCopyChild(struct RrSurface *sur, struct RrSurface *parent); void RrSurfaceFree(struct RrSurface *sur); +Window RrSurfaceWindow(struct RrSurface *sur); struct RrTexture *RrSurfaceTexture(struct RrSurface *sur, int texnum); #endif diff --git a/render2/surface.c b/render2/surface.c index 37f7a040..ab265ef7 100644 --- a/render2/surface.c +++ b/render2/surface.c @@ -62,7 +62,7 @@ struct RrSurface *RrSurfaceNewChild(enum RrSurfaceType type, { struct RrSurface *sur; - /* cant be a child of a prototype! */ + /* can't be a child of a prototype! */ assert(parent->inst); if (!parent->inst) return NULL; @@ -115,7 +115,7 @@ struct RrSurface *RrSurfaceCopyChild(struct RrSurface *orig, { struct RrSurface *sur; - /* cant be a child of a prototype! */ + /* can't be a child of a prototype! */ assert(parent->inst); if (!parent->inst) return NULL; @@ -137,6 +137,15 @@ void RrSurfaceFree(struct RrSurface *sur) } } +Window RrSurfaceWindow(struct RrSurface *sur) +{ + /* can't get a window for a prototype */ + assert(sur->inst); + if (!sur->inst) return None; + + return sur->win; +} + struct RrTexture *RrSurfaceTexture(struct RrSurface *sur, int texnum) { assert(texnum < sur->ntextures);