[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: xcursor and wine
From:       Vijay Kiran Kamuju <infyquest () gmail ! com>
Date:       2005-09-29 9:57:24
Message-ID: 36bf289b05092902552b766ab3 () mail ! gmail ! com
[Download RAW message or body]

Hi,

I just started on writing support for Xcursor, i dont know about the
configure stuff and all that.
So i wrote a small xcursor.c file to be in the dlls/x11drv/ directory.
could any body please tell me how to proceed further.
And also i would like to wite another utility function to convert the
BITMAPINFO into XcursorImage

Thanks,
Vijay

On 9/27/05, Vijay Kiran Kamuju <infyquest@gmail.com> wrote:
> Hi all,
> I any body wants tp implement Xcursor support in wine, for loading
> color cursors.
> What should be implemented, how it should be implemented?
> any details regarding this would be helpful.
> Thanks,
> Vijay
>

["xcursor.c" (application/octet-stream)]

/*
 * Functions to use the Xcursor extension
 *
 * Copyright 2005 Vijay Kiran Kamuju
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "config.h"
#include "wine/port.h"

#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>

#include "windef.h"
#include "winbase.h"
#include "wownt32.h"
#include "x11drv.h"
#include "gdi.h"
#include "wine/library.h"
#include "wine/unicode.h"
#include "wine/debug.h"

#include <X11/Xlib.h>
#include <X11/Xcursor/Xcursor.h>

#ifndef SONAME_LIBX11
#define SONAME_LIBX11 "libX11.so"
#endif
#ifndef SONAME_LIBXCURSOR
#define SONAME_LIBXCURSOR "libXcursor.so"
#endif

static void * xcursor_handle;

#define MAKE_FUNCPTR(f) static typeof(f) * p##f;
MAKE_FUNCPTR(XcursorImageCreate);
MAKE_FUNCPTR(XcursorImageDestroy);
MAKE_FUNCPTR(XcursorImagesCreate);
MAKE_FUNCPTR(XcursorImagesDestroy);
MAKE_FUNCPTR(XcursorCursorsCreate);
MAKE_FUNCPTR(XcursorCursorsDestroy);
MAKE_FUNCPTR(XcursorSupportsARGB);
#undef MAKE_FUNCPTR

void X11DRV_Xcursor_Init(void)
{
  int r = 0;

  if(wine_dlopen(SONAME_LIBX11, RTLD_NOW|RTLD_GLOBAL, NULL, 0) && (xcursor_handle = \
wine_dlopen(SONAME_LIBXRENDER, RTLD_NOW, NULL, 0)))  {
     #define LOAD_FUNCPTR(f) \
             if((p##f = wine_dlsym(xcursor_handle, #f, NULL, 0)) == NULL) \
                 goto sym_not_found;
             LOAD_FUNCPTR(XcursorImageCreate);
             LOAD_FUNCPTR(XcursorImageDestroy);
             LOAD_FUNCPTR(XcursorImagesCreate);
             LOAD_FUNCPTR(XcursorImagesDestroy);
             LOAD_FUNCPTR(XcursorCursorsCreate);
             LOAD_FUNCPTR(XcursorCursorsDestroy);
             LOAD_FUNCPTR(XcursorSupportsARGB);
     #undef LOAD_FUNCPTR
     r=1;

     sym_not_found:
        if (!r)
        {  
          TRACE("Unable to load function ptrs from Xcursor library\n");
          return;
        }
  }
  if(!XcursorSupportsARGB(gdi_display))
  {
     TRACE("Xcursor: display does not support ARGB cursors\n");
  }
}





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic