Fixing configure for FreeBSD and Gentoo, some compilation probs with
authorterminatorX <>
Sun, 4 May 2003 10:40:34 +0000 (10:40 +0000)
committerterminatorX <>
Sun, 4 May 2003 10:40:34 +0000 (10:40 +0000)
older gccs and some sequencer bugs - Alex

12 files changed:
configure.in
src/tX_global.c
src/tX_legacy_vtt.cc
src/tX_loaddlg.cc
src/tX_mastergui.cc
src/tX_mastergui.h
src/tX_seqpar.h
src/tX_sequencer.cc
src/tX_sequencer.h
src/tX_vtt.cc
src/tX_vttgui.cc
src/tX_widget.c

index 83b0d23661ea5c4861b42f90c19e6e9a101b21ab..e3fc00f22bdf894b371954325bda918968760313 100644 (file)
@@ -404,6 +404,8 @@ dnl if test "$enable_dga2" = yes; then
 dnl    AC_DEFINE(USE_DGA2)
 dnl fi
 
+GNOMEpresent=fl
+
 AC_MSG_CHECKING(for GNOME)
        AC_MSG_RESULT([in progress])
        AC_CHECK_PROG(gnomepresent, gnome-name-service, yes, no)
@@ -415,12 +417,12 @@ AC_MSG_CHECKING(for GNOME)
                        gnomedatadir=${datadir}
                fi
                AC_SUBST(gnomedatadir)
-               AM_CONDITIONAL(GNOMEpresent, test "$gnomepresent" = yes)
                AC_MSG_RESULT([Found GNOME - installing terminatorX.desktop.])
                OPTION_GNOME="yes"
        else
                AC_MSG_RESULT([GNOME not found.])
        fi
+       AM_CONDITIONAL(GNOMEpresent, test "$gnomepresent" = yes)
 
 
 dnl Detecting libxml. Based on dia's test.
index df47ea062102ac97519c583d9dd8ee9e425da1a6..bab42717f6c7f967b97a065677709c8dc1ce1739 100644 (file)
@@ -230,8 +230,8 @@ void store_globals() {
        char indent[]="\t";
        FILE *rc=NULL;
        gzFile rz=NULL;
-       _store_compress_xml=0;
        char tmp_xml_buffer[4096];
+       _store_compress_xml=0;
        
        get_rc_name(rc_name);
 
@@ -316,6 +316,9 @@ void load_globals() {
 char *encode_xml(char *dest, const char *src) {
        int i, t, max;
        char tmp[4096];
+       int outlen=4096;
+       int inlen;
+       int res;
        
        tmp[0]=0;
        t=0;
@@ -333,16 +336,13 @@ char *encode_xml(char *dest, const char *src) {
        }
        tmp[t]=0;
 
-       int outlen=4096;
-       int inlen=t;
-       
-       int res=isolat1ToUTF8((unsigned char *) dest, &outlen, (unsigned char *) tmp, &inlen);
+       inlen=t;
+       res=isolat1ToUTF8((unsigned char *) dest, &outlen, (unsigned char *) tmp, &inlen);
        dest[outlen]=0;
        if (res<0) {
                tX_error("failed to encode string (%s) to UTF-8.", src);
        }
        
-       //tX_debug("encode_xml: from \"%s\" to \"%s\".", src, dest); 
        return dest;
 }
 
index f45c71938da3b6596d935e92addbe93271b4e535..bea0d5a84685de6b4474fc4614288510feb21f81 100644 (file)
@@ -648,7 +648,7 @@ int  vtt_class :: load_all_10(FILE* input, char *fname)
                gtk_box_pack_start(GTK_BOX(audio_parent), newvtt->gui.audio_box, TRUE, TRUE, 0);
        }
        
-       sequencer.clear();
+       sequencer.delete_all_events();
        
        ld_destroy();
        
@@ -908,7 +908,7 @@ void tX_sequencer :: load(FILE *in)
        guint32 i;
        tX_event *new_event=NULL;
        
-       clear();
+       delete_all_events();
        
        fread ((void *) &event_count, sizeof(event_count), 1, in);
        
index 317daa3aedd7430e37069960f7b1f5514f9cbe85..865898e42acd64b9b4dfabefdbb5b46467a0c342 100644 (file)
@@ -67,6 +67,7 @@ int ld_create_loaddlg(int mode, int count)
        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);
        ld_window=&(GTK_DIALOG(ld_loaddlg)->window);
+       
        gtk_container_set_border_width(GTK_CONTAINER(ld_window), 5);
        
        vbox=GTK_WIDGET(GTK_DIALOG(ld_loaddlg)->vbox);
