XML serialization for set files, bug fixes and a new full screen mode
authorterminatorX <>
Wed, 20 Nov 2002 23:55:55 +0000 (23:55 +0000)
committerterminatorX <>
Wed, 20 Nov 2002 23:55:55 +0000 (23:55 +0000)
- Alex

ChangeLog
acconfig.h
configure.in
src/tX_audiodevice.cc
src/tX_dialog.cc
src/tX_global.c
src/tX_global.h
src/tX_loaddlg.cc
src/tX_mastergui.cc
src/tX_vtt.cc
src/tX_vttgui.cc

index aea7ce291687d5f84c7820e8fc11dc5612d56f39..6ee2047151d775675f288462ed2777a8877fff93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,12 +3,28 @@ All changes were done by me (Alexander K
 This is not a GNU-style ChangeLog but you sort of get the idea what was
 changed.
 
-[v3.74]
+[v3.74 - prerelase]
+- Fixed a bug in XML serialization that dropped strings' contents.
+- You can now hit "F11" to turn fullscreen mode on off - this will help using
+  terminatorX on small DJ laptops. Note that the key will have no effect in 
+  scratch - hit it before you get that engine running.
+- terminatorX now stores set files as XML documents, too - so terminatorX has
+  become terminatorXML finally. Note: for sets with a large number of events
+  recorded into the sequencer - the XML based set files can grow significally
+  larger than the old ones.
+- The old code to support the obsolete binary tX file formats has now been
+  scheduled for deletion. It's been moved into the tX_legacy* source files and 
+  it will be built only when "--enable-legacy" was used on configuring
+  terminatorX (which is the default). Expect this to become disabled and then
+  totally removed from the sources in future.
 - Enhanced audio data display - you can now zoom into the audio signal, which
   should allow much more precise scratching with larger audio files (ie 
   complete tracks). On playback terminatorX will scroll the displayed area
-  to ensure you always see the area of the sample in which you currently
-  scratch.
+  to ensure you always see the area of the sample in which you're currently
+  scratching on.
+- I have not backported the new code to the old gtk+ 1.2 - so this release no
+  longer builds with gtk+ 1.2 - you have to upgrade to gtk+ Version 2 to be
+  able to build terminatorX.
 - fixed a gcc 3.2 compilation bug - thanks to 
   Adam Duck <duck@informatik.uni-frankfurt.de>
 
index 479dd9aa6e34cabc554ac74355562169243d65b8..47a17962b98a25a98e121a85e28d2d9315ab7a75 100644 (file)
@@ -60,8 +60,5 @@
 /* Don't use movqfix */
 #undef OVERRIDE_MOVQ_AUTODETECT
 
-/* use the newer gtk+ toolkit */
-#undef USE_GTK2
-
 /* Define for supporting old binary tX set files */
 #undef ENABLE_TX_LEGACY
index f73888eaf23f0448164d40a4d5e4e870ca064f2a..128ff45d7a0988d413e0284f5e6b1a78b6bc5cfd 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/tX_global.h)
-AM_INIT_AUTOMAKE(terminatorX, 3.73)
+AM_INIT_AUTOMAKE(terminatorX, 3.74)
 AM_CONFIG_HEADER(config.h)
 
 dnl AC_ARG_ENABLE(closedev, [  --enable-closedev       close audio device if not in use. [default=yes] ])
