~aurelien-riv/livewallpaper/snap

« back to all changes in this revision

Viewing changes to livewallpaper-config/src/widgets.h

  • Committer: Aurélien RIVIÈRE
  • Date: 2012-08-28 19:56:47 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: aurelien.riv@gmail.com-20120828195647-ejhhshrh5fsyumuu
config manager added

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  widgets.h - this file is part of the LiveWallpapers.
 
2
    Copyright 2012 RIVIÈRE Aurélien <aurelien.riv@gmail.com>
 
3
 
 
4
    This program is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 3 of the License, or
 
7
    (at your option) any later version.
 
8
    This program is distributed in the hope that it will be useful,
 
9
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
    GNU General Public License for more details.
 
12
    You should have received a copy of the GNU General Public License
 
13
    along with this program; if not, write to the Free Software
 
14
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
15
    MA 02110-1301, USA.
 
16
*/
 
17
 
 
18
#ifndef WDGT_H
 
19
#define WDGT_H
 
20
 
 
21
#include "main.h"
 
22
#include <ctype.h>
 
23
 
 
24
#define BOX()                                                                                                               \
 
25
    tmpBox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);                   \
 
26
    gtk_widget_set_tooltip_text (tmpBox, _(gkey->description));                         \
 
27
    gtk_box_pack_start (GTK_BOX(tmpBox),                                    \
 
28
                        gtk_label_new (_(gkey->summary)), FALSE, FALSE, 8); \
 
29
                                                                            \
 
30
    ctl = gtk_button_new_from_stock (GTK_STOCK_CLEAR);                      \
 
31
    gtk_widget_set_tooltip_text (ctl, _("Reset key to the default value")); \
 
32
    gtk_button_set_focus_on_click (GTK_BUTTON(ctl), FALSE);                 \
 
33
    g_object_set_data(G_OBJECT(ctl), "key", g_strdup(gkey->name));                      \
 
34
        g_signal_connect (ctl, "clicked", (GCallback)reset_key, settings);          \
 
35
                                                                            \
 
36
    gtk_box_pack_end (GTK_BOX(tmpBox), ctl, FALSE, FALSE, 8);               \
 
37
    gtk_box_pack_start (box, tmpBox, FALSE, FALSE, 0);
 
38
 
 
39
void add_tab   (GtkNotebook *, GtkWidget *, gchar *);
 
40
void add_key   (GSettings *, GtkBox *, Key *);
 
41
void reset_key (GtkWidget *, GSettings *);
 
42
 
 
43
void cb_bind_set_value (GtkWidget *, GSettings *);
 
44
void cb_bind_get_value (GSettings *, gchar *, GtkWidget *);
 
45
 
 
46
#endif