@@ -101,6 +102,7 @@ int ld_create_loaddlg(int mode, int count)
        gtk_widget_realize(ld_loaddlg);
        gdk_window_set_decorations(gtk_widget_get_parent_window(vbox),(GdkWMDecoration) 0);
        gtk_widget_show(ld_loaddlg);
+       gdk_window_set_cursor(ld_loaddlg->window, tX_cursor::get_cursor());
 
        gtk_flush();
                
index 98cfc1a77d7d67e49df6aaf8d4be45e724a8863f..1c6b19e07fa5d7c3daff9a7bb93d3506d159863f 100644 (file)
@@ -289,7 +289,7 @@ GtkSignalFunc new_tables() {
 
        vtt_class::delete_all();
        new_table(NULL, NULL);
-       sequencer.delete_all_events();
+
        gtk_window_set_title(GTK_WINDOW(main_window), "terminatorX");
 
        return NULL;
@@ -387,7 +387,9 @@ void do_load_tables(GtkWidget *wid)
        load_dialog=NULL;
        load_dialog_win=NULL;
 
-       load_tt_part(buffer);   
+       tX_cursor::set_cursor(tX_cursor::WAIT_CURSOR);
+       load_tt_part(buffer);
+       tX_cursor::reset_cursor();
 }
 
 GtkSignalFunc load_tables()
@@ -752,7 +754,7 @@ gboolean quit()
        
        turn_audio_off();
        vtt_class::delete_all();
-       
+
        if (update_tag)
        gtk_timeout_remove(update_tag);
        globals.width=main_window->allocation.width;
@@ -1513,3 +1515,46 @@ void display_browser() {
                browser_tag=gtk_idle_add((GtkFunction) browser_checker, NULL);
        }
 }
+
+
+
+GdkCursor *tX_cursor::cursors[MAX_CURSOR]={NULL, NULL, NULL};
+tX_cursor::cursor_shape tX_cursor::current_shape=tX_cursor::DEFAULT_CURSOR;
+
+void tX_cursor::set_cursor(cursor_shape shape)
+{
+       switch (shape) {
+               case DEFAULT_CURSOR:
+                       cursors[shape]=NULL;
+                       break;
+               
+               case WAIT_CURSOR:
+                       if (!cursors[shape]) cursors[shape]=gdk_cursor_new(GDK_WATCH);
+                       break;
+               
+               case WAIT_A_SECOND_CURSOR:
+                       /* FIXME: What's that short-time wait cursor's id? */
+                       if (!cursors[shape]) cursors[shape]=gdk_cursor_new(GDK_WATCH);
+                       break;
+               
+               default:
+                       tX_debug("No such cursor shape.");
+                       return;
+       }
+       
+       /* Still here? Ok... */
+       current_shape=shape;
+       
+       gdk_window_set_cursor(main_window->window, cursors[shape]);
+}
+
+GdkCursor *tX_cursor::get_cursor()
+{
+       return cursors[current_shape];
+}
+
+void tX_cursor::reset_cursor()
+{
+       current_shape=DEFAULT_CURSOR;
+       gdk_window_set_cursor(main_window->window, cursors[current_shape]);
+}
index 690bac671c2d326aa961d2afe0c1c8fb1ad89815..3f02bb953bffdcb717cf73a51489f47f17b8f59d 100644 (file)
@@ -60,5 +60,24 @@ extern GtkWidget *panel_bar;
 void add_to_panel_bar(GtkWidget *);
 void remove_from_panel_bar(GtkWidget *);
 
+class tX_cursor {
+       public:
+       enum cursor_shape {
+               DEFAULT_CURSOR,
+               WAIT_CURSOR,
+               WAIT_A_SECOND_CURSOR,
+               MAX_CURSOR
+       };
+       
+       private:
+       static GdkCursor *cursors[MAX_CURSOR];
+       static cursor_shape current_shape;
+       
+       public:
+       static void set_cursor(cursor_shape shape);
+       static void reset_cursor();
+       static GdkCursor *get_cursor();
+};
+
 extern bool tX_shutdown;
 #endif
