[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-dev] Patch (5640) for task 6124
From: |
annonygmouse |
Subject: |
Re: [Gnash-dev] Patch (5640) for task 6124 |
Date: |
Mon, 18 Dec 2006 01:51:02 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; ca-AD; rv:1.8.0.8) Gecko/20061105 Iceape/1.0.6 (Debian-1.0.6-1) |
annonygmouse wrote:
Hi.
Today I had some time to play with gtk+gnash.
The result is a first attempt to implement task 6124 (open file menu
option).
The web says "You are not allowed to post comments on this tracker with
your current authentification level." so I can't add the patch to the task.
See https://savannah.gnu.org/patch/index.php?5640
Everytime I try to add a comment to this patch it tells me "No item
found with that id." so I post it here :)
I've finished a first version of the preferences window.
It's populated using the rcfile class from rc.cpp.
This way it's .gnashrc independent.
What did you exactly expect from this preferences window?
I mean: If a user changes a preference, the window should
create a new .gnashrc?
Or it only should change this preference during the session
(until gnash is closed)?
I attach this preliminary version, it only shows the preferences read
from .gnashrc, it does not update any changes.
SebastiĆ
? .gtk.cpp.swp
? about_gnash_open_file.diff
? window_preferences_open_file.diff
Index: NullGui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/NullGui.h,v
retrieving revision 1.7
diff -u -p -u -r1.7 NullGui.h
--- NullGui.h 29 Oct 2006 18:34:10 -0000 1.7
+++ NullGui.h 18 Dec 2006 00:34:09 -0000
@@ -54,6 +54,7 @@ public:
return true;
}
bool run();
+ bool createMenuBar() { return true; }
bool createMenu() { return true; }
bool setupEvents() { return true; }
void renderBuffer() { }
Index: Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.37
diff -u -p -u -r1.37 Player.cpp
--- Player.cpp 6 Dec 2006 10:58:34 -0000 1.37
+++ Player.cpp 18 Dec 2006 00:34:09 -0000
@@ -239,6 +239,86 @@ Player::load_movie()
return md;
}
+/* \brief Run, used to open a new flash file. Using previous initialization */
+int Player::run(const char* infile)
+{
+ bool background = true;
+ // No file name was supplied
+ assert (infile);
+ _infile = infile;
+
+ // Set base url
+ _baseurl = infile;
+
+ // Set _root._url (either explicit of from infile)
+ _url=std::string(infile);
+
+ // Set base url for this movie (needed before parsing)
+ gnash::set_base_url(URL(_baseurl));
+
+ // Load the actual movie.
+ _movie_def = load_movie();
+ if ( ! _movie_def )
+ {
+ return EXIT_FAILURE;
+ }
+
+
+ // Get info about the width & height of the movie.
+ int movie_width = static_cast<int>(_movie_def->get_width_pixels());
+ int movie_height = static_cast<int>(_movie_def->get_height_pixels());
+ float movie_fps = _movie_def->get_frame_rate();
+
+ if (!width) {
+ width = int(movie_width * scale);
+ }
+ if (!height) {
+ height = int(movie_height * scale);
+ }
+
+
+ // Now that we know about movie size, resize gui window (pending).
+ //_gui->createWindow(infile, width, height);
+
+ movie_root& root = VM::init(*_movie_def).getRoot();
+ sprite_instance* m = root.get_root_movie();
+
+ // Start loader thread
+ _movie_def->completeLoad();
+
+ // Parse parameters
+ for ( map<string,string>::const_iterator it=params.begin(),
+ itEnd=params.end(); it != itEnd; ++it)
+ {
+ // todo: use a case-insensitive string type
+ if ( it->first == "flashvars" || it->first == "FlashVars" )
+ {
+ setFlashVars(*m, it->second);
+ continue;
+ }
+
+ // too much noise...
+ //log_warning("Unused parameter %s = %s",
+ // it->first.c_str(), it->second.c_str());
+ }
+
+
+ root.set_display_viewport(0, 0, width, height);
+ root.set_background_alpha(background ? 1.0f : 0.05f);
+
+ if (!delay) {
+ delay = (unsigned int) (1000 / movie_fps) ; // milliseconds per frame
+ }
+ _gui->setInterval(delay);
+
+ if (exit_timeout) {
+ _gui->setTimeout((unsigned int)(exit_timeout * 1000));
+ }
+
+ //_gui->run();
+
+}
+
int
Player::run(int argc, char* argv[], const char* infile, const char* url)
{
Index: Player.h
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.h,v
retrieving revision 1.7
diff -u -p -u -r1.7 Player.h
--- Player.h 21 Nov 2006 00:25:46 -0000 1.7
+++ Player.h 18 Dec 2006 00:34:09 -0000
@@ -72,6 +72,8 @@ public:
int run(int argc, char* argv[],
const char* infile, const char* url=NULL);
+ int run( const char* infile);
+
float setScale(float s);
// milliseconds per frame
Index: gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.53
diff -u -p -u -r1.53 gtk.cpp
--- gtk.cpp 5 Dec 2006 23:25:42 -0000 1.53
+++ gtk.cpp 18 Dec 2006 00:34:10 -0000
@@ -65,6 +65,7 @@ GtkGui::init(int argc, char **argv[])
GNASH_REPORT_FUNCTION;
+
gtk_init (&argc, argv);
glue.init (argc, argv);
@@ -77,6 +78,12 @@ GtkGui::init(int argc, char **argv[])
} else {
_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
dbglogfile << "Created top level window" << endl;
+
+ _vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (_vbox);
+ gtk_container_add (GTK_CONTAINER (_window), _vbox);
+ createMenuBar();
+
}
// XXXbjacques: why do we need this?
@@ -98,7 +105,12 @@ GtkGui::init(int argc, char **argv[])
setupEvents();
gtk_widget_realize(_window);
- gtk_container_add(GTK_CONTAINER(_window), _drawing_area);
+
+ if (_xid)
+ gtk_container_add(GTK_CONTAINER(_window), _drawing_area);
+ else
+ gtk_box_pack_start (GTK_BOX (_vbox), _drawing_area, FALSE, FALSE, 0);
+
gtk_widget_show(_drawing_area);
gtk_widget_show(_window);
@@ -277,13 +289,151 @@ GtkGui::run()
return true;
}
+bool GtkGui::createMenuBar()
+{
+ GtkWidget *menuitem1;
+ GtkWidget *menu1;
+ GtkWidget *obre1;
+ GtkWidget *desa1;
+ GtkWidget *anomena_i_desa1;
+ GtkWidget *separatormenuitem1;
+ GtkWidget *surt1;
+ GtkWidget *menuitem2;
+ GtkWidget *menu2;
+ /* Commented untill cut, copy, paste functionality is implemented
+ GtkWidget *retalla1;
+ GtkWidget *copia1;
+ GtkWidget *enganxa1;
+ GtkWidget *suprimeix1; */
+ GtkWidget *preferences1;
+ GtkWidget *menuitem3;
+ GtkWidget *menu3;
+ GtkWidget *menuitem4;
+ GtkWidget *menu4;
+ GtkWidget *quant_a1;
+
+ _menubar = gtk_menu_bar_new ();
+ gtk_widget_show (_menubar);
+ gtk_box_pack_start (GTK_BOX (_vbox), _menubar, FALSE, FALSE, 0);
+
+ menuitem1 = gtk_menu_item_new_with_mnemonic ("File");
+ gtk_widget_show (menuitem1);
+ gtk_container_add (GTK_CONTAINER (_menubar), menuitem1);
+
+ menu1 = gtk_menu_new ();
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem1), menu1);
+
+ obre1 = gtk_image_menu_item_new_from_stock ("gtk-open", NULL);
+ gtk_widget_show (obre1);
+ gtk_container_add (GTK_CONTAINER (menu1), obre1);
+
+ desa1 = gtk_image_menu_item_new_from_stock ("gtk-save", NULL);
+ gtk_widget_show (desa1);
+ gtk_container_add (GTK_CONTAINER (menu1), desa1);
+ gtk_widget_set_sensitive(desa1,FALSE); // Disabled untill save functionality
is implemented.
+
+ anomena_i_desa1 = gtk_image_menu_item_new_from_stock ("gtk-save-as", NULL);
+ gtk_widget_show (anomena_i_desa1);
+ gtk_container_add (GTK_CONTAINER (menu1), anomena_i_desa1);
+ gtk_widget_set_sensitive(anomena_i_desa1,FALSE); // Disabled untill save-as
functionality is implemented.
+
+ separatormenuitem1 = gtk_separator_menu_item_new ();
+ gtk_widget_show (separatormenuitem1);
+ gtk_container_add (GTK_CONTAINER (menu1), separatormenuitem1);
+ gtk_widget_set_sensitive (separatormenuitem1, FALSE);
+
+ surt1 = gtk_image_menu_item_new_from_stock ("gtk-quit", NULL);
+ gtk_widget_show (surt1);
+ gtk_container_add (GTK_CONTAINER (menu1), surt1);
+
+ menuitem2 = gtk_menu_item_new_with_label ("Edit");
+ gtk_widget_show (menuitem2);
+ gtk_container_add (GTK_CONTAINER (_menubar), menuitem2);
+
+ menu2 = gtk_menu_new ();
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem2), menu2);
+
+/* Commented out untill "cut", "copy" and "paste" are implemented in gnash
+ retalla1 = gtk_image_menu_item_new_from_stock ("gtk-cut", NULL);
+ gtk_widget_show (retalla1);
+ gtk_container_add (GTK_CONTAINER (menu2), retalla1);
+
+ copia1 = gtk_image_menu_item_new_from_stock ("gtk-copy", NULL);
+ gtk_widget_show (copia1);
+ gtk_container_add (GTK_CONTAINER (menu2), copia1);
+
+ enganxa1 = gtk_image_menu_item_new_from_stock ("gtk-paste", NULL);
+ gtk_widget_show (enganxa1);
+ gtk_container_add (GTK_CONTAINER (menu2), enganxa1);
+
+ suprimeix1 = gtk_image_menu_item_new_from_stock ("gtk-delete", NULL);
+ gtk_widget_show (suprimeix1);
+ gtk_container_add (GTK_CONTAINER (menu2), suprimeix1);
+*/
+ preferences1 = gtk_menu_item_new_with_label ("Preferences");
+ gtk_widget_show (preferences1);
+ gtk_container_add (GTK_CONTAINER (menu2), preferences1);
+
+ menuitem4 = gtk_menu_item_new_with_label ("Help");
+ gtk_widget_show (menuitem4);
+ gtk_container_add (GTK_CONTAINER (_menubar), menuitem4);
+
+ menu4 = gtk_menu_new ();
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menu4);
+
+ quant_a1 = gtk_menu_item_new_with_label ("About");
+ gtk_widget_show (quant_a1);
+ gtk_container_add (GTK_CONTAINER (menu4), quant_a1);
+
+/* g_signal_connect ((gpointer) nou1, "activate",
+ G_CALLBACK (on_nou2_activate),
+ NULL); */
+ g_signal_connect ((gpointer) obre1, "activate",
+ G_CALLBACK (&menuitem_openfile_callback),
+ this);
+ /* g_signal_connect ((gpointer) desa1, "activate",
+ G_CALLBACK (on_desa1_activate),
+ NULL);
+ g_signal_connect ((gpointer) anomena_i_desa1, "activate",
+ G_CALLBACK (on_anomena_i_desa1_activate),
+ NULL); */
+ g_signal_connect ((gpointer) surt1, "activate",
+ G_CALLBACK (&menuitem_quit_callback),
+ this);
+ /* g_signal_connect ((gpointer) retalla1, "activate",
+ G_CALLBACK (on_retalla1_activate),
+ NULL);
+ g_signal_connect ((gpointer) copia1, "activate",
+ G_CALLBACK (on_copia1_activate),
+ NULL);
+ g_signal_connect ((gpointer) enganxa1, "activate",
+ G_CALLBACK (on_enganxa2_activate),
+ NULL);
+ g_signal_connect ((gpointer) suprimeix1, "activate",
+ G_CALLBACK (on_suprimeix1_activate),
+ NULL); */
+ g_signal_connect ((gpointer) preferences1, "activate",
+ G_CALLBACK (&menuitem_preferences_callback),
+ this);
+ g_signal_connect ((gpointer) quant_a1, "activate",
+ G_CALLBACK (&menuitem_about_callback),
+ this);
+
+ return true;
+
+}
+
bool
-GtkGui::createMenu()
+GtkGui::createMenu( )
{
GNASH_REPORT_FUNCTION;
_popup_menu = GTK_MENU(gtk_menu_new());
+ GtkMenuItem *menuitem_openfile =
+ GTK_MENU_ITEM(gtk_menu_item_new_with_label("Open file"));
+ gtk_menu_append(_popup_menu, GTK_WIDGET(menuitem_openfile));
+ gtk_widget_show(GTK_WIDGET(menuitem_openfile));
GtkMenuItem *menuitem_play =
GTK_MENU_ITEM(gtk_menu_item_new_with_label("Play Movie"));
gtk_menu_append(_popup_menu, GTK_WIDGET(menuitem_play));
@@ -327,6 +477,14 @@ GtkGui::createMenu()
GTK_MENU_ITEM(gtk_menu_item_new_with_label("Quit Gnash"));
gtk_menu_append(_popup_menu, GTK_WIDGET(menuitem_quit));
gtk_widget_show(GTK_WIDGET(menuitem_quit));
+
+ GtkMenuItem *menuitem_about =
+ GTK_MENU_ITEM(gtk_menu_item_new_with_label("About Gnash"));
+ gtk_menu_append(_popup_menu, GTK_WIDGET(menuitem_about));
+ gtk_widget_show(GTK_WIDGET(menuitem_about));
+
+ g_signal_connect(GTK_OBJECT(menuitem_openfile), "activate",
+ G_CALLBACK(&menuitem_openfile_callback), this);
g_signal_connect(GTK_OBJECT(menuitem_play), "activate",
G_CALLBACK(&menuitem_play_callback), this);
g_signal_connect(GTK_OBJECT(menuitem_pause), "activate",
@@ -345,6 +503,8 @@ GtkGui::createMenu()
G_CALLBACK(&menuitem_jump_backward_callback), this);
g_signal_connect(GTK_OBJECT(menuitem_quit), "activate",
G_CALLBACK(&menuitem_quit_callback), this);
+ g_signal_connect(GTK_OBJECT(menuitem_about), "activate",
+ G_CALLBACK(&menuitem_about_callback), this);
if (get_sound_handler()) {
g_signal_connect(GTK_OBJECT(menuitem_sound), "activate",
G_CALLBACK(&menuitem_sound_callback), this);
@@ -478,6 +638,35 @@ GtkGui::menuitem_restart_callback(GtkMen
/// \brief quit complete, and close the application
void
+GtkGui::menuitem_openfile_callback(GtkMenuItem* /*menuitem*/, gpointer
/*data*/)
+{
+GtkWidget *dialog;
+
+ dbglogfile << "Executant fileselectiondialog! " << endl;
+dialog = gtk_file_chooser_dialog_new ("Open File",
+ NULL,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL);
+
+if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+ {
+ char *filename;
+
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+ dbglogfile << "File to open: " << filename << endl;
+ //Player.run(filename);
+ g_free (filename);
+ }
+
+gtk_widget_destroy (dialog);
+
+// return filechooserdialog1;
+}
+
+/// \brief quit complete, and close the application
+void
GtkGui::menuitem_quit_callback(GtkMenuItem* /*menuitem*/, gpointer /*data*/)
{
// GNASH_REPORT_FUNCTION;
@@ -485,6 +674,397 @@ GtkGui::menuitem_quit_callback(GtkMenuIt
gtk_main_quit();
}
+/// \brief Show gnash preferences window
+void
+GtkGui::menuitem_preferences_callback(GtkMenuItem* /*menuitem*/, gpointer
/*data*/)
+{
+// GNASH_REPORT_FUNCTION;
+
+ GtkWidget *window1;
+ GtkWidget *notebook1;
+ GtkWidget *frame1;
+ GtkWidget *alignment1;
+ GtkWidget *table1;
+ GtkWidget *label5;
+ GtkWidget *hscale1;
+ GtkWidget *label6;
+ GtkWidget *checkbutton1;
+ GtkWidget *label7;
+ GtkWidget *logfilenameentry;
+ GtkWidget *label8;
+ GtkWidget *parseroutputcheckbutton2;
+ GtkWidget *label9;
+ GtkWidget *debugActionScriptcheckbutton3;
+ GtkWidget *label10;
+ GtkWidget *debuggercheckbutton4;
+ GtkWidget *label4;
+ GtkWidget *label1;
+ GtkWidget *frame2;
+ GtkWidget *alignment2;
+ GtkWidget *table4;
+ GtkWidget *label13;
+ GtkWidget *label15;
+ GtkWidget *label16;
+ GtkWidget *whitelistcomboboxentry1;
+ GtkWidget *blacklistcomboboxentry2;
+ GtkWidget *localhostcheckbutton8;
+ GtkWidget *localdomaincheckbutton9;
+ GtkWidget *label11;
+ GtkWidget *label2;
+ GtkWidget *frame3;
+ GtkWidget *alignment3;
+ GtkWidget *table5;
+ GtkWidget *label17;
+ GtkWidget *checkbutton7;
+ GtkWidget *label12;
+ GtkWidget *label3;
+
+ RcInitFile& rcfile = RcInitFile::getDefaultInstance();
+
+ window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title (GTK_WINDOW (window1), "Gnash preferences");
+
+ notebook1 = gtk_notebook_new ();
+ gtk_widget_show (notebook1);
+ gtk_container_add (GTK_CONTAINER (window1), notebook1);
+
+ frame1 = gtk_frame_new (NULL);
+ gtk_widget_show (frame1);
+ gtk_container_add (GTK_CONTAINER (notebook1), frame1);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);
+
+ alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_show (alignment1);
+ gtk_container_add (GTK_CONTAINER (frame1), alignment1);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0);
+
+ table1 = gtk_table_new (6, 2, FALSE);
+ gtk_widget_show (table1);
+ gtk_container_add (GTK_CONTAINER (alignment1), table1);
+
+ label5 = gtk_label_new ("Verbosity");
+ gtk_widget_show (label5);
+ gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
+
+ hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new
(rcfile.verbosityLevel(), 0, 10, 1, 0, 0)));
+ gtk_widget_show (hscale1);
+ gtk_table_attach (GTK_TABLE (table1), hscale1, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+ gtk_scale_set_digits (GTK_SCALE (hscale1), 0);
+ gtk_range_set_update_policy (GTK_RANGE (hscale1), GTK_UPDATE_DISCONTINUOUS);
+
+ label6 = gtk_label_new ("Log to file");
+ gtk_widget_show (label6);
+ gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
+
+ checkbutton1 = gtk_check_button_new_with_mnemonic ("");
+ gtk_widget_show (checkbutton1);
+ gtk_table_attach (GTK_TABLE (table1), checkbutton1, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ if ( rcfile.useWriteLog() == true )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton1), TRUE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton1), FALSE);
+
+ label7 = gtk_label_new ("Log File name");
+ gtk_widget_show (label7);
+ gtk_table_attach (GTK_TABLE (table1), label7, 0, 1, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
+
+ logfilenameentry = gtk_entry_new ();
+ gtk_widget_show (logfilenameentry);
+ gtk_table_attach (GTK_TABLE (table1), logfilenameentry, 1, 2, 2, 3,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ if (rcfile.useWriteLog() == true ) {
+ dbglogfile << "Debug log filename: " << rcfile.getDebugLog().c_str() <<
endl;
+ gtk_entry_set_text( (GtkEntry*) logfilenameentry,
rcfile.getDebugLog().c_str());
+ gtk_widget_set_sensitive(logfilenameentry,TRUE);
+ } else {
+ gtk_widget_set_sensitive(logfilenameentry,FALSE);
+ }
+
+ label8 = gtk_label_new ("Parser output");
+ gtk_widget_show (label8);
+ gtk_table_attach (GTK_TABLE (table1), label8, 0, 1, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);
+
+ parseroutputcheckbutton2 = gtk_check_button_new_with_mnemonic ("");
+ gtk_widget_show (parseroutputcheckbutton2);
+ gtk_table_attach (GTK_TABLE (table1), parseroutputcheckbutton2, 1, 2, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ if ( rcfile.useParserDump() == true )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(parseroutputcheckbutton2), TRUE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(parseroutputcheckbutton2), FALSE);
+
+ label9 = gtk_label_new ("Debug ActionScript");
+ gtk_widget_show (label9);
+ gtk_table_attach (GTK_TABLE (table1), label9, 0, 1, 4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);
+
+ debugActionScriptcheckbutton3 = gtk_check_button_new_with_mnemonic ("");
+ gtk_widget_show (debugActionScriptcheckbutton3);
+ gtk_table_attach (GTK_TABLE (table1), debugActionScriptcheckbutton3, 1, 2,
4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ if ( rcfile.useActionDump() == true )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(debugActionScriptcheckbutton3), TRUE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(debugActionScriptcheckbutton3), FALSE);
+
+ label10 = gtk_label_new ("Debugger");
+ gtk_widget_show (label10);
+ gtk_table_attach (GTK_TABLE (table1), label10, 0, 1, 5, 6,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);
+
+ debuggercheckbutton4 = gtk_check_button_new_with_mnemonic ("");
+ gtk_widget_show (debuggercheckbutton4);
+ gtk_table_attach (GTK_TABLE (table1), debuggercheckbutton4, 1, 2, 5, 6,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ if ( rcfile.useDebugger() == true )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (debuggercheckbutton4),
TRUE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (debuggercheckbutton4),
FALSE);
+
+ label4 = gtk_label_new ("<b>Logging preferences</b>");
+ gtk_widget_show (label4);
+ gtk_frame_set_label_widget (GTK_FRAME (frame1), label4);
+ gtk_label_set_use_markup (GTK_LABEL (label4), TRUE);
+
+ label1 = gtk_label_new ("Logging");
+ gtk_widget_show (label1);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1),
gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);
+
+ frame2 = gtk_frame_new (NULL);
+ gtk_widget_show (frame2);
+ gtk_container_add (GTK_CONTAINER (notebook1), frame2);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);
+
+ alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_show (alignment2);
+ gtk_container_add (GTK_CONTAINER (frame2), alignment2);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0);
+
+ table4 = gtk_table_new (4, 2, FALSE);
+ gtk_widget_show (table4);
+ gtk_container_add (GTK_CONTAINER (alignment2), table4);
+
+ label13 = gtk_label_new ("Allow remote acces from: ");
+ gtk_widget_show (label13);
+ gtk_table_attach (GTK_TABLE (table4), label13, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);
+
+ label15 = gtk_label_new ("Whitelist");
+ gtk_widget_show (label15);
+ gtk_table_attach (GTK_TABLE (table4), label15, 0, 1, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);
+
+ label16 = gtk_label_new ("Blacklist");
+ gtk_widget_show (label16);
+ gtk_table_attach (GTK_TABLE (table4), label16, 0, 1, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label16), 0, 0.5);
+
+ whitelistcomboboxentry1 = gtk_combo_box_entry_new_text ();
+ gtk_widget_show (whitelistcomboboxentry1);
+ gtk_table_attach (GTK_TABLE (table4), whitelistcomboboxentry1, 1, 2, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+
+ blacklistcomboboxentry2 = gtk_combo_box_entry_new_text ();
+ gtk_widget_show (blacklistcomboboxentry2);
+ gtk_table_attach (GTK_TABLE (table4), blacklistcomboboxentry2, 1, 2, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+
+ localhostcheckbutton8 = gtk_check_button_new_with_mnemonic ("local host
only");
+ gtk_widget_show (localhostcheckbutton8);
+ gtk_table_attach (GTK_TABLE (table4), localhostcheckbutton8, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ if ( rcfile.useLocalHost() == true )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(localhostcheckbutton8), TRUE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(localhostcheckbutton8), FALSE);
+
+ localdomaincheckbutton9 = gtk_check_button_new_with_mnemonic ("local domain
only");
+ gtk_widget_show (localdomaincheckbutton9);
+ gtk_table_attach (GTK_TABLE (table4), localdomaincheckbutton9, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ if ( rcfile.useLocalDomain() == true )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(localdomaincheckbutton9), TRUE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(localdomaincheckbutton9), FALSE);
+
+ label11 = gtk_label_new ("<b>Security preferences</b>");
+ gtk_widget_show (label11);
+ gtk_frame_set_label_widget (GTK_FRAME (frame2), label11);
+ gtk_label_set_use_markup (GTK_LABEL (label11), TRUE);
+
+ label2 = gtk_label_new ("Security");
+ gtk_widget_show (label2);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1),
gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);
+
+ frame3 = gtk_frame_new (NULL);
+ gtk_widget_show (frame3);
+ gtk_container_add (GTK_CONTAINER (notebook1), frame3);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_NONE);
+
+ alignment3 = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_show (alignment3);
+ gtk_container_add (GTK_CONTAINER (frame3), alignment3);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment3), 0, 0, 12, 0);
+
+ table5 = gtk_table_new (3, 2, FALSE);
+ gtk_widget_show (table5);
+ gtk_container_add (GTK_CONTAINER (alignment3), table5);
+
+ label17 = gtk_label_new ("Enable sound");
+ gtk_widget_show (label17);
+ gtk_table_attach (GTK_TABLE (table5), label17, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5);
+
+ checkbutton7 = gtk_check_button_new_with_mnemonic ("");
+ gtk_widget_show (checkbutton7);
+ gtk_table_attach (GTK_TABLE (table5), checkbutton7, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ if ( rcfile.useSound() == true )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton7), TRUE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton7), FALSE);
+
+ label12 = gtk_label_new ("<b>Sound preferences</b>");
+ gtk_widget_show (label12);
+ gtk_frame_set_label_widget (GTK_FRAME (frame3), label12);
+ gtk_label_set_use_markup (GTK_LABEL (label12), TRUE);
+
+ label3 = gtk_label_new ("Sound");
+ gtk_widget_show (label3);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1),
gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label3);
+
+ /*g_signal_connect ((gpointer) window1, "show",
+ G_CALLBACK (on_window1_show),
+ NULL);
+ g_signal_connect ((gpointer) hscale1, "value_changed",
+ G_CALLBACK (on_hscale1_value_changed),
+ NULL);
+ g_signal_connect ((gpointer) checkbutton1, "toggled",
+ G_CALLBACK (on_checkbutton1_toggled),
+ NULL);
+ g_signal_connect ((gpointer) logfilenameentry, "changed",
+ G_CALLBACK (on_logfilenameentry_changed),
+ NULL);
+ g_signal_connect ((gpointer) parseroutputcheckbutton2, "toggled",
+ G_CALLBACK (on_parseroutputcheckbutton2_toggled),
+ NULL);
+ g_signal_connect ((gpointer) debugActionScriptcheckbutton3, "toggled",
+ G_CALLBACK (on_debugActionScriptcheckbutton3_toggled),
+ NULL);
+ g_signal_connect ((gpointer) debuggercheckbutton4, "toggled",
+ G_CALLBACK (on_debuggercheckbutton4_toggled),
+ NULL);
+ g_signal_connect ((gpointer) whitelistcomboboxentry1, "add",
+ G_CALLBACK (on_whitelistcomboboxentry1_add),
+ NULL);
+ g_signal_connect ((gpointer) whitelistcomboboxentry1, "remove",
+ G_CALLBACK (on_whitelistcomboboxentry1_remove),
+ NULL);
+ g_signal_connect ((gpointer) blacklistcomboboxentry2, "add",
+ G_CALLBACK (on_blacklistcomboboxentry2_add),
+ NULL);
+ g_signal_connect ((gpointer) blacklistcomboboxentry2, "remove",
+ G_CALLBACK (on_blacklistcomboboxentry2_remove),
+ NULL);
+ g_signal_connect ((gpointer) localhostcheckbutton8, "toggled",
+ G_CALLBACK (on_localhostcheckbutton8_toggled),
+ NULL);
+ g_signal_connect ((gpointer) localdomaincheckbutton9, "toggled",
+ G_CALLBACK (on_localdomaincheckbutton9_toggled),
+ NULL);
+ g_signal_connect ((gpointer) checkbutton7, "toggled",
+ G_CALLBACK (on_checkbutton7_toggled),
+ NULL);
+
+*/
+ gtk_widget_show (window1);
+
+
+}
+
+/// \brief show info about gnash
+void
+GtkGui::menuitem_about_callback(GtkMenuItem* /*menuitem*/, gpointer /*data*/)
+{
+// GNASH_REPORT_FUNCTION;
+const gchar *documentors[] = {
+ "Rob Savoye",
+ "Sandro Santilli",
+ NULL
+ };
+
+const gchar *authors[] = {
+ "Rob Savoye",
+ "Sandro Santilli",
+ "Bastiaan Jacques",
+ "Vitaly Alexeev",
+ "Thomas Groth",
+ "Udo Giacomozzi",
+ "Hannes Mayr",
+ "Marjus Gothe",
+ NULL
+ };
+
+GtkWidget *about = (GtkWidget*) g_object_new (GTK_TYPE_ABOUT_DIALOG,
+ "name", "GNASH flash movie player",
+ "version", VERSION,
+ "copyright", "(C) 2005-2006 The Free Software Foundation",
+ "comments", "Gnash is a GNU Flash movie player. Until now it
has only been possible to play flash movies with proprietary software. While
there are a few other free flash players, none supports anything higher than
SWF v4 at best. Gnash is based on GameSWF, and supports many SWF v7 features.",
+ "authors", authors,
+ "documenters", documentors,
+ "translator-credits", "translator-credits",
+ "logo", NULL,
+ NULL);
+
+ gtk_widget_show (about);
+
+}
+
+
/// \brief Start the movie playing from the current frame.
void
GtkGui::menuitem_play_callback(GtkMenuItem* /*menuitem*/, gpointer /*data*/)
Index: gtksup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gtksup.h,v
retrieving revision 1.30
diff -u -p -u -r1.30 gtksup.h
--- gtksup.h 2 Dec 2006 21:03:50 -0000 1.30
+++ gtksup.h 18 Dec 2006 00:34:10 -0000
@@ -59,6 +59,7 @@ class DSOEXPORT GtkGui : public Gui
virtual bool createWindow(int width, int height);
virtual bool createWindow(const char *title, int width, int height);
virtual bool run();
+ virtual bool createMenuBar();
virtual bool createMenu();
virtual bool setupEvents();
virtual void renderBuffer();
@@ -73,6 +74,8 @@ class DSOEXPORT GtkGui : public Gui
gpointer instance);
static void menuitem_quit_callback(GtkMenuItem *menuitem,
gpointer instance);
+ static void menuitem_about_callback(GtkMenuItem *menuitem,
+ gpointer instance);
static void menuitem_play_callback(GtkMenuItem *menuitem,
gpointer instance);
static void menuitem_pause_callback(GtkMenuItem *menuitem,
@@ -87,7 +90,10 @@ class DSOEXPORT GtkGui : public Gui
gpointer instance);
static void menuitem_jump_backward_callback(GtkMenuItem *menuitem,
gpointer instance);
-
+ static void menuitem_openfile_callback(GtkMenuItem *menuitem,
+ gpointer instance);
+ static void menuitem_preferences_callback(GtkMenuItem *menuitem,
+ gpointer instance);
// GTK Event handlers
static gboolean unrealize_event(GtkWidget *widget, GdkEvent *event,
gpointer data);
@@ -126,6 +132,8 @@ class DSOEXPORT GtkGui : public Gui
GdkPixbuf *_window_icon_pixbuf;
GtkWidget *_drawing_area;
GtkMenu *_popup_menu;
+ GtkWidget *_menubar;
+ GtkWidget *_vbox;
geometry::Range2d<int> _drawbounds;
Index: gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.41
diff -u -p -u -r1.41 gui.h
--- gui.h 6 Dec 2006 11:10:06 -0000 1.41
+++ gui.h 18 Dec 2006 00:34:10 -0000
@@ -98,6 +98,10 @@ public:
/// Start main rendering loop.
virtual bool run() = 0;
+ /// Create a menu bar for the application, attach to our window.
+ // This should only appear in the standalone player.
+ virtual bool createMenuBar() = 0;
+
/// Create a menu and attach it to our window.
virtual bool createMenu() = 0;
@@ -166,6 +170,7 @@ public:
*/
static void menu_restart();
static void menu_quit();
+ static void menu_about();
static void menu_play();
static void menu_pause();
static void menu_stop();