Implement a fullscreen mode
This commit is contained in:
parent
e8162fe768
commit
edba773e5e
|
@ -73,6 +73,17 @@ void on_view_all(gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* on_view_fullscreen */
|
||||||
|
void on_view_fullscreen(gpointer data)
|
||||||
|
{
|
||||||
|
MixerWindow * mixer = data;
|
||||||
|
gboolean fullscreen;
|
||||||
|
|
||||||
|
fullscreen = mixerwindow_get_fullscreen(mixer);
|
||||||
|
mixerwindow_set_fullscreen(mixer, !fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef AUDIO_MIXER_DEVINFO
|
#ifdef AUDIO_MIXER_DEVINFO
|
||||||
/* on_view_outputs */
|
/* on_view_outputs */
|
||||||
void on_view_outputs(gpointer data)
|
void on_view_outputs(gpointer data)
|
||||||
|
|
|
@ -28,15 +28,18 @@ void on_embedded(gpointer data);
|
||||||
/* menubar */
|
/* menubar */
|
||||||
void on_file_properties(gpointer data);
|
void on_file_properties(gpointer data);
|
||||||
void on_file_close(gpointer data);
|
void on_file_close(gpointer data);
|
||||||
void on_view_all(gpointer data);
|
|
||||||
void on_view_outputs(gpointer data);
|
|
||||||
void on_view_inputs(gpointer data);
|
|
||||||
void on_view_record(gpointer data);
|
|
||||||
void on_view_monitor(gpointer data);
|
|
||||||
void on_view_equalization(gpointer data);
|
|
||||||
void on_view_mix(gpointer data);
|
|
||||||
void on_view_modem(gpointer data);
|
|
||||||
void on_help_about(gpointer data);
|
void on_help_about(gpointer data);
|
||||||
void on_help_contents(gpointer data);
|
void on_help_contents(gpointer data);
|
||||||
|
|
||||||
|
void on_view_all(gpointer data);
|
||||||
|
void on_view_equalization(gpointer data);
|
||||||
|
void on_view_fullscreen(gpointer data);
|
||||||
|
void on_view_inputs(gpointer data);
|
||||||
|
void on_view_mix(gpointer data);
|
||||||
|
void on_view_modem(gpointer data);
|
||||||
|
void on_view_monitor(gpointer data);
|
||||||
|
void on_view_outputs(gpointer data);
|
||||||
|
void on_view_record(gpointer data);
|
||||||
|
|
||||||
#endif /* !MIXER_CALLBACKS_H */
|
#endif /* !MIXER_CALLBACKS_H */
|
||||||
|
|
41
src/window.c
41
src/window.c
|
@ -47,6 +47,7 @@ static char _license[] =
|
||||||
struct _MixerWindow
|
struct _MixerWindow
|
||||||
{
|
{
|
||||||
Mixer * mixer;
|
Mixer * mixer;
|
||||||
|
gboolean fullscreen;
|
||||||
|
|
||||||
/* widgets */
|
/* widgets */
|
||||||
GtkWidget * window;
|
GtkWidget * window;
|
||||||
|
@ -95,6 +96,14 @@ static const DesktopMenu _mixer_menu_file[] =
|
||||||
|
|
||||||
static const DesktopMenu _mixer_menu_view[] =
|
static const DesktopMenu _mixer_menu_view[] =
|
||||||
{
|
{
|
||||||
|
{ N_("_Fullscreen"), G_CALLBACK(on_view_fullscreen),
|
||||||
|
# if GTK_CHECK_VERSION(2, 8, 0)
|
||||||
|
GTK_STOCK_FULLSCREEN,
|
||||||
|
# else
|
||||||
|
NULL,
|
||||||
|
# endif
|
||||||
|
0, GDK_KEY_F11 },
|
||||||
|
{ "", NULL, NULL, 0, 0 },
|
||||||
{ N_("_All"), G_CALLBACK(on_view_all), NULL, GDK_CONTROL_MASK,
|
{ N_("_All"), G_CALLBACK(on_view_all), NULL, GDK_CONTROL_MASK,
|
||||||
GDK_KEY_A },
|
GDK_KEY_A },
|
||||||
# ifdef AUDIO_MIXER_DEVINFO
|
# ifdef AUDIO_MIXER_DEVINFO
|
||||||
|
@ -136,6 +145,14 @@ static DesktopToolbar _mixer_toolbar[] =
|
||||||
{
|
{
|
||||||
{ N_("Properties"), G_CALLBACK(on_file_properties),
|
{ N_("Properties"), G_CALLBACK(on_file_properties),
|
||||||
GTK_STOCK_PROPERTIES, GDK_MOD1_MASK, GDK_KEY_Return, NULL },
|
GTK_STOCK_PROPERTIES, GDK_MOD1_MASK, GDK_KEY_Return, NULL },
|
||||||
|
{ "", NULL, NULL, 0, 0, NULL },
|
||||||
|
{ N_("Fullscreen"), G_CALLBACK(on_view_fullscreen),
|
||||||
|
# if GTK_CHECK_VERSION(2, 8, 0)
|
||||||
|
GTK_STOCK_FULLSCREEN,
|
||||||
|
# else
|
||||||
|
"gtk-fullscreen",
|
||||||
|
# endif
|
||||||
|
0, GDK_KEY_F11, NULL },
|
||||||
{ NULL, NULL, NULL, 0, 0, NULL },
|
{ NULL, NULL, NULL, 0, 0, NULL },
|
||||||
{ N_("All"), G_CALLBACK(on_view_all), "stock_select-all", 0, 0, NULL },
|
{ N_("All"), G_CALLBACK(on_view_all), "stock_select-all", 0, 0, NULL },
|
||||||
{ N_("Outputs"), G_CALLBACK(on_view_outputs), "audio-volume-high", 0, 0,
|
{ N_("Outputs"), G_CALLBACK(on_view_outputs), "audio-volume-high", 0, 0,
|
||||||
|
@ -195,6 +212,7 @@ MixerWindow * mixerwindow_new(char const * device, MixerLayout layout,
|
||||||
G_CALLBACK(on_closex), mixer);
|
G_CALLBACK(on_closex), mixer);
|
||||||
}
|
}
|
||||||
mixer->mixer = NULL;
|
mixer->mixer = NULL;
|
||||||
|
mixer->fullscreen = FALSE;
|
||||||
if(mixer->window != NULL)
|
if(mixer->window != NULL)
|
||||||
{
|
{
|
||||||
gtk_widget_realize(mixer->window);
|
gtk_widget_realize(mixer->window);
|
||||||
|
@ -215,7 +233,7 @@ MixerWindow * mixerwindow_new(char const * device, MixerLayout layout,
|
||||||
if(embedded == FALSE)
|
if(embedded == FALSE)
|
||||||
{
|
{
|
||||||
if(layout == ML_TABBED)
|
if(layout == ML_TABBED)
|
||||||
_mixer_menubar[1].menu = &_mixer_menu_view[1];
|
_mixer_menubar[3].menu = &_mixer_menu_view[3];
|
||||||
widget = desktop_menubar_create(_mixer_menubar, mixer, accel);
|
widget = desktop_menubar_create(_mixer_menubar, mixer, accel);
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
|
||||||
}
|
}
|
||||||
|
@ -225,7 +243,7 @@ MixerWindow * mixerwindow_new(char const * device, MixerLayout layout,
|
||||||
if(embedded == FALSE)
|
if(embedded == FALSE)
|
||||||
{
|
{
|
||||||
if(layout != ML_TABBED)
|
if(layout != ML_TABBED)
|
||||||
_mixer_toolbar[1].name = "";
|
_mixer_toolbar[3].name = "";
|
||||||
widget = desktop_toolbar_create(_mixer_toolbar, mixer, accel);
|
widget = desktop_toolbar_create(_mixer_toolbar, mixer, accel);
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
|
||||||
}
|
}
|
||||||
|
@ -272,6 +290,25 @@ void mixerwindow_delete(MixerWindow * mixer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* accessors */
|
||||||
|
/* mixerwindow_get_fullscreen */
|
||||||
|
gboolean mixerwindow_get_fullscreen(MixerWindow * mixer)
|
||||||
|
{
|
||||||
|
return mixer->fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* mixerwindow_set_fullscreen */
|
||||||
|
void mixerwindow_set_fullscreen(MixerWindow * mixer, gboolean fullscreen)
|
||||||
|
{
|
||||||
|
if(fullscreen)
|
||||||
|
gtk_window_fullscreen(GTK_WINDOW(mixer->window));
|
||||||
|
else
|
||||||
|
gtk_window_unfullscreen(GTK_WINDOW(mixer->window));
|
||||||
|
mixer->fullscreen = fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* useful */
|
/* useful */
|
||||||
/* mixerwindow_about */
|
/* mixerwindow_about */
|
||||||
static gboolean _about_on_closex(GtkWidget * widget);
|
static gboolean _about_on_closex(GtkWidget * widget);
|
||||||
|
|
|
@ -32,6 +32,10 @@ MixerWindow * mixerwindow_new(char const * device, MixerLayout layout,
|
||||||
gboolean embedded);
|
gboolean embedded);
|
||||||
void mixerwindow_delete(MixerWindow * mixer);
|
void mixerwindow_delete(MixerWindow * mixer);
|
||||||
|
|
||||||
|
/* accessors */
|
||||||
|
gboolean mixerwindow_get_fullscreen(MixerWindow * mixer);
|
||||||
|
void mixerwindow_set_fullscreen(MixerWindow * mixer, gboolean fullscreen);
|
||||||
|
|
||||||
/* useful */
|
/* useful */
|
||||||
void mixerwindow_about(MixerWindow * mixer);
|
void mixerwindow_about(MixerWindow * mixer);
|
||||||
void mixerwindow_properties(MixerWindow * mixer);
|
void mixerwindow_properties(MixerWindow * mixer);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user