[libslab/gnome-3] port to latest gtk master
- From: Michael Meeks <michael src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libslab/gnome-3] port to latest gtk master
- Date: Mon, 26 Sep 2011 13:40:05 +0000 (UTC)
commit cf2af37bb374630023d2e626ee5ca4c439667363
Author: Michael Meeks <michael meeks suse com>
Date: Mon Sep 26 14:40:38 2011 +0100
port to latest gtk master
libslab/app-resizer.c | 6 +++---
libslab/app-resizer.h | 6 +++---
libslab/app-shell.c | 44 ++++++++++++++++++++++++++++++--------------
libslab/search-bar.c | 9 +++++++--
libslab/search-bar.h | 4 ++--
libslab/search-entry.c | 5 +++--
libslab/slab-section.c | 8 ++++++--
libslab/slab-section.h | 4 ++--
8 files changed, 56 insertions(+), 30 deletions(-)
---
diff --git a/libslab/app-resizer.c b/libslab/app-resizer.c
index 199cc67..6c9fc20 100644
--- a/libslab/app-resizer.c
+++ b/libslab/app-resizer.c
@@ -258,13 +258,13 @@ app_resizer_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
}
GtkWidget *
-app_resizer_new (GtkVBox * child, gint initial_num_columns, gboolean homogeneous,
- AppShellData * app_data)
+app_resizer_new (GtkBox * child, gint initial_num_columns,
+ gboolean homogeneous, AppShellData * app_data)
{
AppResizer *widget;
g_assert (child != NULL);
- g_assert (GTK_IS_VBOX (child));
+ g_assert (GTK_IS_BOX (child));
widget = g_object_new (APP_RESIZER_TYPE, NULL);
widget->cached_element_width = -1;
diff --git a/libslab/app-resizer.h b/libslab/app-resizer.h
index 690d7ae..ed14800 100644
--- a/libslab/app-resizer.h
+++ b/libslab/app-resizer.h
@@ -43,7 +43,7 @@ struct _AppResizer
{
GtkLayout parent;
- GtkVBox *child;
+ GtkBox *child;
GList *cached_tables_list;
gint cached_element_width;
gint cached_table_spacing;
@@ -62,8 +62,8 @@ void app_resizer_set_homogeneous (AppResizer * widget, gboolean value);
void remove_container_entries (GtkContainer * widget);
GType app_resizer_get_type (void);
-GtkWidget *app_resizer_new (GtkVBox * child, gint initial_num_columns, gboolean homogeneous,
- AppShellData * app_data);
+GtkWidget *app_resizer_new (GtkBox * child, gint initial_num_columns,
+ gboolean homogeneous, AppShellData * app_data);
void app_resizer_set_table_cache (AppResizer * widget, GList * cache_list);
void app_resizer_layout_table_default (AppResizer * widget, GtkTable * table, GList * element_list);
void app_resizer_set_vadjustment_value (GtkWidget * widget, gdouble value);
diff --git a/libslab/app-shell.c b/libslab/app-shell.c
index ea6f50c..739eca6 100644
--- a/libslab/app-shell.c
+++ b/libslab/app-shell.c
@@ -254,7 +254,9 @@ layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar *
app_data->shell = shell_window_new (app_data);
app_data->static_actions = actions;
- right_vbox = gtk_vbox_new (FALSE, CATEGORY_SPACING);
+ right_vbox = gtk_box_new (FALSE, CATEGORY_SPACING);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (right_vbox),
+ GTK_ORIENTATION_VERTICAL);
num_cols = SIZING_SCREEN_WIDTH_LARGE_NUMCOLS;
if (gdk_screen_width () <= SIZING_SCREEN_WIDTH_LARGE)
@@ -265,7 +267,7 @@ layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar *
num_cols = SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS;
}
app_data->category_layout =
- app_resizer_new (GTK_VBOX (right_vbox), num_cols, TRUE, app_data);
+ app_resizer_new (GTK_BOX (right_vbox), num_cols, TRUE, app_data);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC,
@@ -283,7 +285,9 @@ layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar *
gtk_container_set_focus_vadjustment (GTK_CONTAINER (right_vbox),
gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw)));
- left_vbox = gtk_vbox_new (FALSE, 15);
+ left_vbox = gtk_box_new (FALSE, 15);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (left_vbox),
+ GTK_ORIENTATION_VERTICAL);
filter_section = create_filter_section (app_data, filter_title);
app_data->filter_section = filter_section;
@@ -305,7 +309,7 @@ static gboolean
relayout_shell_partial (gpointer user_data)
{
AppShellData *app_data = (AppShellData *) user_data;
- GtkVBox *vbox = APP_RESIZER (app_data->category_layout)->child;
+ GtkBox *vbox = APP_RESIZER (app_data->category_layout)->child;
CategoryData *data;
if (app_data->stop_incremental_relayout)
@@ -347,7 +351,7 @@ relayout_shell_partial (gpointer user_data)
static void
relayout_shell_incremental (AppShellData * app_data)
{
- GtkVBox *vbox = APP_RESIZER (app_data->category_layout)->child;
+ GtkBox *vbox = APP_RESIZER (app_data->category_layout)->child;
app_data->stop_incremental_relayout = FALSE;
app_data->filtered_out_everything = TRUE;
@@ -366,7 +370,7 @@ static void
relayout_shell (AppShellData * app_data)
{
GtkWidget *shell = app_data->shell;
- GtkVBox *vbox = APP_RESIZER (app_data->category_layout)->child;
+ GtkBox *vbox = APP_RESIZER (app_data->category_layout)->child;
populate_application_category_sections (app_data, GTK_WIDGET (vbox));
app_resizer_set_table_cache (APP_RESIZER (app_data->category_layout),
@@ -393,7 +397,10 @@ create_actions_section (AppShellData * app_data, const gchar * title,
section = slab_section_new (title, Style1);
g_object_ref (section);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (FALSE, 0);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (vbox),
+ GTK_ORIENTATION_VERTICAL);
+
slab_section_set_contents (SLAB_SECTION (section), vbox);
if (app_data->static_actions)
@@ -431,7 +438,9 @@ create_groups_section (AppShellData * app_data, const gchar * title)
section = slab_section_new (title, Style1);
g_object_ref (section);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (FALSE, 0);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (vbox),
+ GTK_ORIENTATION_VERTICAL);
slab_section_set_contents (SLAB_SECTION (section), vbox);
return section;
@@ -441,13 +450,15 @@ static void
populate_groups_section (AppShellData * app_data)
{
SlabSection *section = SLAB_SECTION (app_data->groups_section);
- GtkVBox *vbox;
+ GtkBox *vbox;
GList *cat_list;
/* Make sure our implementation has not changed and it's still a GtkVBox */
- g_assert (GTK_IS_VBOX (section->contents));
+ g_assert (GTK_IS_BOX (section->contents));
+ g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (section->contents)) ==
+ GTK_ORIENTATION_VERTICAL);
- vbox = GTK_VBOX (section->contents);
+ vbox = GTK_BOX (section->contents);
remove_container_entries (GTK_CONTAINER (vbox));
cat_list = app_data->categories_list;
@@ -717,7 +728,9 @@ create_application_category_sections (AppShellData * app_data)
g_object_ref (data->section);
g_free (markup);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (FALSE, 0);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (hbox),
+ GTK_ORIENTATION_HORIZONTAL);
table = gtk_table_new (0, 0, TRUE);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
@@ -743,7 +756,9 @@ show_no_results_message (AppShellData * app_data, GtkWidget * containing_vbox)
app_data->filtered_out_everything_widget = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
g_object_ref (app_data->filtered_out_everything_widget);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (FALSE, 0);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (hbox),
+ GTK_ORIENTATION_HORIZONTAL);
image = themed_icon_new ("face-surprise", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
@@ -804,7 +819,8 @@ populate_application_category_section (AppShellData * app_data, SlabSection * se
GtkTable *table;
GList *children;
- g_assert (GTK_IS_HBOX (section->contents));
+ g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (section->contents)) ==
+ GTK_ORIENTATION_HORIZONTAL);
hbox = GTK_WIDGET (section->contents);
children = gtk_container_get_children (GTK_CONTAINER (hbox));
diff --git a/libslab/search-bar.c b/libslab/search-bar.c
index 750ace3..d2313df 100644
--- a/libslab/search-bar.c
+++ b/libslab/search-bar.c
@@ -57,7 +57,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (NldSearchBar, nld_search_bar, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (NldSearchBar, nld_search_bar, GTK_TYPE_BOX)
static void emit_search (NldSearchBar * search_bar);
static void emit_search_callback (GtkWidget * widget, gpointer search_bar);
@@ -87,9 +87,14 @@ nld_search_bar_init (NldSearchBar * search_bar)
GtkWidget *alignment;
GtkWidget *entry;
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (search_bar),
+ GTK_ORIENTATION_VERTICAL);
+
gtk_widget_set_can_focus (GTK_WIDGET (search_bar), TRUE);
- priv->hbox = gtk_hbox_new (FALSE, 3);
+ priv->hbox = gtk_box_new (FALSE, 3);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->hbox),
+ GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (search_bar), priv->hbox, TRUE, FALSE, 0);
alignment = gtk_alignment_new (0.0, 0.5, 1.0, 0.0);
diff --git a/libslab/search-bar.h b/libslab/search-bar.h
index 35a3a77..81dab35 100644
--- a/libslab/search-bar.h
+++ b/libslab/search-bar.h
@@ -34,12 +34,12 @@ G_BEGIN_DECLS
typedef struct
{
- GtkVBox parent;
+ GtkBox parent;
} NldSearchBar;
typedef struct
{
- GtkVBoxClass parent_class;
+ GtkBoxClass parent_class;
void (*search) (NldSearchBar *, int context_id, const char *text);
} NldSearchBarClass;
diff --git a/libslab/search-entry.c b/libslab/search-entry.c
index 435eb7e..7587c01 100644
--- a/libslab/search-entry.c
+++ b/libslab/search-entry.c
@@ -21,7 +21,7 @@
#include "search-entry.h"
#include "search-entry-watermark.h"
-#include <librsvg/rsvg.h>
+/* #include <librsvg/rsvg.h> */
#include <string.h>
typedef struct
@@ -86,11 +86,12 @@ nld_search_entry_realize (GtkWidget * widget)
int height;
GdkColor *gdkcolor;
char *svg, color[7];
- RsvgHandle *rsvg;
GTK_WIDGET_CLASS (nld_search_entry_parent_class)->realize (widget);
#ifdef MORE_PORTING_FUN
+ RsvgHandle *rsvg;
+
gdk_window_get_geometry (gtk_entry_get_text_window (GTK_ENTRY (widget)),
NULL, NULL, NULL, &height, NULL);
diff --git a/libslab/slab-section.c b/libslab/slab-section.c
index b0b8d9b..2bf032c 100644
--- a/libslab/slab-section.c
+++ b/libslab/slab-section.c
@@ -20,7 +20,7 @@
#include "slab-section.h"
-G_DEFINE_TYPE (SlabSection, slab_section, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (SlabSection, slab_section, GTK_TYPE_BOX)
static void slab_section_finalize (GObject *);
@@ -36,6 +36,8 @@ slab_section_init (SlabSection * section)
{
section->title = NULL;
section->contents = NULL;
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (section),
+ GTK_ORIENTATION_VERTICAL);
}
static void
@@ -152,7 +154,9 @@ slab_section_new_with_markup (const gchar * title_markup, SlabStyle style)
}
gtk_box_pack_start (GTK_BOX (section), align, TRUE, TRUE, 0);
- section->childbox = GTK_BOX (gtk_vbox_new (FALSE, 10));
+ section->childbox = GTK_BOX (gtk_box_new (FALSE, 10));
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (section->childbox),
+ GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER (align), GTK_WIDGET (section->childbox));
section->title = gtk_label_new (title_markup);
diff --git a/libslab/slab-section.h b/libslab/slab-section.h
index 94c2c1b..5fbb3b5 100644
--- a/libslab/slab-section.h
+++ b/libslab/slab-section.h
@@ -45,7 +45,7 @@ typedef enum
typedef struct
{
- GtkVBox parent_vbox;
+ GtkBox parent_vbox;
GtkWidget *title;
GtkWidget *contents;
@@ -57,7 +57,7 @@ typedef struct
typedef struct
{
- GtkVBoxClass parent_class;
+ GtkBoxClass parent_class;
} SlabSectionClass;
GType slab_section_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]