Use accessor functions instead direct access
https://bugzilla.gnome.org/show_bug.cgi?id=597888
This commit is contained in:
parent
133fce3ac2
commit
c2211ffe0b
23 changed files with 312 additions and 301 deletions
|
@ -328,22 +328,22 @@ image_drag_data_received_cb (GtkWidget *widget,
|
|||
GtkSelectionData *selection_data,
|
||||
guint info, guint time, EImageChooser *chooser)
|
||||
{
|
||||
|
||||
char *target_type;
|
||||
gboolean handled = FALSE;
|
||||
|
||||
target_type = gdk_atom_name (selection_data->target);
|
||||
target_type = gdk_atom_name (gtk_selection_data_get_target (selection_data));
|
||||
|
||||
if (!strcmp (target_type, URI_LIST_TYPE)) {
|
||||
const char *data = gtk_selection_data_get_data (selection_data);
|
||||
char *uri;
|
||||
GFile *file;
|
||||
GInputStream *istream;
|
||||
char *nl = strstr (selection_data->data, "\r\n");
|
||||
char *nl = strstr (data, "\r\n");
|
||||
|
||||
if (nl)
|
||||
uri = g_strndup (selection_data->data, nl - (char *) selection_data->data);
|
||||
uri = g_strndup (data, nl - (char *) data);
|
||||
else
|
||||
uri = g_strdup (selection_data->data);
|
||||
uri = g_strdup (data);
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
istream = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
|
||||
|
|
|
@ -104,7 +104,7 @@ eel_alert_dialog_class_init (EelAlertDialogClass *class)
|
|||
|
||||
gobject_class->set_property = eel_alert_dialog_set_property;
|
||||
gobject_class->get_property = eel_alert_dialog_get_property;
|
||||
|
||||
|
||||
gtk_widget_class_install_style_property (widget_class,
|
||||
g_param_spec_int ("alert_border",
|
||||
_("Image/label border"),
|
||||
|
@ -113,7 +113,7 @@ eel_alert_dialog_class_init (EelAlertDialogClass *class)
|
|||
G_MAXINT,
|
||||
5,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_ALERT_TYPE,
|
||||
g_param_spec_enum ("alert_type",
|
||||
|
@ -122,7 +122,7 @@ eel_alert_dialog_class_init (EelAlertDialogClass *class)
|
|||
GTK_TYPE_MESSAGE_TYPE,
|
||||
GTK_MESSAGE_INFO,
|
||||
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
|
||||
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_BUTTONS,
|
||||
g_param_spec_enum ("buttons",
|
||||
|
@ -187,7 +187,7 @@ eel_alert_dialog_init (EelAlertDialog *dialog)
|
|||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), dialog->details->primary_label,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), dialog->details->secondary_label,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
|
@ -196,11 +196,11 @@ eel_alert_dialog_init (EelAlertDialog *dialog)
|
|||
gtk_expander_set_spacing (GTK_EXPANDER (expander), 6);
|
||||
gtk_container_add (GTK_CONTAINER (expander), dialog->details->details_label);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), expander,
|
||||
gtk_box_pack_start (GTK_BOX (vbox), expander,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
|
||||
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (hbox);
|
||||
|
@ -214,7 +214,7 @@ setup_type (EelAlertDialog *dialog,
|
|||
{
|
||||
const gchar *stock_id = NULL;
|
||||
GtkStockItem item;
|
||||
|
||||
|
||||
switch (type) {
|
||||
case GTK_MESSAGE_INFO:
|
||||
stock_id = GTK_STOCK_DIALOG_INFO;
|
||||
|
@ -245,16 +245,16 @@ setup_type (EelAlertDialog *dialog,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
eel_alert_dialog_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
EelAlertDialog *dialog;
|
||||
|
||||
|
||||
dialog = EEL_ALERT_DIALOG (object);
|
||||
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_ALERT_TYPE:
|
||||
dialog->details->type = g_value_get_enum (value);
|
||||
|
@ -269,16 +269,16 @@ eel_alert_dialog_set_property (GObject *object,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
eel_alert_dialog_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
EelAlertDialog *dialog;
|
||||
|
||||
|
||||
dialog = EEL_ALERT_DIALOG (object);
|
||||
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_ALERT_TYPE:
|
||||
g_value_set_enum (value, dialog->details->type);
|
||||
|
@ -354,16 +354,16 @@ eel_alert_dialog_new (GtkWindow *parent,
|
|||
dialog = GTK_DIALOG (widget);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
|
||||
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
|
||||
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
|
||||
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
||||
gtk_dialog_set_has_separator (dialog, FALSE);
|
||||
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (dialog),
|
||||
(title != NULL) ? title : "");
|
||||
|
||||
eel_alert_dialog_set_primary_label (EEL_ALERT_DIALOG (dialog),
|
||||
primary_message);
|
||||
|
||||
|
||||
eel_alert_dialog_set_secondary_label (EEL_ALERT_DIALOG (dialog),
|
||||
secondary_message);
|
||||
|
||||
|
@ -397,21 +397,21 @@ eel_alert_dialog_add_buttons (EelAlertDialog* alert_dialog,
|
|||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_OK,
|
||||
GTK_RESPONSE_OK);
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
GTK_RESPONSE_OK);
|
||||
break;
|
||||
case GTK_BUTTONS_CLOSE:
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_CLOSE,
|
||||
GTK_RESPONSE_CLOSE);
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
GTK_RESPONSE_CLOSE);
|
||||
break;
|
||||
case GTK_BUTTONS_CANCEL:
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_CANCEL,
|
||||
GTK_RESPONSE_CANCEL);
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
GTK_RESPONSE_CANCEL);
|
||||
break;
|
||||
case GTK_BUTTONS_YES_NO:
|
||||
|
@ -421,7 +421,7 @@ eel_alert_dialog_add_buttons (EelAlertDialog* alert_dialog,
|
|||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_YES,
|
||||
GTK_RESPONSE_YES);
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
GTK_RESPONSE_YES);
|
||||
break;
|
||||
case GTK_BUTTONS_OK_CANCEL:
|
||||
|
@ -431,13 +431,13 @@ eel_alert_dialog_add_buttons (EelAlertDialog* alert_dialog,
|
|||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_OK,
|
||||
GTK_RESPONSE_OK);
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
gtk_dialog_set_default_response (dialog,
|
||||
GTK_RESPONSE_OK);
|
||||
break;
|
||||
default:
|
||||
g_warning ("Unknown GtkButtonsType");
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_object_notify (G_OBJECT (alert_dialog), "buttons");
|
||||
}
|
||||
|
||||
|
@ -450,7 +450,7 @@ eel_alert_dialog_style_set (GtkWidget *widget,
|
|||
|
||||
border_width = 0;
|
||||
|
||||
parent = GTK_WIDGET (EEL_ALERT_DIALOG (widget)->details->image->parent);
|
||||
parent = gtk_widget_get_parent (EEL_ALERT_DIALOG (widget)->details->image);
|
||||
|
||||
if (parent != NULL) {
|
||||
gtk_widget_style_get (widget, "alert_border",
|
||||
|
|
|
@ -220,7 +220,7 @@ delete_fingerprints_question (GtkBuilder *dialog, GtkWidget *enable, GtkWidget *
|
|||
|
||||
button = gtk_button_new_with_mnemonic (_("_Delete Fingerprints"));
|
||||
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_BUTTON));
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_set_can_default (button, TRUE);
|
||||
gtk_widget_show (button);
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (question), button, GTK_RESPONSE_OK);
|
||||
|
||||
|
|
|
@ -678,7 +678,7 @@ passdlg_set_busy (PasswordDialog *pdialog, gboolean busy)
|
|||
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
|
||||
}
|
||||
|
||||
gdk_window_set_cursor (toplevel->window, cursor);
|
||||
gdk_window_set_cursor (gtk_widget_get_window (toplevel), cursor);
|
||||
gdk_display_flush (display);
|
||||
|
||||
if (busy) {
|
||||
|
|
|
@ -707,7 +707,7 @@ wp_drag_received (GtkWidget *widget,
|
|||
GSList *realuris = NULL;
|
||||
gchar **uris;
|
||||
|
||||
uris = g_uri_list_extract_uris ((gchar *) selection_data->data);
|
||||
uris = g_uri_list_extract_uris ((gchar *) gtk_selection_data_get_data (selection_data));
|
||||
if (uris != NULL)
|
||||
{
|
||||
GtkWidget *w;
|
||||
|
@ -1051,20 +1051,21 @@ static void
|
|||
create_button_images (AppearanceData *data)
|
||||
{
|
||||
GtkWidget *widget = (GtkWidget*)data->wp_view;
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
GtkIconSet *icon_set;
|
||||
GdkPixbuf *pixbuf, *pb, *pb2;
|
||||
gint i, w, h;
|
||||
|
||||
icon_set = gtk_style_lookup_icon_set (widget->style, "gtk-media-play");
|
||||
icon_set = gtk_style_lookup_icon_set (style, "gtk-media-play");
|
||||
pb = gtk_icon_set_render_icon (icon_set,
|
||||
widget->style,
|
||||
style,
|
||||
GTK_TEXT_DIR_RTL,
|
||||
GTK_STATE_NORMAL,
|
||||
GTK_ICON_SIZE_MENU,
|
||||
widget,
|
||||
NULL);
|
||||
pb2 = gtk_icon_set_render_icon (icon_set,
|
||||
widget->style,
|
||||
style,
|
||||
GTK_TEXT_DIR_LTR,
|
||||
GTK_STATE_NORMAL,
|
||||
GTK_ICON_SIZE_MENU,
|
||||
|
|
|
@ -91,21 +91,26 @@ static void
|
|||
sample_expose (GtkWidget *darea,
|
||||
GdkEventExpose *expose)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GdkPixbuf *pixbuf = g_object_get_data (G_OBJECT (darea), "sample-pixbuf");
|
||||
GdkWindow *window = gtk_widget_get_window (darea);
|
||||
GtkStyle *style = gtk_widget_get_style (darea);
|
||||
int width = gdk_pixbuf_get_width (pixbuf);
|
||||
int height = gdk_pixbuf_get_height (pixbuf);
|
||||
int x;
|
||||
int y;
|
||||
|
||||
int x = (darea->allocation.width - width) / 2;
|
||||
int y = (darea->allocation.height - height) / 2;
|
||||
|
||||
gdk_draw_rectangle (darea->window, darea->style->white_gc, TRUE,
|
||||
gtk_widget_get_allocation (darea, &allocation);
|
||||
x = (allocation.width - width) / 2;
|
||||
y = (allocation.height - height) / 2;
|
||||
gdk_draw_rectangle (window, style->white_gc, TRUE,
|
||||
0, 0,
|
||||
darea->allocation.width, darea->allocation.height);
|
||||
gdk_draw_rectangle (darea->window, darea->style->black_gc, FALSE,
|
||||
allocation.width, allocation.height);
|
||||
gdk_draw_rectangle (window, style->black_gc, FALSE,
|
||||
0, 0,
|
||||
darea->allocation.width - 1, darea->allocation.height - 1);
|
||||
allocation.width - 1, allocation.height - 1);
|
||||
|
||||
gdk_draw_pixbuf (darea->window, NULL, pixbuf, 0, 0, x, y, width, height,
|
||||
gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, x, y, width, height,
|
||||
GDK_RGB_DITHER_NORMAL, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -537,7 +542,7 @@ application_font_to_gconf (GConfPropertyEditor *peditor,
|
|||
|
||||
gtk_button_set_image (GTK_BUTTON (apply_button), gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON));
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (warning_dialog), apply_button, GTK_RESPONSE_APPLY);
|
||||
GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_set_can_default (apply_button, TRUE);
|
||||
gtk_widget_show (apply_button);
|
||||
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (warning_dialog), GTK_RESPONSE_CLOSE);
|
||||
|
@ -829,9 +834,9 @@ cb_show_details (GtkWidget *button,
|
|||
|
||||
/* pick a sensible maximum dpi */
|
||||
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
|
||||
adjustment->upper = DPI_HIGH_REASONABLE_VALUE;
|
||||
adjustment->lower = DPI_LOW_REASONABLE_VALUE;
|
||||
adjustment->step_increment = 1;
|
||||
gtk_adjustment_set_lower (adjustment, DPI_LOW_REASONABLE_VALUE);
|
||||
gtk_adjustment_set_upper (adjustment, DPI_HIGH_REASONABLE_VALUE);
|
||||
gtk_adjustment_set_step_increment (adjustment, 1);
|
||||
|
||||
dpi_load (data->client, GTK_SPIN_BUTTON (widget));
|
||||
g_signal_connect (widget, "value_changed",
|
||||
|
|
|
@ -984,7 +984,7 @@ theme_drag_data_received_cb (GtkWidget *widget,
|
|||
if (!(info == TARGET_URI_LIST || info == TARGET_NS_URL))
|
||||
return;
|
||||
|
||||
uris = g_uri_list_extract_uris ((gchar *) selection_data->data);
|
||||
uris = g_uri_list_extract_uris ((gchar *) gtk_selection_data_get_data (selection_data));
|
||||
|
||||
if (uris != NULL && uris[0] != NULL) {
|
||||
GFile *f = g_file_new_for_uri (uris[0]);
|
||||
|
|
|
@ -429,7 +429,7 @@ gnome_theme_install_real (GtkWindow *parent,
|
|||
gtk_image_new_from_stock (GTK_STOCK_APPLY,
|
||||
GTK_ICON_SIZE_BUTTON));
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), apply_button, GTK_RESPONSE_APPLY);
|
||||
GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_set_can_default (apply_button, TRUE);
|
||||
gtk_widget_show (apply_button);
|
||||
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY);
|
||||
|
|
|
@ -294,19 +294,20 @@ file_transfer_dialog_init (FileTransferDialog *dlg)
|
|||
GtkWidget *progress_vbox;
|
||||
GtkWidget *table;
|
||||
char *markup;
|
||||
GtkWidget *content_area;
|
||||
|
||||
dlg->priv = FILE_TRANSFER_DIALOG_GET_PRIVATE (dlg);
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
|
||||
dlg->priv = FILE_TRANSFER_DIALOG_GET_PRIVATE (dlg);
|
||||
dlg->priv->cancellable = g_cancellable_new ();
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox),
|
||||
4);
|
||||
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dlg)->vbox), 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (content_area), 4);
|
||||
gtk_box_set_spacing (GTK_BOX (content_area), 4);
|
||||
|
||||
gtk_widget_set_size_request (GTK_WIDGET (dlg), 350, -1);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 6);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
|
||||
|
||||
dlg->priv->status = gtk_label_new (NULL);
|
||||
markup = g_strconcat ("<big><b>", _("Copying files"), "</b></big>", NULL);
|
||||
|
@ -339,7 +340,7 @@ file_transfer_dialog_init (FileTransferDialog *dlg)
|
|||
gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (dlg), 6);
|
||||
|
||||
gtk_widget_show_all (GTK_DIALOG (dlg)->vbox);
|
||||
gtk_widget_show_all (content_area);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
|
|
|
@ -968,7 +968,7 @@ peditor_select_radio_widget_changed (GConfPropertyEditor *peditor,
|
|||
GConfValue *value, *value_wid;
|
||||
|
||||
if (!peditor->p->inited) return;
|
||||
if (!tb->active) return;
|
||||
if (!gtk_toggle_button_get_active (tb)) return;
|
||||
|
||||
value_wid = gconf_value_new (GCONF_VALUE_INT);
|
||||
group = g_slist_copy (gtk_radio_button_get_group (GTK_RADIO_BUTTON (peditor->p->ui_control)));
|
||||
|
@ -1393,6 +1393,7 @@ peditor_image_set_filename (GConfPropertyEditor *peditor, const gchar *filename)
|
|||
GtkImage *image = NULL;
|
||||
const int scale = 100;
|
||||
gchar *message = NULL;
|
||||
GtkWidget *ui_control_child;
|
||||
GList *l;
|
||||
|
||||
/* NULL is not valid, however "" is, but not an error (it's
|
||||
|
@ -1417,11 +1418,13 @@ peditor_image_set_filename (GConfPropertyEditor *peditor, const gchar *filename)
|
|||
filename);
|
||||
}
|
||||
|
||||
if (GTK_IS_IMAGE (GTK_BIN (peditor->p->ui_control)->child))
|
||||
image = GTK_IMAGE (GTK_BIN (peditor->p->ui_control)->child);
|
||||
ui_control_child = gtk_bin_get_child (GTK_BIN (peditor->p->ui_control));
|
||||
|
||||
if (GTK_IS_IMAGE (ui_control_child))
|
||||
image = GTK_IMAGE (ui_control_child);
|
||||
else
|
||||
{
|
||||
for (l = gtk_container_get_children (GTK_CONTAINER (GTK_BIN (peditor->p->ui_control)->child)); l != NULL; l = l->next)
|
||||
for (l = gtk_container_get_children (GTK_CONTAINER (ui_control_child)); l != NULL; l = l->next)
|
||||
{
|
||||
if (GTK_IS_IMAGE (l->data))
|
||||
image = GTK_IMAGE (l->data);
|
||||
|
|
|
@ -92,38 +92,40 @@ static int pipe_from_factory_fd[2];
|
|||
#define METACITY_THUMBNAIL_WIDTH 120
|
||||
#define METACITY_THUMBNAIL_HEIGHT 60
|
||||
|
||||
|
||||
static void
|
||||
fake_expose_widget (GtkWidget *widget,
|
||||
GdkPixmap *pixmap,
|
||||
GdkRectangle *area)
|
||||
static GdkPixmap*
|
||||
draw_window_on_pixbuf (GtkWidget *widget)
|
||||
{
|
||||
GdkWindow *tmp_window;
|
||||
GdkEventExpose event;
|
||||
GdkVisual *visual;
|
||||
GdkPixmap *pixmap;
|
||||
GtkStyle *style;
|
||||
GdkScreen *screen = gdk_screen_get_default ();
|
||||
GdkWindow *window;
|
||||
gint width, height;
|
||||
|
||||
event.type = GDK_EXPOSE;
|
||||
event.window = pixmap;
|
||||
event.send_event = FALSE;
|
||||
event.area = area ? *area : widget->allocation;
|
||||
event.region = NULL;
|
||||
event.count = 0;
|
||||
gtk_widget_ensure_style (widget);
|
||||
|
||||
tmp_window = widget->window;
|
||||
widget->window = pixmap;
|
||||
gtk_widget_send_expose (widget, (GdkEvent *) &event);
|
||||
widget->window = tmp_window;
|
||||
}
|
||||
style = gtk_widget_get_style (widget);
|
||||
|
||||
static void
|
||||
hbox_foreach (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
if (gtk_widget_get_visible (widget)) {
|
||||
gtk_widget_realize (widget);
|
||||
gtk_widget_map (widget);
|
||||
gtk_widget_ensure_style (widget);
|
||||
fake_expose_widget (widget, (GdkPixmap *) data, NULL);
|
||||
}
|
||||
g_assert (style);
|
||||
g_assert (style->font_desc);
|
||||
|
||||
gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
|
||||
|
||||
visual = gtk_widget_get_visual (widget);
|
||||
pixmap = gdk_pixmap_new (NULL, width, height, visual->depth);
|
||||
gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), gtk_widget_get_colormap (widget));
|
||||
|
||||
window = gtk_widget_get_window (widget);
|
||||
|
||||
gdk_window_redirect_to_drawable (window, pixmap, 0, 0, 0, 0, width, height);
|
||||
gdk_window_set_override_redirect (window, TRUE);
|
||||
gtk_window_move (GTK_WINDOW (widget), gdk_screen_get_width (screen), gdk_screen_get_height (screen));
|
||||
gtk_widget_show(widget);
|
||||
|
||||
gdk_window_process_updates (window, TRUE);
|
||||
gtk_widget_hide(widget);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -223,8 +225,8 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
|
||||
GtkRequisition requisition;
|
||||
GtkAllocation allocation;
|
||||
GtkAllocation vbox_allocation;
|
||||
GdkPixmap *pixmap;
|
||||
GdkVisual *visual;
|
||||
MetaFrameFlags flags;
|
||||
MetaTheme *theme;
|
||||
GdkPixbuf *pixbuf, *icon;
|
||||
|
@ -279,14 +281,6 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (preview);
|
||||
gtk_widget_realize (stock_button);
|
||||
gtk_widget_realize (GTK_BIN (stock_button)->child);
|
||||
gtk_widget_realize (checkbox);
|
||||
gtk_widget_realize (radio);
|
||||
gtk_widget_map (stock_button);
|
||||
gtk_widget_map (GTK_BIN (stock_button)->child);
|
||||
gtk_widget_map (checkbox);
|
||||
gtk_widget_map (radio);
|
||||
|
||||
meta_preview_set_frame_flags (META_PREVIEW (preview), flags);
|
||||
meta_preview_set_theme (META_PREVIEW (preview), theme);
|
||||
|
@ -302,39 +296,20 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
gtk_widget_size_allocate (window, &allocation);
|
||||
gtk_widget_size_request (window, &requisition);
|
||||
|
||||
/* Create a pixmap */
|
||||
visual = gtk_widget_get_visual (window);
|
||||
pixmap = gdk_pixmap_new (NULL, META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE, visual->depth);
|
||||
gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), gtk_widget_get_colormap (window));
|
||||
|
||||
/* Draw the window */
|
||||
gtk_widget_ensure_style (window);
|
||||
g_assert (window->style);
|
||||
g_assert (window->style->font_desc);
|
||||
|
||||
fake_expose_widget (window, pixmap, NULL);
|
||||
fake_expose_widget (preview, pixmap, NULL);
|
||||
/* we call this again here because the preview sometimes draws into the area
|
||||
* of the contents, see http://bugzilla.gnome.org/show_bug.cgi?id=351389 */
|
||||
fake_expose_widget (window, pixmap, &vbox->allocation);
|
||||
fake_expose_widget (stock_button, pixmap, NULL);
|
||||
gtk_container_foreach (GTK_CONTAINER (GTK_BIN (GTK_BIN (stock_button)->child)->child),
|
||||
hbox_foreach,
|
||||
pixmap);
|
||||
fake_expose_widget (GTK_BIN (stock_button)->child, pixmap, NULL);
|
||||
fake_expose_widget (checkbox, pixmap, NULL);
|
||||
fake_expose_widget (radio, pixmap, NULL);
|
||||
pixmap = draw_window_on_pixbuf (window);
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
|
||||
gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
|
||||
|
||||
gtk_widget_get_allocation (vbox, &vbox_allocation);
|
||||
|
||||
/* Add the icon theme to the pixbuf */
|
||||
gdk_pixbuf_composite (icon, pixbuf,
|
||||
vbox->allocation.x + vbox->allocation.width - icon_width - 5,
|
||||
vbox->allocation.y + vbox->allocation.height - icon_height - 5,
|
||||
vbox_allocation.x + vbox_allocation.width - icon_width - 5,
|
||||
vbox_allocation.y + vbox_allocation.height - icon_height - 5,
|
||||
icon_width, icon_height,
|
||||
vbox->allocation.x + vbox->allocation.width - icon_width - 5,
|
||||
vbox->allocation.y + vbox->allocation.height - icon_height - 5,
|
||||
vbox_allocation.x + vbox_allocation.width - icon_width - 5,
|
||||
vbox_allocation.y + vbox_allocation.height - icon_height - 5,
|
||||
1.0, 1.0, GDK_INTERP_BILINEAR, 255);
|
||||
region = meta_preview_get_clip_region (META_PREVIEW (preview),
|
||||
META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
|
||||
|
@ -344,6 +319,7 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
g_object_unref (icon);
|
||||
gtk_widget_destroy (window);
|
||||
meta_theme_free (theme);
|
||||
gdk_pixmap_unref (pixmap);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
@ -355,7 +331,6 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
GtkWidget *window, *vbox, *box, *stock_button, *checkbox, *radio;
|
||||
GtkRequisition requisition;
|
||||
GtkAllocation allocation;
|
||||
GdkVisual *visual;
|
||||
GdkPixmap *pixmap;
|
||||
GdkPixbuf *pixbuf, *retval;
|
||||
gint width, height;
|
||||
|
@ -382,11 +357,11 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
|
||||
gtk_widget_show_all (vbox);
|
||||
gtk_widget_realize (stock_button);
|
||||
gtk_widget_realize (GTK_BIN (stock_button)->child);
|
||||
gtk_widget_realize (gtk_bin_get_child (GTK_BIN (stock_button)));
|
||||
gtk_widget_realize (checkbox);
|
||||
gtk_widget_realize (radio);
|
||||
gtk_widget_map (stock_button);
|
||||
gtk_widget_map (GTK_BIN (stock_button)->child);
|
||||
gtk_widget_map (gtk_bin_get_child (GTK_BIN (stock_button)));
|
||||
gtk_widget_map (checkbox);
|
||||
gtk_widget_map (radio);
|
||||
|
||||
|
@ -398,25 +373,9 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
gtk_widget_size_allocate (window, &allocation);
|
||||
gtk_widget_size_request (window, &requisition);
|
||||
|
||||
/* Draw the window */
|
||||
gtk_widget_ensure_style (window);
|
||||
g_assert (window->style);
|
||||
g_assert (window->style->font_desc);
|
||||
|
||||
gtk_window_get_size (GTK_WINDOW (window), &width, &height);
|
||||
|
||||
visual = gtk_widget_get_visual (window);
|
||||
pixmap = gdk_pixmap_new (NULL, width, height, visual->depth);
|
||||
gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), gtk_widget_get_colormap (window));
|
||||
|
||||
fake_expose_widget (window, pixmap, NULL);
|
||||
fake_expose_widget (stock_button, pixmap, NULL);
|
||||
gtk_container_foreach (GTK_CONTAINER (GTK_BIN (GTK_BIN (stock_button)->child)->child),
|
||||
hbox_foreach,
|
||||
pixmap);
|
||||
fake_expose_widget (GTK_BIN (stock_button)->child, pixmap, NULL);
|
||||
fake_expose_widget (checkbox, pixmap, NULL);
|
||||
fake_expose_widget (radio, pixmap, NULL);
|
||||
pixmap = draw_window_on_pixbuf (window);
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
|
||||
gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, width, height);
|
||||
|
@ -427,6 +386,7 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
GDK_INTERP_BILINEAR);
|
||||
g_object_unref (pixbuf);
|
||||
gtk_widget_destroy (window);
|
||||
gdk_pixmap_unref (pixmap);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -439,7 +399,6 @@ create_metacity_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
MetaTheme *theme;
|
||||
GtkRequisition requisition;
|
||||
GtkAllocation allocation;
|
||||
GdkVisual *visual;
|
||||
GdkPixmap *pixmap;
|
||||
GdkPixbuf *pixbuf, *retval;
|
||||
GdkRegion *region;
|
||||
|
@ -484,19 +443,7 @@ create_metacity_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
gtk_widget_size_allocate (window, &allocation);
|
||||
gtk_widget_size_request (window, &requisition);
|
||||
|
||||
/* Draw the window */
|
||||
gtk_widget_ensure_style (window);
|
||||
g_assert (window->style);
|
||||
g_assert (window->style->font_desc);
|
||||
|
||||
/* Create a pixmap */
|
||||
visual = gtk_widget_get_visual (window);
|
||||
pixmap = gdk_pixmap_new (NULL, (int) METACITY_THUMBNAIL_WIDTH * 1.2, (int) METACITY_THUMBNAIL_HEIGHT * 1.2, visual->depth);
|
||||
gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), gtk_widget_get_colormap (window));
|
||||
|
||||
fake_expose_widget (window, pixmap, NULL);
|
||||
fake_expose_widget (preview, pixmap, NULL);
|
||||
fake_expose_widget (window, pixmap, &dummy->allocation);
|
||||
pixmap = draw_window_on_pixbuf (window);
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, (int) METACITY_THUMBNAIL_WIDTH * 1.2, (int) METACITY_THUMBNAIL_HEIGHT * 1.2);
|
||||
gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, (int) METACITY_THUMBNAIL_WIDTH * 1.2, (int) METACITY_THUMBNAIL_HEIGHT * 1.2);
|
||||
|
@ -515,6 +462,8 @@ create_metacity_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
|
|||
|
||||
gtk_widget_destroy (window);
|
||||
meta_theme_free (theme);
|
||||
gdk_pixmap_unref (pixmap);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -419,12 +419,15 @@ static void
|
|||
get_viewport (FooScrollArea *scroll_area,
|
||||
GdkRectangle *viewport)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GtkWidget *widget = GTK_WIDGET (scroll_area);
|
||||
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
viewport->x = scroll_area->priv->x_offset;
|
||||
viewport->y = scroll_area->priv->y_offset;
|
||||
viewport->width = widget->allocation.width;
|
||||
viewport->height = widget->allocation.height;
|
||||
viewport->width = allocation.width;
|
||||
viewport->height = allocation.height;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -444,7 +447,7 @@ clear_exposed_input_region (FooScrollArea *area,
|
|||
GdkRegion *viewport;
|
||||
GdkRectangle allocation;
|
||||
|
||||
allocation = GTK_WIDGET (area)->allocation;
|
||||
gtk_widget_get_allocation (GTK_WIDGET (area), &allocation);
|
||||
allocation.x = 0;
|
||||
allocation.y = 0;
|
||||
allocation_to_canvas (area, &allocation.x, &allocation.y);
|
||||
|
@ -522,7 +525,7 @@ static void
|
|||
initialize_background (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
setup_background_cr (widget->window, cr, 0, 0);
|
||||
setup_background_cr (gtk_widget_get_window (widget), cr, 0, 0);
|
||||
|
||||
cairo_paint (cr);
|
||||
}
|
||||
|
@ -574,7 +577,9 @@ foo_scroll_area_expose (GtkWidget *widget,
|
|||
GdkRegion *region;
|
||||
int x_offset, y_offset;
|
||||
GdkGC *gc;
|
||||
|
||||
GtkAllocation widget_allocation;
|
||||
GdkWindow *window = gtk_widget_get_window (widget);
|
||||
|
||||
/* I don't think expose can ever recurse for the same area */
|
||||
g_assert (!scroll_area->priv->expose_region);
|
||||
|
||||
|
@ -623,13 +628,14 @@ foo_scroll_area_expose (GtkWidget *widget,
|
|||
scroll_area->priv->current_input = NULL;
|
||||
|
||||
/* Finally draw the backing pixmap */
|
||||
gc = gdk_gc_new (widget->window);
|
||||
|
||||
gc = gdk_gc_new (window);
|
||||
|
||||
gdk_gc_set_clip_region (gc, expose->region);
|
||||
|
||||
gdk_draw_drawable (widget->window, gc, scroll_area->priv->pixmap,
|
||||
0, 0, widget->allocation.x, widget->allocation.y,
|
||||
widget->allocation.width, widget->allocation.height);
|
||||
gtk_widget_get_allocation (widget, &widget_allocation);
|
||||
gdk_draw_drawable (window, gc, scroll_area->priv->pixmap,
|
||||
0, 0, widget_allocation.x, widget_allocation.y,
|
||||
widget_allocation.width, widget_allocation.height);
|
||||
|
||||
g_object_unref (gc);
|
||||
gdk_region_destroy (region);
|
||||
|
@ -676,15 +682,12 @@ emit_viewport_changed (FooScrollArea *scroll_area,
|
|||
static void
|
||||
clamp_adjustment (GtkAdjustment *adj)
|
||||
{
|
||||
double old_value = adj->value;
|
||||
|
||||
if (adj->upper >= adj->page_size)
|
||||
adj->value = CLAMP (adj->value, 0.0, adj->upper - adj->page_size);
|
||||
if (gtk_adjustment_get_upper (adj) >= gtk_adjustment_get_page_size (adj))
|
||||
gtk_adjustment_set_value (adj, CLAMP (gtk_adjustment_get_value (adj), 0.0,
|
||||
gtk_adjustment_get_upper (adj)
|
||||
- gtk_adjustment_get_page_size (adj)));
|
||||
else
|
||||
adj->value = 0.0;
|
||||
|
||||
if (old_value != adj->value)
|
||||
gtk_adjustment_value_changed (adj);
|
||||
gtk_adjustment_set_value (adj, 0.0);
|
||||
|
||||
gtk_adjustment_changed (adj);
|
||||
}
|
||||
|
@ -692,25 +695,30 @@ clamp_adjustment (GtkAdjustment *adj)
|
|||
static gboolean
|
||||
set_adjustment_values (FooScrollArea *scroll_area)
|
||||
{
|
||||
GtkAllocation *allocation = >K_WIDGET (scroll_area)->allocation;
|
||||
|
||||
GtkAllocation allocation;
|
||||
|
||||
GtkAdjustment *hadj = scroll_area->priv->hadj;
|
||||
GtkAdjustment *vadj = scroll_area->priv->vadj;
|
||||
|
||||
/* Horizontal */
|
||||
hadj->page_size = allocation->width;
|
||||
hadj->step_increment = 0.1 * allocation->width;
|
||||
hadj->page_increment = 0.9 * allocation->width;
|
||||
hadj->lower = 0.0;
|
||||
hadj->upper = scroll_area->priv->width;
|
||||
gtk_widget_get_allocation (GTK_WIDGET (scroll_area), &allocation);
|
||||
g_object_freeze_notify (G_OBJECT (hadj));
|
||||
gtk_adjustment_set_page_size (hadj, allocation.width);
|
||||
gtk_adjustment_set_step_increment (hadj, 0.1 * allocation.width);
|
||||
gtk_adjustment_set_page_increment (hadj, 0.9 * allocation.width);
|
||||
gtk_adjustment_set_lower (hadj, 0.0);
|
||||
gtk_adjustment_set_upper (hadj, scroll_area->priv->width);
|
||||
g_object_thaw_notify (G_OBJECT (hadj));
|
||||
|
||||
/* Vertical */
|
||||
vadj->page_size = allocation->height;
|
||||
vadj->step_increment = 0.1 * allocation->height;
|
||||
vadj->page_increment = 0.9 * allocation->height;
|
||||
vadj->lower = 0.0;
|
||||
vadj->upper = scroll_area->priv->height;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (vadj));
|
||||
gtk_adjustment_set_page_size (vadj, allocation.height);
|
||||
gtk_adjustment_set_step_increment (vadj, 0.1 * allocation.height);
|
||||
gtk_adjustment_set_page_increment (vadj, 0.9 * allocation.height);
|
||||
gtk_adjustment_set_lower (vadj, 0.0);
|
||||
gtk_adjustment_set_upper (vadj, scroll_area->priv->height);
|
||||
g_object_thaw_notify (G_OBJECT (vadj));
|
||||
|
||||
clamp_adjustment (hadj);
|
||||
clamp_adjustment (vadj);
|
||||
|
||||
|
@ -722,15 +730,18 @@ foo_scroll_area_realize (GtkWidget *widget)
|
|||
{
|
||||
FooScrollArea *area = FOO_SCROLL_AREA (widget);
|
||||
GdkWindowAttr attributes;
|
||||
GtkAllocation widget_allocation;
|
||||
GdkWindow *window;
|
||||
gint attributes_mask;
|
||||
|
||||
gtk_widget_get_allocation (widget, &widget_allocation);
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
|
||||
attributes.window_type = GDK_WINDOW_CHILD;
|
||||
attributes.x = widget->allocation.x;
|
||||
attributes.y = widget->allocation.y;
|
||||
attributes.width = widget->allocation.width;
|
||||
attributes.height = widget->allocation.height;
|
||||
attributes.x = widget_allocation.x;
|
||||
attributes.y = widget_allocation.y;
|
||||
attributes.width = widget_allocation.width;
|
||||
attributes.height = widget_allocation.height;
|
||||
attributes.wclass = GDK_INPUT_ONLY;
|
||||
attributes.event_mask = gtk_widget_get_events (widget);
|
||||
attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
|
||||
|
@ -743,19 +754,20 @@ foo_scroll_area_realize (GtkWidget *widget)
|
|||
GDK_LEAVE_NOTIFY_MASK);
|
||||
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y;
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
|
||||
widget->window = gtk_widget_get_parent_window (widget);
|
||||
g_object_ref (widget->window);
|
||||
|
||||
area->priv->input_window = gdk_window_new (widget->window,
|
||||
area->priv->input_window = gdk_window_new (window,
|
||||
&attributes, attributes_mask);
|
||||
area->priv->pixmap = gdk_pixmap_new (widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
area->priv->pixmap = gdk_pixmap_new (window,
|
||||
widget_allocation.width,
|
||||
widget_allocation.height,
|
||||
-1);
|
||||
gdk_window_set_user_data (area->priv->input_window, area);
|
||||
|
||||
widget->style = gtk_style_attach (widget->style, widget->window);
|
||||
gtk_widget_style_attach (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -777,10 +789,14 @@ static GdkPixmap *
|
|||
create_new_pixmap (GtkWidget *widget,
|
||||
GdkPixmap *old)
|
||||
{
|
||||
GdkPixmap *new = gdk_pixmap_new (widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
GtkAllocation widget_allocation;
|
||||
GdkPixmap *new;
|
||||
|
||||
gtk_widget_get_allocation (widget, &widget_allocation);
|
||||
new = gdk_pixmap_new (gtk_widget_get_window (widget),
|
||||
widget_allocation.width,
|
||||
widget_allocation.height,
|
||||
-1);
|
||||
|
||||
/* Unfortunately we don't know in which direction we were resized,
|
||||
* so we just assume we were dragged from the south-east corner.
|
||||
|
@ -811,12 +827,14 @@ foo_scroll_area_size_allocate (GtkWidget *widget,
|
|||
GdkRectangle old_viewport;
|
||||
GdkRegion *old_allocation;
|
||||
GdkRegion *invalid;
|
||||
GtkAllocation widget_allocation;
|
||||
|
||||
get_viewport (scroll_area, &old_viewport);
|
||||
|
||||
old_allocation = gdk_region_rectangle (&widget->allocation);
|
||||
gtk_widget_get_allocation (widget, &widget_allocation);
|
||||
old_allocation = gdk_region_rectangle (&widget_allocation);
|
||||
gdk_region_offset (old_allocation,
|
||||
-widget->allocation.x, -widget->allocation.y);
|
||||
-widget_allocation.x, -widget_allocation.y);
|
||||
invalid = gdk_region_rectangle (allocation);
|
||||
gdk_region_offset (invalid, -allocation->x, -allocation->y);
|
||||
gdk_region_xor (invalid, old_allocation);
|
||||
|
@ -825,7 +843,7 @@ foo_scroll_area_size_allocate (GtkWidget *widget,
|
|||
gdk_region_destroy (old_allocation);
|
||||
gdk_region_destroy (invalid);
|
||||
|
||||
widget->allocation = *allocation;
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
if (scroll_area->priv->input_window)
|
||||
{
|
||||
|
@ -959,7 +977,7 @@ process_event (FooScrollArea *scroll_area,
|
|||
cairo_t *cr;
|
||||
gboolean inside;
|
||||
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
||||
cairo_set_fill_rule (cr, path->fill_rule);
|
||||
cairo_set_line_width (cr, path->line_width);
|
||||
cairo_append_path (cr, path->path);
|
||||
|
@ -1052,21 +1070,17 @@ foo_scroll_area_set_size_fixed_y (FooScrollArea *scroll_area,
|
|||
int old_y,
|
||||
int new_y)
|
||||
{
|
||||
int dy = new_y - old_y;
|
||||
|
||||
scroll_area->priv->width = width;
|
||||
scroll_area->priv->height = height;
|
||||
|
||||
#if 0
|
||||
g_print ("diff: %d\n", new_y - old_y);
|
||||
#endif
|
||||
|
||||
scroll_area->priv->vadj->value += dy;
|
||||
g_object_thaw_notify (G_OBJECT (scroll_area->priv->vadj));
|
||||
gtk_adjustment_set_value (scroll_area->priv->vadj, new_y);
|
||||
|
||||
set_adjustment_values (scroll_area);
|
||||
|
||||
if (dy != 0)
|
||||
gtk_adjustment_value_changed (scroll_area->priv->vadj);
|
||||
g_object_thaw_notify (G_OBJECT (scroll_area->priv->vadj));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1186,11 +1200,12 @@ foo_scroll_area_scroll (FooScrollArea *area,
|
|||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
GdkRectangle allocation = GTK_WIDGET (area)->allocation;
|
||||
GdkRectangle allocation;
|
||||
GdkRectangle src_area;
|
||||
GdkRectangle move_area;
|
||||
GdkRegion *invalid_region;
|
||||
|
||||
gtk_widget_get_allocation (GTK_WIDGET (area), &allocation);
|
||||
allocation.x = 0;
|
||||
allocation.y = 0;
|
||||
|
||||
|
@ -1250,13 +1265,13 @@ foo_scrollbar_adjustment_changed (GtkAdjustment *adj,
|
|||
/* FIXME: do we treat the offset as int or double, and,
|
||||
* if int, how do we round?
|
||||
*/
|
||||
dx = (int)adj->value - scroll_area->priv->x_offset;
|
||||
scroll_area->priv->x_offset = adj->value;
|
||||
dx = (int)gtk_adjustment_get_value (adj) - scroll_area->priv->x_offset;
|
||||
scroll_area->priv->x_offset = gtk_adjustment_get_value (adj);
|
||||
}
|
||||
else if (adj == scroll_area->priv->vadj)
|
||||
{
|
||||
dy = (int)adj->value - scroll_area->priv->y_offset;
|
||||
scroll_area->priv->y_offset = adj->value;
|
||||
dy = (int)gtk_adjustment_get_value (adj) - scroll_area->priv->y_offset;
|
||||
scroll_area->priv->y_offset = gtk_adjustment_get_value (adj);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1430,34 +1445,40 @@ foo_scroll_area_add_input_from_stroke (FooScrollArea *scroll_area,
|
|||
void
|
||||
foo_scroll_area_invalidate (FooScrollArea *scroll_area)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GtkWidget *widget = GTK_WIDGET (scroll_area);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
foo_scroll_area_invalidate_rect (scroll_area,
|
||||
scroll_area->priv->x_offset, scroll_area->priv->y_offset,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height);
|
||||
allocation.width,
|
||||
allocation.height);
|
||||
}
|
||||
|
||||
static void
|
||||
canvas_to_window (FooScrollArea *area,
|
||||
GdkRegion *region)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GtkWidget *widget = GTK_WIDGET (area);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
gdk_region_offset (region,
|
||||
-area->priv->x_offset + widget->allocation.x,
|
||||
-area->priv->y_offset + widget->allocation.y);
|
||||
-area->priv->x_offset + allocation.x,
|
||||
-area->priv->y_offset + allocation.y);
|
||||
}
|
||||
|
||||
static void
|
||||
window_to_canvas (FooScrollArea *area,
|
||||
GdkRegion *region)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GtkWidget *widget = GTK_WIDGET (area);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
gdk_region_offset (region,
|
||||
area->priv->x_offset - widget->allocation.x,
|
||||
area->priv->y_offset - widget->allocation.y);
|
||||
area->priv->x_offset - allocation.x,
|
||||
area->priv->y_offset - allocation.y);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1539,19 +1560,14 @@ foo_scroll_area_set_viewport_pos (FooScrollArea *scroll_area,
|
|||
int x,
|
||||
int y)
|
||||
{
|
||||
int x_changed = scroll_area->priv->hadj->value != (double)x;
|
||||
int y_changed = scroll_area->priv->vadj->value != (double)y;
|
||||
|
||||
scroll_area->priv->hadj->value = x;
|
||||
scroll_area->priv->vadj->value = y;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (scroll_area->priv->hadj));
|
||||
g_object_freeze_notify (G_OBJECT (scroll_area->priv->vadj));
|
||||
gtk_adjustment_set_value (scroll_area->priv->hadj, x);
|
||||
gtk_adjustment_set_value (scroll_area->priv->vadj, y);
|
||||
|
||||
set_adjustment_values (scroll_area);
|
||||
|
||||
if (x_changed)
|
||||
gtk_adjustment_value_changed (scroll_area->priv->hadj);
|
||||
|
||||
if (y_changed)
|
||||
gtk_adjustment_value_changed (scroll_area->priv->vadj);
|
||||
g_object_thaw_notify (G_OBJECT (scroll_area->priv->hadj));
|
||||
g_object_thaw_notify (G_OBJECT (scroll_area->priv->vadj));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -521,7 +521,7 @@ rebuild_current_monitor_label (App *app)
|
|||
{
|
||||
GdkColor black = { 0, 0, 0, 0 };
|
||||
|
||||
gtk_widget_modify_bg (app->current_monitor_event_box, app->current_monitor_event_box->state, &color);
|
||||
gtk_widget_modify_bg (app->current_monitor_event_box, gtk_widget_get_state (app->current_monitor_event_box), &color);
|
||||
|
||||
/* Make the label explicitly black. We don't want it to follow the
|
||||
* theme's colors, since the label is always shown against a light
|
||||
|
@ -1659,15 +1659,17 @@ paint_background (FooScrollArea *area,
|
|||
{
|
||||
GdkRectangle viewport;
|
||||
GtkWidget *widget;
|
||||
GtkStyle *widget_style;
|
||||
|
||||
widget = GTK_WIDGET (area);
|
||||
|
||||
foo_scroll_area_get_viewport (area, &viewport);
|
||||
widget_style = gtk_widget_get_style (widget);
|
||||
|
||||
cairo_set_source_rgb (cr,
|
||||
widget->style->base[GTK_STATE_SELECTED].red / 65535.0,
|
||||
widget->style->base[GTK_STATE_SELECTED].green / 65535.0,
|
||||
widget->style->base[GTK_STATE_SELECTED].blue / 65535.0);
|
||||
widget_style->base[GTK_STATE_SELECTED].red / 65535.0,
|
||||
widget_style->base[GTK_STATE_SELECTED].green / 65535.0,
|
||||
widget_style->base[GTK_STATE_SELECTED].blue / 65535.0);
|
||||
|
||||
cairo_rectangle (cr,
|
||||
viewport.x, viewport.y,
|
||||
|
@ -1678,9 +1680,9 @@ paint_background (FooScrollArea *area,
|
|||
foo_scroll_area_add_input_from_fill (area, cr, on_canvas_event, NULL);
|
||||
|
||||
cairo_set_source_rgb (cr,
|
||||
widget->style->dark[GTK_STATE_SELECTED].red / 65535.0,
|
||||
widget->style->dark[GTK_STATE_SELECTED].green / 65535.0,
|
||||
widget->style->dark[GTK_STATE_SELECTED].blue / 65535.0);
|
||||
widget_style->dark[GTK_STATE_SELECTED].red / 65535.0,
|
||||
widget_style->dark[GTK_STATE_SELECTED].green / 65535.0,
|
||||
widget_style->dark[GTK_STATE_SELECTED].blue / 65535.0);
|
||||
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
@ -2252,7 +2254,7 @@ static void
|
|||
select_current_output_from_dialog_position (App *app)
|
||||
{
|
||||
if (gtk_widget_get_realized (app->dialog))
|
||||
app->current_output = get_output_for_window (app->current_configuration, app->dialog->window);
|
||||
app->current_output = get_output_for_window (app->current_configuration, gtk_widget_get_window (app->dialog));
|
||||
else
|
||||
app->current_output = NULL;
|
||||
|
||||
|
|
|
@ -559,21 +559,23 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell,
|
|||
EggCellRendererKeys *keys;
|
||||
GtkWidget *label;
|
||||
GtkWidget *eventbox;
|
||||
GValue celltext_editable = {0};
|
||||
|
||||
celltext = GTK_CELL_RENDERER_TEXT (cell);
|
||||
keys = EGG_CELL_RENDERER_KEYS (cell);
|
||||
|
||||
/* If the cell isn't editable we return NULL. */
|
||||
if (celltext->editable == FALSE)
|
||||
g_value_init (&celltext_editable, G_TYPE_BOOLEAN);
|
||||
g_object_get_property (G_OBJECT (celltext), "editable", &celltext_editable);
|
||||
if (g_value_get_boolean (&celltext_editable) == FALSE)
|
||||
return NULL;
|
||||
g_return_val_if_fail (gtk_widget_get_window (widget) != NULL, NULL);
|
||||
|
||||
g_return_val_if_fail (widget->window != NULL, NULL);
|
||||
|
||||
if (gdk_keyboard_grab (widget->window, FALSE,
|
||||
if (gdk_keyboard_grab (gtk_widget_get_window (widget), FALSE,
|
||||
gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
if (gdk_pointer_grab (widget->window, FALSE,
|
||||
if (gdk_pointer_grab (gtk_widget_get_window (widget), FALSE,
|
||||
GDK_BUTTON_PRESS_MASK,
|
||||
NULL, NULL,
|
||||
gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
|
||||
|
@ -598,10 +600,10 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell,
|
|||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
|
||||
gtk_widget_modify_bg (eventbox, GTK_STATE_NORMAL,
|
||||
&widget->style->bg[GTK_STATE_SELECTED]);
|
||||
>k_widget_get_style (widget)->bg[GTK_STATE_SELECTED]);
|
||||
|
||||
gtk_widget_modify_fg (label, GTK_STATE_NORMAL,
|
||||
&widget->style->fg[GTK_STATE_SELECTED]);
|
||||
>k_widget_get_style (widget)->fg[GTK_STATE_SELECTED]);
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (label),
|
||||
TOOLTIP_TEXT);
|
||||
|
|
|
@ -183,12 +183,13 @@ option_focused_cb (GtkWidget * widget, GdkEventFocus * event,
|
|||
gpointer data)
|
||||
{
|
||||
GtkScrolledWindow *win = GTK_SCROLLED_WINDOW (data);
|
||||
GtkAllocation *alloc = &widget->allocation;
|
||||
GtkAllocation alloc;
|
||||
GtkAdjustment *adj;
|
||||
|
||||
gtk_widget_get_allocation (widget, &alloc);
|
||||
adj = gtk_scrolled_window_get_vadjustment (win);
|
||||
gtk_adjustment_clamp_page (adj, alloc->y,
|
||||
alloc->y + alloc->height);
|
||||
gtk_adjustment_clamp_page (adj, alloc.y,
|
||||
alloc.y + alloc.height);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -192,7 +192,8 @@ setup_accessibility (GtkBuilder *dialog, GConfClient *client)
|
|||
WID ("threshold"), NULL);
|
||||
|
||||
gconf_peditor_new_select_radio (NULL, MT_GCONF_HOME "/dwell_mode",
|
||||
GTK_RADIO_BUTTON (WID ("dwell_mode_ctw"))->group, NULL);
|
||||
gtk_radio_button_get_group (GTK_RADIO_BUTTON (WID ("dwell_mode_ctw"))),
|
||||
NULL);
|
||||
update_mode_sensitivity (dialog,
|
||||
gconf_client_get_int (client,
|
||||
MT_GCONF_HOME "/dwell_mode",
|
||||
|
|
|
@ -224,7 +224,7 @@ static void
|
|||
cb_use_auth_toggled (GtkToggleButton *toggle,
|
||||
GtkWidget *table)
|
||||
{
|
||||
gtk_widget_set_sensitive (table, toggle->active);
|
||||
gtk_widget_set_sensitive (table, gtk_toggle_button_get_active (toggle));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -257,8 +257,6 @@ cb_http_details_button_clicked (GtkWidget *button,
|
|||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (widget), GTK_WINDOW (parent));
|
||||
|
||||
gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (gtk_builder_get_object (builder, "use_auth_checkbutton"))->child), TRUE);
|
||||
|
||||
g_signal_connect (gtk_builder_get_object (builder, "use_auth_checkbutton"),
|
||||
"toggled",
|
||||
G_CALLBACK (cb_use_auth_toggled),
|
||||
|
@ -1240,11 +1238,6 @@ setup_dialog (GtkBuilder *builder)
|
|||
"text", COL_NAME,
|
||||
"style", COL_STYLE, NULL);
|
||||
|
||||
/* Hackety hack */
|
||||
gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (gtk_builder_get_object (builder, "none_radiobutton"))->child), TRUE);
|
||||
gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (gtk_builder_get_object (builder, "manual_radiobutton"))->child), TRUE);
|
||||
gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (gtk_builder_get_object (builder, "auto_radiobutton"))->child), TRUE);
|
||||
|
||||
/* Mode */
|
||||
mode_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "none_radiobutton")));
|
||||
connect_sensitivity_signals (builder, mode_group);
|
||||
|
|
|
@ -58,12 +58,19 @@
|
|||
<property name="spacing">18</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="none_radiobutton">
|
||||
<property name="label" translatable="yes"><b>Di_rect internet connection</b></property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Di_rect internet connection</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -81,13 +88,20 @@
|
|||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="manual_radiobutton">
|
||||
<property name="label" translatable="yes"><b>_Manual proxy configuration</b></property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">none_radiobutton</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>_Manual proxy configuration</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -426,13 +440,21 @@
|
|||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="auto_radiobutton">
|
||||
<property name="label" translatable="yes"><b>_Automatic proxy configuration</b></property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="yalign">0.47</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">none_radiobutton</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>_Automatic proxy configuration</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -745,12 +767,19 @@
|
|||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="use_auth_checkbutton">
|
||||
<property name="label" translatable="yes"><b>_Use authentication</b></property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>_Use authentication</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
|
@ -354,8 +354,7 @@ try_spawn_config_tool (GdkScreen *screen)
|
|||
gtk_window_set_title (GTK_WINDOW (no_tool_dialog), "");
|
||||
gtk_window_set_resizable (GTK_WINDOW (no_tool_dialog), FALSE);
|
||||
|
||||
gtk_label_set_markup (GTK_LABEL (GTK_MESSAGE_DIALOG (no_tool_dialog)->label),
|
||||
str);
|
||||
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (no_tool_dialog), str);
|
||||
|
||||
g_free (str);
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ create_text_pixmap(GtkWidget *drawing_area, FT_Face face)
|
|||
XftFont *font;
|
||||
gint *sizes = NULL, n_sizes, alpha_size;
|
||||
FcCharSet *charset = NULL;
|
||||
GdkWindow *window = gtk_widget_get_window (drawing_area);
|
||||
|
||||
text = pango_language_get_sample_string(NULL);
|
||||
if (! check_font_contain_text (face, text))
|
||||
|
@ -122,9 +123,9 @@ create_text_pixmap(GtkWidget *drawing_area, FT_Face face)
|
|||
gtk_widget_realize(drawing_area);
|
||||
|
||||
/* create the XftDraw */
|
||||
xdisplay = GDK_PIXMAP_XDISPLAY(drawing_area->window);
|
||||
xvisual = GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(drawing_area->window));
|
||||
xcolormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(drawing_area->window));
|
||||
xdisplay = GDK_PIXMAP_XDISPLAY(window);
|
||||
xvisual = GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(window));
|
||||
xcolormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(window));
|
||||
XftColorAllocName(xdisplay, xvisual, xcolormap, "black", &colour);
|
||||
|
||||
/* work out what sizes to render */
|
||||
|
@ -187,11 +188,11 @@ create_text_pixmap(GtkWidget *drawing_area, FT_Face face)
|
|||
|
||||
/* create pixmap */
|
||||
gtk_widget_set_size_request(drawing_area, pixmap_width, pixmap_height);
|
||||
pixmap = gdk_pixmap_new(drawing_area->window,
|
||||
pixmap = gdk_pixmap_new(window,
|
||||
pixmap_width, pixmap_height, -1);
|
||||
if (!pixmap)
|
||||
goto end;
|
||||
gdk_draw_rectangle(pixmap, drawing_area->style->white_gc,
|
||||
gdk_draw_rectangle(pixmap, gtk_widget_get_style(drawing_area)->white_gc,
|
||||
TRUE, 0, 0, pixmap_width, pixmap_height);
|
||||
|
||||
xdrawable = GDK_DRAWABLE_XID(pixmap);
|
||||
|
@ -372,8 +373,8 @@ add_face_info(GtkWidget *table, gint *row_p, const gchar *uri, FT_Face face)
|
|||
static gboolean
|
||||
expose_event(GtkWidget *widget, GdkEventExpose *event, GdkPixmap *pixmap)
|
||||
{
|
||||
gdk_draw_drawable(widget->window,
|
||||
widget->style->fg_gc[gtk_widget_get_state (widget)],
|
||||
gdk_draw_drawable(gtk_widget_get_window (widget),
|
||||
gtk_widget_get_style (widget)->fg_gc[gtk_widget_get_state (widget)],
|
||||
pixmap,
|
||||
event->area.x, event->area.y,
|
||||
event->area.x, event->area.y,
|
||||
|
|
|
@ -527,7 +527,7 @@ postpone_clicked_cb (GtkWidget *button,
|
|||
|
||||
priv->postpone_timeout_id = g_timeout_add_seconds (POSTPONE_CANCEL, (GSourceFunc) postpone_cancel_cb, bw);
|
||||
|
||||
grab_on_window (priv->postpone_entry->window, gtk_get_current_event_time ());
|
||||
grab_on_window (gtk_widget_get_window (priv->postpone_entry), gtk_get_current_event_time ());
|
||||
|
||||
gtk_widget_grab_focus (priv->postpone_entry);
|
||||
|
||||
|
@ -547,26 +547,31 @@ get_layout_location (GtkLabel *label,
|
|||
gint *xp,
|
||||
gint *yp)
|
||||
{
|
||||
GtkMisc *misc;
|
||||
GtkWidget *widget;
|
||||
gfloat xalign;
|
||||
gint x, y;
|
||||
GtkMisc *misc;
|
||||
GtkWidget *widget;
|
||||
GtkAllocation widget_allocation;
|
||||
GtkRequisition widget_requisition;
|
||||
gfloat xalign, yalign;
|
||||
gint x, y;
|
||||
gint xpad, ypad;
|
||||
|
||||
misc = GTK_MISC (label);
|
||||
widget = GTK_WIDGET (label);
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) {
|
||||
xalign = misc->xalign;
|
||||
} else {
|
||||
xalign = 1.0 - misc->xalign;
|
||||
}
|
||||
gtk_misc_get_alignment (misc, &xalign, &yalign);
|
||||
gtk_misc_get_padding (misc, &xpad, &ypad);
|
||||
gtk_widget_get_allocation (widget, &widget_allocation);
|
||||
gtk_widget_get_requisition (widget, &widget_requisition);
|
||||
|
||||
x = floor (widget->allocation.x + (int)misc->xpad
|
||||
+ ((widget->allocation.width - widget->requisition.width - 1) * xalign)
|
||||
if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
|
||||
xalign = 1.0 - xalign;
|
||||
|
||||
x = floor (widget_allocation.x + (int)xpad
|
||||
+ ((widget_allocation.width - widget_requisition.width - 1) * xalign)
|
||||
+ 0.5);
|
||||
|
||||
y = floor (widget->allocation.y + (int)misc->ypad
|
||||
+ ((widget->allocation.height - widget->requisition.height - 1) * misc->yalign)
|
||||
y = floor (widget_allocation.y + (int)ypad
|
||||
+ ((widget_allocation.height - widget_requisition.height - 1) * yalign)
|
||||
+ 0.5);
|
||||
|
||||
if (xp) {
|
||||
|
@ -586,6 +591,7 @@ label_expose_event_cb (GtkLabel *label,
|
|||
gint x, y;
|
||||
GdkColor color;
|
||||
GtkWidget *widget;
|
||||
GdkWindow *window;
|
||||
GdkGC *gc;
|
||||
|
||||
color.red = 0;
|
||||
|
@ -596,28 +602,30 @@ label_expose_event_cb (GtkLabel *label,
|
|||
get_layout_location (label, &x, &y);
|
||||
|
||||
widget = GTK_WIDGET (label);
|
||||
gc = gdk_gc_new (widget->window);
|
||||
window = gtk_widget_get_window (widget);
|
||||
|
||||
gc = gdk_gc_new (window);
|
||||
gdk_gc_set_rgb_fg_color (gc, &color);
|
||||
gdk_gc_set_clip_rectangle (gc, &event->area);
|
||||
|
||||
gdk_draw_layout_with_colors (widget->window,
|
||||
gdk_draw_layout_with_colors (window,
|
||||
gc,
|
||||
x + 1,
|
||||
y + 1,
|
||||
label->layout,
|
||||
gtk_label_get_layout (label),
|
||||
&color,
|
||||
NULL);
|
||||
g_object_unref (gc);
|
||||
|
||||
gtk_paint_layout (widget->style,
|
||||
widget->window,
|
||||
gtk_paint_layout (gtk_widget_get_style (widget),
|
||||
window,
|
||||
gtk_widget_get_state (widget),
|
||||
FALSE,
|
||||
&event->area,
|
||||
widget,
|
||||
"label",
|
||||
x, y,
|
||||
label->layout);
|
||||
gtk_label_get_layout (label));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ window_expose_event (GtkWidget *widget,
|
|||
int width;
|
||||
int height;
|
||||
|
||||
context = gdk_cairo_create (widget->window);
|
||||
context = gdk_cairo_create (gtk_widget_get_window (widget));
|
||||
|
||||
cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
|
||||
gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
|
||||
|
@ -200,7 +200,7 @@ set_pixmap_background (GtkWidget *window)
|
|||
|
||||
g_object_unref (tile_pixbuf);
|
||||
|
||||
pixmap = gdk_pixmap_new (GTK_WIDGET (window)->window,
|
||||
pixmap = gdk_pixmap_new (gtk_widget_get_window (window),
|
||||
width,
|
||||
height,
|
||||
-1);
|
||||
|
@ -220,7 +220,7 @@ set_pixmap_background (GtkWidget *window)
|
|||
|
||||
g_object_unref (tmp_pixbuf);
|
||||
|
||||
gdk_window_set_back_pixmap (window->window, pixmap, FALSE);
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (window), pixmap, FALSE);
|
||||
g_object_unref (pixmap);
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ break_window_map_event_cb (GtkWidget *widget,
|
|||
GdkEvent *event,
|
||||
DrWright *dr)
|
||||
{
|
||||
grab_keyboard_on_window (dr->break_window->window, gtk_get_current_event_time ());
|
||||
grab_keyboard_on_window (gtk_widget_get_window (dr->break_window), gtk_get_current_event_time ());
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue