[gnome-control-center/meego-security: 1/8] display-minimal: formatting fixes
- From: Ross Burton <rburton src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/meego-security: 1/8] display-minimal: formatting fixes
- Date: Thu, 18 Mar 2010 10:51:04 +0000 (UTC)
commit 1417610116ac397a120517d73ddb6463fb43782e
Author: Ross Burton <ross linux intel com>
Date: Thu Feb 18 12:39:37 2010 +0000
display-minimal: formatting fixes
capplets/display/cc-display-minimal-page.c | 172 +++++++++++++---------------
1 files changed, 81 insertions(+), 91 deletions(-)
---
diff --git a/capplets/display/cc-display-minimal-page.c b/capplets/display/cc-display-minimal-page.c
index e8b4c44..e9cf66d 100644
--- a/capplets/display/cc-display-minimal-page.c
+++ b/capplets/display/cc-display-minimal-page.c
@@ -50,9 +50,9 @@ typedef enum {
} OutputMode;
enum {
- COL_MODE = 0,
- COL_NAME = 1,
- COL_END = -1
+ COL_MODE = 0,
+ COL_NAME = 1,
+ COL_END = -1
};
struct CcDisplayPagePrivate
@@ -95,15 +95,6 @@ static void apply_configuration_returned_cb (DBusGProxy *proxy, DBusGProxyCa
G_DEFINE_TYPE (CcDisplayPage, cc_display_page, CC_TYPE_PAGE)
-
-typedef struct
-{
- int grab_x;
- int grab_y;
- int output_x;
- int output_y;
-} GrabInfo;
-
static void
error_message (CcDisplayPage *page,
const char *primary_text,
@@ -382,10 +373,10 @@ on_apply_button_clicked (GtkButton *button,
}
typedef struct {
- GnomeRRMode *mode;
- gboolean found;
- GtkTreeIter iter;
- GnomeRRMode *found_mode;
+ GnomeRRMode *mode;
+ gboolean found;
+ GtkTreeIter iter;
+ GnomeRRMode *found_mode;
} FindData;
/*
@@ -394,86 +385,86 @@ typedef struct {
*/
static gboolean
find_mode (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data)
{
- FindData *data = user_data;
- GnomeRRMode *mode = NULL;
- int width, height;
-
- g_assert (data->mode);
- g_assert (!data->found);
-
- width = gnome_rr_mode_get_width (data->mode);
- height = gnome_rr_mode_get_height (data->mode);
-
- gtk_tree_model_get (model, iter, COL_MODE, &mode, COL_END);
- g_assert (mode);
-
- if (gnome_rr_mode_get_width (mode) == width &&
- gnome_rr_mode_get_height (mode) == height) {
- data->found = TRUE;
- data->iter = *iter;
- data->found_mode = mode;
- return TRUE;
- } else {
- return FALSE;
- }
+ FindData *data = user_data;
+ GnomeRRMode *mode = NULL;
+ int width, height;
+
+ g_assert (data->mode);
+ g_assert (!data->found);
+
+ width = gnome_rr_mode_get_width (data->mode);
+ height = gnome_rr_mode_get_height (data->mode);
+
+ gtk_tree_model_get (model, iter, COL_MODE, &mode, COL_END);
+ g_assert (mode);
+
+ if (gnome_rr_mode_get_width (mode) == width &&
+ gnome_rr_mode_get_height (mode) == height) {
+ data->found = TRUE;
+ data->iter = *iter;
+ data->found_mode = mode;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
}
static void
update_resolutions (CcDisplayPage *page)
{
- GnomeRROutput *output;
- GnomeRRMode **modes, *current_mode;
- int i;
-
- gtk_list_store_clear (GTK_LIST_STORE (page->priv->resolution_store));
-
- output = gnome_rr_screen_get_output_by_name (page->priv->screen, page->priv->external_output->name);
- modes = gnome_rr_output_list_modes (output);
- current_mode = gnome_rr_output_get_current_mode (output);
-
- for (i = 0; modes[i] != NULL; i++) {
- GnomeRRMode *mode = modes[i];
- char *s;
- FindData data;
-
- /* Skip modes that are too small for our UX */
- if (gnome_rr_mode_get_width (mode) < 1024 ||
- gnome_rr_mode_get_height (mode) < 576)
- continue;
-
- data.mode = mode;
- data.found = FALSE;
-
- /* See if this have this resolution already in the store */
- gtk_tree_model_foreach (page->priv->resolution_store, find_mode, &data);
- if (data.found) {
- /* This resolution is already in the store. If this mode is a higher
- refresh than the one in the store, replace it */
- if (gnome_rr_mode_get_freq (data.found_mode) <
- gnome_rr_mode_get_freq (mode)) {
- gtk_list_store_set (GTK_LIST_STORE (page->priv->resolution_store), &data.iter,
- COL_MODE, mode, COL_END);
- }
- } else {
- /* This resolution isn't in the store, add it */
- s = g_strdup_printf ("%dx%d",
- gnome_rr_mode_get_width (mode),
- gnome_rr_mode_get_height (mode));
-
- gtk_list_store_insert_with_values (GTK_LIST_STORE (page->priv->resolution_store), &data.iter, -1,
- COL_MODE, mode, COL_NAME, s, COL_END);
- g_free (s);
- }
-
- /* If this mode is the current mode, active it */
- if (mode == current_mode) {
- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (page->priv->resolution_combo), &data.iter);
- }
- }
+ GnomeRROutput *output;
+ GnomeRRMode **modes, *current_mode;
+ int i;
+
+ gtk_list_store_clear (GTK_LIST_STORE (page->priv->resolution_store));
+
+ output = gnome_rr_screen_get_output_by_name (page->priv->screen, page->priv->external_output->name);
+ modes = gnome_rr_output_list_modes (output);
+ current_mode = gnome_rr_output_get_current_mode (output);
+
+ for (i = 0; modes[i] != NULL; i++) {
+ GnomeRRMode *mode = modes[i];
+ char *s;
+ FindData data;
+
+ /* Skip modes that are too small for our UX */
+ if (gnome_rr_mode_get_width (mode) < 1024 ||
+ gnome_rr_mode_get_height (mode) < 576)
+ continue;
+
+ data.mode = mode;
+ data.found = FALSE;
+
+ /* See if this have this resolution already in the store */
+ gtk_tree_model_foreach (page->priv->resolution_store, find_mode, &data);
+ if (data.found) {
+ /* This resolution is already in the store. If this mode is a higher
+ refresh than the one in the store, replace it */
+ if (gnome_rr_mode_get_freq (data.found_mode) <
+ gnome_rr_mode_get_freq (mode)) {
+ gtk_list_store_set (GTK_LIST_STORE (page->priv->resolution_store), &data.iter,
+ COL_MODE, mode, COL_END);
+ }
+ } else {
+ /* This resolution isn't in the store, add it */
+ s = g_strdup_printf ("%dx%d",
+ gnome_rr_mode_get_width (mode),
+ gnome_rr_mode_get_height (mode));
+
+ gtk_list_store_insert_with_values (GTK_LIST_STORE (page->priv->resolution_store), &data.iter, -1,
+ COL_MODE, mode, COL_NAME, s, COL_END);
+ g_free (s);
+ }
+
+ /* If this mode is the current mode, active it */
+ if (mode == current_mode) {
+ gtk_combo_box_set_active_iter (GTK_COMBO_BOX (page->priv->resolution_combo), &data.iter);
+ }
+ }
}
static void
@@ -652,7 +643,6 @@ cc_display_page_constructor (GType type,
GObjectConstructParam *construct_properties)
{
CcDisplayPage *display_page;
- g_debug (__FUNCTION__);
display_page = CC_DISPLAY_PAGE (G_OBJECT_CLASS (cc_display_page_parent_class)->constructor (type,
n_construct_properties,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]