Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 923bf3c625 | |||
| d36604ae41 | |||
| 48d73e164e | |||
| b1277f32de | |||
| ffd12347be | |||
| fc2b45cb50 | |||
| 79c9a7ec5e | |||
| b89a059967 | |||
| fc72a20782 | |||
| 6748d421b6 | |||
| 87a46136b3 | |||
| 47c00c7ad4 | |||
| ce4382e444 | |||
| 74f03f97b1 | |||
| c0c10b993a | |||
| 127e8d8a1b | |||
| 9816a939b7 | |||
| 1b5b4812b9 | |||
| b20c7555fe | |||
| 33ff8e3488 | |||
| b2a5e870df | |||
| 42efae2d47 | |||
| 6919f989f7 | |||
| 82e9821dd8 | |||
| 1113402c7b | |||
| 2d2a6d2bf4 | |||
| 6fb824a0b3 | |||
| 26ae475590 | |||
| 3b35e523fd | |||
| 6c6f1b3dcd | |||
| 30c5e6fe7a | |||
| fda93a2977 | |||
| 151e5c58a8 | |||
| 32baa433b7 | |||
| b00d7d6585 | |||
| 954890278f | |||
| c07c77a489 | |||
| 85641efa08 | |||
| c43a02ba55 |
@@ -1,51 +1,3 @@
|
||||
Overview of Changes from GTK+ 2.17.2 to 2.17.3
|
||||
==============================================
|
||||
|
||||
* GtkFileChooser:
|
||||
- Shows the size column by default now
|
||||
|
||||
* GtkStatusIcon:
|
||||
- Has a title property, which can be used by ATs when they
|
||||
read status icons
|
||||
|
||||
* GtkInfoBar:
|
||||
- The default theme now includes color definitions for infobars
|
||||
- The ::use-tooltip-style style property has been removed
|
||||
|
||||
* GtkMountOperation now supports interaction during unmount operations.
|
||||
|
||||
* The client-side windows branch has been merged; GDK now maintains
|
||||
its own window hierarchy client-side, and only uses X windows where
|
||||
unavoidable. Some of the benefits of this change are
|
||||
- Reduced flicker
|
||||
- The ability to do transformed and animated rendering of widgets
|
||||
- Easier embedding of GTK+ widgets e.g. into Clutter scene graphs
|
||||
This is a fundamental change to the way GDK works, so watch out for
|
||||
regressions.
|
||||
|
||||
* Bugs fixed:
|
||||
586315 Crash in GTK+ 2.14 when calling gtk.FileChooser.list_shor...
|
||||
461944 pressing the volume icon in full screen shuts down the sound
|
||||
490724 iconview item's height would be changed event with same m...
|
||||
564063 regression: Left margin in popup menus
|
||||
582025 Accelerators fail for submenus
|
||||
585626 Setting widget tooltip hammers X11 server on any TCP/IP X...
|
||||
585802 Add API to make GtkStatusIcon accessible with a name
|
||||
585858 right-click Add-to-Booksmarks is sometimes greyed out
|
||||
586330 GtkButton ignores user_underline when an image is set
|
||||
318807 Offscreen windows and window redirection
|
||||
587716 GtkInfoBar broken on resize
|
||||
587485 GMountOperation::show-processes support
|
||||
|
||||
* Updated translations
|
||||
Brazilian Portuguese
|
||||
Estonian
|
||||
Hebrew
|
||||
Spanish
|
||||
Swedish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.17.1 to 2.17.2
|
||||
==============================================
|
||||
|
||||
|
||||
+1
-5
@@ -269,11 +269,7 @@
|
||||
/* #undef USE_MEDIALIB25 */
|
||||
|
||||
/* Define to 1 if XXM is available and should be used */
|
||||
#ifndef _MSC_VER
|
||||
# define USE_MMX 1
|
||||
#else
|
||||
# undef USE_MMX
|
||||
#endif
|
||||
#define USE_MMX 1
|
||||
|
||||
/* Define to 1 if no XInput should be used */
|
||||
/* #undef XINPUT_NONE */
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ m4_define([gtk_api_version], [2.0])
|
||||
m4_define([gtk_binary_version], [2.10.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.21.3])
|
||||
m4_define([glib_required_version], [2.19.7])
|
||||
m4_define([pango_required_version], [1.20])
|
||||
m4_define([atk_required_version], [1.13.0])
|
||||
m4_define([cairo_required_version], [1.6])
|
||||
|
||||
@@ -23,14 +23,14 @@ demos = \
|
||||
iconview.c \
|
||||
iconview_edit.c \
|
||||
images.c \
|
||||
infobar.c \
|
||||
links.c \
|
||||
links.c \
|
||||
list_store.c \
|
||||
menus.c \
|
||||
panes.c \
|
||||
pickers.c \
|
||||
pixbufs.c \
|
||||
printing.c \
|
||||
resolution_independence.c \
|
||||
rotated_text.c \
|
||||
search_entry.c \
|
||||
sizegroup.c \
|
||||
|
||||
@@ -553,7 +553,8 @@ do_appwindow (GtkWidget *do_widget)
|
||||
0, 0);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
200, 200);
|
||||
GTK_SIZE_ONE_TWELFTH_EM (200),
|
||||
GTK_SIZE_ONE_TWELFTH_EM (200));
|
||||
|
||||
contents = gtk_text_view_new ();
|
||||
gtk_widget_grab_focus (contents);
|
||||
|
||||
@@ -58,14 +58,32 @@ on_entry_changed (GtkWidget *widget, gpointer data)
|
||||
gtk_assistant_set_page_complete (assistant, current_page, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
on_unit_changed (GtkWidget *assistant,
|
||||
gpointer user_data)
|
||||
{
|
||||
int n;
|
||||
GdkPixbuf *pixbuf;
|
||||
GtkWidget *page;
|
||||
|
||||
/* update icons on all pages */
|
||||
for (n = 0; n < 3; n++)
|
||||
{
|
||||
page = gtk_assistant_get_nth_page (GTK_ASSISTANT (assistant), n);
|
||||
pixbuf = gtk_widget_render_icon (assistant, GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG, NULL);
|
||||
gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), page, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
create_page1 (GtkWidget *assistant)
|
||||
{
|
||||
GtkWidget *box, *label, *entry;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
box = gtk_hbox_new (FALSE, 12);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
|
||||
box = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
label = gtk_label_new ("You must fill out this entry to continue:");
|
||||
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
||||
@@ -91,8 +109,8 @@ create_page2 (GtkWidget *assistant)
|
||||
GtkWidget *box, *checkbutton;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
box = gtk_vbox_new (12, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
|
||||
box = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
|
||||
"even if you do not check this");
|
||||
@@ -134,7 +152,7 @@ do_assistant (GtkWidget *do_widget)
|
||||
{
|
||||
assistant = gtk_assistant_new ();
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (assistant), -1, 300);
|
||||
gtk_window_set_default_size (GTK_WINDOW (assistant), -1, GTK_SIZE_ONE_TWELFTH_EM (300));
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (assistant),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
@@ -151,6 +169,10 @@ do_assistant (GtkWidget *do_widget)
|
||||
G_CALLBACK (on_assistant_apply), NULL);
|
||||
g_signal_connect (G_OBJECT (assistant), "prepare",
|
||||
G_CALLBACK (on_assistant_prepare), NULL);
|
||||
|
||||
/* need to reset the header pixbufs to correct size when the units change */
|
||||
g_signal_connect (G_OBJECT (assistant), "unit-changed",
|
||||
G_CALLBACK (on_unit_changed), NULL);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (assistant))
|
||||
|
||||
+24
-24
@@ -6,10 +6,10 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *
|
||||
create_bbox (gint horizontal,
|
||||
char *title,
|
||||
gint spacing,
|
||||
gint layout)
|
||||
create_bbox (gint horizontal,
|
||||
char *title,
|
||||
GtkSize spacing,
|
||||
gint layout)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *bbox;
|
||||
@@ -22,7 +22,7 @@ create_bbox (gint horizontal,
|
||||
else
|
||||
bbox = gtk_vbutton_box_new ();
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (bbox), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (bbox), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_container_add (GTK_CONTAINER (frame), bbox);
|
||||
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
|
||||
@@ -61,56 +61,56 @@ do_button_box (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
main_vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), main_vbox);
|
||||
|
||||
frame_horz = gtk_frame_new ("Horizontal Button Boxes");
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, 10);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD),
|
||||
create_bbox (TRUE, "Spread", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_SPREAD),
|
||||
TRUE, TRUE, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE),
|
||||
TRUE, TRUE, 5);
|
||||
create_bbox (TRUE, "Edge", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_EDGE),
|
||||
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START),
|
||||
TRUE, TRUE, 5);
|
||||
create_bbox (TRUE, "Start", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_START),
|
||||
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END),
|
||||
TRUE, TRUE, 5);
|
||||
create_bbox (TRUE, "End", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_END),
|
||||
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
frame_vert = gtk_frame_new ("Vertical Button Boxes");
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, 10);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox),
|
||||
create_bbox (FALSE, "Spread", 30, GTK_BUTTONBOX_SPREAD),
|
||||
create_bbox (FALSE, "Spread", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_SPREAD),
|
||||
TRUE, TRUE, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox),
|
||||
create_bbox (FALSE, "Edge", 30, GTK_BUTTONBOX_EDGE),
|
||||
TRUE, TRUE, 5);
|
||||
create_bbox (FALSE, "Edge", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_EDGE),
|
||||
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox),
|
||||
create_bbox (FALSE, "Start", 30, GTK_BUTTONBOX_START),
|
||||
TRUE, TRUE, 5);
|
||||
create_bbox (FALSE, "Start", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_START),
|
||||
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox),
|
||||
create_bbox (FALSE, "End", 30, GTK_BUTTONBOX_END),
|
||||
TRUE, TRUE, 5);
|
||||
create_bbox (FALSE, "End", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_END),
|
||||
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
|
||||
@@ -354,8 +354,8 @@ create_frame (ChangeDisplayInfo *info,
|
||||
|
||||
*frame = gtk_frame_new (title);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (*frame), hbox);
|
||||
|
||||
scrollwin = gtk_scrolled_window_new (NULL, NULL);
|
||||
@@ -372,7 +372,7 @@ create_frame (ChangeDisplayInfo *info,
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (*tree_view));
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
|
||||
|
||||
*button_vbox = gtk_vbox_new (FALSE, 5);
|
||||
*button_vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), *button_vbox, FALSE, FALSE, 0);
|
||||
|
||||
if (!info->size_group)
|
||||
@@ -611,15 +611,15 @@ do_changedisplay (GtkWidget *do_widget)
|
||||
"Change", GTK_RESPONSE_OK,
|
||||
NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (info->window), 300, 400);
|
||||
gtk_window_set_default_size (GTK_WINDOW (info->window), GTK_SIZE_ONE_TWELFTH_EM (300), GTK_SIZE_ONE_TWELFTH_EM (400));
|
||||
|
||||
g_signal_connect (info->window, "response",
|
||||
G_CALLBACK (response_cb), info);
|
||||
g_signal_connect (info->window, "destroy",
|
||||
G_CALLBACK (destroy_cb), &info);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->window)->vbox), vbox,
|
||||
TRUE, TRUE, 0);
|
||||
|
||||
@@ -207,7 +207,7 @@ do_clipboard (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
@@ -215,8 +215,8 @@ do_clipboard (GtkWidget *do_widget)
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
|
||||
/* Create the first entry */
|
||||
@@ -232,8 +232,8 @@ do_clipboard (GtkWidget *do_widget)
|
||||
label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
|
||||
/* Create the second entry */
|
||||
@@ -249,8 +249,8 @@ do_clipboard (GtkWidget *do_widget)
|
||||
label = gtk_label_new ("Images can be transferred via the clipboard, too");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
|
||||
/* Create the first image */
|
||||
|
||||
@@ -87,10 +87,10 @@ do_colorsel (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/*
|
||||
@@ -108,7 +108,7 @@ do_colorsel (GtkWidget *do_widget)
|
||||
G_CALLBACK (expose_event_callback), NULL);
|
||||
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 200, 200);
|
||||
gtk_widget_set_size_request (da, GTK_SIZE_ONE_TWELFTH_EM (200), GTK_SIZE_ONE_TWELFTH_EM (200));
|
||||
/* set the color */
|
||||
gtk_widget_modify_bg (da, GTK_STATE_NORMAL, &color);
|
||||
|
||||
|
||||
+13
-16
@@ -11,8 +11,10 @@
|
||||
|
||||
enum
|
||||
{
|
||||
PIXBUF_COL,
|
||||
TEXT_COL
|
||||
STOCK_ID_COL,
|
||||
TEXT_COL,
|
||||
|
||||
NUM_COLUMNS,
|
||||
};
|
||||
|
||||
static gchar *
|
||||
@@ -50,7 +52,6 @@ create_stock_icon_store (void)
|
||||
};
|
||||
|
||||
GtkStockItem item;
|
||||
GdkPixbuf *pixbuf;
|
||||
GtkWidget *cellview;
|
||||
GtkTreeIter iter;
|
||||
GtkListStore *store;
|
||||
@@ -59,29 +60,25 @@ create_stock_icon_store (void)
|
||||
|
||||
cellview = gtk_cell_view_new ();
|
||||
|
||||
store = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
|
||||
store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (stock_id); i++)
|
||||
{
|
||||
if (stock_id[i])
|
||||
{
|
||||
pixbuf = gtk_widget_render_icon (cellview, stock_id[i],
|
||||
GTK_ICON_SIZE_BUTTON, NULL);
|
||||
gtk_stock_lookup (stock_id[i], &item);
|
||||
gtk_stock_lookup (stock_id[i], &item);
|
||||
label = strip_underscore (item.label);
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter,
|
||||
PIXBUF_COL, pixbuf,
|
||||
STOCK_ID_COL, stock_id[i],
|
||||
TEXT_COL, label,
|
||||
-1);
|
||||
g_object_unref (pixbuf);
|
||||
g_free (label);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter,
|
||||
PIXBUF_COL, NULL,
|
||||
TEXT_COL, "separator",
|
||||
-1);
|
||||
}
|
||||
@@ -343,9 +340,9 @@ do_combobox (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 2);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (2));
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/* A combobox demonstrating cell renderers, separators and
|
||||
@@ -355,7 +352,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
|
||||
box = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_container_add (GTK_CONTAINER (frame), box);
|
||||
|
||||
model = create_stock_icon_store ();
|
||||
@@ -366,7 +363,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
|
||||
"pixbuf", PIXBUF_COL,
|
||||
"stock-id", STOCK_ID_COL,
|
||||
NULL);
|
||||
|
||||
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo),
|
||||
@@ -396,7 +393,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
|
||||
box = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_container_add (GTK_CONTAINER (frame), box);
|
||||
|
||||
model = create_capital_store ();
|
||||
@@ -425,7 +422,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
|
||||
box = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_container_add (GTK_CONTAINER (frame), box);
|
||||
|
||||
combo = gtk_combo_box_entry_new_text ();
|
||||
|
||||
@@ -148,8 +148,9 @@
|
||||
</accessibility>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="default_height">250</property>
|
||||
<property name="default_width">440</property>
|
||||
<!-- 100 mm = 10 cm ~= 4 inches -->
|
||||
<property name="default_height">100 mm</property>
|
||||
<property name="default_width">36.6667em</property>
|
||||
<property name="title">GtkBuilder demo</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
|
||||
+11
-11
@@ -51,16 +51,16 @@ interactive_dialog_clicked (GtkButton *button,
|
||||
GTK_RESPONSE_CANCEL,
|
||||
NULL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
|
||||
|
||||
stock = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), stock, FALSE, FALSE, 0);
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0);
|
||||
label = gtk_label_new_with_mnemonic ("_Entry 1");
|
||||
gtk_table_attach_defaults (GTK_TABLE (table),
|
||||
@@ -112,17 +112,17 @@ do_dialog (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Dialogs");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
frame = gtk_frame_new ("Dialogs");
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
||||
|
||||
/* Standard message dialog */
|
||||
hbox = gtk_hbox_new (FALSE, 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
button = gtk_button_new_with_mnemonic ("_Message Dialog");
|
||||
g_signal_connect (button, "clicked",
|
||||
@@ -132,7 +132,7 @@ do_dialog (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
|
||||
|
||||
/* Interactive dialog*/
|
||||
hbox = gtk_hbox_new (FALSE, 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
vbox2 = gtk_vbox_new (FALSE, 0);
|
||||
|
||||
@@ -143,8 +143,8 @@ do_dialog (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new_with_mnemonic ("_Entry 1");
|
||||
|
||||
@@ -245,10 +245,10 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/*
|
||||
@@ -266,7 +266,7 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
gtk_widget_set_size_request (da, GTK_SIZE_ONE_TWELFTH_EM (100), GTK_SIZE_ONE_TWELFTH_EM (100));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
@@ -288,7 +288,7 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
gtk_widget_set_size_request (da, GTK_SIZE_ONE_TWELFTH_EM (100), GTK_SIZE_ONE_TWELFTH_EM (100));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
|
||||
@@ -328,11 +328,11 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Shopping list");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
@@ -365,7 +365,7 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (sw), treeview);
|
||||
|
||||
/* some buttons */
|
||||
hbox = gtk_hbox_new (TRUE, 4);
|
||||
hbox = gtk_hbox_new (TRUE, GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
|
||||
button = gtk_button_new_with_label ("Add item");
|
||||
@@ -378,7 +378,7 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
G_CALLBACK (remove_item), treeview);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 320, 200);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (320), GTK_SIZE_ONE_TWELFTH_EM (200));
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
|
||||
@@ -58,9 +58,9 @@ do_entry_completion (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example.");
|
||||
|
||||
@@ -32,9 +32,9 @@ do_expander (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
label = gtk_label_new ("Expander demo. Click on the triangle for details.");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
@@ -267,7 +267,7 @@ do_hypertext (GtkWidget *do_widget)
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
450, 450);
|
||||
GTK_SIZE_ONE_TWELFTH_EM (450), GTK_SIZE_ONE_TWELFTH_EM (450));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
@@ -263,7 +263,7 @@ do_iconview (GtkWidget *do_widget)
|
||||
GError *error;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (650), GTK_SIZE_ONE_TWELFTH_EM (400));
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
|
||||
@@ -332,10 +332,10 @@ do_images (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (cleanup_callback), NULL);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/* Info bar
|
||||
*
|
||||
* Info bar widgets are used to report important messages to the user.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void
|
||||
on_bar_response (GtkInfoBar *info_bar,
|
||||
gint response_id,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
"You clicked a button on an info bar");
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||
"Your response has id %d", response_id);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_infobar (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *bar;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *vbox2;
|
||||
GtkWidget *label;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new_with_buttons (GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
|
||||
g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
frame = gtk_frame_new ("Info bars");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 8);
|
||||
|
||||
vbox2 = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
||||
|
||||
/* Standard message dialog */
|
||||
label = gtk_label_new ("An example of different info bars");
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
{
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -173,9 +173,9 @@ do_list_store (GtkWidget *do_widget)
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 8);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
|
||||
@@ -206,7 +206,7 @@ do_list_store (GtkWidget *do_widget)
|
||||
add_columns (GTK_TREE_VIEW (treeview));
|
||||
|
||||
/* finish & show */
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 280, 250);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (280), GTK_SIZE_ONE_TWELFTH_EM (250));
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
|
||||
@@ -764,9 +764,9 @@ create_text (GtkTextBuffer **buffer,
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view),
|
||||
GTK_WRAP_WORD);
|
||||
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (text_view),
|
||||
2);
|
||||
GTK_SIZE_ONE_TWELFTH_EM (2));
|
||||
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (text_view),
|
||||
2);
|
||||
GTK_SIZE_ONE_TWELFTH_EM (2));
|
||||
}
|
||||
|
||||
return scrolled_window;
|
||||
@@ -792,7 +792,7 @@ create_tree (void)
|
||||
|
||||
gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
|
||||
GTK_SELECTION_BROWSE);
|
||||
gtk_widget_set_size_request (tree_view, 200, -1);
|
||||
gtk_widget_set_size_request (tree_view, GTK_SIZE_ONE_TWELFTH_EM (200), -1);
|
||||
|
||||
/* this code only supports 1 level of children. If we
|
||||
* want more we probably have to use a recursing function.
|
||||
@@ -946,6 +946,7 @@ main (int argc, char **argv)
|
||||
}
|
||||
/* -- End of hack -- */
|
||||
|
||||
gtk_enable_resolution_independence ();
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
setup_default_icon ();
|
||||
@@ -969,7 +970,7 @@ main (int argc, char **argv)
|
||||
gtk_label_new_with_mnemonic ("_Info"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title",
|
||||
"font", "Sans 18",
|
||||
"scale", PANGO_SCALE_XX_LARGE,
|
||||
NULL);
|
||||
g_object_unref (info_buffer);
|
||||
|
||||
@@ -999,9 +1000,9 @@ main (int argc, char **argv)
|
||||
"weight", PANGO_WEIGHT_BOLD,
|
||||
"foreground", "DarkGoldenrod4",
|
||||
NULL);
|
||||
g_object_unref (source_buffer);
|
||||
g_object_unref (source_buffer);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (600), GTK_SIZE_ONE_TWELFTH_EM (400));
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
|
||||
|
||||
@@ -179,8 +179,8 @@ do_menus (GtkWidget *do_widget)
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
gtk_widget_show (menuitem);
|
||||
|
||||
box2 = gtk_vbox_new (FALSE, 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
|
||||
box2 = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box2), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
|
||||
gtk_widget_show (box2);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ create_pane_options (GtkPaned *paned,
|
||||
GtkWidget *check_button;
|
||||
|
||||
frame = gtk_frame_new (frame_label);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
|
||||
table = gtk_table_new (3, 2, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
@@ -138,14 +138,14 @@ do_panes (GtkWidget *do_widget)
|
||||
|
||||
vpaned = gtk_vpaned_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), vpaned, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER(vpaned), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
hpaned = gtk_hpaned_new ();
|
||||
gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_size_request (frame, 60, 60);
|
||||
gtk_widget_set_size_request (frame, GTK_SIZE_ONE_TWELFTH_EM (60), GTK_SIZE_ONE_TWELFTH_EM (60));
|
||||
gtk_paned_add1 (GTK_PANED (hpaned), frame);
|
||||
|
||||
button = gtk_button_new_with_mnemonic ("_Hi there");
|
||||
@@ -153,12 +153,12 @@ do_panes (GtkWidget *do_widget)
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_size_request (frame, 80, 60);
|
||||
gtk_widget_set_size_request (frame, GTK_SIZE_ONE_TWELFTH_EM (80), GTK_SIZE_ONE_TWELFTH_EM (60));
|
||||
gtk_paned_add2 (GTK_PANED (hpaned), frame);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_size_request (frame, 60, 80);
|
||||
gtk_widget_set_size_request (frame, GTK_SIZE_ONE_TWELFTH_EM (60), GTK_SIZE_ONE_TWELFTH_EM (80));
|
||||
gtk_paned_add2 (GTK_PANED (vpaned), frame);
|
||||
|
||||
/* Now create toggle buttons to control sizing */
|
||||
|
||||
@@ -18,19 +18,20 @@ do_pickers (GtkWidget *do_widget)
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
table = gtk_table_new (4, 2, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 10);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (3));
|
||||
gtk_container_add (GTK_CONTAINER (window), table);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
|
||||
label = gtk_label_new ("Color:");
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
|
||||
+22
-39
@@ -13,19 +13,19 @@
|
||||
#define HEADER_HEIGHT (10*72/25.4)
|
||||
#define HEADER_GAP (3*72/25.4)
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
gchar *filename;
|
||||
gdouble font_size;
|
||||
|
||||
gint lines_per_page;
|
||||
gint lines_per_page;
|
||||
gchar **lines;
|
||||
gint num_lines;
|
||||
gint num_pages;
|
||||
} PrintData;
|
||||
|
||||
static void
|
||||
begin_print (GtkPrintOperation *operation,
|
||||
begin_print (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -35,9 +35,9 @@ begin_print (GtkPrintOperation *operation,
|
||||
double height;
|
||||
|
||||
height = gtk_print_context_get_height (context) - HEADER_HEIGHT - HEADER_GAP;
|
||||
|
||||
|
||||
data->lines_per_page = floor (height / data->font_size);
|
||||
|
||||
|
||||
g_file_get_contents (data->filename, &contents, NULL, NULL);
|
||||
|
||||
data->lines = g_strsplit (contents, "\n", 0);
|
||||
@@ -46,7 +46,7 @@ begin_print (GtkPrintOperation *operation,
|
||||
i = 0;
|
||||
while (data->lines[i] != NULL)
|
||||
i++;
|
||||
|
||||
|
||||
data->num_lines = i;
|
||||
data->num_pages = (data->num_lines - 1) / data->lines_per_page + 1;
|
||||
|
||||
@@ -72,10 +72,10 @@ draw_page (GtkPrintOperation *operation,
|
||||
width = gtk_print_context_get_width (context);
|
||||
|
||||
cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT);
|
||||
|
||||
|
||||
cairo_set_source_rgb (cr, 0.8, 0.8, 0.8);
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
|
||||
cairo_set_source_rgb (cr, 0, 0, 0);
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_stroke (cr);
|
||||
@@ -107,19 +107,19 @@ draw_page (GtkPrintOperation *operation,
|
||||
pango_layout_get_pixel_size (layout, &text_width, &text_height);
|
||||
cairo_move_to (cr, width - text_width - 4, (HEADER_HEIGHT - text_height) / 2);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
|
||||
|
||||
g_object_unref (layout);
|
||||
|
||||
|
||||
layout = gtk_print_context_create_pango_layout (context);
|
||||
|
||||
|
||||
desc = pango_font_description_from_string ("monospace");
|
||||
pango_font_description_set_size (desc, data->font_size * PANGO_SCALE);
|
||||
pango_layout_set_font_description (layout, desc);
|
||||
pango_font_description_free (desc);
|
||||
|
||||
|
||||
cairo_move_to (cr, 0, HEADER_HEIGHT + HEADER_GAP);
|
||||
line = page_nr * data->lines_per_page;
|
||||
for (i = 0; i < data->lines_per_page && line < data->num_lines; i++)
|
||||
for (i = 0; i < data->lines_per_page && line < data->num_lines; i++)
|
||||
{
|
||||
pango_layout_set_text (layout, data->lines[line], -1);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
@@ -131,7 +131,7 @@ draw_page (GtkPrintOperation *operation,
|
||||
}
|
||||
|
||||
static void
|
||||
end_print (GtkPrintOperation *operation,
|
||||
end_print (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -147,9 +147,7 @@ GtkWidget *
|
||||
do_printing (GtkWidget *do_widget)
|
||||
{
|
||||
GtkPrintOperation *operation;
|
||||
GtkPrintSettings *settings;
|
||||
PrintData *data;
|
||||
gchar *uri, *dir, *ext;
|
||||
GError *error = NULL;
|
||||
|
||||
operation = gtk_print_operation_new ();
|
||||
@@ -157,52 +155,37 @@ do_printing (GtkWidget *do_widget)
|
||||
data->filename = demo_find_file ("printing.c", NULL);
|
||||
data->font_size = 12.0;
|
||||
|
||||
g_signal_connect (G_OBJECT (operation), "begin-print",
|
||||
g_signal_connect (G_OBJECT (operation), "begin-print",
|
||||
G_CALLBACK (begin_print), data);
|
||||
g_signal_connect (G_OBJECT (operation), "draw-page",
|
||||
g_signal_connect (G_OBJECT (operation), "draw-page",
|
||||
G_CALLBACK (draw_page), data);
|
||||
g_signal_connect (G_OBJECT (operation), "end-print",
|
||||
g_signal_connect (G_OBJECT (operation), "end-print",
|
||||
G_CALLBACK (end_print), data);
|
||||
|
||||
gtk_print_operation_set_use_full_page (operation, FALSE);
|
||||
gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS);
|
||||
|
||||
settings = gtk_print_settings_new ();
|
||||
dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
|
||||
if (dir == NULL)
|
||||
dir = g_get_home_dir ();
|
||||
if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "ps") == 0)
|
||||
ext = ".ps";
|
||||
else
|
||||
ext = ".pdf";
|
||||
|
||||
uri = g_strconcat ("file://", dir, "/", "gtk-demo", ext, NULL);
|
||||
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
|
||||
gtk_print_operation_set_print_settings (operation, settings);
|
||||
|
||||
gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (do_widget), &error);
|
||||
|
||||
g_object_unref (operation);
|
||||
g_object_unref (settings);
|
||||
g_free (uri);
|
||||
|
||||
if (error)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (do_widget),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"%s", error->message);
|
||||
g_error_free (error);
|
||||
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
/* Resolution Independence
|
||||
*
|
||||
* This demonstates resolution independence features available since
|
||||
* version 2.14 of GTK+. Use the slider to change the effective DPI
|
||||
* per monitor. Note that the changes will only affect windows from
|
||||
* this process.
|
||||
*/
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkWindowGroup *window_group = NULL;
|
||||
static GtkWidget *hscale;
|
||||
static GtkWidget *label;
|
||||
static GtkWidget *button;
|
||||
static gdouble button_dpi;
|
||||
|
||||
#define INCHES_TO_MM 25.4
|
||||
|
||||
#define MIN_DPI 24.0
|
||||
#define MAX_DPI 480.0
|
||||
#define STEP_DPI 1.0
|
||||
|
||||
static void
|
||||
update (void)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
gint monitor_num;
|
||||
char *plug_name;
|
||||
char *s;
|
||||
gdouble dpi;
|
||||
char *font_name;
|
||||
GtkSettings *settings;
|
||||
int width_mm;
|
||||
int height_mm;
|
||||
GdkRectangle geometry;
|
||||
|
||||
plug_name = NULL;
|
||||
font_name = NULL;
|
||||
width_mm = -1;
|
||||
height_mm = -1;
|
||||
geometry.x = -1;
|
||||
geometry.y = -1;
|
||||
geometry.width = -1;
|
||||
geometry.height = -1;
|
||||
|
||||
screen = gtk_window_get_screen (GTK_WINDOW (window));
|
||||
monitor_num = gtk_widget_get_monitor_num (window);
|
||||
if (screen != NULL && monitor_num >= 0)
|
||||
{
|
||||
plug_name = gdk_screen_get_monitor_plug_name (screen, monitor_num);
|
||||
width_mm = gdk_screen_get_monitor_width_mm (screen, monitor_num);
|
||||
height_mm = gdk_screen_get_monitor_height_mm (screen, monitor_num);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, &geometry);
|
||||
}
|
||||
if (screen != NULL)
|
||||
settings = gtk_settings_get_for_screen (screen);
|
||||
else
|
||||
settings = gtk_settings_get_default ();
|
||||
g_object_get (settings, "gtk-font-name", &font_name, NULL);
|
||||
|
||||
s = g_strdup_printf ("Monitor %d (%s) @ %dx%d+%d+%d\n"
|
||||
"%d mm x %d mm\n"
|
||||
"DPI: %.1f x %.1f\n"
|
||||
"Font \"%s\"\n"
|
||||
"1 em -> %g pixels\n"
|
||||
"1 mm -> %g pixels",
|
||||
monitor_num,
|
||||
plug_name != NULL ? plug_name : "unknown name",
|
||||
geometry.width, geometry.height, geometry.x, geometry.y,
|
||||
width_mm, height_mm,
|
||||
INCHES_TO_MM * geometry.width / width_mm,
|
||||
INCHES_TO_MM * geometry.height / height_mm,
|
||||
font_name,
|
||||
gtk_size_to_pixel_double (screen, monitor_num, gtk_size_em (1.0)),
|
||||
gtk_size_to_pixel_double (screen, monitor_num, gtk_size_mm (1.0)));
|
||||
gtk_label_set_text (GTK_LABEL (label), s);
|
||||
g_free (s);
|
||||
|
||||
button_dpi = MIN (INCHES_TO_MM * geometry.width / width_mm,
|
||||
INCHES_TO_MM * geometry.height / height_mm);
|
||||
s = g_strdup_printf ("Set DPI to %.1f", button_dpi);
|
||||
gtk_button_set_label (GTK_BUTTON (button), s);
|
||||
g_free (s);
|
||||
|
||||
dpi = -1;
|
||||
if (screen != NULL)
|
||||
{
|
||||
dpi = gdk_screen_get_resolution_for_monitor (screen, monitor_num);
|
||||
gtk_range_set_value (GTK_RANGE (hscale), dpi);
|
||||
}
|
||||
|
||||
g_free (plug_name);
|
||||
g_free (font_name);
|
||||
}
|
||||
|
||||
static void
|
||||
window_mapped (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
update ();
|
||||
}
|
||||
|
||||
static void
|
||||
unit_changed (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
update ();
|
||||
}
|
||||
|
||||
static void
|
||||
monitor_num_notify (GtkWindow *window, GParamSpec *psec, gpointer user_data)
|
||||
{
|
||||
g_debug ("notify::monitor-num");
|
||||
update ();
|
||||
}
|
||||
|
||||
static void
|
||||
update_value (void)
|
||||
{
|
||||
gdouble slider_value;
|
||||
|
||||
slider_value = gtk_range_get_value (GTK_RANGE (hscale));
|
||||
if (slider_value >= MIN_DPI && slider_value <= MAX_DPI)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
gint monitor_num;
|
||||
|
||||
screen = gtk_window_get_screen (GTK_WINDOW (window));
|
||||
monitor_num = gtk_widget_get_monitor_num (window);
|
||||
if (screen != NULL && monitor_num >= 0)
|
||||
{
|
||||
gdk_screen_set_resolution_for_monitor (screen, monitor_num, slider_value);
|
||||
g_signal_emit_by_name (screen, "monitors-changed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean is_pressed = FALSE;
|
||||
|
||||
static gboolean
|
||||
hscale_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
|
||||
{
|
||||
is_pressed = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
hscale_button_release_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
|
||||
{
|
||||
is_pressed = FALSE;
|
||||
update_value ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
hscale_value_changed (GtkRange *range, gpointer user_data)
|
||||
{
|
||||
if (!is_pressed)
|
||||
update_value ();
|
||||
}
|
||||
|
||||
static char *
|
||||
hscale_format_value (GtkScale *scale, gdouble value, gpointer user_data)
|
||||
{
|
||||
return g_strdup_printf ("%g DPI", value);
|
||||
}
|
||||
|
||||
static void
|
||||
dpi_button_clicked (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
gtk_range_set_value (GTK_RANGE (hscale), button_dpi);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_resolution_independence (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
|
||||
if (window != NULL)
|
||||
goto have_window;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Resolution Independence");
|
||||
gtk_window_set_icon_name (GTK_WINDOW (window), "gtk-fullscreen");
|
||||
|
||||
g_signal_connect (G_OBJECT (window), "map", G_CALLBACK (window_mapped), NULL);
|
||||
g_signal_connect (G_OBJECT (window), "notify::monitor-num", G_CALLBACK (monitor_num_notify), NULL);
|
||||
g_signal_connect (G_OBJECT (window), "unit-changed", G_CALLBACK (unit_changed), NULL);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, gtk_size_em (1));
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
hscale = gtk_hscale_new_with_range (MIN_DPI, MAX_DPI, STEP_DPI);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hscale, FALSE, FALSE, 0);
|
||||
|
||||
g_signal_connect (G_OBJECT (hscale), "value-changed", G_CALLBACK (hscale_value_changed), NULL);
|
||||
g_signal_connect (G_OBJECT (hscale), "button-press-event", G_CALLBACK (hscale_button_press_event), NULL);
|
||||
g_signal_connect (G_OBJECT (hscale), "button-release-event", G_CALLBACK (hscale_button_release_event), NULL);
|
||||
g_signal_connect (G_OBJECT (hscale), "format-value", G_CALLBACK (hscale_format_value), NULL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), gtk_size_em (1));
|
||||
gtk_widget_set_size_request (window, GTK_SIZE_ONE_TWELFTH_EM (500), -1);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
button = gtk_button_new ();
|
||||
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (dpi_button_clicked), NULL);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
/* avoid dialogs (e.g. printing) grabbing focus from us */
|
||||
if (window_group == NULL)
|
||||
window_group = gtk_window_group_new ();
|
||||
gtk_window_group_add_window (window_group, GTK_WINDOW (window));
|
||||
|
||||
/* make sure we're on top */
|
||||
gtk_window_set_keep_above (GTK_WINDOW (window), TRUE);
|
||||
|
||||
have_window:
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
{
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -189,7 +189,8 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Rotated Text");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 4 * RADIUS, 2 * RADIUS);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
gtk_size_em ((4 * RADIUS)), gtk_size_em ((4 * RADIUS)));
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_hbox_new (TRUE, 0);
|
||||
@@ -207,19 +208,18 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
G_CALLBACK (rotated_text_expose_event), NULL);
|
||||
|
||||
/* And a label */
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
|
||||
gtk_label_set_angle (GTK_LABEL (label), 45);
|
||||
gtk_label_set_angle (label, 45);
|
||||
|
||||
/* Set up fancy stuff on the label */
|
||||
layout = gtk_label_get_layout (GTK_LABEL (label));
|
||||
layout = gtk_label_get_layout (label);
|
||||
pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout),
|
||||
fancy_shape_renderer,
|
||||
NULL, NULL);
|
||||
attrs = create_fancy_attr_list_for_layout (layout);
|
||||
gtk_label_set_attributes (GTK_LABEL (label), attrs);
|
||||
gtk_label_set_attributes (label, attrs);
|
||||
pango_attr_list_unref (attrs);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@ do_sizegroup (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
|
||||
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
|
||||
@@ -127,9 +127,9 @@ do_sizegroup (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
|
||||
add_row (GTK_TABLE (table), 0, size_group, "_Foreground", color_options);
|
||||
@@ -141,9 +141,9 @@ do_sizegroup (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
|
||||
add_row (GTK_TABLE (table), 0, size_group, "_Dashing", dash_options);
|
||||
|
||||
@@ -420,12 +420,12 @@ do_stock_browser (GtkWidget *do_widget)
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Stock Icons and Items");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), -1, 500);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), -1, GTK_SIZE_ONE_TWELFTH_EM (500));
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 8);
|
||||
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (window), hbox);
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
@@ -494,8 +494,8 @@ do_stock_browser (GtkWidget *do_widget)
|
||||
frame = gtk_frame_new ("Selected Item");
|
||||
gtk_container_add (GTK_CONTAINER (align), frame);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (4));
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
||||
|
||||
display = g_new (StockItemDisplay, 1);
|
||||
|
||||
@@ -182,9 +182,9 @@ do_textscroll (GtkWidget *do_widget)
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (600), GTK_SIZE_ONE_TWELFTH_EM (400));
|
||||
|
||||
hbox = gtk_hbox_new (TRUE, 6);
|
||||
hbox = gtk_hbox_new (TRUE, GTK_SIZE_ONE_TWELFTH_EM (6));
|
||||
gtk_container_add (GTK_CONTAINER (window), hbox);
|
||||
|
||||
create_text_view (hbox, TRUE);
|
||||
|
||||
+13
-10
@@ -114,7 +114,7 @@ create_tags (GtkTextBuffer *buffer)
|
||||
"justification", GTK_JUSTIFY_RIGHT, NULL);
|
||||
|
||||
gtk_text_buffer_create_tag (buffer, "wide_margins",
|
||||
"left_margin", 50, "right_margin", 50,
|
||||
"left_margin", GTK_SIZE_ONE_TWELFTH_EM (50), "right_margin", GTK_SIZE_ONE_TWELFTH_EM (50),
|
||||
NULL);
|
||||
|
||||
gtk_text_buffer_create_tag (buffer, "strikethrough",
|
||||
@@ -139,9 +139,9 @@ create_tags (GtkTextBuffer *buffer)
|
||||
gtk_text_buffer_create_tag (buffer, "rtl_quote",
|
||||
"wrap_mode", GTK_WRAP_WORD,
|
||||
"direction", GTK_TEXT_DIR_RTL,
|
||||
"indent", 30,
|
||||
"left_margin", 20,
|
||||
"right_margin", 20,
|
||||
"indent", GTK_SIZE_ONE_TWELFTH_EM (30),
|
||||
"left_margin", GTK_SIZE_ONE_TWELFTH_EM (20),
|
||||
"right_margin", GTK_SIZE_ONE_TWELFTH_EM (20),
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,10 @@ insert_text (GtkTextBuffer *buffer)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
scaled = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR);
|
||||
scaled = gdk_pixbuf_scale_simple (pixbuf,
|
||||
gtk_size_to_pixel (NULL, 0, GTK_SIZE_ONE_TWELFTH_EM (32)),
|
||||
gtk_size_to_pixel (NULL, 0, GTK_SIZE_ONE_TWELFTH_EM (32)),
|
||||
GDK_INTERP_BILINEAR);
|
||||
g_object_unref (pixbuf);
|
||||
pixbuf = scaled;
|
||||
|
||||
@@ -409,7 +412,7 @@ attach_widgets (GtkTextView *text_view)
|
||||
{
|
||||
widget = gtk_hscale_new (NULL);
|
||||
gtk_range_set_range (GTK_RANGE (widget), 0, 100);
|
||||
gtk_widget_set_size_request (widget, 70, -1);
|
||||
gtk_widget_set_size_request (widget, GTK_SIZE_ONE_TWELFTH_EM (70), -1);
|
||||
}
|
||||
else if (i == 3)
|
||||
{
|
||||
@@ -454,7 +457,7 @@ do_textview (GtkWidget *do_widget)
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
450, 450);
|
||||
GTK_SIZE_ONE_TWELFTH_EM (450), GTK_SIZE_ONE_TWELFTH_EM (450));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
@@ -463,7 +466,7 @@ do_textview (GtkWidget *do_widget)
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
|
||||
|
||||
vpaned = gtk_vpaned_new ();
|
||||
gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER(vpaned), GTK_SIZE_ONE_TWELFTH_EM (5));
|
||||
gtk_container_add (GTK_CONTAINER (window), vpaned);
|
||||
|
||||
/* For convenience, we just use the autocreated buffer from
|
||||
@@ -534,7 +537,7 @@ recursive_attach_view (int depth,
|
||||
gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &color);
|
||||
|
||||
align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (align), 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (align), GTK_SIZE_ONE_TWELFTH_EM (1));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (event_box), align);
|
||||
gtk_container_add (GTK_CONTAINER (align), child_view);
|
||||
@@ -590,7 +593,7 @@ easter_egg_callback (GtkWidget *button,
|
||||
window_ptr = &window;
|
||||
g_object_add_weak_pointer (G_OBJECT (window), window_ptr);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (300), GTK_SIZE_ONE_TWELFTH_EM (400));
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* havoc column */
|
||||
@@ -313,7 +313,7 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* tim column */
|
||||
@@ -336,7 +336,7 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* owen column */
|
||||
@@ -358,7 +358,7 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* dave column */
|
||||
@@ -380,7 +380,7 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
}
|
||||
|
||||
@@ -402,8 +402,8 @@ do_tree_store (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox),
|
||||
@@ -435,7 +435,7 @@ do_tree_store (GtkWidget *do_widget)
|
||||
/* expand all rows after the treeview widget has been realized */
|
||||
g_signal_connect (treeview, "realize",
|
||||
G_CALLBACK (gtk_tree_view_expand_all), NULL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (50), GTK_SIZE_ONE_TWELFTH_EM (400));
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
|
||||
@@ -204,7 +204,7 @@ do_ui_manager (GtkWidget *do_widget)
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new ("Type\n<alt>\nto start");
|
||||
gtk_widget_set_size_request (label, 200, 200);
|
||||
gtk_widget_set_size_request (label, GTK_SIZE_ONE_TWELFTH_EM (200), GTK_SIZE_ONE_TWELFTH_EM (200));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (box1), label, TRUE, TRUE, 0);
|
||||
|
||||
@@ -213,8 +213,8 @@ do_ui_manager (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
|
||||
|
||||
|
||||
box2 = gtk_vbox_new (FALSE, 10);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
|
||||
box2 = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box2), GTK_SIZE_ONE_TWELFTH_EM (10));
|
||||
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
|
||||
|
||||
button = gtk_button_new_with_label ("close");
|
||||
|
||||
@@ -103,9 +103,5 @@
|
||||
<index id="api-index-2-16" role="2.16">
|
||||
<title>Index of new symbols in 2.16</title>
|
||||
<xi:include href="xml/api-index-2.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-18" role="2.18">
|
||||
<title>Index of new symbols in 2.18</title>
|
||||
<xi:include href="xml/api-index-2.18.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
</book>
|
||||
|
||||
@@ -225,8 +225,12 @@ gdk_screen_broadcast_client_message
|
||||
gdk_screen_get_setting
|
||||
gdk_screen_get_font_options
|
||||
gdk_screen_set_font_options
|
||||
gdk_screen_get_font_options_for_monitor
|
||||
gdk_screen_set_font_options_for_monitor
|
||||
gdk_screen_get_resolution
|
||||
gdk_screen_set_resolution
|
||||
gdk_screen_get_resolution_for_monitor
|
||||
gdk_screen_set_resolution_for_monitor
|
||||
gdk_screen_get_active_window
|
||||
gdk_screen_get_window_stack
|
||||
<SUBSECTION Spawning>
|
||||
@@ -661,7 +665,6 @@ gdk_window_resize
|
||||
gdk_window_move_resize
|
||||
gdk_window_scroll
|
||||
gdk_window_move_region
|
||||
gdk_window_ensure_native
|
||||
gdk_window_reparent
|
||||
gdk_window_clear
|
||||
gdk_window_clear_area
|
||||
@@ -740,7 +743,6 @@ gdk_window_get_colormap
|
||||
gdk_window_get_type
|
||||
gdk_window_get_origin
|
||||
gdk_window_get_deskrelative_origin
|
||||
gdk_window_get_root_coords
|
||||
gdk_window_get_pointer
|
||||
GdkModifierType
|
||||
gdk_window_get_parent
|
||||
@@ -769,10 +771,6 @@ GdkPointerHooks
|
||||
gdk_set_pointer_hooks
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_offscreen_window_get_pixmap
|
||||
gdk_offscreen_window_set_embedder
|
||||
gdk_offscreen_window_get_embedder
|
||||
gdk_window_geometry_changed
|
||||
gdk_window_redirect_to_drawable
|
||||
gdk_window_remove_redirection
|
||||
|
||||
@@ -880,6 +878,7 @@ gdk_pango_renderer_set_stipple
|
||||
gdk_pango_renderer_set_override_color
|
||||
gdk_pango_context_get
|
||||
gdk_pango_context_get_for_screen
|
||||
gdk_pango_context_get_for_screen_for_monitor
|
||||
gdk_pango_context_set_colormap
|
||||
GdkPangoAttrEmbossed
|
||||
GdkPangoAttrEmbossColor
|
||||
@@ -937,7 +936,6 @@ gdk_region_get_clipbox
|
||||
gdk_region_get_rectangles
|
||||
gdk_region_empty
|
||||
gdk_region_equal
|
||||
gdk_region_rect_equal
|
||||
gdk_region_point_in
|
||||
gdk_region_rect_in
|
||||
GdkOverlapType
|
||||
|
||||
@@ -94,7 +94,6 @@ for the possible window states
|
||||
was added in 2.8.
|
||||
@GDK_DAMAGE: the content of the window has been changed. This event type
|
||||
was added in 2.14.
|
||||
@GDK_EVENT_LAST: marks the end of the GdkEventType enumeration. Added in 2.18
|
||||
|
||||
<!-- ##### ENUM GdkEventMask ##### -->
|
||||
<para>
|
||||
|
||||
@@ -175,16 +175,6 @@ included in the region, while areas overlapped an even number of times are not.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_region_rect_equal ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@region:
|
||||
@rectangle:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_region_point_in ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -189,38 +189,6 @@ these types.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GdkWindow::from-embedder ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@gdkwindow: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@arg3:
|
||||
@arg4:
|
||||
|
||||
<!-- ##### SIGNAL GdkWindow::pick-embedded-child ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@gdkwindow: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GdkWindow::to-embedder ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@gdkwindow: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@arg3:
|
||||
@arg4:
|
||||
|
||||
<!-- ##### ENUM GdkWindowType ##### -->
|
||||
<para>
|
||||
Describes the kind of window.
|
||||
@@ -232,7 +200,6 @@ Describes the kind of window.
|
||||
@GDK_WINDOW_DIALOG: useless/deprecated compatibility type
|
||||
@GDK_WINDOW_TEMP: override redirect temporary window (used to implement #GtkMenu)
|
||||
@GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
|
||||
@GDK_WINDOW_OFFSCREEN: offscreen window. Since 2.18
|
||||
|
||||
<!-- ##### ENUM GdkWindowClass ##### -->
|
||||
<para>
|
||||
@@ -718,15 +685,6 @@ Deprecated equivalent of g_object_unref()
|
||||
@dy:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_window_ensure_native ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@window:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_window_reparent ##### -->
|
||||
<para>
|
||||
|
||||
@@ -1426,18 +1384,6 @@ Deprecated equivalent of gdk_drawable_get_type().
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_window_get_root_coords ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@window:
|
||||
@x:
|
||||
@y:
|
||||
@root_x:
|
||||
@root_y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_window_get_pointer ##### -->
|
||||
<para>
|
||||
|
||||
@@ -1713,39 +1659,12 @@ Applications should never have any reason to use this facility
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_offscreen_window_get_pixmap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@window:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_offscreen_window_set_embedder ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@window:
|
||||
@embedder:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_offscreen_window_get_embedder ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@window:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_window_geometry_changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@window:
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("../gdk-docs.sgml" "book" "refsect2" "")
|
||||
End:
|
||||
-->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_window_redirect_to_drawable ##### -->
|
||||
@@ -1771,11 +1690,3 @@ Applications should never have any reason to use this facility
|
||||
@window:
|
||||
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("../gdk-docs.sgml" "book" "refsect2" "")
|
||||
End:
|
||||
-->
|
||||
|
||||
|
||||
|
||||
@@ -345,7 +345,10 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/layout-rlbt.png \
|
||||
$(srcdir)/images/layout-rltb.png \
|
||||
$(srcdir)/images/layout-tblr.png \
|
||||
$(srcdir)/images/layout-tbrl.png
|
||||
$(srcdir)/images/layout-tbrl.png \
|
||||
$(srcdir)/images/gtk-ri-file-chooser-size-6.png \
|
||||
$(srcdir)/images/gtk-ri-file-chooser-size-12.png \
|
||||
$(srcdir)/images/gtk-ri-file-chooser-size-24.png
|
||||
|
||||
# Extra options to supply to gtkdoc-fixref
|
||||
FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html \
|
||||
|
||||
@@ -126,6 +126,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
<xi:include href="xml/gtktypeutils.xml" />
|
||||
<xi:include href="xml/gtktesting.xml" />
|
||||
<xi:include href="xml/filesystem.xml" />
|
||||
<xi:include href="xml/gtksize.xml" />
|
||||
</part>
|
||||
|
||||
<part id="gtkobjects">
|
||||
|
||||
@@ -328,6 +328,7 @@ GtkAlignment
|
||||
gtk_alignment_new
|
||||
gtk_alignment_set
|
||||
gtk_alignment_get_padding
|
||||
gtk_alignment_get_padding_unit
|
||||
gtk_alignment_set_padding
|
||||
<SUBSECTION Standard>
|
||||
GTK_ALIGNMENT
|
||||
@@ -471,9 +472,11 @@ gtk_box_pack_end_defaults
|
||||
gtk_box_get_homogeneous
|
||||
gtk_box_set_homogeneous
|
||||
gtk_box_get_spacing
|
||||
gtk_box_get_spacing_unit
|
||||
gtk_box_set_spacing
|
||||
gtk_box_reorder_child
|
||||
gtk_box_query_child_packing
|
||||
gtk_box_query_child_packing_unit
|
||||
gtk_box_set_child_packing
|
||||
<SUBSECTION Standard>
|
||||
GTK_BOX
|
||||
@@ -1033,6 +1036,7 @@ gtk_container_unset_focus_chain
|
||||
gtk_container_class_find_child_property
|
||||
gtk_container_class_install_child_property
|
||||
gtk_container_class_list_child_properties
|
||||
gtk_container_get_border_width_unit
|
||||
<SUBSECTION Standard>
|
||||
GTK_CONTAINER
|
||||
GTK_IS_CONTAINER
|
||||
@@ -1414,6 +1418,7 @@ gtk_expander_set_expanded
|
||||
gtk_expander_get_expanded
|
||||
gtk_expander_set_spacing
|
||||
gtk_expander_get_spacing
|
||||
gtk_expander_get_spacing_unit
|
||||
gtk_expander_set_label
|
||||
gtk_expander_get_label
|
||||
gtk_expander_set_use_underline
|
||||
@@ -1931,14 +1936,19 @@ gtk_icon_view_set_columns
|
||||
gtk_icon_view_get_columns
|
||||
gtk_icon_view_set_item_width
|
||||
gtk_icon_view_get_item_width
|
||||
gtk_icon_view_get_item_width_unit
|
||||
gtk_icon_view_set_spacing
|
||||
gtk_icon_view_get_spacing
|
||||
gtk_icon_view_get_spacing_unit
|
||||
gtk_icon_view_set_row_spacing
|
||||
gtk_icon_view_get_row_spacing
|
||||
gtk_icon_view_get_row_spacing_unit
|
||||
gtk_icon_view_set_column_spacing
|
||||
gtk_icon_view_get_column_spacing
|
||||
gtk_icon_view_get_column_spacing_unit
|
||||
gtk_icon_view_set_margin
|
||||
gtk_icon_view_get_margin
|
||||
gtk_icon_view_get_margin_unit
|
||||
gtk_icon_view_select_path
|
||||
gtk_icon_view_unselect_path
|
||||
gtk_icon_view_path_is_selected
|
||||
@@ -2016,6 +2026,7 @@ gtk_image_set
|
||||
gtk_image_get
|
||||
gtk_image_set_pixel_size
|
||||
gtk_image_get_pixel_size
|
||||
gtk_image_get_pixel_size_unit
|
||||
<SUBSECTION Standard>
|
||||
GTK_IMAGE
|
||||
GTK_IS_IMAGE
|
||||
@@ -2420,8 +2431,6 @@ gtk_menu_get_title
|
||||
gtk_menu_set_monitor
|
||||
gtk_menu_get_monitor
|
||||
gtk_menu_get_tearoff_state
|
||||
gtk_menu_set_reserve_toggle_size
|
||||
gtk_menu_get_reserve_toggle_size
|
||||
<SUBSECTION>
|
||||
gtk_menu_popdown
|
||||
gtk_menu_reposition
|
||||
@@ -2629,6 +2638,7 @@ gtk_misc_set_alignment
|
||||
gtk_misc_set_padding
|
||||
gtk_misc_get_alignment
|
||||
gtk_misc_get_padding
|
||||
gtk_misc_get_padding_unit
|
||||
<SUBSECTION Standard>
|
||||
GTK_MISC
|
||||
GTK_IS_MISC
|
||||
@@ -3597,8 +3607,6 @@ gtk_status_icon_set_tooltip_markup
|
||||
gtk_status_icon_get_tooltip_markup
|
||||
gtk_status_icon_set_has_tooltip
|
||||
gtk_status_icon_get_has_tooltip
|
||||
gtk_status_icon_set_title
|
||||
gtk_status_icon_get_title
|
||||
gtk_status_icon_set_visible
|
||||
gtk_status_icon_get_visible
|
||||
gtk_status_icon_set_blinking
|
||||
@@ -3634,10 +3642,14 @@ gtk_table_set_row_spacings
|
||||
gtk_table_set_col_spacings
|
||||
gtk_table_set_homogeneous
|
||||
gtk_table_get_default_row_spacing
|
||||
gtk_table_get_default_row_spacing_unit
|
||||
gtk_table_get_homogeneous
|
||||
gtk_table_get_row_spacing
|
||||
gtk_table_get_row_spacing_unit
|
||||
gtk_table_get_col_spacing
|
||||
gtk_table_get_col_spacing_unit
|
||||
gtk_table_get_default_col_spacing
|
||||
gtk_table_get_default_col_spacing_unit
|
||||
<SUBSECTION Standard>
|
||||
GTK_TABLE
|
||||
GTK_IS_TABLE
|
||||
@@ -4017,18 +4029,24 @@ gtk_text_view_set_overwrite
|
||||
gtk_text_view_get_overwrite
|
||||
gtk_text_view_set_pixels_above_lines
|
||||
gtk_text_view_get_pixels_above_lines
|
||||
gtk_text_view_get_pixels_above_lines_unit
|
||||
gtk_text_view_set_pixels_below_lines
|
||||
gtk_text_view_get_pixels_below_lines
|
||||
gtk_text_view_get_pixels_below_lines_unit
|
||||
gtk_text_view_set_pixels_inside_wrap
|
||||
gtk_text_view_get_pixels_inside_wrap
|
||||
gtk_text_view_get_pixels_inside_wrap_unit
|
||||
gtk_text_view_set_justification
|
||||
gtk_text_view_get_justification
|
||||
gtk_text_view_set_left_margin
|
||||
gtk_text_view_get_left_margin
|
||||
gtk_text_view_get_left_margin_unit
|
||||
gtk_text_view_set_right_margin
|
||||
gtk_text_view_get_right_margin
|
||||
gtk_text_view_get_right_margin_unit
|
||||
gtk_text_view_set_indent
|
||||
gtk_text_view_get_indent
|
||||
gtk_text_view_get_indent_unit
|
||||
gtk_text_view_set_tabs
|
||||
gtk_text_view_get_tabs
|
||||
gtk_text_view_set_accepts_tab
|
||||
@@ -4753,6 +4771,7 @@ gtk_tree_view_column_set_cell_data_func
|
||||
gtk_tree_view_column_clear_attributes
|
||||
gtk_tree_view_column_set_spacing
|
||||
gtk_tree_view_column_get_spacing
|
||||
gtk_tree_view_column_get_spacing_unit
|
||||
gtk_tree_view_column_set_visible
|
||||
gtk_tree_view_column_get_visible
|
||||
gtk_tree_view_column_set_resizable
|
||||
@@ -4761,11 +4780,14 @@ gtk_tree_view_column_set_sizing
|
||||
gtk_tree_view_column_get_sizing
|
||||
gtk_tree_view_column_get_width
|
||||
gtk_tree_view_column_get_fixed_width
|
||||
gtk_tree_view_column_get_fixed_width_unit
|
||||
gtk_tree_view_column_set_fixed_width
|
||||
gtk_tree_view_column_set_min_width
|
||||
gtk_tree_view_column_get_min_width
|
||||
gtk_tree_view_column_get_min_width_unit
|
||||
gtk_tree_view_column_set_max_width
|
||||
gtk_tree_view_column_get_max_width
|
||||
gtk_tree_view_column_get_max_width_unit
|
||||
gtk_tree_view_column_clicked
|
||||
gtk_tree_view_column_set_title
|
||||
gtk_tree_view_column_get_title
|
||||
@@ -4814,6 +4836,7 @@ GtkTreeViewMappingFunc
|
||||
GtkTreeViewSearchEqualFunc
|
||||
gtk_tree_view_new
|
||||
gtk_tree_view_get_level_indentation
|
||||
gtk_tree_view_get_level_indentation_unit
|
||||
gtk_tree_view_get_show_expanders
|
||||
gtk_tree_view_set_level_indentation
|
||||
gtk_tree_view_set_show_expanders
|
||||
@@ -4988,13 +5011,17 @@ GtkCellRendererMode
|
||||
GtkCellRenderer
|
||||
GtkCellRendererClass
|
||||
gtk_cell_renderer_get_size
|
||||
gtk_cell_renderer_get_size_unit
|
||||
gtk_cell_renderer_render
|
||||
gtk_cell_renderer_activate
|
||||
gtk_cell_renderer_start_editing
|
||||
gtk_cell_renderer_editing_canceled
|
||||
gtk_cell_renderer_stop_editing
|
||||
gtk_cell_renderer_get_fixed_size
|
||||
gtk_cell_renderer_get_fixed_size_unit
|
||||
gtk_cell_renderer_set_fixed_size
|
||||
gtk_cell_renderer_get_tree_view_column
|
||||
gtk_cell_renderer_get_tree_view
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_CELL_RENDERER
|
||||
@@ -5529,6 +5556,15 @@ gtk_widget_set_has_tooltip
|
||||
gtk_widget_trigger_tooltip_query
|
||||
gtk_widget_get_snapshot
|
||||
gtk_widget_get_window
|
||||
gtk_widget_get_monitor_num
|
||||
gtk_widget_get_size_request_unit
|
||||
gtk_widget_size_to_pixel
|
||||
gtk_widget_size_to_pixel_double
|
||||
gtk_widget_style_get_property_unit
|
||||
gtk_widget_style_get_unit_valist
|
||||
gtk_widget_style_get_unit
|
||||
gtk_widget_get_unit_valist
|
||||
gtk_widget_get_unit
|
||||
<SUBSECTION>
|
||||
gtk_requisition_copy
|
||||
gtk_requisition_free
|
||||
@@ -5615,6 +5651,7 @@ gtk_window_get_deletable
|
||||
gtk_window_get_default_icon_list
|
||||
gtk_window_get_default_icon_name
|
||||
gtk_window_get_default_size
|
||||
gtk_window_get_default_size_unit
|
||||
gtk_window_get_destroy_with_parent
|
||||
gtk_window_get_frame_dimensions
|
||||
gtk_window_get_has_frame
|
||||
@@ -5650,6 +5687,7 @@ gtk_window_set_icon_name
|
||||
gtk_window_set_auto_startup_notification
|
||||
gtk_window_get_opacity
|
||||
gtk_window_set_opacity
|
||||
gtk_window_get_monitor_num
|
||||
<SUBSECTION Standard>
|
||||
GTK_WINDOW
|
||||
GTK_IS_WINDOW
|
||||
@@ -5818,6 +5856,9 @@ gtk_style_set_font
|
||||
gtk_style_get_style_property
|
||||
gtk_style_get_valist
|
||||
gtk_style_get
|
||||
gtk_style_get_style_property_unit
|
||||
gtk_style_get_unit_valist
|
||||
gtk_style_get_unit
|
||||
gtk_draw_hline
|
||||
gtk_draw_vline
|
||||
gtk_draw_shadow
|
||||
@@ -6494,7 +6535,10 @@ gtk_icon_set_ref
|
||||
gtk_icon_set_render_icon
|
||||
gtk_icon_set_unref
|
||||
gtk_icon_size_lookup
|
||||
gtk_icon_size_lookup_unit
|
||||
gtk_icon_size_lookup_for_settings
|
||||
gtk_icon_size_lookup_for_settings_for_monitor
|
||||
gtk_icon_size_lookup_for_settings_unit
|
||||
gtk_icon_size_register
|
||||
gtk_icon_size_register_alias
|
||||
gtk_icon_size_from_name
|
||||
@@ -7040,3 +7084,31 @@ GTK_TYPE_ORIENTABLE
|
||||
<SUBSECTION Private>
|
||||
gtk_orientable_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Units</TITLE>
|
||||
<FILE>gtksize</FILE>
|
||||
GtkSize
|
||||
GtkUSize
|
||||
GtkSizeUnit
|
||||
gtk_size_em
|
||||
gtk_size_mm
|
||||
gtk_size_get_em
|
||||
gtk_size_get_mm
|
||||
GTK_SIZE_ONE_TWELFTH_EM
|
||||
GTK_SIZE_MAXPIXEL
|
||||
GTK_SIZE_MINPIXEL
|
||||
gtk_size_get_unit
|
||||
gtk_size_to_pixel
|
||||
gtk_size_to_pixel_double
|
||||
gtk_size_to_string
|
||||
gtk_param_spec_size
|
||||
gtk_value_set_size
|
||||
gtk_value_get_size
|
||||
gtk_value_size_skip_conversion
|
||||
gtk_param_spec_usize
|
||||
gtk_value_set_usize
|
||||
gtk_value_get_usize
|
||||
gtk_value_usize_skip_conversion
|
||||
gtk_enable_resolution_independence
|
||||
</SECTION>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 135 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -119,11 +119,6 @@ should be accessed using the functions below.
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:reserve-toggle-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:tearoff-state ##### -->
|
||||
<para>
|
||||
|
||||
@@ -359,24 +354,6 @@ See gtk_menu_set_accel_group().
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_reserve_toggle_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@reserve_toggle_size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_reserve_toggle_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_popdown ##### -->
|
||||
<para>
|
||||
Removes the menu from the screen.
|
||||
|
||||
@@ -23,7 +23,7 @@ realized at least once. The following example demonstrates a way to do this:
|
||||
<informalexample><programlisting>
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* make sure the type is realized */
|
||||
/* make sure the type is realized &ast/
|
||||
g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
|
||||
|
||||
g_object_set (gtk_settings_get_default (), "gtk-menu-images", FALSE, NULL);
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Units
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### TYPEDEF GtkSize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### TYPEDEF GtkUSize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkSizeUnit ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_SIZE_UNIT_PIXEL:
|
||||
@GTK_SIZE_UNIT_EM:
|
||||
@GTK_SIZE_UNIT_MM:
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_em ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@em:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_mm ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@mm:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_get_em ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_get_mm ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_SIZE_ONE_TWELFTH_EM ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_SIZE_MAXPIXEL ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_SIZE_MINPIXEL ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_get_unit ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_to_pixel ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@screen:
|
||||
@monitor_num:
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_to_pixel_double ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@screen:
|
||||
@monitor_num:
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_size_to_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_param_spec_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@name:
|
||||
@nick:
|
||||
@blurb:
|
||||
@minimum:
|
||||
@maximum:
|
||||
@default_value:
|
||||
@flags:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_value_set_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
@v_size:
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_value_get_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_value_size_skip_conversion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_param_spec_usize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@name:
|
||||
@nick:
|
||||
@blurb:
|
||||
@minimum:
|
||||
@maximum:
|
||||
@default_value:
|
||||
@flags:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_value_set_usize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
@v_size:
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_value_get_usize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_value_usize_skip_conversion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@value:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_enable_resolution_independence ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
@@ -172,11 +172,6 @@ on Win32 doesn't allow to embed arbitrary widgets.
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkStatusIcon:title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkStatusIcon:tooltip-markup ##### -->
|
||||
<para>
|
||||
|
||||
@@ -425,24 +420,6 @@ on Win32 doesn't allow to embed arbitrary widgets.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_status_icon_set_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@status_icon:
|
||||
@title:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_status_icon_get_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@status_icon:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_status_icon_set_visible ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ source code release of GTK+. For binary distributions, please check with
|
||||
your vendor.</para>
|
||||
|
||||
<para>A copy is available online for reference at <ulink
|
||||
url="http://www.gtk.org/documentation.html#Tutorials">http://www.gtk.org/documentation.html#Tutorials</ulink>. You can also find other GTK+ tutorials there.</para>
|
||||
url="http://www.gtk.org/tutorial/">http://www.gtk.org/tutorial</ulink>.</para>
|
||||
|
||||
<para>A packaged version of this tutorial is available from
|
||||
<para>A packaged verion of this tutorial is available from
|
||||
<ulink url="ftp://ftp.gtk.org/pub/gtk/tutorial/">
|
||||
ftp://ftp.gtk.org/pub/gtk/tutorial</ulink> which contains the tutorial in
|
||||
various different formats. This package is primary for those people wanting
|
||||
to have the tutorial available for offline reference and for printing. Note
|
||||
that the packaged version may be older than the online version.</para>
|
||||
various different formats. This
|
||||
package is primary for those people wanting to have the tutorial
|
||||
available for offline reference and for printing.</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
|
||||
@@ -2452,7 +2452,7 @@ gchar *
|
||||
gdk_pixbuf_format_get_description (GdkPixbufFormat *format)
|
||||
{
|
||||
gchar *domain;
|
||||
const gchar *description;
|
||||
gchar *description;
|
||||
g_return_val_if_fail (format != NULL, NULL);
|
||||
|
||||
if (format->domain != NULL)
|
||||
|
||||
@@ -15,12 +15,11 @@ GDK_PIXBUF_VER = 2.0
|
||||
# but not yet -DINCLUDE_png
|
||||
##USEGDIP=1
|
||||
# to get _working_ include modules we need respective defines ...
|
||||
#
|
||||
BUILT_IN_FORMATS = \
|
||||
!IFDEF USEGDIP
|
||||
-DINCLUDE_gdiplus \
|
||||
!ELSE
|
||||
-DINCLUDE_bmp -DINCLUDE_gif -DINCLUDE_ico -DINCLUDE_jpeg -DINCLUDE_tiff \
|
||||
-DINCLUDE_bmp -DINCLUDE_gif -DINCLUDE_ico -DINCLUDE_jpeg -DINCLUDE_tiff \
|
||||
!ENDIF
|
||||
-DINCLUDE_png \
|
||||
-DINCLUDE_xpm -DINCLUDE_wbmp \
|
||||
|
||||
+3
-4
@@ -120,7 +120,6 @@ gdk_c_sources = \
|
||||
gdkintl.h \
|
||||
gdkkeys.c \
|
||||
gdkkeyuni.c \
|
||||
gdkoffscreenwindow.c \
|
||||
gdkpango.c \
|
||||
gdkpixbuf-drawable.c \
|
||||
gdkpixbuf-render.c \
|
||||
@@ -152,10 +151,10 @@ gdk_built_sources = \
|
||||
gdkincludedir = $(includedir)/gtk-2.0/gdk
|
||||
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
|
||||
|
||||
# gdkmarshalers.c is not here because it is currently an empty file
|
||||
common_sources = \
|
||||
$(gdk_c_sources) \
|
||||
gdkenumtypes.c \
|
||||
gdkmarshalers.c \
|
||||
gdkmarshalers.h
|
||||
|
||||
libgdk_directfb_2_0_la_SOURCES = $(common_sources)
|
||||
@@ -269,11 +268,11 @@ gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
|
||||
# Marshaller generation
|
||||
#
|
||||
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
|
||||
$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
|
||||
$(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
|
||||
&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
|
||||
|| ( rm -f gdkmarshalers-h.tmp && exit 1)
|
||||
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
|
||||
(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
|
||||
(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
|
||||
&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
|
||||
|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
|
||||
|
||||
|
||||
@@ -57,8 +57,9 @@ const GOptionEntry _gdk_windowing_args[] =
|
||||
{ NULL}
|
||||
};
|
||||
|
||||
/* Main entry point for gdk in 2.6 args are parsed
|
||||
*/
|
||||
/**
|
||||
Main entry point for gdk in 2.6 args are parsed
|
||||
**/
|
||||
GdkDisplay * gdk_display_open (const gchar *display_name)
|
||||
{
|
||||
IDirectFB *directfb;
|
||||
|
||||
@@ -59,8 +59,9 @@
|
||||
void
|
||||
_gdk_windowing_init (void)
|
||||
{
|
||||
/* Not that usable called before parse_args
|
||||
*/
|
||||
/**
|
||||
Not that usable called before parse_args
|
||||
**/
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1640,8 +1640,9 @@ gdk_directfb_window_clear_area (GdkWindow *window,
|
||||
|
||||
impl = GDK_DRAWABLE_IMPL_DIRECTFB (private->impl);
|
||||
|
||||
/* Follow XClearArea definition for zero height width
|
||||
*/
|
||||
/**
|
||||
Follow XClearArea definition for zero height width
|
||||
**/
|
||||
if( width == 0 )
|
||||
width = impl->width-x;
|
||||
if( height == 0 )
|
||||
|
||||
+23
-31
@@ -69,6 +69,9 @@ gdk_get_use_xshm
|
||||
gdk_set_use_xshm
|
||||
#endif
|
||||
gdk_keyboard_grab
|
||||
gdk_keyboard_grab_info_libgtk_only
|
||||
gdk_pointer_grab
|
||||
gdk_pointer_grab_info_libgtk_only
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -82,9 +85,6 @@ gdk_pointer_is_grabbed
|
||||
gdk_pointer_ungrab
|
||||
gdk_event_send_client_message
|
||||
gdk_event_send_clientmessage_toall
|
||||
gdk_keyboard_grab_info_libgtk_only
|
||||
gdk_pointer_grab_info_libgtk_only
|
||||
gdk_display_pointer_is_grabbed
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -254,6 +254,12 @@ gdk_visual_type_get_type G_GNUC_CONST
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_PIXMAP_H__)
|
||||
#if IN_FILE(__GDK_PIXMAP_X11_C__)
|
||||
gdk_bitmap_create_from_data
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_FONT_H__)
|
||||
#if IN_FILE(__GDK_FONT_C__)
|
||||
#ifndef GDK_DISABLE_DEPRECATED
|
||||
@@ -460,6 +466,7 @@ gdk_display_get_default_screen
|
||||
gdk_display_get_name
|
||||
gdk_display_get_n_screens
|
||||
gdk_display_get_screen
|
||||
gdk_display_pointer_is_grabbed
|
||||
gdk_display_pointer_ungrab
|
||||
gdk_display_keyboard_ungrab
|
||||
gdk_display_open
|
||||
@@ -660,16 +667,10 @@ gdk_window_set_back_pixmap
|
||||
gdk_window_set_cursor
|
||||
gdk_window_get_geometry
|
||||
gdk_window_get_origin
|
||||
gdk_window_get_root_coords
|
||||
gdk_window_get_deskrelative_origin
|
||||
gdk_window_shape_combine_mask
|
||||
gdk_window_shape_combine_region
|
||||
gdk_window_set_child_shapes
|
||||
gdk_window_merge_child_shapes
|
||||
gdk_window_input_shape_combine_mask
|
||||
gdk_window_input_shape_combine_region
|
||||
gdk_window_set_child_input_shapes
|
||||
gdk_window_merge_child_input_shapes
|
||||
gdk_window_set_static_gravities
|
||||
gdk_window_reparent
|
||||
gdk_window_add_filter
|
||||
@@ -715,24 +716,6 @@ gdk_window_set_user_data
|
||||
gdk_window_thaw_toplevel_updates_libgtk_only
|
||||
gdk_window_thaw_updates
|
||||
gdk_window_set_composited
|
||||
gdk_pointer_grab
|
||||
gdk_window_beep
|
||||
gdk_window_geometry_changed
|
||||
gdk_window_ensure_native
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_WINDOW_H__)
|
||||
#if IN_FILE(__GDK_OFFSCREEN_WINDOW_C__)
|
||||
gdk_offscreen_window_get_pixmap
|
||||
gdk_offscreen_window_set_embedder
|
||||
gdk_offscreen_window_get_embedder
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_INTERNALS_H__)
|
||||
#if IN_FILE(__GDK_OFFSCREEN_WINDOW_C__)
|
||||
gdk_offscreen_window_get_type G_GNUC_CONST
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -750,6 +733,7 @@ gdk_window_lookup
|
||||
gdk_window_lookup_for_display
|
||||
#ifndef GDK_DISABLE_DEPRECATED
|
||||
gdk_window_set_hints
|
||||
gdk_window_get_deskrelative_origin
|
||||
#endif
|
||||
gdk_window_get_type_hint
|
||||
gdk_window_set_type_hint
|
||||
@@ -764,12 +748,15 @@ gdk_window_set_startup_id
|
||||
gdk_window_set_transient_for
|
||||
gdk_window_get_root_origin
|
||||
gdk_window_get_frame_extents
|
||||
gdk_window_input_shape_combine_mask
|
||||
gdk_window_input_shape_combine_region
|
||||
gdk_window_set_override_redirect
|
||||
gdk_window_set_accept_focus
|
||||
gdk_window_set_focus_on_map
|
||||
gdk_window_set_icon_list
|
||||
gdk_window_set_icon
|
||||
gdk_window_set_icon_name
|
||||
gdk_window_beep
|
||||
gdk_window_set_opacity
|
||||
gdk_window_iconify
|
||||
gdk_window_deiconify
|
||||
@@ -786,6 +773,8 @@ gdk_window_set_group
|
||||
gdk_window_get_decorations
|
||||
gdk_window_set_decorations
|
||||
gdk_window_set_functions
|
||||
gdk_window_set_child_input_shapes
|
||||
gdk_window_merge_child_input_shapes
|
||||
gdk_window_begin_move_drag
|
||||
gdk_window_begin_resize_drag
|
||||
gdk_window_enable_synchronized_configure
|
||||
@@ -900,6 +889,7 @@ gdk_pango_attr_embossed_new
|
||||
gdk_pango_attr_stipple_new
|
||||
gdk_pango_context_get
|
||||
gdk_pango_context_get_for_screen
|
||||
gdk_pango_context_get_for_screen_for_monitor
|
||||
#ifndef GDK_DISABLE_DEPRECATED
|
||||
gdk_pango_context_set_colormap
|
||||
#endif
|
||||
@@ -936,24 +926,23 @@ gdk_pixbuf_render_to_drawable_alpha
|
||||
|
||||
#if IN_HEADER(__GDK_PIXMAP_H__)
|
||||
#if IN_FILE(__GDK_PIXMAP_C__)
|
||||
gdk_bitmap_create_from_data
|
||||
gdk_pixmap_colormap_create_from_xpm
|
||||
gdk_pixmap_create_from_data
|
||||
gdk_pixmap_create_from_xpm
|
||||
gdk_pixmap_colormap_create_from_xpm_d
|
||||
gdk_pixmap_create_from_xpm_d
|
||||
gdk_pixmap_get_type G_GNUC_CONST
|
||||
gdk_pixmap_new
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_PIXMAP_H__)
|
||||
#if IN_FILE(__GDK_PIXMAP_X11_C__)
|
||||
gdk_pixmap_create_from_data
|
||||
gdk_pixmap_foreign_new
|
||||
gdk_pixmap_foreign_new_for_display
|
||||
gdk_pixmap_foreign_new_for_screen
|
||||
gdk_pixmap_lookup
|
||||
gdk_pixmap_lookup_for_display
|
||||
gdk_pixmap_new
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -963,7 +952,6 @@ gdk_region_copy
|
||||
gdk_region_destroy
|
||||
gdk_region_empty
|
||||
gdk_region_equal
|
||||
gdk_region_rect_equal
|
||||
gdk_region_get_clipbox
|
||||
gdk_region_get_rectangles
|
||||
gdk_region_intersect
|
||||
@@ -1021,8 +1009,12 @@ gdk_screen_get_monitor_at_point
|
||||
gdk_screen_get_monitor_at_window
|
||||
gdk_screen_set_font_options
|
||||
gdk_screen_get_font_options
|
||||
gdk_screen_set_font_options_for_monitor
|
||||
gdk_screen_get_font_options_for_monitor
|
||||
gdk_screen_set_resolution
|
||||
gdk_screen_get_resolution
|
||||
gdk_screen_get_resolution_for_monitor
|
||||
gdk_screen_set_resolution_for_monitor
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -50,10 +50,6 @@ gdk_cairo_create (GdkDrawable *drawable)
|
||||
|
||||
surface = _gdk_drawable_ref_cairo_surface (drawable);
|
||||
cr = cairo_create (surface);
|
||||
|
||||
if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return cr;
|
||||
|
||||
+7
-635
@@ -22,11 +22,9 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <math.h>
|
||||
#include <glib.h>
|
||||
#include "gdk.h" /* gdk_event_send_client_message() */
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkmarshalers.h"
|
||||
#include "gdkscreen.h"
|
||||
@@ -62,14 +60,6 @@ static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window
|
||||
static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
static GdkWindow *gdk_window_real_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow *gdk_display_real_get_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
@@ -77,8 +67,8 @@ static char *gdk_sm_client_id;
|
||||
|
||||
static const GdkDisplayPointerHooks default_pointer_hooks = {
|
||||
_gdk_windowing_get_pointer,
|
||||
gdk_window_real_window_get_pointer,
|
||||
gdk_display_real_get_window_at_pointer
|
||||
_gdk_windowing_window_get_pointer,
|
||||
_gdk_windowing_window_at_pointer
|
||||
};
|
||||
|
||||
static const GdkDisplayPointerHooks singlehead_pointer_hooks = {
|
||||
@@ -120,7 +110,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDisplayClass, closed),
|
||||
NULL, NULL,
|
||||
_gdk_marshal_VOID__BOOLEAN,
|
||||
gdk_marshal_VOID__BOOLEAN,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
G_TYPE_BOOLEAN);
|
||||
@@ -444,25 +434,6 @@ _gdk_get_sm_client_id (void)
|
||||
return gdk_sm_client_id;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_enable_motion_hints (GdkDisplay *display)
|
||||
{
|
||||
gulong serial;
|
||||
|
||||
if (display->pointer_info.motion_hint_serial != 0)
|
||||
{
|
||||
serial = _gdk_windowing_window_get_next_serial (display);
|
||||
/* We might not actually generate the next request, so
|
||||
make sure this triggers always, this may cause it to
|
||||
trigger slightly too early, but this is just a hint
|
||||
anyway. */
|
||||
if (serial > 0)
|
||||
serial--;
|
||||
if (serial < display->pointer_info.motion_hint_serial)
|
||||
display->pointer_info.motion_hint_serial = serial;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_pointer:
|
||||
* @display: a #GdkDisplay
|
||||
@@ -502,68 +473,6 @@ gdk_display_get_pointer (GdkDisplay *display,
|
||||
*mask = tmp_mask;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_display_real_get_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
{
|
||||
GdkWindow *window;
|
||||
gint x, y;
|
||||
|
||||
window = _gdk_windowing_window_at_pointer (display, &x, &y, NULL);
|
||||
|
||||
/* This might need corrections, as the native window returned
|
||||
may contain client side children */
|
||||
if (window)
|
||||
{
|
||||
double xx, yy;
|
||||
|
||||
window = _gdk_window_find_descendant_at (window,
|
||||
x, y,
|
||||
&xx, &yy);
|
||||
x = floor (xx + 0.5);
|
||||
y = floor (yy + 0.5);
|
||||
}
|
||||
|
||||
*win_x = x;
|
||||
*win_y = y;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_window_real_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
gint tmpx, tmpy;
|
||||
GdkModifierType tmp_mask;
|
||||
gboolean normal_child;
|
||||
|
||||
private = (GdkWindowObject *) window;
|
||||
|
||||
normal_child = GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_pointer (window,
|
||||
&tmpx, &tmpy,
|
||||
&tmp_mask);
|
||||
/* We got the coords on the impl, convert to the window */
|
||||
tmpx -= private->abs_x;
|
||||
tmpy -= private->abs_y;
|
||||
|
||||
if (x)
|
||||
*x = tmpx;
|
||||
if (y)
|
||||
*y = tmpy;
|
||||
if (mask)
|
||||
*mask = tmp_mask;
|
||||
|
||||
if (normal_child)
|
||||
return _gdk_window_find_child_at (window, tmpx, tmpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_window_at_pointer:
|
||||
* @display: a #GdkDisplay
|
||||
@@ -677,8 +586,8 @@ singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
return gdk_window_real_window_get_pointer (gdk_drawable_get_display (window),
|
||||
window, x, y, mask);
|
||||
return _gdk_windowing_window_get_pointer (gdk_drawable_get_display (window),
|
||||
window, x, y, mask);
|
||||
}
|
||||
|
||||
static GdkWindow*
|
||||
@@ -686,8 +595,8 @@ singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
{
|
||||
return gdk_display_real_get_window_at_pointer (gdk_screen_get_display (screen),
|
||||
win_x, win_y);
|
||||
return _gdk_windowing_window_at_pointer (gdk_screen_get_display (screen),
|
||||
win_x, win_y);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -723,542 +632,5 @@ gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks)
|
||||
return (GdkPointerHooks *)result;
|
||||
}
|
||||
|
||||
static void
|
||||
generate_grab_broken_event (GdkWindow *window,
|
||||
gboolean keyboard,
|
||||
gboolean implicit,
|
||||
GdkWindow *grab_window)
|
||||
{
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
{
|
||||
GdkEvent event;
|
||||
event.type = GDK_GRAB_BROKEN;
|
||||
event.grab_broken.window = window;
|
||||
event.grab_broken.send_event = 0;
|
||||
event.grab_broken.keyboard = keyboard;
|
||||
event.grab_broken.implicit = implicit;
|
||||
event.grab_broken.grab_window = grab_window;
|
||||
gdk_event_put (&event);
|
||||
}
|
||||
}
|
||||
|
||||
GdkPointerGrabInfo *
|
||||
_gdk_display_get_last_pointer_grab (GdkDisplay *display)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
l = g_list_last (display->pointer_grabs);
|
||||
|
||||
if (l == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return (GdkPointerGrabInfo *)l->data;
|
||||
}
|
||||
|
||||
|
||||
GdkPointerGrabInfo *
|
||||
_gdk_display_add_pointer_grab (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
GdkWindow *native_window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
unsigned long serial_start,
|
||||
guint32 time,
|
||||
gboolean implicit)
|
||||
{
|
||||
GdkPointerGrabInfo *info, *other_info;
|
||||
GList *l;
|
||||
|
||||
info = g_new0 (GdkPointerGrabInfo, 1);
|
||||
|
||||
info->window = g_object_ref (window);
|
||||
info->native_window = g_object_ref (native_window);
|
||||
info->serial_start = serial_start;
|
||||
info->serial_end = G_MAXULONG;
|
||||
info->owner_events = owner_events;
|
||||
info->event_mask = event_mask;
|
||||
info->time = time;
|
||||
info->implicit = implicit;
|
||||
|
||||
/* Find the first grab that has a larger start time (if any) and insert
|
||||
* before that. I.E we insert after already existing grabs with same
|
||||
* start time */
|
||||
for (l = display->pointer_grabs; l != NULL; l = l->next)
|
||||
{
|
||||
other_info = l->data;
|
||||
|
||||
if (info->serial_start < other_info->serial_start)
|
||||
break;
|
||||
}
|
||||
display->pointer_grabs =
|
||||
g_list_insert_before (display->pointer_grabs, l, info);
|
||||
|
||||
/* Make sure the new grab end before next grab */
|
||||
if (l)
|
||||
{
|
||||
other_info = l->data;
|
||||
info->serial_end = other_info->serial_start;
|
||||
}
|
||||
|
||||
/* Find any previous grab and update its end time */
|
||||
l = g_list_find (display->pointer_grabs, info);
|
||||
l = l->prev;
|
||||
if (l)
|
||||
{
|
||||
other_info = l->data;
|
||||
other_info->serial_end = serial_start;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
static void
|
||||
free_pointer_grab (GdkPointerGrabInfo *info)
|
||||
{
|
||||
g_object_unref (info->window);
|
||||
g_object_unref (info->native_window);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
/* _gdk_synthesize_crossing_events only works inside one toplevel.
|
||||
This function splits things into two calls if needed, converting the
|
||||
coordinates to the right toplevel */
|
||||
static void
|
||||
synthesize_crossing_events (GdkDisplay *display,
|
||||
GdkWindow *src_window,
|
||||
GdkWindow *dest_window,
|
||||
GdkCrossingMode crossing_mode,
|
||||
guint32 time,
|
||||
gulong serial)
|
||||
{
|
||||
GdkWindow *src_toplevel, *dest_toplevel;
|
||||
GdkModifierType state;
|
||||
int x, y;
|
||||
|
||||
if (src_window)
|
||||
src_toplevel = gdk_window_get_toplevel (src_window);
|
||||
else
|
||||
src_toplevel = NULL;
|
||||
if (dest_window)
|
||||
dest_toplevel = gdk_window_get_toplevel (dest_window);
|
||||
else
|
||||
dest_toplevel = NULL;
|
||||
|
||||
if (src_toplevel == NULL && dest_toplevel == NULL)
|
||||
return;
|
||||
|
||||
if (src_toplevel == NULL ||
|
||||
src_toplevel == dest_toplevel)
|
||||
{
|
||||
/* Same toplevels */
|
||||
gdk_window_get_pointer (dest_toplevel,
|
||||
&x, &y, &state);
|
||||
_gdk_synthesize_crossing_events (display,
|
||||
src_window,
|
||||
dest_window,
|
||||
crossing_mode,
|
||||
x, y, state,
|
||||
time,
|
||||
NULL,
|
||||
serial);
|
||||
}
|
||||
else if (dest_toplevel == NULL)
|
||||
{
|
||||
gdk_window_get_pointer (src_toplevel,
|
||||
&x, &y, &state);
|
||||
_gdk_synthesize_crossing_events (display,
|
||||
src_window,
|
||||
NULL,
|
||||
crossing_mode,
|
||||
x, y, state,
|
||||
time,
|
||||
NULL,
|
||||
serial);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Different toplevels */
|
||||
gdk_window_get_pointer (src_toplevel,
|
||||
&x, &y, &state);
|
||||
_gdk_synthesize_crossing_events (display,
|
||||
src_window,
|
||||
NULL,
|
||||
crossing_mode,
|
||||
x, y, state,
|
||||
time,
|
||||
NULL,
|
||||
serial);
|
||||
gdk_window_get_pointer (dest_toplevel,
|
||||
&x, &y, &state);
|
||||
_gdk_synthesize_crossing_events (display,
|
||||
NULL,
|
||||
dest_window,
|
||||
crossing_mode,
|
||||
x, y, state,
|
||||
time,
|
||||
NULL,
|
||||
serial);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
switch_to_pointer_grab (GdkDisplay *display,
|
||||
GdkPointerGrabInfo *grab,
|
||||
GdkPointerGrabInfo *last_grab,
|
||||
guint32 time,
|
||||
gulong serial)
|
||||
{
|
||||
GdkWindow *src_window, *pointer_window;
|
||||
GdkWindowObject *w;
|
||||
GList *old_grabs;
|
||||
GdkModifierType state;
|
||||
int x, y;
|
||||
|
||||
/* Temporarily unset pointer to make sure we send the crossing events below */
|
||||
old_grabs = display->pointer_grabs;
|
||||
display->pointer_grabs = NULL;
|
||||
|
||||
if (grab)
|
||||
{
|
||||
/* New grab is in effect */
|
||||
|
||||
/* We need to generate crossing events for the grab.
|
||||
* However, there are never any crossing events for implicit grabs
|
||||
* TODO: ... Actually, this could happen if the pointer window
|
||||
* doesn't have button mask so a parent gets the event...
|
||||
*/
|
||||
if (!grab->implicit)
|
||||
{
|
||||
/* We send GRAB crossing events from the window under the pointer to the
|
||||
grab window. Except if there is an old grab then we start from that */
|
||||
if (last_grab)
|
||||
src_window = last_grab->window;
|
||||
else
|
||||
src_window = display->pointer_info.window_under_pointer;
|
||||
|
||||
if (src_window != grab->window)
|
||||
{
|
||||
synthesize_crossing_events (display,
|
||||
src_window, grab->window,
|
||||
GDK_CROSSING_GRAB, time, serial);
|
||||
}
|
||||
|
||||
/* !owner_event Grabbing a window that we're not inside, current status is
|
||||
now NULL (i.e. outside grabbed window) */
|
||||
if (!grab->owner_events && display->pointer_info.window_under_pointer != grab->window)
|
||||
_gdk_display_set_window_under_pointer (display, NULL);
|
||||
}
|
||||
|
||||
grab->activated = TRUE;
|
||||
}
|
||||
else if (last_grab)
|
||||
{
|
||||
pointer_window = _gdk_windowing_window_at_pointer (display, &x, &y, &state);
|
||||
if (pointer_window != NULL &&
|
||||
(GDK_WINDOW_DESTROYED (pointer_window) ||
|
||||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT ||
|
||||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_FOREIGN))
|
||||
pointer_window = NULL;
|
||||
|
||||
/* We force checked what window we're in, so we need to
|
||||
* update the toplevel_under_pointer info, as that won't get told of
|
||||
* this change.
|
||||
*/
|
||||
if (display->pointer_info.toplevel_under_pointer)
|
||||
g_object_unref (display->pointer_info.toplevel_under_pointer);
|
||||
display->pointer_info.toplevel_under_pointer = NULL;
|
||||
|
||||
if (pointer_window)
|
||||
{
|
||||
/* Convert to toplevel */
|
||||
w = (GdkWindowObject *)pointer_window;
|
||||
while (/*w->parent != NULL && */
|
||||
w->parent->window_type != GDK_WINDOW_ROOT)
|
||||
{
|
||||
x += w->x;
|
||||
y += w->y;
|
||||
w = w->parent;
|
||||
}
|
||||
|
||||
/* w is now toplevel and x,y in toplevel coords */
|
||||
display->pointer_info.toplevel_under_pointer = g_object_ref (w);
|
||||
|
||||
/* Find (possibly virtual) child window */
|
||||
pointer_window =
|
||||
_gdk_window_find_descendant_at ((GdkWindow *)w,
|
||||
x, y,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
if (pointer_window != last_grab->window)
|
||||
synthesize_crossing_events (display,
|
||||
last_grab->window, pointer_window,
|
||||
GDK_CROSSING_UNGRAB, time, serial);
|
||||
|
||||
/* We're now ungrabbed, update the window_under_pointer */
|
||||
_gdk_display_set_window_under_pointer (display, pointer_window);
|
||||
|
||||
if (last_grab->implicit_ungrab)
|
||||
generate_grab_broken_event (last_grab->window,
|
||||
FALSE, TRUE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
display->pointer_grabs = old_grabs;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_pointer_grab_update (GdkDisplay *display,
|
||||
gulong current_serial)
|
||||
{
|
||||
GdkPointerGrabInfo *current_grab, *next_grab;
|
||||
guint32 time;
|
||||
|
||||
time = display->last_event_time;
|
||||
|
||||
while (display->pointer_grabs != NULL)
|
||||
{
|
||||
current_grab = display->pointer_grabs->data;
|
||||
|
||||
if (current_grab->serial_start > current_serial)
|
||||
return; /* Hasn't started yet */
|
||||
|
||||
if (current_grab->serial_end > current_serial ||
|
||||
(current_grab->serial_end == current_serial &&
|
||||
current_grab->grab_one_pointer_release_event))
|
||||
{
|
||||
/* This one hasn't ended yet.
|
||||
its the currently active one or scheduled to be active */
|
||||
|
||||
if (!current_grab->activated)
|
||||
switch_to_pointer_grab (display, current_grab, NULL, time, current_serial);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
next_grab = NULL;
|
||||
if (display->pointer_grabs->next)
|
||||
{
|
||||
/* This is the next active grab */
|
||||
next_grab = display->pointer_grabs->next->data;
|
||||
|
||||
if (next_grab->serial_start > current_serial)
|
||||
next_grab = NULL; /* Actually its not yet active */
|
||||
}
|
||||
|
||||
if (next_grab == NULL ||
|
||||
current_grab->window != next_grab->window)
|
||||
generate_grab_broken_event (GDK_WINDOW (current_grab->window),
|
||||
FALSE, current_grab->implicit,
|
||||
next_grab? next_grab->window : NULL);
|
||||
|
||||
|
||||
/* Remove old grab */
|
||||
display->pointer_grabs =
|
||||
g_list_delete_link (display->pointer_grabs,
|
||||
display->pointer_grabs);
|
||||
|
||||
switch_to_pointer_grab (display,
|
||||
next_grab, current_grab,
|
||||
time, current_serial);
|
||||
|
||||
free_pointer_grab (current_grab);
|
||||
}
|
||||
}
|
||||
|
||||
static GList *
|
||||
find_pointer_grab (GdkDisplay *display,
|
||||
gulong serial)
|
||||
{
|
||||
GdkPointerGrabInfo *grab;
|
||||
GList *l;
|
||||
|
||||
for (l = display->pointer_grabs; l != NULL; l = l->next)
|
||||
{
|
||||
grab = l->data;
|
||||
|
||||
if (serial >= grab->serial_start && serial < grab->serial_end)
|
||||
return l;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
GdkPointerGrabInfo *
|
||||
_gdk_display_has_pointer_grab (GdkDisplay *display,
|
||||
gulong serial)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
l = find_pointer_grab (display, serial);
|
||||
if (l)
|
||||
return l->data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Returns true if last grab was ended */
|
||||
gboolean
|
||||
_gdk_display_end_pointer_grab (GdkDisplay *display,
|
||||
gulong serial,
|
||||
GdkWindow *if_child,
|
||||
gboolean implicit)
|
||||
{
|
||||
GdkPointerGrabInfo *grab;
|
||||
GList *l;
|
||||
|
||||
l = find_pointer_grab (display, serial);
|
||||
|
||||
if (l == NULL)
|
||||
return FALSE;
|
||||
|
||||
grab = l->data;
|
||||
if (grab &&
|
||||
(if_child == NULL ||
|
||||
_gdk_window_event_parent_of (grab->window, if_child)))
|
||||
{
|
||||
grab->serial_end = serial;
|
||||
grab->implicit_ungrab = implicit;
|
||||
return l->next == NULL;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_set_has_keyboard_grab (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
GdkWindow *native_window,
|
||||
gboolean owner_events,
|
||||
unsigned long serial,
|
||||
guint32 time)
|
||||
{
|
||||
if (display->keyboard_grab.window != NULL &&
|
||||
display->keyboard_grab.window != window)
|
||||
generate_grab_broken_event (display->keyboard_grab.window,
|
||||
TRUE, FALSE, window);
|
||||
|
||||
display->keyboard_grab.window = window;
|
||||
display->keyboard_grab.native_window = native_window;
|
||||
display->keyboard_grab.owner_events = owner_events;
|
||||
display->keyboard_grab.serial = serial;
|
||||
display->keyboard_grab.time = time;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_unset_has_keyboard_grab (GdkDisplay *display,
|
||||
gboolean implicit)
|
||||
{
|
||||
if (implicit)
|
||||
generate_grab_broken_event (display->keyboard_grab.window,
|
||||
TRUE, FALSE, NULL);
|
||||
display->keyboard_grab.window = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_keyboard_grab_info_libgtk_only:
|
||||
* @display: the display for which to get the grab information
|
||||
* @grab_window: location to store current grab window
|
||||
* @owner_events: location to store boolean indicating whether
|
||||
* the @owner_events flag to gdk_keyboard_grab() was %TRUE.
|
||||
*
|
||||
* Determines information about the current keyboard grab.
|
||||
* This is not public API and must not be used by applications.
|
||||
*
|
||||
* Return value: %TRUE if this application currently has the
|
||||
* keyboard grabbed.
|
||||
**/
|
||||
gboolean
|
||||
gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
if (display->keyboard_grab.window)
|
||||
{
|
||||
if (grab_window)
|
||||
*grab_window = display->keyboard_grab.window;
|
||||
if (owner_events)
|
||||
*owner_events = display->keyboard_grab.owner_events;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_pointer_grab_info_libgtk_only:
|
||||
* @display: the #GdkDisplay for which to get the grab information
|
||||
* @grab_window: location to store current grab window
|
||||
* @owner_events: location to store boolean indicating whether
|
||||
* the @owner_events flag to gdk_pointer_grab() was %TRUE.
|
||||
*
|
||||
* Determines information about the current pointer grab.
|
||||
* This is not public API and must not be used by applications.
|
||||
*
|
||||
* Return value: %TRUE if this application currently has the
|
||||
* pointer grabbed.
|
||||
**/
|
||||
gboolean
|
||||
gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
{
|
||||
GdkPointerGrabInfo *info;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
/* What we're interested in is the steady state (ie last grab),
|
||||
because we're interested e.g. if we grabbed so that we
|
||||
can ungrab, even if our grab is not active just yet. */
|
||||
info = _gdk_display_get_last_pointer_grab (display);
|
||||
|
||||
if (info)
|
||||
{
|
||||
if (grab_window)
|
||||
*grab_window = info->window;
|
||||
if (owner_events)
|
||||
*owner_events = info->owner_events;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gdk_display_pointer_is_grabbed:
|
||||
* @display: a #GdkDisplay
|
||||
*
|
||||
* Test if the pointer is grabbed.
|
||||
*
|
||||
* Returns: %TRUE if an active X pointer grab is in effect
|
||||
*
|
||||
* Since: 2.2
|
||||
*/
|
||||
gboolean
|
||||
gdk_display_pointer_is_grabbed (GdkDisplay *display)
|
||||
{
|
||||
GdkPointerGrabInfo *info;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE);
|
||||
|
||||
/* What we're interested in is the steady state (ie last grab),
|
||||
because we're interested e.g. if we grabbed so that we
|
||||
can ungrab, even if our grab is not active just yet. */
|
||||
info = _gdk_display_get_last_pointer_grab (display);
|
||||
|
||||
return (info && !info->implicit);
|
||||
}
|
||||
|
||||
#define __GDK_DISPLAY_C__
|
||||
#include "gdkaliasdef.c"
|
||||
|
||||
@@ -43,33 +43,6 @@ typedef struct _GdkDisplayPointerHooks GdkDisplayPointerHooks;
|
||||
#define GDK_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY))
|
||||
#define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
|
||||
|
||||
/* Tracks information about the keyboard grab on this display */
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindow *native_window;
|
||||
gulong serial;
|
||||
gboolean owner_events;
|
||||
guint32 time;
|
||||
} GdkKeyboardGrabInfo;
|
||||
|
||||
/* Tracks information about which window and position the pointer last was in.
|
||||
* This is useful when we need to synthesize events later.
|
||||
* Note that we track toplevel_under_pointer using enter/leave events,
|
||||
* so in the case of a grab, either with owner_events==FALSE or with the
|
||||
* pointer in no clients window the x/y coordinates may actually be outside
|
||||
* the window.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *toplevel_under_pointer; /* The toplevel window with mouse inside, tracked via native events */
|
||||
GdkWindow *window_under_pointer; /* The window that last got sent a normal enter event */
|
||||
gdouble toplevel_x, toplevel_y;
|
||||
guint32 state;
|
||||
guint32 button;
|
||||
gulong motion_hint_serial; /* 0 == didn't deliver hinted motion event */
|
||||
} GdkPointerWindowInfo;
|
||||
|
||||
struct _GdkDisplay
|
||||
{
|
||||
GObject parent_instance;
|
||||
@@ -91,18 +64,10 @@ struct _GdkDisplay
|
||||
const GdkDisplayPointerHooks *pointer_hooks; /* Current hooks for querying pointer */
|
||||
|
||||
guint closed : 1; /* Whether this display has been closed */
|
||||
guint ignore_core_events : 1; /* Don't send core motion and button event */
|
||||
|
||||
guint double_click_distance; /* Maximum distance between clicks in pixels */
|
||||
gint button_x[2]; /* The last 2 button click positions. */
|
||||
gint button_y[2];
|
||||
|
||||
GList *pointer_grabs;
|
||||
GdkKeyboardGrabInfo keyboard_grab;
|
||||
GdkPointerWindowInfo pointer_info;
|
||||
|
||||
/* Last reported event time from server */
|
||||
guint32 last_event_time;
|
||||
};
|
||||
|
||||
struct _GdkDisplayClass
|
||||
|
||||
@@ -92,7 +92,7 @@ gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkDisplayManagerClass, display_opened),
|
||||
NULL, NULL,
|
||||
_gdk_marshal_VOID__OBJECT,
|
||||
gdk_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
GDK_TYPE_DISPLAY);
|
||||
|
||||
+12
-113
@@ -150,8 +150,7 @@ gdk_drawable_get_size (GdkDrawable *drawable,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
|
||||
if (GDK_DRAWABLE_GET_CLASS (drawable)->get_size != NULL)
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -624,7 +623,7 @@ gdk_draw_drawable (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkDrawable *composite, *composite_impl;
|
||||
GdkDrawable *composite;
|
||||
gint composite_x_offset = 0;
|
||||
gint composite_y_offset = 0;
|
||||
|
||||
@@ -653,37 +652,13 @@ gdk_draw_drawable (GdkDrawable *drawable,
|
||||
&composite_x_offset,
|
||||
&composite_y_offset);
|
||||
|
||||
/* The draw_drawable call below is will recurse into gdk_draw_drawable again,
|
||||
* specifying the right impl for the destination. This means the composite
|
||||
* we got here will be fed to get_composite_drawable again, which is a problem
|
||||
* for window as that causes double the composite offset. Avoid this by passing
|
||||
* in the impl directly.
|
||||
*/
|
||||
if (GDK_IS_WINDOW (composite))
|
||||
composite_impl = GDK_WINDOW_OBJECT (src)->impl;
|
||||
else
|
||||
composite_impl = composite;
|
||||
|
||||
/* TODO: For non-native windows this may copy stuff from other overlapping
|
||||
windows. We should clip that and (for windows with bg != None) clear that
|
||||
area in the destination instead. */
|
||||
|
||||
if (GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src)
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src (drawable, gc,
|
||||
composite_impl,
|
||||
xsrc - composite_x_offset,
|
||||
ysrc - composite_y_offset,
|
||||
xdest, ydest,
|
||||
width, height,
|
||||
src);
|
||||
else /* backwards compat for old out-of-tree implementations of GdkDrawable (are there any?) */
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc,
|
||||
composite_impl,
|
||||
xsrc - composite_x_offset,
|
||||
ysrc - composite_y_offset,
|
||||
xdest, ydest,
|
||||
width, height);
|
||||
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc, composite,
|
||||
xsrc - composite_x_offset,
|
||||
ysrc - composite_y_offset,
|
||||
xdest, ydest,
|
||||
width, height);
|
||||
|
||||
g_object_unref (composite);
|
||||
}
|
||||
|
||||
@@ -896,7 +871,7 @@ real_draw_glyphs (GdkDrawable *drawable,
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (drawable);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE, drawable);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE);
|
||||
|
||||
if (matrix)
|
||||
{
|
||||
@@ -1020,7 +995,7 @@ gdk_draw_trapezoids (GdkDrawable *drawable,
|
||||
g_return_if_fail (n_trapezoids == 0 || trapezoids != NULL);
|
||||
|
||||
cr = gdk_cairo_create (drawable);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE, drawable);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE);
|
||||
|
||||
for (i = 0; i < n_trapezoids; i++)
|
||||
{
|
||||
@@ -1210,7 +1185,7 @@ gdk_drawable_real_get_image (GdkDrawable *drawable,
|
||||
return gdk_drawable_copy_to_image (drawable, NULL, x, y, 0, 0, width, height);
|
||||
}
|
||||
|
||||
static GdkDrawable *
|
||||
static GdkDrawable*
|
||||
gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
@@ -1796,81 +1771,5 @@ _gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _gdk_drawable_get_subwindow_scratch_gc:
|
||||
* @drawable: A #GdkDrawable
|
||||
*
|
||||
* Returns a #GdkGC suitable for drawing on @drawable. The #GdkGC has
|
||||
* the standard values for @drawable, except for the graphics_exposures
|
||||
* field which is %TRUE and the subwindow mode which is %GDK_INCLUDE_INFERIORS.
|
||||
*
|
||||
* The foreground color of the returned #GdkGC is undefined. The #GdkGC
|
||||
* must not be altered in any way, except to change its foreground color.
|
||||
*
|
||||
* Return value: A #GdkGC suitable for drawing on @drawable
|
||||
*
|
||||
* Since: 2.18
|
||||
**/
|
||||
GdkGC *
|
||||
_gdk_drawable_get_subwindow_scratch_gc (GdkDrawable *drawable)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
gint depth;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
|
||||
|
||||
screen = gdk_drawable_get_screen (drawable);
|
||||
|
||||
g_return_val_if_fail (!screen->closed, NULL);
|
||||
|
||||
depth = gdk_drawable_get_depth (drawable) - 1;
|
||||
|
||||
if (!screen->subwindow_gcs[depth])
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCValuesMask mask;
|
||||
|
||||
values.graphics_exposures = TRUE;
|
||||
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
|
||||
mask = GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW;
|
||||
|
||||
screen->subwindow_gcs[depth] =
|
||||
gdk_gc_new_with_values (drawable, &values, mask);
|
||||
}
|
||||
|
||||
return screen->subwindow_gcs[depth];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* _gdk_drawable_get_source_drawable:
|
||||
* @drawable: a #GdkDrawable
|
||||
*
|
||||
* Returns a drawable for the passed @drawable that is guaranteed to be
|
||||
* usable to create a pixmap (e.g.: not an offscreen window).
|
||||
*
|
||||
* Since: 2.16
|
||||
*/
|
||||
GdkDrawable *
|
||||
_gdk_drawable_get_source_drawable (GdkDrawable *drawable)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
|
||||
|
||||
if (GDK_DRAWABLE_GET_CLASS (drawable)->get_source_drawable)
|
||||
return GDK_DRAWABLE_GET_CLASS (drawable)->get_source_drawable (drawable);
|
||||
|
||||
return drawable;
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
_gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
return GDK_DRAWABLE_GET_CLASS (drawable)->create_cairo_surface (drawable,
|
||||
width, height);
|
||||
}
|
||||
|
||||
|
||||
#define __GDK_DRAW_C__
|
||||
#include "gdkaliasdef.c"
|
||||
|
||||
+4
-20
@@ -200,27 +200,10 @@ struct _GdkDrawableClass
|
||||
|
||||
cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
|
||||
|
||||
GdkDrawable *(*get_source_drawable) (GdkDrawable *drawable);
|
||||
|
||||
void (*set_cairo_clip) (GdkDrawable *drawable,
|
||||
cairo_t *cr);
|
||||
|
||||
cairo_surface_t * (*create_cairo_surface) (GdkDrawable *drawable,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
void (*draw_drawable_with_src) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkDrawable *src,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkDrawable *original_src);
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gdk_reserved4) (void);
|
||||
void (*_gdk_reserved5) (void);
|
||||
void (*_gdk_reserved6) (void);
|
||||
void (*_gdk_reserved7) (void);
|
||||
void (*_gdk_reserved9) (void);
|
||||
void (*_gdk_reserved10) (void);
|
||||
@@ -229,6 +212,7 @@ struct _GdkDrawableClass
|
||||
void (*_gdk_reserved13) (void);
|
||||
void (*_gdk_reserved14) (void);
|
||||
void (*_gdk_reserved15) (void);
|
||||
void (*_gdk_reserved16) (void);
|
||||
};
|
||||
|
||||
struct _GdkTrapezoid
|
||||
|
||||
+3
-73
@@ -120,63 +120,6 @@ _gdk_event_queue_append (GdkDisplay *display,
|
||||
return display->queued_tail;
|
||||
}
|
||||
|
||||
/**
|
||||
* _gdk_event_queue_insert_after:
|
||||
* @display: a #GdkDisplay
|
||||
* @sibling: Append after this event.
|
||||
* @event: Event to append.
|
||||
*
|
||||
* Appends an event after the specified event, or if it isn't in
|
||||
* the queue, onto the tail of the event queue.
|
||||
*
|
||||
* Returns: the newly appended list node.
|
||||
*
|
||||
* Since: 2.16
|
||||
*/
|
||||
GList*
|
||||
_gdk_event_queue_insert_after (GdkDisplay *display,
|
||||
GdkEvent *sibling,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GList *prev = g_list_find (display->queued_events, sibling);
|
||||
if (prev && prev->next)
|
||||
{
|
||||
display->queued_events = g_list_insert_before (display->queued_events, prev->next, event);
|
||||
return prev->next;
|
||||
}
|
||||
else
|
||||
return _gdk_event_queue_append (display, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* _gdk_event_queue_insert_after:
|
||||
* @display: a #GdkDisplay
|
||||
* @sibling: Append after this event.
|
||||
* @event: Event to append.
|
||||
*
|
||||
* Appends an event before the specified event, or if it isn't in
|
||||
* the queue, onto the tail of the event queue.
|
||||
*
|
||||
* Returns: the newly appended list node.
|
||||
*
|
||||
* Since: 2.16
|
||||
*/
|
||||
GList*
|
||||
_gdk_event_queue_insert_before (GdkDisplay *display,
|
||||
GdkEvent *sibling,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GList *next = g_list_find (display->queued_events, sibling);
|
||||
if (next)
|
||||
{
|
||||
display->queued_events = g_list_insert_before (display->queued_events, next, event);
|
||||
return next->prev;
|
||||
}
|
||||
else
|
||||
return _gdk_event_queue_append (display, event);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _gdk_event_queue_remove_link:
|
||||
* @display: a #GdkDisplay
|
||||
@@ -632,7 +575,6 @@ gdk_event_get_time (const GdkEvent *event)
|
||||
case GDK_SETTING:
|
||||
case GDK_OWNER_CHANGE:
|
||||
case GDK_GRAB_BROKEN:
|
||||
case GDK_EVENT_LAST:
|
||||
/* return current time */
|
||||
break;
|
||||
}
|
||||
@@ -711,7 +653,6 @@ gdk_event_get_state (const GdkEvent *event,
|
||||
case GDK_SETTING:
|
||||
case GDK_OWNER_CHANGE:
|
||||
case GDK_GRAB_BROKEN:
|
||||
case GDK_EVENT_LAST:
|
||||
/* no state field */
|
||||
break;
|
||||
}
|
||||
@@ -943,17 +884,9 @@ gdk_event_get_axis (const GdkEvent *event,
|
||||
void
|
||||
gdk_event_request_motions (const GdkEventMotion *event)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
if (event->type == GDK_MOTION_NOTIFY && event->is_hint)
|
||||
{
|
||||
gdk_device_get_state (event->device, event->window, NULL, NULL);
|
||||
|
||||
display = gdk_drawable_get_display (event->window);
|
||||
_gdk_display_enable_motion_hints (display);
|
||||
}
|
||||
gdk_device_get_state (event->device, event->window, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1168,16 +1101,13 @@ gdk_synthesize_click (GdkDisplay *display,
|
||||
gint nclicks)
|
||||
{
|
||||
GdkEvent temp_event;
|
||||
GdkEvent *event_copy;
|
||||
GList *link;
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
temp_event = *event;
|
||||
temp_event.type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
|
||||
|
||||
event_copy = gdk_event_copy (&temp_event);
|
||||
link = _gdk_event_queue_append (display, event_copy);
|
||||
|
||||
gdk_display_put_event (display, &temp_event);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+1
-2
@@ -151,8 +151,7 @@ typedef enum
|
||||
GDK_SETTING = 33,
|
||||
GDK_OWNER_CHANGE = 34,
|
||||
GDK_GRAB_BROKEN = 35,
|
||||
GDK_DAMAGE = 36,
|
||||
GDK_EVENT_LAST /* helper variable for decls */
|
||||
GDK_DAMAGE = 36
|
||||
} GdkEventType;
|
||||
|
||||
/* Event masks. (Used to select what types of events a window
|
||||
|
||||
+9
-210
@@ -43,24 +43,12 @@ struct _GdkGCPrivate
|
||||
{
|
||||
GdkRegion *clip_region;
|
||||
|
||||
guint32 region_tag_applied;
|
||||
int region_tag_offset_x;
|
||||
int region_tag_offset_y;
|
||||
|
||||
GdkRegion *old_clip_region;
|
||||
GdkPixmap *old_clip_mask;
|
||||
|
||||
GdkFill fill;
|
||||
GdkBitmap *stipple;
|
||||
GdkPixmap *tile;
|
||||
|
||||
GdkPixmap *clip_mask;
|
||||
|
||||
|
||||
guint32 fg_pixel;
|
||||
guint32 bg_pixel;
|
||||
|
||||
guint subwindow_mode : 1;
|
||||
guint fill : 2;
|
||||
guint exposures : 2;
|
||||
};
|
||||
|
||||
#define GDK_GC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDK_TYPE_GC, GdkGCPrivate))
|
||||
@@ -162,8 +150,6 @@ _gdk_gc_init (GdkGC *gc,
|
||||
gc->clip_x_origin = values->clip_x_origin;
|
||||
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
|
||||
gc->clip_y_origin = values->clip_y_origin;
|
||||
if ((values_mask & GDK_GC_CLIP_MASK) && values->clip_mask)
|
||||
priv->clip_mask = g_object_ref (values->clip_mask);
|
||||
if (values_mask & GDK_GC_TS_X_ORIGIN)
|
||||
gc->ts_x_origin = values->ts_x_origin;
|
||||
if (values_mask & GDK_GC_TS_Y_ORIGIN)
|
||||
@@ -186,12 +172,6 @@ _gdk_gc_init (GdkGC *gc,
|
||||
priv->fg_pixel = values->foreground.pixel;
|
||||
if (values_mask & GDK_GC_BACKGROUND)
|
||||
priv->bg_pixel = values->background.pixel;
|
||||
if (values_mask & GDK_GC_SUBWINDOW)
|
||||
priv->subwindow_mode = values->subwindow_mode;
|
||||
if (values_mask & GDK_GC_EXPOSURES)
|
||||
priv->exposures = values->graphics_exposures;
|
||||
else
|
||||
priv->exposures = TRUE;
|
||||
|
||||
gc->colormap = gdk_drawable_get_colormap (drawable);
|
||||
if (gc->colormap)
|
||||
@@ -203,15 +183,9 @@ gdk_gc_finalize (GObject *object)
|
||||
{
|
||||
GdkGC *gc = GDK_GC (object);
|
||||
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
|
||||
|
||||
|
||||
if (priv->clip_region)
|
||||
gdk_region_destroy (priv->clip_region);
|
||||
if (priv->old_clip_region)
|
||||
gdk_region_destroy (priv->old_clip_region);
|
||||
if (priv->clip_mask)
|
||||
g_object_unref (priv->clip_mask);
|
||||
if (priv->old_clip_mask)
|
||||
g_object_unref (priv->old_clip_mask);
|
||||
if (gc->colormap)
|
||||
g_object_unref (gc->colormap);
|
||||
if (priv->tile)
|
||||
@@ -295,12 +269,6 @@ gdk_gc_set_values (GdkGC *gc,
|
||||
|
||||
priv = GDK_GC_GET_PRIVATE (gc);
|
||||
|
||||
if ((values_mask & GDK_GC_CLIP_X_ORIGIN) ||
|
||||
(values_mask & GDK_GC_CLIP_Y_ORIGIN) ||
|
||||
(values_mask & GDK_GC_CLIP_MASK) ||
|
||||
(values_mask & GDK_GC_SUBWINDOW))
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
|
||||
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
|
||||
gc->clip_x_origin = values->clip_x_origin;
|
||||
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
|
||||
@@ -311,14 +279,6 @@ gdk_gc_set_values (GdkGC *gc,
|
||||
gc->ts_y_origin = values->ts_y_origin;
|
||||
if (values_mask & GDK_GC_CLIP_MASK)
|
||||
{
|
||||
if (priv->clip_mask)
|
||||
{
|
||||
g_object_unref (priv->clip_mask);
|
||||
priv->clip_mask = NULL;
|
||||
}
|
||||
if (values->clip_mask)
|
||||
priv->clip_mask = g_object_ref (values->clip_mask);
|
||||
|
||||
if (priv->clip_region)
|
||||
{
|
||||
gdk_region_destroy (priv->clip_region);
|
||||
@@ -353,10 +313,6 @@ gdk_gc_set_values (GdkGC *gc,
|
||||
priv->fg_pixel = values->foreground.pixel;
|
||||
if (values_mask & GDK_GC_BACKGROUND)
|
||||
priv->bg_pixel = values->background.pixel;
|
||||
if (values_mask & GDK_GC_SUBWINDOW)
|
||||
priv->subwindow_mode = values->subwindow_mode;
|
||||
if (values_mask & GDK_GC_EXPOSURES)
|
||||
priv->exposures = values->graphics_exposures;
|
||||
|
||||
GDK_GC_GET_CLASS (gc)->set_values (gc, values, values_mask);
|
||||
}
|
||||
@@ -586,120 +542,18 @@ gdk_gc_set_clip_mask (GdkGC *gc,
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_CLIP_MASK);
|
||||
}
|
||||
|
||||
/* Takes ownership of passed in region */
|
||||
static void
|
||||
_gdk_gc_set_clip_region_real (GdkGC *gc,
|
||||
GdkRegion *region,
|
||||
gboolean reset_origin)
|
||||
_gdk_gc_set_clip_region_internal (GdkGC *gc,
|
||||
GdkRegion *region)
|
||||
{
|
||||
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
|
||||
|
||||
if (priv->clip_mask)
|
||||
{
|
||||
g_object_unref (priv->clip_mask);
|
||||
priv->clip_mask = NULL;
|
||||
}
|
||||
|
||||
if (priv->clip_region)
|
||||
gdk_region_destroy (priv->clip_region);
|
||||
|
||||
priv->clip_region = region;
|
||||
|
||||
_gdk_windowing_gc_set_clip_region (gc, region, reset_origin);
|
||||
}
|
||||
|
||||
/* Doesn't copy region, allows not to reset origin */
|
||||
void
|
||||
_gdk_gc_set_clip_region_internal (GdkGC *gc,
|
||||
GdkRegion *region,
|
||||
gboolean reset_origin)
|
||||
{
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
_gdk_gc_set_clip_region_real (gc, region, reset_origin);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_gdk_gc_add_drawable_clip (GdkGC *gc,
|
||||
guint32 region_tag,
|
||||
GdkRegion *region,
|
||||
int offset_x,
|
||||
int offset_y)
|
||||
{
|
||||
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
|
||||
|
||||
if (priv->region_tag_applied == region_tag &&
|
||||
offset_x == priv->region_tag_offset_x &&
|
||||
offset_y == priv->region_tag_offset_y)
|
||||
return; /* Already appied this drawable region */
|
||||
|
||||
if (priv->region_tag_applied)
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
|
||||
region = gdk_region_copy (region);
|
||||
if (offset_x != 0 || offset_y != 0)
|
||||
gdk_region_offset (region, offset_x, offset_y);
|
||||
|
||||
if (priv->clip_mask)
|
||||
{
|
||||
int w, h;
|
||||
GdkPixmap *new_mask;
|
||||
GdkGC *tmp_gc;
|
||||
GdkColor black = {0, 0, 0, 0};
|
||||
|
||||
priv->old_clip_mask = g_object_ref (priv->clip_mask);
|
||||
gdk_drawable_get_size (priv->old_clip_mask, &w, &h);
|
||||
|
||||
new_mask = gdk_pixmap_new (priv->old_clip_mask, w, h, -1);
|
||||
tmp_gc = _gdk_drawable_get_scratch_gc ((GdkDrawable *)new_mask, FALSE);
|
||||
|
||||
gdk_gc_set_foreground (tmp_gc, &black);
|
||||
gdk_draw_rectangle (new_mask, tmp_gc, TRUE, 0, 0, -1, -1);
|
||||
_gdk_gc_set_clip_region_internal (tmp_gc, region, TRUE); /* Takes ownership of region */
|
||||
gdk_draw_drawable (new_mask,
|
||||
tmp_gc,
|
||||
priv->old_clip_mask,
|
||||
0, 0,
|
||||
0, 0,
|
||||
-1, -1);
|
||||
gdk_gc_set_clip_region (tmp_gc, NULL);
|
||||
gdk_gc_set_clip_mask (gc, new_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
priv->old_clip_region = priv->clip_region;
|
||||
priv->clip_region = region;
|
||||
if (priv->old_clip_region)
|
||||
gdk_region_intersect (region, priv->old_clip_region);
|
||||
|
||||
_gdk_windowing_gc_set_clip_region (gc, priv->clip_region, FALSE);
|
||||
}
|
||||
|
||||
priv->region_tag_applied = region_tag;
|
||||
priv->region_tag_offset_x = offset_x;
|
||||
priv->region_tag_offset_y = offset_y;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_gc_remove_drawable_clip (GdkGC *gc)
|
||||
{
|
||||
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
|
||||
|
||||
if (priv->region_tag_applied)
|
||||
{
|
||||
priv->region_tag_applied = 0;
|
||||
if (priv->old_clip_mask)
|
||||
{
|
||||
gdk_gc_set_clip_mask (gc, priv->old_clip_mask);
|
||||
g_object_unref (priv->old_clip_mask);
|
||||
priv->old_clip_mask = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
_gdk_gc_set_clip_region_real (gc, priv->old_clip_region, FALSE);
|
||||
priv->old_clip_region = NULL;
|
||||
}
|
||||
}
|
||||
_gdk_windowing_gc_set_clip_region (gc, region);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -719,14 +573,12 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
|
||||
if (rectangle)
|
||||
region = gdk_region_rectangle (rectangle);
|
||||
else
|
||||
region = NULL;
|
||||
|
||||
_gdk_gc_set_clip_region_real (gc, region, TRUE);
|
||||
_gdk_gc_set_clip_region_internal (gc, region);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -746,14 +598,12 @@ gdk_gc_set_clip_region (GdkGC *gc,
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
|
||||
if (region)
|
||||
copy = gdk_region_copy (region);
|
||||
else
|
||||
copy = NULL;
|
||||
|
||||
_gdk_gc_set_clip_region_real (gc, copy, TRUE);
|
||||
_gdk_gc_set_clip_region_internal (gc, copy);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -790,14 +640,6 @@ _gdk_gc_get_fill (GdkGC *gc)
|
||||
return GDK_GC_GET_PRIVATE (gc)->fill;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_gc_get_exposures (GdkGC *gc)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_GC (gc), FALSE);
|
||||
|
||||
return GDK_GC_GET_PRIVATE (gc)->exposures;
|
||||
}
|
||||
|
||||
/**
|
||||
* _gdk_gc_get_tile:
|
||||
* @gc: a #GdkGC
|
||||
@@ -881,27 +723,13 @@ gdk_gc_set_subwindow (GdkGC *gc,
|
||||
GdkSubwindowMode mode)
|
||||
{
|
||||
GdkGCValues values;
|
||||
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
|
||||
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
|
||||
/* This could get called a lot to reset the subwindow mode in
|
||||
the client side clipping, so bail out early */
|
||||
if (priv->subwindow_mode == mode)
|
||||
return;
|
||||
|
||||
values.subwindow_mode = mode;
|
||||
gdk_gc_set_values (gc, &values, GDK_GC_SUBWINDOW);
|
||||
}
|
||||
|
||||
GdkSubwindowMode
|
||||
_gdk_gc_get_subwindow (GdkGC *gc)
|
||||
{
|
||||
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
|
||||
|
||||
return priv->subwindow_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gc_set_exposures:
|
||||
* @gc: a #GdkGC.
|
||||
@@ -1062,26 +890,6 @@ gdk_gc_copy (GdkGC *dst_gc,
|
||||
dst_priv->clip_region = gdk_region_copy (src_priv->clip_region);
|
||||
else
|
||||
dst_priv->clip_region = NULL;
|
||||
|
||||
dst_priv->region_tag_applied = src_priv->region_tag_applied;
|
||||
|
||||
if (dst_priv->old_clip_region)
|
||||
gdk_region_destroy (dst_priv->old_clip_region);
|
||||
|
||||
if (src_priv->old_clip_region)
|
||||
dst_priv->old_clip_region = gdk_region_copy (src_priv->old_clip_region);
|
||||
else
|
||||
dst_priv->old_clip_region = NULL;
|
||||
|
||||
if (src_priv->clip_mask)
|
||||
dst_priv->clip_mask = g_object_ref (src_priv->clip_mask);
|
||||
else
|
||||
dst_priv->clip_mask = NULL;
|
||||
|
||||
if (src_priv->old_clip_mask)
|
||||
dst_priv->old_clip_mask = g_object_ref (src_priv->old_clip_mask);
|
||||
else
|
||||
dst_priv->old_clip_mask = NULL;
|
||||
|
||||
dst_priv->fill = src_priv->fill;
|
||||
|
||||
@@ -1099,8 +907,6 @@ gdk_gc_copy (GdkGC *dst_gc,
|
||||
|
||||
dst_priv->fg_pixel = src_priv->fg_pixel;
|
||||
dst_priv->bg_pixel = src_priv->bg_pixel;
|
||||
dst_priv->subwindow_mode = src_priv->subwindow_mode;
|
||||
dst_priv->exposures = src_priv->exposures;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1311,8 +1117,6 @@ gc_get_background (GdkGC *gc,
|
||||
* the fill mode will be forced to %GDK_STIPPLED
|
||||
* @gc_changed: pass %FALSE if the @gc has not changed since the
|
||||
* last call to this function
|
||||
* @target_drawable: The drawable you're drawing in. If passed in
|
||||
* this is used for client side window clip emulation.
|
||||
*
|
||||
* Set the attributes of a cairo context to match those of a #GdkGC
|
||||
* as far as possible. Some aspects of a #GdkGC, such as clip masks
|
||||
@@ -1323,8 +1127,7 @@ _gdk_gc_update_context (GdkGC *gc,
|
||||
cairo_t *cr,
|
||||
const GdkColor *override_foreground,
|
||||
GdkBitmap *override_stipple,
|
||||
gboolean gc_changed,
|
||||
GdkDrawable *target_drawable)
|
||||
gboolean gc_changed)
|
||||
{
|
||||
GdkGCPrivate *priv;
|
||||
GdkFill fill;
|
||||
@@ -1443,10 +1246,6 @@ _gdk_gc_update_context (GdkGC *gc,
|
||||
|
||||
cairo_clip (cr);
|
||||
}
|
||||
|
||||
/* The reset above resets the window clip rect, so we want to re-set that */
|
||||
if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
|
||||
GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+60
-290
@@ -170,110 +170,6 @@ struct _GdkEventPrivate
|
||||
gpointer windowing_data;
|
||||
};
|
||||
|
||||
/* Tracks information about the pointer grab on this display */
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindow *native_window;
|
||||
gulong serial_start;
|
||||
gulong serial_end; /* exclusive, i.e. not active on serial_end */
|
||||
gboolean owner_events;
|
||||
guint event_mask;
|
||||
gboolean implicit;
|
||||
guint32 time;
|
||||
|
||||
gboolean activated;
|
||||
gboolean implicit_ungrab;
|
||||
gboolean grab_one_pointer_release_event;
|
||||
} GdkPointerGrabInfo;
|
||||
|
||||
typedef struct _GdkInputWindow GdkInputWindow;
|
||||
|
||||
/* Private version of GdkWindowObject. The initial part of this strucuture
|
||||
is public for historical reasons. Don't change that part */
|
||||
typedef struct _GdkWindowPaint GdkWindowPaint;
|
||||
|
||||
struct _GdkWindowObject
|
||||
{
|
||||
/* vvvvvvv THIS PART IS PUBLIC. DON'T CHANGE vvvvvvvvvvvvvv */
|
||||
GdkDrawable parent_instance;
|
||||
|
||||
GdkDrawable *impl; /* window-system-specific delegate object */
|
||||
|
||||
GdkWindowObject *parent;
|
||||
|
||||
gpointer user_data;
|
||||
|
||||
gint x;
|
||||
gint y;
|
||||
|
||||
gint extension_events;
|
||||
|
||||
GList *filters;
|
||||
GList *children;
|
||||
|
||||
GdkColor bg_color;
|
||||
GdkPixmap *bg_pixmap;
|
||||
|
||||
GSList *paint_stack;
|
||||
|
||||
GdkRegion *update_area;
|
||||
guint update_freeze_count;
|
||||
|
||||
guint8 window_type;
|
||||
guint8 depth;
|
||||
guint8 resize_count;
|
||||
|
||||
GdkWindowState state;
|
||||
|
||||
guint guffaw_gravity : 1;
|
||||
guint input_only : 1;
|
||||
guint modal_hint : 1;
|
||||
guint composited : 1;
|
||||
|
||||
guint destroyed : 2;
|
||||
|
||||
guint accept_focus : 1;
|
||||
guint focus_on_map : 1;
|
||||
guint shaped : 1;
|
||||
|
||||
GdkEventMask event_mask;
|
||||
|
||||
guint update_and_descendants_freeze_count;
|
||||
|
||||
GdkWindowRedirect *redirect;
|
||||
|
||||
/* ^^^^^^^^^^ THIS PART IS PUBLIC. DON'T CHANGE ^^^^^^^^^^ */
|
||||
|
||||
/* The GdkWindowObject that has the impl, ref:ed if another window.
|
||||
* This ref is required to keep the wrapper of the impl window alive
|
||||
* for as long as any GdkWindow references the impl. */
|
||||
GdkWindowObject *impl_window;
|
||||
int abs_x, abs_y; /* Absolute offset in impl */
|
||||
gint width, height;
|
||||
guint32 clip_tag;
|
||||
GdkRegion *clip_region; /* Clip region (wrt toplevel) in window coords */
|
||||
GdkRegion *clip_region_with_children; /* Clip region in window coords */
|
||||
GdkCursor *cursor;
|
||||
gint8 toplevel_window_type;
|
||||
guint synthesize_crossing_event_queued : 1;
|
||||
guint effective_visibility : 2;
|
||||
guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
|
||||
guint native_visibility : 2; /* the native visibility of a impl windows */
|
||||
|
||||
guint num_offscreen_children;
|
||||
GdkWindowPaint *implicit_paint;
|
||||
GdkInputWindow *input_window; /* only set for impl windows */
|
||||
|
||||
GList *outstanding_moves;
|
||||
|
||||
GdkRegion *shape;
|
||||
GdkRegion *input_shape;
|
||||
|
||||
cairo_surface_t *cairo_surface;
|
||||
};
|
||||
|
||||
|
||||
extern GdkEventFunc _gdk_event_func; /* Callback for events */
|
||||
extern gpointer _gdk_event_data;
|
||||
extern GDestroyNotify _gdk_event_notify;
|
||||
@@ -286,21 +182,15 @@ extern gchar *_gdk_display_arg_name;
|
||||
void _gdk_events_queue (GdkDisplay *display);
|
||||
GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
|
||||
|
||||
GList* _gdk_event_queue_find_first (GdkDisplay *display);
|
||||
void _gdk_event_queue_remove_link (GdkDisplay *display,
|
||||
GList *node);
|
||||
GList* _gdk_event_queue_prepend (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
GList* _gdk_event_queue_append (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
GList* _gdk_event_queue_insert_after (GdkDisplay *display,
|
||||
GdkEvent *after_event,
|
||||
GdkEvent *event);
|
||||
GList* _gdk_event_queue_insert_before(GdkDisplay *display,
|
||||
GdkEvent *after_event,
|
||||
GdkEvent *event);
|
||||
void _gdk_event_button_generate (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
GList* _gdk_event_queue_find_first (GdkDisplay *display);
|
||||
void _gdk_event_queue_remove_link (GdkDisplay *display,
|
||||
GList *node);
|
||||
GList* _gdk_event_queue_prepend (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
GList* _gdk_event_queue_append (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
void _gdk_event_button_generate (GdkDisplay *display,
|
||||
GdkEvent *event);
|
||||
|
||||
void _gdk_windowing_event_data_copy (const GdkEvent *src,
|
||||
GdkEvent *dst);
|
||||
@@ -337,59 +227,28 @@ GdkImage *_gdk_drawable_copy_to_image (GdkDrawable *drawable,
|
||||
|
||||
cairo_surface_t *_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable);
|
||||
|
||||
GdkDrawable *_gdk_drawable_get_source_drawable (GdkDrawable *drawable);
|
||||
cairo_surface_t * _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
/* GC caching */
|
||||
GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
|
||||
gboolean graphics_exposures);
|
||||
GdkGC *_gdk_drawable_get_subwindow_scratch_gc (GdkDrawable *drawable);
|
||||
|
||||
void _gdk_gc_update_context (GdkGC *gc,
|
||||
cairo_t *cr,
|
||||
const GdkColor *override_foreground,
|
||||
GdkBitmap *override_stipple,
|
||||
gboolean gc_changed,
|
||||
GdkDrawable *target_drawable);
|
||||
gboolean gc_changed);
|
||||
|
||||
/*************************************
|
||||
* Interfaces used by windowing code *
|
||||
*************************************/
|
||||
|
||||
GdkPixmap *_gdk_pixmap_new (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth);
|
||||
GdkPixmap *_gdk_pixmap_create_from_data (GdkDrawable *drawable,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth,
|
||||
const GdkColor *fg,
|
||||
const GdkColor *bg);
|
||||
GdkPixmap *_gdk_bitmap_create_from_data (GdkDrawable *drawable,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height);
|
||||
GdkWindow *_gdk_window_new (GdkWindow *window,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
void _gdk_window_destroy (GdkWindow *window,
|
||||
gboolean foreign_destroy);
|
||||
void _gdk_window_clear_update_area (GdkWindow *window);
|
||||
|
||||
void _gdk_window_impl_new (GdkWindow *window,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkVisual *visual,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
void _gdk_window_destroy (GdkWindow *window,
|
||||
gboolean foreign_destroy);
|
||||
void _gdk_window_clear_update_area (GdkWindow *window);
|
||||
void _gdk_window_update_size (GdkWindow *window);
|
||||
|
||||
void _gdk_window_process_updates_recurse (GdkWindow *window,
|
||||
GdkRegion *expose_region);
|
||||
|
||||
void _gdk_screen_close (GdkScreen *screen);
|
||||
void _gdk_screen_close (GdkScreen *screen);
|
||||
|
||||
const char *_gdk_get_sm_client_id (void);
|
||||
|
||||
@@ -399,22 +258,11 @@ void _gdk_gc_init (GdkGC *gc,
|
||||
GdkGCValuesMask values_mask);
|
||||
|
||||
GdkRegion *_gdk_gc_get_clip_region (GdkGC *gc);
|
||||
gboolean _gdk_gc_get_exposures (GdkGC *gc);
|
||||
GdkFill _gdk_gc_get_fill (GdkGC *gc);
|
||||
GdkPixmap *_gdk_gc_get_tile (GdkGC *gc);
|
||||
GdkBitmap *_gdk_gc_get_stipple (GdkGC *gc);
|
||||
guint32 _gdk_gc_get_fg_pixel (GdkGC *gc);
|
||||
guint32 _gdk_gc_get_bg_pixel (GdkGC *gc);
|
||||
void _gdk_gc_add_drawable_clip (GdkGC *gc,
|
||||
guint32 region_tag,
|
||||
GdkRegion *region,
|
||||
int offset_x,
|
||||
int offset_y);
|
||||
void _gdk_gc_remove_drawable_clip (GdkGC *gc);
|
||||
void _gdk_gc_set_clip_region_internal (GdkGC *gc,
|
||||
GdkRegion *region,
|
||||
gboolean reset_origin);
|
||||
GdkSubwindowMode _gdk_gc_get_subwindow (GdkGC *gc);
|
||||
|
||||
/*****************************************
|
||||
* Interfaces provided by windowing code *
|
||||
@@ -436,49 +284,60 @@ void _gdk_windowing_set_default_display (GdkDisplay *display);
|
||||
gchar *_gdk_windowing_substitute_screen_number (const gchar *display_name,
|
||||
gint screen_number);
|
||||
|
||||
gulong _gdk_windowing_window_get_next_serial (GdkDisplay *display);
|
||||
void _gdk_windowing_window_get_offsets (GdkWindow *window,
|
||||
gint *x_offset,
|
||||
gint *y_offset);
|
||||
GdkRegion *_gdk_windowing_window_get_shape (GdkWindow *window);
|
||||
GdkRegion *_gdk_windowing_window_get_input_shape(GdkWindow *window);
|
||||
GdkRegion *_gdk_windowing_get_shape_for_mask (GdkBitmap *mask);
|
||||
void _gdk_windowing_window_beep (GdkWindow *window);
|
||||
|
||||
|
||||
void _gdk_windowing_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* _gdk_windowing_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* _gdk_windowing_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask);
|
||||
GdkGrabStatus _gdk_windowing_pointer_grab (GdkWindow *window,
|
||||
GdkWindow *native,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time);
|
||||
void _gdk_windowing_got_event (GdkDisplay *display,
|
||||
GList *event_link,
|
||||
GdkEvent *event,
|
||||
gulong serial);
|
||||
|
||||
void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
|
||||
GdkRegion *expose_region);
|
||||
void _gdk_windowing_before_process_all_updates (void);
|
||||
void _gdk_windowing_after_process_all_updates (void);
|
||||
gint *win_y);
|
||||
|
||||
/* Return the number of bits-per-pixel for images of the specified depth. */
|
||||
gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
|
||||
gint depth);
|
||||
|
||||
void _gdk_window_reparent (GdkWindow *window,
|
||||
GdkWindow *new_parent,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
#define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
|
||||
|
||||
/* Called before processing updates for a window. This gives the windowing
|
||||
* layer a chance to save the region for later use in avoiding duplicate
|
||||
* exposes. The return value indicates whether the function has a saved
|
||||
* the region; if the result is TRUE, then the windowing layer is responsible
|
||||
* for destroying the region later.
|
||||
*/
|
||||
gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
|
||||
GdkRegion *area);
|
||||
|
||||
/* Called to do the windowing system specific part of gdk_window_destroy(),
|
||||
*
|
||||
* window: The window being destroyed
|
||||
* recursing: If TRUE, then this is being called because a parent
|
||||
* was destroyed. This generally means that the call to the windowing system
|
||||
* to destroy the window can be omitted, since it will be destroyed as a result
|
||||
* of the parent being destroyed. Unless @foreign_destroy
|
||||
*
|
||||
* foreign_destroy: If TRUE, the window or a parent was destroyed by some external
|
||||
* agency. The window has already been destroyed and no windowing
|
||||
* system calls should be made. (This may never happen for some
|
||||
* windowing systems.)
|
||||
*/
|
||||
void _gdk_windowing_window_destroy (GdkWindow *window,
|
||||
gboolean recursing,
|
||||
gboolean foreign_destroy);
|
||||
|
||||
/* Called when gdk_window_destroy() is called on a foreign window
|
||||
* or an ancestor of the foreign window. It should generally reparent
|
||||
@@ -506,9 +365,15 @@ struct _GdkPaintableIface
|
||||
GTypeInterface g_iface;
|
||||
|
||||
void (* begin_paint_region) (GdkPaintable *paintable,
|
||||
GdkWindow *window,
|
||||
const GdkRegion *region);
|
||||
void (* end_paint) (GdkPaintable *paintable);
|
||||
|
||||
void (* invalidate_maybe_recurse) (GdkPaintable *paintable,
|
||||
const GdkRegion *region,
|
||||
gboolean (*child_func) (GdkWindow *, gpointer),
|
||||
gpointer user_data);
|
||||
void (* process_updates) (GdkPaintable *paintable,
|
||||
gboolean update_children);
|
||||
};
|
||||
|
||||
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
|
||||
@@ -522,7 +387,6 @@ GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
|
||||
* _gdk_windowing_gc_set_clip_region:
|
||||
* @gc: a #GdkGC
|
||||
* @region: the new clip region
|
||||
* @reset_origin: if TRUE, reset the clip_x/y_origin values to 0
|
||||
*
|
||||
* Do any window-system specific processing necessary
|
||||
* for a change in clip region. Since the clip origin
|
||||
@@ -534,8 +398,7 @@ GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
|
||||
* will already return the new region.
|
||||
**/
|
||||
void _gdk_windowing_gc_set_clip_region (GdkGC *gc,
|
||||
const GdkRegion *region,
|
||||
gboolean reset_origin);
|
||||
const GdkRegion *region);
|
||||
|
||||
/**
|
||||
* _gdk_windowing_gc_copy:
|
||||
@@ -572,99 +435,6 @@ char *_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
|
||||
void _gdk_windowing_launch_failed (GAppLaunchContext *context,
|
||||
const char *startup_notify_id);
|
||||
|
||||
GdkPointerGrabInfo *_gdk_display_get_active_pointer_grab (GdkDisplay *display);
|
||||
void _gdk_display_pointer_grab_update (GdkDisplay *display,
|
||||
gulong current_serial);
|
||||
GdkPointerGrabInfo *_gdk_display_get_last_pointer_grab (GdkDisplay *display);
|
||||
GdkPointerGrabInfo *_gdk_display_add_pointer_grab (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
GdkWindow *native_window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
unsigned long serial_start,
|
||||
guint32 time,
|
||||
gboolean implicit);
|
||||
GdkPointerGrabInfo * _gdk_display_has_pointer_grab (GdkDisplay *display,
|
||||
gulong serial);
|
||||
gboolean _gdk_display_end_pointer_grab (GdkDisplay *display,
|
||||
gulong serial,
|
||||
GdkWindow *if_child,
|
||||
gboolean implicit);
|
||||
void _gdk_display_set_has_keyboard_grab (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
GdkWindow *native_window,
|
||||
gboolean owner_events,
|
||||
unsigned long serial,
|
||||
guint32 time);
|
||||
void _gdk_display_unset_has_keyboard_grab (GdkDisplay *display,
|
||||
gboolean implicit);
|
||||
void _gdk_display_enable_motion_hints (GdkDisplay *display);
|
||||
|
||||
|
||||
void _gdk_window_invalidate_for_expose (GdkWindow *window,
|
||||
const GdkRegion *region);
|
||||
|
||||
void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
cairo_surface_t * _gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
|
||||
int width,
|
||||
int height);
|
||||
GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
|
||||
int x, int y);
|
||||
GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
|
||||
double x, double y,
|
||||
double *found_x,
|
||||
double *found_y);
|
||||
|
||||
void _gdk_window_add_damage (GdkWindow *toplevel,
|
||||
GdkRegion *damaged_region);
|
||||
|
||||
GdkEvent * _gdk_make_event (GdkWindow *window,
|
||||
GdkEventType type,
|
||||
GdkEvent *event_in_queue,
|
||||
gboolean before_event);
|
||||
|
||||
void _gdk_synthesize_crossing_events (GdkDisplay *display,
|
||||
GdkWindow *src,
|
||||
GdkWindow *dest,
|
||||
GdkCrossingMode mode,
|
||||
gint toplevel_x,
|
||||
gint toplevel_y,
|
||||
GdkModifierType mask,
|
||||
guint32 time_,
|
||||
GdkEvent *event_in_queue,
|
||||
gulong serial);
|
||||
void _gdk_display_set_window_under_pointer (GdkDisplay *display,
|
||||
GdkWindow *window);
|
||||
|
||||
|
||||
void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
|
||||
|
||||
GdkRegion *_gdk_window_calculate_full_clip_region (GdkWindow *window,
|
||||
GdkWindow *base_window,
|
||||
gboolean do_children,
|
||||
gint *base_x_offset,
|
||||
gint *base_y_offset);
|
||||
gboolean _gdk_window_has_impl (GdkWindow *window);
|
||||
GdkWindow * _gdk_window_get_impl_window (GdkWindow *window);
|
||||
GdkWindow *_gdk_window_get_input_window_for_event (GdkWindow *native_window,
|
||||
GdkEventType event_type,
|
||||
int x, int y,
|
||||
gulong serial);
|
||||
GdkRegion *_gdk_region_new_from_yxbanded_rects (GdkRectangle *rects, int n_rects);
|
||||
|
||||
/*****************************
|
||||
* offscreen window routines *
|
||||
*****************************/
|
||||
GType gdk_offscreen_window_get_type (void);
|
||||
void _gdk_offscreen_window_new (GdkWindow *window,
|
||||
GdkScreen *screen,
|
||||
GdkVisual *visual,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
|
||||
|
||||
/************************************
|
||||
* Initialization and exit routines *
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
VOID:OBJECT
|
||||
VOID:BOOLEAN
|
||||
VOID:POINTER,POINTER,POINTER
|
||||
OBJECT:VOID
|
||||
OBJECT:DOUBLE,DOUBLE
|
||||
VOID:DOUBLE,DOUBLE,POINTER,POINTER
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+37
-2
@@ -214,8 +214,7 @@ get_cairo_context (GdkPangoRenderer *gdk_renderer,
|
||||
priv->cr,
|
||||
color,
|
||||
priv->stipple[part],
|
||||
priv->gc_changed,
|
||||
priv->drawable);
|
||||
priv->gc_changed);
|
||||
}
|
||||
|
||||
priv->last_part = part;
|
||||
@@ -1497,5 +1496,41 @@ gdk_pango_context_get_for_screen (GdkScreen *screen)
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_pango_context_get_for_screen_for_monitor:
|
||||
* @screen: the #GdkScreen for which the context is to be created.
|
||||
* @monitor_num: monitor number or -1 to use default monitor
|
||||
*
|
||||
* Like gdk_pango_context_get_for_screen() but also takes a monitor
|
||||
* number.
|
||||
*
|
||||
* Return value: a new #PangoContext for @screen
|
||||
*
|
||||
* Since: RIMERGE
|
||||
**/
|
||||
PangoContext *
|
||||
gdk_pango_context_get_for_screen_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
PangoFontMap *fontmap;
|
||||
PangoContext *context;
|
||||
const cairo_font_options_t *options;
|
||||
double dpi;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
fontmap = pango_cairo_font_map_get_default ();
|
||||
|
||||
context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
|
||||
|
||||
options = gdk_screen_get_font_options_for_monitor (screen, monitor_num);
|
||||
pango_cairo_context_set_font_options (context, options);
|
||||
|
||||
dpi = gdk_screen_get_resolution_for_monitor (screen, monitor_num);
|
||||
pango_cairo_context_set_resolution (context, dpi);
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
#define __GDK_PANGO_C__
|
||||
#include "gdkaliasdef.c"
|
||||
|
||||
@@ -104,6 +104,9 @@ void gdk_pango_renderer_set_override_color (GdkPangoRenderer *gdk_renderer,
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
PangoContext *gdk_pango_context_get_for_screen_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num);
|
||||
|
||||
PangoContext *gdk_pango_context_get_for_screen (GdkScreen *screen);
|
||||
#ifndef GDK_MULTIHEAD_SAFE
|
||||
PangoContext *gdk_pango_context_get (void);
|
||||
|
||||
+3
-83
@@ -77,8 +77,7 @@ static void gdk_pixmap_draw_drawable (GdkDrawable *drawable,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkPixmap *original_src);
|
||||
gint height);
|
||||
static void gdk_pixmap_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
@@ -146,9 +145,6 @@ static GdkImage* gdk_pixmap_copy_to_image (GdkDrawable *drawable,
|
||||
gint height);
|
||||
|
||||
static cairo_surface_t *gdk_pixmap_ref_cairo_surface (GdkDrawable *drawable);
|
||||
static cairo_surface_t *gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
static GdkVisual* gdk_pixmap_real_get_visual (GdkDrawable *drawable);
|
||||
static gint gdk_pixmap_real_get_depth (GdkDrawable *drawable);
|
||||
@@ -203,7 +199,7 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
|
||||
drawable_class->draw_polygon = gdk_pixmap_draw_polygon;
|
||||
drawable_class->draw_text = gdk_pixmap_draw_text;
|
||||
drawable_class->draw_text_wc = gdk_pixmap_draw_text_wc;
|
||||
drawable_class->draw_drawable_with_src = gdk_pixmap_draw_drawable;
|
||||
drawable_class->draw_drawable = gdk_pixmap_draw_drawable;
|
||||
drawable_class->draw_points = gdk_pixmap_draw_points;
|
||||
drawable_class->draw_segments = gdk_pixmap_draw_segments;
|
||||
drawable_class->draw_lines = gdk_pixmap_draw_lines;
|
||||
@@ -220,7 +216,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
|
||||
drawable_class->get_visual = gdk_pixmap_real_get_visual;
|
||||
drawable_class->_copy_to_image = gdk_pixmap_copy_to_image;
|
||||
drawable_class->ref_cairo_surface = gdk_pixmap_ref_cairo_surface;
|
||||
drawable_class->create_cairo_surface = gdk_pixmap_create_cairo_surface;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -234,54 +229,6 @@ gdk_pixmap_finalize (GObject *object)
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
GdkPixmap *
|
||||
gdk_pixmap_new (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth)
|
||||
{
|
||||
GdkDrawable *source_drawable;
|
||||
|
||||
if (drawable)
|
||||
source_drawable = _gdk_drawable_get_source_drawable (drawable);
|
||||
else
|
||||
source_drawable = NULL;
|
||||
return _gdk_pixmap_new (source_drawable, width, height, depth);
|
||||
}
|
||||
|
||||
GdkPixmap *
|
||||
gdk_bitmap_create_from_data (GdkDrawable *drawable,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkDrawable *source_drawable;
|
||||
|
||||
if (drawable)
|
||||
source_drawable = _gdk_drawable_get_source_drawable (drawable);
|
||||
else
|
||||
source_drawable = NULL;
|
||||
return _gdk_bitmap_create_from_data (source_drawable, data, width, height);
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_create_from_data (GdkDrawable *drawable,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth,
|
||||
const GdkColor *fg,
|
||||
const GdkColor *bg)
|
||||
{
|
||||
GdkDrawable *source_drawable;
|
||||
|
||||
source_drawable = _gdk_drawable_get_source_drawable (drawable);
|
||||
return _gdk_pixmap_create_from_data (source_drawable,
|
||||
data, width, height,
|
||||
depth, fg,bg);
|
||||
}
|
||||
|
||||
|
||||
static GdkGC *
|
||||
gdk_pixmap_create_gc (GdkDrawable *drawable,
|
||||
GdkGCValues *values,
|
||||
@@ -302,7 +249,6 @@ gdk_pixmap_draw_rectangle (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_rectangle (private->impl, gc, filled,
|
||||
x, y, width, height);
|
||||
}
|
||||
@@ -320,7 +266,6 @@ gdk_pixmap_draw_arc (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_arc (private->impl, gc, filled,
|
||||
x, y,
|
||||
width, height, angle1, angle2);
|
||||
@@ -335,7 +280,6 @@ gdk_pixmap_draw_polygon (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_polygon (private->impl, gc, filled, points, npoints);
|
||||
}
|
||||
|
||||
@@ -350,7 +294,6 @@ gdk_pixmap_draw_text (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_text (private->impl, font, gc,
|
||||
x, y, text, text_length);
|
||||
}
|
||||
@@ -366,7 +309,6 @@ gdk_pixmap_draw_text_wc (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_text_wc (private->impl, font, gc,
|
||||
x, y, text, text_length);
|
||||
}
|
||||
@@ -380,12 +322,10 @@ gdk_pixmap_draw_drawable (GdkDrawable *drawable,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkPixmap *original_src)
|
||||
gint height)
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_drawable (private->impl, gc, src, xsrc, ysrc,
|
||||
xdest, ydest,
|
||||
width, height);
|
||||
@@ -399,7 +339,6 @@ gdk_pixmap_draw_points (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_points (private->impl, gc, points, npoints);
|
||||
}
|
||||
|
||||
@@ -411,7 +350,6 @@ gdk_pixmap_draw_segments (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_segments (private->impl, gc, segs, nsegs);
|
||||
}
|
||||
|
||||
@@ -423,7 +361,6 @@ gdk_pixmap_draw_lines (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_lines (private->impl, gc, points, npoints);
|
||||
}
|
||||
|
||||
@@ -437,7 +374,6 @@ gdk_pixmap_draw_glyphs (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_glyphs (private->impl, gc, font, x, y, glyphs);
|
||||
}
|
||||
|
||||
@@ -452,7 +388,6 @@ gdk_pixmap_draw_glyphs_transformed (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_glyphs_transformed (private->impl, gc, matrix, font, x, y, glyphs);
|
||||
}
|
||||
|
||||
@@ -469,7 +404,6 @@ gdk_pixmap_draw_image (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_image (private->impl, gc, image, xsrc, ysrc, xdest, ydest,
|
||||
width, height);
|
||||
}
|
||||
@@ -490,8 +424,6 @@ gdk_pixmap_draw_pixbuf (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
if (gc)
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_pixbuf (private->impl, gc, pixbuf,
|
||||
src_x, src_y, dest_x, dest_y, width, height,
|
||||
dither, x_dither, y_dither);
|
||||
@@ -505,7 +437,6 @@ gdk_pixmap_draw_trapezoids (GdkDrawable *drawable,
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_trapezoids (private->impl, gc, trapezoids, n_trapezoids);
|
||||
}
|
||||
|
||||
@@ -584,17 +515,6 @@ gdk_pixmap_ref_cairo_surface (GdkDrawable *drawable)
|
||||
return _gdk_drawable_ref_cairo_surface (((GdkPixmapObject*)drawable)->impl);
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
return _gdk_windowing_create_cairo_surface (GDK_PIXMAP_OBJECT(drawable)->impl,
|
||||
width, height);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static GdkBitmap *
|
||||
make_solid_mask (GdkScreen *screen, gint width, gint height)
|
||||
{
|
||||
|
||||
@@ -43,9 +43,6 @@ void gdk_synthesize_window_state (GdkWindow *window,
|
||||
GdkWindowState unset_flags,
|
||||
GdkWindowState set_flags);
|
||||
|
||||
gboolean _gdk_window_event_parent_of (GdkWindow *parent,
|
||||
GdkWindow *child);
|
||||
|
||||
/* Tests whether a pair of x,y may cause overflows when converted to Pango
|
||||
* units (multiplied by PANGO_SCALE). We don't allow the entire range, leave
|
||||
* some space for additions afterwards, to be safe...
|
||||
|
||||
@@ -96,7 +96,6 @@ static void miRegionOp (GdkRegion *newReg,
|
||||
overlapFunc overlapFn,
|
||||
nonOverlapFunc nonOverlap1Fn,
|
||||
nonOverlapFunc nonOverlap2Fn);
|
||||
static void miSetExtents (GdkRegion *pReg);
|
||||
|
||||
/**
|
||||
* gdk_region_new:
|
||||
@@ -123,31 +122,6 @@ gdk_region_new (void)
|
||||
return temp;
|
||||
}
|
||||
|
||||
GdkRegion *
|
||||
_gdk_region_new_from_yxbanded_rects (GdkRectangle *rects,
|
||||
int num_rects)
|
||||
{
|
||||
GdkRegion *temp;
|
||||
int i;
|
||||
|
||||
temp = g_slice_new (GdkRegion);
|
||||
|
||||
temp->rects = g_new (GdkRegionBox, num_rects);
|
||||
temp->size = num_rects;
|
||||
temp->numRects = num_rects;
|
||||
for (i = 0; i < num_rects; i++)
|
||||
{
|
||||
temp->rects[i].x1 = rects[i].x;
|
||||
temp->rects[i].y1 = rects[i].y;
|
||||
temp->rects[i].x2 = rects[i].x + rects[i].width;
|
||||
temp->rects[i].y2 = rects[i].y + rects[i].height;
|
||||
}
|
||||
miSetExtents (temp);
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gdk_region_rectangle:
|
||||
* @rectangle: a #GdkRectangle
|
||||
@@ -1581,32 +1555,6 @@ gdk_region_equal (const GdkRegion *region1,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_region_rect_equal:
|
||||
* @region: a #GdkRegion
|
||||
* @rectangle: a #GdkRectangle
|
||||
*
|
||||
* Finds out if a regions is the same as a rectangle.
|
||||
*
|
||||
* Returns: %TRUE if @region and @rectangle are equal.
|
||||
*
|
||||
* Since: 2.18
|
||||
*/
|
||||
gboolean
|
||||
gdk_region_rect_equal (const GdkRegion *region,
|
||||
const GdkRectangle *rectangle)
|
||||
{
|
||||
g_return_val_if_fail (region != NULL, FALSE);
|
||||
g_return_val_if_fail (rectangle != NULL, FALSE);
|
||||
|
||||
if (region->numRects != 1) return FALSE;
|
||||
else if (region->extents.x1 != rectangle->x) return FALSE;
|
||||
else if (region->extents.y1 != rectangle->y) return FALSE;
|
||||
else if (region->extents.x2 != rectangle->x + rectangle->width) return FALSE;
|
||||
else if (region->extents.y2 != rectangle->y + rectangle->height) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_region_point_in:
|
||||
* @region: a #GdkRegion
|
||||
|
||||
@@ -77,8 +77,6 @@ void gdk_region_get_rectangles (const GdkRegion *region,
|
||||
gboolean gdk_region_empty (const GdkRegion *region);
|
||||
gboolean gdk_region_equal (const GdkRegion *region1,
|
||||
const GdkRegion *region2);
|
||||
gboolean gdk_region_rect_equal (const GdkRegion *region,
|
||||
const GdkRectangle *rectangle);
|
||||
gboolean gdk_region_point_in (const GdkRegion *region,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
@@ -428,6 +428,25 @@ gdk_screen_set_font_options (GdkScreen *screen,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_set_font_options_for_monitor:
|
||||
* @screen: a #GdkScreen
|
||||
* @options: a #cairo_font_options_t, or %NULL to unset any
|
||||
* previously set default font options.
|
||||
*
|
||||
* Like gdk_screen_set_font_options() but per monitor.
|
||||
*
|
||||
* Since: RIMERGE
|
||||
**/
|
||||
void
|
||||
gdk_screen_set_font_options_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
const cairo_font_options_t *options)
|
||||
{
|
||||
/* TODO: need to implement per-monitor font options */
|
||||
return gdk_screen_set_font_options (screen, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_get_font_options:
|
||||
* @screen: a #GdkScreen
|
||||
@@ -447,6 +466,26 @@ gdk_screen_get_font_options (GdkScreen *screen)
|
||||
return screen->font_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_get_font_options_for_monitor:
|
||||
* @screen: a #GdkScreen
|
||||
* @monitor_num: monitor number or -1 for default monitor
|
||||
*
|
||||
* Like gdk_screen_get_font_options() but per monitor.
|
||||
*
|
||||
* Return value: the current font options, or %NULL if no default
|
||||
* font options have been set.
|
||||
*
|
||||
* Since: RIMERGE
|
||||
**/
|
||||
const cairo_font_options_t *
|
||||
gdk_screen_get_font_options_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
/* TODO: need to implement per-monitor font options */
|
||||
return gdk_screen_get_font_options (screen);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_set_resolution:
|
||||
* @screen: a #GdkScreen
|
||||
@@ -497,6 +536,50 @@ gdk_screen_get_resolution (GdkScreen *screen)
|
||||
return screen->resolution;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_get_resolution_for_monitor:
|
||||
* @screen: a #GdkScreen
|
||||
* @monitor_num: monitor number or -1 for default monitor
|
||||
*
|
||||
* Like gdk_screen_get_resolution() but per monitor.
|
||||
*
|
||||
* Returns: the current resolution or -1 if no resolution has been
|
||||
* set.
|
||||
*
|
||||
* Since: RIMERGE
|
||||
**/
|
||||
gdouble
|
||||
gdk_screen_get_resolution_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
#if 0
|
||||
/* Nifty trick to test RI - monitor 0 will have 3 times the user configured DPI */
|
||||
return (monitor_num == 0 ? 3.0 : 1.0) * gdk_screen_get_resolution (screen);
|
||||
#endif
|
||||
/* TODO: need to implement per-monitor resolution */
|
||||
return gdk_screen_get_resolution (screen);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_set_resolution_for_monitor:
|
||||
* @screen: a #GdkScreen
|
||||
* @monitor_num: monitor number
|
||||
* @dpi: the resolution in "dots per inch". (Physical inches aren't actually
|
||||
* involved; the terminology is conventional.)
|
||||
*
|
||||
* Like gdk_screen_set_resolution() but per monitor.
|
||||
*
|
||||
* Since: RIMERGE
|
||||
**/
|
||||
void
|
||||
gdk_screen_set_resolution_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
gdouble dpi)
|
||||
{
|
||||
/* TODO: need to implement per-monitor resolution */
|
||||
gdk_screen_set_resolution (screen, dpi);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_screen_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
|
||||
+13
-1
@@ -51,7 +51,6 @@ struct _GdkScreen
|
||||
|
||||
GdkGC *normal_gcs[32];
|
||||
GdkGC *exposure_gcs[32];
|
||||
GdkGC *subwindow_gcs[32];
|
||||
|
||||
cairo_font_options_t *font_options;
|
||||
double resolution; /* pixels/points scale factor for fonts */
|
||||
@@ -119,10 +118,23 @@ void gdk_screen_set_font_options (GdkScreen
|
||||
const cairo_font_options_t *options);
|
||||
const cairo_font_options_t *gdk_screen_get_font_options (GdkScreen *screen);
|
||||
|
||||
void gdk_screen_set_font_options_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
const cairo_font_options_t *options);
|
||||
const cairo_font_options_t *gdk_screen_get_font_options_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num);
|
||||
|
||||
void gdk_screen_set_resolution (GdkScreen *screen,
|
||||
gdouble dpi);
|
||||
gdouble gdk_screen_get_resolution (GdkScreen *screen);
|
||||
|
||||
gdouble gdk_screen_get_resolution_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num);
|
||||
|
||||
void gdk_screen_set_resolution_for_monitor (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
gdouble dpi);
|
||||
|
||||
GdkWindow *gdk_screen_get_active_window (GdkScreen *screen);
|
||||
GList *gdk_screen_get_window_stack (GdkScreen *screen);
|
||||
|
||||
|
||||
+1012
-5982
File diff suppressed because it is too large
Load Diff
+11
-35
@@ -37,10 +37,10 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkGeometry GdkGeometry;
|
||||
typedef struct _GdkWindowAttr GdkWindowAttr;
|
||||
typedef struct _GdkPointerHooks GdkPointerHooks;
|
||||
typedef struct _GdkWindowRedirect GdkWindowRedirect;
|
||||
typedef struct _GdkGeometry GdkGeometry;
|
||||
typedef struct _GdkWindowAttr GdkWindowAttr;
|
||||
typedef struct _GdkPointerHooks GdkPointerHooks;
|
||||
typedef struct _GdkWindowRedirect GdkWindowRedirect;
|
||||
|
||||
/* Classes of windows.
|
||||
* InputOutput: Almost every window should be of this type. Such windows
|
||||
@@ -77,8 +77,7 @@ typedef enum
|
||||
GDK_WINDOW_CHILD,
|
||||
GDK_WINDOW_DIALOG,
|
||||
GDK_WINDOW_TEMP,
|
||||
GDK_WINDOW_FOREIGN,
|
||||
GDK_WINDOW_OFFSCREEN
|
||||
GDK_WINDOW_FOREIGN
|
||||
} GdkWindowType;
|
||||
|
||||
/* Window attribute mask values.
|
||||
@@ -260,12 +259,6 @@ typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
|
||||
#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
|
||||
#define GDK_WINDOW_OBJECT(object) ((GdkWindowObject *) GDK_WINDOW (object))
|
||||
|
||||
#ifndef GDK_COMPILATION
|
||||
/* We used to export all of GdkWindowObject, but we don't want to keep doing so.
|
||||
However, there are various parts of it accessed by macros and other code,
|
||||
so we keep the old exported version public, but in reality it is larger. */
|
||||
|
||||
/**** DON'T CHANGE THIS STRUCT, the real version is in gdkinternals.h ****/
|
||||
struct _GdkWindowObject
|
||||
{
|
||||
GdkDrawable parent_instance;
|
||||
@@ -315,7 +308,6 @@ struct _GdkWindowObject
|
||||
|
||||
GdkWindowRedirect *redirect;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct _GdkWindowObjectClass
|
||||
{
|
||||
@@ -387,7 +379,6 @@ void gdk_window_move_region (GdkWindow *window,
|
||||
const GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy);
|
||||
gboolean gdk_window_ensure_native (GdkWindow *window);
|
||||
|
||||
/*
|
||||
* This allows for making shaped (partially transparent) windows
|
||||
@@ -531,11 +522,6 @@ void gdk_window_get_position (GdkWindow *window,
|
||||
gint gdk_window_get_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
void gdk_window_get_root_coords (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *root_x,
|
||||
gint *root_y);
|
||||
|
||||
#if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
|
||||
/* Used by gtk_handle_box_button_changed () */
|
||||
@@ -659,22 +645,12 @@ GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks);
|
||||
|
||||
GdkWindow *gdk_get_default_root_window (void);
|
||||
|
||||
/* Offscreen redirection */
|
||||
GdkPixmap *gdk_offscreen_window_get_pixmap (GdkWindow *window);
|
||||
void gdk_offscreen_window_set_embedder (GdkWindow *window,
|
||||
GdkWindow *embedder);
|
||||
GdkWindow *gdk_offscreen_window_get_embedder (GdkWindow *window);
|
||||
void gdk_window_geometry_changed (GdkWindow *window);
|
||||
|
||||
void gdk_window_redirect_to_drawable (GdkWindow *window,
|
||||
GdkDrawable *drawable,
|
||||
gint src_x,
|
||||
gint src_y,
|
||||
gint dest_x,
|
||||
gint dest_y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_window_remove_redirection (GdkWindow *window);
|
||||
void gdk_window_redirect_to_drawable (GdkWindow *window,
|
||||
GdkDrawable *drawable,
|
||||
gint src_x, gint src_y,
|
||||
gint dest_x, gint dest_y,
|
||||
gint width, gint height);
|
||||
void gdk_window_remove_redirection (GdkWindow *window);
|
||||
|
||||
#ifndef GDK_DISABLE_DEPRECATED
|
||||
#define GDK_ROOT_PARENT() (gdk_get_default_root_window ())
|
||||
|
||||
+27
-73
@@ -44,13 +44,11 @@ struct _GdkWindowImplIface
|
||||
GTypeInterface g_iface;
|
||||
|
||||
void (* show) (GdkWindow *window,
|
||||
gboolean already_mapped);
|
||||
gboolean raise);
|
||||
void (* hide) (GdkWindow *window);
|
||||
void (* withdraw) (GdkWindow *window);
|
||||
void (* raise) (GdkWindow *window);
|
||||
void (* lower) (GdkWindow *window);
|
||||
void (* restack_under) (GdkWindow *window,
|
||||
GList *native_siblings);
|
||||
|
||||
void (* move_resize) (GdkWindow *window,
|
||||
gboolean with_move,
|
||||
@@ -58,10 +56,25 @@ struct _GdkWindowImplIface
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void (* move_region) (GdkWindow *window,
|
||||
const GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy);
|
||||
void (* scroll) (GdkWindow *window,
|
||||
gint dx,
|
||||
gint dy);
|
||||
|
||||
void (* clear_area) (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean send_expose);
|
||||
void (* set_background) (GdkWindow *window,
|
||||
const GdkColor *color);
|
||||
void (* set_back_pixmap) (GdkWindow *window,
|
||||
GdkPixmap *pixmap);
|
||||
GdkPixmap *pixmap,
|
||||
gboolean parent_relative);
|
||||
|
||||
GdkEventMask (* get_events) (GdkWindow *window);
|
||||
void (* set_events) (GdkWindow *window,
|
||||
@@ -71,9 +84,6 @@ struct _GdkWindowImplIface
|
||||
GdkWindow *new_parent,
|
||||
gint x,
|
||||
gint y);
|
||||
void (* clear_region) (GdkWindow *window,
|
||||
GdkRegion *region,
|
||||
gboolean send_expose);
|
||||
|
||||
void (* set_cursor) (GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
@@ -84,87 +94,31 @@ struct _GdkWindowImplIface
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *depth);
|
||||
gint (* get_root_coords) (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint *root_x,
|
||||
gint *root_y);
|
||||
gint (* get_deskrelative_origin) (GdkWindow *window,
|
||||
gint (* get_origin) (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
gboolean (* get_pointer) (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
void (* get_offsets) (GdkWindow *window,
|
||||
gint *x_offset,
|
||||
gint *y_offset);
|
||||
|
||||
void (* shape_combine_mask) (GdkWindow *window,
|
||||
GdkBitmap *mask,
|
||||
gint x,
|
||||
gint y);
|
||||
void (* shape_combine_region) (GdkWindow *window,
|
||||
const GdkRegion *shape_region,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void (* input_shape_combine_region) (GdkWindow *window,
|
||||
const GdkRegion *shape_region,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void (* set_child_shapes) (GdkWindow *window);
|
||||
void (* merge_child_shapes) (GdkWindow *window);
|
||||
|
||||
gboolean (* set_static_gravities) (GdkWindow *window,
|
||||
gboolean use_static);
|
||||
|
||||
/* Called before processing updates for a window. This gives the windowing
|
||||
* layer a chance to save the region for later use in avoiding duplicate
|
||||
* exposes. The return value indicates whether the function has a saved
|
||||
* the region; if the result is TRUE, then the windowing layer is responsible
|
||||
* for destroying the region later.
|
||||
*/
|
||||
gboolean (* queue_antiexpose) (GdkWindow *window,
|
||||
GdkRegion *update_area);
|
||||
void (* queue_translation) (GdkWindow *window,
|
||||
GdkRegion *area,
|
||||
gint dx,
|
||||
gint dy);
|
||||
|
||||
/* Called to do the windowing system specific part of gdk_window_destroy(),
|
||||
*
|
||||
* window: The window being destroyed
|
||||
* recursing: If TRUE, then this is being called because a parent
|
||||
* was destroyed. This generally means that the call to the windowing system
|
||||
* to destroy the window can be omitted, since it will be destroyed as a result
|
||||
* of the parent being destroyed. Unless @foreign_destroy
|
||||
*
|
||||
* foreign_destroy: If TRUE, the window or a parent was destroyed by some external
|
||||
* agency. The window has already been destroyed and no windowing
|
||||
* system calls should be made. (This may never happen for some
|
||||
* windowing systems.)
|
||||
*/
|
||||
void (* destroy) (GdkWindow *window,
|
||||
gboolean recursing,
|
||||
gboolean foreign_destroy);
|
||||
|
||||
void (* input_window_destroy) (GdkWindow *window);
|
||||
void (* input_window_crossing)(GdkWindow *window,
|
||||
gboolean enter);
|
||||
};
|
||||
|
||||
/* Interface Functions */
|
||||
GType gdk_window_impl_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* private definitions from gdkwindow.h */
|
||||
|
||||
struct _GdkWindowRedirect
|
||||
{
|
||||
GdkWindowObject *redirected;
|
||||
GdkDrawable *pixmap;
|
||||
|
||||
gint src_x;
|
||||
gint src_y;
|
||||
gint dest_x;
|
||||
gint dest_y;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
GdkRegion *damage;
|
||||
guint damage_idle;
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_IMPL_H__ */
|
||||
|
||||
+1
-3
@@ -52,7 +52,7 @@ EXTRALIBS = \
|
||||
$(WTKIT)\lib\i386\wntab32x.lib \
|
||||
$(GLIB_LIBS) \
|
||||
..\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib \
|
||||
$(PANGOWIN32_LIBS) $(PANGOCAIRO_LIBS) $(INTL_LIBS) $(CAIRO_LIBS) \
|
||||
$(PANGOWIN32_LIBS) $(INTL_LIBS) $(CAIRO_LIBS) \
|
||||
$(PANGOCAIRO_LIBS)
|
||||
|
||||
gdk-win32-backend :
|
||||
@@ -95,8 +95,6 @@ gdk_OBJECTS = \
|
||||
gdkkeynames.obj \
|
||||
gdkkeys.obj \
|
||||
gdkkeyuni.obj \
|
||||
gdkmarshalers.obj \
|
||||
gdkoffscreenwindow.obj \
|
||||
gdkpango.obj \
|
||||
gdkpixbuf-drawable.obj \
|
||||
gdkpixbuf-render.obj \
|
||||
|
||||
+33
-32
@@ -35,11 +35,6 @@
|
||||
return gdk_window;
|
||||
}
|
||||
|
||||
-(NSTrackingRectTag)trackingRect
|
||||
{
|
||||
return trackingRect;
|
||||
}
|
||||
|
||||
-(BOOL)isFlipped
|
||||
{
|
||||
return YES;
|
||||
@@ -72,39 +67,46 @@
|
||||
if (NSEqualRects (rect, NSZeroRect))
|
||||
return;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
[self getRectsBeingDrawn:&drawn_rects count:&count];
|
||||
|
||||
/* Note: arbitrary limit here to not degrade performace too much. It would
|
||||
* be better to optimize the construction of the region below, by using
|
||||
* _gdk_region_new_from_yxbanded_rects.
|
||||
*/
|
||||
if (count > 25)
|
||||
region = gdk_region_new ();
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
gdk_rect.x = drawn_rects[i].origin.x;
|
||||
gdk_rect.y = drawn_rects[i].origin.y;
|
||||
gdk_rect.width = drawn_rects[i].size.width;
|
||||
gdk_rect.height = drawn_rects[i].size.height;
|
||||
|
||||
gdk_region_union_with_rect (region, &gdk_rect);
|
||||
}
|
||||
|
||||
if (!gdk_region_empty (region))
|
||||
{
|
||||
GdkEvent event;
|
||||
|
||||
gdk_rect.x = rect.origin.x;
|
||||
gdk_rect.y = rect.origin.y;
|
||||
gdk_rect.width = rect.size.width;
|
||||
gdk_rect.height = rect.size.height;
|
||||
|
||||
event.expose.type = GDK_EXPOSE;
|
||||
event.expose.window = g_object_ref (gdk_window);
|
||||
event.expose.send_event = FALSE;
|
||||
event.expose.count = 0;
|
||||
event.expose.region = region;
|
||||
event.expose.area = gdk_rect;
|
||||
|
||||
impl->in_paint_rect_count++;
|
||||
|
||||
region = gdk_region_rectangle (&gdk_rect);
|
||||
(*_gdk_event_func) (&event, _gdk_event_data);
|
||||
|
||||
impl->in_paint_rect_count--;
|
||||
|
||||
g_object_unref (gdk_window);
|
||||
}
|
||||
else
|
||||
{
|
||||
region = gdk_region_new ();
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
gdk_rect.x = drawn_rects[i].origin.x;
|
||||
gdk_rect.y = drawn_rects[i].origin.y;
|
||||
gdk_rect.width = drawn_rects[i].size.width;
|
||||
gdk_rect.height = drawn_rects[i].size.height;
|
||||
|
||||
gdk_region_union_with_rect (region, &gdk_rect);
|
||||
}
|
||||
}
|
||||
|
||||
impl->in_paint_rect_count++;
|
||||
_gdk_window_process_updates_recurse (gdk_window, region);
|
||||
impl->in_paint_rect_count--;
|
||||
|
||||
gdk_region_destroy (region);
|
||||
|
||||
@@ -113,6 +115,8 @@
|
||||
[[self window] invalidateShadow];
|
||||
needsInvalidateShadow = NO;
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
||||
-(void)setNeedsInvalidateShadow:(BOOL)invalidate
|
||||
@@ -129,9 +133,6 @@
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
NSRect rect;
|
||||
|
||||
if (!impl->toplevel)
|
||||
return;
|
||||
|
||||
if (trackingRect)
|
||||
{
|
||||
[self removeTrackingRect:trackingRect];
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
-(void)setGdkWindow:(GdkWindow *)window;
|
||||
-(GdkWindow *)gdkWindow;
|
||||
-(NSTrackingRectTag)trackingRect;
|
||||
-(void)setNeedsInvalidateShadow:(BOOL)invalidate;
|
||||
|
||||
@end
|
||||
|
||||
@@ -142,8 +142,17 @@
|
||||
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
GdkEvent *event;
|
||||
|
||||
/* Ignore new position during showing/hiding the window, otherwise we
|
||||
* would get the off-screen position that is used for hidden windows to
|
||||
* get reliable MouseEntered events when showing them again. See comments
|
||||
* in show() and hide().
|
||||
*/
|
||||
if (inShowOrHide)
|
||||
return;
|
||||
|
||||
private->x = content_rect.origin.x;
|
||||
private->y = _gdk_quartz_window_get_inverted_screen_y (content_rect.origin.y + content_rect.size.height);
|
||||
|
||||
@@ -152,8 +161,8 @@
|
||||
event->configure.window = g_object_ref (window);
|
||||
event->configure.x = private->x;
|
||||
event->configure.y = private->y;
|
||||
event->configure.width = private->width;
|
||||
event->configure.height = private->height;
|
||||
event->configure.width = impl->width;
|
||||
event->configure.height = impl->height;
|
||||
|
||||
_gdk_event_queue_append (gdk_display_get_default (), event);
|
||||
}
|
||||
@@ -163,22 +172,21 @@
|
||||
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
GdkEvent *event;
|
||||
|
||||
private->width = content_rect.size.width;
|
||||
private->height = content_rect.size.height;
|
||||
impl->width = content_rect.size.width;
|
||||
impl->height = content_rect.size.height;
|
||||
|
||||
[[self contentView] setFrame:NSMakeRect (0, 0, private->width, private->height)];
|
||||
|
||||
_gdk_window_update_size (window);
|
||||
[[self contentView] setFrame:NSMakeRect (0, 0, impl->width, impl->height)];
|
||||
|
||||
/* Synthesize a configure event */
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->configure.window = g_object_ref (window);
|
||||
event->configure.x = private->x;
|
||||
event->configure.y = private->y;
|
||||
event->configure.width = private->width;
|
||||
event->configure.height = private->height;
|
||||
event->configure.width = impl->width;
|
||||
event->configure.height = impl->height;
|
||||
|
||||
_gdk_event_queue_append (gdk_display_get_default (), event);
|
||||
}
|
||||
@@ -271,8 +279,32 @@
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
gboolean was_hidden;
|
||||
int requested_x = 0, requested_y = 0;
|
||||
|
||||
inShowOrHide = YES;
|
||||
was_hidden = FALSE;
|
||||
|
||||
if (!GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
NSRect content_rect;
|
||||
NSRect frame_rect;
|
||||
|
||||
was_hidden = TRUE;
|
||||
|
||||
/* We move the window in place if it's not mapped. See comment in
|
||||
* hide().
|
||||
*/
|
||||
content_rect =
|
||||
NSMakeRect (private->x,
|
||||
_gdk_quartz_window_get_inverted_screen_y (private->y) - impl->height,
|
||||
impl->width, impl->height);
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:NO];
|
||||
|
||||
requested_x = frame_rect.origin.x;
|
||||
requested_y = frame_rect.origin.y;
|
||||
}
|
||||
|
||||
if (makeKey)
|
||||
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
|
||||
@@ -280,6 +312,20 @@
|
||||
[impl->toplevel orderFront:nil];
|
||||
|
||||
inShowOrHide = NO;
|
||||
|
||||
/* When the window manager didn't allow our request, update the position
|
||||
* to what it really ended up as.
|
||||
*/
|
||||
if (was_hidden)
|
||||
{
|
||||
NSRect frame_rect;
|
||||
|
||||
frame_rect = [impl->toplevel frame];
|
||||
if (requested_x != frame_rect.origin.x || requested_y != frame_rect.origin.y)
|
||||
{
|
||||
[self windowDidMove:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)hide
|
||||
@@ -287,9 +333,23 @@
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
NSRect content_rect;
|
||||
NSRect frame_rect;
|
||||
|
||||
inShowOrHide = YES;
|
||||
|
||||
/* We move the window away when hiding, to make it possible to move it in
|
||||
* place when showing to get reliable tracking rect events (which are used
|
||||
* to generate crossing events). We have to do this, probably a bug in
|
||||
* quartz.
|
||||
*/
|
||||
content_rect = NSMakeRect (-500 - impl->width, -500 - impl->height,
|
||||
impl->width, impl->height);
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:NO];
|
||||
|
||||
[impl->toplevel orderOut:nil];
|
||||
|
||||
inShowOrHide = NO;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,9 +178,3 @@ gdk_display_supports_composite (GdkDisplay *display)
|
||||
/* FIXME: Implement */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gulong
|
||||
_gdk_windowing_window_get_next_serial (GdkDisplay *display)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
+41
-130
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <sys/time.h>
|
||||
#include <cairo-quartz.h>
|
||||
#include "gdkprivate-quartz.h"
|
||||
|
||||
@@ -32,56 +31,20 @@ typedef struct {
|
||||
CGContextRef cg_context;
|
||||
} GdkQuartzCairoSurfaceData;
|
||||
|
||||
void
|
||||
_gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
/* This is not supported with quartz surfaces. */
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_cairo_surface_destroy (void *data)
|
||||
{
|
||||
GdkQuartzCairoSurfaceData *surface_data = data;
|
||||
GdkDrawableImplQuartz *impl = GDK_DRAWABLE_IMPL_QUARTZ (surface_data->drawable);
|
||||
|
||||
gdk_quartz_drawable_release_context (surface_data->drawable,
|
||||
surface_data->cg_context);
|
||||
|
||||
impl->cairo_surface = NULL;
|
||||
|
||||
gdk_quartz_drawable_release_context (surface_data->drawable,
|
||||
surface_data->cg_context);
|
||||
|
||||
g_free (surface_data);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
CGContextRef cg_context;
|
||||
GdkQuartzCairoSurfaceData *surface_data;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
cg_context = gdk_quartz_drawable_get_context (drawable, TRUE);
|
||||
|
||||
if (!cg_context)
|
||||
return NULL;
|
||||
|
||||
surface_data = g_new (GdkQuartzCairoSurfaceData, 1);
|
||||
surface_data->drawable = drawable;
|
||||
surface_data->cg_context = cg_context;
|
||||
|
||||
surface = cairo_quartz_surface_create_for_cg_context (cg_context,
|
||||
width, height);
|
||||
|
||||
cairo_surface_set_user_data (surface, &gdk_quartz_cairo_key,
|
||||
surface_data,
|
||||
gdk_quartz_cairo_surface_destroy);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
|
||||
{
|
||||
@@ -93,11 +56,24 @@ gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
|
||||
|
||||
if (!impl->cairo_surface)
|
||||
{
|
||||
CGContextRef cg_context;
|
||||
int width, height;
|
||||
GdkQuartzCairoSurfaceData *surface_data;
|
||||
|
||||
cg_context = gdk_quartz_drawable_get_context (drawable, TRUE);
|
||||
if (!cg_context)
|
||||
return NULL;
|
||||
|
||||
gdk_drawable_get_size (drawable, &width, &height);
|
||||
impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable,
|
||||
width, height);
|
||||
|
||||
impl->cairo_surface = cairo_quartz_surface_create_for_cg_context (cg_context, width, height);
|
||||
|
||||
surface_data = g_new (GdkQuartzCairoSurfaceData, 1);
|
||||
surface_data->drawable = drawable;
|
||||
surface_data->cg_context = cg_context;
|
||||
|
||||
cairo_surface_set_user_data (impl->cairo_surface, &gdk_quartz_cairo_key,
|
||||
surface_data, gdk_quartz_cairo_surface_destroy);
|
||||
}
|
||||
else
|
||||
cairo_surface_reference (impl->cairo_surface);
|
||||
@@ -207,6 +183,8 @@ gdk_quartz_draw_arc (GdkDrawable *drawable,
|
||||
GDK_QUARTZ_CONTEXT_FILL :
|
||||
GDK_QUARTZ_CONTEXT_STROKE);
|
||||
|
||||
CGContextSaveGState (context);
|
||||
|
||||
start_angle = angle1 * 2.0 * G_PI / 360.0 / 64.0;
|
||||
end_angle = start_angle + angle2 * 2.0 * G_PI / 360.0 / 64.0;
|
||||
|
||||
@@ -255,6 +233,8 @@ gdk_quartz_draw_arc (GdkDrawable *drawable,
|
||||
CGContextStrokePath (context);
|
||||
}
|
||||
|
||||
CGContextRestoreGState (context);
|
||||
|
||||
gdk_quartz_drawable_release_context (drawable, context);
|
||||
}
|
||||
|
||||
@@ -331,76 +311,55 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkDrawable *original_src)
|
||||
gint height)
|
||||
{
|
||||
int src_depth = gdk_drawable_get_depth (src);
|
||||
int dest_depth = gdk_drawable_get_depth (drawable);
|
||||
GdkDrawableImplQuartz *src_impl;
|
||||
|
||||
if (GDK_IS_WINDOW_IMPL_QUARTZ (src))
|
||||
{
|
||||
GdkWindowImplQuartz *window_impl;
|
||||
|
||||
window_impl = GDK_WINDOW_IMPL_QUARTZ (src);
|
||||
|
||||
/* We do support moving areas on the same drawable, if it can be done
|
||||
* by using a scroll. FIXME: We need to check that the params support
|
||||
* this hack, and make sure it's done properly with any offsets etc?
|
||||
*/
|
||||
if (drawable == (GdkDrawable *)window_impl)
|
||||
{
|
||||
[window_impl->view scrollRect:NSMakeRect (xsrc, ysrc, width, height)
|
||||
by:NSMakeSize (xdest - xsrc, ydest - ysrc)];
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
g_warning ("Drawing with window source != dest is not supported");
|
||||
|
||||
return;
|
||||
}
|
||||
else if (GDK_IS_DRAWABLE_IMPL_QUARTZ (src))
|
||||
if (GDK_IS_DRAWABLE_IMPL_QUARTZ (src))
|
||||
src_impl = GDK_DRAWABLE_IMPL_QUARTZ (src);
|
||||
else if (GDK_IS_PIXMAP (src))
|
||||
src_impl = GDK_DRAWABLE_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (src)->impl);
|
||||
else
|
||||
else if (GDK_IS_WINDOW (src))
|
||||
{
|
||||
g_warning ("Unsupported source %s", G_OBJECT_TYPE_NAME (src));
|
||||
src_impl = GDK_DRAWABLE_IMPL_QUARTZ (GDK_WINDOW_OBJECT (src)->impl);
|
||||
/* FIXME: Implement drawing a window. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Handle drawable and pixmap sources. */
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
if (src_depth == 1)
|
||||
{
|
||||
/* FIXME: src depth 1 is not supported yet */
|
||||
g_warning ("Source with depth 1 unsupported");
|
||||
}
|
||||
else if (dest_depth != 0 && src_depth == dest_depth)
|
||||
{
|
||||
GdkPixmapImplQuartz *pixmap_impl = GDK_PIXMAP_IMPL_QUARTZ (src_impl);
|
||||
CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
|
||||
|
||||
if (!context)
|
||||
return;
|
||||
return;
|
||||
|
||||
_gdk_quartz_gc_update_cg_context (gc, drawable, context,
|
||||
GDK_QUARTZ_CONTEXT_STROKE);
|
||||
GDK_QUARTZ_CONTEXT_STROKE);
|
||||
|
||||
CGContextClipToRect (context, CGRectMake (xdest, ydest, width, height));
|
||||
CGContextTranslateCTM (context, xdest - xsrc, ydest - ysrc +
|
||||
pixmap_impl->height);
|
||||
GDK_PIXMAP_IMPL_QUARTZ (src_impl)->height);
|
||||
CGContextScaleCTM (context, 1.0, -1.0);
|
||||
|
||||
CGContextDrawImage (context,
|
||||
CGRectMake (0, 0, pixmap_impl->width, pixmap_impl->height),
|
||||
pixmap_impl->image);
|
||||
CGContextDrawImage (context,
|
||||
CGRectMake(0, 0,
|
||||
GDK_PIXMAP_IMPL_QUARTZ (src_impl)->width,
|
||||
GDK_PIXMAP_IMPL_QUARTZ (src_impl)->height),
|
||||
GDK_PIXMAP_IMPL_QUARTZ (src_impl)->image);
|
||||
|
||||
gdk_quartz_drawable_release_context (drawable, context);
|
||||
}
|
||||
else
|
||||
g_warning ("Attempt to draw a drawable with depth %d to a drawable with depth %d",
|
||||
src_depth, dest_depth);
|
||||
src_depth, dest_depth);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -661,7 +620,7 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
|
||||
drawable_class->draw_polygon = gdk_quartz_draw_polygon;
|
||||
drawable_class->draw_text = gdk_quartz_draw_text;
|
||||
drawable_class->draw_text_wc = gdk_quartz_draw_text_wc;
|
||||
drawable_class->draw_drawable_with_src = gdk_quartz_draw_drawable;
|
||||
drawable_class->draw_drawable = gdk_quartz_draw_drawable;
|
||||
drawable_class->draw_points = gdk_quartz_draw_points;
|
||||
drawable_class->draw_segments = gdk_quartz_draw_segments;
|
||||
drawable_class->draw_lines = gdk_quartz_draw_lines;
|
||||
@@ -722,51 +681,6 @@ gdk_quartz_drawable_get_context (GdkDrawable *drawable,
|
||||
return GDK_DRAWABLE_IMPL_QUARTZ_GET_CLASS (drawable)->get_context (drawable, antialias);
|
||||
}
|
||||
|
||||
/* Help preventing "beam sync penalty" where CG makes all graphics code
|
||||
* block until the next vsync if we try to flush (including call display on
|
||||
* a view) too often. We do this by limiting the manual flushing done
|
||||
* outside of expose calls to less than some frequency when measured over
|
||||
* the last 4 flushes. This is a bit arbitray, but seems to make it possible
|
||||
* for some quick manual flushes (such as gtkruler or gimp's marching ants)
|
||||
* without hitting the max flush frequency.
|
||||
*
|
||||
* If drawable NULL, no flushing is done, only registering that a flush was
|
||||
* done externally.
|
||||
*/
|
||||
void
|
||||
_gdk_quartz_drawable_flush (GdkDrawable *drawable)
|
||||
{
|
||||
static struct timeval prev_tv;
|
||||
static gint intervals[4];
|
||||
static gint index;
|
||||
struct timeval tv;
|
||||
gint ms;
|
||||
|
||||
gettimeofday (&tv, NULL);
|
||||
ms = (tv.tv_sec - prev_tv.tv_sec) * 1000 + (tv.tv_usec - prev_tv.tv_usec) / 1000;
|
||||
intervals[index++ % 4] = ms;
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
ms = intervals[0] + intervals[1] + intervals[2] + intervals[3];
|
||||
|
||||
/* ~25Hz on average. */
|
||||
if (ms > 4*40)
|
||||
{
|
||||
if (GDK_IS_WINDOW_IMPL_QUARTZ (drawable))
|
||||
{
|
||||
GdkWindowImplQuartz *window_impl = GDK_WINDOW_IMPL_QUARTZ (drawable);
|
||||
|
||||
[window_impl->toplevel flushWindow];
|
||||
}
|
||||
|
||||
prev_tv = tv;
|
||||
}
|
||||
}
|
||||
else
|
||||
prev_tv = tv;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_quartz_drawable_release_context (GdkDrawable *drawable,
|
||||
CGContextRef cg_context)
|
||||
@@ -780,10 +694,7 @@ gdk_quartz_drawable_release_context (GdkDrawable *drawable,
|
||||
|
||||
/* See comment in gdk_quartz_drawable_get_context(). */
|
||||
if (window_impl->in_paint_rect_count == 0)
|
||||
{
|
||||
_gdk_quartz_drawable_flush (drawable);
|
||||
[window_impl->view unlockFocus];
|
||||
}
|
||||
[window_impl->view unlockFocus];
|
||||
}
|
||||
else if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable))
|
||||
CGContextRelease (cg_context);
|
||||
|
||||
+1203
-478
File diff suppressed because it is too large
Load Diff
@@ -208,8 +208,7 @@ _gdk_quartz_gc_new (GdkDrawable *drawable,
|
||||
|
||||
void
|
||||
_gdk_windowing_gc_set_clip_region (GdkGC *gc,
|
||||
const GdkRegion *region,
|
||||
gboolean reset_origin)
|
||||
const GdkRegion *region)
|
||||
{
|
||||
GdkGCQuartz *private = GDK_GC_QUARTZ (gc);
|
||||
|
||||
@@ -225,11 +224,8 @@ _gdk_windowing_gc_set_clip_region (GdkGC *gc,
|
||||
|
||||
private->have_clip_region = region != NULL;
|
||||
|
||||
if (reset_origin)
|
||||
{
|
||||
gc->clip_x_origin = 0;
|
||||
gc->clip_y_origin = 0;
|
||||
}
|
||||
gc->clip_x_origin = 0;
|
||||
gc->clip_y_origin = 0;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -285,6 +281,7 @@ gdk_quartz_draw_tiled_pattern (void *info,
|
||||
CGContextRef context)
|
||||
{
|
||||
GdkGC *gc = GDK_GC (info);
|
||||
GdkGCQuartz *private = GDK_GC_QUARTZ (gc);
|
||||
CGImageRef pattern_image;
|
||||
size_t width, height;
|
||||
|
||||
|
||||
@@ -23,16 +23,68 @@
|
||||
#include "gdkprivate-quartz.h"
|
||||
|
||||
void
|
||||
_gdk_quartz_window_queue_translation (GdkWindow *window,
|
||||
GdkRegion *area,
|
||||
gint dx,
|
||||
gint dy)
|
||||
_gdk_quartz_window_scroll (GdkWindow *window,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
NSRect visible_nsrect;
|
||||
GdkRectangle visible_rect, scrolled_rect;
|
||||
GdkRegion *visible_region, *scrolled_region;
|
||||
GdkRectangle *rects;
|
||||
gint n_rects, i;
|
||||
GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
GList *list;
|
||||
|
||||
/* Move the current invalid region */
|
||||
if (private->update_area)
|
||||
gdk_region_offset (private->update_area, dx, dy);
|
||||
|
||||
visible_nsrect = [impl->view visibleRect];
|
||||
|
||||
visible_rect.x = visible_nsrect.origin.x;
|
||||
visible_rect.y = visible_nsrect.origin.y;
|
||||
visible_rect.width = visible_nsrect.size.width;
|
||||
visible_rect.height = visible_nsrect.size.height;
|
||||
|
||||
scrolled_rect = visible_rect;
|
||||
scrolled_rect.x += dx;
|
||||
scrolled_rect.y += dy;
|
||||
|
||||
gdk_rectangle_intersect (&visible_rect, &scrolled_rect, &scrolled_rect);
|
||||
|
||||
visible_region = gdk_region_rectangle (&visible_rect);
|
||||
scrolled_region = gdk_region_rectangle (&scrolled_rect);
|
||||
|
||||
gdk_region_subtract (visible_region, scrolled_region);
|
||||
|
||||
[impl->view scrollRect:[impl->view bounds] by:NSMakeSize(dx, dy)];
|
||||
|
||||
gdk_region_get_rectangles (visible_region, &rects, &n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
[impl->view setNeedsDisplayInRect:NSMakeRect (rects[i].x, rects[i].y, rects[i].width, rects[i].height)];
|
||||
|
||||
g_free (rects);
|
||||
|
||||
gdk_region_destroy (visible_region);
|
||||
gdk_region_destroy (scrolled_region);
|
||||
|
||||
/* Move child windows */
|
||||
for (list = private->children; list; list = list->next)
|
||||
{
|
||||
GdkWindowObject *child = GDK_WINDOW_OBJECT (list->data);
|
||||
|
||||
gdk_window_move (list->data,
|
||||
child->x + dx,
|
||||
child->y + dy);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_quartz_window_queue_antiexpose (GdkWindow *window,
|
||||
GdkRegion *area)
|
||||
void
|
||||
_gdk_quartz_window_move_region (GdkWindow *window,
|
||||
const GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
return FALSE;
|
||||
/* FIXME: Implement */
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ gdk_device_get_history (GdkDevice *device,
|
||||
gint *n_events)
|
||||
{
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
g_return_val_if_fail (GDK_WINDOW_IS_QUARTZ (window), FALSE);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
g_return_val_if_fail (events != NULL, FALSE);
|
||||
g_return_val_if_fail (n_events != NULL, FALSE);
|
||||
|
||||
@@ -262,7 +262,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
GdkInputWindow *iw;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_WINDOW_IS_QUARTZ (window));
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
window_private = (GdkWindowObject*) window;
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
typedef struct _GdkAxisInfo GdkAxisInfo;
|
||||
typedef struct _GdkInputVTable GdkInputVTable;
|
||||
typedef struct _GdkDevicePrivate GdkDevicePrivate;
|
||||
typedef struct _GdkInputWindow GdkInputWindow;
|
||||
|
||||
struct _GdkInputVTable {
|
||||
gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
|
||||
|
||||
@@ -137,10 +137,10 @@ data_provider_release (void *info, const void *data, size_t size)
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
_gdk_pixmap_new (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth)
|
||||
gdk_pixmap_new (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth)
|
||||
{
|
||||
GdkPixmap *pixmap;
|
||||
GdkDrawableImplQuartz *draw_impl;
|
||||
@@ -224,10 +224,10 @@ _gdk_pixmap_new (GdkDrawable *drawable,
|
||||
}
|
||||
|
||||
GdkPixmap *
|
||||
_gdk_bitmap_create_from_data (GdkDrawable *window,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height)
|
||||
gdk_bitmap_create_from_data (GdkDrawable *window,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkPixmap *pixmap;
|
||||
GdkPixmapImplQuartz *impl;
|
||||
@@ -264,13 +264,13 @@ _gdk_bitmap_create_from_data (GdkDrawable *window,
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
_gdk_pixmap_create_from_data (GdkDrawable *drawable,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth,
|
||||
const GdkColor *fg,
|
||||
const GdkColor *bg)
|
||||
gdk_pixmap_create_from_data (GdkDrawable *drawable,
|
||||
const gchar *data,
|
||||
gint width,
|
||||
gint height,
|
||||
gint depth,
|
||||
const GdkColor *fg,
|
||||
const GdkColor *bg)
|
||||
{
|
||||
/* FIXME: Implement */
|
||||
return NULL;
|
||||
|
||||
@@ -102,8 +102,6 @@ extern GdkWindow *_gdk_root;
|
||||
|
||||
extern GdkDragContext *_gdk_quartz_drag_source_context;
|
||||
|
||||
#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindowObject *)win)->impl))
|
||||
|
||||
/* Initialization */
|
||||
void _gdk_windowing_window_init (void);
|
||||
void _gdk_events_init (void);
|
||||
@@ -151,13 +149,21 @@ void _gdk_quartz_window_debug_highlight (GdkWindow *window,
|
||||
|
||||
/* Events */
|
||||
typedef enum {
|
||||
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
|
||||
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP,
|
||||
GDK_QUARTZ_EVENT_SUBTYPE_FAKE_CROSSING
|
||||
} GdkQuartzEventSubType;
|
||||
|
||||
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
|
||||
gboolean got_focus);
|
||||
void _gdk_quartz_events_send_map_event (GdkWindow *window);
|
||||
GdkWindow * _gdk_quartz_events_get_mouse_window (gboolean consider_grabs);
|
||||
void _gdk_quartz_events_update_mouse_window (GdkWindow *window);
|
||||
void _gdk_quartz_events_update_cursor (GdkWindow *window);
|
||||
void _gdk_quartz_events_send_map_events (GdkWindow *window);
|
||||
GdkEventMask _gdk_quartz_events_get_current_event_mask (void);
|
||||
void _gdk_quartz_events_trigger_crossing_events(gboolean defer_to_mainloop);
|
||||
|
||||
extern GdkWindow *_gdk_quartz_keyboard_grab_window;
|
||||
extern GdkWindow *_gdk_quartz_pointer_grab_window;
|
||||
|
||||
/* Event loop */
|
||||
gboolean _gdk_quartz_event_loop_check_pending (void);
|
||||
@@ -180,17 +186,14 @@ gboolean _gdk_quartz_keys_is_modifier (guint keycode);
|
||||
|
||||
/* Drawable */
|
||||
void _gdk_quartz_drawable_finish (GdkDrawable *drawable);
|
||||
void _gdk_quartz_drawable_flush (GdkDrawable *drawable);
|
||||
|
||||
/* Geometry */
|
||||
void _gdk_quartz_window_scroll (GdkWindow *window,
|
||||
gint dx,
|
||||
gint dy);
|
||||
void _gdk_quartz_window_queue_translation (GdkWindow *window,
|
||||
GdkRegion *area,
|
||||
gint dx,
|
||||
gint dy);
|
||||
gboolean _gdk_quartz_window_queue_antiexpose (GdkWindow *window,
|
||||
GdkRegion *area);
|
||||
void _gdk_quartz_window_move_region (GdkWindow *window,
|
||||
const GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy);
|
||||
|
||||
#endif /* __GDK_PRIVATE_QUARTZ_H__ */
|
||||
|
||||
+700
-394
File diff suppressed because it is too large
Load Diff
@@ -45,12 +45,17 @@ struct _GdkWindowImplQuartz
|
||||
{
|
||||
GdkDrawableImplQuartz parent_instance;
|
||||
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
NSWindow *toplevel;
|
||||
NSTrackingRectTag tracking_rect;
|
||||
GdkQuartzView *view;
|
||||
|
||||
GdkWindowTypeHint type_hint;
|
||||
|
||||
NSCursor *nscursor;
|
||||
|
||||
GdkRegion *paint_clip_region;
|
||||
gint begin_paint_count;
|
||||
gint in_paint_rect_count;
|
||||
|
||||
@@ -36,12 +36,6 @@ _gdk_windowing_set_default_display (GdkDisplay *display)
|
||||
g_assert (display == NULL || _gdk_display == display);
|
||||
}
|
||||
|
||||
gulong
|
||||
_gdk_windowing_window_get_next_serial (GdkDisplay *display)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MONITOR_INFO
|
||||
static BOOL CALLBACK
|
||||
count_monitor (HMONITOR hmonitor,
|
||||
@@ -206,7 +200,7 @@ gdk_display_open (const gchar *display_name)
|
||||
_gdk_visual_init ();
|
||||
gdk_screen_set_default_colormap (_gdk_screen,
|
||||
gdk_screen_get_system_colormap (_gdk_screen));
|
||||
_gdk_windowing_window_init (_gdk_screen);
|
||||
_gdk_windowing_window_init ();
|
||||
_gdk_windowing_image_init ();
|
||||
_gdk_events_init ();
|
||||
_gdk_input_init (_gdk_display);
|
||||
|
||||
@@ -92,8 +92,7 @@ static void gdk_win32_draw_drawable (GdkDrawable *drawable,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkDrawable *original_src);
|
||||
gint height);
|
||||
static void gdk_win32_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
@@ -180,7 +179,7 @@ gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
|
||||
drawable_class->draw_polygon = gdk_win32_draw_polygon;
|
||||
drawable_class->draw_text = gdk_win32_draw_text;
|
||||
drawable_class->draw_text_wc = gdk_win32_draw_text_wc;
|
||||
drawable_class->draw_drawable_with_src = gdk_win32_draw_drawable;
|
||||
drawable_class->draw_drawable = gdk_win32_draw_drawable;
|
||||
drawable_class->draw_points = gdk_win32_draw_points;
|
||||
drawable_class->draw_segments = gdk_win32_draw_segments;
|
||||
drawable_class->draw_lines = gdk_win32_draw_lines;
|
||||
@@ -1149,8 +1148,7 @@ gdk_win32_draw_drawable (GdkDrawable *drawable,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkDrawable *original_src)
|
||||
gint height)
|
||||
{
|
||||
g_assert (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable));
|
||||
|
||||
@@ -1659,45 +1657,16 @@ _gdk_win32_blit (gboolean use_fg_bg,
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
if (GDK_IS_WINDOW_IMPL_WIN32 (draw_impl) &&
|
||||
GDK_IS_PIXMAP_IMPL_WIN32 (src_impl))
|
||||
{
|
||||
GdkPixmapImplWin32 *src_pixmap = GDK_PIXMAP_IMPL_WIN32 (src_impl);
|
||||
|
||||
if (xsrc < 0)
|
||||
{
|
||||
width += xsrc;
|
||||
xdest -= xsrc;
|
||||
xsrc = 0;
|
||||
}
|
||||
|
||||
if (ysrc < 0)
|
||||
{
|
||||
height += ysrc;
|
||||
ydest -= ysrc;
|
||||
ysrc = 0;
|
||||
}
|
||||
|
||||
if (xsrc + width > src_pixmap->width)
|
||||
width = src_pixmap->width - xsrc;
|
||||
if (ysrc + height > src_pixmap->height)
|
||||
height = src_pixmap->height - ysrc;
|
||||
}
|
||||
|
||||
hdc = gdk_win32_hdc_get (&draw_impl->parent_instance, gc, GDK_GC_FOREGROUND);
|
||||
|
||||
gdk_drawable_get_size (src_impl->wrapper, &src_width, &src_height);
|
||||
gdk_drawable_get_size (src, &src_width, &src_height);
|
||||
|
||||
if ((src_rgn = CreateRectRgn (0, 0, src_width + 1, src_height + 1)) == NULL)
|
||||
{
|
||||
WIN32_GDI_FAILED ("CreateRectRgn");
|
||||
}
|
||||
WIN32_GDI_FAILED ("CreateRectRgn");
|
||||
else if ((draw_rgn = CreateRectRgn (xsrc, ysrc,
|
||||
xsrc + width + 1,
|
||||
ysrc + height + 1)) == NULL)
|
||||
{
|
||||
WIN32_GDI_FAILED ("CreateRectRgn");
|
||||
}
|
||||
WIN32_GDI_FAILED ("CreateRectRgn");
|
||||
else
|
||||
{
|
||||
if (GDK_IS_WINDOW_IMPL_WIN32 (draw_impl))
|
||||
@@ -1762,7 +1731,6 @@ _gdk_win32_blit (gboolean use_fg_bg,
|
||||
xsrc, ysrc, xdest, ydest, width, height);
|
||||
else
|
||||
blit_from_window (hdc, GDK_GC_WIN32 (gc), src_impl, xsrc, ysrc, xdest, ydest, width, height);
|
||||
|
||||
gdk_win32_hdc_release (&draw_impl->parent_instance, gc, GDK_GC_FOREGROUND);
|
||||
}
|
||||
|
||||
@@ -1839,9 +1807,7 @@ _gdk_win32_drawable_acquire_dc (GdkDrawable *drawable)
|
||||
return impl->hdc;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1878,17 +1844,6 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
|
||||
}
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
HDC hdc = _gdk_win32_drawable_acquire_dc (drawable);
|
||||
if (!hdc)
|
||||
return NULL;
|
||||
return cairo_win32_surface_create (hdc);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_win32_cairo_surface_destroy (void *data)
|
||||
{
|
||||
@@ -1909,28 +1864,21 @@ gdk_win32_ref_cairo_surface (GdkDrawable *drawable)
|
||||
|
||||
if (!impl->cairo_surface)
|
||||
{
|
||||
// On Win32 cairo surface, width and height are determined from the DC
|
||||
impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable, 0, 0);
|
||||
HDC hdc = _gdk_win32_drawable_acquire_dc (drawable);
|
||||
if (!hdc)
|
||||
return NULL;
|
||||
|
||||
impl->cairo_surface = cairo_win32_surface_create (hdc);
|
||||
|
||||
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key,
|
||||
drawable, gdk_win32_cairo_surface_destroy);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_surface_reference (impl->cairo_surface);
|
||||
}
|
||||
cairo_surface_reference (impl->cairo_surface);
|
||||
|
||||
return impl->cairo_surface;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
// Do nothing. The surface size is determined by the DC
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_win32_get_depth (GdkDrawable *drawable)
|
||||
{
|
||||
@@ -1974,9 +1922,10 @@ _gdk_win32_drawable_finish (GdkDrawable *drawable)
|
||||
if (impl->cairo_surface)
|
||||
{
|
||||
cairo_surface_finish (impl->cairo_surface);
|
||||
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key, NULL, NULL);
|
||||
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
//TODO_CSW: g_assert (impl->hdc_count == 0);
|
||||
|
||||
g_assert (impl->hdc_count == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ struct _GdkDrawableImplWin32
|
||||
struct _GdkDrawableImplWin32Class
|
||||
{
|
||||
GdkDrawableClass parent_class;
|
||||
|
||||
};
|
||||
|
||||
GType gdk_drawable_impl_win32_get_type (void);
|
||||
|
||||
+678
-132
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user