From bc99d9c78e51f697652e2d55eb0d80b5dc3c9b9c Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 26 May 2003 16:50:54 +0000 Subject: [PATCH] let you retrieve the Window for a surface --- render2/render.h | 1 + render2/surface.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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); -- 2.34.1