@@ -17,9 +17,6 @@ AC_ARG_ENABLE(xsetpointer,  [  --enable-xsetpointer    enables executing of xset
 dnl AC_ARG_ENABLE(alsa,         [  --enable-alsa           use ALSA for sound output (default=auto) ])
 AC_ARG_ENABLE(oss,          [  --enable-oss            use OSS for sound output (default=auto) ])
 dnl AC_ARG_ENABLE(movqfix,         [  --disable-movqfix       don't use movq fix for gcc >= 2.96 [default=on] ])
-AC_ARG_ENABLE(gtk2,        [  --disable-gtk2          use gtk+ 1.2 even if verion 2 detected (default=auto) ])
-dnl AC_ARG_ENABLE(dial,         [  --enable-dial           use dials instead of scales for effects (default=yes) ])
-dnl AC_ARG_ENABLE(bigdial,      [  --enable-bigdial        use BIG dials (default=yes) ])
 dnl AC_ARG_ENABLE(dga2,     [  --enable-dga2           use DGA2 instead of DGA1. (experimental) (default=no) ])
 AC_ARG_ENABLE(libxml2,     [  --disable-libxml2       use libxml even if verion 2 detected (default=auto) ])
 AC_ARG_ENABLE(mad,             [  --disable-mad           disable mad for mp3 support (default=auto) ])
@@ -42,7 +39,6 @@ OPTION_OGG123="no"
 OPTION_VORBIS="no"
 OPTION_AUDIOFILE="no"
 OPTION_WAV="no"
-OPTION_GTK_VERSION="none"
 OPTION_GNOME="no"
 OPTION_SCHEDULER="no"
 
@@ -111,36 +107,15 @@ if test "$tX_threads" = "no"; then
        AC_MSG_ERROR([** failed to detect pthreads implementation **])
 fi
 
-gtk2="no"
-gtk12="no"
-
-if test "$enable_gtk2" != "no"; then
-       AM_PATH_GTK_2_0(, [
-         GTK2_CFLAGS="$GTK_CFLAGS"
-         GTK2_LIBS="$GTK_LIBS"
-         gtk2="yes"
-         GTK2_VERSION="`$PKG_CONFIG --modversion gtk+-2.0`"], [ gtk2="no" ]) 
-         OPTION_GTK_VERSION="Version 2 - ($GTK2_VERSION)"
-fi
+AM_PATH_GTK_2_0(, [
+  GTK2_CFLAGS="$GTK_CFLAGS"
+  GTK2_LIBS="$GTK_LIBS"
+  gtk2="yes"
+  GTK2_VERSION="`$PKG_CONFIG --modversion gtk+-2.0`"], [ gtk2="yes" ]) 
+  OPTION_GTK_VERSION="Version 2 - ($GTK2_VERSION)"
 
 if test "$gtk2" = "no"; then
-       AM_PATH_GTK([1.2.5], [
-         GTK12_CFLAGS="$GTK_CFLAGS"
-         GTK12_LIBS="$GTK_LIBS"
-         gtk12="yes"
-         GTK12_VERSION="`$GTK_CONFIG $gtk_config_args --version`"], [ gtk12="no" ])
-         OPTION_GTK_VERSION="Version 1.2 - ($GTK12_VERSION)"     
-fi
-
-if test "$gtk2" = "yes"; then
-       AC_MSG_RESULT([using gtk+ version 2 as widget toolkit.])
-       AC_DEFINE(USE_GTK2)
-else
-       if test "$gtk12" = "yes"; then
-               AC_MSG_RESULT([using gtk+ version 1.2 as widget toolkit.])
-       else
-               AC_MSG_ERROR([** couldn't find gtk+ > Version 1.2.5 **])
-       fi
+       AC_MSG_ERROR([** couldn't find gtk+ > Version 2. Please upgrade (http://www.gtk.org). **])
 fi
 
 dnl Checks for header files.
@@ -519,7 +494,6 @@ option_info;
 
 echo "builtin-wav support: $OPTION_WAV"
 echo "enhanced scheduling support: $OPTION_SCHEDULER"
-echo "gtk+ Version: $OPTION_GTK_VERSION"
 echo "GNOME support: $OPTION_GNOME"
 echo
 echo You can now run \'make\' to compile terminatorX
index 8e6bc17ced657f52072cb9976f8077dcee492886..5f305d000f117295a0a4afb75d27b68e4c23fdff 100644 (file)
 
 #include "tX_endian.h"
 
-#define __USE_XOPEN // we need this for swab()
-#include <unistd.h>
-#undef __USE_XOPEN
+#ifndef __USE_XOPEN
+#      define __USE_XOPEN // we need this for swab()
+#      include <unistd.h>
+#      undef __USE_XOPEN
+#else
+#      include <unistd.h>
+#endif
 
 void tX_audiodevice :: init()
 {
index 30ef2234319153a225afb5c6baa68f9dcb29ba27..1653e01bfeb1c9b35e398aa8bebc707d60da37b2 100644 (file)
@@ -100,11 +100,7 @@ void apply_options() {
                
        globals.sense_cycles=(int) sense_cycles->value;
        globals.xinput_enable=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(xinput_enable));
-#ifdef         USE_GTK2
        text=(char *) gtk_button_get_label(GTK_BUTTON(xinput_device));
-#else  
-       gtk_label_get(GTK_LABEL(GTK_BUTTON(xinput_device)->child), &text);
-#endif 
        strcpy(globals.xinput_device, text);    
        
        globals.mouse_speed=mouse_speed->value;
@@ -208,11 +204,7 @@ void  use_stdout_changed(GtkWidget *widget)
 }
 void select_input(GtkWidget *w, char *dev)
 {
-#ifdef         USE_GTK2
        gtk_button_set_label(GTK_BUTTON(xinput_device), dev);
-#else          
-       gtk_label_set(GTK_LABEL(GTK_BUTTON(xinput_device)->child), dev);
-#endif 
 }
 
 void create_options()
@@ -577,17 +569,10 @@ void show_about(int nag)
        if (nag) {
                GtkWidget *box=gtk_vbox_new(FALSE, 2);
                GtkWidget *box2=gtk_hbox_new(FALSE, 2);
-//             GtkWidget *seph=gtk_hseparator_new();
                GtkWidget *label;
-#ifndef USE_GTK2               
-               char about_prefix_umlaut[]="Copyright (C) 1999-2002 by Alexander König";
-               char about_prefix_broken_umlaut[]="Copyright (C) 1999-2002 by Alexander Ko\"nig";
-               char *str;
-#endif         
                
                gtk_container_add(GTK_CONTAINER(window), box);
                gtk_box_pack_start(GTK_BOX(box), pwid, WID_FIX);
-//             gtk_box_pack_start(GTK_BOX(box), seph, WID_FIX);
                gtk_box_pack_start(GTK_BOX(box), box2, WID_FIX);
                
                label=gtk_label_new(PACKAGE" release "VERSION);
@@ -595,20 +580,11 @@ void show_about(int nag)
                gtk_misc_set_alignment(GTK_MISC(label), 0.1, 0.5);
                gtk_widget_show(label);
 
-#ifdef USE_GTK2
                label=gtk_label_new("Copyright (C) 1999-2002 by Alexander K\xC3\xB6nig");
-#else
-               label=gtk_label_new(about_prefix_umlaut);
-               gtk_label_get(GTK_LABEL(label), &str);
-               if (strlen(str)==0) {
-                       gtk_label_set(GTK_LABEL(label), about_prefix_broken_umlaut);\r
-               }
-#endif         
                gtk_box_pack_start(GTK_BOX(box2), label, WID_DYN);
                gtk_misc_set_alignment(GTK_MISC(label), 0.9, 0.5);
                gtk_widget_show(label);
                
-//             gtk_widget_show(seph);
                gtk_widget_show(box2);
                gtk_widget_show(box);
                gtk_widget_show(window);
@@ -622,12 +598,7 @@ void show_about(int nag)
                
                sep=gtk_hseparator_new();
                add_about_wid_fix(sep);
-#ifdef USE_GTK2
                char about_prefix_umlaut[]="\nThis is "PACKAGE" Release "VERSION" - Copyright (C) 1999-2002 by Alexander K\xC3\xB6nig";
-#else
-               char about_prefix_umlaut[]="\nThis is "PACKAGE" Release "VERSION" - Copyright (C) 1999-2002 by Alexander König";
-               char about_prefix_broken_umlaut[]="\nThis is "PACKAGE" Release "VERSION" - Copyright (C) 1999-2002 by Alexander Ko\"nig";
-#endif         
                char about_rest[]="\n\nSend comments, patches and scratches to: alex@lisas.de\n"
                "terminatorX-homepage: http://www.terminatorX.cx\n\nThis binary has been compiled with the following flags: "
                "Sox support: "
@@ -678,34 +649,18 @@ void show_about(int nag)
                
                label=gtk_label_new(buffer);
 
-#ifndef USE_GTK2
-               char *str;
-               gtk_label_get(GTK_LABEL(label), &str);
-               
-               /* Fixing a strange gtk+ bug that appears at least on my system.
-               */
-               if (strlen(str)==0) 
-               {
-                       tX_warning( "This gtk+ has broken umlauts.");
-                       strcpy(buffer, about_prefix_broken_umlaut);
-                       strcat(buffer, about_rest);
-                       gtk_label_set(GTK_LABEL(label), buffer);                
-               }
-#endif
-               
-               gtk_misc_set_alignment (GTK_MISC(label), 0.5 ,0.5);
+               gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
                add_about_wid_fix(label);
                
                sep=gtk_hseparator_new();
                add_about_wid_fix(sep);
 
                label=gtk_label_new("License (GPL V2):");
-               gtk_misc_set_alignment (GTK_MISC(label), 0.5 ,0.5);
+               gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
                add_about_wid_fix(label);
 
                hbox=gtk_hbox_new(FALSE, 5);            
 
-#ifdef USE_GTK2
                GtkTextIter iter;
                GtkTextBuffer *tbuffer;
 
@@ -728,19 +683,6 @@ void show_about(int nag)
                
                gtk_box_pack_start(GTK_BOX(hbox), scroll, WID_DYN);
                gtk_widget_show(scroll);                
-#else
-               text=gtk_text_new(NULL,NULL);
-               scroll=gtk_vscrollbar_new(GTK_TEXT(text)->vadj);
-               gtk_text_set_editable(GTK_TEXT(text),0);
-               gtk_text_set_word_wrap( GTK_TEXT(text), 0);
-               gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL, license, strlen(license));
-
-               gtk_box_pack_start(GTK_BOX(hbox), text, WID_DYN);
-               gtk_widget_show(text);
-               
-               gtk_box_pack_start(GTK_BOX(hbox), scroll, WID_FIX);
-               gtk_widget_show(scroll);
-#endif         
                
                add_about_wid(hbox);
 
index 2e69bab9b8ee2e0e338320d43c70c4d89758a10b..804edcabc4ec828b65cbd76e9cbe07df65038d63 100644 (file)
@@ -194,6 +194,7 @@ int load_globals_xml() {
                }
        }
 
+       puts(globals.audio_device);
        xmlFreeDoc(doc);
        
        return 0;
@@ -203,6 +204,7 @@ void store_globals() {
        char rc_name[PATH_MAX]="";
        char indent[]="\t";
        FILE *rc;
+       char tmp_xml_buffer[4096];
        
        get_rc_name(rc_name);
 
@@ -258,3 +260,26 @@ void load_globals() {
 #endif         
        }
 }
+
+char *encode_xml(char *dest, const char *src) {
+       int i, t, max;
+       
+       dest[0]=0;
+       t=0;
+       max=strlen(src);
+       
+       for (i=0; i<max; i++) {
+               switch (src[i]) {
+                       case '<': dest[t]=0; strcat(dest, "&lt;"); t+=4; break;
+                       case '>': dest[t]=0; strcat(dest, "&gt;"); t+=4; break;
+                       case '&': dest[t]=0; strcat(dest, "&amp;"); t+=5; break;
+                       case '"': dest[t]=0; strcat(dest, "&quot;"); t+=6; break;
+                       case '\'': strcat(dest, "&apos;"); t+=7; break;
+                       default: dest[t]=src[i]; t++;
+               }
+       }
+       dest[t]=0;
+       
+       tX_debug("encode_xml: from \"%s\" to \"%s\".", src, dest); 
+       return dest;
+}
index b43446e1d7e040347d94fadb3c0918e3f0eaba3d..8c76fb2115a74144dd32f228b7c5fab302024856 100644 (file)
@@ -136,6 +136,7 @@ extern tx_global globals;
 
 extern void load_globals();
 extern void store_globals();
+extern char *encode_xml(char *dest, const char *src);
 
 #define nop
 
@@ -157,7 +158,7 @@ extern void store_globals();
 
 #define store_int(s, i); fprintf(rc, "%s<%s>%i</%s>\n", indent, s,(int) i, s);
 #define store_float(s, i); fprintf(rc, "%s<%s>%lf</%s>\n", indent, s,(double) i, s);
-#define store_string(s, i); fprintf(rc, "%s<%s>%s</%s>\n", indent, s, i, s);
+#define store_string(s, i); fprintf(rc, "%s<%s>%s</%s>\n", indent, s, encode_xml(tmp_xml_buffer, i) , s);
 #define store_bool(s, i); fprintf(rc, "%s<%s>%s</%s>\n", indent, s, i ? "true" : "false", s);
 
 #define store_id(s, id); fprintf(rc, "%s<%s id=\"%i\"/>\n", indent, s, id);
index 0439edf138759f0f90d78408399b4563c2c7d2f7..daecee9dc63adff490b29b3e20c77143f43a84dd 100644 (file)
@@ -64,16 +64,9 @@ int ld_create_loaddlg(int mode, int count)
        ld_mode=mode;
        ld_count=count;
 
-#ifdef USE_GTK2
        ld_loaddlg=gtk_dialog_new_with_buttons("terminatorX - loading",
                GTK_WINDOW(main_window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_NONE, NULL);
-#else  
-       ld_loaddlg=gtk_dialog_new();    
-#endif 
        ld_window=&(GTK_DIALOG(ld_loaddlg)->window);
-#ifndef        USE_GTK2
-       gtk_window_set_title(ld_window, "terminatorX - loading");       
-#endif 
        gtk_container_set_border_width(GTK_CONTAINER(ld_window), 5);
        
        vbox=GTK_WIDGET(GTK_DIALOG(ld_loaddlg)->vbox);
@@ -103,16 +96,8 @@ int ld_create_loaddlg(int mode, int count)
        ld_single_p=gtk_progress_bar_new();
        add_widget_fix(ld_single_p);
 
-#ifndef USE_GTK2       
-       dummy=gtk_button_new_with_label("Cancel");
-       gtk_box_pack_start(GTK_BOX(actionarea), dummy, WID_DYN);
-       gtk_widget_show(dummy);
-#endif 
        gtk_window_set_modal(ld_window, TRUE);
        gtk_window_set_default_size(ld_window, 400, 100);
-#ifndef USE_GTK2
-       gtk_window_set_position(ld_window, GTK_WIN_POS_CENTER_ALWAYS);
-#endif 
        gtk_widget_realize(ld_loaddlg);
        gdk_window_set_decorations(gtk_widget_get_parent_window(vbox),(GdkWMDecoration) 0);
        gtk_widget_show(ld_loaddlg);
index 33aa7b0b67c0aa99864f33d9d977f830558719c3..11bd9a6998282530a8ab9eb58c9da0cadc37a0f8 100644 (file)
@@ -65,6 +65,7 @@ GtkWidget *grab_button;
 GtkWidget *main_flash_l;
 GtkWidget *main_flash_r;
 GtkWidget *rec_btn;
+GtkWidget *fullscreen_button;
 
 GtkWidget *seq_rec_btn;
 GtkWidget *seq_play_btn;
@@ -92,6 +93,8 @@ GtkWidget *SaveSet;
 
 GtkWidget *engine_btn;
 
+bool tX_fullscreen_status=false;
+
 int rec_dont_care=0;
 gint update_tag;
 
@@ -1022,6 +1025,9 @@ void create_mastergui(int x, int y)
        gtk_widget_show(dummy);
        gui_set_tooltip(dummy, "Click here to exit terminatorX.");
        gtk_signal_connect (GTK_OBJECT(dummy), "clicked", (GtkSignalFunc) quit, NULL);
+
+       fullscreen_button=gtk_button_new_with_label("Fullscreen");
+       gtk_box_pack_start(GTK_BOX(right_hbox), fullscreen_button, WID_FIX);
        
        add_sep();              
 
@@ -1143,60 +1149,17 @@ void tx_note(const char *message, bool isError)
                strcat(buffer, "error:\n\n");
        }
        
-#ifdef USE_GTK2
        strcat(buffer, message);
        GtkWidget *dialog=gtk_message_dialog_new(GTK_WINDOW(main_window),
                GTK_DIALOG_DESTROY_WITH_PARENT,
                isError ? GTK_MESSAGE_ERROR : GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, message);
        gtk_dialog_run(GTK_DIALOG(dialog));
        gtk_widget_destroy(dialog);     
-#else  
-       
-       GtkWidget *mbox;
-       GtkWidget *label;
-       GtkWidget *btn;
-       GtkWidget *sp;
-       GtkWindow *win;
-       
-       mbox=gtk_dialog_new();
-       win=&(GTK_DIALOG(mbox)->window);
-
-       gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(mbox)->vbox), 4);
-       gtk_container_set_border_width(GTK_CONTAINER(mbox), 10);
-       
-       label=gtk_label_new("terminatorX note");
-       gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mbox)->vbox), label, TRUE, TRUE, 0);
-       gtk_widget_show(label);
-
-       sp=gtk_hseparator_new();
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mbox)->vbox), sp, TRUE, TRUE, 0);
-       gtk_widget_show(sp);
-
-       label=gtk_label_new(message);
-       gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mbox)->vbox), label, TRUE, TRUE, 0);
-       gtk_widget_show(label); 
-
-       btn = gtk_button_new_with_label("Ok");
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mbox)->action_area), btn, TRUE, TRUE, 0);
-
-       gtk_signal_connect(GTK_OBJECT(btn), "clicked", GtkSignalFunc(note_destroy), mbox);
-
-       gtk_window_set_default_size(win, 200, 100);
-       gtk_window_set_position(win, GTK_WIN_POS_CENTER_ALWAYS);        
-
-       GTK_WIDGET_SET_FLAGS (btn, GTK_CAN_DEFAULT);
-       gtk_widget_grab_default(btn);
-       gtk_widget_show(btn);
-       gtk_widget_show(mbox);
-#endif 
 }
 
 
 void tx_l_note(const char *message)
 {
-#ifdef USE_GTK2
        char buffer[4096]="Plugin info:\n\n";
        strcat(buffer, message);
        
@@ -1204,46 +1167,8 @@ void tx_l_note(const char *message)
                GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, message);
        gtk_dialog_run(GTK_DIALOG(dialog));
        gtk_widget_destroy(dialog);     
