PatchSet 7471 
Date: 2007/02/14 13:50:51
Author: alper
Branch: HEAD
Tag: (none) 
Log:

2007-02-14 Alper Akcan <[EMAIL PROTECTED]>

Modified Files:
        * libraries/clib/awt/xynth/Makefile.am,
          libraries/clib/awt/xynth/Makefile.in,
          libraries/clib/awt/xynth/color.c,
          libraries/clib/awt/xynth/event.c,
          libraries/clib/awt/xynth/font.c,
          libraries/clib/awt/xynth/graphic.c,
          libraries/clib/awt/xynth/image.c,
          libraries/clib/awt/xynth/toolkit.c,
          libraries/clib/awt/toolkit.h,
          libraries/clib/awt/window.c : Minor improvements.

Members: 
        libraries/clib/awt/xynth/Makefile.am:1.2->1.3 
        libraries/clib/awt/xynth/Makefile.in:1.6->1.7 
        libraries/clib/awt/xynth/color.c:1.2->1.3 
        libraries/clib/awt/xynth/event.c:1.2->1.3 
        libraries/clib/awt/xynth/font.c:1.2->1.3 
        libraries/clib/awt/xynth/graphic.c:1.2->1.3 
        libraries/clib/awt/xynth/image.c:1.2->1.3 
        libraries/clib/awt/xynth/toolkit.c:1.2->1.3 
        libraries/clib/awt/xynth/toolkit.h:1.2->1.3 
        libraries/clib/awt/xynth/window.c:1.2->1.3 

Index: kaffe/libraries/clib/awt/xynth/Makefile.am
diff -u kaffe/libraries/clib/awt/xynth/Makefile.am:1.2 
kaffe/libraries/clib/awt/xynth/Makefile.am:1.3
--- kaffe/libraries/clib/awt/xynth/Makefile.am:1.2      Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/Makefile.am  Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 # Xynth-based AWT support for standard Java libraries
 #
-# Copyright (c) 2006
+# Copyright (c) 2006 - 2007
 #       Alper Akcan <[EMAIL PROTECTED]>
 #
 
Index: kaffe/libraries/clib/awt/xynth/Makefile.in
diff -u kaffe/libraries/clib/awt/xynth/Makefile.in:1.6 
kaffe/libraries/clib/awt/xynth/Makefile.in:1.7
--- kaffe/libraries/clib/awt/xynth/Makefile.in:1.6      Wed Jan  3 23:02:16 2007
+++ kaffe/libraries/clib/awt/xynth/Makefile.in  Wed Feb 14 13:50:51 2007
@@ -16,7 +16,7 @@
 
 # Xynth-based AWT support for standard Java libraries
 #
-# Copyright (c) 2006
+# Copyright (c) 2006 - 2007
 #       Alper Akcan <[EMAIL PROTECTED]>
 #
 
Index: kaffe/libraries/clib/awt/xynth/color.c
diff -u kaffe/libraries/clib/awt/xynth/color.c:1.2 
kaffe/libraries/clib/awt/xynth/color.c:1.3
--- kaffe/libraries/clib/awt/xynth/color.c:1.2  Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/color.c      Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
Index: kaffe/libraries/clib/awt/xynth/event.c
diff -u kaffe/libraries/clib/awt/xynth/event.c:1.2 
kaffe/libraries/clib/awt/xynth/event.c:1.3
--- kaffe/libraries/clib/awt/xynth/event.c:1.2  Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/event.c      Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
@@ -137,7 +137,7 @@
                        jevent = (*env)->CallStaticObjectMethod(env, 
MouseEvent, getMouseEvent, idx, JMOUSE_MOVED, 0, event->mouse->x, 
event->mouse->y);
                }
        }
-       DEBUGF("Leave %d", xevent->window->client->id);
+       DEBUGF("Leave %d", xevent->window->id);
        return jevent;
 }
 
@@ -192,7 +192,7 @@
                return NULL;
        }
        event = xevent->event;
