[planner] Remove deprecated GTK_WIDGET_*.
- From: Luis Menina <lmenina src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner] Remove deprecated GTK_WIDGET_*.
- Date: Tue, 5 Mar 2013 17:12:14 +0000 (UTC)
commit 6bad1c8764d27035e324c6f4f98f19887ac80908
Author: Luis Menina <liberforce freeside fr>
Date: Sat Mar 2 13:27:01 2013 +0100
Remove deprecated GTK_WIDGET_*.
Removed symbols:
GTK_WIDGET_SET_FLAGS
GTK_WIDGET_REALIZED
GTK_WIDGET_HAS_FOCUS
GTK_WIDGET_DRAWABLE
GTK_WIDGET_MAPPED
GTK_WIDGET_STATE
GTK_WIDGET_NO_WINDOW
GTK_WIDGET_HAS_GRAB
https://bugzilla.gnome.org/show_bug.cgi?id=575129
src/planner-calendar.c | 66 +++++++++++++++++++++---------------------
src/planner-column-dialog.c | 4 +-
src/planner-gantt-chart.c | 6 ++--
src/planner-gantt-header.c | 10 +++---
src/planner-group-dialog.c | 2 +-
src/planner-popup-button.c | 4 +-
src/planner-popup-entry.c | 2 +-
src/planner-resource-view.c | 4 +-
src/planner-task-tree.c | 6 ++--
src/planner-usage-chart.c | 6 ++--
src/planner-usage-tree.c | 2 +-
11 files changed, 56 insertions(+), 56 deletions(-)
---
diff --git a/src/planner-calendar.c b/src/planner-calendar.c
index a1a2b44..33aece8 100644
--- a/src/planner-calendar.c
+++ b/src/planner-calendar.c
@@ -176,19 +176,19 @@ dates_difference(N_int year1, N_int mm1, N_int dd1,
#define DAY_YSEP 0 /* not really good for small calendar */
/* Color usage */
-#define HEADER_FG_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)])
-#define HEADER_BG_COLOR(widget) (& (widget)->style->bg[GTK_WIDGET_STATE (widget)])
-#define SELECTED_BG_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_HAS_FOCUS (widget) ?
GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
-#define SELECTED_FG_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_HAS_FOCUS (widget) ?
GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
-#define NORMAL_DAY_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)])
-#define PREV_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
-#define NEXT_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
-#define MARKED_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)])
-#define BACKGROUND_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_STATE (widget)])
-#define HIGHLIGHT_BACK_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
-
-#define SHADED_BG_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
-#define STRIPED_BG_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
+#define HEADER_FG_COLOR(widget) (& (widget)->style->fg[gtk_widget_get_state (widget)])
+#define HEADER_BG_COLOR(widget) (& (widget)->style->bg[gtk_widget_get_state (widget)])
+#define SELECTED_BG_COLOR(widget) (& (widget)->style->base[gtk_widget_has_focus (widget) ?
GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
+#define SELECTED_FG_COLOR(widget) (& (widget)->style->text[gtk_widget_has_focus (widget) ?
GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
+#define NORMAL_DAY_COLOR(widget) (& (widget)->style->fg[gtk_widget_get_state (widget)])
+#define PREV_MONTH_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
+#define NEXT_MONTH_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
+#define MARKED_COLOR(widget) (& (widget)->style->fg[gtk_widget_get_state (widget)])
+#define BACKGROUND_COLOR(widget) (& (widget)->style->base[gtk_widget_get_state (widget)])
+#define HIGHLIGHT_BACK_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
+
+#define SHADED_BG_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
+#define STRIPED_BG_COLOR(widget) (& (widget)->style->mid[gtk_widget_get_state (widget)])
enum {
ARROW_YEAR_LEFT,
@@ -442,7 +442,7 @@ planner_calendar_init (PlannerCalendar *calendar)
PlannerCalendarPrivateData *private_data;
widget = GTK_WIDGET (calendar);
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (widget, TRUE);
calendar->private_data = g_malloc (sizeof (PlannerCalendarPrivateData));
private_data = PLANNER_CALENDAR_PRIVATE_DATA (calendar);
@@ -831,7 +831,7 @@ planner_calendar_main_button (GtkWidget *widget,
else if (day_month == MONTH_NEXT)
planner_calendar_set_month_next (calendar);
- if (!GTK_WIDGET_HAS_FOCUS (widget))
+ if (! gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
planner_calendar_select_and_focus_day (calendar, day);
@@ -1051,7 +1051,7 @@ planner_calendar_realize (GtkWidget *widget)
calendar = PLANNER_CALENDAR (widget);
private_data = PLANNER_CALENDAR_PRIVATE_DATA (widget);
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
planner_calendar_compute_days (calendar);
attributes.x = widget->allocation.x;
@@ -1360,7 +1360,7 @@ planner_calendar_size_allocate (GtkWidget *widget,
private_data->week_width = 0;
}
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
@@ -1428,7 +1428,7 @@ planner_calendar_expose (GtkWidget *widget,
private_data = PLANNER_CALENDAR_PRIVATE_DATA (widget);
- if (GTK_WIDGET_DRAWABLE (widget))
+ if (gtk_widget_is_drawable (widget))
{
if (event->window == private_data->main_win)
planner_calendar_paint_main (widget);
@@ -1443,7 +1443,7 @@ planner_calendar_expose (GtkWidget *widget,
planner_calendar_paint_week_numbers (widget);
if (event->window == widget->window)
{
- gtk_paint_shadow (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+ gtk_paint_shadow (widget->style, widget->window, gtk_widget_get_state (widget),
GTK_SHADOW_IN, NULL, widget, "calendar",
0, 0, widget->allocation.width, widget->allocation.height);
}
@@ -1876,7 +1876,7 @@ planner_calendar_paint_day (GtkWidget *widget,
if (calendar->selected_day == day)
gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (GTK_WIDGET (calendar)));
else
- gdk_gc_set_foreground (gc, & (GTK_WIDGET (calendar)->style->fg[GTK_WIDGET_STATE
(calendar)]));
+ gdk_gc_set_foreground (gc, & (GTK_WIDGET (calendar)->style->fg[gtk_widget_get_state
(GTK_WIDGET (calendar))]));
}
@@ -1901,7 +1901,7 @@ planner_calendar_paint_day (GtkWidget *widget,
break;
}
- if (GTK_WIDGET_HAS_FOCUS (calendar)
+ if (gtk_widget_has_focus (GTK_WIDGET (calendar))
&& calendar->focus_row == row && calendar->focus_col == col)
{
gtk_paint_focus (widget->style,
@@ -2045,7 +2045,7 @@ planner_calendar_display_options (PlannerCalendar *calendar,
widget = GTK_WIDGET (calendar);
private_data = PLANNER_CALENDAR_PRIVATE_DATA (calendar);
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
if ((flags ^ calendar->display_flags) & PLANNER_CALENDAR_NO_MONTH_CHANGE)
{
@@ -2192,7 +2192,7 @@ planner_calendar_select_day (PlannerCalendar *calendar,
selected_day = calendar->selected_day;
calendar->selected_day = 0;
- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
planner_calendar_paint_day_num (GTK_WIDGET (calendar), selected_day);
}
@@ -2201,7 +2201,7 @@ planner_calendar_select_day (PlannerCalendar *calendar,
/* Select the new day */
if (day != 0)
{
- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
planner_calendar_paint_day_num (GTK_WIDGET (calendar), day);
}
@@ -2250,7 +2250,7 @@ planner_calendar_clear_marks (PlannerCalendar *calendar)
calendar->num_marked_dates = 0;
- if (GTK_WIDGET_DRAWABLE (calendar))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
{
planner_calendar_paint_main (GTK_WIDGET (calendar));
}
@@ -2268,7 +2268,7 @@ planner_calendar_unmark_day (PlannerCalendar *calendar,
calendar->num_marked_dates--;
}
- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
{
planner_calendar_paint_main (GTK_WIDGET (calendar));
}
@@ -2515,19 +2515,19 @@ planner_calendar_thaw (PlannerCalendar *calendar)
if (!(--private_data->freeze_count))
{
if (private_data->dirty_header)
- if (GTK_WIDGET_DRAWABLE (calendar))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
planner_calendar_paint_header (GTK_WIDGET (calendar));
if (private_data->dirty_day_names)
- if (GTK_WIDGET_DRAWABLE (calendar))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
planner_calendar_paint_day_names (GTK_WIDGET (calendar));
if (private_data->dirty_week)
- if (GTK_WIDGET_DRAWABLE (calendar))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
planner_calendar_paint_week_numbers (GTK_WIDGET (calendar));
if (private_data->dirty_main)
- if (GTK_WIDGET_DRAWABLE (calendar))
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
planner_calendar_paint_main (GTK_WIDGET (calendar));
}
}
@@ -2540,7 +2540,7 @@ planner_calendar_set_background (GtkWidget *widget)
private_data = PLANNER_CALENDAR_PRIVATE_DATA (widget);
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
for (i = 0; i < 4; i++)
{
@@ -2570,7 +2570,7 @@ static void
planner_calendar_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
- if (previous_style && GTK_WIDGET_REALIZED (widget))
+ if (previous_style && gtk_widget_get_realized (widget))
planner_calendar_set_background(widget);
}
@@ -2749,7 +2749,7 @@ planner_calendar_mark_day (PlannerCalendar *calendar,
calendar->num_marked_dates--;
}
- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar))) {
+ if (gtk_widget_is_drawable (GTK_WIDGET (calendar))) {
planner_calendar_paint_main (GTK_WIDGET (calendar));
}
}
diff --git a/src/planner-column-dialog.c b/src/planner-column-dialog.c
index 7919fde..abb5a80 100644
--- a/src/planner-column-dialog.c
+++ b/src/planner-column-dialog.c
@@ -65,13 +65,13 @@ column_dialog_update_sensitivity (DialogData *data)
down_sensitive = FALSE;
hide_sensitive = FALSE;
- if (GTK_WIDGET_HAS_FOCUS (data->hidden_tree)) {
+ if (gtk_widget_has_focus (GTK_WIDGET (data->hidden_tree))) {
hidden_sensitive = TRUE;
gtk_tree_view_get_cursor (GTK_TREE_VIEW (data->hidden_tree),
&path,
NULL);
}
- else if (GTK_WIDGET_HAS_FOCUS (data->visible_tree)) {
+ else if (gtk_widget_has_focus (GTK_WIDGET (data->visible_tree))) {
visible_sensitive = TRUE;
gtk_tree_view_get_cursor (GTK_TREE_VIEW (data->visible_tree),
&path,
diff --git a/src/planner-gantt-chart.c b/src/planner-gantt-chart.c
index 5efd9d5..a96ba2d 100644
--- a/src/planner-gantt-chart.c
+++ b/src/planner-gantt-chart.c
@@ -589,7 +589,7 @@ gantt_chart_size_allocate (GtkWidget *widget,
/* Force reflow (if we are mapped), since it looks smoother with less
* jumping around.
*/
- if (GTK_WIDGET_MAPPED (chart)) {
+ if (gtk_widget_get_mapped (GTK_WIDGET (chart))) {
planner_gantt_chart_reflow_now (chart);
}
}
@@ -1025,7 +1025,7 @@ gantt_chart_reflow_idle (PlannerGanttChart *chart)
void
planner_gantt_chart_reflow_now (PlannerGanttChart *chart)
{
- if (!GTK_WIDGET_MAPPED (chart)) {
+ if (! gtk_widget_get_mapped (GTK_WIDGET (chart))) {
return;
}
@@ -1035,7 +1035,7 @@ planner_gantt_chart_reflow_now (PlannerGanttChart *chart)
static void
gantt_chart_reflow (PlannerGanttChart *chart, gboolean height_changed)
{
- if (!GTK_WIDGET_MAPPED (chart)) {
+ if (! gtk_widget_get_mapped (GTK_WIDGET (chart))) {
return;
}
diff --git a/src/planner-gantt-header.c b/src/planner-gantt-header.c
index 82fce6f..b1229b4 100644
--- a/src/planner-gantt-header.c
+++ b/src/planner-gantt-header.c
@@ -348,7 +348,7 @@ gantt_header_set_property (GObject *object,
priv->height);
}
- if ((change_width || change_height || change_scale) && GTK_WIDGET_REALIZED (header)) {
+ if ((change_width || change_height || change_scale) && gtk_widget_get_realized (GTK_WIDGET (header)))
{
gdk_window_invalidate_rect (priv->bin_window,
NULL,
FALSE);
@@ -401,7 +401,7 @@ gantt_header_map (GtkWidget *widget)
header = PLANNER_GANTT_HEADER (widget);
- GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+ gtk_widget_set_mapped (widget, TRUE);
gdk_window_show (header->priv->bin_window);
gdk_window_show (widget->window);
@@ -416,7 +416,7 @@ gantt_header_realize (GtkWidget *widget)
header = PLANNER_GANTT_HEADER (widget);
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
/* Create the main, clipping window. */
attributes.window_type = GDK_WINDOW_CHILD;
@@ -485,7 +485,7 @@ gantt_header_size_allocate (GtkWidget *widget,
header = PLANNER_GANTT_HEADER (widget);
- if (GTK_WIDGET_REALIZED (widget)) {
+ if (gtk_widget_get_realized (widget)) {
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
@@ -724,7 +724,7 @@ static void
gantt_header_adjustment_changed (GtkAdjustment *adjustment,
PlannerGanttHeader *header)
{
- if (GTK_WIDGET_REALIZED (header)) {
+ if (gtk_widget_get_realized (GTK_WIDGET (header))) {
gdk_window_move (header->priv->bin_window,
-header->priv->hadjustment->value,
0);
diff --git a/src/planner-group-dialog.c b/src/planner-group-dialog.c
index c41705d..45bf994 100644
--- a/src/planner-group-dialog.c
+++ b/src/planner-group-dialog.c
@@ -333,7 +333,7 @@ group_dialog_insert_group_cb (GtkWidget *button, GtkWidget *dialog)
cmd = (GroupCmdInsert*) group_cmd_insert (data->view);
- if (!GTK_WIDGET_HAS_FOCUS (data->tree_view)) {
+ if (! gtk_widget_has_focus (GTK_WIDGET (data->tree_view))) {
gtk_widget_grab_focus (GTK_WIDGET (data->tree_view));
}
diff --git a/src/planner-popup-button.c b/src/planner-popup-button.c
index 71fc068..df317ed 100644
--- a/src/planner-popup-button.c
+++ b/src/planner-popup-button.c
@@ -204,7 +204,7 @@ popup_button_position (PlannerPopupButton *button,
gdk_window_get_origin (button_widget->window, x, y);
- if (GTK_WIDGET_NO_WINDOW (button_widget)) {
+ if (! gtk_widget_get_has_window (button_widget)) {
*x += button_widget->allocation.x;
*y += button_widget->allocation.y;
}
@@ -292,7 +292,7 @@ popup_button_popdown (PlannerPopupButton *button,
g_object_unref (priv->popup_widget);
priv->popup_widget = NULL;
- if (GTK_WIDGET_HAS_GRAB (priv->popup_window)) {
+ if (gtk_widget_has_grab (priv->popup_window)) {
gtk_grab_remove (priv->popup_window);
gdk_keyboard_ungrab (GDK_CURRENT_TIME);
gdk_pointer_ungrab (GDK_CURRENT_TIME);
diff --git a/src/planner-popup-entry.c b/src/planner-popup-entry.c
index 5661196..d8a0594 100644
--- a/src/planner-popup-entry.c
+++ b/src/planner-popup-entry.c
@@ -102,7 +102,7 @@ planner_popup_entry_init (PlannerPopupEntry *widget)
gtk_container_add (GTK_CONTAINER (widget), widget->hbox);
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (GTK_WIDGET (widget), TRUE);
gtk_widget_add_events (GTK_WIDGET (widget), GDK_KEY_PRESS_MASK);
gtk_widget_add_events (GTK_WIDGET (widget), GDK_KEY_RELEASE_MASK);
}
diff --git a/src/planner-resource-view.c b/src/planner-resource-view.c
index d1f4cc3..ec89365 100644
--- a/src/planner-resource-view.c
+++ b/src/planner-resource-view.c
@@ -508,7 +508,7 @@ resource_view_column_notify_width_cb (GtkWidget *column,
GParamSpec *spec,
PlannerResourceView *view)
{
- if (GTK_WIDGET_REALIZED (view->priv->tree_view)) {
+ if (gtk_widget_get_realized (GTK_WIDGET (view->priv->tree_view))) {
g_signal_emit_by_name (view->priv->tree_view, "columns-changed");
}
}
@@ -866,7 +866,7 @@ resource_view_insert_resource_cb (GtkAction *action,
cmd = (ResourceCmdInsert*) planner_resource_cmd_insert (view->main_window, NULL);
- if (!GTK_WIDGET_HAS_FOCUS (priv->tree_view)) {
+ if (! gtk_widget_has_focus (GTK_WIDGET (priv->tree_view))) {
gtk_widget_grab_focus (GTK_WIDGET (priv->tree_view));
}
diff --git a/src/planner-task-tree.c b/src/planner-task-tree.c
index a59deab..68be61e 100644
--- a/src/planner-task-tree.c
+++ b/src/planner-task-tree.c
@@ -2320,7 +2320,7 @@ task_tree_column_notify_width_cb (GtkWidget *column,
GParamSpec *spec,
PlannerTaskTree *tree)
{
- if (GTK_WIDGET_REALIZED (tree)) {
+ if (gtk_widget_get_realized (GTK_WIDGET (tree))) {
g_signal_emit_by_name (tree, "columns-changed");
}
}
@@ -2670,7 +2670,7 @@ planner_task_tree_insert_subtask (PlannerTaskTree *tree)
planner_task_cmd_insert (tree->priv->main_window,
parent, position, work, work, NULL);
- if (!GTK_WIDGET_HAS_FOCUS (tree)) {
+ if (! gtk_widget_has_focus (GTK_WIDGET (tree))) {
gtk_widget_grab_focus (GTK_WIDGET (tree));
}
@@ -2759,7 +2759,7 @@ planner_task_tree_insert_task (PlannerTaskTree *tree)
planner_task_cmd_insert (tree->priv->main_window,
parent, position, work, work, NULL);
- if (!GTK_WIDGET_HAS_FOCUS (tree)) {
+ if (! gtk_widget_has_focus (GTK_WIDGET (tree))) {
gtk_widget_grab_focus (GTK_WIDGET (tree));
}
diff --git a/src/planner-usage-chart.c b/src/planner-usage-chart.c
index 27be545..a9db4f5 100644
--- a/src/planner-usage-chart.c
+++ b/src/planner-usage-chart.c
@@ -693,7 +693,7 @@ usage_chart_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
chart = PLANNER_USAGE_CHART (widget);
- if (GTK_WIDGET_MAPPED (chart)) {
+ if (gtk_widget_get_mapped (GTK_WIDGET (chart))) {
usage_chart_reflow_now (chart);
}
}
@@ -864,7 +864,7 @@ usage_chart_reflow_idle (PlannerUsageChart *chart)
static void
usage_chart_reflow_now (PlannerUsageChart *chart)
{
- if (!GTK_WIDGET_MAPPED (chart)) {
+ if (! gtk_widget_get_mapped (GTK_WIDGET (chart))) {
return;
}
@@ -874,7 +874,7 @@ usage_chart_reflow_now (PlannerUsageChart *chart)
static void
usage_chart_reflow (PlannerUsageChart *chart, gboolean height_changed)
{
- if (!GTK_WIDGET_MAPPED (chart)) {
+ if (! gtk_widget_get_mapped (GTK_WIDGET (chart))) {
return;
}
diff --git a/src/planner-usage-tree.c b/src/planner-usage-tree.c
index 0351ee9..4afeff1 100644
--- a/src/planner-usage-tree.c
+++ b/src/planner-usage-tree.c
@@ -300,7 +300,7 @@ usage_tree_column_notify_width_cb (GtkWidget *column,
GParamSpec *spec,
PlannerUsageTree *tree)
{
- if (GTK_WIDGET_REALIZED (tree)) {
+ if (gtk_widget_get_realized (GTK_WIDGET (tree))) {
g_signal_emit_by_name (tree, "columns-changed");
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]