[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash Makefile.am ChangeLog backend/Makefile.am...
From: |
Rob Savoye |
Subject: |
[Gnash-commit] gnash Makefile.am ChangeLog backend/Makefile.am... |
Date: |
Sat, 15 Sep 2007 03:06:39 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Rob Savoye <rsavoye> 07/09/15 03:06:38
Modified files:
. : Makefile.am ChangeLog
backend : Makefile.am
extensions : Makefile.am
gui : Makefile.am
extensions/lirc: Makefile.am
extensions/dejagnu: dejagnu.cpp
Added files:
libbase : lirc.h lirc.cpp
Removed files:
extensions/lirc: lirc.cpp lirc.h
Log message:
* extensions/lirc/Makefile.am: Chnage from lirc.* to lirc_ext.*
to
avoid name collisions.
* libbase/lirc.h, lirc.cpp: New files for lirc interface for
remote control.
* extensions/lirc_ext.h, lirc_ext.cpp: Renamed from lirc.*.
* libbase/extensions.cpp: Change how extraneous directories get
ignored.
* Makefile.am: Add debug info for lirc.
* backend/Makefile.am: Wrap conditionals around building the
libraries.
* extensions/Makefile.am: Add Lirc extension.
* extensions/dejagnu/dejagnu.cpp: Change debug support to
log_*().
* gui/Makefile.am: Add LIRC flags to build.
* libbase/Makefile.am: Add lirc.cpp and lirc.h, new files for
lirc
support.
* libbase/network.cpp, network.h: Add connectSocket() for
talking
to named pipes.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/lirc.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/lirc.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/Makefile.am?cvsroot=gnash&r1=1.89&r2=1.90
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4322&r2=1.4323
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/Makefile.am?cvsroot=gnash&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/gnash/extensions/Makefile.am?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Makefile.am?cvsroot=gnash&r1=1.106&r2=1.107
http://cvs.savannah.gnu.org/viewcvs/gnash/extensions/lirc/Makefile.am?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/extensions/lirc/lirc.cpp?cvsroot=gnash&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/extensions/lirc/lirc.h?cvsroot=gnash&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/extensions/dejagnu/dejagnu.cpp?cvsroot=gnash&r1=1.10&r2=1.11
Patches:
Index: Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/Makefile.am,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- Makefile.am 29 Aug 2007 00:58:02 -0000 1.89
+++ Makefile.am 15 Sep 2007 03:06:37 -0000 1.90
@@ -15,7 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# $Id: Makefile.am,v 1.89 2007/08/29 00:58:02 strk Exp $
+# $Id: Makefile.am,v 1.90 2007/09/15 03:06:37 rsavoye Exp $
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.6.0
@@ -151,8 +151,8 @@
@echo " Z_LIBS is $(Z_LIBS)"
@echo " LIBXML_CFLAGS is $(LIBXML_CFLAGS)"
@echo " LIBXML_LIBS is $(LIBXML_LIBS)"
- @echo " FREETYPE2_CFLAGS is $(FREETYPE2_CFLAGS)"
- @echo " FREETYPE2_LIBS is $(FREETYPE2_LIBS)"
+ @echo " FREETYPE_CFLAGS is $(FREETYPE2_CFLAGS)"
+ @echo " FREETYPE_LIBS is $(FREETYPE2_LIBS)"
@echo " FONTCONFIG_CFLAGS is $(FONTCONFIG_CFLAGS)"
@echo " FONTCONFIG_LIBS is $(FONTCONFIG_LIBS)"
if HAVE_DMALLOC
@@ -163,6 +163,10 @@
@echo "MYSQL_CFLAGS is $(MYSQL_CFLAGS)"
@echo "MYSQL_LIBS is $(MYSQL_LIBS)"
endif
+if BUILD_LIRC_EXT
+ @echo " LIRC_CFLAGS is $(LIRC_CFLAGS)"
+ @echo " LIRC_LIBS is $(LIRC_LIBS)"
+endif
if USE_MAD_ENGINE
@echo " MAD_CFLAGS is $(MAD_CFLAGS)"
@echo " MAD_LIBS is $(MAD_LIBS)"
@@ -193,8 +197,10 @@
@echo " SWFDEC_TESTSUITE $(SWFDEC_TESTSUITE)"
endif
@echo "Graphics support..."
+if BUILD_CAIRO_RENDERER
@echo " CAIRO_CFLAGS is $(CAIRO_CFLAGS)"
@echo " CAIRO_LIBS is $(CAIRO_LIBS)"
+endif
if BUILD_OGL_RENDERER
@echo " GLEXT_CFLAGS is $(GLEXT_CFLAGS)"
@echo " GLEXT_LIBS is $(GLEXT_LIBS)"
@@ -251,3 +257,4 @@
$(srcdir)/testsuite/anaylse-results.sh
.PHONY : dumpconfig anal testreport checksum check mudflap mudflap-check
snapshot deb debian rmp redhat
+
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4322
retrieving revision 1.4323
diff -u -b -r1.4322 -r1.4323
--- ChangeLog 14 Sep 2007 17:15:57 -0000 1.4322
+++ ChangeLog 15 Sep 2007 03:06:37 -0000 1.4323
@@ -1,3 +1,23 @@
+2007-09-14 Rob Savoye <address@hidden>
+
+ * extensions/lirc/Makefile.am: Chnage from lirc.* to lirc_ext.* to
+ avoid name collisions.
+ * libbase/lirc.h, lirc.cpp: New files for lirc interface for
+ remote control.
+ * extensions/lirc_ext.h, lirc_ext.cpp: Renamed from lirc.*.
+ * libbase/extensions.cpp: Change how extraneous directories get
+ ignored.
+ * Makefile.am: Add debug info for lirc.
+ * backend/Makefile.am: Wrap conditionals around building the
+ libraries.
+ * extensions/Makefile.am: Add Lirc extension.
+ * extensions/dejagnu/dejagnu.cpp: Change debug support to log_*().
+ * gui/Makefile.am: Add LIRC flags to build.
+ * libbase/Makefile.am: Add lirc.cpp and lirc.h, new files for lirc
+ support.
+ * libbase/network.cpp, network.h: Add connectSocket() for talking
+ to named pipes.
+
2007-09-14 Sandro Santilli <address@hidden>
* server/DynamicShape.cpp: optimized bounds computation by the
@@ -40,6 +60,9 @@
2007-09-13 Rob Savoye <address@hidden>
+ * libbase/extension.cpp: Change alorithm for which files to ignore
+ when scanning.
+
* macros/lirc.m4: Search for lirc files, so we can support a
remote control.
Index: backend/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/backend/Makefile.am,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- backend/Makefile.am 10 Aug 2007 04:36:13 -0000 1.59
+++ backend/Makefile.am 15 Sep 2007 03:06:37 -0000 1.60
@@ -113,29 +113,33 @@
libgnashbackend_la_LDFLAGS = -release $(VERSION)
noinst_LTLIBRARIES = # set later on by conditionals
+
+if BUILD_OGL_RENDERER
if HAVE_OPENGL
noinst_LTLIBRARIES += libgnashogl.la
#plugins_LTLIBRARIES += libgnashogl.la
libgnashogl_la_SOURCES = render_handler_tri.cpp render_handler_ogl.cpp
#libgnashogl_la_LDFLAGS = -module -avoid-version -no-undefined
-libgnashogl_la_LDFLAGS =
+endif
endif
+if BUILD_AGG_RENDERER
if HAVE_AGG
noinst_LTLIBRARIES += libgnashagg.la
#plugins_LTLIBRARIES += libgnashagg.la
libgnashagg_la_SOURCES = render_handler_tri.cpp render_handler_agg.cpp
#libgnashagg_la_LDFLAGS = -module -avoid-version -no-undefined
-libgnashagg_la_LDFLAGS =
libgnashagg_la_LIBADD = $(AGG_LIBS)
endif
+endif
+if BUILD_CAIRO_RENDERER
if HAVE_CAIRO
noinst_LTLIBRARIES += libgnashcairo.la
# plugins_LTLIBRARIES += libgnashcairo.la
libgnashcairo_la_SOURCES = render_handler_tri.cpp render_handler_cairo.cpp
#libgnashcairo_la_LDFLAGS = -module -avoid-version -no-undefined
-libgnashcairo_la_LDFLAGS =
+endif
endif
# Rebuild with GCC 4.x Mudflap support
Index: extensions/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/extensions/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- extensions/Makefile.am 20 Jul 2007 01:50:32 -0000 1.9
+++ extensions/Makefile.am 15 Sep 2007 03:06:38 -0000 1.10
@@ -31,6 +31,14 @@
OTHER_DIRS += fileio
endif
+if BUILD_LIRC_EXT
+OTHER_DIRS += lirc
+endif
+
+if BUILD_DBUS_EXT
+OTHER_DIRS += dbus
+endif
+
if BUILD_GTK_EXT
if BUILD_GTK_GUI
OTHER_DIRS += gtk2
Index: gui/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/gui/Makefile.am,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -b -r1.106 -r1.107
--- gui/Makefile.am 13 Sep 2007 09:47:31 -0000 1.106
+++ gui/Makefile.am 15 Sep 2007 03:06:38 -0000 1.107
@@ -45,6 +45,7 @@
-DPLUGINSDIR=\"$(pluginsdir)\" \
$(LIBXML_CFLAGS) \
$(DMALLOC_CFLAGS) \
+ $(LIRC_CFLAGS) \
$(BOOST_CFLAGS) \
$(PTHREAD_CFLAGS) \
$(NULL)
@@ -78,6 +79,8 @@
$(CURL_LIBS) \
$(LIBXML_LIBS) \
$(INCLTDL) \
+ $(LIRC_LIBS) \
+ $(MYSQL_LIBS)
$(BOOST_LIBS) \
$(PTHREAD_LIBS) \
$(NULL)
@@ -87,8 +90,7 @@
$(top_builddir)/backend/libgnashbackend.la \
$(top_builddir)/server/libgnashserver.la \
$(top_builddir)/libgeometry/libgnashgeo.la \
- $(top_builddir)/libbase/libgnashbase.la \
- $(MYSQL_LIBS)
+ $(top_builddir)/libbase/libgnashbase.la
# Only build loadable modules unless statically linking
# if DYNAMIC_GUI # make shared libraries suitable for dlopen().
@@ -333,6 +335,11 @@
gtk.cpp gtksup.h gtk_glue.h
gtk_gnash_LDADD = $(top_builddir)/backend/libgnashagg.la \
$(GNASH_LIBS) $(GTK_LIBS) $(AGG_LIBS)
+# if ALP # Access Linux Platform
+# gtk_gnash_LDFLAGS += "-shared -Xlinker -z -Xlinker defs $(GTK2_LIBS)"
+# gtk_gnash_LDADD += $(ALP_LIBS)
+# endif
+
endif # BUILD_AGG_RENDERER
if BUILD_CAIRO_RENDERER
gtk_gnash_CPPFLAGS += $(CAIRO_CFLAGS)
@@ -416,3 +423,18 @@
# $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$i
"$(DESTDIR)$(plugindir)/$$i" ; \
# done
# endif
+
+# if ALP
+# alpdir = build
+# install-alp: libgnashalp.la
+# $(mkinstalldirs) build
+# ${CP} $(srcdir)/Manifest.xml build/
+# $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG)
$(alp_LTLIBRARIES) build
+# ${RM} build/*.a build/*.T build/*.0
+
+# alp_LTLIBRARIES = libgnashalp.la
+
+# libgnashalp_la_SOURCES = $(gtk_gnash_SOURCES)
+# libgnashalp_la_LDFLAGS = -module -avoid-version
+
+# endif
Index: extensions/lirc/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/extensions/lirc/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- extensions/lirc/Makefile.am 12 Sep 2007 04:16:30 -0000 1.1
+++ extensions/lirc/Makefile.am 15 Sep 2007 03:06:38 -0000 1.2
@@ -29,17 +29,15 @@
-I$(top_srcdir)/asobjs \
$(INCLTDL)
-AM_LDFLAGS = \
+lirc_la_SOURCES = lirc_ext.cpp lirc_ext.h
+lirc_la_LDFLAGS = -module -avoid-version -no-undefined
+lirc_la_LIBDADD = $(LIBADD_DL) $(LIBLTDL) \
$(top_builddir)/libbase/libgnashbase.la \
$(top_builddir)/backend/libgnashbackend.la \
$(top_builddir)/server/libgnashserver.la \
$(PTHREAD_LIBS) \
$(NULL)
-lirc_la_SOURCES = lirc.cpp lirc.h
-lirc_la_LDFLAGS = -module -avoid-version -no-undefined
-lirc_la_LIBDADD = $(LIBADD_DL) $(LIBLTDL) $(AM_LDFLAGS)
-
check_PROGRAMS = # SharedTest
CLEANFILES = \
gnash-dbg.log
Index: extensions/dejagnu/dejagnu.cpp
===================================================================
RCS file: /sources/gnash/gnash/extensions/dejagnu/dejagnu.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- extensions/dejagnu/dejagnu.cpp 1 Jul 2007 10:53:58 -0000 1.10
+++ extensions/dejagnu/dejagnu.cpp 15 Sep 2007 03:06:38 -0000 1.11
@@ -37,8 +37,6 @@
as_value dejagnu_fail(const fn_call& fn);
as_value dejagnu_totals(const fn_call& fn);
-LogFile& dbglogfile = LogFile::getDefaultInstance();
-
class dejagnu_as_object : public as_object
{
public:
@@ -95,7 +93,7 @@
// GNASH_REPORT_FUNCTION;
passed++;
- dbglogfile << "PASSED: " << msg << endl;
+ log_msg("PASSED: %s\n", msg);
return NULL;
}
@@ -105,7 +103,7 @@
// GNASH_REPORT_FUNCTION;
failed++;
- dbglogfile << "FAILED: " << msg << endl;
+ log_msg("FAILED: %s\n", msg);
return NULL;
}
Index: libbase/lirc.h
===================================================================
RCS file: libbase/lirc.h
diff -N libbase/lirc.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libbase/lirc.h 15 Sep 2007 03:06:37 -0000 1.1
@@ -0,0 +1,60 @@
+//
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#ifndef __LIRC_H__
+#define __LIRC_H__
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gnash.h"
+#include "network.h"
+
+namespace gnash {
+
+class DSOEXPORT Lirc : public Network {
+public:
+ Lirc();
+ ~Lirc();
+ bool init();
+ bool init(const char *sockpath);
+
+ // Whenever lircd receives a IR signal it will broadcast the
+ // following string to each client:
+ // <code> <repeat count> <button name> <remote control name>
+ gnash::key::code getKey();
+ const char *getButton();
+#if 0
+ char *parseCode(char *packet);
+ int parseCount(char *packet);
+ char *parseButtonName(char *packet);
+ char *parseControlName(char *packet);
+#endif
+ private:
+ const char *sockname;
+};
+
+} // end of gnash namespace
+
+// __LIRC_H__
+#endif
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
Index: libbase/lirc.cpp
===================================================================
RCS file: libbase/lirc.cpp
diff -N libbase/lirc.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libbase/lirc.cpp 15 Sep 2007 03:06:37 -0000 1.1
@@ -0,0 +1,164 @@
+//
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string>
+
+#include <iostream>
+#include "gnash.h"
+#include "network.h"
+#include "log.h"
+#include "lirc.h"
+
+using namespace std;
+
+namespace gnash {
+
+// this number camne from the lirc irw program. If this size works for
+// them, it should work for us.
+const int LIRC_PACKET_SIZE = 128;
+const int TIMEOUT = 10;
+
+Lirc::Lirc()
+ : sockname("/tmp/lircd")
+{
+ GNASH_REPORT_FUNCTION;
+}
+
+Lirc::~Lirc()
+{
+ GNASH_REPORT_FUNCTION;
+ closeNet();
+}
+
+bool
+Lirc::init()
+{
+ GNASH_REPORT_FUNCTION;
+ return connectSocket(sockname);
+}
+
+bool
+Lirc::init(const char *sockpath)
+{
+ GNASH_REPORT_FUNCTION;
+ return connectSocket(sockpath);
+}
+
+// Whenever lircd receives a IR signal it will broadcast the
+// following string to each client:
+// <code> <repeat count> <button name> <remote control name>
+// 0000000000000003 1 PREV LIRCEMU
+// 0000000000000006 1 NEXT LIRCEMU
+// 0000000000000012 1 A LIRCEMU
+
+gnash::key::code
+Lirc::getKey()
+{
+ GNASH_REPORT_FUNCTION;
+
+ key::code key;
+
+ char buf[LIRC_PACKET_SIZE];
+ memset(buf, 0, LIRC_PACKET_SIZE);
+
+ readNet(buf, LIRC_PACKET_SIZE, TIMEOUT);
+
+ string packet = buf;
+ string::size_type space1 = packet.find(" ") +1;
+ string::size_type space2 = packet.find(" ", space1) + 1;
+ string::size_type space3 = packet.find(" ", space2) +1;
+
+ // read the data if there is any
+ string code_str = packet.substr(0, space1);
+ string count_str = packet.substr(space1, space2-space1);
+ string button_str = packet.substr(space2,space3-space2);
+ string control_str = packet.substr(space3);
+
+ if (button_str[0] > 'A' && button_str[0] < 'Z') {
+ cerr << "Character: " << button_str << endl;
+ key = (gnash::key::code)button_str[0];
+ }
+
+ return key;
+}
+
+const char *
+Lirc::getButton()
+{
+// GNASH_REPORT_FUNCTION;
+
+ char buf[LIRC_PACKET_SIZE];
+ memset(buf, 0, LIRC_PACKET_SIZE);
+
+ readNet(buf, LIRC_PACKET_SIZE, TIMEOUT);
+
+ string packet = buf;
+ string::size_type space1 = packet.find(" ") + 1;
+ string::size_type space2 = packet.find(" ", space1) + 1;
+ string::size_type space3 = packet.find(" ", space2) +1;
+
+
+ // read the data if there is any
+ string button_str = packet.substr(space2, space3-space2);
+
+ return button_str.c_str();
+}
+
+#if 0
+char *
+Lirc::parseCode(char *packet)
+{
+ GNASH_REPORT_FUNCTION;
+
+ char *ptr;
+ ptr = strchr(packet, " ");
+
+ return ptr;
+}
+
+int
+Lirc::parseCount(char *packet)
+{
+ GNASH_REPORT_FUNCTION;
+
+}
+
+char *
+Lirc::parseButtonName(char *packet)
+{
+ GNASH_REPORT_FUNCTION;
+
+}
+char *
+Lirc::parseControlName(char *packet)
+{
+ GNASH_REPORT_FUNCTION;
+
+}
+#endif
+
+} // end of gnash namespace
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
Index: extensions/lirc/lirc.cpp
===================================================================
RCS file: extensions/lirc/lirc.cpp
diff -N extensions/lirc/lirc.cpp
--- extensions/lirc/lirc.cpp 14 Sep 2007 23:16:21 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,311 +0,0 @@
-//
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <iostream>
-
-#include <cstdarg>
-#include <cstdio>
-#include <cstdlib>
-
-#include <string>
-#include "log.h"
-#include "lirc.h"
-#include "lirc/lirc_client.h"
-#include "fn_call.h"
-#include "as_object.h"
-#include "builtin_function.h" // need builtin_function
-
-using namespace std;
-
-namespace gnash
-{
- struct lirc_config *config;
-
- as_value lirc_ext_init(const fn_call& fn);
- as_value lirc_ext_deinit(const fn_call& fn);
- as_value lirc_ext_readconfig(const fn_call& fn);
- as_value lirc_ext_freeconfig(const fn_call& fn);
- as_value lirc_ext_nextcode(const fn_call& fn);
- as_value lirc_ext_code2char(const fn_call& fn);
- as_value lirc_ext_readconfig_only(const fn_call& fn);
- as_value lirc_ext_code2charprog(const fn_call& fn);
- as_value lirc_ext_getsocketname(const fn_call& fn);
- as_value lirc_ext_getmode(const fn_call& fn);
- as_value lirc_ext_setmode(const fn_call& fn);
-
-class lirc_as_object : public as_object
-{
-public:
- Lirc obj;
-};
-
-static void
-attachInterface(as_object *obj)
-{
- GNASH_REPORT_FUNCTION;
- obj->init_member("lirc_init", new builtin_function(lirc_ext_init));
- obj->init_member("lirc_deinit", new builtin_function(lirc_ext_deinit));
- obj->init_member("lirc_readconfig", new
builtin_function(lirc_ext_readconfig));
- obj->init_member("lirc_freeconfig", new
builtin_function(lirc_ext_freeconfig));
- obj->init_member("lirc_nextcode", new builtin_function(lirc_ext_nextcode));
- obj->init_member("lirc_code2char", new
builtin_function(lirc_ext_code2char));
- obj->init_member("lirc_readconfig_only", new
builtin_function(lirc_ext_readconfig_only));
- obj->init_member("lirc_code2charprog", new
builtin_function(lirc_ext_code2charprog));
- obj->init_member("lirc_getsocketname", new
builtin_function(lirc_ext_getsocketname));
- obj->init_member("lirc_getmode", new builtin_function(lirc_ext_getmode));
- obj->init_member("lirc_setmode", new builtin_function(lirc_ext_setmode));
-}
-
-static as_object*
-getInterface()
-{
- GNASH_REPORT_FUNCTION;
- static boost::intrusive_ptr<as_object> o;
- if (o == NULL) {
- o = new as_object();
- }
- return o.get();
-}
-
-static as_value
-lirc_ctor(const fn_call& /* fn */)
-{
- GNASH_REPORT_FUNCTION;
- lirc_as_object* obj = new lirc_as_object();
-
- attachInterface(obj);
- return as_value(obj); // will keep alive
-// printf ("Hello World from %s !!!\n", __PRETTY_FUNCTION__);
-}
-
-
-Lirc::Lirc()
-{
- GNASH_REPORT_FUNCTION;
-}
-
-Lirc::~Lirc()
-{
- GNASH_REPORT_FUNCTION;
-}
-
-// int lirc_init(char *prog,int verbose);
-as_value
-lirc_ext_init(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- string text = fn.arg(0).to_string();
- int num = fn.arg(1).to_number<int>();
- return as_value(lirc_init(const_cast<char *>(text.c_str()), num));
- }
- return as_value(false);
-}
-
-// int lirc_deinit(void);
-as_value
-lirc_ext_deinit(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- string text = fn.arg(0).to_string();
- return as_value(lirc_deinit());
- }
- return as_value(false);
-}
-
-// int lirc_readconfig(char *file,struct lirc_config **config, int
(check)(char *s));
-as_value
-lirc_ext_readconfig(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- string text = fn.arg(0).to_string();
- config = dynamic_cast<lirc_config *>(fn.arg(1).to_object().get());
- char *code = const_cast<char *>(text.c_str());
- // char *check = const_cast<char *>(fn.arg(2).to_string().c_str());
- // return as_value(lirc_readconfig(const_cast<char *>(text.c_str(),
&config, check)));
- }
- return as_value(false);
-}
-
-// void lirc_freeconfig(struct lirc_config *config);
-as_value lirc_ext_freeconfig(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- config = dynamic_cast<lirc_config *>(fn.arg(0).to_object().get());
- lirc_freeconfig(config);
- return as_value(true);
- }
- return as_value(false);
-}
-
-// int lirc_nextcode(char **code);
-as_value lirc_ext_nextcode(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- string text = fn.arg(0).to_string();
- char *code = const_cast<char *>(text.c_str());
- return as_value(lirc_nextcode(&code));
- }
- return as_value(false);
-}
-
-// int lirc_code2char(struct lirc_config *config,char *code,char **string);
-as_value lirc_ext_code2char(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- config = dynamic_cast<lirc_config *>(fn.arg(0).to_object().get());
- char *code = const_cast<char *>(fn.arg(1).to_string().c_str());
- char *str = const_cast<char *>(fn.arg(2).to_string().c_str());
- return as_value(lirc_code2char(config, code, &str));
- }
- return as_value(false);
-}
-
-// int lirc_readconfig_only(char *file,struct lirc_config **config,
-// int (check)(char *s));
-as_value
-lirc_ext_readconfig_only(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- char *file = const_cast<char *>(fn.arg(0).to_string().c_str());
- config = dynamic_cast<lirc_config *>(fn.arg(1).to_object().get());
- char *check = const_cast<char *>(fn.arg(2).to_string().c_str());
- // return as_value(lirc_readconfig_only(file, &config, check));
- }
- return as_value(false);
-}
-
-// int lirc_code2charprog(struct lirc_config *config,char *code,char **string,
-// char **prog);
-as_value
-lirc_ext_code2charprog(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- config = dynamic_cast<lirc_config *>(fn.arg(0).to_object().get());
- char *code = const_cast<char *>(fn.arg(1).to_string().c_str());
- char *str = const_cast<char *>(fn.arg(2).to_string().c_str());
- char *prog = const_cast<char *>(fn.arg(3).to_string().c_str());
- return as_value(lirc_code2charprog(config, code, &str, &prog));
- }
- return as_value(false);
-}
-
-// size_t lirc_getsocketname(const char *filename, char *buf, size_t size);
-as_value
-lirc_ext_getsocketname(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- const char *filename = fn.arg(0).to_string().c_str();
- char *buf = const_cast<char *>(fn.arg(1).to_string().c_str());
- size_t size = fn.arg(2).to_number<int>();
- lirc_getsocketname(filename, buf, size);
- }
- return as_value(false);
-}
-
-// const char *lirc_getmode(struct lirc_config *config);
-as_value
-lirc_ext_getmode(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- config = dynamic_cast<lirc_config *>(fn.arg(0).to_object().get());
- return as_value(lirc_getmode(config));
- }
- return as_value(false);
-}
-
-// const char *lirc_setmode(struct lirc_config *config, const char *mode);
-as_value
-lirc_ext_setmode(const fn_call& fn)
-{
- GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<lirc_as_object> ptr =
ensureType<lirc_as_object>(fn.this_ptr);
-
- if (fn.nargs > 0) {
- config = dynamic_cast<lirc_config *>(fn.arg(0).to_object().get());
- char *mode = const_cast<char *>(fn.arg(1).to_string().c_str());
- return as_value(lirc_setmode(config, mode));
- }
- return as_value(false);
-}
-
-std::auto_ptr<as_object>
-init_lirc_instance()
-{
- return std::auto_ptr<as_object>(new lirc_as_object());
-}
-
-// const char *lirc_setmode(struct lirc_config *config, const char *mode);
-extern "C" {
- void
- lirc_class_init(as_object &obj)
- {
-// GNASH_REPORT_FUNCTION;
- // This is going to be the global "class"/"function"
- static boost::intrusive_ptr<builtin_function> cl;
- if (cl == NULL) {
- cl = new builtin_function(&lirc_ctor, getInterface());
-// // replicate all interface to class, to be able to access
-// // all methods as static functions
- attachInterface(cl.get());
- }
-
- obj.init_member("Lirc", cl.get());
- }
-} // end of extern C
-
-
-} // end of gnash namespace
-
-// Local Variables:
-// mode: C++
-// indent-tabs-mode: t
-// End:
Index: extensions/lirc/lirc.h
===================================================================
RCS file: extensions/lirc/lirc.h
diff -N extensions/lirc/lirc.h
--- extensions/lirc/lirc.h 12 Sep 2007 04:16:31 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-//
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef __LIRC_PLUGIN_H__
-#define __LIRC_PLUGIN_H__
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <memory> // for auto_ptr
-#include "as_object.h"
-
-namespace gnash
-{
-
-class Lirc {
-public:
- Lirc();
- ~Lirc();
-private:
-};
-
-extern "C" {
- void lirc_class_init(as_object &obj);
- /// Return an instance
-}
-
-std::auto_ptr<as_object> init_lirc_instance();
-
-} // end of gnash namespace
-
-// __LIRC_PLUGIN_H__
-#endif
-
-// Local Variables:
-// mode: C++
-// indent-tabs-mode: t
-// End:
- [Gnash-commit] gnash Makefile.am ChangeLog backend/Makefile.am...,
Rob Savoye <=