-       if (xevent->window->client->pri == 0) {
+       if (xevent->window->pri == 0) {
                jevent = (*env)->CallStaticObjectMethod(env, FocusEvent, 
getFocusEvent, idx, JFOCUS_GAINED, JNI_FALSE);
        } else {
                jevent = (*env)->CallStaticObjectMethod(env, FocusEvent, 
getFocusEvent, idx, JFOCUS_LOST, JNI_FALSE);
@@ -266,7 +266,7 @@
 void xynth_kaffe_atevent (s_window_t *window, s_event_t *event)
 {
        xynth_event_t *xevent;
-       DEBUGF("Enter id: %d", window->client->id);
+       DEBUGF("Enter id: %d", window->id);
        switch (event->type & EVENT_MASK) {
                case QUIT_EVENT:
                case MOUSE_EVENT:
Index: kaffe/libraries/clib/awt/xynth/font.c
diff -u kaffe/libraries/clib/awt/xynth/font.c:1.2 
kaffe/libraries/clib/awt/xynth/font.c:1.3
--- kaffe/libraries/clib/awt/xynth/font.c:1.2   Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/font.c       Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
@@ -119,7 +119,7 @@
        s_font_get_glyph(font);
        AWT_FREE(str);
        DEBUGF("Leave");
-       return font->img->w;
+       return font->glyph.img->w;
 }
 
 KAFFE_FONT_FUNC_DECL (jobject, Java_java_awt_Toolkit_fntGetWidths)
@@ -136,11 +136,10 @@
        jw = (*env)->GetIntArrayElements(env, widths, &isCopy);
        for (n = 0; n < 256; n++) {
                sprintf(str, "%c", n);
-               s_font_set_str(font, str);
-               s_font_get_glyph(font);
-               jw[n] = font->img->w;
+               jw[n] = s_font_get_width(font, str);
                jw[n] = (jw[n] < 0) ? 0 : jw[n];
        }
        (*env)->ReleaseIntArrayElements(env, widths, jw, 0);
+       DEBUGF("Leave");
        return widths;
 }
Index: kaffe/libraries/clib/awt/xynth/graphic.c
diff -u kaffe/libraries/clib/awt/xynth/graphic.c:1.2 
kaffe/libraries/clib/awt/xynth/graphic.c:1.3
--- kaffe/libraries/clib/awt/xynth/graphic.c:1.2        Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/graphic.c    Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
@@ -263,11 +263,11 @@
        s_font_set_rgb(gr->font, r, g, b);
        s_font_get_glyph(gr->font);
        coor.x = gr->x0 + x;
-       coor.y = gr->y0 + y - gr->font->yMax;
-       coor.w = gr->font->img->w;
-       coor.h = gr->font->img->h;
+       coor.y = gr->y0 + y - gr->font->glyph.yMax;
+       coor.w = gr->font->glyph.img->w;
+       coor.h = gr->font->glyph.img->h;
        if (s_rect_intersect(&(gr->clip), &coor, &inter) == 0) {
-               s_putboxpartrgba(gr->surface, inter.x, inter.y, inter.w, 
inter.h, coor.w, coor.h, gr->font->img->rgba, inter.x - coor.x, inter.y - 
coor.y);
+               s_putboxpartrgba(gr->surface, inter.x, inter.y, inter.w, 
inter.h, coor.w, coor.h, gr->font->glyph.img->rgba, inter.x - coor.x, inter.y - 
coor.y);
        }
        AWT_FREE(str);
        DEBUGF("Leave");
@@ -331,11 +331,11 @@
        s_font_set_rgb(gr->font, r, g, b);
        s_font_get_glyph(gr->font);
        coor.x = gr->x0 + x;
-       coor.y = gr->y0 + y - gr->font->yMax;
-       coor.w = gr->font->img->w;
-       coor.h = gr->font->img->h;
+       coor.y = gr->y0 + y - gr->font->glyph.yMax;
+       coor.w = gr->font->glyph.img->w;
+       coor.h = gr->font->glyph.img->h;
        if (s_rect_intersect(&(gr->clip), &coor, &inter) == 0) {
-               s_putboxpartrgba(gr->surface, inter.x, inter.y, inter.w, 
inter.h, coor.w, coor.h, gr->font->img->rgba, inter.x - coor.x, inter.y - 
coor.y);
+               s_putboxpartrgba(gr->surface, inter.x, inter.y, inter.w, 
inter.h, coor.w, coor.h, gr->font->glyph.img->rgba, inter.x - coor.x, inter.y - 
coor.y);
        }
        AWT_FREE(str);
        (*env)->ReleaseCharArrayElements(env, jChars, jc, JNI_ABORT);
Index: kaffe/libraries/clib/awt/xynth/image.c
diff -u kaffe/libraries/clib/awt/xynth/image.c:1.2 
kaffe/libraries/clib/awt/xynth/image.c:1.3
--- kaffe/libraries/clib/awt/xynth/image.c:1.2  Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/image.c      Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
Index: kaffe/libraries/clib/awt/xynth/toolkit.c
diff -u kaffe/libraries/clib/awt/xynth/toolkit.c:1.2 
kaffe/libraries/clib/awt/xynth/toolkit.c:1.3
--- kaffe/libraries/clib/awt/xynth/toolkit.c:1.2        Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/toolkit.c    Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
@@ -25,9 +25,9 @@
        xynth->eventq = (xynth_eventq_t *) AWT_MALLOC(sizeof(xynth_eventq_t));
        s_list_init(&(xynth->eventq->list));
        s_thread_mutex_init(&(xynth->eventq->mut));
-       s_client_init(&(xynth->root));
+       s_window_init(&(xynth->root));
        s_window_new(xynth->root, WINDOW_MAIN, NULL);
-       s_thread_create(s_client_main, xynth->root);
+       s_thread_create(s_window_main, xynth->root);
        xynth->nwindows = XYNTH_NWINDOWS;
        xynth->windows = AWT_CALLOC(xynth->nwindows, sizeof(window_rec_t));
        
@@ -44,8 +44,8 @@
        xynth->keymap[S_KEYCODE_ZERO] = 0x30;
        xynth->keymap[S_KEYCODE_MINUS] = 0x0;
        xynth->keymap[S_KEYCODE_EQUAL] = 0x3d;
-       xynth->keymap[S_KEYCODE_DELETE] = -'\b';
-       xynth->keymap[S_KEYCODE_TAB] = -'\t';
+       xynth->keymap[S_KEYCODE_DELETE] = 0x08;
+       xynth->keymap[S_KEYCODE_TAB] = 0x9;
        xynth->keymap[S_KEYCODE_q] = 0x51;
        xynth->keymap[S_KEYCODE_w] = 0x57;
        xynth->keymap[S_KEYCODE_e] = 0x45;
@@ -58,7 +58,7 @@
        xynth->keymap[S_KEYCODE_p] = 0x50;
        xynth->keymap[S_KEYCODE_BRACKETLEFT] = 0x5b;
        xynth->keymap[S_KEYCODE_BRACKETRIGHT] = 0x5d;
-       xynth->keymap[S_KEYCODE_RETURN] = -'\n';
+       xynth->keymap[S_KEYCODE_RETURN] = 0xa;
        xynth->keymap[S_KEYCODE_LEFTCONTROL] = 0x11;
        xynth->keymap[S_KEYCODE_a] = 0x41;
        xynth->keymap[S_KEYCODE_s] = 0x53;
Index: kaffe/libraries/clib/awt/xynth/toolkit.h
diff -u kaffe/libraries/clib/awt/xynth/toolkit.h:1.2 
kaffe/libraries/clib/awt/xynth/toolkit.h:1.3
--- kaffe/libraries/clib/awt/xynth/toolkit.h:1.2        Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/toolkit.h    Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
Index: kaffe/libraries/clib/awt/xynth/window.c
diff -u kaffe/libraries/clib/awt/xynth/window.c:1.2 
kaffe/libraries/clib/awt/xynth/window.c:1.3
--- kaffe/libraries/clib/awt/xynth/window.c:1.2 Mon Aug 28 11:39:45 2006
+++ kaffe/libraries/clib/awt/xynth/window.c     Wed Feb 14 13:50:51 2007
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2006
+ * Copyright (c) 2006 - 2007
  *     Alper Akcan <[EMAIL PROTECTED]>, All rights reserved.
  *
  * See the file "license.terms" for information on usage and redistribution 
@@ -40,13 +40,13 @@
        jobject jwindow;
        DEBUGF("Enter");
        str = java2CString(env, jTitle);
-       s_client_init(&window);
+       s_window_init(&window);
        s_window_new(window, WINDOW_CHILD, xynth->root);
        s_window_set_coor(window, WINDOW_NOFORM, x, y, width, height);
        s_window_set_title(window, str);
        s_fillbox(window->surface, 0, 0, window->surface->width, 
window->surface->height, clrBack);
-       s_client_atevent(window, xynth_kaffe_atevent);
-       s_client_main(window);
+       s_window_atevent(window, xynth_kaffe_atevent);
+       s_window_main(window);
        jwindow = JCL_NewRawDataObject(env, window);
        source_idx_register(xynth, UNVEIL_WINDOW(jwindow), xynth->root);
        DEBUGF("title: %s, x: %d, y: %d, w: %d, h: %d, cursor: %d, clrback: %d, 
resize: %d", str, x, y, width, height, clrBack, isResizable);
@@ -62,12 +62,12 @@
        s_window_t *window;
        DEBUGF("Enter");
        owner = UNVEIL_WINDOW(nowner);
-       s_client_init(&window);
+       s_window_init(&window);
        s_window_new(window, WINDOW_CHILD | WINDOW_NOFORM, owner);
        s_window_set_coor(window, WINDOW_NOFORM, x, y, width, height);
        s_fillbox(window->surface, 0, 0, window->surface->width, 
window->surface->height, clrBack);
-       s_client_atevent(window, xynth_kaffe_atevent);
-       s_client_main(window);
+       s_window_atevent(window, xynth_kaffe_atevent);
+       s_window_main(window);
        jwindow = JCL_NewRawDataObject(env, window);
        source_idx_register(xynth, UNVEIL_WINDOW(jwindow), owner);
        DEBUGF("Leave");
@@ -83,13 +83,13 @@
        DEBUGF("Enter");
        str = java2CString(env, jTitle);
        owner = UNVEIL_WINDOW(nowner);
-       s_client_init(&window);
+       s_window_init(&window);
        s_window_new(window, WINDOW_CHILD, owner);
        s_window_set_coor(window, WINDOW_NOFORM, x, y, width, height);
        s_window_set_title(window, str);
        s_fillbox(window->surface, 0, 0, window->surface->width, 
window->surface->height, clrBack);
-       s_client_atevent(window, xynth_kaffe_atevent);
-       s_client_main(window);
+       s_window_atevent(window, xynth_kaffe_atevent);
+       s_window_main(window);
        jwindow = JCL_NewRawDataObject(env, window);
        source_idx_register(xynth, UNVEIL_WINDOW(jwindow), owner);
        AWT_FREE(str);
@@ -108,7 +108,7 @@
                DEBUGF("Could not find idx for window");
                return;
        }
-       DEBUGF("window->client->id: %d", window->client->id);
+       DEBUGF("window->id: %d", window->id);
        if (showIt) {
                s_window_show(window);
        } else {
@@ -151,6 +151,6 @@
                DEBUGF("Could not find idx for window");
                return;
        }
-       s_client_quit(window);
+       s_window_quit(window);
        DEBUGF("Leave");
 }

_______________________________________________
kaffe mailing list
[email protected]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to