OGMRip Gtk+ Reference Manual: Helper

## Helper Helper — A list of helper functions |

## Functions

#define | GTK_BOX_CHILD()
gchar * | g_get_locale ()
gulong | g_signal_connect_data_while_alive ()
#define | g_signal_connect_while_alive()
#define | g_signal_connect_swapped_while_alive()
void | gtk_window_set_parent ()
void | gtk_window_set_icon_from_stock ()
void | gtk_dialog_response_accept ()
void | gtk_dialog_set_response_visible ()
gint | gtk_radio_button_get_active ()
void | gtk_radio_button_set_active ()
gboolean | gtk_tree_model_iter_prev ()
void | gtk_label_set_int ()
gint | gtk_label_get_int ()
GtkWidget * | gtk_box_get_nth_child ()
const gchar * | ogmrip_get_system_profiles_dir ()
const gchar * | ogmrip_get_user_profiles_dir ()
void | ogmrip_combo_box_containers_construct ()
void | ogmrip_combo_box_add_containers ()
GType | ogmrip_combo_box_get_active_container ()
void | ogmrip_combo_box_set_active_container ()
void | ogmrip_combo_box_video_codecs_construct ()
void | ogmrip_combo_box_add_video_codecs ()
GType | ogmrip_combo_box_get_active_video_codec ()
void | ogmrip_combo_box_set_active_video_codec ()
void | ogmrip_combo_box_audio_codecs_construct ()
void | ogmrip_combo_box_add_audio_codecs ()
GType | ogmrip_combo_box_get_active_audio_codec ()
void | ogmrip_combo_box_set_active_audio_codec ()
void | ogmrip_combo_box_subp_codecs_construct ()
void | ogmrip_combo_box_add_subp_codecs ()
GType | ogmrip_combo_box_get_active_subp_codec ()
void | ogmrip_combo_box_set_active_subp_codec ()
void | ogmrip_combo_box_languages_construct ()
GtkWidget * | ogmrip_message_dialog_new ()
gint | ogmrip_message_dialog ()
GtkWidget * | ogmrip_load_dvd_dialog_new ()

## Object Hierarchy

## Includes

    #include <ogmrip-source-chooser.h>

## Description

## Functions

### GTK_BOX_CHILD()

    #define GTK_BOX_CHILD(b) ((GtkBoxChild *) (b))

### g_get_locale ()

    gchar *
    g_get_locale (gint category);

Returns the active source and its type.

#### Parameters

category | A pointer to store the type of the chooser |

#### Returns

The active OGMRipSource

### g_signal_connect_data_while_alive ()

    gulong
    g_signal_connect_data_while_alive (gpointer instance,
                                       const gchar *detailed_signal,
                                       GCallback c_handler,
                                       gpointer alive,
                                       GClosureNotify destroy_data,
                                       GConnectFlags connect_flags);

Connects a GCallback function to a signal for a particular object automatically disconnecting it when `alive` is destroyed.

#### Parameters

instance | the instance to connect to |
detailed_signal | a string of the form "signal-name::detail" |
c_handler | the GCallback to connect |
alive | the instance to check for |
destroy_data | a GClosureNotify for data |
connect_flags | a combination of GConnectFlags |

#### Returns

the handler id

### g_signal_connect_while_alive()

    #define             g_signal_connect_while_alive(instance, detailed_signal, c_handler, alive)

Connects a GCallback function to a signal for a particular object automatically disconnecting it when `alive` is destroyed.

#### Parameters

instance | the instance to connect to |
detailed_signal | a string of the form "signal-name::detail" |
c_handler | the GCallback to connect |
alive | the instance to check for |

#### Returns

the handler id

### g_signal_connect_swapped_while_alive()

    #define             g_signal_connect_swapped_while_alive(instance, detailed_signal, c_handler, alive)

Connects a GCallback function to a signal for a particular object automatically disconnecting it when `alive` is destroyed.

#### Parameters

instance | the instance to connect to |
detailed_signal | a string of the form "signal-name::detail" |
c_handler | the GCallback to connect |
alive | the instance to check for |

#### Returns

the handler id

### gtk_window_set_parent ()

    void
    gtk_window_set_parent (GtkWindow *window,
                           GtkWindow *parent);

Sets a parent window for a window. This is equivalent to calling `gtk_window_set_transient_for()`, `gtk_window_set_position()`, `gtk_window_set_gravity()`, and `gtk_window_set_destroy_with_parent()` on `window` .

#### Parameters

window | A GtkWindow |
parent | The parent window |

### gtk_window_set_icon_from_stock ()

    void
    gtk_window_set_icon_from_stock (GtkWindow *window,
                                    const gchar *stock_id);

