[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright configure gtkshell/swallow.c gtkshell...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright configure gtkshell/swallow.c gtkshell... |
Date: |
Mon, 20 Oct 2008 19:28:55 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 08/10/20 19:28:54
Modified files:
. : configure
gtkshell : swallow.c swallow.h
Log message:
Begin native windows porting work.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.113&r2=1.114
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/swallow.c?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/swallow.h?cvsroot=antiright&r1=1.3&r2=1.4
Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -b -r1.113 -r1.114
--- configure 19 Dec 2007 18:44:45 -0000 1.113
+++ configure 20 Oct 2008 19:28:54 -0000 1.114
@@ -29,17 +29,9 @@
USE_DISTCC=NO
USE_CCACHE=NO
USE_BOEHMGC=NO
-USE_THREADS=NO
# Must be enabled.
USE_GTK=YES
-
-# Set default CFLAGS, if necessary.
-if [ "$CFLAGS" = "" ]; then
- CFLAGS="-Os -fomit-frame-pointer -pipe"
-fi
-
-# Handle command line arguments.
for ARG in $@; do
if [ "$ARG" = "-d" ]; then
echo 'Configuring with debug options...'
@@ -58,14 +50,6 @@
USE_DISTCC=YES
elif [ "$ARG" = "--enable-boehmgc" ]; then
USE_BOEHMGC=YES
- elif [ "$ARG" = "--disable-threads" ]; then
- USE_THREADS=NO
- elif [ "$ARG" = "--enable-quickstart-toolbar" ]; then
- DEFS="$DEFS -DGSH_USE_QUICKSTART"
- elif [ "$ARG" = "--enable-clock-frame" ]; then
- DEFS="$DEFS -DGSH_FRAMED_CLOCK"
- else
- echo WARNING: Unknown configure option passed: "$ARG"
fi
done
@@ -148,19 +132,24 @@
fi
fi
+AS=as
+
+if [ -d /cygdrive ]; then
+ echo WIN32
+ WINDOWS="TRUE"
+ DEFS="$DEFS -DWIN32"
+ CFLAGS="$CFLAGS -mms-bitfields"
+ CC=mingw32-gcc
+ AS=mingw32-as
+fi
+
INCLUDE="$INCLUDE -I/usr/pkg/include -I/usr/local/include -I/usr/X11R6/include"
LIBDIR="$LIBDIR -L/usr/pkg/lib -L/usr/local/lib -L/usr/X11R6/lib"
-LDFLAGS="$LDFLAGS -lX11 -lXext -lXinerama"
+ARDATADIR=$PREFIX/share/antiright
DEFS="$DEFS -D_GNU_SOURCE -DARDATADIR='\"$PREFIX/share/antiright\"'"
INSTALL=/usr/bin/install
-if [ "$USE_THREADS" = "YES" ]; then
- DEFS="$DEFS -DUSE_THREADS"
- LDFLAGS="$LDFLAGS -lpthread"
- echo USE_THREADS=YES >> config.mk
-fi
-
echo Prefix is $PREFIX
echo "VERSION=$VERSION" >> config.mk
echo "PREFIX=$PREFIX" >> config.mk
@@ -172,4 +161,12 @@
echo "CFLAGS=$CFLAGS" >> config.mk
echo "CC=$CC" >> config.mk
echo "LDFLAGS=$LDFLAGS" >> config.mk
+echo "AS=$AS" >> config.mk
+
+if [ "$WINDOWS" = "TRUE" ]; then
+ sed 's_C:/cygwin/_/_g' < config.mk > config.mk.new
+ mv config.mk.new config.mk
+ sed 's_
__g' < config.mk > config.mk.new
+ mv config.mk.new config.mk
+fi
Index: gtkshell/swallow.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/swallow.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gtkshell/swallow.c 19 Dec 2007 18:44:46 -0000 1.5
+++ gtkshell/swallow.c 20 Oct 2008 19:28:54 -0000 1.6
@@ -22,15 +22,16 @@
along with AntiRight; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
-
+#ifndef WIN32
#include "gtkshell.h"
-
-#if 0 /* This is the previous code by Peter Amstutz.
- It is preserved for reference. */
+#ifndef WIN32
#include <gdk/gdkx.h>
+#endif
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
+#include <reent.h>
+#include <utmpx.h>
static gboolean
swallow(char* wantedWindow, Display* display, Screen* screen, Window hunger,
@@ -173,46 +174,30 @@
return ret;
}
-#endif /* 0 */
-
-struct
-SwallowData
-{
- GtkSocket * swallower;
- GdkNativeWindow window_id;
-};
-
-static gboolean
-swallow_app(gpointer client_data)
-{
- struct SwallowData * swallow_manager = client_data;
-
- gtk_socket_steal(swallow_manager->swallower,
- swallow_manager->window_id);
-/* g_free(swallow_manager); */
- return FALSE;
-}
-
void
-gsh_swallow_app(GtkWidget * swallower, const gchar * source_name)
+gsh_swallow_app(GtkWidget * target, gchar * source_name)
{
- struct SwallowData * swallow_manager
- = g_malloc(sizeof(struct SwallowData));
+ GdkWindow * window = target->window;
- swallow_manager->swallower=GTK_SOCKET(swallower);
- swallow_manager->window_id=atoi(source_name);
-
- (void) g_timeout_add(1000, swallow_app, swallow_manager);
+#ifndef WIN32
+ swallow(source_name,
+ GDK_WINDOW_XDISPLAY(window),
+ GDK_SCREEN_XSCREEN(gtk_widget_get_screen(target)),
+ GDK_WINDOW_XWINDOW(window),
+ (unsigned int *)&(target->requisition.width),
+ (unsigned int *)&(target->requisition.height));
+#endif
+ gtk_widget_set_size_request(target,
+ target->requisition.width,
+ target->requisition.height);
}
-void
-gsh_add_embedded(GSH * gsh, char * identifier)
-{
- GtkWidget * swallower;
-
- swallower=gtk_socket_new();
- $(gsh, manage, swallower);
- gtk_widget_show_all(gsh->widgets.window);
- gsh_swallow_app(swallower, identifier);
-}
+#endif /* not WIN32 */
+/* example
+ if(swallow(ap->applet_name,
+ GDK_DISPLAY_XDISPLAY(gdkdisplay),
+ GDK_SCREEN_XSCREEN(gdkscreen),
+ GDK_WINDOW_XWINDOW (GTK_WIDGET (ap->parentWidget)->window),
+ &ap->width, &ap->height))
+*/
Index: gtkshell/swallow.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/swallow.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/swallow.h 29 Nov 2007 18:22:44 -0000 1.3
+++ gtkshell/swallow.h 20 Oct 2008 19:28:54 -0000 1.4
@@ -23,11 +23,11 @@
#ifndef GSH_SWALLOW_H
#define GSH_SWALLOW_H
-void
-gsh_swallow_app(GtkWidget * target, const gchar * source_name);
+#ifndef WIN32
void
-gsh_add_embedded(GSH * gsh, char * identifier);
+gsh_swallow_app(GtkWidget * target, gchar * source_name);
+#endif /* not WIN32 */
#endif /* GSH_SWALLOW_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright configure gtkshell/swallow.c gtkshell...,
Jeffrey Bedard <=