[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/fb.cpp gui/fbsup.h
From: |
Udo Giacomozzi |
Subject: |
[Gnash-commit] gnash ChangeLog gui/fb.cpp gui/fbsup.h |
Date: |
Mon, 16 Oct 2006 08:39:27 +0000 |
CVSROOT: /cvsroot/gnash
Module name: gnash
Changes by: Udo Giacomozzi <udog> 06/10/16 08:39:27
Modified files:
. : ChangeLog
gui : fb.cpp fbsup.h
Log message:
Implemented clean exit for FB GUI
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1226&r2=1.1227
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fb.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fbsup.h?cvsroot=gnash&r1=1.8&r2=1.9
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.1226
retrieving revision 1.1227
diff -u -b -r1.1226 -r1.1227
--- ChangeLog 15 Oct 2006 22:40:57 -0000 1.1226
+++ ChangeLog 16 Oct 2006 08:39:27 -0000 1.1227
@@ -1,3 +1,7 @@
+2006-10-16 Udo Giacomozzi <address@hidden>
+
+ * gui/fbsup.h, gui/fb.cpp: Implemented clean exit for FB GUI
+
2006-10-16 Bastiaan Jacques <address@hidden>
* plugin/klash/klash.cpp: Fix compilation issues by ensuring that
Index: gui/fb.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/fb.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- gui/fb.cpp 13 Oct 2006 11:41:11 -0000 1.14
+++ gui/fb.cpp 16 Oct 2006 08:39:27 -0000 1.15
@@ -51,6 +51,7 @@
#include <sys/mman.h>
#include <linux/fb.h>
#include <unistd.h>
+#include <signal.h>
#include "gnash.h"
#include "gui.h"
@@ -104,6 +105,16 @@
#endif
//---------------
+int terminate_request=false; // global scope to avoid GUI access
+
+/// Called on CTRL-C and alike
+void terminate_signal(int signo) {
+ terminate_request=true;
+}
+
+
+//---------------
+
FBGui::FBGui() : Gui()
{
}
@@ -114,11 +125,16 @@
fd = -1;
fbmem = NULL;
buffer = NULL;
+
+ signal(SIGINT, terminate_signal);
+ signal(SIGTERM, terminate_signal);
}
FBGui::~FBGui()
{
+
if (fd>0) {
+ enable_terminal();
log_msg("Closing framebuffer device\n");
close(fd);
}
@@ -292,6 +308,8 @@
agg_handler->init_buffer(_mem, _size, _width, _height);
+ disable_terminal();
+
return true;
}
@@ -299,7 +317,7 @@
{
double timer = 0.0;
- while (true) {
+ while (!terminate_request) {
double prevtimer = timer;
@@ -428,6 +446,19 @@
#endif
+} // set_invalidated_region
+
+void FBGui::disable_terminal() {
+ /*
+ --> doesn't work as this hides the cursor of the *current* terminal (which
+ --> doesn't have to be the fb one). Maybe just detach from terminal?
+ printf("\033[?25l");
+ fflush(stdout);*/
+}
+
+void FBGui::enable_terminal() {
+ /*printf("\033[?25h");
+ fflush(stdout);*/
}
// end of namespace gnash
Index: gui/fbsup.h
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/fbsup.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gui/fbsup.h 13 Oct 2006 11:41:11 -0000 1.8
+++ gui/fbsup.h 16 Oct 2006 08:39:27 -0000 1.9
@@ -103,6 +103,12 @@
bool initialize_renderer();
+ /// switches from text mode to graphics mode (disables the text
terminal)
+ void disable_terminal();
+
+ /// reverts disable_terminal() changes
+ void enable_terminal();
+
int valid_x(int x);
int valid_y(int y);