pnmixer
Volume mixer for the system tray
Data Structures | Macros | Functions
ui-hotkey-dialog.c File Reference

Hotkey dialog subsystem. More...

#include <glib.h>
#include <gtk/gtk.h>
#include "support-log.h"
#include "support-intl.h"
#include "support-ui.h"
#include "ui-hotkey-dialog.h"
#include "main.h"
Include dependency graph for ui-hotkey-dialog.c:

Go to the source code of this file.

Data Structures

struct  hotkey_dialog
 

Macros

#define HOTKEY_DIALOG_UI_FILE   "hotkey-dialog-gtk2.glade"
 

Functions

static void configure_hotkey_dialog (GtkWindow *window, GtkLabel *instruction_label, const gchar *hotkey)
 
gboolean on_hotkey_dialog_key_press_event (G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event, HotkeyDialog *dialog)
 
gboolean on_hotkey_dialog_key_release_event (GtkWidget *widget, G_GNUC_UNUSED GdkEventKey *event, G_GNUC_UNUSED HotkeyDialog *dialog)
 
gchar * hotkey_dialog_run (HotkeyDialog *dialog)
 
void hotkey_dialog_destroy (HotkeyDialog *dialog)
 
HotkeyDialoghotkey_dialog_create (GtkWindow *parent, const gchar *hotkey)
 

Detailed Description

Hotkey dialog subsystem.

This file holds the ui-related code for the hotkey dialog, usually run from the preferences window.

Definition in file ui-hotkey-dialog.c.

Macro Definition Documentation

◆ HOTKEY_DIALOG_UI_FILE

#define HOTKEY_DIALOG_UI_FILE   "hotkey-dialog-gtk2.glade"

Definition at line 35 of file ui-hotkey-dialog.c.

Function Documentation

◆ configure_hotkey_dialog()

static void configure_hotkey_dialog ( GtkWindow *  window,
GtkLabel *  instruction_label,
const gchar *  hotkey 
)
static

Definition at line 42 of file ui-hotkey-dialog.c.

◆ hotkey_dialog_create()

HotkeyDialog* hotkey_dialog_create ( GtkWindow *  parent,
const gchar *  hotkey 
)

Creates a new hotkey dialog.

Parameters
parenta GtkWindow to be used as the parent.
hotkeythe hotkey concerned.
Returns
the newly created HotkeyDialog instance.

Definition at line 222 of file ui-hotkey-dialog.c.

◆ hotkey_dialog_destroy()

void hotkey_dialog_destroy ( HotkeyDialog dialog)

Destroys a hotkey dialog, freeing any resources.

Parameters
dialoga HotkeyDialog instance.

Definition at line 206 of file ui-hotkey-dialog.c.

◆ hotkey_dialog_run()

gchar* hotkey_dialog_run ( HotkeyDialog dialog)

Runs the hotkey dialog, and returns a string representing the hotkey that has been pressed. String must be freed.

Parameters
dialoga HotkeyDialog instance.
Returns
the hotkey pressed, must be freed.

Definition at line 130 of file ui-hotkey-dialog.c.

◆ on_hotkey_dialog_key_press_event()

gboolean on_hotkey_dialog_key_press_event ( G_GNUC_UNUSED GtkWidget *  widget,
GdkEventKey *  event,
HotkeyDialog dialog 
)

Handles the 'key-press-event' signal on the GtkDialog 'hotkey_dialog'. Update the text displayed in the dialog.

Parameters
widgetthe object which received the signal.
eventthe GdkEventKey which triggered the signal.
dialoguser data set when the signal handler was connected.
Returns
TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.

Definition at line 76 of file ui-hotkey-dialog.c.

◆ on_hotkey_dialog_key_release_event()

gboolean on_hotkey_dialog_key_release_event ( GtkWidget *  widget,
G_GNUC_UNUSED GdkEventKey *  event,
G_GNUC_UNUSED HotkeyDialog dialog 
)

Handles the signal 'key-release-event' on the GtkDialog 'hotkey_dialog'. Closes the dialog.

Parameters
widgetthe object which received the signal.
eventthe GdkEventKey which triggered the signal.
dialoguser data set when the signal handler was connected.
Returns
TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.

Definition at line 113 of file ui-hotkey-dialog.c.