-#else          
-       char buffer[4096]="\n   Plugin Info:  \n   ------------  \n\n";
-       
-       GtkWidget *mbox;
-       GtkWidget *label;
-       GtkWidget *btn;
-       GtkWindow *win;
-       
-       mbox=gtk_dialog_new();
-       win=&(GTK_DIALOG(mbox)->window);
-       strcat(buffer, message);
-       strcat(buffer, "\n");
-       label=gtk_label_new(buffer);
-       gtk_label_set_justify (GTK_LABEL(label),  GTK_JUSTIFY_LEFT);
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mbox)->vbox), label, TRUE, TRUE, 0);
-       gtk_widget_show(label);
-
-       btn = gtk_button_new_with_label("Ok");
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(mbox)->action_area), btn, TRUE, TRUE, 0);
-       gtk_widget_show(btn);
-       
-       gtk_signal_connect(GTK_OBJECT(btn), "clicked", GtkSignalFunc(note_destroy), mbox);
-
-       gtk_window_set_default_size(win, 200, 100);
-       gtk_window_set_position(win, GTK_WIN_POS_CENTER_ALWAYS);        
-       gtk_widget_show(mbox);
-#endif 
 }
 
-void display_mastergui()
-{
-       GtkWidget *top;
-       gtk_widget_realize(main_window);
-       tX_set_icon(main_window, "terminatorX");
-       load_knob_pixs(main_window);
-
-       gtk_widget_show(main_window);
-       top=gtk_widget_get_toplevel(main_window);
-       xwindow=GDK_WINDOW_XWINDOW(top->window);
-}
 
 void add_to_panel_bar(GtkWidget *button) {
        buttons_on_panel_bar++;
@@ -1256,3 +1181,67 @@ void remove_from_panel_bar(GtkWidget *button) {
        gtk_container_remove(GTK_CONTAINER(panel_bar), button);
        if (buttons_on_panel_bar==0) gtk_widget_hide(panel_bar);
 }
+
+/* Fullscreen code... */
+#define _WIN_LAYER_TOP                 -1
+#define _WIN_LAYER_NORMAL      4
+#define _NET_WM_STATE_REMOVE   0
+#define _NET_WM_STATE_ADD      1
+#define _NET_WM_STATE_TOGGLE   2
+
+void fullscreen_toggle() {
+       XEvent xev;
+       Window win=GDK_WINDOW_XID(main_window->window);
+       Display *disp=GDK_WINDOW_XDISPLAY(main_window->window);
+       
+       tX_fullscreen_status=!tX_fullscreen_status;
+       
+       /* Top layer.. */
+       xev.xclient.type = ClientMessage;
+       xev.xclient.serial = 0;
+       xev.xclient.send_event = True;
+       xev.xclient.display = disp;
+       xev.xclient.window = win;
+       xev.xclient.message_type = gdk_x11_get_xatom_by_name ("_WIN_LAYER");
+       xev.xclient.format = 32;
+       xev.xclient.data.l[0] = tX_fullscreen_status ? _WIN_LAYER_TOP : _WIN_LAYER_NORMAL ;
+       XSendEvent(disp, GDK_WINDOW_XID (gdk_get_default_root_window ()),
+               False, SubstructureRedirectMask | SubstructureNotifyMask,
+               &xev);
+       
+       /* Fullscreen */
+       xev.xclient.type = ClientMessage;
+       xev.xclient.serial = 0;
+       xev.xclient.send_event = True;
+       xev.xclient.display = disp;
+       xev.xclient.window = win;
+       xev.xclient.message_type = gdk_x11_get_xatom_by_name ("_NET_WM_STATE");
+       xev.xclient.format = 32;
+       xev.xclient.data.l[0] = tX_fullscreen_status ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
+       xev.xclient.data.l[1] = gdk_x11_atom_to_xatom (gdk_atom_intern ("_NET_WM_STATE_FULLSCREEN", TRUE));
+       xev.xclient.data.l[2] = gdk_x11_atom_to_xatom (GDK_NONE);
+       XSendEvent(gdk_display, GDK_WINDOW_XID (gdk_get_default_root_window ()),
+               False, SubstructureRedirectMask | SubstructureNotifyMask,
+               &xev);  
+}
+
+#include <gdk/gdkkeysyms.h>
+
+void fullscreen_setup() {
+       GtkAccelGroup* accel_group=gtk_accel_group_new();
+       gtk_widget_add_accelerator (fullscreen_button, "activate", accel_group, GDK_F11, (GdkModifierType) 0, (GtkAccelFlags) 0);
+       g_signal_connect(fullscreen_button, "activate", (GCallback) fullscreen_toggle, NULL);
+       gtk_window_add_accel_group(GTK_WINDOW(main_window), accel_group);
+}
+
+void display_mastergui()
+{
+       GtkWidget *top;
+       gtk_widget_realize(main_window);
+       tX_set_icon(main_window, "terminatorX");
+       load_knob_pixs(main_window);
+       fullscreen_setup();
+       gtk_widget_show(main_window);
+       top=gtk_widget_get_toplevel(main_window);
+       xwindow=GDK_WINDOW_XWINDOW(top->window);
+}
index ae1a703f549e002118aa12b03504b5bd290d3db4..a792ef4122201c19b036f18cd4e9fc86602e32d1 100644 (file)
@@ -1550,7 +1550,8 @@ void vtt_class :: xy_input(f_prec x_value, f_prec y_value)
 
 int  vtt_class :: save(FILE *rc, char *indent) {
        list <vtt_fx *> :: iterator effect;
-
+       char tmp_xml_buffer[4096];
+       
        int res=0;
 
        fprintf(rc, "%s<turntable>\n", indent);
index 7bb927ca609b98d811ff047c019ab19255816d30..259734414748e1385dc03b785cd34916f07c8729 100644 (file)
@@ -206,11 +206,7 @@ void load_part(char *newfile, vtt_class *vtt)
        else
        {
                nicer_filename(global_filename_buffer, newfile);
-#ifdef  USE_GTK2
         gtk_button_set_label(GTK_BUTTON(vtt->gui.file), global_filename_buffer);
-#else           
-               gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), global_filename_buffer);
-#endif
        }       
 }
 
