summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Bosveld <joel@joel-desktop.(none)>2008-01-25 12:45:49 +0900
committerJoel Bosveld <joel@joel-desktop.(none)>2008-01-25 12:45:49 +0900
commit13fb652485a8449d2881b37c5f15fcd524287c21 (patch)
treeb517287a8221b783870302a8eedfc766b8ce60ac
parent4b5d524dfaa44b34f8c35ba2a5be2b5361a0a41f (diff)
downloadcubedbus-13fb652485a8449d2881b37c5f15fcd524287c21.tar.gz
cubedbus-13fb652485a8449d2881b37c5f15fcd524287c21.tar.bz2
Fix modify action to call correct function
-rw-r--r--cubedbus.c58
1 files changed, 42 insertions, 16 deletions
diff --git a/cubedbus.c b/cubedbus.c
index 6bb4c91..ba527e8 100644
--- a/cubedbus.c
+++ b/cubedbus.c
@@ -215,33 +215,50 @@ cubedbusModifyObject (CompDisplay *d,
CompOption *option,
int nOption)
{
+ //get gs pointer
CompScreen *s;
Window xid;
xid = getIntOptionNamed (option, nOption, "root", 0);
s = findScreenAtDisplay (d, xid);
- if(!s) return FALSE;
+ if(!s) return FALSE;
CUBEDBUS_SCREEN(s);
- CubedbusObject *objptr;
- objptr=gs->head;
- char name[16];
+ CubedbusObject *head=gs->head;
+ CubedbusObject *objptr=gs->head;
- char *tempName=getStringOptionNamed (option,nOption,"name", "");
-
- if(strlen(tempName) >= 16) /* should be array length */
+ CubedbusName *cubedbusName = malloc (sizeof(CubedbusName));
+ int i;
+
+ if(!cubedbusGetName( getStringOptionNamed(option,nOption,"name",""), cubedbusName )) return FALSE;
+
+ /* sets the head pointer correctly */
+
+ for(i=0;i<cubedbusName->n -1 ;i++) /* stop 1 before the object to be created */
{
- compLogMessage (NULL,"cubedbus",CompLogLevelError, "name is too long");
- return FALSE;
+ while(1)
+ {
+ if(objptr == NULL) return FALSE;
+
+ if(!strcmp(objptr->name, cubedbusName->string[i]))
+ {
+ head=objptr;
+ CubedbusObj *data=objptr->data;
+ objptr=data->firstChild;
+ break;
+ }
+ else objptr=objptr->next;
+ }
}
- strcpy(name,tempName);
-
- while(1)
+
+ while(1)
{
- if(objptr==NULL) return FALSE;
- if(!strcmp(objptr->name,name)) return (objptr->modfunc) (objptr, option, nOption);
+ if(objptr==NULL) return false;
+ if(!strcmp(objptr->name,cubedbusName->string[i]))
+ {
+ return (objptr->modfunc) (objptr, option, nOption);
+ }
objptr=objptr->next;
}
-
}
@@ -354,7 +371,16 @@ cubedbusPaintInside (CompScreen *s,
sA.yRotate += cs->invert * (360.0f / size) *
(cs->xRotations - (s->x * cs->nOutput)); /*?*/
-
+
+ FILE *fp=fopen("/tmp/compiz.matrix","w");
+ fprintf(fp,"%f\n",sA.xRotate);
+ fprintf(fp,"%f\n",sA.yRotate);
+ fprintf(fp,"%f\n",sA.vRotate);
+ fprintf(fp,"%f\n",sA.xTranslate);
+ fprintf(fp,"%f\n",sA.yTranslate);
+ fprintf(fp,"%f\n",sA.zTranslate);
+ fprintf(fp,"%f\n",sA.zCamera);
+fclose(fp);
CompTransform mT = *transform;
(*s->applyScreenTransform) (s, &sA, output, &mT);