• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision74a7bae47928022775830fb27bb433f621f3bb07 (tree)
l'heure2020-09-12 20:28:46
AuteurRuben Agin <phabrics@phab...>
CommiterRuben Agin

Message de Log

Checkpoint for final VNC code prep.

Change Summary

Modification

--- a/.gitignore
+++ /dev/null
@@ -1,72 +0,0 @@
1-syntax: glob
2-INSTALL
3-Makefile.in
4-aclocal.m4
5-autom4te.cache
6-compile
7-config.*
8-configure
9-depcomp
10-install-sh
11-libltdl
12-argz.m4
13-libtool.m4
14-ltargz.m4
15-ltdl.m4
16-ltoptions.m4
17-ltsugar.m4
18-ltversion.m4
19-lt~obsolete.m4
20-ltmain.sh
21-missing
22-ylwrap
23-Makefile
24-.deps
25-libtool
26-stamp-h1
27-recode-host.*
28-tmeconfig.h
29-*.o
30-*.lo
31-*.a
32-*.la
33-*.lai
34-*.so
35-*.so.*
36-bus-device-auto.c
37-fb-xlat-auto.c
38-float-auto.c
39-ieee754-auto.h
40-ieee754-misc-auto.c
41-ieee754-ops-auto.c
42-ieee754-ops-auto.h
43-m6888x-auto.c
44-m68k-auto.h
45-m68k-bus-auto.c
46-m68k-insns-auto.c
47-m68k-opmap.c
48-sparc-auto.h
49-sparc-bus-auto.c
50-sparc-fpu-auto.c
51-sparc-insns-auto.c
52-sparc-vis-auto.c
53-memory-auto.c
54-memory-auto.h
55-shlibvar.h
56-tme-sun-eeprom
57-tme-sun-idprom
58-tme-preopen.txt
59-tme-plugins.txt
60-.libs
61-tmesh/tmesh
62-tmesh-input.c
63-TAGS
64-build*
65-*~
66-./
67-tmememory.h
68-*.tex
69-*.info
70-mdate-sh
71-stamp-vti
72-version.texi
--- a/contrib/tme-0.8/configure.ac
+++ b/contrib/tme-0.8/configure.ac
@@ -765,14 +765,14 @@ AC_CHECK_DECLS(
765765 )
766766 CFLAGS="${old_CFLAGS}"
767767
768-tme_host_types="tun bsd openvpn posix gtk"
768+tme_host_types="tun bsd openvpn posix gtk rfb"
769769
770770 for tme_host_type in ${tme_host_types}; do
771771 eval enable_${tme_host_type}=no
772772 done
773773
774774 AC_ARG_ENABLE(hosts,
775-[ --enable-hosts=hosttypes enable hosts (default="tun bsd openvpn posix gtk" if host supports)],
775+[ --enable-hosts=hosttypes enable hosts (default="tun bsd openvpn posix gtk rfb" if host supports)],
776776 [tme_host_types=${enableval}], [enable_hosts=yes])
777777
778778 if test "x${enable_hosts}" = xno; then
@@ -783,6 +783,11 @@ for tme_host_type in ${tme_host_types}; do
783783 eval enable_${tme_host_type}=yes
784784 done
785785
786+AS_IF([test "x${enable_rfb}" = xyes], [
787+ TME_HOSTS="rfb ${TME_HOSTS}"
788+ PKG_CHECK_MODULES([RFB], [libvncserver])
789+])
790+
786791 AM_CONDITIONAL([USING_OPENVPN], [test "x${enable_openvpn}" = xyes && test "x${have_tap_header}" = xyes])
787792 if test "x${enable_openvpn}" = xyes && test "x${have_tap_header}" = xyes; then
788793 TME_HOSTS="openvpn ${TME_HOSTS}"
@@ -815,12 +820,13 @@ found_BPFVERSION
815820 fi])
816821
817822 if test "x${TME_HOSTS}" != x; then
818- TME_HOSTS="eth ${TME_HOSTS}"
823+ TME_HOSTS="${TME_HOSTS}"
819824 fi
820825
821826 if test "x${enable_posix}" = xyes; then
822827 TME_HOSTS="posix ${TME_HOSTS}"
823828 fi
829+
824830 AC_MSG_RESULT($TME_HOSTS)
825831
826832 AC_SYS_POSIX_TERMIOS
@@ -1028,7 +1034,7 @@ dnl Checks for GTK.
10281034 AM_PATH_GTK_3_0([], have_gtk=yes, have_gtk=no)
10291035 if test "x$have_gtk" = xyes; then
10301036 if test "x${enable_gtk}" = xyes; then
1031- TME_HOSTS="gtk display ${TME_HOSTS}"
1037+ TME_HOSTS="gtk ${TME_HOSTS}"
10321038 fi
10331039 TME_FB_XLAT_DST="d32b32s0p32olml_r0xffff0000_g0xff00ff00_b0xff0000ff d24b32s0p32olml_r0xff0000_g0xff00_b0xff"
10341040 # TME_FB_XLAT_DST="d32b32s0p32olml_r0xffff0000_g0xff00ff00_b0xff0000ff d24b32s0p32olml_r0xff0000_g0xff00_b0xff d16b16s0p32olml_r0xf800_g0x07e0_b0x001f d8b8s0p32olml_r0xff_g0xff_b0xff d1b1s0p32olml_r0x1_g0x1_b0x1"
@@ -1602,10 +1608,9 @@ AC_CONFIG_FILES([Makefile
16021608 host/Makefile
16031609 host/openvpn/Makefile
16041610 host/posix/Makefile
1605- host/eth/Makefile
1611+ host/rfb/Makefile
16061612 host/bsd/Makefile
16071613 host/tun/Makefile
1608- host/display/Makefile
16091614 host/gtk/Makefile
16101615 bus/Makefile
16111616 bus/multibus/Makefile
--- a/contrib/tme-0.8/host/Makefile.am
+++ b/contrib/tme-0.8/host/Makefile.am
@@ -2,5 +2,27 @@
22 # Makefile.am for The Machine Emulator host/:
33
44 AUTOMAKE_OPTIONS = 1.4 gnu
5+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I. -D_TME_IMPL $(GTK_CFLAGS)
6+
7+lib_LTLIBRARIES = libtme-host.la
8+libtme_host_la_SOURCES = eth-impl.c eth-if.h display-mouse.c display-keyboard.c display.c display.h
9+libtme_host_la_LIBADD = $(top_builddir)/generic/libtme-generic.la $(GTK_LIBS)
10+
11+EXTRA_DIST = keymap-make.pl keymap-def.h
12+
13+display-keyboard.lo: keymap.h
14+
15+BUILT_SOURCES = keymap.h
16+CLEANFILES = keymap.h
17+if USING_X
18+keymap.h: keymap-make.pl
19+ $(PERL) $< > $@
20+else
21+keymap.h: keymap-def.h
22+ cp $< $@
23+endif
24+
25+include $(top_srcdir)/modules
26+
527 SUBDIRS = @TME_HOSTS@
6-DIST_SUBDIRS = posix display gtk eth bsd tun openvpn
28+DIST_SUBDIRS = posix gtk bsd tun openvpn rfb
--- a/contrib/tme-0.8/host/bsd/Makefile.am
+++ b/contrib/tme-0.8/host/bsd/Makefile.am
@@ -3,14 +3,14 @@
33
44 AUTOMAKE_OPTIONS = 1.4 gnu
55
6-AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/../eth -I. -D_TME_IMPL
6+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/.. -I. -D_TME_IMPL
77
88 pkglib_LTLIBRARIES = tme_host_bsd.la
99 tme_host_bsd_la_SOURCES = bsd-bpf.c
1010 tme_host_bsd_la_LDFLAGS = -module -version-info 0:0:0
11-tme_host_bsd_la_LIBADD = ../eth/libeth.la
11+tme_host_bsd_la_LIBADD = ../libtme-host.la
1212 include $(top_srcdir)/modules
13-$(pkglib_LTLIBRARIES): ../eth/libeth.la
14-../eth/libeth.la: force
13+$(pkglib_LTLIBRARIES): ../libtme-host.la
14+../libtme-host.la: force
1515 cd `dirname $@` && $(MAKE) `basename $@`
1616 force: ;
--- a/contrib/tme-0.8/host/display/display-keyboard.c
+++ b/contrib/tme-0.8/host/display-keyboard.c
@@ -463,7 +463,7 @@ _tme_keyboard_ctrl(struct tme_keyboard_connection *conn_keyboard,
463463
464464 /* ring the bell: */
465465 if (ctrl & TME_KEYBOARD_CTRL_BELL) {
466- gdk_beep();
466+ display->tme_display_bell(display);
467467 }
468468
469469 return (TME_OK);
--- a/contrib/tme-0.8/host/display/display.h
+++ b/contrib/tme-0.8/host/display.h
@@ -40,7 +40,7 @@
4040 #include <tme/generic/fb.h>
4141 #include <tme/generic/keyboard.h>
4242 #include <tme/generic/mouse.h>
43-#define TME_THREADS_GLIB
43+#define TME_THREADS_POSIX
4444 #include <tme/threads.h>
4545 #include <tme/hash.h>
4646
@@ -160,8 +160,9 @@ struct tme_display {
160160 int tme_screen_height;
161161
162162 /* implementation-specific callback functions: */
163- struct tme_screen *(*tme_screen_add) _TME_P((struct tme_display *, struct tme_connection *));
163+ int (*tme_display_bell) _TME_P((struct tme_display *));
164164 int (*tme_display_update) _TME_P((struct tme_display *));
165+ struct tme_screen *(*tme_screen_add) _TME_P((struct tme_display *, struct tme_connection *));
165166 int (*tme_screen_resize) _TME_P((struct tme_screen *));
166167 int (*tme_screen_redraw) _TME_P((struct tme_screen *));
167168 int (*tme_screen_update) _TME_P((struct tme_screen *));
--- a/contrib/tme-0.8/host/gtk/Makefile.am
+++ b/contrib/tme-0.8/host/gtk/Makefile.am
@@ -3,15 +3,15 @@
33
44 AUTOMAKE_OPTIONS = 1.4 gnu
55
6-AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/../display -I. -D_TME_IMPL $(GTK_CFLAGS)
6+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/.. -I. -D_TME_IMPL $(GTK_CFLAGS)
77
88 pkglib_LTLIBRARIES = tme_host_gtk.la
99 tme_host_gtk_la_SOURCES = gtk-mouse.c gtk-keyboard.c gtk-screen.c gtk-display.h
1010 tme_host_gtk_la_LDFLAGS = -module -version-info 0:0:0
11-tme_host_gtk_la_LIBADD = ../display/libdisplay.la $(GTK_LIBS)
11+tme_host_gtk_la_LIBADD = ../libtme-host.la
1212
1313 include $(top_srcdir)/modules
14-$(pkglib_LTLIBRARIES): ../display/libdisplay.la
15-../display/libdisplay.la: force
14+$(pkglib_LTLIBRARIES): ../libtme-host.la
15+../libtme-host.la: force
1616 cd `dirname $@` && $(MAKE) `basename $@`
1717 force: ;
--- a/contrib/tme-0.8/host/gtk/gtk-screen.c
+++ b/contrib/tme-0.8/host/gtk/gtk-screen.c
@@ -40,13 +40,9 @@ _TME_RCSID("$Id: gtk-screen.c,v 1.11 2009/08/30 21:39:03 fredette Exp $");
4040 #include "gtk-display.h"
4141 #include <stdlib.h>
4242
43-/* this is called before the screen's display is updated: */
4443 static void
45-_tme_gtk_screen_redraw(struct tme_gtk_screen *screen)
46-{
47- cairo_surface_flush(screen->tme_gtk_screen_surface);
48- cairo_surface_mark_dirty(screen->tme_gtk_screen_surface);
49- gtk_widget_queue_draw(screen->tme_gtk_screen_gtkframe);
44+_tme_gtk_display_bell(struct tme_gdk_display *display) {
45+ gdk_display_bell(display->tme_gdk_display);
5046 }
5147
5248 static int
@@ -319,6 +315,15 @@ _tme_gtk_screen_configure(GtkWidget *widget,
319315 return TRUE;
320316 }
321317
318+/* this is called before the screen's display is updated: */
319+static void
320+_tme_gtk_screen_redraw(struct tme_gtk_screen *screen)
321+{
322+ cairo_surface_flush(screen->tme_gtk_screen_surface);
323+ cairo_surface_mark_dirty(screen->tme_gtk_screen_surface);
324+ gtk_widget_queue_draw(screen->tme_gtk_screen_gtkframe);
325+}
326+
322327 /* Redraw the screen from the surface. Note that the ::draw
323328 * signal receives a ready-to-be-used cairo_t that is already
324329 * clipped to only draw the exposed areas of the widget
@@ -356,7 +361,6 @@ _tme_gtk_screen_new(struct tme_gdk_display *display,
356361 struct tme_gtk_screen *screen;
357362 GdkDisplay *gdkdisplay;
358363 GdkDeviceManager *devices;
359- GdkRectangle workarea;
360364 GtkWidget *menu_bar;
361365 GtkWidget *menu;
362366 GtkWidget *submenu;
@@ -368,19 +372,6 @@ _tme_gtk_screen_new(struct tme_gdk_display *display,
368372
369373 screen = tme_screen_new(display, struct tme_gtk_screen, conn);
370374
371- display->tme_gdk_display = gdk_display_get_default();
372-
373- display->tme_gdk_display_cursor
374- = gdk_cursor_new_for_display(display->tme_gdk_display, GDK_BLANK_CURSOR);
375-
376- display->tme_gdk_display_seat = gdk_display_get_default_seat(display->tme_gdk_display);
377-
378- display->tme_gdk_display_monitor = gdk_display_get_primary_monitor(display->tme_gdk_display);
379-
380- gdk_monitor_get_workarea(display->tme_gdk_display_monitor, &workarea);
381-
382- display->display.tme_screen_width = workarea.width;
383- display->display.tme_screen_height = workarea.height;
384375 screen->screen.tme_screen_scale = gdk_monitor_get_scale_factor(display->tme_gdk_display_monitor);
385376
386377 /* create the top-level window, and allow it to shrink, grow,
@@ -547,7 +538,8 @@ _tme_display_menu_radio(struct tme_gtk_screen *screen,
547538
548539 /* the new GTK display function: */
549540 TME_ELEMENT_SUB_NEW_DECL(tme_host_gtk,display) {
550- struct tme_display *display;
541+ struct tme_gdk_display *display;
542+ GdkRectangle workarea;
551543
552544 /* start our data structure: */
553545 display = tme_new0(struct tme_gdk_display, 1);
@@ -558,11 +550,26 @@ TME_ELEMENT_SUB_NEW_DECL(tme_host_gtk,display) {
558550
559551 _tme_gtk_init();
560552
553+ display->tme_gdk_display = gdk_display_get_default();
554+
555+ display->tme_gdk_display_cursor
556+ = gdk_cursor_new_for_display(display->tme_gdk_display, GDK_BLANK_CURSOR);
557+
558+ display->tme_gdk_display_seat = gdk_display_get_default_seat(display->tme_gdk_display);
559+
560+ display->tme_gdk_display_monitor = gdk_display_get_primary_monitor(display->tme_gdk_display);
561+
562+ gdk_monitor_get_workarea(display->tme_gdk_display_monitor, &workarea);
563+
564+ display->display.tme_screen_width = workarea.width;
565+ display->display.tme_screen_height = workarea.height;
566+
561567 /* set the display-specific functions: */
562- display->tme_screen_add = _tme_gtk_screen_new;
563- display->tme_screen_resize = _tme_gtk_screen_resize;
564- display->tme_screen_redraw = _tme_gtk_screen_redraw;
565- display->tme_display_update = _tme_gtk_display_update;
568+ display->display.tme_display_bell = _tme_gtk_display_bell;
569+ display->display.tme_display_update = _tme_gtk_display_update;
570+ display->display.tme_screen_add = _tme_gtk_screen_new;
571+ display->display.tme_screen_resize = _tme_gtk_screen_resize;
572+ display->display.tme_screen_redraw = _tme_gtk_screen_redraw;
566573
567574 /* setup the thread loop function: */
568575 //tme_threads_init(NULL, gtk_main);
--- a/contrib/tme-0.8/host/openvpn/Makefile.am
+++ b/contrib/tme-0.8/host/openvpn/Makefile.am
@@ -3,18 +3,18 @@
33
44 AUTOMAKE_OPTIONS = 1.4 gnu
55
6-AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/../eth -I. -D_TME_IMPL
6+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/.. -I. -D_TME_IMPL
77
88 pkglib_LTLIBRARIES = tme_host_openvpn.la
99 tme_host_openvpn_la_SOURCES = \
1010 openvpn-link.c \
1111 openvpn-tap.c
12-tme_host_openvpn_la_LIBADD = ../eth/libeth.la
12+tme_host_openvpn_la_LIBADD = ../libtme-host.la
1313 tme_host_openvpn_la_LDFLAGS = -module -version-info 0:0:0
1414
1515 include $(top_srcdir)/modules
1616
17-$(pkglib_LTLIBRARIES): ../eth/libeth.la
18-../eth/libeth.la: force
17+$(pkglib_LTLIBRARIES): ../libtme-host.la
18+../libtme-host.la: force
1919 cd `dirname $@` && $(MAKE) `basename $@`
2020 force: ;
--- a/contrib/tme-0.8/host/rfb/Makefile.am
+++ b/contrib/tme-0.8/host/rfb/Makefile.am
@@ -3,15 +3,15 @@
33
44 AUTOMAKE_OPTIONS = 1.4 gnu
55
6-AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/../display -I. -D_TME_IMPL $(RFB_CFLAGS)
6+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I$(srcdir)/.. -I. -D_TME_IMPL $(RFB_CFLAGS)
77
88 pkglib_LTLIBRARIES = tme_host_rfb.la
9-tme_host_rfb_la_SOURCES = rfb-display.c rfb-display.h
9+tme_host_rfb_la_SOURCES = rfb-display.c
1010 tme_host_rfb_la_LDFLAGS = -module -version-info 0:0:0
11-tme_host_rfb_la_LIBADD = ../display/libdisplay.la $(RFB_LIBS)
11+tme_host_rfb_la_LIBADD = ../libtme-host.la $(RFB_LIBS)
1212
1313 include $(top_srcdir)/modules
14-$(pkglib_LTLIBRARIES): ../display/libdisplay.la
15-../display/libdisplay.la: force
14+$(pkglib_LTLIBRARIES): ../libtme-host.la
15+../libtme-host.la: force
1616 cd `dirname $@` && $(MAKE) `basename $@`
1717 force: ;
--- a/contrib/tme-0.8/host/rfb/rfb-display.c
+++ b/contrib/tme-0.8/host/rfb/rfb-display.c
@@ -36,15 +36,27 @@
3636 #include <tme/common.h>
3737
3838 /* includes: */
39-#include "rfb-display.h"
39+#include "display.h"
40+#include <rfb/rfb.h>
4041 #include <stdlib.h>
4142
43+static const int bpp=4;
44+static int maxx=800, maxy=600;
45+/* TODO: odd maxx doesn't work (vncviewer bug) */
46+
4247 typedef struct tme_rfb_screen {
4348 int tme_rfb_screen_mouse_buttons_last,
4449 tme_rfb_screen_mouse_warp_x,
4550 tme_rfb_screen_mouse_warp_y;
4651 } tme_rfb_screen;
4752
53+typedef struct tme_rfb_display {
54+ /* the generic display structure */
55+ struct tme_display display;
56+
57+ rfbScreenInfoPtr server;
58+} tme_rfb_display;
59+
4860 static void _tme_rfb_clientgone(rfbClientPtr cl)
4961 {
5062 free(cl->clientData);
@@ -58,6 +70,11 @@ static enum rfbNewClientAction _tme_rfb_newclient(rfbClientPtr cl)
5870 return RFB_CLIENT_ACCEPT;
5971 }
6072
73+static void
74+_tme_rfb_display_bell(struct tme_rfb_display *display) {
75+ rfbSendBell(display->server);
76+}
77+
6178 static int
6279 _tme_rfb_display_update(struct tme_display *display) {
6380 long usec;
@@ -77,83 +94,66 @@ _tme_rfb_screen_redraw(struct tme_screen *screen)
7794 struct tme_fb_connection *conn_fb = screen->tme_screen_fb;
7895 rfbScreenInfoPtr server = ((tme_rfb_display *)screen->tme_screen_display)->server;
7996
80- if(conn_fb->tme_fb_connection_buffer == server->frameBuffer)
97+ if((char *)conn_fb->tme_fb_connection_buffer == server->frameBuffer)
8198 rfbMarkRectAsModified(server, 0, 0,
8299 conn_fb->tme_fb_connection_width,
83100 conn_fb->tme_fb_connection_height);
84101 }
85102
86103 /* switch to new framebuffer contents */
87-static void _tme_rfb_screen_resize(struct tme_screen *screen, int width, int height)
104+static void _tme_rfb_screen_resize(struct tme_screen *screen)
88105 {
89106 unsigned char *oldfb, *newfb;
90107 struct tme_fb_connection *conn_fb = screen->tme_screen_fb;
108+ int width = conn_fb->tme_fb_connection_width;
109+ int height = conn_fb->tme_fb_connection_height;
91110 rfbScreenInfoPtr server = ((tme_rfb_display *)screen->tme_screen_display)->server;
92111
93112 newfb = (unsigned char*)tme_malloc(width * height * bpp);
94- if(!conn_fb->tme_fb_connection_buffer ||
95- conn_fb->tme_fb_connection_buffer == server->frameBuffer) {
96- oldfb = (unsigned char*)server->frameBuffer;
113+ if((char *)conn_fb->tme_fb_connection_buffer == server->frameBuffer) {
97114 rfbNewFramebuffer(server, (char*)newfb, width, height, 8, 3, bpp);
98- free(oldfb);
99- } else
100- free(conn_fb->tme_fb_connection_buffer);
115+ }
116+ free(conn_fb->tme_fb_connection_buffer);
101117 conn_fb->tme_fb_connection_buffer = newfb;
102118 /*** FIXME: Re-install cursor. ***/
103119 }
104120
105-/* Create a new surface of the appropriate size to store our scribbles */
106-static gboolean
107-_tme_rfb_screen_configure(RfbWidget *widget,
108- GdkEventConfigure *event,
109- gpointer _screen)
121+/* this makes a new screen: */
122+struct tme_screen *
123+_tme_rfb_screen_new(struct tme_rfb_display *display,
124+ struct tme_connection *conn)
110125 {
111- struct tme_rfb_screen *screen;
112- struct tme_display *display;
113- GdkWindow *window;
114- int scale;
115-
116- screen = (struct tme_rfb_screen *) _screen;
117-
118- /* get the display: */
119- display = screen->screen.tme_screen_display;
126+ struct tme_screen *screen;
127+ struct tme_fb_connection *conn_fb;
120128
121129 /* lock our mutex: */
122- tme_mutex_lock(&display->tme_display_mutex);
130+ tme_mutex_lock(&display->display.tme_display_mutex);
123131
124- cairo_surface_destroy(screen->tme_rfb_screen_surface);
132+ screen = tme_screen_new(display, struct tme_screen, conn);
125133
126- window = rfb_widget_get_window(screen->tme_rfb_screen_rfbframe);
134+ screen->tme_screen_scale = 1;
127135
128- screen->screen.tme_screen_scale = gdk_window_get_scale_factor(window);
129-
130- screen->tme_rfb_screen_surface
131- = gdk_window_create_similar_image_surface(window,
132- screen->tme_rfb_screen_format,
133- gdk_window_get_width(window) * screen->screen.tme_screen_scale,
134- gdk_window_get_height(window) * screen->screen.tme_screen_scale,
135- screen->screen.tme_screen_scale);
136-
137- conn_fb = screen->screen.tme_screen_fb;
136+ conn_fb = screen->tme_screen_fb;
138137
139138 /* update our framebuffer connection: */
140139 conn_fb->tme_fb_connection_skipx = 0;
141- conn_fb->tme_fb_connection_scanline_pad = _tme_rfb_scanline_pad(cairo_image_surface_get_stride(screen->tme_rfb_screen_surface));
140+ conn_fb->tme_fb_connection_scanline_pad = bpp;
142141 conn_fb->tme_fb_connection_order = TME_ENDIAN_NATIVE;
143- conn_fb->tme_fb_connection_buffer = cairo_image_surface_get_data(screen->tme_rfb_screen_surface);
144- conn_fb->tme_fb_connection_buffsz = cairo_image_surface_get_stride(screen->tme_rfb_screen_surface) * conn_fb->tme_fb_connection_height;
145- conn_fb->tme_fb_connection_bits_per_pixel = 16;
146- conn_fb->tme_fb_connection_depth = 16;
142+ conn_fb->tme_fb_connection_bits_per_pixel = bpp * 8;
143+ conn_fb->tme_fb_connection_depth = 24;
147144 conn_fb->tme_fb_connection_class = TME_FB_XLAT_CLASS_COLOR;
148- conn_fb->tme_fb_connection_mask_g = 0x0007e0;
149- conn_fb->tme_fb_connection_mask_b = 0x00001f;
150- conn_fb->tme_fb_connection_mask_r = 0x00f800;
145+ conn_fb->tme_fb_connection_mask_g = 0x00ff00;
146+ conn_fb->tme_fb_connection_mask_b = 0x0000ff;
147+ conn_fb->tme_fb_connection_mask_r = 0xff0000;
148+ display->server->frameBuffer = conn_fb->tme_fb_connection_buffer;
151149
150+ _tme_screen_configure(screen);
151+
152152 /* unlock our mutex: */
153- tme_mutex_unlock(&display->tme_display_mutex);
153+ tme_mutex_unlock(&display->display.tme_display_mutex);
154154
155155 /* We've handled the configure event, no need for further processing. */
156- return TRUE;
156+ return (screen);
157157 }
158158
159159 /* this is a VNC callback for a key press or release event: */
@@ -181,8 +181,6 @@ _tme_rfb_key_event(rfbBool down, rfbKeySym key, rfbClientPtr cl)
181181 /* unlock the mutex: */
182182 tme_mutex_unlock(&display->tme_display_mutex);
183183
184- /* don't process this event any further: */
185- return (TRUE);
186184 }
187185
188186 /* this is a VNC callback for a mouse event: */
@@ -259,7 +257,7 @@ TME_ELEMENT_SUB_NEW_DECL(tme_host_rfb,display) {
259257 display = element->tme_element_private;
260258
261259 /* allocate initial screen structure of the given size: */
262- server=rfbGetScreen(args, arg_i,maxx,maxy,8,3,4);
260+ server=rfbGetScreen(&arg_i,args,maxx,maxy,8,3,bpp);
263261 if(!server)
264262 return 1;
265263 server->desktopName = "The Machine Emulator";
@@ -273,11 +271,15 @@ TME_ELEMENT_SUB_NEW_DECL(tme_host_rfb,display) {
273271 rfbInitServer(server);
274272
275273 display->server = server;
274+ display->display.tme_screen_width = maxx;
275+ display->display.tme_screen_height = maxy;
276+
276277 /* set the display-specific functions: */
277- // display->tme_screen_add = _tme_rfb_screen_new;
278- display->tme_screen_resize = _tme_rfb_screen_resize;
279- display->tme_screen_redraw = _tme_rfb_screen_redraw;
280- display->tme_display_update = _tme_rfb_display_update;
278+ display->display.tme_display_bell = _tme_rfb_display_bell;
279+ display->display.tme_display_update = _tme_rfb_display_update;
280+ display->display.tme_screen_add = _tme_rfb_screen_new;
281+ display->display.tme_screen_resize = _tme_rfb_screen_resize;
282+ display->display.tme_screen_redraw = _tme_rfb_screen_redraw;
281283
282284 return (TME_OK);
283285 }
--- a/contrib/tme-0.8/host/rfb/rfb-display.h
+++ /dev/null
@@ -1,125 +0,0 @@
1-/* $Id: gtk-display.h,v 1.10 2009/08/28 01:29:47 fredette Exp $ */
2-
3-/* host/gtk/gtk-display.h - header file for GTK display support: */
4-
5-/*
6- * Copyright (c) 2003 Matt Fredette
7- * All rights reserved.
8- *
9- * Redistribution and use in source and binary forms, with or without
10- * modification, are permitted provided that the following conditions
11- * are met:
12- * 1. Redistributions of source code must retain the above copyright
13- * notice, this list of conditions and the following disclaimer.
14- * 2. Redistributions in binary form must reproduce the above copyright
15- * notice, this list of conditions and the following disclaimer in the
16- * documentation and/or other materials provided with the distribution.
17- * 3. All advertising materials mentioning features or use of this software
18- * must display the following acknowledgement:
19- * This product includes software developed by Matt Fredette.
20- * 4. The name of the author may not be used to endorse or promote products
21- * derived from this software without specific prior written permission.
22- *
23- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
27- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33- * POSSIBILITY OF SUCH DAMAGE.
34- */
35-
36-#ifndef _HOST_GTK_DISPLAY_H
37-#define _HOST_GTK_DISPLAY_H
38-
39-_TME_RCSID("$Id: gtk-display.h,v 1.10 2009/08/28 01:29:47 fredette Exp $");
40-
41-/* includes: */
42-#include "display.h"
43-#ifndef G_ENABLE_DEBUG
44-#define G_ENABLE_DEBUG (0)
45-#endif /* !G_ENABLE_DEBUG */
46-#include <gtk/gtk.h>
47-
48-/* macros: */
49-
50-/* types: */
51-
52-/* a display: */
53-struct tme_gdk_display {
54-
55- /* the generic display structure */
56- struct tme_display display;
57-
58- GdkDisplay *tme_gdk_display;
59-
60- GdkCursor *tme_gdk_display_cursor;
61-
62- GdkSeat *tme_gdk_display_seat;
63-
64- GdkMonitor *tme_gdk_display_monitor;
65-};
66-
67-/* a screen: */
68-struct tme_gtk_screen {
69-
70- /* the generic screen structure */
71- struct tme_screen screen;
72-
73- rfbScreenInfoPtr server;
74-
75- /* the top-level window: */
76- GtkWidget *tme_gtk_screen_window;
77-
78- /* the outer vertical packing box: */
79- GtkWidget *tme_gtk_screen_vbox0;
80-
81- /* the GtkWidget, GdkWindow & cairo_surface for the framebuffer: */
82- GtkWidget *tme_gtk_screen_gtkframe;
83- cairo_surface_t *tme_gtk_screen_surface;
84- cairo_format_t tme_gtk_screen_format;
85-
86- /* the mouse on label: */
87- GtkWidget *tme_gtk_screen_mouse_label;
88-
89- /* the status bar, and the context ID: */
90- GtkWidget *tme_gtk_screen_mouse_statusbar;
91- guint tme_gtk_screen_mouse_statusbar_cid;
92-
93- /* if GDK_VoidSymbol, mouse mode is off. otherwise,
94- mouse mode is on, and this is the keyval that will
95- turn mouse mode off: */
96- guint tme_gtk_screen_mouse_keyval;
97-
98- /* when mouse mode is on, this is the previous events mask
99- for the framebuffer event box: */
100- GdkEventMask tme_gtk_screen_mouse_events_old;
101-
102- /* when mouse mode is on, this is the warp center: */
103- gint tme_gtk_screen_mouse_warp_x;
104- gint tme_gtk_screen_mouse_warp_y;
105-
106- /* when mouse mode is on, the last tme buttons state: */
107- unsigned int tme_gtk_screen_mouse_buttons_last;
108-};
109-
110-/* a menu item: */
111-struct tme_display_menu_item {
112- /* the string for the menu item label: */
113- const char *name;
114-
115- GCallback menu_func;
116-};
117-
118-/* prototypes: */
119-void _tme_gtk_keyboard_attach _TME_P((struct tme_gtk_screen *));
120-void _tme_gtk_mouse_attach _TME_P((struct tme_gtk_screen *));
121-gint _tme_display_enter_focus _TME_P((GtkWidget *, GdkEvent *, gpointer));
122-GtkWidget *_tme_display_menu_radio _TME_P((struct tme_gtk_screen *, struct tme_display_menu_item *, int num_items));
123-
124-#endif /* _HOST_GTK_DISPLAY_H */
125-
--- a/contrib/tme-0.8/host/tun/Makefile.am
+++ b/contrib/tme-0.8/host/tun/Makefile.am
@@ -3,17 +3,16 @@
33
44 AUTOMAKE_OPTIONS = 1.4 gnu
55
6-AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(srcdir)/../eth -I$(top_srcdir)/lib -I. -D_TME_IMPL -DDEV_TAP_FILENAME=@DEV_TAP_FILENAME@ $(NATINC)
6+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(srcdir)/.. -I$(top_srcdir)/lib -I. -D_TME_IMPL -DDEV_TAP_FILENAME=@DEV_TAP_FILENAME@ $(NATINC)
77
88 pkglib_LTLIBRARIES = tme_host_tun.la
99 tme_host_tun_la_SOURCES = tun-tap.c
1010 tme_host_tun_la_LDFLAGS = -module -version-info 0:0:0
11-tme_host_tun_la_LIBADD = $(NATLIBS) \
12- ../eth/libeth.la
11+tme_host_tun_la_LIBADD = ../libtme-host.la $(NATLIBS)
1312
1413 include $(top_srcdir)/modules
1514
16-$(pkglib_LTLIBRARIES): ../eth/libeth.la
17-../eth/libeth.la: force
15+$(pkglib_LTLIBRARIES): ../libtme-host.la
16+../libtme-host.la: force
1817 cd `dirname $@` && $(MAKE) `basename $@`
1918 force: ;