@@ -251,26 +247,20 @@ void drop_file(GtkWidget *widget, GdkDragContext *context,
        *fn=0;  
        
        char *realfn=NULL;
-#ifdef USE_GTK2        
        char *host=NULL;
        
        realfn=g_filename_from_uri(filename, &host, NULL);
        if (realfn) {
                fn=realfn;
        } else  {
-#endif         
                fn = strchr (filename, ':');
                if (fn) fn++; else fn=(char *) selection_data->data;
-#ifdef USE_GTK2                        
        }
-#endif 
 
        load_part(realfn, vtt);
 
-#ifdef USE_GTK2        
        if (realfn) g_free(realfn);
        if (host) g_free(host);
-#endif         
 }
 
 
@@ -303,11 +293,7 @@ GtkSignalFunc load_file(GtkWidget *wid, vtt_class *vtt)
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_load_file), vtt);
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_load_file), vtt);    
        gtk_signal_connect (GTK_OBJECT(vtt->gui.fs), "delete-event", GTK_SIGNAL_FUNC(quit_load_file), vtt);     
-#ifdef USE_GTK2
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "cursor_changed", GTK_SIGNAL_FUNC(trigger_prelis), vtt->gui.fs);            
-#else
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "select_row", GTK_SIGNAL_FUNC(trigger_prelis), vtt->gui.fs);
-#endif
        return NULL;
 }
 
