From: "Jim C. Brown" <jma5@umd.edu>
To: spetreolle@users.sourceforge.net, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] gtk2 driver
Date: Tue, 31 May 2005 14:54:18 -0400 [thread overview]
Message-ID: <20050531185418.GA14917@jbrown.mylinuxbox.org> (raw)
In-Reply-To: <20050531141534.41833.qmail@web26809.mail.ukl.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]
On Tue, May 31, 2005 at 04:15:34PM +0200, Sylvain Petreolle wrote:
> --- "Jim C. Brown" <jma5@umd.edu> a ?crit :
>
> > Here is the new driver. Patch is against a clean qemu directory. Once you
> > apply the patch, dump the attached files into the qemu root directory and
> > run configure with '--enable-gtk' option. The '--set-fs-driver=' option
> > exists but there should be no need to use it.
> >
> Hunks #2 and #3 of vl.c fail to apply to a new tree checked today,
> could you post an updated patch ?
Attached is a patch that omits the vl.c hunks and a vl.c.diff patch that
should work.
The problem was that I have the no-sdl-grab patch applied to my vl.c while
a clean tree doesn't.
>
> Kind regards,
>
> Usurp (aka Sylvain Petreolle)
>
> humans are like computers,
> yesterday the BIOS was all
> - today its just a word
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
[-- Attachment #2: qemu-gtk-patch.diff --]
[-- Type: text/plain, Size: 4575 bytes --]
diff -u qemu.orig/Makefile.target qemu/Makefile.target
--- qemu.orig/Makefile.target Mon May 30 19:42:28 2005
+++ qemu/Makefile.target Mon May 30 19:57:26 2005
@@ -357,6 +357,10 @@
ifdef CONFIG_SDL
VL_OBJS+=sdl.o
endif
+ifdef CONFIG_GTK
+VL_OBJS+=gtk2.o
+VL_OBJS+=fullscreen.o
+endif
ifdef CONFIG_COCOA
VL_OBJS+=cocoa.o
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa
@@ -392,13 +396,19 @@
endif
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
+ $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(GTK_LIBS) $(FS_LIBS) $(VL_LIBS)
cocoa.o: cocoa.m
$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
sdl.o: sdl.c keymaps.c sdl_keysym.h
$(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
+
+gtk2.o: gtk2.c keymaps.c gdk_keysym.h fullscreen.h
+ $(CC) $(CFLAGS) $(DEFINES) $(GTK_CFLAGS) -c -o $@ $<
+
+fullscreen.o: $(FSDRV) fullscreen.h
+ $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
sdlaudio.o: sdlaudio.c
$(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
diff -u qemu.orig/configure qemu/configure
--- qemu.orig/configure Mon May 30 19:40:14 2005
+++ qemu/configure Mon May 30 20:10:11 2005
@@ -15,6 +15,7 @@
TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPF="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}-conf"
# default parameters
prefix=""
@@ -171,6 +172,10 @@
;;
--disable-sdl) sdl="no"
;;
+ --enable-gtk) gtk="yes"
+ ;;
+ --set-fs-driver=*) fsdrv=`echo $opt | cut -d '=' -f 2`
+ ;;
--enable-fmod) fmod="yes"
;;
--fmod-lib=*) fmod_lib=${opt#--fmod-lib=}
@@ -311,6 +316,62 @@
fi # cross compilation
fi # -z $sdl
+##########################################
+# GTK probe
+
+gtk_too_old=no
+
+if test -z "$gtk" ; then
+
+gtk=no
+
+# normal GTK probe
+cat > $TMPC << EOF
+#include <stdlib.h>
+#include <gtk/gtk.h>
+int main(int argc, char **argv) { gtk_init(&argc, &argv); return EXIT_SUCCESS; }
+EOF
+
+if $cc -o $TMPE `pkg-config --cflags --libs gtk+-2.0 2> /dev/null` $TMPC 2> /dev/null ; then
+_gtkversion=`pkg-config --modversion gtk+-2.0 | sed 's/[^0-9]//g'`
+if test "$_sdlversion" -lt 240 ; then
+ gtk_too_old=yes
+else
+ gtk=yes
+
+fi
+
+fi # gtk compile test
+
+fi # -z $gtk
+
+if [ "$gtk" = "yes" ]; then
+
+if [ "$fsdrv" = "" ] ; then
+
+if [ "$bsd" = "yes" -o "$linux" = "yes" ]; then
+ fsdrv=xvid_fs.c
+else
+ fsdrv=null_fs.c
+fi
+
+fi # fsdrv test
+
+if [ "$fsdrv" = "xvid_fs.c" -o "$fsdrv" = "null_fs.c" ]; then
+ echo "fsdrv=$fsdrv" >> $TMPF
+else
+ echo "Warning: unknown gtk fullscreen driver: $fsdrv - using null driver"
+ echo 'fsdrv=null_fs.c' >> $TMPF
+ fsdrv=null_fs.c
+fi
+
+if [ "$fsdrv" = "xvid_fs.c" ]; then
+ FS_LIBS="-lX11 -lXxf86vm -lXext -L/usr/X11R6/lib"
+ echo 'FS_LIBS="-lX11 -lXxf86vm -lXext -L/usr/X11R6/lib"' >> $TMPF
+fi
+
+fi # gtk=yes test
+
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat << EOF
@@ -434,6 +495,8 @@
if test "$sdl" != "no" ; then
echo "SDL static link $sdl_static"
fi
+echo "GTK support $gtk"
+echo "GTK FS driver $fsdrv"
echo "mingw32 support $mingw32"
echo "Adlib support $adlib"
echo -n "FMOD support $fmod"
@@ -643,6 +706,8 @@
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
+. $TMPF
+
if test "$target_cpu" = "i386" ; then
echo "TARGET_ARCH=i386" >> $config_mak
echo "#define TARGET_ARCH \"i386\"" >> $config_h
@@ -720,6 +785,17 @@
fi
fi
+if test "$gtk" = "yes" ; then
+ . $TMPF
+ echo "#define CONFIG_GTK 1" >> $config_h
+ echo "CONFIG_GTK=yes" >> $config_mak
+ echo "GTK_LIBS=`pkg-config --libs gtk+-2.0`" >> $config_mak
+ echo "GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`" >> $config_mak
+ echo "FSDRV=$fsdrv" >> $config_mak
+ echo "FS_LIBS=$FS_LIBS" >> $config_mak
+ echo "" >> $config_mak
+fi
+
if test "$cocoa" = "yes" ; then
echo "#define CONFIG_COCOA 1" >> $config_h
echo "CONFIG_COCOA=yes" >> $config_mak
@@ -739,4 +815,4 @@
done
fi
-rm -f $TMPO $TMPC $TMPE $TMPS
+rm -f $TMPO $TMPC $TMPE $TMPS $TMPF
diff -u qemu.orig/vl.h qemu/vl.h
--- qemu.orig/vl.h Mon May 30 19:40:14 2005
+++ qemu/vl.h Sat May 28 16:16:18 2005
@@ -579,6 +579,9 @@
/* sdl.c */
void sdl_display_init(DisplayState *ds, int full_screen);
+/* gtk2.c */
+void gtk2_display_init(DisplayState *ds, int full_screen);
+
/* cocoa.m */
void cocoa_display_init(DisplayState *ds, int full_screen);
[-- Attachment #3: vl.c.diff --]
[-- Type: text/plain, Size: 1611 bytes --]
--- vl.c.orig Tue May 31 14:53:22 2005
+++ vl.c Tue May 31 14:52:55 2005
@@ -147,6 +147,7 @@
TextConsole *vga_console;
CharDriverState *serial_hds[MAX_SERIAL_PORTS];
CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
+int use_gtk = 0;
#ifdef TARGET_I386
int win2k_install_hack = 0;
#endif
@@ -2877,6 +2878,7 @@
QEMU_OPTION_cirrusvga,
QEMU_OPTION_g,
QEMU_OPTION_std_vga,
+ QEMU_OPTION_use_gtk,
QEMU_OPTION_monitor,
QEMU_OPTION_serial,
QEMU_OPTION_parallel,
@@ -2947,6 +2949,7 @@
{ "localtime", 0, QEMU_OPTION_localtime },
{ "isa", 0, QEMU_OPTION_isa },
{ "std-vga", 0, QEMU_OPTION_std_vga },
+ { "use-gtk", 0, QEMU_OPTION_use_gtk },
{ "monitor", 1, QEMU_OPTION_monitor },
{ "serial", 1, QEMU_OPTION_serial },
{ "parallel", 1, QEMU_OPTION_parallel },
@@ -3345,6 +3348,9 @@
case QEMU_OPTION_std_vga:
cirrus_vga_enabled = 0;
break;
+ case QEMU_OPTION_use_gtk:
+ use_gtk = 1;
+ break;
case QEMU_OPTION_g:
{
const char *p;
@@ -3599,7 +3605,17 @@
if (nographic) {
dumb_display_init(ds);
} else {
+#if defined(CONFIG_GTK)
#if defined(CONFIG_SDL)
+ /* so we can choose */
+ if (use_gtk)
+ gtk2_display_init(ds, full_screen);
+ else
+ sdl_display_init(ds, full_screen);
+#else
+ gtk2_display_init(ds, full_screen);
+#endif
+#elif defined(CONFIG_SDL)
sdl_display_init(ds, full_screen);
#elif defined(CONFIG_COCOA)
cocoa_display_init(ds, full_screen);
next prev parent reply other threads:[~2005-05-31 18:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-30 17:11 [Qemu-devel] gtk2 driver Jim C. Brown
2005-05-30 19:10 ` Lionel Ulmer
2005-05-30 20:21 ` Jim C. Brown
2005-05-30 21:10 ` Fabrice Bellard
2005-05-30 23:03 ` Jim C. Brown
2005-05-31 0:24 ` Jim C. Brown
2005-05-31 14:15 ` Sylvain Petreolle
2005-05-31 18:54 ` Jim C. Brown [this message]
2005-05-31 19:45 ` Jim C. Brown
2005-05-31 20:28 ` Jim C. Brown
2005-05-31 23:44 ` Jim C. Brown
-- strict thread matches above, loose matches on Subject: below --
2005-05-26 11:42 [Qemu-devel] [PATCH] Embed QEmu screen on a custom window Miguel Angel Fraile
2005-05-26 12:10 ` Christian MICHON
2005-05-26 20:03 ` Fabrice Bellard
2005-05-26 20:32 ` gtk [was Re: [Qemu-devel] [PATCH] Embed QEmu screen on a custom window] Jim C. Brown
2005-05-27 6:07 ` Jim C. Brown
2005-05-27 10:59 ` [Qemu-devel] gtk2 driver Sebastien Bechet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050531185418.GA14917@jbrown.mylinuxbox.org \
--to=jma5@umd.edu \
--cc=qemu-devel@nongnu.org \
--cc=spetreolle@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).