devdraw: update Lion cocoa

R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5015042
This commit is contained in:
David Jeannot 2011-09-19 08:58:59 -04:00 committed by Russ Cox
parent 53000799be
commit 48107872ba
8 changed files with 627 additions and 430 deletions

View file

@ -1,5 +1,5 @@
<$PLAN9/src/mkhdr <$PLAN9/src/mkhdr
<|./osxvers <|osxvers
TARG=9pfuse TARG=9pfuse

View file

@ -7,7 +7,7 @@ void setlabel(char*);
char* getsnarf(void); char* getsnarf(void);
void putsnarf(char*); void putsnarf(char*);
void mousetrack(int, int, int, int); void mousetrack(int, int, int, uint);
void keystroke(int); void keystroke(int);
void kicklabel(char*); void kicklabel(char*);

File diff suppressed because it is too large Load diff

View file

@ -308,7 +308,7 @@ matchmouse(void)
} }
void void
mousetrack(int x, int y, int b, int ms) mousetrack(int x, int y, int b, uint ms)
{ {
Mouse *m; Mouse *m;

View file

@ -23,32 +23,3 @@ qunlock(QLock *q)
{ {
pthread_mutex_unlock(&q->m); pthread_mutex_unlock(&q->m);
} }
static void
rinit(Rendez *r)
{
pthread_mutex_lock(&initlock);
if(r->init == 0){
pthread_cond_init(&r->c, nil);
r->init = 1;
}
pthread_mutex_unlock(&initlock);
}
void
rsleep(Rendez *r)
{
if(r->init == 0)
rinit(r);
pthread_cond_wait(&r->c, &r->l->m);
}
int
rwakeup(Rendez *r)
{
if(r->init == 0)
rinit(r);
pthread_cond_signal(&r->c);
return 0;
}

View file

@ -1,12 +1,8 @@
#define QLock DQLock #define QLock DQLock
#define qlock dqlock #define qlock dqlock
#define qunlock dqunlock #define qunlock dqunlock
#define Rendez DRendez
#define rsleep drsleep
#define rwakeup drwakeup
typedef struct QLock QLock; typedef struct QLock QLock;
typedef struct Rendez Rendez;
struct QLock struct QLock
{ {
@ -14,14 +10,5 @@ struct QLock
int init; int init;
}; };
struct Rendez
{
QLock *l;
pthread_cond_t c;
int init;
};
void qlock(QLock*); void qlock(QLock*);
void qunlock(QLock*); void qunlock(QLock*);
void rsleep(Rendez*);
int rwakeup(Rendez*); /* BUG: always returns 0 */

View file

@ -1,4 +1,5 @@
<$PLAN9/src/mkhdr <$PLAN9/src/mkhdr
<|osxvers
TARG=devdraw TARG=devdraw