@@ -584,10 +570,7 @@ void vg_mouse_mapping_pressed(GtkWidget *wid, vtt_class *vtt) {
        
        gtk_menu_popup (GTK_MENU(vtt->gui.mouse_mapping_menu), NULL, NULL, NULL, NULL, 0, 0);
 
-#ifdef USE_GTK2
-       /* gtk+ is really waiting for this.. */
        gtk_signal_emit_by_name(GTK_OBJECT(wid), "released", vtt);
-#endif 
 }
 
 void vg_file_button_pressed(GtkWidget *wid, vtt_class *vtt) {
@@ -616,10 +599,8 @@ void vg_file_button_pressed(GtkWidget *wid, vtt_class *vtt) {
        
        gtk_menu_popup(GTK_MENU(vtt->gui.file_menu), NULL, NULL, NULL, NULL, 0,0);
 
-#ifdef USE_GTK2
        /* gtk+ is really waiting for this.. */
        gtk_signal_emit_by_name(GTK_OBJECT(wid), "released", vtt);
-#endif 
 }
 
 void vg_adjust_zoom(GtkWidget *wid, vtt_class *vtt) {  
@@ -677,10 +658,8 @@ void fx_button_pressed(GtkWidget *wid, vtt_class *vtt)
        
        gtk_menu_popup (GTK_MENU(g->ladspa_menu), NULL, NULL, NULL, NULL, 0, 0);
 
-#ifdef USE_GTK2
        /* gtk+ is really waiting for this.. */
        gtk_signal_emit_by_name(GTK_OBJECT(wid), "released", vtt);
-#endif 
 }
 
 #define connect_entry(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "activate", (GtkSignalFunc) func, (void *) vtt);
@@ -688,16 +667,7 @@ void fx_button_pressed(GtkWidget *wid, vtt_class *vtt)
 #define connect_button(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "clicked", (GtkSignalFunc) func, (void *) vtt);
 #define connect_range(wid, func); gtk_signal_connect(GTK_OBJECT(gtk_range_get_adjustment(GTK_RANGE(g->wid))), "value_changed", (GtkSignalFunc) func, (void *) vtt);
 #define connect_scale_format(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "format-value", (GtkSignalFunc) func, (void *) vtt);
-
-#ifdef USE_GTK2
 #define connect_press_button(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "pressed", (GtkSignalFunc) func, (void *) vtt);
-#else
-/* "pressed" then pop-up doesn't work with gtk 1.2 
-   and the well-known gdk hack doesn't support an additional vtt pointer..
-*/
-#define connect_press_button(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "clicked", (GtkSignalFunc) func, (void *) vtt);
-#endif
-
 #define connect_rel_button(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "released", (GtkSignalFunc) func, (void *) vtt);
 
 GtkWidget *vg_create_fx_bar(vtt_class *vtt, vtt_fx *effect, int showdel);
@@ -1207,21 +1177,13 @@ void gui_set_name(vtt_class *vtt, char *newname)
 
 void gui_set_filename (vtt_class *vtt, char *newname)
 {
-#ifdef  USE_GTK2
         gtk_button_set_label(GTK_BUTTON(vtt->gui.file), newname);
-#else           
-        gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), newname);
-#endif  
 }
 
 void gui_update_display(vtt_class *vtt)
 {
        nicer_filename(global_filename_buffer, vtt->filename);
-#ifdef  USE_GTK2
-        gtk_button_set_label(GTK_BUTTON(vtt->gui.file), global_filename_buffer);
-#else           
-        gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), global_filename_buffer);
-#endif  
+       gtk_button_set_label(GTK_BUTTON(vtt->gui.file), global_filename_buffer);
        gtk_tx_set_data(GTK_TX(vtt->gui.display), vtt->buffer, vtt->samples_in_buffer);
 }