index b18cf47241dc79bd5fca96a69b50effd8efb9d1b..0c85c001cf80c3ff726ad323a4a020d9d8a0eaba 100644 (file)
@@ -163,20 +163,20 @@ class tX_seqpar_master_volume : public tX_seqpar_update
 {
        public:
        tX_seqpar_master_volume();
-       private:
        virtual void do_exec(const float value);
        virtual void do_update_graphics();      
-        virtual const char *get_name(); 
+       private:
+       virtual const char *get_name(); 
 };
 
 class tX_seqpar_master_pitch : public tX_seqpar_update_active_forward
 {
        public:
        tX_seqpar_master_pitch();
-       private:
        virtual void do_exec(const float value);
        virtual void do_update_graphics();      
-        virtual const char *get_name(); 
+       private:
+    virtual const char *get_name(); 
 };
 
 class tX_seqpar_vtt_speed : public tX_seqpar_no_update_active_forward
index 4647823d1e0ca9ed08e495995257099f58aa9007..af69bcb3af6df98181c9b4bf2e8c059dc457e03f 100644 (file)
@@ -205,6 +205,10 @@ void tX_sequencer :: delete_all_events() {
                delete (*ev);
                song_list.erase(ev);
        }
+
+       start_timestamp=0;
+       current_timestamp=0;
+       max_timestamp=0;
 }
 
 void tX_sequencer :: delete_all_events_for_sp(tX_seqpar *sp)
@@ -255,19 +259,6 @@ void tX_sequencer :: save(FILE *rc, gzFile rz, char *indent) {
        tX_store("%s</sequencer>\n", indent);
 }
 
-
-void tX_sequencer :: clear()
-{
-       if (song_list.size()==0) return;
-       
-       song_list.erase(song_list.begin(), song_list.end());
-       
-       current_timestamp=0;
-       max_timestamp=0;
-       start_timestamp=0;
-}
-
-
 guint32 tX_sequencer :: set_start_timestamp(float pos)
 {
        guint32 timestamp;
index aef297f8cd49c10d59ab98d2d2b80f1827003a49..66d4eea88c393ed50d2c24b254b3ae83bb6a8e8b 100644 (file)
@@ -87,7 +87,6 @@ class tX_sequencer
        void load(FILE *);
 #endif 
        void load(xmlDocPtr, xmlNodePtr);
-       void clear();
        
        guint32 set_start_timestamp(float pos);
        void forward_to_start_timestamp(int dont_fake);
index d16221011d1e0b7b248d559165c0bf09a47bc5e9..fc36a12e05142c3fd0d4b64b83548e0b65cb294a 100644 (file)
@@ -1608,6 +1608,21 @@ void vtt_class :: delete_all()
        while (main_list.size()) {
                delete((*main_list.begin()));
        }
+       
+       /* Take care of the master events.. */
+       sequencer.delete_all_events();
+       
+       /* Now reset master settings ot the default: */
+       set_master_pitch(1.0);
+       set_master_volume(1.0);
+       
+       sp_master_pitch.do_exec(1.0);
+       sp_master_pitch.do_update_graphics();
+
+       sp_master_volume.do_exec(1.0);
+       sp_master_volume.do_update_graphics();
+       
+       seq_update();
 }
 
 
index f655fc76536d971d07a64e38ffe0c3278f844285..8102e13beee5ae76fe79a9c5468b6e2d9425e7de 100644 (file)
@@ -221,6 +221,8 @@ void do_load_file(GtkWidget *wid, vtt_class *vtt)
        strcpy(newfile, gtk_file_selection_get_filename(GTK_FILE_SELECTION(vtt->gui.fs)));
        gtk_widget_destroy(GTK_WIDGET(vtt->gui.fs));
        
+       tX_cursor::set_cursor(tX_cursor::WAIT_CURSOR);
+       
        load_part(newfile, vtt);
        
        if (!globals.current_path)
@@ -232,6 +234,8 @@ void do_load_file(GtkWidget *wid, vtt_class *vtt)
        globals.current_path = strdup(newfile);
 
        vtt->gui.file_dialog=NULL;
+       
+       tX_cursor::reset_cursor();
 }
 
 void drop_file(GtkWidget *widget, GdkDragContext *context,
index 3355295084fab4b6265a375c24be453da23a8bdf..cfbe3e3736ea5b4e4beaed17e2c33e699fe22e10 100644 (file)
@@ -154,10 +154,11 @@ GtkWidget *gtk_tx_new(int16_t * wavdata, int wavsamples) {
 }
 
 static void gtk_tx_destroy(GtkObject * object) {
+       GtkTx *tx;
        g_return_if_fail(object != NULL);
        g_return_if_fail(GTK_IS_TX(object));
 
-       GtkTx *tx=GTK_TX(object);
+       tx=GTK_TX(object);
        
        if (tx->disp_data) { free(tx->disp_data); tx->disp_data=NULL; }