summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-16 06:25:52 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-16 06:25:52 +0000
commitbbf369b9e52d718ce335c60aa457bee86b40503d (patch)
tree919d1a975d346d1e720152cdba066657bf7b33e6 /recordmydesktop/src
parent70ed9b12e14fa40b16bfa92011ea1d2d67155b7e (diff)
src/rmd_types.h: Remove DisplaySpecs::bpixel and wpixel.
src/rmd_make_dummy_pointer.[ch]: Take Display as a parameter to MakeDummyPointer() and put bpixel and wpixel locally here instead. src/rmd.c: Remove initialization of DisplaySpecs::bpixel and wpixel. src/rmd_initialize_data.c: Pass Display to MakeDummyPointer(). git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@549 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/rmd.c2
-rw-r--r--recordmydesktop/src/rmd_initialize_data.c9
-rw-r--r--recordmydesktop/src/rmd_make_dummy_pointer.c28
-rw-r--r--recordmydesktop/src/rmd_make_dummy_pointer.h3
-rw-r--r--recordmydesktop/src/rmd_types.h2
5 files changed, 23 insertions, 21 deletions
diff --git a/recordmydesktop/src/rmd.c b/recordmydesktop/src/rmd.c
index 92e247f..bb513a2 100644
--- a/recordmydesktop/src/rmd.c
+++ b/recordmydesktop/src/rmd.c
@@ -84,8 +84,6 @@ int main(int argc,char **argv){
pdata.specs.visual = DefaultVisual(pdata.dpy, pdata.specs.screen);
pdata.specs.gc = DefaultGC(pdata.dpy, pdata.specs.screen);
pdata.specs.depth = DefaultDepth(pdata.dpy, pdata.specs.screen);
- pdata.specs.bpixel = XBlackPixel(pdata.dpy, pdata.specs.screen);
- pdata.specs.wpixel = XWhitePixel(pdata.dpy, pdata.specs.screen);
if((pdata.specs.depth!=32)&&
(pdata.specs.depth!=24)&&
diff --git a/recordmydesktop/src/rmd_initialize_data.c b/recordmydesktop/src/rmd_initialize_data.c
index 32bd529..631e725 100644
--- a/recordmydesktop/src/rmd_initialize_data.c
+++ b/recordmydesktop/src/rmd_initialize_data.c
@@ -63,9 +63,12 @@ int InitializeData(ProgData *pdata,
fprintf(stderr,"Initializing...\n");
MakeMatrices();
if(pdata->args.have_dummy_cursor){
- pdata->dummy_pointer=MakeDummyPointer(&pdata->specs,16,
- pdata->args.cursor_color,0,
- &pdata->npxl);
+ pdata->dummy_pointer = MakeDummyPointer(pdata->dpy,
+ &pdata->specs,
+ 16,
+ pdata->args.cursor_color,
+ 0,
+ &pdata->npxl);
pdata->dummy_p_size=16;
}
else
diff --git a/recordmydesktop/src/rmd_make_dummy_pointer.c b/recordmydesktop/src/rmd_make_dummy_pointer.c
index e49178e..7b409cf 100644
--- a/recordmydesktop/src/rmd_make_dummy_pointer.c
+++ b/recordmydesktop/src/rmd_make_dummy_pointer.c
@@ -26,17 +26,22 @@
#include "config.h"
+#include <X11/Xlib.h>
+
#include "rmd_types.h"
#include "rmd_macro.h"
#include "rmd_make_dummy_pointer.h"
-unsigned char *MakeDummyPointer(DisplaySpecs *specs,
+unsigned char *MakeDummyPointer(Display *display,
+ DisplaySpecs *specs,
int size,
int color,
int type,
unsigned char *npxl){
+ unsigned long bpixel = XBlackPixel(display, specs->screen);
+ unsigned long wpixel = XWhitePixel(display, specs->screen);
int i,k,o='.';
unsigned long b=(color)?'w':'b',
w=(color)?'b':'w';
@@ -59,18 +64,15 @@ unsigned char *MakeDummyPointer(DisplaySpecs *specs,
{o,o,o,o,o,o,w,w,o,o,o,o,o,o,o,o}}
};
unsigned char *ret=malloc(size*sizeof(char[size*4]));
- unsigned char wp[4]={
- ((specs->wpixel^0xff000000)>>24),
- ((specs->wpixel^0x00ff0000)>>16),
- ((specs->wpixel^0x0000ff00)>>8),
- ((specs->wpixel^0x000000ff))
- };
- unsigned char bp[4]={
- ((specs->bpixel^0xff000000)>>24),
- ((specs->bpixel^0x00ff0000)>>16),
- ((specs->bpixel^0x0000ff00)>>8),
- ((specs->bpixel^0x000000ff))
- };
+ unsigned char wp[4]={ (wpixel ^ 0xff000000) >> 24,
+ (wpixel ^ 0x00ff0000) >> 16,
+ (wpixel ^ 0x0000ff00) >> 8,
+ (wpixel ^ 0x000000ff) };
+ unsigned char bp[4]={ (bpixel ^ 0xff000000) >> 24,
+ (bpixel ^ 0x00ff0000) >> 16,
+ (bpixel ^ 0x0000ff00) >> 8,
+ (bpixel ^ 0x000000ff) };
+
*npxl=((wp[0]-1)!=bp[0])?wp[0]-100:wp[0]-102;
for(i=0;i<size;i++){
for(k=0;k<size;k++){
diff --git a/recordmydesktop/src/rmd_make_dummy_pointer.h b/recordmydesktop/src/rmd_make_dummy_pointer.h
index c0aa144..cd7a9a0 100644
--- a/recordmydesktop/src/rmd_make_dummy_pointer.h
+++ b/recordmydesktop/src/rmd_make_dummy_pointer.h
@@ -48,7 +48,8 @@
*
* \returns Pointer to pixel data of the cursor
*/
-unsigned char *MakeDummyPointer(DisplaySpecs *specs,
+unsigned char *MakeDummyPointer(Display *display,
+ DisplaySpecs *specs,
int size,
int color,
int type,
diff --git a/recordmydesktop/src/rmd_types.h b/recordmydesktop/src/rmd_types.h
index 2af06b2..89271b8 100644
--- a/recordmydesktop/src/rmd_types.h
+++ b/recordmydesktop/src/rmd_types.h
@@ -86,8 +86,6 @@ typedef struct _DisplaySpecs{ //this struct holds some basic information
Visual *visual;
GC gc;
int depth;
- unsigned long bpixel;
- unsigned long wpixel;
}DisplaySpecs;
typedef struct _WGeometry{ //basic geometry of a window or area
© All Rights Reserved