Changeset 3487:be2ecd9ae926 in roaraudio


Ignore:
Timestamp:
02/14/10 17:48:01 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updated x11 interface a bit

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/roarx11.h

    r3375 r3487  
    3838#include "libroar.h" 
    3939 
     40#ifdef ROAR_HAVE_LIBX11 
     41#define _ROAR_X11_DISPLAY Display 
     42#else 
     43#define _ROAR_X11_DISPLAY void 
     44#endif 
     45 
    4046struct roar_x11_connection { 
    4147#ifdef ROAR_HAVE_LIBX11 
     48 int close; 
    4249 Display * display; 
    4350#else 
     
    4754 
    4855struct roar_x11_connection * roar_x11_connect(char * display); 
     56struct roar_x11_connection * roar_x11_connect_display(_ROAR_X11_DISPLAY * display); 
    4957int    roar_x11_disconnect(struct roar_x11_connection * con); 
    5058 
  • libroar/roarx11.c

    r3474 r3487  
    5151 } 
    5252 
     53 con->close = 1; 
     54 
     55 return con; 
     56#else 
     57 return NULL; 
     58#endif 
     59} 
     60 
     61struct roar_x11_connection * roar_x11_connect_display(_ROAR_X11_DISPLAY * display) { 
     62#ifdef ROAR_HAVE_LIBX11 
     63 struct roar_x11_connection * con; 
     64 
     65 if ( display == NULL ) 
     66  return NULL; 
     67 
     68 if ( (con = roar_mm_malloc(sizeof(struct roar_x11_connection))) == NULL ) 
     69  return NULL; 
     70 
     71 con->close   = 0; 
     72 con->display = display; 
     73 
    5374 return con; 
    5475#else 
     
    5980int roar_x11_disconnect(struct roar_x11_connection * con) { 
    6081#ifdef ROAR_HAVE_LIBX11 
    61  int ret; 
     82 int ret = 0; 
    6283 
    6384 if ( con == NULL ) 
    6485  return -1; 
    6586 
    66  ret = XCloseDisplay(con->display); 
     87 if ( con->close ) 
     88  ret = XCloseDisplay(con->display); 
    6789 
    6890 roar_mm_free(con); 
Note: See TracChangeset for help on using the changeset viewer.