Sets the icon of `window` from a stock item.

#### Parameters

window | A GtkWindow |
stock_id | the name of the stock item |

### gtk_dialog_response_accept ()

    void
    gtk_dialog_response_accept (GtkDialog *dialog);

Emits the "response" signal with GTK_RESPONSE_ACCEPT.

#### Parameters

dialog | a GtkDialog |

### gtk_dialog_set_response_visible ()

    void
    gtk_dialog_set_response_visible (GtkDialog *dialog,
                                     gint response_id,
                                     gboolean setting);

Sets the <literal>visible</literal> property of each widget in the dialog's action area with the given `response_id` . A convenient way to show/hide dialog buttons.

#### Parameters

dialog | a GtkDialog |
response_id | a response ID |
setting | `TRUE` for visible |

### gtk_radio_button_get_active ()

    gint
    gtk_radio_button_get_active (GtkRadioButton *radio);

Returns the index of the active GtkRadioButton.

#### Parameters

radio | Any GtkRadioButton of the group |

#### Returns

An integer, or -1

### gtk_radio_button_set_active ()

    void
    gtk_radio_button_set_active (GtkRadioButton *radio,
                                 guint index);

Sets the active item of the radio group.

#### Parameters

radio | Any GtkRadioButton of the group |
index | The index of the active item |

### gtk_tree_model_iter_prev ()

    gboolean
    gtk_tree_model_iter_prev (GtkTreeModel *tree_model,
                              GtkTreeIter *iter);

Sets `iter` to point to the node preceding it at the current level. If there is no previous `iter` , `FALSE` is returned and `iter` is set to be invalid.

#### Parameters

tree_model | A GtkTreeModel |
iter | The GtkTreeIter |

#### Returns

`TRUE`, if `iter` has been changed to the previous node

### gtk_label_set_int ()

    void
    gtk_label_set_int (GtkLabel *label,
                       gint value);

Sets the value of a GtkLabel widget.

#### Parameters

label | A GtkLabel |
value | An integer |

### gtk_label_get_int ()

    gint
    gtk_label_get_int (GtkLabel *label);

Gets the value of the `label` represented as an integer.

#### Parameters

label | A GtkLabel |

#### Returns

The value of the `label` widget

### gtk_box_get_nth_child ()

    GtkWidget *
    gtk_box_get_nth_child (GtkBox *box,
                           gint n);

Returns the `n` 'th item in `box` .

#### Parameters

box | A GtkBox |
n | The index of the desired child |

#### Returns

The nth GtkWidget, or NULL

### ogmrip_get_system_profiles_dir ()

    const gchar *
    ogmrip_get_system_profiles_dir (void);

Return the system directory containing profiles.

#### Returns

a directory, or NULL

### ogmrip_get_user_profiles_dir ()

    const gchar *
    ogmrip_get_user_profiles_dir (void);

Return the user directory containing profiles.

#### Returns

a directory, or NULL

### ogmrip_combo_box_containers_construct ()

    void
    ogmrip_combo_box_containers_construct (GtkComboBox *combo);

Configures a `combo` to store containers.

#### Parameters

combo | A GtkComboBox |

### ogmrip_combo_box_add_containers ()

    void
    ogmrip_combo_box_add_containers (GtkComboBox *combo);

Populates `combo` with all known containers.

#### Parameters

combo | A GtkComboBox |

### ogmrip_combo_box_get_active_container ()

    GType
    ogmrip_combo_box_get_active_container (GtkComboBox *combo);

Returns the selected container.

#### Parameters

combo | A GtkComboBox |

#### Returns

a container type, or G_TYPE_NONE

### ogmrip_combo_box_set_active_container ()

    void
    ogmrip_combo_box_set_active_container (GtkComboBox *combo,
                                           const gchar *container);

Selects the container with the given `name` .

#### Parameters

combo | A GtkComboBox |
container | The name of the container |

### ogmrip_combo_box_video_codecs_construct ()

    void
    ogmrip_combo_box_video_codecs_construct
                                   (GtkComboBox *combo);

Configures a `combo` to store video codecs.

#### Parameters

combo | A GtkComboBox |

### ogmrip_combo_box_add_video_codecs ()

    void
    ogmrip_combo_box_add_video_codecs (GtkComboBox *combo,
                                       GType container);

Populates `combo` with all video codecs compatible with `container` .

#### Parameters

combo | A GtkComboBox |
container | A container |

### ogmrip_combo_box_get_active_video_codec ()

    GType
    ogmrip_combo_box_get_active_video_codec
                                   (GtkComboBox *combo);

Returns the selected video codec.

#### Parameters

combo | A GtkComboBox |

#### Returns

a video type, or G_TYPE_NONE

### ogmrip_combo_box_set_active_video_codec ()

    void
    ogmrip_combo_box_set_active_video_codec
                                   (GtkComboBox *combo,
                                    const gchar *codec);

Selects the video codec with the given `name` .

#### Parameters

combo | A GtkComboBox |
codec | The name of the video codec |

### ogmrip_combo_box_audio_codecs_construct ()

    void
    ogmrip_combo_box_audio_codecs_construct
                                   (GtkComboBox *combo);

Configures a `combo` to store audio codecs.

#### Parameters

combo | A GtkComboBox |

### ogmrip_combo_box_add_audio_codecs ()

    void
    ogmrip_combo_box_add_audio_codecs (GtkComboBox *combo,
                                       GType container);

Populates `combo` with all audio codecs compatible with `container` .

#### Parameters

combo | A GtkComboBox |
container | A container |

### ogmrip_combo_box_get_active_audio_codec ()

    GType
    ogmrip_combo_box_get_active_audio_codec
                                   (GtkComboBox *combo);

Returns the selected audio codec.

#### Parameters

combo | A GtkComboBox |

#### Returns

an audio type, or G_TYPE_NONE

### ogmrip_combo_box_set_active_audio_codec ()

    void
    ogmrip_combo_box_set_active_audio_codec
                                   (GtkComboBox *combo,
                                    const gchar *codec);

Selects the audio codec with the given `name` .

#### Parameters

combo | A GtkComboBox |
codec | The name of the audio codec |

### ogmrip_combo_box_subp_codecs_construct ()

    void
    ogmrip_combo_box_subp_codecs_construct
                                   (GtkComboBox *combo);

Configures a `combo` to store subp codecs.

#### Parameters

combo | A GtkComboBox |

### ogmrip_combo_box_add_subp_codecs ()

    void
    ogmrip_combo_box_add_subp_codecs (GtkComboBox *combo,
                                      GType container);

Populates `combo` with all subp codecs compatible with `container` .

#### Parameters

combo | A GtkComboBox |
container | A container |

### ogmrip_combo_box_get_active_subp_codec ()

    GType
    ogmrip_combo_box_get_active_subp_codec
                                   (GtkComboBox *combo);

Returns the selected subp codec.

#### Parameters

combo | A GtkComboBox |

#### Returns

a subp type, or G_TYPE_NONE

### ogmrip_combo_box_set_active_subp_codec ()

    void
    ogmrip_combo_box_set_active_subp_codec
                                   (GtkComboBox *combo,
                                    const gchar *codec);

Selects the subp codec with the given `name` .

#### Parameters

combo | A GtkComboBox |
codec | The name of the subp codec |

### ogmrip_combo_box_languages_construct ()

    void
    ogmrip_combo_box_languages_construct (GtkComboBox *combo,
                                          const gchar *default_text);

Configures a `combo` to store languages.

#### Parameters

combo | a GtkComboBox |
default_text | the default text |

### ogmrip_message_dialog_new ()

    GtkWidget *
    ogmrip_message_dialog_new (GtkWindow *parent,
                               GtkMessageType type,
                               const gchar *format,
                               ...);

Creates a new message dialog, which is a simple dialog with an icon indicating the dialog type (error, warning, etc.) and some text the user may want to see.

#### Parameters

parent | A GtkWindow |
type | A GtkMessageType |
format | printf()-style format string, or NULL |
... | Arguments for `format` |

#### Returns

A new GtkMessageDialog

### ogmrip_message_dialog ()

    gint
    ogmrip_message_dialog (GtkWindow *parent,
                           GtkMessageType type,
                           const gchar *format,
                           ...);

Creates and displays a new message dialog, which is a simple dialog with an icon indicating the dialog type (error, warning, etc.) and some text the user may want to see.

#### Parameters

parent | A GtkWindow |
type | A GtkMessageType |
format | printf()-style format string, or NULL |
... | Arguments for `format` |

#### Returns

The response ID

### ogmrip_load_dvd_dialog_new ()

    GtkWidget *
    ogmrip_load_dvd_dialog_new (GtkWindow *parent,
                                OGMDvdDisc *disc,
                                const gchar *name,
                                gboolean cancellable);

Creates a dialog waiting for the given DVD to be inserted.

#### Parameters

parent | Transient parent of the dialog, or NULL |
disc | An OGMDvdDisc |
name | The name of the DVD |
cancellable | Whether the dialog is cancellable |

#### Returns

a newly created dialog

## Types and Values