~ubuntu-branches/ubuntu/maverick/zapping/maverick

« back to all changes in this revision

Viewing changes to src/properties.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-03-08 23:19:08 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050308231908-oip7rfv6lcmo8c0e
Tags: 0.9.2-2ubuntu1
Rebuilt for Python transition (2.3 -> 2.4)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef __PROPERTIES_H__
2
2
#define __PROPERTIES_H__
3
3
 
 
4
#include <gtk/gtk.h>
 
5
 
4
6
/* A module handling a toplevel property page (new version) */
5
7
typedef struct {
6
8
  /* Add a property page to the properties dialog */
7
 
  void (*add) ( GnomeDialog *dialog );
 
9
  void (*add) ( GtkDialog *dialog );
8
10
  /* Called when the OK or Apply buttons are pressed for a modified
9
11
     page. @page is the modified page */
10
 
  void (*apply) ( GnomeDialog *dialog, GtkWidget *page );
 
12
  void (*apply) ( GtkDialog *dialog, GtkWidget *page );
11
13
  /* Called when the help button is pressed */
12
 
  void (*help) ( GnomeDialog *dialog, GtkWidget *page );
 
14
  void (*help) ( GtkDialog *dialog, GtkWidget *page );
13
15
  /* Called when the Cancel button is pressed for a modified
14
16
     page. @page is the modified page */
15
 
  void (*cancel) ( GnomeDialog *dialog, GtkWidget *page );
 
17
  void (*cancel) ( GtkDialog *dialog, GtkWidget *page );
16
18
} property_handler;
17
19
 
18
20
/* Register a set of callbacks to manage the properties */
19
21
/* prepend/append refer to the order in which the handlers are called
20
22
   to build the properties */
21
 
void prepend_property_handler (property_handler *p);
22
 
void append_property_handler (property_handler *p);
 
23
void prepend_property_handler (const property_handler *p);
 
24
void append_property_handler (const property_handler *p);
23
25
 
24
26
/**
25
27
 * Create a group with the given name.
26
28
 * @group: Name for the group.
27
29
 */
28
30
void
29
 
append_properties_group         (GnomeDialog    *dialog,
30
 
                                 const gchar    *group);
 
31
append_properties_group         (GtkDialog      *dialog,
 
32
                                 const gchar    *group,
 
33
                                 const gchar * group_i18n);
31
34
 
32
35
/**
33
36
 * Sets up a properties dialog.
37
40
 
38
41
/**
39
42
 * Opens a created group.
40
 
 * @group: Name you gave the group when creating it.
 
43
 * @group: Name you gave the group when creating it (not localized).
41
44
 */
42
45
void
43
46
open_properties_group           (GtkWidget      *dialog,
53
56
 
54
57
/**
55
58
 * Appends to the dialog group the given page.
56
 
 * @group: Name of the group this page belongs to.
 
59
 * @group: Name of the group this page belongs to (not localized).
57
60
 * @label: Name you wish to give to this group.
58
61
 * @pixmap: Pixmap to show with the label, can be %NULL.
59
62
 * @page: The page contents.
60
63
 */
61
64
void
62
 
append_properties_page          (GnomeDialog    *dialog,
 
65
append_properties_page          (GtkDialog      *dialog,
63
66
                                 const gchar    *group,
64
67
                                 const gchar    *label,
65
68
                                 GtkWidget      *pixmap,
102
105
typedef struct {
103
106
  /* Label for the entry */
104
107
  const gchar   *label;
105
 
  /* Source of the icon (we use both GNOME and Z icons for the moment) */
106
 
  enum {
107
 
    ICON_ZAPPING,
108
 
    ICON_GNOME
109
 
  } icon_source;
110
 
  const gchar   *icon_name; /* relative to PACKAGE_PIXMAPS_DIR or
111
 
                               gnome_pixmap_file */
 
108
  const gchar   *icon_name; /* relative to the pixmaps installation dir */
112
109
  const gchar   *widget; /* Notebook page to use (must be in zapping.glade) */
113
110
  /* Apply the current config to the dialog */
114
111
  void          (*setup)(GtkWidget *widget);
120
117
  void          (*help)(GtkWidget *widget);
121
118
  /* See apply */
122
119
  void          (*cancel)(GtkWidget *widget);
 
120
  /* Link id in zapping.xml, instead of help handler. */
 
121
  const gchar *help_link_id;
 
122
  /* Function to create preferences instead of glade file name
 
123
     in standard_properties_add(), .widget and .setup above. */
 
124
  GtkWidget *   (*create)(void);
123
125
} SidebarEntry;
124
126
 
125
127
typedef struct {
131
133
  gint num_items;
132
134
} SidebarGroup;
133
135
 
134
 
#ifndef acount
135
 
#define acount(x) ((sizeof(x))/(sizeof(x[0])))
136
 
#endif
137
 
 
138
136
/**
139
137
 * Add the groups/items that groups contains.
140
138
 * @dialog: The properties dialog.
143
141
 * @glade_file: glade file containing the widgets.
144
142
 */
145
143
void
146
 
standard_properties_add         (GnomeDialog    *dialog,
147
 
                                 SidebarGroup   *groups,
 
144
standard_properties_add         (GtkDialog      *dialog,
 
145
                                 const SidebarGroup *   groups,
148
146
                                 gint           num_groups,
149
147
                                 const gchar    *glade_file);
150
148