Commit fa5ba0bb authored by Stéphane Borel's avatar Stéphane Borel

-Unification of gnome/gtk intefaces: now all the file are in plugin/gtk.

Specific files are glade generated files and intf_* files. All the
remainders are common to gtk and gnome and contain all the callbacks for
both interfaces.
parent 5ae87b7e
......@@ -12,7 +12,7 @@
# All possible plugin directories, needed for make clean
#
PLUGINS_DIR := alsa beos darwin dsp dummy \
dvd esd fb ggi glide gnome gtk \
dvd esd fb ggi glide gtk \
downmix idct imdct \
macosx mga \
motion \
......@@ -23,7 +23,7 @@ PLUGINS_DIR := alsa beos darwin dsp dummy \
# All possible plugin objects
#
PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin dsp/dsp dummy/dummy \
dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gnome/gnome gtk/gtk \
dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gtk/gnome gtk/gtk \
downmix/downmix downmix/downmixsse downmix/downmix3dn \
idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
imdct/imdct imdct/imdct3dn imdct/imdctsse \
......@@ -76,8 +76,7 @@ AC3_DECODER = src/ac3_decoder/ac3_decoder_thread.o \
AC3_SPDIF = src/ac3_spdif/ac3_spdif.o \
src/ac3_spdif/ac3_iec958.o
LPCM_DECODER = src/lpcm_decoder/lpcm_decoder_thread.o \
src/lpcm_decoder/lpcm_decoder.o
LPCM_DECODER = src/lpcm_decoder/lpcm_decoder_thread.o
AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
src/audio_decoder/adec_generic.o \
......
###############################################################################
# vlc (VideoLAN Client) gnome module Makefile
# (c)2001 VideoLAN
###############################################################################
#
# Objects
#
PLUGIN_GNOME = gnome.o intf_gnome.o gnome_callbacks.o gnome_interface.o gnome_support.o gnome_playlist.o
BUILTIN_GNOME = $(PLUGIN_GNOME:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_GNOME) $(BUILTIN_GNOME)
#
# Virtual targets
#
include ../../Makefile.modules
$(PLUGIN_GNOME): %.o: .dep/%.d
$(PLUGIN_GNOME): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gtk gnomeui` -c -o $@ $<
$(BUILTIN_GNOME): BUILTIN_%.o: .dep/%.d
$(BUILTIN_GNOME): BUILTIN_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN `gnome-config --cflags gtk gnomeui` -c -o $@ $<
#
# Real targets
#
../../lib/gnome.so: $(PLUGIN_GNOME)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GNOME)
../../lib/gnome.a: $(BUILTIN_GNOME)
ar r $@ $^
$(RANLIB) $@
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* intf_gnome.h: private Gnome interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.h,v 1.11 2001/05/10 06:47:31 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Drag'n'drop stuff
*****************************************************************************/
#define DROP_ACCEPT_TEXT_URI_LIST 0
#define DROP_ACCEPT_TEXT_PLAIN 1
/*****************************************************************************
* Interface modes
*****************************************************************************/
#define FILE_MODE 0
#define NET_MODE 1
#define DVD_MODE 2
#define VCD_MODE 3
/*****************************************************************************
* String sizes
*****************************************************************************/
#define GNOME_MENU_LABEL_SIZE 64
/*****************************************************************************
* Convert user_data structures to title and chapter information
*****************************************************************************/
#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
/*****************************************************************************
* Inline function to retrieve the interface structure
*****************************************************************************/
static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
{
return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
"p_intf" ) );
}
/*****************************************************************************
* intf_sys_t: description and status of Gnome interface
*****************************************************************************/
typedef struct intf_sys_s
{
/* special actions */
boolean_t b_popup_changed; /* display menu ? */
boolean_t b_window_changed; /* window display toggled ? */
boolean_t b_playlist_changed; /* playlist display toggled ? */
boolean_t b_slider_free; /* slider status */
boolean_t b_title_update; /* do we need to update title menus */
boolean_t b_chapter_update; /* do we need to update
chapter menus */
boolean_t b_angle_update; /* do we need to update angle menus */
boolean_t b_audio_update; /* do we need to update audio menus */
boolean_t b_spu_update; /* do we need to update spu menus */
/* Windows and widgets */
GtkWidget * p_window; /* main window */
GtkWidget * p_popup; /* popup menu */
GtkWidget * p_playlist; /* playlist */
GtkWidget * p_modules; /* module manager */
GtkWidget * p_about; /* about window */
GtkWidget * p_fileopen; /* file open window */
GtkWidget * p_disc; /* disc selection window */
GtkWidget * p_network; /* network stream window */
GtkWidget * p_preferences; /* preferences window */
GtkWidget * p_jump; /* jump window */
/* The slider */
GtkFrame * p_slider_frame;
GtkAdjustment * p_adj; /* slider adjustment object */
float f_adj_oldvalue; /* previous value */
/* The window labels */
GtkLabel * p_label_title;
GtkLabel * p_label_chapter;
/* Playlist management */
int i_list_timeout;
int i_playing; /* playlist selected item */
/* input mode management */
boolean_t b_mode_changed;
gint i_intf_mode; /* interface mode: file, net, disc */
gint i_part; /* current chapter */
/* XXX: Ugly kludge, see intf_gnome.c */
void ( *pf_gtk_callback ) ( void );
void ( *pf_gdk_callback ) ( void );
} intf_sys_t;
###############################################################################
# vlc (VideoLAN Client) gtk module Makefile
# vlc (VideoLAN Client) gtk/gnome module Makefile
# (c)2001 VideoLAN
###############################################################################
......@@ -7,16 +7,17 @@
# Objects
#
PLUGIN_C = gtk.o intf_gtk.o gtk_callbacks.o gtk_interface.o gtk_support.o gtk_open.o gtk_control.o gtk_menu.o gtk_playlist.o gtk_modules.o gtk_preferences.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
PLUGIN_GTK = gtk.o intf_gtk.o gtk_interface.o gtk_support.o
PLUGIN_GNOME = gnome.o intf_gnome.o gnome_interface.o gnome_support.o gnome_callbacks.o
PLUGIN_GTKCOMMON = gtk_display.o gtk_callbacks.o gtk_open.o gtk_control.o gtk_menu.o gtk_playlist.o gtk_modules.o gtk_preferences.o
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
BUILTIN_GTK = $(PLUGIN_GTK:%.o=BUILTIN_GTK_%.o) \
$(PLUGIN_GTKCOMMON:%.o=BUILTIN_GTK_%.o)
BUILTIN_GNOME = $(PLUGIN_GNOME:%.o=BUILTIN_GNOME_%.o) \
$(PLUGIN_GTKCOMMON:%.o=BUILTIN_GNOME_%.o)
#
# Special plugin modifications
#
CFLAGS += $(CFLAGS_GTK)
ALL_OBJ = $(PLUGIN_GTK) $(PLUGIN_GNOME) $(PLUGIN_GTKCOMMON) \
$(BUILTIN_GTK) $(BUILTIN_GNOME)
#
# Virtual targets
......@@ -24,14 +25,42 @@ CFLAGS += $(CFLAGS_GTK)
include ../../Makefile.modules
$(PLUGIN_GTKCOMMON): %.o: .dep/%.d
$(PLUGIN_GTKCOMMON): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) $(CFLAGS_GTK) -c -o $@ $<
$(PLUGIN_GTK): %.o: .dep/%.d
$(PLUGIN_GTK): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) $(CFLAGS_GTK) -DMODULE_NAME=gtk -c -o $@ $<
$(PLUGIN_GNOME): %.o: .dep/%.d
$(PLUGIN_GNOME): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -DMODULE_NAME=gnome `gnome-config --cflags gtk gnomeui` -c -o $@ $<
$(BUILTIN_GTK): BUILTIN_GTK_%.o: .dep/%.d
$(BUILTIN_GTK): BUILTIN_GTK_%.o: %.c
$(CC) $(CFLAGS) $(CFLAGS_GTK) -DBUILTIN -DMODULE_NAME=gtk -c -o $@ $<
$(BUILTIN_GNOME): BUILTIN_GNOME_%.o: .dep/%.d
$(BUILTIN_GNOME): BUILTIN_GNOME_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=gnome `gnome-config --cflags gtk gnomeui` -c -o $@ $<
#
# Real targets
#
../../lib/gtk.so: $(PLUGIN_C)
../../lib/gtk.so: $(PLUGIN_GTK) $(PLUGIN_GTKCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GTK)
../../lib/gtk.a: $(BUILTIN_C)
../../lib/gtk.a: $(BUILTIN_GTK)
ar r $@ $^
$(RANLIB) $@
../../lib/gnome.so: $(PLUGIN_GNOME) $(PLUGIN_GTKCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GNOME)
../../lib/gnome.a: $(BUILTIN_GNOME)
ar r $@ $^
$(RANLIB) $@
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.7 2001/04/28 03:36:25 sam Exp $
* $Id: gnome.c,v 1.1 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gnome.h>
#include "gnome_callbacks.h"
#include "gnome_interface.h"
#include "gnome_support.h"
/*
* These wrappers are made necessary by a bug in glade that seems not
* to put user_data in c source of menuitems.
*/
void
GnomeMenubarFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkFileOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkDiscOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenbarNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarExitActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkExit( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarWindowToggleActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWindowToggle( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarFullscreenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkFullscreen( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarPlaylistActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkPlaylistShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarModulesActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkModulesShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarPreferencesActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkPreferencesShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomeMenubarAboutActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkAboutShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
void
GnomePopupPlayActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlPlay( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupPauseActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlPause( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupStopActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlStop( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupBackActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlBack( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupSlowActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlSlow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupFastActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlFast( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupWindowToggleActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWindowToggle( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupFullscreenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkFullscreen( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupNextActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkPlaylistNext( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupPrevActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkPlaylistPrev( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkFileOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkDiscOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupAboutActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkAboutShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupPlaylistActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkPlaylistShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupPreferencesActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkPreferencesShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePopupExitActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkExit( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
void
GnomePlaylistDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkDiscOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_playlist" );
}
void
GnomePlaylistFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkFileOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_playlist" );
}
void
GnomePlaylistNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_playlist" );
}
void
GnomePopupJumpActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkJumpShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
}
#include <gnome.h>
#include "gtk_callbacks.h"
void
GnomeMenubarFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenbarNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarExitActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarWindowToggleActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarFullscreenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarPlaylistActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarModulesActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarPreferencesActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomeMenubarAboutActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupPlayActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupPauseActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupStopActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupBackActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupSlowActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupFastActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupWindowToggleActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupFullscreenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupNextActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupPrevActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupAboutActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupPlaylistActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupPreferencesActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupExitActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePlaylistDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePlaylistFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePlaylistNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GnomePopupJumpActivate (GtkMenuItem *menuitem,
gpointer user_data);
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.19 2001/05/19 00:39:30 stef Exp $
* $Id: gtk_callbacks.c,v 1.20 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -22,9 +22,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......
/*****************************************************************************
* gtk_callbacks.h : Callbacks for the gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.h,v 1.13 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <gtk/gtk.h>
#include "config.h"
#include "gtk_control.h"
#include "gtk_menu.h"
#include "gtk_open.h"
......@@ -8,7 +38,9 @@
/* General glade callbacks */
/* main window callbacks: specific prototypes are in headers listed before */
/*****************************************************************************
* main window callbacks: specific prototypes are in headers listed before
*****************************************************************************/
gboolean GtkExit ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkWindowToggle ( GtkWidget *, GdkEventButton *, gpointer );
......
......@@ -2,7 +2,7 @@
* gtk_control.c : functions to handle stream control buttons.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_control.c,v 1.2 2001/05/15 14:49:48 stef Exp $
* $Id: gtk_control.c,v 1.3 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -22,9 +22,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......
/*****************************************************************************
* gtk_display.c: Gtk+ tools for main interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_display.c,v 1.1 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <gtk/gtk.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "modules.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_msg.h"
#include "intf_playlist.h"
#include "video.h"
#include "video_output.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_menu.h"
#include "gtk_display.h"
#include "intf_gtk.h"
#include "main.h"
/*****************************************************************************
* GtkDisplayDate: display stream date
*****************************************************************************
* This function displays the current date related to the position in
* the stream. It is called whenever the slider changes its value.
* The lock has to be taken before you call the function.
*****************************************************************************/
void GtkDisplayDate( GtkAdjustment *p_adj )
{
intf_thread_t *p_intf;
p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
if( p_intf->p_input != NULL )
{
#define p_area p_intf->p_input->stream.p_selected_area
char psz_time[ OFFSETTOTIME_MAX_SIZE ];
gtk_frame_set_label( GTK_FRAME( p_intf->p_sys->p_slider_frame ),
input_OffsetToTime( p_intf->p_input, psz_time,
( p_area->i_size * p_adj->value ) / 100 ) );
#undef p_area
}
}
/*****************************************************************************
* GtkModeManage: actualise the aspect of the interface whenever the input
* changes.
*****************************************************************************
* The lock has to be taken before you call the function.
*****************************************************************************/
gint GtkModeManage( intf_thread_t * p_intf )
{
GtkWidget * p_dvd_box;
GtkWidget * p_file_box;
GtkWidget * p_network_box;
GtkWidget * p_slider;
GtkWidget * p_label;
boolean_t b_control;
#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
p_intf->p_sys->ptr ) , ( name ) ) )
/* hide all boxes except default file box */
p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "file_box" ) );
gtk_widget_hide( GTK_WIDGET( p_file_box ) );
p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "network_box" ) );
gtk_widget_hide( GTK_WIDGET( p_network_box ) );
p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "dvd_box" ) );
gtk_widget_hide( GTK_WIDGET( p_dvd_box ) );
/* hide slider */
p_slider = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "slider_frame" ) );
gtk_widget_hide( GTK_WIDGET( p_slider ) );
/* controls unavailable */
b_control = 0;
/* show the box related to current input mode */
if( p_intf->p_input != NULL )
{
switch( p_intf->p_input->stream.i_method & 0xf0 )
{
case INPUT_METHOD_FILE:
gtk_widget_show( GTK_WIDGET( p_file_box ) );
p_label = gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ),
"label_status" );
gtk_label_set_text( GTK_LABEL( p_label ),
p_intf->p_input->p_source );
break;
case INPUT_METHOD_DISC:
gtk_widget_show( GTK_WIDGET( p_dvd_box ) );
break;
case INPUT_METHOD_NETWORK:
gtk_widget_show( GTK_WIDGET( p_network_box ) );
p_label = gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ),
"network_address_label" );
gtk_label_set_text( GTK_LABEL( p_label ),
p_intf->p_input->p_source );
break;
default:
intf_ErrMsg( "intf error: can't determine input method" );
break;
}
/* slider for seekable streams */
if( p_intf->p_input->stream.b_seekable )
{
gtk_widget_show( GTK_WIDGET( p_slider ) );
}
/* control buttons for free pace streams */
b_control = p_intf->p_input->stream.b_pace_control;
/* get ready for menu regeneration */
p_intf->p_sys->b_title_update = 1;
p_intf->p_sys->b_chapter_update = 1;
p_intf->p_sys->b_angle_update = 1;
p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->i_part = 0;
p_intf->p_input->stream.b_changed = 0;
intf_WarnMsg( 3,
"intf info: menus refreshed as stream has changed" );
}
else
{
/* default mode */
p_label = gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_window ),
"label_status" );
gtk_label_set_text( GTK_LABEL( p_label ), "" );
gtk_widget_show( GTK_WIDGET( p_file_box ) );
/* unsensitize menus */
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"),
FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_angle"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_audio"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_subpictures"),
FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"),
FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_angle"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"),
FALSE );
}
/* set control items */
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control );
#undef GETWIDGET
return TRUE;
}
/*****************************************************************************
* gnome_playlist.h : Playlist functions for the Gnome plugin.
* gtk_dsiplay.h: Gtk+ tools for main interface.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_playlist.h,v 1.1 2001/05/06 18:41:52 stef Exp $
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_display.h,v 1.1 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* Authors: Pierre Baillet <oct@zoy.org>
*
* 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 2 of the License, or
......@@ -21,15 +22,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
void GnomeDropDataReceived ( intf_thread_t *, GtkSelectionData *,
guint, int );
void GnomeRebuildCList ( GtkCList *, playlist_t * );
int GnomeHasValidExtension( gchar * );
int GnomeAppendList ( playlist_t *, int, GList * );
void GnomePlayListManage ( intf_thread_t * );
gint GnomeCompareItems ( gconstpointer, gconstpointer );
GList * GnomeReadFiles ( gchar * );
void GnomeDeleteGListItem ( gpointer, gpointer );
/*****************************************************************************
* Prototypes
*****************************************************************************/
gint GtkModeManage ( intf_thread_t * p_intf );
void GtkDisplayDate ( GtkAdjustment *p_adj );
......@@ -244,7 +244,7 @@ create_intf_window (void)
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_interface_hide);
gtk_tooltips_set_tip (tooltips, menubar_interface_hide, _("Hide the main interface window"), NULL);
menubar_fullscreen = gtk_check_menu_item_new_with_label ("");
menubar_fullscreen = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_fullscreen)->child),
_("_Fullscreen"));
gtk_widget_add_accelerator (menubar_fullscreen, "activate_item", menubar_view_menu_accels,
......@@ -254,7 +254,6 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_fullscreen);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_fullscreen);
gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (menubar_fullscreen), TRUE);
separator13 = gtk_menu_item_new ();
gtk_widget_ref (separator13);
......
......@@ -2,7 +2,7 @@
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.3 2001/05/19 00:39:30 stef Exp $
* $Id: gtk_menu.c,v 1.4 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -22,9 +22,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment