Compare commits
362 Commits
4.8.3
...
async-colo
Author | SHA1 | Date | |
---|---|---|---|
|
2c42750efd | ||
|
ab833951db | ||
|
aa5041e65c | ||
|
4022786847 | ||
|
029bb9ad18 | ||
|
799fb41937 | ||
|
e6f4c596fa | ||
|
3d7fb26588 | ||
|
93f9b2d519 | ||
|
6f3613a06f | ||
|
3723778f42 | ||
|
3fc3f8d2ff | ||
|
2868f1b509 | ||
|
f44570e71a | ||
|
15d39dddc5 | ||
|
1028449bcc | ||
|
01cca279f9 | ||
|
a7cae4bffa | ||
|
3e2e29a1dc | ||
|
de069e15c2 | ||
|
f8edefd7c0 | ||
|
24a15b51fe | ||
|
1f7aba345d | ||
|
230212c59c | ||
|
86f7c19b91 | ||
|
e5cea4e39d | ||
|
22aca8952f | ||
|
c0e437d163 | ||
|
ffe97a453f | ||
|
c09ba28b06 | ||
|
81de43eba5 | ||
|
788be8b945 | ||
|
0370979225 | ||
|
943014074c | ||
|
c0e8523a01 | ||
|
8374ebe4c4 | ||
|
611d14108d | ||
|
25cf702345 | ||
|
1d9c61cada | ||
|
71adb26a0d | ||
|
e27fa33690 | ||
|
f7dfead861 | ||
|
aac04a0995 | ||
|
8af191e52d | ||
|
06382ff836 | ||
|
cd469788c3 | ||
|
44b5076cf2 | ||
|
e5be9e1035 | ||
|
b831d01f0d | ||
|
278bcf2680 | ||
|
c19d0dc9ea | ||
|
edd5ed169e | ||
|
8ec9c3fdc6 | ||
|
e95022040f | ||
|
3a2ce620e2 | ||
|
df49bf9eec | ||
|
53327f3aea | ||
|
c0c3d75062 | ||
|
d0d0409f9d | ||
|
3a7d094542 | ||
|
280adcbb8c | ||
|
83431a999c | ||
|
eeeee99aa8 | ||
|
0f503e0ba2 | ||
|
3e4ae62b44 | ||
|
ec4f814bd4 | ||
|
0141ba4e00 | ||
|
52ef16c21b | ||
|
6ca7104015 | ||
|
07d6166ab8 | ||
|
dc651c3dc3 | ||
|
f520801626 | ||
|
4e3fbd0b0f | ||
|
8a24fdea38 | ||
|
b26222b6ba | ||
|
c8d291ab86 | ||
|
0a87438432 | ||
|
ddf1cd6678 | ||
|
9c6d5e2ca5 | ||
|
1f2561b08e | ||
|
d5b31a30fd | ||
|
39c678988d | ||
|
9052c191cb | ||
|
766f442636 | ||
|
27a3d2d09e | ||
|
3a3482e41e | ||
|
44c37fa34a | ||
|
5c41dbfaa5 | ||
|
c9d2ff7a0f | ||
|
174af596c5 | ||
|
de2624faa7 | ||
|
cda784a5f4 | ||
|
cc33dbef03 | ||
|
ce36611c4e | ||
|
038cb31d27 | ||
|
3b53a6b0a9 | ||
|
619ff2338e | ||
|
2bcd6949df | ||
|
abd78ce5f5 | ||
|
7899fc03c4 | ||
|
9984f00781 | ||
|
a0d3bdc911 | ||
|
b96317b872 | ||
|
6c84958b9f | ||
|
f2559b1dbb | ||
|
ed2ade4801 | ||
|
4549172825 | ||
|
b877804eb6 | ||
|
5310abbcf7 | ||
|
490d4b0b9e | ||
|
375432f0b6 | ||
|
c00a23ebbc | ||
|
4cd2e2a11f | ||
|
ae7bf4dcf7 | ||
|
9ed1505073 | ||
|
e040d3663e | ||
|
6af69a7b7d | ||
|
a116e0dd26 | ||
|
3e2b962a36 | ||
|
abb60ec579 | ||
|
b738d4a6ac | ||
|
0149bd49ca | ||
|
e05157437f | ||
|
e045e798a2 | ||
|
7908a72fa9 | ||
|
593bf2bc6d | ||
|
cf701d5db4 | ||
|
bf8d4c5418 | ||
|
912145c81b | ||
|
913127b553 | ||
|
62f85e2f49 | ||
|
4b1212eb4a | ||
|
94a096ec4c | ||
|
404ee55ec4 | ||
|
5fbd52da49 | ||
|
7bf094c117 | ||
|
4bb79decf3 | ||
|
60fb93e063 | ||
|
1894a8960e | ||
|
4ba5c90bc9 | ||
|
1d16bd7d30 | ||
|
17819ad4f6 | ||
|
ac1ea6faca | ||
|
8a3f1a1fa1 | ||
|
46c7c0c4e6 | ||
|
dd60a9abd6 | ||
|
50835ffbf6 | ||
|
637713fe72 | ||
|
7e71c868ab | ||
|
aaf5c43e78 | ||
|
5fb6f0e410 | ||
|
cd031de680 | ||
|
eeda25ab04 | ||
|
acaf04a24e | ||
|
bcabe77799 | ||
|
64cf31f348 | ||
|
e037155a94 | ||
|
55cbb8a8d6 | ||
|
db599f2ae6 | ||
|
741567868e | ||
|
1e5e0480fd | ||
|
917aa7928d | ||
|
cd4dbd67a2 | ||
|
5a6eab05e9 | ||
|
55ccaf9df9 | ||
|
af0e056eec | ||
|
77d1f0d982 | ||
|
d4d7d5eafd | ||
|
f658027c51 | ||
|
7be993b728 | ||
|
e1d78821f6 | ||
|
94ac1af293 | ||
|
b4db48935d | ||
|
f5063c1435 | ||
|
8092a6858e | ||
|
0fbaeaabd0 | ||
|
995f00d23f | ||
|
100605ef0c | ||
|
1246cd5e73 | ||
|
f30e59fed9 | ||
|
5e8b294faf | ||
|
c84c469b78 | ||
|
1a5a65acd0 | ||
|
6f5d18a9f5 | ||
|
004f22a51c | ||
|
d775caff7f | ||
|
baf3a3eecd | ||
|
ca2e14788d | ||
|
c57d8fc6be | ||
|
294e5bb79f | ||
|
bde19f9b2a | ||
|
1d2071b892 | ||
|
b46eb5c20a | ||
|
3d605615ce | ||
|
c502d7fca6 | ||
|
9f8abc5d74 | ||
|
c8cbb3fbba | ||
|
fa3c8ed5f9 | ||
|
8ac5f1983e | ||
|
eccc02d084 | ||
|
0c94db7147 | ||
|
ed87473bf9 | ||
|
812a879ec2 | ||
|
5627542d7c | ||
|
f42fe500c9 | ||
|
ac3177ce95 | ||
|
ccaaff406f | ||
|
b1ec43ae33 | ||
|
ee8c2a235f | ||
|
299fbfd722 | ||
|
5f54ecdf2c | ||
|
e09138ce45 | ||
|
a71893f88b | ||
|
01324ffaff | ||
|
c354465ed8 | ||
|
50ab2386ec | ||
|
bf9f362597 | ||
|
d03ee57cc5 | ||
|
6f24bd9ff4 | ||
|
616e0a0d32 | ||
|
ee76105119 | ||
|
381f863a18 | ||
|
57c63d9ce7 | ||
|
0522dade9f | ||
|
484cff2182 | ||
|
dd3c371c08 | ||
|
3145bce6a1 | ||
|
73f991a7fd | ||
|
0205caa371 | ||
|
c2c46a7036 | ||
|
2b00b64e8c | ||
|
4e2522a080 | ||
|
473065dfeb | ||
|
60dafebd91 | ||
|
35370752d5 | ||
|
808d00906c | ||
|
da5d5bd71f | ||
|
0c99e69423 | ||
|
410813eb6b | ||
|
6cc44eb0fe | ||
|
11ee930b9d | ||
|
69e4c9b01e | ||
|
c32fed9238 | ||
|
4941ef659f | ||
|
6efb18330f | ||
|
5e256590db | ||
|
79303d7cd3 | ||
|
681a818af2 | ||
|
933b1eb4df | ||
|
c419b57754 | ||
|
05323869d7 | ||
|
2520148ebb | ||
|
a06a4ad59a | ||
|
141aac1a60 | ||
|
8a1578ede8 | ||
|
8ba7840528 | ||
|
3168a3e086 | ||
|
3cf9149129 | ||
|
7c8a098852 | ||
|
ecbdb3104a | ||
|
c8a332b3af | ||
|
b5f7d57124 | ||
|
0db5c7f421 | ||
|
ed83272f35 | ||
|
20b49e7c34 | ||
|
6a6ef0f437 | ||
|
32ef462f1d | ||
|
b895360f49 | ||
|
c2c094e8a1 | ||
|
d4d0192405 | ||
|
15ea36e7fd | ||
|
692279586a | ||
|
9eec475dcc | ||
|
661130d429 | ||
|
68b73ebf91 | ||
|
08c0020ac3 | ||
|
ac87c72797 | ||
|
5be8710774 | ||
|
5fa027ab8a | ||
|
dbe04adb1a | ||
|
6815f3af6d | ||
|
f8357512d0 | ||
|
8bfc19e7f7 | ||
|
d6f7449636 | ||
|
f4286e8f1a | ||
|
14e6fd1f12 | ||
|
2e57621fc5 | ||
|
4a8ae3a20c | ||
|
61393fdcce | ||
|
6ed6cebcf4 | ||
|
2f764f6c18 | ||
|
a646e50019 | ||
|
e967dfed2d | ||
|
2dc33a9de1 | ||
|
7c5e1c6195 | ||
|
8607312fef | ||
|
abac891bd2 | ||
|
2e25a13fc0 | ||
|
7a2c4e8a38 | ||
|
90e0ace325 | ||
|
9a2a5d9c8b | ||
|
d4dd0dcd79 | ||
|
d454586927 | ||
|
1917b6a0a3 | ||
|
a924b820c2 | ||
|
9e82d2b843 | ||
|
ab7a04d89f | ||
|
a377f95aac | ||
|
4356e0c3ce | ||
|
5d5de9f759 | ||
|
e1f69ea278 | ||
|
6a76fe41c6 | ||
|
aae82d7992 | ||
|
ca576e877f | ||
|
bc23038848 | ||
|
43e8730acd | ||
|
c43def5fce | ||
|
e68b365fa1 | ||
|
3867f9b8ea | ||
|
0b20c57867 | ||
|
7e9ca5b41d | ||
|
a527a4d82e | ||
|
adfc29968a | ||
|
e17e94d2da | ||
|
9af3bb8dc1 | ||
|
998dd11cbd | ||
|
9cb8d21cb5 | ||
|
4fc4298920 | ||
|
230188fb30 | ||
|
a96c75ff02 | ||
|
1b4ed00509 | ||
|
a54284b629 | ||
|
ee9e9bb3e1 | ||
|
cae9689281 | ||
|
1f6e2cf291 | ||
|
69a76054e8 | ||
|
31fea11255 | ||
|
5dd7e24806 | ||
|
848dc78112 | ||
|
e9d7cd3a48 | ||
|
b3a3a6ceb1 | ||
|
148c133674 | ||
|
d2c9cbba4f | ||
|
8b33900e1d | ||
|
0c3572312a | ||
|
7e683ed89b | ||
|
7fb892460a | ||
|
d517804acd | ||
|
ce761122b2 | ||
|
76a5354ad7 | ||
|
006b473c0c | ||
|
5e1af6d7d5 | ||
|
ec0cd4a994 | ||
|
86864d7bc0 | ||
|
485ffcde38 | ||
|
0304eaec94 | ||
|
a7814a0963 | ||
|
160a83023a | ||
|
911abe2d2c | ||
|
0c02573c47 | ||
|
4257e1ce4f | ||
|
94a4c2cb40 |
@@ -192,6 +192,7 @@ macos:
|
||||
only:
|
||||
- branches@GNOME/gtk
|
||||
stage: build
|
||||
allow_failure: true
|
||||
tags:
|
||||
- macos
|
||||
needs: []
|
||||
|
47
NEWS
47
NEWS
@@ -1,3 +1,50 @@
|
||||
Overview of Changes in 4.9.1, dd-mm-yyyy
|
||||
========================================
|
||||
|
||||
Note that deprecations are an early outlook
|
||||
at changes that will appear in an eventual
|
||||
GTK 5 release, which is still far away.
|
||||
|
||||
* GtkTreeView, GtkIconView, GtkComboBox and
|
||||
auxiliary classes have been deprecated
|
||||
|
||||
* GtkEntryCompletion has been deprecated
|
||||
|
||||
* GtkStyleContext has been deprecated
|
||||
|
||||
* gtk_render_ and gtk_snapshot_render_ APIs
|
||||
have been deprecated
|
||||
|
||||
* GtkAppChooser widgets hae been deprecated
|
||||
|
||||
* GtkMountOperation:
|
||||
- Fix the dialog to look reasonable
|
||||
- Make it work under non-X11
|
||||
|
||||
* GtkStringSorter:
|
||||
- Support different collation methods
|
||||
|
||||
* Accessibility:
|
||||
- Introduce GtkAccessibleRange and implement it
|
||||
|
||||
* Debugging:
|
||||
- Unify formatting for debug output
|
||||
- Make make debug options available in
|
||||
non-debug builds
|
||||
|
||||
* Translation updates:
|
||||
Abkhazian
|
||||
Basque
|
||||
Bulgarian
|
||||
Croatian
|
||||
Friulian
|
||||
Georgian
|
||||
German
|
||||
Hungarian
|
||||
Russian
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.8.1, 16-09-2022
|
||||
========================================
|
||||
|
||||
|
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "constraint-editor.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
struct _ConstraintEditor
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "guide-editor.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
struct _GuideEditor
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
@@ -11,6 +11,8 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
enum
|
||||
{
|
||||
ICON_NAME_COL,
|
||||
|
@@ -1,20 +1,16 @@
|
||||
/* Theming/CSS Accordion
|
||||
*
|
||||
* A simple accordion demo written using CSS transitions and multiple backgrounds
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
destroy_provider (GtkWidget *window,
|
||||
GtkStyleProvider *provider)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
||||
for (child = gtk_widget_get_first_child (widget);
|
||||
child != NULL;
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
apply_css (child, provider);
|
||||
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (window), provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
@@ -24,8 +20,8 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *container, *child;
|
||||
GtkStyleProvider *provider;
|
||||
GtkWidget *container, *styled_box, *child;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
|
||||
@@ -33,10 +29,13 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
styled_box = gtk_frame_new (NULL);
|
||||
gtk_window_set_child (GTK_WINDOW (window), styled_box);
|
||||
gtk_widget_add_css_class (styled_box, "accordion");
|
||||
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (container, GTK_ALIGN_CENTER);
|
||||
gtk_window_set_child (GTK_WINDOW (window), container);
|
||||
gtk_frame_set_child (GTK_FRAME (styled_box), container);
|
||||
|
||||
child = gtk_button_new_with_label ("This");
|
||||
gtk_box_append (GTK_BOX (container), child);
|
||||
@@ -56,10 +55,16 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
child = gtk_button_new_with_label (":-)");
|
||||
gtk_box_append (GTK_BOX (container), child);
|
||||
|
||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
||||
gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider), "/css_accordion/css_accordion.css");
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_resource (provider, "/css_accordion/css_accordion.css");
|
||||
|
||||
apply_css (window, provider);
|
||||
gtk_style_context_add_provider_for_display (gtk_widget_get_display (window),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (destroy_provider), provider);
|
||||
g_object_unref (provider);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -1,13 +1,13 @@
|
||||
@import url("resource://css_accordion/reset.css");
|
||||
.accordion, .accordion * {
|
||||
all: unset;
|
||||
|
||||
* {
|
||||
transition-property: color, background-color, border-color, background-image, padding, border-width;
|
||||
transition-duration: 1s;
|
||||
|
||||
font: 20px Cantarell;
|
||||
}
|
||||
|
||||
window {
|
||||
.accordion {
|
||||
background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0,
|
||||
linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px,
|
||||
linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px,
|
||||
@@ -18,7 +18,7 @@ window {
|
||||
background-size: 20px 20px;
|
||||
}
|
||||
|
||||
button {
|
||||
.accordion button {
|
||||
color: black;
|
||||
background-color: #bbb;
|
||||
border-style: solid;
|
||||
@@ -28,25 +28,25 @@ button {
|
||||
padding: 12px 4px;
|
||||
}
|
||||
|
||||
button:first-child {
|
||||
.accordion button:first-child {
|
||||
border-radius: 5px 0 0 5px;
|
||||
}
|
||||
|
||||
button:last-child {
|
||||
.accordion button:last-child {
|
||||
border-radius: 0 5px 5px 0;
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
.accordion button:hover {
|
||||
padding: 12px 48px;
|
||||
background-color: #4870bc;
|
||||
}
|
||||
|
||||
button *:hover {
|
||||
.accordion button *:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
button:hover:active,
|
||||
button:active {
|
||||
.accordion button:hover:active,
|
||||
.accordion button:active {
|
||||
background-color: #993401;
|
||||
}
|
||||
|
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
|
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
|
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
|
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
|
@@ -24,7 +24,6 @@
|
||||
</gresource>
|
||||
<gresource prefix="/css_accordion">
|
||||
<file>css_accordion.css</file>
|
||||
<file>reset.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_basics">
|
||||
<file>css_basics.css</file>
|
||||
|
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CanvasItem, canvas_item, CANVAS, ITEM, GtkWidget)
|
||||
|
||||
struct _CanvasItem {
|
||||
@@ -24,6 +25,9 @@ struct _CanvasItem {
|
||||
double delta;
|
||||
|
||||
GtkWidget *editor;
|
||||
|
||||
GtkStyleProvider *provider;
|
||||
char *css_class;
|
||||
};
|
||||
|
||||
struct _CanvasItemClass {
|
||||
@@ -34,32 +38,41 @@ G_DEFINE_TYPE (CanvasItem, canvas_item, GTK_TYPE_WIDGET)
|
||||
|
||||
static int n_items = 0;
|
||||
|
||||
static void
|
||||
unstyle_item (CanvasItem *item)
|
||||
{
|
||||
if (item->provider)
|
||||
{
|
||||
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (item->label), item->provider);
|
||||
g_clear_object (&item->provider);
|
||||
}
|
||||
|
||||
if (item->css_class)
|
||||
{
|
||||
gtk_widget_remove_css_class (item->label, item->css_class);
|
||||
g_clear_pointer (&item->css_class, g_free);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
set_color (CanvasItem *item,
|
||||
GdkRGBA *color)
|
||||
{
|
||||
char *css;
|
||||
char *str;
|
||||
GtkStyleContext *context;
|
||||
GtkCssProvider *provider;
|
||||
const char *old_class;
|
||||
const char *name;
|
||||
|
||||
unstyle_item (item);
|
||||
|
||||
str = gdk_rgba_to_string (color);
|
||||
css = g_strdup_printf ("* { background: %s; }", str);
|
||||
|
||||
context = gtk_widget_get_style_context (item->label);
|
||||
provider = g_object_get_data (G_OBJECT (context), "style-provider");
|
||||
if (provider)
|
||||
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
|
||||
|
||||
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
|
||||
if (old_class)
|
||||
gtk_widget_remove_css_class (item->label, old_class);
|
||||
name = gtk_widget_get_name (item->label);
|
||||
css = g_strdup_printf ("#%s { background: %s; }", name, str);
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, css, -1);
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (item->label), GTK_STYLE_PROVIDER (provider), 800);
|
||||
g_object_set_data_full (G_OBJECT (context), "style-provider", provider, g_object_unref);
|
||||
gtk_style_context_add_provider_for_display (gtk_widget_get_display (item->label), GTK_STYLE_PROVIDER (provider), 700);
|
||||
item->provider = GTK_STYLE_PROVIDER (provider);
|
||||
|
||||
g_free (str);
|
||||
g_free (css);
|
||||
@@ -69,21 +82,10 @@ static void
|
||||
set_css (CanvasItem *item,
|
||||
const char *class)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
GtkCssProvider *provider;
|
||||
const char *old_class;
|
||||
unstyle_item (item);
|
||||
|
||||
context = gtk_widget_get_style_context (item->label);
|
||||
provider = g_object_get_data (G_OBJECT (context), "style-provider");
|
||||
if (provider)
|
||||
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
|
||||
|
||||
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
|
||||
if (old_class)
|
||||
gtk_widget_remove_css_class (item->label, old_class);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (item->label), "css-class", g_strdup (class), g_free);
|
||||
gtk_widget_add_css_class (item->label, class);
|
||||
item->css_class = g_strdup (class);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -722,6 +724,7 @@ do_dnd (GtkWidget *do_widget)
|
||||
int i;
|
||||
int x, y;
|
||||
GtkCssProvider *provider;
|
||||
GString *css;
|
||||
|
||||
button = gtk_color_button_new ();
|
||||
g_object_unref (g_object_ref_sink (button));
|
||||
@@ -733,6 +736,18 @@ do_dnd (GtkWidget *do_widget)
|
||||
800);
|
||||
g_object_unref (provider);
|
||||
|
||||
css = g_string_new ("");
|
||||
for (i = 0; colors[i]; i++)
|
||||
g_string_append_printf (css, ".canvasitem.%s { background: %s; }\n", colors[i], colors[i]);
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, css->str, css->len);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
800);
|
||||
g_object_unref (provider);
|
||||
g_string_free (css, TRUE);
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -14,6 +14,8 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int number;
|
||||
|
@@ -8,6 +8,8 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* Creates a tree model containing the completions */
|
||||
static GtkTreeModel *
|
||||
create_completion_model (void)
|
||||
|
@@ -9,6 +9,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
enum {
|
||||
WIDTH_COLUMN,
|
||||
HEIGHT_COLUMN,
|
||||
|
@@ -21,6 +21,75 @@
|
||||
#include "script-names.h"
|
||||
#include "language-names.h"
|
||||
|
||||
/* {{{ ScriptLang object */
|
||||
|
||||
G_DECLARE_FINAL_TYPE (ScriptLang, script_lang, SCRIPT, LANG, GObject)
|
||||
|
||||
struct _ScriptLang
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
char *langname;
|
||||
unsigned int script_index;
|
||||
unsigned int lang_index;
|
||||
hb_tag_t lang_tag;
|
||||
};
|
||||
|
||||
struct _ScriptLangClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (ScriptLang, script_lang, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
script_lang_init (ScriptLang *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
script_lang_finalize (GObject *object)
|
||||
{
|
||||
ScriptLang *self = SCRIPT_LANG (object);
|
||||
|
||||
g_free (self->langname);
|
||||
|
||||
G_OBJECT_CLASS (script_lang_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
script_lang_class_init (ScriptLangClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = script_lang_finalize;
|
||||
}
|
||||
|
||||
static ScriptLang *
|
||||
script_lang_new (const char *langname,
|
||||
unsigned int script_index,
|
||||
unsigned int lang_index,
|
||||
hb_tag_t lang_tag)
|
||||
{
|
||||
ScriptLang *self;
|
||||
|
||||
self = g_object_new (script_lang_get_type (), NULL);
|
||||
|
||||
self->langname = g_strdup (langname);
|
||||
self->script_index = script_index;
|
||||
self->lang_index = lang_index;
|
||||
self->lang_tag = lang_tag;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static char *
|
||||
script_lang_get_langname (ScriptLang *self)
|
||||
{
|
||||
return g_strdup (self->langname);
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
#define MAKE_TAG(a,b,c,d) (unsigned int)(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
|
||||
|
||||
@@ -94,6 +163,10 @@ demo_free (gpointer data)
|
||||
g_clear_pointer (&demo->axes, g_hash_table_unref);
|
||||
g_clear_pointer (&demo->text, g_free);
|
||||
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (),
|
||||
GTK_STYLE_PROVIDER (demo->provider));
|
||||
g_object_unref (demo->provider);
|
||||
|
||||
g_free (demo);
|
||||
}
|
||||
|
||||
@@ -471,8 +544,6 @@ update_display (void)
|
||||
GString *s;
|
||||
char *text;
|
||||
gboolean has_feature;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
PangoFontDescription *desc;
|
||||
GList *l;
|
||||
PangoAttrList *attrs;
|
||||
@@ -575,14 +646,13 @@ update_display (void)
|
||||
|
||||
features = g_string_free (s, FALSE);
|
||||
|
||||
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (demo->script_lang), &iter))
|
||||
if (gtk_drop_down_get_selected (GTK_DROP_DOWN (demo->script_lang)) != 0)
|
||||
{
|
||||
hb_tag_t lang_tag;
|
||||
ScriptLang *selected;
|
||||
|
||||
model = gtk_combo_box_get_model (GTK_COMBO_BOX (demo->script_lang));
|
||||
gtk_tree_model_get (model, &iter, 3, &lang_tag, -1);
|
||||
selected = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (demo->script_lang));
|
||||
|
||||
lang = pango_language_from_string (hb_language_to_string (hb_ot_tag_to_language (lang_tag)));
|
||||
lang = pango_language_from_string (hb_language_to_string (hb_ot_tag_to_language (selected->lang_tag)));
|
||||
}
|
||||
else
|
||||
lang = NULL;
|
||||
@@ -739,40 +809,30 @@ tag_pair_equal (gconstpointer a, gconstpointer b)
|
||||
return pair_a->script_tag == pair_b->script_tag && pair_a->lang_tag == pair_b->lang_tag;
|
||||
}
|
||||
|
||||
static int
|
||||
script_sort_func (GtkTreeModel *model,
|
||||
GtkTreeIter *a,
|
||||
GtkTreeIter *b,
|
||||
gpointer user_data)
|
||||
|
||||
static GtkOrdering
|
||||
script_sort (const void *item1,
|
||||
const void *item2,
|
||||
void *data)
|
||||
{
|
||||
char *sa, *sb;
|
||||
int ret;
|
||||
ScriptLang *a = (ScriptLang *)item1;
|
||||
ScriptLang *b = (ScriptLang *)item2;
|
||||
|
||||
gtk_tree_model_get (model, a, 0, &sa, -1);
|
||||
gtk_tree_model_get (model, b, 0, &sb, -1);
|
||||
|
||||
ret = strcmp (sa, sb);
|
||||
|
||||
g_free (sa);
|
||||
g_free (sb);
|
||||
|
||||
return ret;
|
||||
return strcmp (a->langname, b->langname);
|
||||
}
|
||||
|
||||
static void
|
||||
update_script_combo (void)
|
||||
{
|
||||
GtkListStore *store;
|
||||
GListStore *store;
|
||||
GtkSortListModel *sortmodel;
|
||||
hb_font_t *hb_font;
|
||||
int i, j, k;
|
||||
PangoFont *pango_font;
|
||||
GHashTable *tags;
|
||||
GHashTableIter iter;
|
||||
TagPair *pair;
|
||||
char *lang;
|
||||
hb_tag_t active;
|
||||
GtkTreeIter active_iter;
|
||||
gboolean have_active = FALSE;
|
||||
|
||||
lang = gtk_font_chooser_get_language (GTK_FONT_CHOOSER (demo->font));
|
||||
|
||||
@@ -782,7 +842,7 @@ update_script_combo (void)
|
||||
|
||||
g_free (lang);
|
||||
|
||||
store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
|
||||
store = g_list_store_new (script_lang_get_type ());
|
||||
|
||||
pango_font = get_pango_font ();
|
||||
hb_font = pango_font_get_hb_font (pango_font);
|
||||
@@ -806,19 +866,19 @@ update_script_combo (void)
|
||||
|
||||
hb_face = hb_font_get_face (hb_font);
|
||||
|
||||
for (i= 0; i < 2; i++)
|
||||
for (guint i = 0; i < 2; i++)
|
||||
{
|
||||
hb_tag_t scripts[80];
|
||||
unsigned int script_count = G_N_ELEMENTS (scripts);
|
||||
|
||||
hb_ot_layout_table_get_script_tags (hb_face, tables[i], 0, &script_count, scripts);
|
||||
for (j = 0; j < script_count; j++)
|
||||
for (guint j = 0; j < script_count; j++)
|
||||
{
|
||||
hb_tag_t languages[80];
|
||||
unsigned int language_count = G_N_ELEMENTS (languages);
|
||||
|
||||
hb_ot_layout_script_get_language_tags (hb_face, tables[i], j, 0, &language_count, languages);
|
||||
for (k = 0; k < language_count; k++)
|
||||
for (guint k = 0; k < language_count; k++)
|
||||
{
|
||||
pair = g_new (TagPair, 1);
|
||||
pair->script_tag = scripts[j];
|
||||
@@ -838,7 +898,6 @@ update_script_combo (void)
|
||||
{
|
||||
const char *langname;
|
||||
char langbuf[5];
|
||||
GtkTreeIter tree_iter;
|
||||
|
||||
if (pair->lang_tag == 0 && pair->script_tag == 0)
|
||||
langname = NC_("Language", "None");
|
||||
@@ -855,31 +914,31 @@ update_script_combo (void)
|
||||
}
|
||||
}
|
||||
|
||||
gtk_list_store_insert_with_values (store, &tree_iter, -1,
|
||||
0, langname,
|
||||
1, pair->script_index,
|
||||
2, pair->lang_index,
|
||||
3, pair->lang_tag,
|
||||
-1);
|
||||
if (pair->lang_tag == active)
|
||||
{
|
||||
have_active = TRUE;
|
||||
active_iter = tree_iter;
|
||||
}
|
||||
g_list_store_append (store, script_lang_new (langname,
|
||||
pair->script_index,
|
||||
pair->lang_index,
|
||||
pair->lang_tag));
|
||||
}
|
||||
|
||||
g_hash_table_destroy (tags);
|
||||
|
||||
gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store),
|
||||
script_sort_func, NULL, NULL);
|
||||
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
|
||||
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
|
||||
GTK_SORT_ASCENDING);
|
||||
gtk_combo_box_set_model (GTK_COMBO_BOX (demo->script_lang), GTK_TREE_MODEL (store));
|
||||
if (have_active)
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (demo->script_lang), &active_iter);
|
||||
else
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (demo->script_lang), 0);
|
||||
sortmodel = gtk_sort_list_model_new (G_LIST_MODEL (store),
|
||||
GTK_SORTER (gtk_custom_sorter_new (script_sort, NULL, NULL)));
|
||||
gtk_drop_down_set_model (GTK_DROP_DOWN (demo->script_lang), G_LIST_MODEL (sortmodel));
|
||||
|
||||
for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (sortmodel)); i++)
|
||||
{
|
||||
ScriptLang *item = g_list_model_get_item (G_LIST_MODEL (sortmodel), i);
|
||||
g_object_unref (item);
|
||||
|
||||
if (item->lang_tag == active)
|
||||
{
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (demo->script_lang), i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_object_unref (sortmodel);
|
||||
}
|
||||
|
||||
static char *
|
||||
@@ -904,27 +963,19 @@ static void
|
||||
update_features (void)
|
||||
{
|
||||
int i, j;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
guint script_index, lang_index;
|
||||
hb_tag_t lang_tag;
|
||||
PangoFont *pango_font;
|
||||
hb_font_t *hb_font;
|
||||
GList *l;
|
||||
ScriptLang *selected;
|
||||
|
||||
/* set feature presence checks from the font features */
|
||||
|
||||
if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (demo->script_lang), &iter))
|
||||
if (gtk_drop_down_get_selected (GTK_DROP_DOWN (demo->script_lang)) == 0)
|
||||
return;
|
||||
|
||||
model = gtk_combo_box_get_model (GTK_COMBO_BOX (demo->script_lang));
|
||||
gtk_tree_model_get (model, &iter,
|
||||
1, &script_index,
|
||||
2, &lang_index,
|
||||
3, &lang_tag,
|
||||
-1);
|
||||
selected = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (demo->script_lang));
|
||||
|
||||
if (lang_tag == 0) /* None is selected */
|
||||
if (selected->lang_tag == 0) /* None is selected */
|
||||
{
|
||||
for (l = demo->feature_items; l; l = l->next)
|
||||
{
|
||||
@@ -965,8 +1016,8 @@ update_features (void)
|
||||
|
||||
hb_ot_layout_language_get_feature_tags (hb_face,
|
||||
tables[i],
|
||||
script_index,
|
||||
lang_index,
|
||||
selected->script_index,
|
||||
selected->lang_index,
|
||||
0,
|
||||
&count,
|
||||
features);
|
||||
@@ -988,8 +1039,8 @@ update_features (void)
|
||||
|
||||
hb_ot_layout_language_find_feature (hb_face,
|
||||
tables[i],
|
||||
script_index,
|
||||
lang_index,
|
||||
selected->script_index,
|
||||
selected->lang_index,
|
||||
features[j],
|
||||
&feature_index);
|
||||
|
||||
@@ -1321,10 +1372,9 @@ free_instance (gpointer data)
|
||||
}
|
||||
|
||||
static void
|
||||
add_instance (hb_face_t *face,
|
||||
unsigned int index,
|
||||
GtkWidget *combo,
|
||||
int pos)
|
||||
add_instance (hb_face_t *face,
|
||||
unsigned int index,
|
||||
GtkStringList *strings)
|
||||
{
|
||||
Instance *instance;
|
||||
hb_ot_name_id_t name_id;
|
||||
@@ -1340,20 +1390,20 @@ add_instance (hb_face_t *face,
|
||||
instance->index = index;
|
||||
|
||||
g_hash_table_add (demo->instances, instance);
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), instance->name);
|
||||
gtk_string_list_append (GTK_STRING_LIST (strings), instance->name);
|
||||
}
|
||||
|
||||
static void
|
||||
unset_instance (GtkAdjustment *adjustment)
|
||||
{
|
||||
if (demo->instance_combo)
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (demo->instance_combo), 0);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (demo->instance_combo), 0);
|
||||
}
|
||||
|
||||
static void
|
||||
instance_changed (GtkComboBox *combo)
|
||||
instance_changed (GtkDropDown *combo)
|
||||
{
|
||||
char *text;
|
||||
const char *text;
|
||||
Instance *instance;
|
||||
Instance ikey;
|
||||
int i;
|
||||
@@ -1365,11 +1415,12 @@ instance_changed (GtkComboBox *combo)
|
||||
hb_font_t *hb_font;
|
||||
hb_face_t *hb_face;
|
||||
|
||||
text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo));
|
||||
text = gtk_string_list_get_string (GTK_STRING_LIST (gtk_drop_down_get_model (combo)),
|
||||
gtk_drop_down_get_selected (combo));
|
||||
if (text[0] == '\0')
|
||||
goto out;
|
||||
|
||||
ikey.name = text;
|
||||
ikey.name = (char *) text;
|
||||
instance = g_hash_table_lookup (demo->instances, &ikey);
|
||||
if (!instance)
|
||||
{
|
||||
@@ -1410,7 +1461,6 @@ instance_changed (GtkComboBox *combo)
|
||||
}
|
||||
|
||||
out:
|
||||
g_free (text);
|
||||
g_clear_object (&pango_font);
|
||||
g_free (ai);
|
||||
g_free (coords);
|
||||
@@ -1520,6 +1570,7 @@ update_font_variations (void)
|
||||
{
|
||||
GtkWidget *label;
|
||||
GtkWidget *combo;
|
||||
GtkStringList *strings;
|
||||
|
||||
label = gtk_label_new ("Instance");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
@@ -1527,26 +1578,28 @@ update_font_variations (void)
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
|
||||
gtk_grid_attach (GTK_GRID (demo->variations_grid), label, 0, -1, 1, 1);
|
||||
|
||||
combo = gtk_combo_box_text_new ();
|
||||
strings = gtk_string_list_new (NULL);
|
||||
combo = gtk_drop_down_new (G_LIST_MODEL (strings), NULL);
|
||||
|
||||
gtk_widget_set_halign (combo, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (combo, GTK_ALIGN_BASELINE);
|
||||
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "");
|
||||
gtk_string_list_append (strings, "");
|
||||
|
||||
for (i = 0; i < hb_ot_var_get_named_instance_count (hb_face); i++)
|
||||
add_instance (hb_face, i, combo, i);
|
||||
add_instance (hb_face, i, strings);
|
||||
|
||||
for (i = 0; i < hb_ot_var_get_named_instance_count (hb_face); i++)
|
||||
{
|
||||
if (matches_instance (hb_face, i, n_axes, design_coords))
|
||||
{
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i + 1);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_grid_attach (GTK_GRID (demo->variations_grid), combo, 1, -1, 3, 1);
|
||||
g_signal_connect (combo, "changed", G_CALLBACK (instance_changed), NULL);
|
||||
g_signal_connect (combo, "notify::selecte", G_CALLBACK (instance_changed), NULL);
|
||||
demo->instance_combo = combo;
|
||||
}
|
||||
|
||||
@@ -1693,6 +1746,7 @@ do_font_features (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
GtkBuilderScope *scope;
|
||||
GtkEventController *controller;
|
||||
GtkExpression *expression;
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
|
||||
@@ -1726,6 +1780,9 @@ do_font_features (GtkWidget *do_widget)
|
||||
demo->description = GTK_WIDGET (gtk_builder_get_object (builder, "description"));
|
||||
demo->font = GTK_WIDGET (gtk_builder_get_object (builder, "font"));
|
||||
demo->script_lang = GTK_WIDGET (gtk_builder_get_object (builder, "script_lang"));
|
||||
expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL, 0, NULL, G_CALLBACK (script_lang_get_langname), NULL, NULL);
|
||||
gtk_drop_down_set_expression (GTK_DROP_DOWN (demo->script_lang), expression);
|
||||
gtk_expression_unref (expression);
|
||||
demo->feature_list = GTK_WIDGET (gtk_builder_get_object (builder, "feature_list"));
|
||||
demo->stack = GTK_WIDGET (gtk_builder_get_object (builder, "stack"));
|
||||
demo->entry = GTK_WIDGET (gtk_builder_get_object (builder, "entry"));
|
||||
@@ -1744,8 +1801,8 @@ do_font_features (GtkWidget *do_widget)
|
||||
demo->swin = GTK_WIDGET (gtk_builder_get_object (builder, "swin"));
|
||||
|
||||
demo->provider = gtk_css_provider_new ();
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (demo->swin),
|
||||
GTK_STYLE_PROVIDER (demo->provider), 800);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||
GTK_STYLE_PROVIDER (demo->provider), 800);
|
||||
|
||||
basic_value_changed (demo->size_adjustment, demo->size_entry);
|
||||
basic_value_changed (demo->letterspacing_adjustment, demo->letterspacing_entry);
|
||||
@@ -1823,3 +1880,5 @@ do_font_features (GtkWidget *do_widget)
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/* vim:set foldmethod=marker expandtab: */
|
||||
|
@@ -259,16 +259,10 @@
|
||||
<object class="GtkBox" id="feature_list">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="script_lang">
|
||||
<object class="GtkDropDown" id="script_lang">
|
||||
<property name="tooltip-text" translatable="yes">Language System</property>
|
||||
<property name="margin-top">10</property>
|
||||
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
<signal name="notify::selected" handler="font_features_script_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -43,7 +43,6 @@ update_image (void)
|
||||
cairo_t *cr;
|
||||
GdkPixbuf *pixbuf;
|
||||
GdkPixbuf *pixbuf2;
|
||||
const char *hint;
|
||||
cairo_font_options_t *fopt;
|
||||
cairo_hint_style_t hintstyle;
|
||||
cairo_hint_metrics_t hintmetrics;
|
||||
@@ -58,18 +57,23 @@ update_image (void)
|
||||
|
||||
fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
|
||||
|
||||
hint = gtk_combo_box_get_active_id (GTK_COMBO_BOX (hinting));
|
||||
hintstyle = CAIRO_HINT_STYLE_DEFAULT;
|
||||
if (hint)
|
||||
switch (gtk_drop_down_get_selected (GTK_DROP_DOWN (hinting)))
|
||||
{
|
||||
if (strcmp (hint, "none") == 0)
|
||||
hintstyle = CAIRO_HINT_STYLE_NONE;
|
||||
else if (strcmp (hint, "slight") == 0)
|
||||
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
|
||||
else if (strcmp (hint, "medium") == 0)
|
||||
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
|
||||
else if (strcmp (hint, "full") == 0)
|
||||
hintstyle = CAIRO_HINT_STYLE_FULL;
|
||||
case 0:
|
||||
hintstyle = CAIRO_HINT_STYLE_NONE;
|
||||
break;
|
||||
case 1:
|
||||
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
|
||||
break;
|
||||
case 2:
|
||||
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
|
||||
break;
|
||||
case 3:
|
||||
hintstyle = CAIRO_HINT_STYLE_FULL;
|
||||
break;
|
||||
default:
|
||||
hintstyle = CAIRO_HINT_STYLE_DEFAULT;
|
||||
break;
|
||||
}
|
||||
cairo_font_options_set_hint_style (fopt, hintstyle);
|
||||
|
||||
@@ -418,7 +422,7 @@ do_fontrendering (GtkWidget *do_widget)
|
||||
g_signal_connect (down_button, "clicked", G_CALLBACK (scale_down), NULL);
|
||||
g_signal_connect (entry, "notify::text", G_CALLBACK (update_image), NULL);
|
||||
g_signal_connect (font_button, "notify::font-desc", G_CALLBACK (update_image), NULL);
|
||||
g_signal_connect (hinting, "notify::active", G_CALLBACK (update_image), NULL);
|
||||
g_signal_connect (hinting, "notify::selected", G_CALLBACK (update_image), NULL);
|
||||
g_signal_connect (anti_alias, "notify::active", G_CALLBACK (update_image), NULL);
|
||||
g_signal_connect (hint_metrics, "notify::active", G_CALLBACK (update_image), NULL);
|
||||
g_signal_connect (text_radio, "notify::active", G_CALLBACK (update_image), NULL);
|
||||
|
@@ -116,15 +116,18 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="hinting">
|
||||
<property name="active">0</property>
|
||||
<object class="GtkDropDown" id="hinting">
|
||||
<property name="valign">center</property>
|
||||
<items>
|
||||
<item translatable="yes" id="none">None</item>
|
||||
<item translatable="yes" id="slight">Slight</item>
|
||||
<item translatable="yes" id="medium">Medium</item>
|
||||
<item translatable="yes" id="full">Full</item>
|
||||
</items>
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item translatable="yes">None</item>
|
||||
<item translatable="yes">Slight</item>
|
||||
<item translatable="yes">Medium</item>
|
||||
<item translatable="yes">Full</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<layout>
|
||||
|
@@ -144,7 +144,6 @@ make_shader_stack (const char *name,
|
||||
GtkTextBuffer *buffer;
|
||||
GBytes *bytes;
|
||||
GtkEventController *controller;
|
||||
GtkCssProvider *provider;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
stack = gtk_shader_stack_new ();
|
||||
@@ -235,12 +234,6 @@ make_shader_stack (const char *name,
|
||||
g_signal_connect (buffer, "changed", G_CALLBACK (text_changed), button);
|
||||
g_object_set_data (G_OBJECT (button), "the-stack", stack);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (apply_text), buffer);
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (button),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
g_object_unref (provider);
|
||||
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
||||
gtk_widget_add_css_class (button, "small");
|
||||
@@ -274,11 +267,21 @@ make_shader_stack (const char *name,
|
||||
return vbox;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_provider (gpointer data)
|
||||
{
|
||||
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
|
||||
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||
g_object_unref (provider);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_gltransition_window (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *window, *headerbar, *scale, *outer_grid, *grid, *background;
|
||||
GdkPaintable *paintable;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
@@ -333,6 +336,14 @@ create_gltransition_window (GtkWidget *do_widget)
|
||||
make_shader_stack ("Kaleidoscope", "/gltransition/kaleidoscope.glsl", 3, scale),
|
||||
1, 1, 1, 1);
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
@@ -9,6 +9,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
#define FOLDER_NAME "/iconview/gnome-fs-directory.png"
|
||||
|
@@ -8,6 +8,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
enum
|
||||
{
|
||||
COL_TEXT,
|
||||
|
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkTreeModel *model = NULL;
|
||||
static guint timeout = 0;
|
||||
|
@@ -422,6 +422,10 @@ do_listview_settings (GtkWidget *do_widget)
|
||||
gtk_column_view_column_set_sorter (name_column, sorter);
|
||||
g_object_unref (sorter);
|
||||
|
||||
sorter = GTK_SORTER (gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "type")));
|
||||
gtk_column_view_column_set_sorter (type_column, sorter);
|
||||
g_object_unref (sorter);
|
||||
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,6 @@
|
||||
#include "script-names.h"
|
||||
#include "unicode-names.h"
|
||||
|
||||
|
||||
#define UCD_TYPE_ITEM (ucd_item_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (UcdItem, ucd_item, UCD, ITEM, GObject)
|
||||
|
||||
@@ -338,6 +337,15 @@ create_ucd_view (GtkWidget *label)
|
||||
|
||||
static GtkWidget *window;
|
||||
|
||||
static void
|
||||
remove_provider (gpointer data)
|
||||
{
|
||||
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
|
||||
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||
g_object_unref (provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_listview_ucd (GtkWidget *do_widget)
|
||||
{
|
||||
@@ -360,7 +368,7 @@ do_listview_ucd (GtkWidget *do_widget)
|
||||
gtk_widget_add_css_class (label, "enormous");
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, "label.enormous { font-size: 80px; }", -1);
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (label), GTK_STYLE_PROVIDER (provider), 800);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (), GTK_STYLE_PROVIDER (provider), 800);
|
||||
gtk_widget_set_hexpand (label, TRUE);
|
||||
gtk_box_append (GTK_BOX (box), label);
|
||||
|
||||
@@ -370,6 +378,8 @@ do_listview_ucd (GtkWidget *do_widget)
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
|
||||
gtk_box_prepend (GTK_BOX (box), sw);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include "config.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
/* Create an object for the pegs that get moved around in the game.
|
||||
*
|
||||
* We implement the GdkPaintable interface for them, so we can use GtkPicture
|
||||
@@ -359,6 +360,15 @@ drop_drop (GtkDropTarget *target,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_provider (gpointer data)
|
||||
{
|
||||
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
|
||||
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||
g_object_unref (provider);
|
||||
}
|
||||
|
||||
static void
|
||||
create_board (GtkWidget *window)
|
||||
{
|
||||
@@ -375,6 +385,9 @@ create_board (GtkWidget *window)
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, css, -1);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
800);
|
||||
|
||||
grid = gtk_grid_new ();
|
||||
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
|
||||
@@ -393,9 +406,6 @@ create_board (GtkWidget *window)
|
||||
continue;
|
||||
|
||||
image = gtk_image_new ();
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (image),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
800);
|
||||
gtk_widget_add_css_class (image, "solitaire-field");
|
||||
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
|
||||
if (x != 3 || y != 3)
|
||||
@@ -439,7 +449,7 @@ create_board (GtkWidget *window)
|
||||
}
|
||||
}
|
||||
|
||||
g_object_unref (provider);
|
||||
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -123,8 +123,14 @@ do_pickers (GtkWidget *do_widget)
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_hexpand (label, TRUE);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
|
||||
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
|
||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@ enum {
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
static void
|
||||
pixbuf_paintable_snapshot (GdkPaintable *paintable,
|
||||
GdkSnapshot *snapshot,
|
||||
@@ -37,7 +36,6 @@ pixbuf_paintable_snapshot (GdkPaintable *paintable,
|
||||
|
||||
g_object_unref (texture);
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
static int
|
||||
pixbuf_paintable_get_intrinsic_width (GdkPaintable *paintable)
|
||||
|
@@ -16,24 +16,6 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Convenience function to create a combo box holding a number of strings
|
||||
*/
|
||||
GtkWidget *
|
||||
create_combo_box (const char **strings)
|
||||
{
|
||||
GtkWidget *combo_box;
|
||||
const char **str;
|
||||
|
||||
combo_box = gtk_combo_box_text_new ();
|
||||
|
||||
for (str = strings; *str; str++)
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), *str);
|
||||
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
|
||||
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
static void
|
||||
add_row (GtkGrid *table,
|
||||
int row,
|
||||
@@ -41,7 +23,7 @@ add_row (GtkGrid *table,
|
||||
const char *label_text,
|
||||
const char **options)
|
||||
{
|
||||
GtkWidget *combo_box;
|
||||
GtkWidget *dropdown;
|
||||
GtkWidget *label;
|
||||
|
||||
label = gtk_label_new_with_mnemonic (label_text);
|
||||
@@ -50,12 +32,12 @@ add_row (GtkGrid *table,
|
||||
gtk_widget_set_hexpand (label, TRUE);
|
||||
gtk_grid_attach (table, label, 0, row, 1, 1);
|
||||
|
||||
combo_box = create_combo_box (options);
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box);
|
||||
gtk_widget_set_halign (combo_box, GTK_ALIGN_END);
|
||||
gtk_widget_set_valign (combo_box, GTK_ALIGN_BASELINE);
|
||||
gtk_size_group_add_widget (size_group, combo_box);
|
||||
gtk_grid_attach (table, combo_box, 1, row, 1, 1);
|
||||
dropdown = gtk_drop_down_new_from_strings (options);
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), dropdown);
|
||||
gtk_widget_set_halign (dropdown, GTK_ALIGN_END);
|
||||
gtk_widget_set_valign (dropdown, GTK_ALIGN_BASELINE);
|
||||
gtk_size_group_add_widget (size_group, dropdown);
|
||||
gtk_grid_attach (table, dropdown, 1, row, 1, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <stdlib.h> /* for exit() */
|
||||
#include "paintable.h"
|
||||
|
||||
|
||||
static void easter_egg_callback (GtkWidget *button, gpointer data);
|
||||
|
||||
static void
|
||||
@@ -429,11 +430,11 @@ attach_widgets (GtkTextView *text_view)
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
widget = gtk_combo_box_text_new ();
|
||||
const char *options[] = {
|
||||
"Option 1", "Option 2", "Option 3", NULL
|
||||
};
|
||||
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 1");
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 2");
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 3");
|
||||
widget = gtk_drop_down_new_from_strings (options);
|
||||
}
|
||||
else if (i == 2)
|
||||
{
|
||||
|
@@ -10,6 +10,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* TreeItem structure */
|
||||
typedef struct _TreeItem TreeItem;
|
||||
struct _TreeItem
|
||||
|
@@ -664,6 +664,7 @@ on_record_button_toggled (GtkToggleButton *button,
|
||||
gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action");
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
static void
|
||||
on_page_combo_changed (GtkComboBox *combo,
|
||||
gpointer user_data)
|
||||
@@ -705,6 +706,7 @@ on_page_combo_changed (GtkComboBox *combo,
|
||||
default:;
|
||||
}
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
on_range_from_changed (GtkSpinButton *from)
|
||||
@@ -843,6 +845,7 @@ page_changed_cb (GtkWidget *stack, GParamSpec *pspec, gpointer data)
|
||||
}
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
static void
|
||||
populate_model (GtkTreeStore *store)
|
||||
{
|
||||
@@ -960,6 +963,7 @@ row_separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
|
||||
|
||||
return is_sep;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
update_title_header (GtkListBoxRow *row,
|
||||
@@ -1578,6 +1582,7 @@ osd_frame_pressed (GtkGestureClick *gesture,
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
static gboolean
|
||||
page_combo_separator_func (GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
@@ -1592,6 +1597,7 @@ page_combo_separator_func (GtkTreeModel *model,
|
||||
|
||||
return res;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
toggle_format (GSimpleAction *action,
|
||||
@@ -1844,6 +1850,7 @@ update_buttons (GtkWidget *iv, GtkIconSize size)
|
||||
gtk_widget_set_sensitive (button, size != GTK_ICON_SIZE_INHERIT);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
static void
|
||||
increase_icon_size (GtkWidget *iv)
|
||||
{
|
||||
@@ -1894,6 +1901,7 @@ reset_icon_size (GtkWidget *iv)
|
||||
|
||||
gtk_widget_queue_resize (iv);
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
static char *
|
||||
scale_format_value_blank (GtkScale *scale, double value, gpointer user_data)
|
||||
@@ -2270,10 +2278,12 @@ activate (GApplication *app)
|
||||
g_object_set_data (G_OBJECT (window), "selection_flowbox", widget2);
|
||||
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (populate_flowbox), widget2);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "charletree");
|
||||
populate_model ((GtkTreeStore *)gtk_tree_view_get_model (GTK_TREE_VIEW (widget)));
|
||||
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (widget), row_separator_func, NULL, NULL);
|
||||
gtk_tree_view_expand_all (GTK_TREE_VIEW (widget));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
widget = GTK_WIDGET (gtk_builder_get_object (builder, "munsell"));
|
||||
widget2 = GTK_WIDGET (gtk_builder_get_object (builder, "cchooser"));
|
||||
@@ -2281,6 +2291,7 @@ activate (GApplication *app)
|
||||
populate_colors (widget, widget2);
|
||||
g_signal_connect (widget2, "notify::rgba", G_CALLBACK (rgba_changed), widget);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
|
||||
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
|
||||
@@ -2291,6 +2302,7 @@ activate (GApplication *app)
|
||||
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
|
||||
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
|
||||
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
|
||||
|
||||
|
@@ -3345,10 +3345,12 @@ bad things might happen.</property>
|
||||
<attribute name="display-hint">circular-buttons</attribute>
|
||||
<item>
|
||||
<attribute name="verb-icon">printer-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">Print all the things!</attribute>
|
||||
<attribute name="action">win.print</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="verb-icon">emblem-shared-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">Share all the things!</attribute>
|
||||
<attribute name="action">app.share</attribute>
|
||||
</item>
|
||||
</section>
|
||||
@@ -3363,14 +3365,17 @@ bad things might happen.</property>
|
||||
<attribute name="label" translatable="yes">Edit</attribute>
|
||||
<item>
|
||||
<attribute name="verb-icon">edit-cut-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">Cut</attribute>
|
||||
<attribute name="action">app.cut</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="verb-icon">edit-copy-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">Copy</attribute>
|
||||
<attribute name="action">app.copy</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="verb-icon">edit-paste-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">Paste</attribute>
|
||||
<attribute name="action">app.paste</attribute>
|
||||
</item>
|
||||
</section>
|
||||
|
@@ -12,8 +12,8 @@ SYNOPSIS
|
||||
--------
|
||||
| **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE>
|
||||
|
|
||||
| **gtk4-builder-tool** validate <FILE>
|
||||
| **gtk4-builder-tool** enumerate <FILE>
|
||||
| **gtk4-builder-tool** validate [OPTIONS...] <FILE>
|
||||
| **gtk4-builder-tool** enumerate [OPTIONS...] <FILE>
|
||||
| **gtk4-builder-tool** simplify [OPTIONS...] <FILE>
|
||||
| **gtk4-builder-tool** preview [OPTIONS...] <FILE>
|
||||
| **gtk4-builder-tool** screenshot [OPTIONS...] <FILE>
|
||||
@@ -33,12 +33,20 @@ Validation
|
||||
The ``validate`` command validates the given UI definition file and reports
|
||||
errors to ``stderr``.
|
||||
|
||||
``--deprecations``
|
||||
|
||||
Warn about uses of deprecated types in the UI definition file.
|
||||
|
||||
Enumeration
|
||||
^^^^^^^^^^^
|
||||
|
||||
The ``enumerate`` command lists all the named objects that are present in the UI
|
||||
The ``enumerate`` command prints all the named objects that are present in the UI
|
||||
definition file.
|
||||
|
||||
``--callbacks``
|
||||
|
||||
Print the names of callbacks as well.
|
||||
|
||||
Preview
|
||||
^^^^^^^
|
||||
|
||||
|
74
docs/reference/gtk/migrating-4to5.md
Normal file
74
docs/reference/gtk/migrating-4to5.md
Normal file
@@ -0,0 +1,74 @@
|
||||
Title: Preparing for GTK 5
|
||||
Slug: gtk-migrating-4-to-5
|
||||
|
||||
GTK 5 will be a major new version of GTK that breaks both API and
|
||||
ABI compared to GTK 4.x. GTK 5 does not exist yet, so we cannot
|
||||
be entirely sure what will be involved in a migration from GTK 4
|
||||
to GTK 5. But we can already give some preliminary hints about
|
||||
the likely changes, and how to prepare for them in code that is
|
||||
using GTK 4.
|
||||
|
||||
### Do not use deprecated symbols
|
||||
|
||||
As always, functions and types that are known to go away in the
|
||||
next major version of GTK are being marked as deprecated in GTK 4.
|
||||
|
||||
Removing the use of deprecated APIs is the most important step
|
||||
to prepare your code for the next major version of GTK. Often,
|
||||
deprecation notes will include hints about replacement APIs to
|
||||
help you with this.
|
||||
|
||||
Sometimes, it is helpful to have some background information about
|
||||
the motivation and goals of larger API changes.
|
||||
|
||||
## Cell renderers are going away
|
||||
|
||||
Cell renderers were introduced in GTK 2 to support rendering of
|
||||
"big data" UIs, in particular treeviews. Over the years, more
|
||||
"data-like" widgets have started to use them, and cell renderers
|
||||
have grown into a shadowy, alternative rendering infrastructure
|
||||
that duplicates much of what widgets do, while duplicating the
|
||||
code and adding their own dose of bugs.
|
||||
|
||||
In GTK 4, replacement widgets for GtkTreeView, GtkIconView and
|
||||
GtkComboBox have appeared: GtkListView, GtkColumnView, GtkGridView
|
||||
and GtkDropDown. For GTK 5, we will take the next step and remove
|
||||
all cell renderer-based widgets.
|
||||
|
||||
## Themed rendering APIs are going away
|
||||
|
||||
The old GTK 2 era rendering APIs for theme components like
|
||||
gtk_render_frame() or gtk_render_check() have not been used by
|
||||
GTK itself even in later GTK 3, but they have been kepy around
|
||||
for the benefit of "external drawing" users - applications that
|
||||
want their controls to look like GTK without using widgets.
|
||||
|
||||
Supporting this is increasingly getting in the way of making
|
||||
the GTK CSS machinery fast and correct. One notable problem is
|
||||
that temporary style changes (using gtk_style_context_save())
|
||||
is breaking animations. Therefore, these APIs will be going away
|
||||
in GTK 5, together with their more modern GtkSnapshot variants
|
||||
like gtk_snapshot_render_background() or gtk_snapshot_render_focus().
|
||||
|
||||
The best way to render parts of your widget using CSS styling
|
||||
is to use subwidgets. For example, to show a piece of text with
|
||||
fonts, effects and shadows according to the current CSS style,
|
||||
use a GtkLabel.
|
||||
|
||||
If you have a need for custom drawing that fits into the current
|
||||
(dark or light) theme, e.g. for rendering a graph, you can still
|
||||
get the current style foreground color, using
|
||||
[method@Gtk.Widget.get_style_color].
|
||||
|
||||
## Local stylesheets are going away
|
||||
|
||||
The cascading part of GTK's CSS implementation is complicated by
|
||||
the existence of local stylesheets (i.e. those added with
|
||||
gtk_style_context_add_provider()). And local stylesheets are
|
||||
unintuitive in that they do not apply to the whole subtree of
|
||||
widgets, but just to the one widget where the stylesheet was
|
||||
added.
|
||||
|
||||
GTK 5 will no longer provide this functionality. The recommendations
|
||||
is to use a global stylesheet (i.e. gtk_style_context_add_provider_for_display())
|
||||
and rely on style classes to make your CSS apply only where desired.
|
@@ -92,8 +92,7 @@ Specifies a list of directories to search when GTK is looking for
|
||||
dynamically loaded objects such as input method modules and print
|
||||
backends. If the path to the dynamically loaded object is given as
|
||||
an absolute path name, then GTK loads it directly. Otherwise, GTK
|
||||
goes in turn through the directories in `GTK_PATH`, followed by
|
||||
the directory `.gtk-4.0` in the user's home directory, followed
|
||||
goes in turn through the directories in `GTK_PATH`, followed
|
||||
by the system default directory, which is `libdir/gtk-4.0/modules`.
|
||||
(If `GTK_EXE_PREFIX` is defined, `libdir` is `$GTK_EXE_PREFIX/lib`.
|
||||
Otherwise it is the libdir specified when GTK was configured, usually
|
||||
|
@@ -1,6 +1,13 @@
|
||||
Title: Tree and List Widget Overview
|
||||
Slug: gtk-treeview
|
||||
|
||||
This document describes the `GtkTreeView` widget and auxiliary
|
||||
classes, like tree models and cell renderers. All of these have
|
||||
been deprecated and will be removed in GTK 5. Their replacements
|
||||
are described in the [List Widget Overview](section-list-widget.html).
|
||||
|
||||
## Introduction
|
||||
|
||||
To create a tree or list in GTK, use the `GtkTreeModel` interface in
|
||||
conjunction with the `GtkTreeView` widget. This widget is designed around
|
||||
a _Model/View/Controller_ design and consists of four major parts:
|
||||
|
@@ -350,7 +350,8 @@ quit_activated (GSimpleAction *action,
|
||||
}
|
||||
|
||||
static void
|
||||
combo_changed (GtkComboBox *combo,
|
||||
combo_changed (GtkDropDown *combo,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkDialog *dialog = user_data;
|
||||
@@ -359,7 +360,7 @@ combo_changed (GtkComboBox *combo,
|
||||
char **accels;
|
||||
char *str;
|
||||
|
||||
action = gtk_combo_box_get_active_id (combo);
|
||||
action = gtk_string_object_get_string (GTK_STRING_OBJECT (gtk_drop_down_get_selected_item (combo)));
|
||||
|
||||
if (!action)
|
||||
return;
|
||||
@@ -388,7 +389,7 @@ response (GtkDialog *dialog,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkEntry *entry = g_object_get_data (user_data, "entry");
|
||||
GtkComboBox *combo = g_object_get_data (user_data, "combo");
|
||||
GtkDropDown *combo = g_object_get_data (user_data, "combo");
|
||||
const char *action;
|
||||
const char *str;
|
||||
char **accels;
|
||||
@@ -399,7 +400,7 @@ response (GtkDialog *dialog,
|
||||
return;
|
||||
}
|
||||
|
||||
action = gtk_combo_box_get_active_id (combo);
|
||||
action = gtk_string_object_get_string (GTK_STRING_OBJECT (gtk_drop_down_get_selected_item (combo)));
|
||||
|
||||
if (!action)
|
||||
return;
|
||||
@@ -424,6 +425,7 @@ edit_accels (GSimpleAction *action,
|
||||
char **actions;
|
||||
GtkWidget *dialog;
|
||||
int i;
|
||||
GtkStringList *strings;
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons ("Accelerators",
|
||||
NULL,
|
||||
@@ -435,7 +437,8 @@ edit_accels (GSimpleAction *action,
|
||||
gtk_window_set_application (GTK_WINDOW (dialog), app);
|
||||
actions = gtk_application_list_action_descriptions (app);
|
||||
|
||||
combo = gtk_combo_box_text_new ();
|
||||
strings = gtk_string_list_new (NULL);
|
||||
combo = gtk_drop_down_new (G_LIST_MODEL (strings), NULL);
|
||||
g_object_set (gtk_dialog_get_content_area (GTK_DIALOG (dialog)),
|
||||
"margin-top", 10,
|
||||
"margin-bottom", 10,
|
||||
@@ -446,8 +449,8 @@ edit_accels (GSimpleAction *action,
|
||||
|
||||
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), combo);
|
||||
for (i = 0; actions[i]; i++)
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), actions[i], actions[i]);
|
||||
g_signal_connect (combo, "changed", G_CALLBACK (combo_changed), dialog);
|
||||
gtk_string_list_append (strings, actions[i]);
|
||||
g_signal_connect (combo, "notify::selected", G_CALLBACK (combo_changed), dialog);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
gtk_widget_set_hexpand (entry, TRUE);
|
||||
@@ -458,7 +461,7 @@ edit_accels (GSimpleAction *action,
|
||||
g_object_set_data (G_OBJECT (dialog), "combo", combo);
|
||||
g_object_set_data (G_OBJECT (dialog), "entry", entry);
|
||||
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), 0);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
@@ -262,7 +262,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
message->key.state,
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
|
@@ -16,6 +16,8 @@ G_BEGIN_DECLS
|
||||
#mesondefine GDK_WINDOWING_WAYLAND
|
||||
#mesondefine GDK_WINDOWING_WIN32
|
||||
|
||||
#mesondefine GDK_RENDERING_CAIRO
|
||||
#mesondefine GDK_RENDERING_GL
|
||||
#mesondefine GDK_RENDERING_VULKAN
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -879,7 +879,7 @@ file_text_serializer (GdkContentSerializer *serializer)
|
||||
g_string_append (str, path);
|
||||
g_free (path);
|
||||
if (l->next)
|
||||
g_string_append (str, " ");
|
||||
g_string_append (str, "\n");
|
||||
}
|
||||
path = g_string_free (str, FALSE);
|
||||
}
|
||||
|
@@ -1517,6 +1517,16 @@ gdk_button_event_get_button (GdkEvent *event)
|
||||
* An event related to a key-based device.
|
||||
*/
|
||||
|
||||
static void
|
||||
gdk_key_event_finalize (GdkEvent *event)
|
||||
{
|
||||
GdkKeyEvent *self = (GdkKeyEvent *) event;
|
||||
|
||||
g_free (self->compose_sequence);
|
||||
|
||||
GDK_EVENT_SUPER (event)->finalize (event);
|
||||
}
|
||||
|
||||
static GdkModifierType
|
||||
gdk_key_event_get_state (GdkEvent *event)
|
||||
{
|
||||
@@ -1528,7 +1538,7 @@ gdk_key_event_get_state (GdkEvent *event)
|
||||
static const GdkEventTypeInfo gdk_key_event_info = {
|
||||
sizeof (GdkKeyEvent),
|
||||
NULL,
|
||||
NULL,
|
||||
gdk_key_event_finalize,
|
||||
gdk_key_event_get_state,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -1552,6 +1562,10 @@ GDK_DEFINE_EVENT_TYPE (GdkKeyEvent, gdk_key_event,
|
||||
* @is_modifier: whether the event is a modifiers only event
|
||||
* @translated: the translated key data for the given @state
|
||||
* @no_lock: the translated key data without the given @state
|
||||
* @compose_sequence: (transfer none) (nullable):
|
||||
* The compose sequence string, either partial or only the
|
||||
* final composed string, if that can be determined at event
|
||||
* creation time. Used by selected IM modules.
|
||||
*
|
||||
* Creates a new `GdkKeyEvent`.
|
||||
*
|
||||
@@ -1566,7 +1580,8 @@ gdk_key_event_new (GdkEventType type,
|
||||
GdkModifierType state,
|
||||
gboolean is_modifier,
|
||||
GdkTranslatedKey *translated,
|
||||
GdkTranslatedKey *no_lock)
|
||||
GdkTranslatedKey *no_lock,
|
||||
char *compose_sequence)
|
||||
{
|
||||
g_return_val_if_fail (type == GDK_KEY_PRESS ||
|
||||
type == GDK_KEY_RELEASE, NULL);
|
||||
@@ -1579,6 +1594,7 @@ gdk_key_event_new (GdkEventType type,
|
||||
self->key_is_modifier = is_modifier;
|
||||
self->translated[0] = *translated;
|
||||
self->translated[1] = *no_lock;
|
||||
self->compose_sequence = g_strdup (compose_sequence);
|
||||
|
||||
return event;
|
||||
}
|
||||
@@ -1609,6 +1625,26 @@ gdk_key_event_get_translated_key (GdkEvent *event,
|
||||
return &(self->translated[0]);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_key_event_get_compose_sequence:
|
||||
* @event: (type GdkKeyEvent): a key event
|
||||
*
|
||||
* Extracts the compose sequence string from a key event.
|
||||
*
|
||||
* Returns: (transfer none): the compose sequence string
|
||||
*/
|
||||
char *
|
||||
gdk_key_event_get_compose_sequence (GdkEvent *event)
|
||||
{
|
||||
GdkKeyEvent *self = (GdkKeyEvent *) event;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_EVENT (event), 0);
|
||||
g_return_val_if_fail (GDK_IS_EVENT_TYPE (event, GDK_KEY_PRESS) ||
|
||||
GDK_IS_EVENT_TYPE (event, GDK_KEY_RELEASE), FALSE);
|
||||
|
||||
return self->compose_sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_key_event_get_keyval:
|
||||
* @event: (type GdkKeyEvent): a key event
|
||||
|
@@ -259,6 +259,9 @@ typedef struct {
|
||||
* @keycode: the raw code of the key that was pressed or released.
|
||||
* @translated: the result of translating @keycode. First with the full
|
||||
* @state, then while ignoring Caps Lock.
|
||||
* @compose_sequence: optional string for use by selected IM modules.
|
||||
* Contains either partial compose sequences or the final composed
|
||||
* string of the keystroke sequence.
|
||||
*
|
||||
* Describes a key press or key release event.
|
||||
*/
|
||||
@@ -270,6 +273,7 @@ struct _GdkKeyEvent
|
||||
guint32 keycode;
|
||||
gboolean key_is_modifier;
|
||||
GdkTranslatedKey translated[2];
|
||||
char *compose_sequence;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -470,7 +474,8 @@ GdkEvent * gdk_key_event_new (GdkEventType type,
|
||||
GdkModifierType modifiers,
|
||||
gboolean is_modifier,
|
||||
GdkTranslatedKey *translated,
|
||||
GdkTranslatedKey *no_lock);
|
||||
GdkTranslatedKey *no_lock,
|
||||
char *compose_sequence);
|
||||
|
||||
GdkEvent * gdk_focus_event_new (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
@@ -597,6 +602,8 @@ GdkEvent * gdk_grab_broken_event_new (GdkSurface *surface,
|
||||
GdkTranslatedKey * gdk_key_event_get_translated_key (GdkEvent *event,
|
||||
gboolean no_lock);
|
||||
|
||||
char * gdk_key_event_get_compose_sequence (GdkEvent *event);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* Following flag is set for events on the event queue during
|
||||
@@ -626,7 +633,6 @@ void _gdk_event_queue_flush (GdkDisplay *display);
|
||||
|
||||
double * gdk_event_dup_axes (GdkEvent *event);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_EVENTS_PRIVATE_H__ */
|
||||
|
@@ -32,6 +32,9 @@ G_DEFINE_POINTER_TYPE (GdkToplevelSize, gdk_toplevel_size)
|
||||
#define UNCONFIGURED_WIDTH 400
|
||||
#define UNCONFIGURED_HEIGHT 300
|
||||
|
||||
#define DEFAULT_BOUNDS_WIDTH INT_MAX
|
||||
#define DEFAULT_BOUNDS_HEIGHT INT_MAX
|
||||
|
||||
void
|
||||
gdk_toplevel_size_init (GdkToplevelSize *size,
|
||||
int bounds_width,
|
||||
@@ -68,8 +71,15 @@ gdk_toplevel_size_get_bounds (GdkToplevelSize *size,
|
||||
g_return_if_fail (bounds_width);
|
||||
g_return_if_fail (bounds_height);
|
||||
|
||||
*bounds_width = size->bounds_width;
|
||||
*bounds_height = size->bounds_height;
|
||||
if (size->bounds_width > 0)
|
||||
*bounds_width = size->bounds_width;
|
||||
else
|
||||
*bounds_width = DEFAULT_BOUNDS_WIDTH;
|
||||
|
||||
if (size->bounds_height > 0)
|
||||
*bounds_height = size->bounds_height;
|
||||
else
|
||||
*bounds_height = DEFAULT_BOUNDS_HEIGHT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -118,6 +118,16 @@
|
||||
*/
|
||||
#define GDK_VERSION_4_8 (G_ENCODE_VERSION (4, 8))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_4_10:
|
||||
*
|
||||
* A macro that evaluates to the 4.10 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 4.10
|
||||
*/
|
||||
#define GDK_VERSION_4_10 (G_ENCODE_VERSION (4, 10))
|
||||
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target, with a hard backstop to the
|
||||
@@ -273,4 +283,18 @@
|
||||
# define GDK_DEPRECATED_IN_4_8_FOR(f) _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_10
|
||||
# define GDK_AVAILABLE_IN_4_10 GDK_UNAVAILABLE(4, 10)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_4_10 _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_10
|
||||
# define GDK_DEPRECATED_IN_4_10 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_4_10_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_4_10 _GDK_EXTERN
|
||||
# define GDK_DEPRECATED_IN_4_10_FOR(f) _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
@@ -440,7 +440,7 @@ on_data_ready_cb (GObject *object,
|
||||
|
||||
g_output_stream_close (G_OUTPUT_STREAM (wr->stream), NULL, NULL);
|
||||
|
||||
size = g_memory_output_stream_get_size (wr->stream);
|
||||
size = g_memory_output_stream_get_data_size (wr->stream);
|
||||
bytes = g_memory_output_stream_steal_data (wr->stream);
|
||||
data = [[NSData alloc] initWithBytesNoCopy:bytes
|
||||
length:size
|
||||
|
@@ -431,7 +431,8 @@ fill_key_event (GdkMacosDisplay *display,
|
||||
state,
|
||||
is_modifier,
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static GdkEvent *
|
||||
|
@@ -944,7 +944,8 @@ _gdk_macos_surface_synthesize_null_key (GdkMacosSurface *self)
|
||||
0,
|
||||
FALSE,
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
_gdk_event_queue_append (display, event);
|
||||
}
|
||||
|
||||
|
@@ -161,6 +161,8 @@ gdkconfig_cdata.set('GDK_WINDOWING_WAYLAND', wayland_enabled)
|
||||
gdkconfig_cdata.set('GDK_WINDOWING_WIN32', win32_enabled)
|
||||
gdkconfig_cdata.set('GDK_WINDOWING_BROADWAY', broadway_enabled)
|
||||
gdkconfig_cdata.set('GDK_WINDOWING_MACOS', macos_enabled)
|
||||
gdkconfig_cdata.set('GDK_RENDERING_CAIRO', true)
|
||||
gdkconfig_cdata.set('GDK_RENDERING_GL', true)
|
||||
gdkconfig_cdata.set('GDK_RENDERING_VULKAN', have_vulkan)
|
||||
|
||||
gdkconfig = configure_file(
|
||||
|
@@ -2205,7 +2205,8 @@ deliver_key_event (GdkWaylandSeat *seat,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
_gdk_wayland_keymap_key_is_modifier (keymap, key),
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
|
||||
@@ -5322,7 +5323,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
|
||||
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
|
||||
|
||||
seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (gdk_device));
|
||||
serial = _gdk_wayland_seat_get_implicit_grab_serial (GDK_SEAT (seat), NULL);
|
||||
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL);
|
||||
wl_data_device_set_selection (seat->data_device, source, serial);
|
||||
}
|
||||
|
||||
|
@@ -203,7 +203,7 @@ gdk_wayland_keymap_get_entries_for_keycode (GdkKeymap *keymap,
|
||||
{
|
||||
const xkb_keysym_t *syms;
|
||||
int num_syms;
|
||||
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, hardware_keycode, layout, 0, &syms);
|
||||
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, hardware_keycode, layout, level, &syms);
|
||||
if (keys)
|
||||
{
|
||||
(*keys)[i].keycode = hardware_keycode;
|
||||
@@ -254,7 +254,7 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
|
||||
if (state & GDK_ALT_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
|
||||
if (state & GDK_SUPER_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Super");
|
||||
mods |= (1 << xkb_keymap_mod_get_index (xkb_keymap, "Super") | 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_LOGO));
|
||||
if (state & GDK_HYPER_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Hyper");
|
||||
if (state & GDK_META_MASK)
|
||||
@@ -277,6 +277,8 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
|
||||
state |= GDK_CONTROL_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
|
||||
state |= GDK_ALT_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_LOGO)))
|
||||
state |= GDK_SUPER_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Super")))
|
||||
state |= GDK_SUPER_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Hyper")))
|
||||
|
@@ -292,7 +292,8 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
|
||||
}
|
||||
|
||||
seat = gdk_display_get_default_seat (GDK_DISPLAY (wdisplay));
|
||||
serial = _gdk_wayland_seat_get_implicit_grab_serial (seat, NULL);
|
||||
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (GDK_WAYLAND_SEAT (seat),
|
||||
NULL);
|
||||
zwp_primary_selection_device_v1_set_selection (cb->primary_data_device,
|
||||
cb->source,
|
||||
serial);
|
||||
|
@@ -1419,10 +1419,18 @@ configure_toplevel_geometry (GdkSurface *surface)
|
||||
GdkRectangle monitor_geometry;
|
||||
|
||||
monitor = g_list_model_get_item (gdk_display_get_monitors (display), 0);
|
||||
gdk_monitor_get_geometry (monitor, &monitor_geometry);
|
||||
bounds_width = monitor_geometry.width;
|
||||
bounds_height = monitor_geometry.height;
|
||||
g_object_unref (monitor);
|
||||
if (monitor)
|
||||
{
|
||||
gdk_monitor_get_geometry (monitor, &monitor_geometry);
|
||||
bounds_width = monitor_geometry.width;
|
||||
bounds_height = monitor_geometry.height;
|
||||
g_object_unref (monitor);
|
||||
}
|
||||
else
|
||||
{
|
||||
bounds_width = 0;
|
||||
bounds_height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
|
||||
|
@@ -17,34 +17,29 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#define GDK_PIXBUF_ENABLE_BACKEND /* Ugly? */
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkcursor.h"
|
||||
#include "gdkwin32.h"
|
||||
#include "gdktextureprivate.h"
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#include "gdkdisplay-win32.h"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#include <w32api.h>
|
||||
#endif
|
||||
|
||||
#include "xcursors.h"
|
||||
|
||||
typedef struct _DefaultCursor {
|
||||
#include <stdint.h>
|
||||
|
||||
static struct {
|
||||
char *name;
|
||||
char *id;
|
||||
} DefaultCursor;
|
||||
|
||||
static DefaultCursor default_cursors[] = {
|
||||
} default_cursors[] = {
|
||||
/* -- Win32 cursor names: -- */
|
||||
{ "appstarting", IDC_APPSTARTING },
|
||||
{ "arrow", IDC_ARROW },
|
||||
{ "cross", IDC_CROSS },
|
||||
{ "hand", IDC_HAND },
|
||||
{ "help", IDC_HELP },
|
||||
{ "ibeam", IDC_IBEAM },
|
||||
/* an X cursor name, for compatibility with GTK: */
|
||||
/* -- X11 cursor names: -- */
|
||||
{ "left_ptr_watch", IDC_APPSTARTING },
|
||||
{ "sizeall", IDC_SIZEALL },
|
||||
{ "sizenesw", IDC_SIZENESW },
|
||||
@@ -53,7 +48,7 @@ static DefaultCursor default_cursors[] = {
|
||||
{ "sizewe", IDC_SIZEWE },
|
||||
{ "uparrow", IDC_UPARROW },
|
||||
{ "wait", IDC_WAIT },
|
||||
/* css cursor names: */
|
||||
/* -- CSS cursor names: -- */
|
||||
{ "default", IDC_ARROW },
|
||||
{ "pointer", IDC_HAND },
|
||||
{ "progress", IDC_APPSTARTING },
|
||||
@@ -93,18 +88,17 @@ struct _GdkWin32HCursor
|
||||
|
||||
/* Do not do any modifications to the handle
|
||||
* (i.e. do not call DestroyCursor() on it).
|
||||
* It's a "read-only" copy, the original is stored
|
||||
* in the display instance.
|
||||
*/
|
||||
* It's a "read-only" copy, the original is
|
||||
* stored in the display instance */
|
||||
HANDLE readonly_handle;
|
||||
|
||||
/* This is a way to access the real handle stored
|
||||
* in the display.
|
||||
* TODO: make it a weak reference
|
||||
*/
|
||||
/* This is a way to access the real handle
|
||||
* stored in the display.
|
||||
* TODO: make it a weak reference */
|
||||
GdkWin32Display *display;
|
||||
|
||||
/* A copy of the "destoyable" attribute of the handle */
|
||||
/* A copy of the "destoyable" attribute of
|
||||
* the handle */
|
||||
gboolean readonly_destroyable;
|
||||
};
|
||||
|
||||
@@ -382,7 +376,8 @@ hcursor_from_x_cursor (int i,
|
||||
int j, x, y, ofs;
|
||||
HCURSOR rv;
|
||||
int w, h;
|
||||
guchar *and_plane, *xor_plane;
|
||||
uint8_t *and_plane;
|
||||
uint8_t *xor_plane;
|
||||
|
||||
w = GetSystemMetrics (SM_CXCURSOR);
|
||||
h = GetSystemMetrics (SM_CYCURSOR);
|
||||
@@ -406,7 +401,7 @@ hcursor_from_x_cursor (int i,
|
||||
for (x = 0; x < cursors[i].width && x < w ; x++, j++)
|
||||
{
|
||||
int pofs = ofs + x / 8;
|
||||
guchar data = (cursors[i].data[j/4] & (0xc0 >> (2 * (j%4)))) >> (2 * (3 - (j%4)));
|
||||
uint8_t data = (cursors[i].data[j/4] & (0xc0 >> (2 * (j%4)))) >> (2 * (3 - (j%4)));
|
||||
int bit = 7 - (j % cursors[i].width) % 8;
|
||||
|
||||
if (data)
|
||||
@@ -852,7 +847,7 @@ static GdkWin32HCursor *
|
||||
create_blank_win32hcursor (GdkWin32Display *display)
|
||||
{
|
||||
int w, h;
|
||||
guchar *and_plane, *xor_plane;
|
||||
uint8_t *and_plane, *xor_plane;
|
||||
HCURSOR rv;
|
||||
|
||||
w = GetSystemMetrics (SM_CXCURSOR);
|
||||
@@ -1009,7 +1004,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
RGBQUAD colors[2];
|
||||
} bmi;
|
||||
HDC hdc;
|
||||
guchar *pixels, *bits;
|
||||
uint8_t *pixels, *bits;
|
||||
int rowstride, x, y, w, h;
|
||||
|
||||
if (!GDI_CALL (GetIconInfo, (hicon, &ii)))
|
||||
@@ -1117,7 +1112,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
const guchar *andp, *xorp;
|
||||
const uint8_t *andp, *xorp;
|
||||
if (bmi.bi.biHeight < 0)
|
||||
{
|
||||
andp = bits + bpl*y;
|
||||
@@ -1178,8 +1173,8 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
*/
|
||||
|
||||
static HBITMAP
|
||||
create_alpha_bitmap (int size,
|
||||
guchar **outdata)
|
||||
create_alpha_bitmap (int size,
|
||||
uint8_t **outdata)
|
||||
{
|
||||
BITMAPV5HEADER bi;
|
||||
HDC hdc;
|
||||
@@ -1216,9 +1211,9 @@ create_alpha_bitmap (int size,
|
||||
}
|
||||
|
||||
static HBITMAP
|
||||
create_color_bitmap (int size,
|
||||
guchar **outdata,
|
||||
int bits)
|
||||
create_color_bitmap (int size,
|
||||
uint8_t **outdata,
|
||||
int bits)
|
||||
{
|
||||
struct {
|
||||
BITMAPV4HEADER bmiHeader;
|
||||
@@ -1265,8 +1260,9 @@ pixbuf_to_hbitmaps_alpha_winxp (GdkPixbuf *pixbuf,
|
||||
* http://www.dotnet247.com/247reference/msgs/13/66301.aspx
|
||||
*/
|
||||
HBITMAP hColorBitmap, hMaskBitmap;
|
||||
guchar *indata, *inrow;
|
||||
guchar *colordata, *colorrow, *maskdata, *maskbyte;
|
||||
const uint8_t *indata;
|
||||
const uint8_t *inrow;
|
||||
uint8_t *colordata, *colorrow, *maskdata, *maskbyte;
|
||||
int width, height, size, i, i_offset, j, j_offset, rowstride;
|
||||
guint maskstride, mask_bit;
|
||||
|
||||
@@ -1289,7 +1285,7 @@ pixbuf_to_hbitmaps_alpha_winxp (GdkPixbuf *pixbuf,
|
||||
/* MSDN says mask rows are aligned to "LONG" boundaries */
|
||||
maskstride = (((size + 31) & ~31) >> 3);
|
||||
|
||||
indata = gdk_pixbuf_get_pixels (pixbuf);
|
||||
indata = gdk_pixbuf_read_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
|
||||
if (width > height)
|
||||
@@ -1343,8 +1339,9 @@ pixbuf_to_hbitmaps_normal (GdkPixbuf *pixbuf,
|
||||
* http://www.dotnet247.com/247reference/msgs/13/66301.aspx
|
||||
*/
|
||||
HBITMAP hColorBitmap, hMaskBitmap;
|
||||
guchar *indata, *inrow;
|
||||
guchar *colordata, *colorrow, *maskdata, *maskbyte;
|
||||
const uint8_t *indata;
|
||||
const uint8_t *inrow;
|
||||
uint8_t *colordata, *colorrow, *maskdata, *maskbyte;
|
||||
int width, height, size, i, i_offset, j, j_offset, rowstride, nc, bmstride;
|
||||
gboolean has_alpha;
|
||||
guint maskstride, mask_bit;
|
||||
@@ -1373,7 +1370,7 @@ pixbuf_to_hbitmaps_normal (GdkPixbuf *pixbuf,
|
||||
/* MSDN says mask rows are aligned to "LONG" boundaries */
|
||||
maskstride = (((size + 31) & ~31) >> 3);
|
||||
|
||||
indata = gdk_pixbuf_get_pixels (pixbuf);
|
||||
indata = gdk_pixbuf_read_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
nc = gdk_pixbuf_get_n_channels (pixbuf);
|
||||
has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
|
||||
|
@@ -1857,7 +1857,8 @@ gdk_event_translate (MSG *msg,
|
||||
0,
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
break;
|
||||
@@ -1906,8 +1907,12 @@ gdk_event_translate (MSG *msg,
|
||||
GdkTranslatedKey translated;
|
||||
GdkTranslatedKey no_lock;
|
||||
BYTE key_state[256];
|
||||
wchar_t wbuf[100];
|
||||
int ccount = 0;
|
||||
GArray *translation;
|
||||
MSG msg2;
|
||||
int level = 0;
|
||||
int effective_group = 0;
|
||||
GdkModifierType consumed = 0;
|
||||
char *composed = NULL;
|
||||
|
||||
/* Ignore key messages intended for the IME */
|
||||
if (msg->wParam == VK_PROCESSKEY || in_ime_composition)
|
||||
@@ -1929,34 +1934,41 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
API_CALL (GetKeyboardState, (key_state));
|
||||
|
||||
ccount = 0;
|
||||
|
||||
if (msg->wParam == VK_PACKET)
|
||||
{
|
||||
ccount = ToUnicode (VK_PACKET, HIWORD (msg->lParam), key_state, wbuf, 1, 0);
|
||||
if (ccount == 1)
|
||||
{
|
||||
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
|
||||
{
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
impl->leading_surrogate_keydown = wbuf[0];
|
||||
else
|
||||
impl->leading_surrogate_keyup = wbuf[0];
|
||||
|
||||
/* don't emit an event */
|
||||
return_val = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* wait until an event is created */;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keyval = GDK_KEY_VoidSymbol;
|
||||
keycode = msg->wParam;
|
||||
|
||||
/* Get the WinAPI translation of the WM_KEY messages to characters.
|
||||
|
||||
The WM_CHAR messages are generated by a previous call to TranslateMessage() and always
|
||||
follow directly after the corresponding WM_KEY* messages.
|
||||
There could be 0 or more WM_CHAR messages following (for example dead keys don't generate
|
||||
WM_CHAR messages - they generate WM_DEAD_CHAR instead, but we are not interested in those
|
||||
messages). */
|
||||
|
||||
translation = g_array_sized_new (FALSE, FALSE, sizeof (gunichar2), 2);
|
||||
while (PeekMessageW (&msg2, msg->hwnd, 0, 0, 0) && (msg2.message == WM_CHAR || msg2.message == WM_SYSCHAR))
|
||||
{
|
||||
/* The character is encoded in WPARAM as UTF-16. */
|
||||
gunichar2 c = msg2.wParam;
|
||||
|
||||
/* Append character to translation string. */
|
||||
g_array_append_val (translation, c);
|
||||
|
||||
/* Remove message from queue */
|
||||
GetMessageW (&msg2, msg->hwnd, 0, 0);
|
||||
}
|
||||
|
||||
if (translation->len > 0)
|
||||
composed = g_utf16_to_utf8 ((gunichar2*)translation->data,
|
||||
translation->len, NULL, NULL, NULL);
|
||||
|
||||
g_array_unref (translation);
|
||||
translation = NULL;
|
||||
|
||||
/* Ignore control sequences like Backspace */
|
||||
if (composed && g_unichar_iscntrl (g_utf8_get_char (composed)))
|
||||
g_clear_pointer (&composed, g_free);
|
||||
|
||||
if (HIWORD (msg->lParam) & KF_EXTENDED)
|
||||
{
|
||||
switch (msg->wParam)
|
||||
@@ -1985,61 +1997,20 @@ gdk_event_translate (MSG *msg,
|
||||
state = build_key_event_state (key_state);
|
||||
group = get_active_group ();
|
||||
|
||||
if (msg->wParam == VK_PACKET && ccount == 1)
|
||||
{
|
||||
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
else if (wbuf[0] >= 0xDC00 && wbuf[0] < 0xE000)
|
||||
{
|
||||
wchar_t leading;
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode, state, group,
|
||||
&keyval, &effective_group, &level, &consumed);
|
||||
translated.keyval = keyval;
|
||||
translated.consumed = consumed;
|
||||
translated.layout = effective_group;
|
||||
translated.level = level;
|
||||
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
leading = impl->leading_surrogate_keydown;
|
||||
else
|
||||
leading = impl->leading_surrogate_keyup;
|
||||
|
||||
keyval = gdk_unicode_to_keyval ((leading - 0xD800) * 0x400 + wbuf[0] - 0xDC00 + 0x10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
keyval = gdk_unicode_to_keyval (wbuf[0]);
|
||||
}
|
||||
|
||||
translated.keyval = keyval;
|
||||
translated.consumed = 0;
|
||||
translated.layout = 0;
|
||||
translated.level = 0;
|
||||
|
||||
no_lock = translated;
|
||||
}
|
||||
else
|
||||
{
|
||||
int level = 0;
|
||||
int effective_group = 0;
|
||||
GdkModifierType consumed = 0;
|
||||
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode, state, group,
|
||||
&keyval, &effective_group, &level, &consumed);
|
||||
translated.keyval = keyval;
|
||||
translated.consumed = consumed;
|
||||
translated.layout = effective_group;
|
||||
translated.level = level;
|
||||
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode,
|
||||
state & ~GDK_LOCK_MASK, group, &keyval,
|
||||
&effective_group, &level, &consumed);
|
||||
no_lock.keyval = keyval;
|
||||
no_lock.consumed = consumed;
|
||||
no_lock.layout = effective_group;
|
||||
no_lock.level = level;
|
||||
}
|
||||
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
impl->leading_surrogate_keydown = 0;
|
||||
else
|
||||
impl->leading_surrogate_keyup = 0;
|
||||
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode,
|
||||
state & ~GDK_LOCK_MASK, group, &keyval,
|
||||
&effective_group, &level, &consumed);
|
||||
no_lock.keyval = keyval;
|
||||
no_lock.consumed = consumed;
|
||||
no_lock.layout = effective_group;
|
||||
no_lock.level = level;
|
||||
|
||||
/* Only one release key event is fired when both shift keys are pressed together
|
||||
and then released. In order to send the missing event, press events for shift
|
||||
@@ -2087,10 +2058,12 @@ gdk_event_translate (MSG *msg,
|
||||
state,
|
||||
is_modifier,
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
composed);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
g_free (composed);
|
||||
return_val = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -2169,7 +2142,8 @@ gdk_event_translate (MSG *msg,
|
||||
build_key_event_state (key_state),
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
@@ -2182,7 +2156,8 @@ gdk_event_translate (MSG *msg,
|
||||
build_key_event_state (key_state),
|
||||
FALSE,
|
||||
&translated,
|
||||
&translated);
|
||||
&translated,
|
||||
NULL);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
@@ -2229,6 +2204,7 @@ gdk_event_translate (MSG *msg,
|
||||
generate_button_event (GDK_BUTTON_PRESS, button,
|
||||
window, msg);
|
||||
|
||||
*ret_valp = (msg->message == WM_XBUTTONDOWN ? TRUE : 0);
|
||||
return_val = TRUE;
|
||||
break;
|
||||
|
||||
@@ -2312,6 +2288,7 @@ gdk_event_translate (MSG *msg,
|
||||
mouse_window_ignored_leave = NULL;
|
||||
}
|
||||
|
||||
*ret_valp = (msg->message == WM_XBUTTONUP ? TRUE : 0);
|
||||
return_val = TRUE;
|
||||
break;
|
||||
}
|
||||
|
@@ -235,14 +235,6 @@ struct _GdkWin32Surface
|
||||
/* The cursor that GDK set for this window via GdkDevice */
|
||||
GdkWin32HCursor *cursor;
|
||||
|
||||
/* When VK_PACKET sends us a leading surrogate, it's stashed here.
|
||||
* Later, when another VK_PACKET sends a tailing surrogate, we make up
|
||||
* a full unicode character from them, or discard the leading surrogate,
|
||||
* if the next key is not a tailing surrogate.
|
||||
*/
|
||||
wchar_t leading_surrogate_keydown;
|
||||
wchar_t leading_surrogate_keyup;
|
||||
|
||||
/* Window size hints */
|
||||
int hint_flags;
|
||||
GdkGeometry hints;
|
||||
|
@@ -1595,7 +1595,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
state,
|
||||
gdk_x11_keymap_key_is_modifier (keymap, xev->detail),
|
||||
&translated,
|
||||
&no_lock);
|
||||
&no_lock,
|
||||
NULL);
|
||||
|
||||
if (ev->evtype == XI_KeyPress)
|
||||
set_user_time (event);
|
||||
|
@@ -1,14 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/node">
|
||||
<interface name="org.a11y.atspi.Value">
|
||||
|
||||
<property name="MinimumValue" type="d" access="read"/>
|
||||
|
||||
<property name="MaximumValue" type="d" access="read"/>
|
||||
|
||||
<property name="MinimumIncrement" type="d" access="read"/>
|
||||
|
||||
<property name="CurrentValue" type="d" access="readwrite"/>
|
||||
|
||||
</interface>
|
||||
<interface name="org.a11y.atspi.Value">
|
||||
<property name="MinimumValue" type="d" access="read"/>
|
||||
<property name="MaximumValue" type="d" access="read"/>
|
||||
<property name="MinimumIncrement" type="d" access="read"/>
|
||||
<property name="CurrentValue" type="d" access="readwrite"/>
|
||||
<property name="Text" type="s" access="read"/>
|
||||
</interface>
|
||||
</node>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkatspipangoprivate.h"
|
||||
#include "gtkpango.h"
|
||||
#include "gtkpangoprivate.h"
|
||||
|
||||
void
|
||||
gtk_pango_get_font_attributes (PangoFontDescription *font,
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "gtklistbase.h"
|
||||
#include "gtklistbox.h"
|
||||
#include "gtkflowbox.h"
|
||||
#include "gtkcombobox.h"
|
||||
#include "deprecated/gtkcombobox.h"
|
||||
#include "gtkstackswitcher.h"
|
||||
#include "gtknotebook.h"
|
||||
#include "gtklistview.h"
|
||||
@@ -618,6 +618,8 @@ static const GDBusInterfaceVTable flowbox_vtable = {
|
||||
/* }}} */
|
||||
/* {{{ GtkComboBox */
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
combobox_handle_method (GDBusConnection *connection,
|
||||
const gchar *sender,
|
||||
@@ -713,6 +715,8 @@ static const GDBusInterfaceVTable combobox_vtable = {
|
||||
NULL
|
||||
};
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/* }}} */
|
||||
/* {{{ GtkStackSwitcher */
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include "gtkentryprivate.h"
|
||||
#include "gtkinscriptionprivate.h"
|
||||
#include "gtklabelprivate.h"
|
||||
#include "gtkpango.h"
|
||||
#include "gtkpangoprivate.h"
|
||||
#include "gtkpasswordentryprivate.h"
|
||||
#include "gtksearchentryprivate.h"
|
||||
#include "gtkspinbuttonprivate.h"
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include "gtkatspipangoprivate.h"
|
||||
#include "gtktextbufferprivate.h"
|
||||
#include "gtktextviewprivate.h"
|
||||
#include "gtkpango.h"
|
||||
#include "gtkpangoprivate.h"
|
||||
|
||||
void
|
||||
gtk_text_view_add_default_attributes (GtkTextView *view,
|
||||
|
@@ -24,14 +24,9 @@
|
||||
|
||||
#include "a11y/atspi/atspi-value.h"
|
||||
|
||||
#include "gtkaccessiblerangeprivate.h"
|
||||
#include "gtkatcontextprivate.h"
|
||||
#include "gtkdebug.h"
|
||||
#include "gtklevelbar.h"
|
||||
#include "gtkpaned.h"
|
||||
#include "gtkprogressbar.h"
|
||||
#include "gtkrange.h"
|
||||
#include "gtkscalebutton.h"
|
||||
#include "gtkspinbutton.h"
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
@@ -45,31 +40,58 @@ handle_value_get_property (GDBusConnection *connection,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkATContext *ctx = GTK_AT_CONTEXT (user_data);
|
||||
|
||||
/* Numeric attributes */
|
||||
struct {
|
||||
const char *name;
|
||||
GtkAccessibleProperty property;
|
||||
} properties[] = {
|
||||
} num_properties[] = {
|
||||
{ "MinimumValue", GTK_ACCESSIBLE_PROPERTY_VALUE_MIN },
|
||||
{ "MaximumValue", GTK_ACCESSIBLE_PROPERTY_VALUE_MAX },
|
||||
{ "CurrentValue", GTK_ACCESSIBLE_PROPERTY_VALUE_NOW },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (properties); i++)
|
||||
/* String attributes */
|
||||
struct {
|
||||
const char *name;
|
||||
GtkAccessibleProperty property;
|
||||
} str_properties[] = {
|
||||
{ "Text", GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT },
|
||||
};
|
||||
|
||||
for (int i = 0; i < G_N_ELEMENTS (num_properties); i++)
|
||||
{
|
||||
if (g_strcmp0 (property_name, properties[i].name) == 0)
|
||||
if (g_strcmp0 (property_name, num_properties[i].name) == 0)
|
||||
{
|
||||
if (gtk_at_context_has_accessible_property (ctx, properties[i].property))
|
||||
if (gtk_at_context_has_accessible_property (ctx, num_properties[i].property))
|
||||
{
|
||||
GtkAccessibleValue *value;
|
||||
GtkAccessibleValue *value =
|
||||
gtk_at_context_get_accessible_property (ctx, num_properties[i].property);
|
||||
|
||||
value = gtk_at_context_get_accessible_property (ctx, properties[i].property);
|
||||
return g_variant_new_double (gtk_number_accessible_value_get (value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* fall back for a) MinimumIncrement b) widgets that should have the
|
||||
for (int i = 0; i < G_N_ELEMENTS (str_properties); i++)
|
||||
{
|
||||
if (g_strcmp0 (property_name, str_properties[i].name) == 0)
|
||||
{
|
||||
if (gtk_at_context_has_accessible_property (ctx, str_properties[i].property))
|
||||
{
|
||||
GtkAccessibleValue *value =
|
||||
gtk_at_context_get_accessible_property (ctx, str_properties[i].property);
|
||||
|
||||
return g_variant_new_string (gtk_string_accessible_value_get (value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Special-case MinimumIncrement as it does not have an ARIA counterpart */
|
||||
if (g_strcmp0 (property_name, "MinimumIncrement") == 0)
|
||||
return g_variant_new_double (0.0);
|
||||
|
||||
/* fall back for widgets that should have the
|
||||
* properties but don't
|
||||
*/
|
||||
return g_variant_new_double (0.0);
|
||||
@@ -86,23 +108,10 @@ handle_value_set_property (GDBusConnection *connection,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkATContext *self = user_data;
|
||||
GtkWidget *widget = GTK_WIDGET (gtk_at_context_get_accessible (self));
|
||||
GtkAccessibleRange *range = GTK_ACCESSIBLE_RANGE (gtk_at_context_get_accessible (self));
|
||||
|
||||
if (g_strcmp0 (property_name, "CurrentValue") == 0)
|
||||
{
|
||||
/* we only allow setting values if that is part of the user-exposed
|
||||
* functionality of the widget.
|
||||
*/
|
||||
if (GTK_IS_RANGE (widget))
|
||||
gtk_range_set_value (GTK_RANGE (widget), g_variant_get_double (value));
|
||||
else if (GTK_IS_PANED (widget))
|
||||
gtk_paned_set_position (GTK_PANED (widget), (int)(g_variant_get_double (value) + 0.5));
|
||||
else if (GTK_IS_SPIN_BUTTON (widget))
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), g_variant_get_double (value));
|
||||
else if (GTK_IS_SCALE_BUTTON (widget))
|
||||
gtk_scale_button_set_value (GTK_SCALE_BUTTON (widget), g_variant_get_double (value));
|
||||
return TRUE;
|
||||
}
|
||||
return gtk_accessible_range_set_current_value (range, g_variant_get_double (value));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -116,14 +125,8 @@ static const GDBusInterfaceVTable value_vtable = {
|
||||
const GDBusInterfaceVTable *
|
||||
gtk_atspi_get_value_vtable (GtkAccessible *accessible)
|
||||
{
|
||||
if (GTK_IS_LEVEL_BAR (accessible) ||
|
||||
GTK_IS_PANED (accessible) ||
|
||||
GTK_IS_PROGRESS_BAR (accessible) ||
|
||||
GTK_IS_RANGE (accessible) ||
|
||||
GTK_IS_SCALE_BUTTON (accessible) ||
|
||||
GTK_IS_SPIN_BUTTON (accessible))
|
||||
if (GTK_IS_ACCESSIBLE_RANGE (accessible))
|
||||
return &value_vtable;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,10 @@
|
||||
*
|
||||
* To obtain the application that has been selected in a `GtkAppChooser`,
|
||||
* use [method@Gtk.AppChooser.get_app_info].
|
||||
*
|
||||
* Deprecated: 4.10: The application selection widgets should be
|
||||
* implemented according to the design of each platform and/or
|
||||
* application requiring them.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -52,6 +56,8 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
G_DEFINE_INTERFACE (GtkAppChooser, gtk_app_chooser, GTK_TYPE_WIDGET);
|
||||
|
||||
static void
|
||||
@@ -82,6 +88,8 @@ gtk_app_chooser_default_init (GtkAppChooserIface *iface)
|
||||
* shows applications.
|
||||
*
|
||||
* Returns: the content type of @self. Free with g_free()
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
char *
|
||||
gtk_app_chooser_get_content_type (GtkAppChooser *self)
|
||||
@@ -105,6 +113,8 @@ gtk_app_chooser_get_content_type (GtkAppChooser *self)
|
||||
*
|
||||
* Returns: (nullable) (transfer full): a `GAppInfo` for the
|
||||
* currently selected application
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
GAppInfo *
|
||||
gtk_app_chooser_get_app_info (GtkAppChooser *self)
|
||||
@@ -117,6 +127,8 @@ gtk_app_chooser_get_app_info (GtkAppChooser *self)
|
||||
* @self: a `GtkAppChooser`
|
||||
*
|
||||
* Reloads the list of applications.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_refresh (GtkAppChooser *self)
|
@@ -41,11 +41,11 @@ typedef struct _GtkAppChooser GtkAppChooser;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_app_chooser_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GAppInfo * gtk_app_chooser_get_app_info (GtkAppChooser *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
char * gtk_app_chooser_get_content_type (GtkAppChooser *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_refresh (GtkAppChooser *self);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkAppChooser, g_object_unref)
|
@@ -45,9 +45,13 @@
|
||||
* To track changes in the selected application, use the
|
||||
* [signal@Gtk.AppChooserButton::changed] signal.
|
||||
*
|
||||
* # CSS nodes
|
||||
* ## CSS nodes
|
||||
*
|
||||
* `GtkAppChooserButton` has a single CSS node with the name “appchooserbutton”.
|
||||
*
|
||||
* Deprecated: 4.10: The application selection widgets should be
|
||||
* implemented according to the design of each platform and/or
|
||||
* application requiring them.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
@@ -67,6 +71,8 @@
|
||||
#include "gtkliststore.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
enum {
|
||||
PROP_SHOW_DIALOG_ITEM = 1,
|
||||
PROP_SHOW_DEFAULT_ITEM,
|
||||
@@ -883,6 +889,8 @@ real_insert_separator (GtkAppChooserButton *self,
|
||||
* that can handle content of the given type.
|
||||
*
|
||||
* Returns: a newly created `GtkAppChooserButton`
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
GtkWidget *
|
||||
gtk_app_chooser_button_new (const char *content_type)
|
||||
@@ -900,6 +908,8 @@ gtk_app_chooser_button_new (const char *content_type)
|
||||
*
|
||||
* Appends a separator to the list of applications that is shown
|
||||
* in the popup.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_append_separator (GtkAppChooserButton *self)
|
||||
@@ -928,6 +938,8 @@ gtk_app_chooser_button_append_separator (GtkAppChooserButton *self)
|
||||
* callback for the activation of a particular custom item in the list.
|
||||
*
|
||||
* See also [method@Gtk.AppChooserButton.append_separator].
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_append_custom_item (GtkAppChooserButton *self,
|
||||
@@ -955,6 +967,8 @@ gtk_app_chooser_button_append_custom_item (GtkAppChooserButton *self,
|
||||
*
|
||||
* Use [method@Gtk.AppChooser.refresh] to bring the selection
|
||||
* to its initial state.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_set_active_custom_item (GtkAppChooserButton *self,
|
||||
@@ -983,6 +997,8 @@ gtk_app_chooser_button_set_active_custom_item (GtkAppChooserButton *self,
|
||||
* for a `GtkAppChooserDialog`.
|
||||
*
|
||||
* Returns: the value of [property@Gtk.AppChooserButton:show-dialog-item]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_button_get_show_dialog_item (GtkAppChooserButton *self)
|
||||
@@ -999,6 +1015,8 @@ gtk_app_chooser_button_get_show_dialog_item (GtkAppChooserButton *self)
|
||||
*
|
||||
* Sets whether the dropdown menu of this button should show an
|
||||
* entry to trigger a `GtkAppChooserDialog`.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_set_show_dialog_item (GtkAppChooserButton *self,
|
||||
@@ -1022,6 +1040,8 @@ gtk_app_chooser_button_set_show_dialog_item (GtkAppChooserButton *self,
|
||||
* application at the top.
|
||||
*
|
||||
* Returns: the value of [property@Gtk.AppChooserButton:show-default-item]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_button_get_show_default_item (GtkAppChooserButton *self)
|
||||
@@ -1038,6 +1058,8 @@ gtk_app_chooser_button_get_show_default_item (GtkAppChooserButton *self)
|
||||
*
|
||||
* Sets whether the dropdown menu of this button should show the
|
||||
* default application for the given content type at top.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_set_show_default_item (GtkAppChooserButton *self,
|
||||
@@ -1063,6 +1085,8 @@ gtk_app_chooser_button_set_show_default_item (GtkAppChooserButton *self,
|
||||
* Sets the text to display at the top of the dialog.
|
||||
*
|
||||
* If the heading is not set, the dialog displays a default text.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_set_heading (GtkAppChooserButton *self,
|
||||
@@ -1084,6 +1108,8 @@ gtk_app_chooser_button_set_heading (GtkAppChooserButton *self,
|
||||
*
|
||||
* Returns: (nullable): the text to display at the top of the dialog,
|
||||
* or %NULL, in which case a default text is displayed
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
const char *
|
||||
gtk_app_chooser_button_get_heading (GtkAppChooserButton *self)
|
||||
@@ -1099,6 +1125,8 @@ gtk_app_chooser_button_get_heading (GtkAppChooserButton *self)
|
||||
* @modal: %TRUE to make the dialog modal
|
||||
*
|
||||
* Sets whether the dialog should be modal.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_set_modal (GtkAppChooserButton *self,
|
||||
@@ -1121,6 +1149,8 @@ gtk_app_chooser_button_set_modal (GtkAppChooserButton *self,
|
||||
* Gets whether the dialog is modal.
|
||||
*
|
||||
* Returns: %TRUE if the dialog is modal
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_button_get_modal (GtkAppChooserButton *self)
|
@@ -40,40 +40,40 @@ typedef struct _GtkAppChooserButton GtkAppChooserButton;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_app_chooser_button_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkWidget * gtk_app_chooser_button_new (const char *content_type);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_button_append_separator (GtkAppChooserButton *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_button_append_custom_item (GtkAppChooserButton *self,
|
||||
const char *name,
|
||||
const char *label,
|
||||
GIcon *icon);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_button_set_active_custom_item (GtkAppChooserButton *self,
|
||||
const char *name);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_button_set_show_dialog_item (GtkAppChooserButton *self,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_button_get_show_dialog_item (GtkAppChooserButton *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_button_set_heading (GtkAppChooserButton *self,
|
||||
const char *heading);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
const char *
|
||||
gtk_app_chooser_button_get_heading (GtkAppChooserButton *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_button_set_show_default_item (GtkAppChooserButton *self,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_button_get_show_default_item (GtkAppChooserButton *self);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_button_get_modal (GtkAppChooserButton *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_button_set_modal (GtkAppChooserButton *self,
|
||||
gboolean modal);
|
||||
|
@@ -37,6 +37,10 @@
|
||||
*
|
||||
* To set the heading that is shown above the `GtkAppChooserWidget`,
|
||||
* use [method@Gtk.AppChooserDialog.set_heading].
|
||||
*
|
||||
* Deprecated: 4.10: The application selection widgets should be
|
||||
* implemented according to the design of each platform and/or
|
||||
* application requiring them.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
@@ -61,6 +65,8 @@
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
typedef struct _GtkAppChooserDialogClass GtkAppChooserDialogClass;
|
||||
|
||||
struct _GtkAppChooserDialog {
|
||||
@@ -214,13 +220,13 @@ set_dialog_properties (GtkAppChooserDialog *self)
|
||||
else if (self->content_type)
|
||||
{
|
||||
/* Translators: %s is a file type description */
|
||||
subtitle = g_strdup_printf (_("Opening “%s” files."),
|
||||
subtitle = g_strdup_printf (_("Opening “%s” files."),
|
||||
unknown ? self->content_type : description);
|
||||
string = g_strdup_printf (_("No applications found for “%s” files"),
|
||||
unknown ? self->content_type : description);
|
||||
}
|
||||
|
||||
g_object_get (self, "use-header-bar", &use_header, NULL);
|
||||
g_object_get (self, "use-header-bar", &use_header, NULL);
|
||||
if (use_header)
|
||||
{
|
||||
GtkWidget *box, *label;
|
||||
@@ -492,7 +498,7 @@ static void
|
||||
gtk_app_chooser_dialog_dispose (GObject *object)
|
||||
{
|
||||
GtkAppChooserDialog *self = GTK_APP_CHOOSER_DIALOG (object);
|
||||
|
||||
|
||||
g_clear_object (&self->gfile);
|
||||
|
||||
self->dismissed = TRUE;
|
||||
@@ -670,6 +676,8 @@ set_parent_and_flags (GtkWidget *dialog,
|
||||
* The dialog will show applications that can open the file.
|
||||
*
|
||||
* Returns: a newly created `GtkAppChooserDialog`
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
GtkWidget *
|
||||
gtk_app_chooser_dialog_new (GtkWindow *parent,
|
||||
@@ -700,6 +708,8 @@ gtk_app_chooser_dialog_new (GtkWindow *parent,
|
||||
* The dialog will show applications that can open the content type.
|
||||
*
|
||||
* Returns: a newly created `GtkAppChooserDialog`
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
GtkWidget *
|
||||
gtk_app_chooser_dialog_new_for_content_type (GtkWindow *parent,
|
||||
@@ -726,6 +736,8 @@ gtk_app_chooser_dialog_new_for_content_type (GtkWindow *parent,
|
||||
* Returns the `GtkAppChooserWidget` of this dialog.
|
||||
*
|
||||
* Returns: (transfer none): the `GtkAppChooserWidget` of @self
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
GtkWidget *
|
||||
gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self)
|
||||
@@ -743,6 +755,8 @@ gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self)
|
||||
* Sets the text to display at the top of the dialog.
|
||||
*
|
||||
* If the heading is not set, the dialog displays a default text.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *self,
|
||||
@@ -777,6 +791,8 @@ gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *self,
|
||||
*
|
||||
* Returns: (nullable): the text to display at the top of the dialog,
|
||||
* or %NULL, in which case a default text is displayed
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
const char *
|
||||
gtk_app_chooser_dialog_get_heading (GtkAppChooserDialog *self)
|
@@ -43,21 +43,21 @@ typedef struct _GtkAppChooserDialog GtkAppChooserDialog;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_app_chooser_dialog_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkWidget * gtk_app_chooser_dialog_new (GtkWindow *parent,
|
||||
GtkDialogFlags flags,
|
||||
GFile *file);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkWidget * gtk_app_chooser_dialog_new_for_content_type (GtkWindow *parent,
|
||||
GtkDialogFlags flags,
|
||||
const char *content_type);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkWidget * gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *self,
|
||||
const char *heading);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
const char * gtk_app_chooser_dialog_get_heading (GtkAppChooserDialog *self);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkAppChooserDialog, g_object_unref)
|
@@ -44,6 +44,8 @@
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkAppChooserWidget:
|
||||
*
|
||||
@@ -67,9 +69,13 @@
|
||||
* [signal@Gtk.AppChooserWidget::application-selected] and
|
||||
* [signal@Gtk.AppChooserWidget::application-activated] signals.
|
||||
*
|
||||
* # CSS nodes
|
||||
* ## CSS nodes
|
||||
*
|
||||
* `GtkAppChooserWidget` has a single CSS node with name appchooser.
|
||||
*
|
||||
* Deprecated: 4.10: The application selection widgets should be
|
||||
* implemented according to the design of each platform and/or
|
||||
* application requiring them.
|
||||
*/
|
||||
|
||||
typedef struct _GtkAppChooserWidgetClass GtkAppChooserWidgetClass;
|
||||
@@ -310,7 +316,7 @@ gtk_app_chooser_sort_func (GtkTreeModel *model,
|
||||
retval = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
/* the recommended one always wins */
|
||||
if (a_recommended && !b_recommended)
|
||||
{
|
||||
@@ -442,7 +448,7 @@ gtk_app_chooser_widget_add_section (GtkAppChooserWidget *self,
|
||||
retval = FALSE;
|
||||
heading_added = FALSE;
|
||||
bold_string = g_strdup_printf ("<b>%s</b>", heading_title);
|
||||
|
||||
|
||||
for (l = applications; l != NULL; l = l->next)
|
||||
{
|
||||
app = l->data;
|
||||
@@ -1112,6 +1118,8 @@ gtk_app_chooser_widget_iface_init (GtkAppChooserIface *iface)
|
||||
* that can handle content of the given type.
|
||||
*
|
||||
* Returns: a newly created `GtkAppChooserWidget`
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
GtkWidget *
|
||||
gtk_app_chooser_widget_new (const char *content_type)
|
||||
@@ -1128,6 +1136,8 @@ gtk_app_chooser_widget_new (const char *content_type)
|
||||
*
|
||||
* Sets whether the app chooser should show the default handler
|
||||
* for the content type in a separate section.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_widget_set_show_default (GtkAppChooserWidget *self,
|
||||
@@ -1153,6 +1163,8 @@ gtk_app_chooser_widget_set_show_default (GtkAppChooserWidget *self,
|
||||
* for the content type in a separate section.
|
||||
*
|
||||
* Returns: the value of [property@Gtk.AppChooserWidget:show-default]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_widget_get_show_default (GtkAppChooserWidget *self)
|
||||
@@ -1169,6 +1181,8 @@ gtk_app_chooser_widget_get_show_default (GtkAppChooserWidget *self)
|
||||
*
|
||||
* Sets whether the app chooser should show recommended applications
|
||||
* for the content type in a separate section.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_widget_set_show_recommended (GtkAppChooserWidget *self,
|
||||
@@ -1194,6 +1208,8 @@ gtk_app_chooser_widget_set_show_recommended (GtkAppChooserWidget *self,
|
||||
* for the content type in a separate section.
|
||||
*
|
||||
* Returns: the value of [property@Gtk.AppChooserWidget:show-recommended]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_widget_get_show_recommended (GtkAppChooserWidget *self)
|
||||
@@ -1210,6 +1226,8 @@ gtk_app_chooser_widget_get_show_recommended (GtkAppChooserWidget *self)
|
||||
*
|
||||
* Sets whether the app chooser should show related applications
|
||||
* for the content type in a separate section.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_widget_set_show_fallback (GtkAppChooserWidget *self,
|
||||
@@ -1235,6 +1253,8 @@ gtk_app_chooser_widget_set_show_fallback (GtkAppChooserWidget *self,
|
||||
* for the content type in a separate section.
|
||||
*
|
||||
* Returns: the value of [property@Gtk.AppChooserWidget:show-fallback]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_widget_get_show_fallback (GtkAppChooserWidget *self)
|
||||
@@ -1251,6 +1271,8 @@ gtk_app_chooser_widget_get_show_fallback (GtkAppChooserWidget *self)
|
||||
*
|
||||
* Sets whether the app chooser should show applications
|
||||
* which are unrelated to the content type.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_widget_set_show_other (GtkAppChooserWidget *self,
|
||||
@@ -1276,6 +1298,8 @@ gtk_app_chooser_widget_set_show_other (GtkAppChooserWidget *self,
|
||||
* which are unrelated to the content type.
|
||||
*
|
||||
* Returns: the value of [property@Gtk.AppChooserWidget:show-other]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_widget_get_show_other (GtkAppChooserWidget *self)
|
||||
@@ -1292,6 +1316,8 @@ gtk_app_chooser_widget_get_show_other (GtkAppChooserWidget *self)
|
||||
*
|
||||
* Sets whether the app chooser should show all applications
|
||||
* in a flat list.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_widget_set_show_all (GtkAppChooserWidget *self,
|
||||
@@ -1317,6 +1343,8 @@ gtk_app_chooser_widget_set_show_all (GtkAppChooserWidget *self,
|
||||
* in a flat list.
|
||||
*
|
||||
* Returns: the value of [property@Gtk.AppChooserWidget:show-all]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
gboolean
|
||||
gtk_app_chooser_widget_get_show_all (GtkAppChooserWidget *self)
|
||||
@@ -1333,6 +1361,8 @@ gtk_app_chooser_widget_get_show_all (GtkAppChooserWidget *self)
|
||||
*
|
||||
* Sets the text that is shown if there are not applications
|
||||
* that can handle the content type.
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_widget_set_default_text (GtkAppChooserWidget *self,
|
||||
@@ -1359,6 +1389,8 @@ gtk_app_chooser_widget_set_default_text (GtkAppChooserWidget *self,
|
||||
* that can handle the content type.
|
||||
*
|
||||
* Returns: (nullable): the value of [property@Gtk.AppChooserWidget:default-text]
|
||||
*
|
||||
* Deprecated: 4.10: This widget will be removed in GTK 5
|
||||
*/
|
||||
const char *
|
||||
gtk_app_chooser_widget_get_default_text (GtkAppChooserWidget *self)
|
@@ -43,43 +43,43 @@ typedef struct _GtkAppChooserWidget GtkAppChooserWidget;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_app_chooser_widget_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkWidget * gtk_app_chooser_widget_new (const char *content_type);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_widget_set_show_default (GtkAppChooserWidget *self,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_widget_get_show_default (GtkAppChooserWidget *self);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_widget_set_show_recommended (GtkAppChooserWidget *self,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_widget_get_show_recommended (GtkAppChooserWidget *self);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_widget_set_show_fallback (GtkAppChooserWidget *self,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_widget_get_show_fallback (GtkAppChooserWidget *self);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_widget_set_show_other (GtkAppChooserWidget *self,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_widget_get_show_other (GtkAppChooserWidget *self);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_widget_set_show_all (GtkAppChooserWidget *self,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_app_chooser_widget_get_show_all (GtkAppChooserWidget *self);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_app_chooser_widget_set_default_text (GtkAppChooserWidget *self,
|
||||
const char *text);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
const char * gtk_app_chooser_widget_get_default_text (GtkAppChooserWidget *self);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkAppChooserWidget, g_object_unref)
|
@@ -35,7 +35,7 @@
|
||||
* Usually users dont have to interact with the `GtkCellArea` directly
|
||||
* unless they are implementing a cell-layouting widget themselves.
|
||||
*
|
||||
* # Requesting area sizes
|
||||
* ## Requesting area sizes
|
||||
*
|
||||
* As outlined in
|
||||
* [GtkWidget’s geometry management section](class.Widget.html#height-for-width-geometry-management),
|
||||
@@ -186,7 +186,7 @@
|
||||
* values while more and more height is required for the row heights
|
||||
* that are calculated in the background.
|
||||
*
|
||||
* # Rendering Areas
|
||||
* ## Rendering Areas
|
||||
*
|
||||
* Once area sizes have been acquired at least for the rows in the
|
||||
* visible area of the layouting widget they can be rendered at
|
||||
@@ -227,7 +227,7 @@
|
||||
* would make sense to calculate the allocation for each row at
|
||||
* the time the widget is allocated using [func@Gtk.distribute_natural_allocation].
|
||||
*
|
||||
* # Handling Events and Driving Keyboard Focus
|
||||
* ## Handling Events and Driving Keyboard Focus
|
||||
*
|
||||
* Passing events to the area is as simple as handling events on any
|
||||
* normal widget and then passing them to the [method@Gtk.CellArea.event]
|
||||
@@ -316,7 +316,7 @@
|
||||
* Note that the layouting widget is responsible for matching the
|
||||
* `GtkDirectionType` values to the way it lays out its cells.
|
||||
*
|
||||
* # Cell Properties
|
||||
* ## Cell Properties
|
||||
*
|
||||
* The `GtkCellArea` introduces cell properties for `GtkCellRenderer`s.
|
||||
* This provides some general interfaces for defining the relationship
|
||||
@@ -335,6 +335,9 @@
|
||||
* [method@Gtk.CellArea.cell_set] or [method@Gtk.CellArea.cell_set_valist]. To obtain
|
||||
* the value of a cell property, use [method@Gtk.CellArea.cell_get_property]
|
||||
* [method@Gtk.CellArea.cell_get] or [method@Gtk.CellArea.cell_get_valist].
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets for displaying their
|
||||
* contents
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -343,17 +346,18 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "gtkcelllayout.h"
|
||||
#include "deprecated/gtkcelllayout.h"
|
||||
#include "gtkcellarea.h"
|
||||
#include "gtkcellareacontext.h"
|
||||
#include "deprecated/gtkcellareacontext.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtksnapshot.h"
|
||||
#include "deprecated/gtkrender.h"
|
||||
#include "gtkstylecontext.h"
|
||||
#include "gtknative.h"
|
||||
|
||||
#include <gobject/gvaluecollector.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* GObjectClass */
|
||||
static void gtk_cell_area_dispose (GObject *object);
|
||||
@@ -1587,6 +1591,8 @@ gtk_cell_area_buildable_custom_tag_end (GtkBuildable *buildable,
|
||||
* @renderer: the `GtkCellRenderer` to add to @area
|
||||
*
|
||||
* Adds @renderer to @area with the default child cell properties.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_add (GtkCellArea *area,
|
||||
@@ -1604,6 +1610,8 @@ gtk_cell_area_add (GtkCellArea *area,
|
||||
* @renderer: the `GtkCellRenderer` to remove from @area
|
||||
*
|
||||
* Removes @renderer from @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_remove (GtkCellArea *area,
|
||||
@@ -1658,6 +1666,8 @@ get_has_renderer (GtkCellRenderer *renderer,
|
||||
* Checks if @area contains @renderer.
|
||||
*
|
||||
* Returns: %TRUE if @renderer is in the @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_area_has_renderer (GtkCellArea *area,
|
||||
@@ -1680,6 +1690,8 @@ gtk_cell_area_has_renderer (GtkCellArea *area,
|
||||
* @callback_data: user provided data pointer
|
||||
*
|
||||
* Calls @callback for every `GtkCellRenderer` in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_foreach (GtkCellArea *area,
|
||||
@@ -1737,6 +1749,8 @@ gtk_cell_area_foreach_alloc (GtkCellArea *area,
|
||||
* Delegates event handling to a `GtkCellArea`.
|
||||
*
|
||||
* Returns: %TRUE if the event was handled by @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
int
|
||||
gtk_cell_area_event (GtkCellArea *area,
|
||||
@@ -1777,6 +1791,8 @@ gtk_cell_area_event (GtkCellArea *area,
|
||||
*
|
||||
* Snapshots @area’s cells according to @area’s layout onto at
|
||||
* the given coordinates.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_snapshot (GtkCellArea *area,
|
||||
@@ -1830,6 +1846,8 @@ get_cell_allocation (GtkCellRenderer *renderer,
|
||||
*
|
||||
* Derives the allocation of @renderer inside @area if @area
|
||||
* were to be renderered in @cell_area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_get_cell_allocation (GtkCellArea *area,
|
||||
@@ -1886,6 +1904,8 @@ get_cell_by_position (GtkCellRenderer *renderer,
|
||||
* returns the full cell allocation for it inside @cell_area.
|
||||
*
|
||||
* Returns: (transfer none): the `GtkCellRenderer` at @x and @y.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_area_get_cell_at_position (GtkCellArea *area,
|
||||
@@ -1929,6 +1949,8 @@ gtk_cell_area_get_cell_at_position (GtkCellArea *area,
|
||||
* which was used to request the size of those rows of data).
|
||||
*
|
||||
* Returns: (transfer full): a newly created `GtkCellArea`Context which can be used with @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellAreaContext *
|
||||
gtk_cell_area_create_context (GtkCellArea *area)
|
||||
@@ -1956,6 +1978,8 @@ gtk_cell_area_create_context (GtkCellArea *area)
|
||||
* to be displayed.
|
||||
*
|
||||
* Returns: (transfer full): a newly created `GtkCellArea`Context copy of @context.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellAreaContext *
|
||||
gtk_cell_area_copy_context (GtkCellArea *area,
|
||||
@@ -2000,6 +2024,8 @@ gtk_cell_area_get_request_mode (GtkCellArea *area)
|
||||
* to check the @minimum_width and @natural_width of this call but rather to
|
||||
* consult gtk_cell_area_context_get_preferred_width() after a series of
|
||||
* requests.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_get_preferred_width (GtkCellArea *area,
|
||||
@@ -2038,6 +2064,8 @@ gtk_cell_area_get_preferred_width (GtkCellArea *area,
|
||||
* requested with gtk_cell_area_get_preferred_width() again and then
|
||||
* the full width of the requested rows checked again with
|
||||
* gtk_cell_area_context_get_preferred_width().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area,
|
||||
@@ -2072,6 +2100,8 @@ gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area,
|
||||
* to check the @minimum_height and @natural_height of this call but rather to
|
||||
* consult gtk_cell_area_context_get_preferred_height() after a series of
|
||||
* requests.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_get_preferred_height (GtkCellArea *area,
|
||||
@@ -2110,6 +2140,8 @@ gtk_cell_area_get_preferred_height (GtkCellArea *area,
|
||||
* requested with gtk_cell_area_get_preferred_height() again and then
|
||||
* the full height of the requested rows checked again with
|
||||
* gtk_cell_area_context_get_preferred_height().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area,
|
||||
@@ -2141,6 +2173,8 @@ gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area,
|
||||
*
|
||||
* Connects an @attribute to apply values from @column for the
|
||||
* `GtkTreeModel` in use.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_attribute_connect (GtkCellArea *area,
|
||||
@@ -2207,6 +2241,8 @@ gtk_cell_area_attribute_connect (GtkCellArea *area,
|
||||
* Disconnects @attribute for the @renderer in @area so that
|
||||
* attribute will no longer be updated with values from the
|
||||
* model.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_attribute_disconnect (GtkCellArea *area,
|
||||
@@ -2250,6 +2286,8 @@ gtk_cell_area_attribute_disconnect (GtkCellArea *area,
|
||||
* or -1 if the attribute is not mapped.
|
||||
*
|
||||
* Returns: the model column, or -1
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
int
|
||||
gtk_cell_area_attribute_get_column (GtkCellArea *area,
|
||||
@@ -2288,6 +2326,8 @@ gtk_cell_area_attribute_get_column (GtkCellArea *area,
|
||||
*
|
||||
* Applies any connected attributes to the renderers in
|
||||
* @area by pulling the values from @tree_model.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_apply_attributes (GtkCellArea *area,
|
||||
@@ -2339,6 +2379,8 @@ gtk_cell_area_get_current_path_string (GtkCellArea *area)
|
||||
* @pspec: the `GParamSpec` for the property
|
||||
*
|
||||
* Installs a cell property on a cell area class.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_class_install_cell_property (GtkCellAreaClass *aclass,
|
||||
@@ -2375,6 +2417,8 @@ gtk_cell_area_class_install_cell_property (GtkCellAreaClass *aclass,
|
||||
* Finds a cell property of a cell area class by name.
|
||||
*
|
||||
* Returns: (transfer none): the `GParamSpec` of the child property
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GParamSpec*
|
||||
gtk_cell_area_class_find_cell_property (GtkCellAreaClass *aclass,
|
||||
@@ -2399,6 +2443,8 @@ gtk_cell_area_class_find_cell_property (GtkCellAreaClass *aclass,
|
||||
* Returns: (array length=n_properties) (transfer container): a newly
|
||||
* allocated %NULL-terminated array of `GParamSpec`*. The array
|
||||
* must be freed with g_free().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GParamSpec**
|
||||
gtk_cell_area_class_list_cell_properties (GtkCellAreaClass *aclass,
|
||||
@@ -2428,6 +2474,8 @@ gtk_cell_area_class_list_cell_properties (GtkCellAreaClass *aclass,
|
||||
*
|
||||
* Adds @renderer to @area, setting cell properties at the same time.
|
||||
* See gtk_cell_area_add() and gtk_cell_area_cell_set() for more details.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_add_with_properties (GtkCellArea *area,
|
||||
@@ -2466,6 +2514,8 @@ gtk_cell_area_add_with_properties (GtkCellArea *area,
|
||||
* with @first_prop_name
|
||||
*
|
||||
* Sets one or more cell properties for @cell in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_cell_set (GtkCellArea *area,
|
||||
@@ -2492,6 +2542,8 @@ gtk_cell_area_cell_set (GtkCellArea *area,
|
||||
* optionally by more name/return location pairs, followed by %NULL
|
||||
*
|
||||
* Gets the values of one or more cell properties for @renderer in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_cell_get (GtkCellArea *area,
|
||||
@@ -2563,6 +2615,8 @@ area_set_cell_property (GtkCellArea *area,
|
||||
* with @first_prop_name
|
||||
*
|
||||
* Sets one or more cell properties for @renderer in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_cell_set_valist (GtkCellArea *area,
|
||||
@@ -2623,6 +2677,8 @@ gtk_cell_area_cell_set_valist (GtkCellArea *area,
|
||||
* optionally by more name/return location pairs, followed by %NULL
|
||||
*
|
||||
* Gets the values of one or more cell properties for @renderer in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_cell_get_valist (GtkCellArea *area,
|
||||
@@ -2680,6 +2736,8 @@ gtk_cell_area_cell_get_valist (GtkCellArea *area,
|
||||
* @value: the value to set the cell property to
|
||||
*
|
||||
* Sets a cell property for @renderer in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_cell_set_property (GtkCellArea *area,
|
||||
@@ -2716,6 +2774,8 @@ gtk_cell_area_cell_set_property (GtkCellArea *area,
|
||||
* @value: a location to return the value
|
||||
*
|
||||
* Gets the value of a cell property for @renderer in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_cell_get_property (GtkCellArea *area,
|
||||
@@ -2785,6 +2845,8 @@ gtk_cell_area_cell_get_property (GtkCellArea *area,
|
||||
* after applying new attributes to @area.
|
||||
*
|
||||
* Returns: whether @area can do anything when activated.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_area_is_activatable (GtkCellArea *area)
|
||||
@@ -2808,6 +2870,8 @@ gtk_cell_area_is_activatable (GtkCellArea *area)
|
||||
* to how it lays out cells.
|
||||
*
|
||||
* Returns: %TRUE if focus remains inside @area as a result of this call.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_area_focus (GtkCellArea *area,
|
||||
@@ -2833,6 +2897,8 @@ gtk_cell_area_focus (GtkCellArea *area,
|
||||
* can also activate a widget if it currently has the focus.
|
||||
*
|
||||
* Returns: Whether @area was successfully activated.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_area_activate (GtkCellArea *area,
|
||||
@@ -2859,6 +2925,8 @@ gtk_cell_area_activate (GtkCellArea *area,
|
||||
* `GtkCellAreaClass.focus()` or `GtkCellAreaClass.event()`,
|
||||
* however it can also be used to implement functions such
|
||||
* as gtk_tree_view_set_cursor_on_cell().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_set_focus_cell (GtkCellArea *area,
|
||||
@@ -2897,6 +2965,8 @@ gtk_cell_area_set_focus_cell (GtkCellArea *area,
|
||||
* Retrieves the currently focused cell for @area
|
||||
*
|
||||
* Returns: (transfer none) (nullable): the currently focused cell in @area.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_area_get_focus_cell (GtkCellArea *area)
|
||||
@@ -2925,6 +2995,8 @@ gtk_cell_area_get_focus_cell (GtkCellArea *area)
|
||||
*
|
||||
* Events handled by focus siblings can also activate the given
|
||||
* focusable @renderer.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_add_focus_sibling (GtkCellArea *area,
|
||||
@@ -2968,6 +3040,8 @@ gtk_cell_area_add_focus_sibling (GtkCellArea *area,
|
||||
*
|
||||
* Removes @sibling from @renderer’s focus sibling list
|
||||
* (see gtk_cell_area_add_focus_sibling()).
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_remove_focus_sibling (GtkCellArea *area,
|
||||
@@ -3003,6 +3077,8 @@ gtk_cell_area_remove_focus_sibling (GtkCellArea *area,
|
||||
* (see gtk_cell_area_add_focus_sibling()).
|
||||
*
|
||||
* Returns: %TRUE if @sibling is a focus sibling of @renderer
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_area_is_focus_sibling (GtkCellArea *area,
|
||||
@@ -3038,6 +3114,8 @@ gtk_cell_area_is_focus_sibling (GtkCellArea *area,
|
||||
*
|
||||
* Returns: (element-type GtkCellRenderer) (transfer none): A `GList` of `GtkCellRenderer`s.
|
||||
* The returned list is internal and should not be freed.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
const GList *
|
||||
gtk_cell_area_get_focus_siblings (GtkCellArea *area,
|
||||
@@ -3066,6 +3144,8 @@ gtk_cell_area_get_focus_siblings (GtkCellArea *area,
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the `GtkCellRenderer`
|
||||
* for which @renderer is a sibling
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_area_get_focus_from_sibling (GtkCellArea *area,
|
||||
@@ -3205,6 +3285,8 @@ gtk_cell_area_set_edit_widget (GtkCellArea *area,
|
||||
* being edited.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): The currently edited `GtkCellRenderer`
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_area_get_edited_cell (GtkCellArea *area)
|
||||
@@ -3224,6 +3306,8 @@ gtk_cell_area_get_edited_cell (GtkCellArea *area)
|
||||
* to edit the currently edited cell.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): The currently active `GtkCellEditable` widget
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellEditable *
|
||||
gtk_cell_area_get_edit_widget (GtkCellArea *area)
|
||||
@@ -3251,6 +3335,8 @@ gtk_cell_area_get_edit_widget (GtkCellArea *area)
|
||||
* implementation.
|
||||
*
|
||||
* Returns: whether cell activation was successful
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_area_activate_cell (GtkCellArea *area,
|
||||
@@ -3344,6 +3430,8 @@ gtk_cell_area_activate_cell (GtkCellArea *area,
|
||||
* edit widget.
|
||||
*
|
||||
* See gtk_cell_area_get_edited_cell() and gtk_cell_area_get_edit_widget().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_stop_editing (GtkCellArea *area,
|
||||
@@ -3396,6 +3484,8 @@ gtk_cell_area_stop_editing (GtkCellArea *area,
|
||||
* This is a convenience function for `GtkCellArea` implementations
|
||||
* to get the inner area where a given `GtkCellRenderer` will be
|
||||
* rendered. It removes any padding previously added by gtk_cell_area_request_renderer().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_inner_cell_area (GtkCellArea *area,
|
||||
@@ -3448,6 +3538,8 @@ gtk_cell_area_inner_cell_area (GtkCellArea *area,
|
||||
* function to request size and then use gtk_cell_area_inner_cell_area()
|
||||
* at render and event time since this function will add padding
|
||||
* around the cell for focus painting.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_request_renderer (GtkCellArea *area,
|
@@ -26,9 +26,9 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellrenderer.h>
|
||||
#include <gtk/gtkwidget.h>
|
||||
#include <gtk/gtktreemodel.h>
|
||||
#include <gtk/deprecated/gtkcellrenderer.h>
|
||||
#include <gtk/deprecated/gtktreemodel.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -269,20 +269,20 @@ GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_area_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* Basic methods */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_add (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_remove (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_area_has_renderer (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_foreach (GtkCellArea *area,
|
||||
GtkCellCallback callback,
|
||||
gpointer callback_data);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_foreach_alloc (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
@@ -290,14 +290,14 @@ void gtk_cell_area_foreach_alloc (GtkCellArea
|
||||
const GdkRectangle *background_area,
|
||||
GtkCellAllocCallback callback,
|
||||
gpointer callback_data);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
int gtk_cell_area_event (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_snapshot (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
@@ -307,14 +307,14 @@ void gtk_cell_area_snapshot (GtkCellArea
|
||||
GtkCellRendererState flags,
|
||||
gboolean paint_focus);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_get_cell_allocation (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GtkCellRenderer *renderer,
|
||||
const GdkRectangle *cell_area,
|
||||
GdkRectangle *allocation);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_area_get_cell_at_position (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
@@ -324,179 +324,179 @@ GtkCellRenderer *gtk_cell_area_get_cell_at_position (GtkCellArea
|
||||
GdkRectangle *alloc_area);
|
||||
|
||||
/* Geometry */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellAreaContext *gtk_cell_area_create_context (GtkCellArea *area);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellAreaContext *gtk_cell_area_copy_context (GtkCellArea *area,
|
||||
GtkCellAreaContext *context);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkSizeRequestMode gtk_cell_area_get_request_mode (GtkCellArea *area);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_get_preferred_width (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
int *minimum_width,
|
||||
int *natural_width);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
int width,
|
||||
int *minimum_height,
|
||||
int *natural_height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_get_preferred_height (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
int *minimum_height,
|
||||
int *natural_height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
int height,
|
||||
int *minimum_width,
|
||||
int *natural_width);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
const char * gtk_cell_area_get_current_path_string (GtkCellArea *area);
|
||||
|
||||
|
||||
/* Attributes */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_apply_attributes (GtkCellArea *area,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
gboolean is_expander,
|
||||
gboolean is_expanded);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_attribute_connect (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *attribute,
|
||||
int column);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_attribute_disconnect (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *attribute);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
int gtk_cell_area_attribute_get_column (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *attribute);
|
||||
|
||||
|
||||
/* Cell Properties */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_class_install_cell_property (GtkCellAreaClass *aclass,
|
||||
guint property_id,
|
||||
GParamSpec *pspec);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GParamSpec* gtk_cell_area_class_find_cell_property (GtkCellAreaClass *aclass,
|
||||
const char *property_name);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GParamSpec** gtk_cell_area_class_list_cell_properties (GtkCellAreaClass *aclass,
|
||||
guint *n_properties);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_add_with_properties (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_cell_set (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_cell_get (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_cell_set_valist (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *first_property_name,
|
||||
va_list var_args);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_cell_get_valist (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *first_property_name,
|
||||
va_list var_args);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_cell_set_property (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *property_name,
|
||||
const GValue *value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_cell_get_property (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const char *property_name,
|
||||
GValue *value);
|
||||
|
||||
/* Focus */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_area_is_activatable (GtkCellArea *area);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_area_activate (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean edit_only);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_area_focus (GtkCellArea *area,
|
||||
GtkDirectionType direction);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_set_focus_cell (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_area_get_focus_cell (GtkCellArea *area);
|
||||
|
||||
|
||||
/* Focus siblings */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_add_focus_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_remove_focus_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_area_is_focus_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
const GList * gtk_cell_area_get_focus_siblings (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_area_get_focus_from_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
|
||||
/* Cell Activation/Editing */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_area_get_edited_cell (GtkCellArea *area);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellEditable *gtk_cell_area_get_edit_widget (GtkCellArea *area);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_area_activate_cell (GtkCellArea *area,
|
||||
GtkWidget *widget,
|
||||
GtkCellRenderer *renderer,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_stop_editing (GtkCellArea *area,
|
||||
gboolean canceled);
|
||||
|
||||
/* Functions for area implementations */
|
||||
|
||||
/* Distinguish the inner cell area from the whole requested area including margins */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_inner_cell_area (GtkCellArea *area,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GdkRectangle *inner_area);
|
||||
|
||||
/* Request the size of a cell while respecting the cell margins (requests are margin inclusive) */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_request_renderer (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkOrientation orientation,
|
@@ -42,16 +42,20 @@
|
||||
* configured by configuring the `GtkCellAreaBox` align child cell property
|
||||
* with gtk_cell_area_cell_set_property() or by specifying the "align"
|
||||
* argument to gtk_cell_area_box_pack_start() and gtk_cell_area_box_pack_end().
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets for displaying their
|
||||
* contents
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkorientable.h"
|
||||
#include "gtkcelllayout.h"
|
||||
#include "deprecated/gtkcelllayout.h"
|
||||
#include "gtkcellareabox.h"
|
||||
#include "gtkcellareaboxcontextprivate.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* GObjectClass */
|
||||
static void gtk_cell_area_box_finalize (GObject *object);
|
||||
@@ -501,7 +505,7 @@ cell_groups_rebuild (GtkCellAreaBox *box)
|
||||
CellInfo *info = l->data;
|
||||
|
||||
/* A new group starts with any aligned cell, or
|
||||
* at the beginning and end of a fixed size cell.
|
||||
* at the beginning and end of a fixed size cell.
|
||||
* the first group is implied */
|
||||
if ((info->align || info->fixed || last_cell_fixed) && l != cells)
|
||||
{
|
||||
@@ -891,7 +895,7 @@ get_allocated_cells (GtkCellAreaBox *box,
|
||||
if (visible_cells == 0)
|
||||
continue;
|
||||
|
||||
/* If were not aligned, place the cell after the last cell
|
||||
/* If were not aligned, place the cell after the last cell
|
||||
* and eat up the extra space
|
||||
*/
|
||||
if (group->align)
|
||||
@@ -2085,7 +2089,7 @@ _gtk_cell_area_box_group_visible (GtkCellAreaBox *box,
|
||||
{
|
||||
GtkCellAreaBoxPrivate *priv = gtk_cell_area_box_get_instance_private (box);
|
||||
CellGroup *group;
|
||||
|
||||
|
||||
g_assert (group_idx >= 0 && group_idx < priv->groups->len);
|
||||
|
||||
group = &g_array_index (priv->groups, CellGroup, group_idx);
|
||||
@@ -2103,6 +2107,8 @@ _gtk_cell_area_box_group_visible (GtkCellAreaBox *box,
|
||||
* Creates a new `GtkCellAreaBox`.
|
||||
*
|
||||
* Returns: a newly created `GtkCellAreaBox`
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellArea *
|
||||
gtk_cell_area_box_new (void)
|
||||
@@ -2123,6 +2129,8 @@ gtk_cell_area_box_new (void)
|
||||
*
|
||||
* The @renderer is packed after any other `GtkCellRenderer` packed
|
||||
* with reference to the start of @box.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_box_pack_start (GtkCellAreaBox *box,
|
||||
@@ -2164,6 +2172,8 @@ gtk_cell_area_box_pack_start (GtkCellAreaBox *box,
|
||||
*
|
||||
* The @renderer is packed after (away from end of) any other
|
||||
* `GtkCellRenderer` packed with reference to the end of @box.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_box_pack_end (GtkCellAreaBox *box,
|
||||
@@ -2199,6 +2209,8 @@ gtk_cell_area_box_pack_end (GtkCellAreaBox *box,
|
||||
* Gets the spacing added between cell renderers.
|
||||
*
|
||||
* Returns: the space added between cell renderers in @box.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
int
|
||||
gtk_cell_area_box_get_spacing (GtkCellAreaBox *box)
|
||||
@@ -2216,6 +2228,8 @@ gtk_cell_area_box_get_spacing (GtkCellAreaBox *box)
|
||||
* @spacing: the space to add between `GtkCellRenderer`s
|
||||
*
|
||||
* Sets the spacing to add between cell renderers in @box.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_box_set_spacing (GtkCellAreaBox *box,
|
@@ -26,7 +26,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellarea.h>
|
||||
#include <gtk/deprecated/gtkcellarea.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -39,23 +39,23 @@ typedef struct _GtkCellAreaBox GtkCellAreaBox;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_area_box_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellArea *gtk_cell_area_box_new (void);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_box_pack_start (GtkCellAreaBox *box,
|
||||
GtkCellRenderer *renderer,
|
||||
gboolean expand,
|
||||
gboolean align,
|
||||
gboolean fixed);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_box_pack_end (GtkCellAreaBox *box,
|
||||
GtkCellRenderer *renderer,
|
||||
gboolean expand,
|
||||
gboolean align,
|
||||
gboolean fixed);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
int gtk_cell_area_box_get_spacing (GtkCellAreaBox *box);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_box_set_spacing (GtkCellAreaBox *box,
|
||||
int spacing);
|
||||
|
@@ -26,6 +26,8 @@
|
||||
|
||||
#include "gtkprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* GObjectClass */
|
||||
static void _gtk_cell_area_box_context_finalize (GObject *object);
|
||||
|
||||
@@ -137,7 +139,7 @@ get_array (GtkCellAreaBoxContext *context,
|
||||
return array;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static gboolean
|
||||
group_expands (GtkCellAreaBoxContext *context,
|
||||
int group_idx)
|
||||
{
|
||||
@@ -159,7 +161,7 @@ count_expand_groups (GtkCellAreaBoxContext *context)
|
||||
if (priv->expand[i])
|
||||
expand++;
|
||||
}
|
||||
|
||||
|
||||
return expand;
|
||||
}
|
||||
|
||||
@@ -180,7 +182,7 @@ _gtk_cell_area_box_context_init (GtkCellAreaBoxContext *box_context)
|
||||
NULL, (GDestroyNotify)free_cache_array);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_gtk_cell_area_box_context_class_init (GtkCellAreaBoxContextClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
@@ -265,11 +267,11 @@ _gtk_cell_area_box_context_sum (GtkCellAreaBoxContext *context,
|
||||
box_orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (area));
|
||||
array = get_array (context, orientation, for_size);
|
||||
|
||||
/* Get the last visible aligned group
|
||||
/* Get the last visible aligned group
|
||||
* (we need to get space at least up till this group) */
|
||||
for (i = array->len - 1; i >= 0; i--)
|
||||
{
|
||||
if (priv->align[i] &&
|
||||
if (priv->align[i] &&
|
||||
_gtk_cell_area_box_group_visible (area, i))
|
||||
break;
|
||||
}
|
||||
@@ -324,7 +326,7 @@ _gtk_cell_area_box_context_get_preferred_height_for_width (GtkCellAreaContext *c
|
||||
int *minimum_height,
|
||||
int *natural_height)
|
||||
{
|
||||
_gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_VERTICAL,
|
||||
_gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_VERTICAL,
|
||||
width, minimum_height, natural_height);
|
||||
}
|
||||
|
||||
@@ -334,7 +336,7 @@ _gtk_cell_area_box_context_get_preferred_width_for_height (GtkCellAreaContext *c
|
||||
int *minimum_width,
|
||||
int *natural_width)
|
||||
{
|
||||
_gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_HORIZONTAL,
|
||||
_gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_HORIZONTAL,
|
||||
height, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
@@ -684,11 +686,11 @@ _gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
|
||||
int last_aligned_group_idx = 0;
|
||||
int i, j;
|
||||
|
||||
/* Get the last visible aligned group
|
||||
/* Get the last visible aligned group
|
||||
* (we need to get space at least up till this group) */
|
||||
for (i = priv->base_widths->len - 1; i >= 0; i--)
|
||||
{
|
||||
if (priv->align[i] &&
|
||||
if (priv->align[i] &&
|
||||
_gtk_cell_area_box_group_visible (area, i))
|
||||
break;
|
||||
}
|
||||
@@ -844,11 +846,11 @@ _gtk_cell_area_box_context_get_orientation_allocs (GtkCellAreaBoxContext *contex
|
||||
gtk_cell_area_context_get_allocation (ctx, &width, &height);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL && width > 0)
|
||||
allocs = allocate_for_orientation (context, area, orientation,
|
||||
allocs = allocate_for_orientation (context, area, orientation,
|
||||
spacing, width, height,
|
||||
&alloc_count);
|
||||
else if (orientation == GTK_ORIENTATION_VERTICAL && height > 0)
|
||||
allocs = allocate_for_orientation (context, area, orientation,
|
||||
allocs = allocate_for_orientation (context, area, orientation,
|
||||
spacing, height, width,
|
||||
&alloc_count);
|
||||
|
@@ -26,9 +26,9 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellareacontext.h>
|
||||
#include <gtk/gtkcellareabox.h>
|
||||
#include <gtk/gtkcellrenderer.h>
|
||||
#include <gtk/deprecated/gtkcellareacontext.h>
|
||||
#include <gtk/deprecated/gtkcellareabox.h>
|
||||
#include <gtk/deprecated/gtkcellrenderer.h>
|
||||
#include <gtk/gtksizerequest.h>
|
||||
|
||||
G_BEGIN_DECLS
|
@@ -41,6 +41,8 @@
|
||||
#include "gtkcellareacontext.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* GObjectClass */
|
||||
static void gtk_cell_area_context_dispose (GObject *object);
|
||||
static void gtk_cell_area_context_get_property (GObject *object,
|
||||
@@ -306,6 +308,8 @@ gtk_cell_area_context_real_allocate (GtkCellAreaContext *context,
|
||||
* compute a proper allocation.
|
||||
*
|
||||
* Returns: (transfer none): the `GtkCellArea` this context was created by.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellArea *
|
||||
gtk_cell_area_context_get_area (GtkCellAreaContext *context)
|
||||
@@ -343,6 +347,8 @@ gtk_cell_area_context_get_area (GtkCellAreaContext *context)
|
||||
* in the allocated width necessitates a recalculation
|
||||
* of all the displayed row heights using
|
||||
* gtk_cell_area_get_preferred_height_for_width().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_reset (GtkCellAreaContext *context)
|
||||
@@ -370,6 +376,8 @@ gtk_cell_area_context_reset (GtkCellAreaContext *context)
|
||||
* and vertical orientations producing a homogeneous effect of the
|
||||
* rows. This is generally the case for `GtkTreeView` when
|
||||
* `GtkTreeView:fixed-height-mode` is enabled.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_allocate (GtkCellAreaContext *context,
|
||||
@@ -392,6 +400,8 @@ gtk_cell_area_context_allocate (GtkCellAreaContext *context,
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a `GtkCellArea`, the returned values are 0.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context,
|
||||
@@ -420,6 +430,8 @@ gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context,
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a `GtkCellArea`, the returned values are 0.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context,
|
||||
@@ -449,6 +461,8 @@ gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context,
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a `GtkCellArea`, the returned values are -1.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_height_for_width (GtkCellAreaContext *context,
|
||||
@@ -477,6 +491,8 @@ gtk_cell_area_context_get_preferred_height_for_width (GtkCellAreaContext *contex
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a `GtkCellArea`, the returned values are -1.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *context,
|
||||
@@ -504,6 +520,8 @@ gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *contex
|
||||
* If the context was not allocated in width or height, or if the
|
||||
* context was recently reset with gtk_cell_area_context_reset(),
|
||||
* the returned value will be -1.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
|
||||
@@ -534,6 +552,8 @@ gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
|
||||
* the request process over a series of `GtkTreeModel` rows to
|
||||
* progressively push the requested width over a series of
|
||||
* gtk_cell_area_get_preferred_width() requests.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
|
||||
@@ -576,6 +596,8 @@ gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
|
||||
* the request process over a series of `GtkTreeModel` rows to
|
||||
* progressively push the requested height over a series of
|
||||
* gtk_cell_area_get_preferred_height() requests.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_push_preferred_height (GtkCellAreaContext *context,
|
@@ -26,7 +26,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellarea.h>
|
||||
#include <gtk/deprecated/gtkcellarea.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -87,37 +87,37 @@ GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_area_context_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* Main apis */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellArea *gtk_cell_area_context_get_area (GtkCellAreaContext *context);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_allocate (GtkCellAreaContext *context,
|
||||
int width,
|
||||
int height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_reset (GtkCellAreaContext *context);
|
||||
|
||||
/* Apis for GtkCellArea clients to consult cached values
|
||||
* for a series of GtkTreeModel rows
|
||||
*/
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context,
|
||||
int *minimum_width,
|
||||
int *natural_width);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context,
|
||||
int *minimum_height,
|
||||
int *natural_height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_get_preferred_height_for_width (GtkCellAreaContext *context,
|
||||
int width,
|
||||
int *minimum_height,
|
||||
int *natural_height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *context,
|
||||
int height,
|
||||
int *minimum_width,
|
||||
int *natural_width);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
|
||||
int *width,
|
||||
int *height);
|
||||
@@ -125,11 +125,11 @@ void gtk_cell_area_context_get_allocation (GtkCellAreaCo
|
||||
/* Apis for GtkCellArea implementations to update cached values
|
||||
* for multiple GtkTreeModel rows
|
||||
*/
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
|
||||
int minimum_width,
|
||||
int natural_width);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_area_context_push_preferred_height (GtkCellAreaContext *context,
|
||||
int minimum_height,
|
||||
int natural_height);
|
@@ -23,6 +23,9 @@
|
||||
* The `GtkCellEditable` interface must be implemented for widgets to be usable
|
||||
* to edit the contents of a `GtkTreeView` cell. It provides a way to specify how
|
||||
* temporary widgets should be configured for editing, get the new value, etc.
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets for displaying their
|
||||
* contents. See [iface@Gtk.Editable] for editable text widgets
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -30,6 +33,7 @@
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
typedef GtkCellEditableIface GtkCellEditableInterface;
|
||||
G_DEFINE_INTERFACE(GtkCellEditable, gtk_cell_editable, GTK_TYPE_WIDGET)
|
||||
@@ -128,6 +132,8 @@ gtk_cell_editable_start_editing (GtkCellEditable *cell_editable,
|
||||
* @cell_editable: A `GtkCellEditable`
|
||||
*
|
||||
* Emits the `GtkCellEditable::editing-done` signal.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_editable_editing_done (GtkCellEditable *cell_editable)
|
||||
@@ -142,6 +148,8 @@ gtk_cell_editable_editing_done (GtkCellEditable *cell_editable)
|
||||
* @cell_editable: A `GtkCellEditable`
|
||||
*
|
||||
* Emits the `GtkCellEditable::remove-widget` signal.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_editable_remove_widget (GtkCellEditable *cell_editable)
|
@@ -62,12 +62,12 @@ struct _GtkCellEditableIface
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_editable_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_editable_start_editing (GtkCellEditable *cell_editable,
|
||||
GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_editable_editing_done (GtkCellEditable *cell_editable);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_editable_remove_widget (GtkCellEditable *cell_editable);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellEditable, g_object_unref)
|
@@ -24,7 +24,7 @@
|
||||
* want to provide a `GtkTreeViewColumn` like API for packing cells,
|
||||
* setting attributes and data funcs.
|
||||
*
|
||||
* One of the notable features provided by implementations of
|
||||
* One of the notable features provided by implementations of
|
||||
* `GtkCellLayout` are attributes. Attributes let you set the properties
|
||||
* in flexible ways. They can just be set to constant values like regular
|
||||
* properties. But they can also be mapped to a column of the underlying
|
||||
@@ -34,7 +34,7 @@
|
||||
* gtk_cell_layout_set_cell_data_func() that is called to determine the
|
||||
* value of the attribute for each cell that is rendered.
|
||||
*
|
||||
* # GtkCellLayouts as GtkBuildable
|
||||
* ## GtkCellLayouts as GtkBuildable
|
||||
*
|
||||
* Implementations of GtkCellLayout which also implement the GtkBuildable
|
||||
* interface (`GtkCellView`, `GtkIconView`, `GtkComboBox`,
|
||||
@@ -78,7 +78,7 @@
|
||||
* </object>
|
||||
* ```
|
||||
*
|
||||
* # Subclassing GtkCellLayout implementations
|
||||
* ## Subclassing GtkCellLayout implementations
|
||||
*
|
||||
* When subclassing a widget that implements `GtkCellLayout` like
|
||||
* `GtkIconView` or `GtkComboBox`, there are some considerations related
|
||||
@@ -126,6 +126,9 @@
|
||||
* to support alternative cell areas, you can do so by moving the
|
||||
* problematic calls out of `init()` and into a `constructor()`
|
||||
* for your class.
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets to display their contents.
|
||||
* See [class@Gtk.LayoutManager] for layout manager delegate objects
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -135,6 +138,8 @@
|
||||
#include "gtkcelllayout.h"
|
||||
#include "gtkbuilderprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
#define warn_no_cell_area(func) \
|
||||
g_critical ("%s: Called but no GtkCellArea is available yet", func)
|
||||
|
||||
@@ -279,8 +284,8 @@ gtk_cell_layout_default_set_cell_data_func (GtkCellLayout *cell_layout,
|
||||
area = iface->get_area (cell_layout);
|
||||
|
||||
if (area)
|
||||
_gtk_cell_area_set_cell_data_func_with_proxy (area, cell,
|
||||
(GFunc)func, func_data, destroy,
|
||||
_gtk_cell_area_set_cell_data_func_with_proxy (area, cell,
|
||||
(GFunc)func, func_data, destroy,
|
||||
cell_layout);
|
||||
else
|
||||
warn_no_cell_area ("GtkCellLayoutIface->set_cell_data_func()");
|
||||
@@ -360,6 +365,8 @@ gtk_cell_layout_default_get_cells (GtkCellLayout *cell_layout)
|
||||
* is divided evenly between cells for which @expand is %TRUE.
|
||||
*
|
||||
* Note that reusing the same cell renderer is not supported.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_pack_start (GtkCellLayout *cell_layout,
|
||||
@@ -383,6 +390,8 @@ gtk_cell_layout_pack_start (GtkCellLayout *cell_layout,
|
||||
* divided evenly between cells for which @expand is %TRUE.
|
||||
*
|
||||
* Note that reusing the same cell renderer is not supported.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_pack_end (GtkCellLayout *cell_layout,
|
||||
@@ -401,6 +410,8 @@ gtk_cell_layout_pack_end (GtkCellLayout *cell_layout,
|
||||
*
|
||||
* Unsets all the mappings on all renderers on @cell_layout and
|
||||
* removes all renderers from @cell_layout.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_clear (GtkCellLayout *cell_layout)
|
||||
@@ -438,7 +449,7 @@ gtk_cell_layout_set_attributesv (GtkCellLayout *cell_layout,
|
||||
* @cell: a `GtkCellRenderer`
|
||||
* @...: a %NULL-terminated list of attributes
|
||||
*
|
||||
* Sets the attributes in the parameter list as the attributes
|
||||
* Sets the attributes in the parameter list as the attributes
|
||||
* of @cell_layout.
|
||||
*
|
||||
* See [method@Gtk.CellLayout.add_attribute] for more details.
|
||||
@@ -446,6 +457,8 @@ gtk_cell_layout_set_attributesv (GtkCellLayout *cell_layout,
|
||||
* The attributes should be in attribute/column order, as in
|
||||
* gtk_cell_layout_add_attribute(). All existing attributes are
|
||||
* removed, and replaced with the new attributes.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout,
|
||||
@@ -476,6 +489,8 @@ gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout,
|
||||
* example if column 2 of the model contains strings, you could have the
|
||||
* “text” attribute of a `GtkCellRendererText` get its values from column 2.
|
||||
* In this context "attribute" and "property" are used interchangeably.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout,
|
||||
@@ -506,6 +521,8 @@ gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout,
|
||||
* cell renderer(s) as appropriate.
|
||||
*
|
||||
* @func may be %NULL to remove a previously set function.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
|
||||
@@ -517,7 +534,7 @@ gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
|
||||
g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
|
||||
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
|
||||
|
||||
GTK_CELL_LAYOUT_GET_IFACE
|
||||
GTK_CELL_LAYOUT_GET_IFACE
|
||||
(cell_layout)->set_cell_data_func (cell_layout, cell, func, func_data, destroy);
|
||||
}
|
||||
|
||||
@@ -528,6 +545,8 @@ gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
|
||||
*
|
||||
* Clears all existing attributes previously set with
|
||||
* gtk_cell_layout_set_attributes().
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout,
|
||||
@@ -549,6 +568,8 @@ gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout,
|
||||
*
|
||||
* Note that @cell has already to be packed into @cell_layout
|
||||
* for this to function properly.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_layout_reorder (GtkCellLayout *cell_layout,
|
||||
@@ -571,6 +592,8 @@ gtk_cell_layout_reorder (GtkCellLayout *cell_layout,
|
||||
* a list of cell renderers. The list, but not the renderers has
|
||||
* been newly allocated and should be freed with g_list_free()
|
||||
* when no longer needed.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GList *
|
||||
gtk_cell_layout_get_cells (GtkCellLayout *cell_layout)
|
||||
@@ -589,6 +612,8 @@ gtk_cell_layout_get_cells (GtkCellLayout *cell_layout)
|
||||
* is used by @cell_layout.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): the cell area used by @cell_layout
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellArea *
|
||||
gtk_cell_layout_get_area (GtkCellLayout *cell_layout)
|
||||
@@ -597,7 +622,7 @@ gtk_cell_layout_get_area (GtkCellLayout *cell_layout)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CELL_LAYOUT (cell_layout), NULL);
|
||||
|
||||
iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout);
|
||||
iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout);
|
||||
if (iface->get_area)
|
||||
return iface->get_area (cell_layout);
|
||||
|
@@ -22,8 +22,8 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellrenderer.h>
|
||||
#include <gtk/gtkcellarea.h>
|
||||
#include <gtk/deprecated/gtkcellrenderer.h>
|
||||
#include <gtk/deprecated/gtkcellarea.h>
|
||||
#include <gtk/gtkbuildable.h>
|
||||
#include <gtk/gtkbuilder.h>
|
||||
|
||||
@@ -110,41 +110,41 @@ struct _GtkCellLayoutIface
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_layout_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_pack_start (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
gboolean expand);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_pack_end (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
gboolean expand);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GList *gtk_cell_layout_get_cells (GtkCellLayout *cell_layout);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_clear (GtkCellLayout *cell_layout);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
const char *attribute,
|
||||
int column);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
GtkCellLayoutDataFunc func,
|
||||
gpointer func_data,
|
||||
GDestroyNotify destroy);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_layout_reorder (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
int position);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellArea *gtk_cell_layout_get_area (GtkCellLayout *cell_layout);
|
||||
|
||||
gboolean _gtk_cell_layout_buildable_custom_tag_start (GtkBuildable *buildable,
|
@@ -26,6 +26,8 @@
|
||||
#include "gtktreeprivate.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRenderer:
|
||||
*
|
||||
@@ -66,6 +68,9 @@
|
||||
* corresponding “set” property, e.g. “cell-background-set” corresponds
|
||||
* to “cell-background”. These “set” properties reflect whether a property
|
||||
* has been set or not. You should not set them independently.
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets for displaying their
|
||||
* contents
|
||||
*/
|
||||
|
||||
|
||||
@@ -211,7 +216,7 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
|
||||
*
|
||||
* This signal gets emitted when the user cancels the process of editing a
|
||||
* cell. For example, an editable cell renderer could be written to cancel
|
||||
* editing when the user presses Escape.
|
||||
* editing when the user presses Escape.
|
||||
*
|
||||
* See also: gtk_cell_renderer_stop_editing().
|
||||
*/
|
||||
@@ -249,12 +254,12 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
|
||||
* const char *path,
|
||||
* gpointer data)
|
||||
* {
|
||||
* if (GTK_IS_ENTRY (editable))
|
||||
* if (GTK_IS_ENTRY (editable))
|
||||
* {
|
||||
* GtkEntry *entry = GTK_ENTRY (editable);
|
||||
*
|
||||
*
|
||||
* // ... create a GtkEntryCompletion
|
||||
*
|
||||
*
|
||||
* gtk_entry_set_completion (entry, completion);
|
||||
* }
|
||||
* }
|
||||
@@ -626,7 +631,7 @@ set_cell_bg_color (GtkCellRenderer *cell,
|
||||
* @cell: a `GtkCellRenderer`
|
||||
* @snapshot: a `GtkSnapshot` to draw to
|
||||
* @widget: the widget owning @window
|
||||
* @background_area: entire cell area (including tree expanders and maybe
|
||||
* @background_area: entire cell area (including tree expanders and maybe
|
||||
* padding on the sides)
|
||||
* @cell_area: area normally rendered by a cell renderer
|
||||
* @flags: flags that affect rendering
|
||||
@@ -638,6 +643,8 @@ set_cell_bg_color (GtkCellRenderer *cell,
|
||||
* blank space around the cell, and also the area containing the tree expander;
|
||||
* so the @background_area rectangles for all cells tile to cover the entire
|
||||
* @window.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_snapshot (GtkCellRenderer *cell,
|
||||
@@ -711,6 +718,8 @@ gtk_cell_renderer_snapshot (GtkCellRenderer *cell,
|
||||
* toggles when it gets a mouse click.
|
||||
*
|
||||
* Returns: %TRUE if the event was consumed/handled
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
gboolean
|
||||
gtk_cell_renderer_activate (GtkCellRenderer *cell,
|
||||
@@ -758,6 +767,8 @@ gtk_cell_renderer_activate (GtkCellRenderer *cell,
|
||||
*
|
||||
* Returns: (nullable) (transfer none): A new `GtkCellEditable` for editing this
|
||||
* @cell, or %NULL if editing is not possible
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
GtkCellEditable *
|
||||
gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
|
||||
@@ -794,7 +805,7 @@ gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
|
||||
|
||||
gtk_widget_add_css_class (GTK_WIDGET (editable), "cell");
|
||||
|
||||
g_signal_emit (cell,
|
||||
g_signal_emit (cell,
|
||||
cell_renderer_signals[EDITING_STARTED], 0,
|
||||
editable, path);
|
||||
|
||||
@@ -810,6 +821,8 @@ gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
|
||||
* @height: the height of the cell renderer, or -1
|
||||
*
|
||||
* Sets the renderer size to be explicit, independent of the properties set.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,
|
||||
@@ -850,6 +863,8 @@ gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,
|
||||
* @height: (out) (optional): location to fill in with the fixed height of the cell
|
||||
*
|
||||
* Fills in @width and @height with the appropriate size of @cell.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,
|
||||
@@ -875,6 +890,8 @@ gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,
|
||||
* @yalign: the y alignment of the cell renderer
|
||||
*
|
||||
* Sets the renderer’s alignment within its available space.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_set_alignment (GtkCellRenderer *cell,
|
||||
@@ -916,6 +933,8 @@ gtk_cell_renderer_set_alignment (GtkCellRenderer *cell,
|
||||
* @yalign: (out) (optional): location to fill in with the y alignment of the cell
|
||||
*
|
||||
* Fills in @xalign and @yalign with the appropriate values of @cell.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_alignment (GtkCellRenderer *cell,
|
||||
@@ -941,6 +960,8 @@ gtk_cell_renderer_get_alignment (GtkCellRenderer *cell,
|
||||
* @ypad: the y padding of the cell renderer
|
||||
*
|
||||
* Sets the renderer’s padding.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_set_padding (GtkCellRenderer *cell,
|
||||
@@ -981,6 +1002,8 @@ gtk_cell_renderer_set_padding (GtkCellRenderer *cell,
|
||||
* @ypad: (out) (optional): location to fill in with the y padding of the cell
|
||||
*
|
||||
* Fills in @xpad and @ypad with the appropriate values of @cell.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_padding (GtkCellRenderer *cell,
|
||||
@@ -1005,6 +1028,8 @@ gtk_cell_renderer_get_padding (GtkCellRenderer *cell,
|
||||
* @visible: the visibility of the cell
|
||||
*
|
||||
* Sets the cell renderer’s visibility.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_set_visible (GtkCellRenderer *cell,
|
||||
@@ -1030,6 +1055,8 @@ gtk_cell_renderer_set_visible (GtkCellRenderer *cell,
|
||||
* Returns the cell renderer’s visibility.
|
||||
*
|
||||
* Returns: %TRUE if the cell renderer is visible
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_renderer_get_visible (GtkCellRenderer *cell)
|
||||
@@ -1045,6 +1072,8 @@ gtk_cell_renderer_get_visible (GtkCellRenderer *cell)
|
||||
* @sensitive: the sensitivity of the cell
|
||||
*
|
||||
* Sets the cell renderer’s sensitivity.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_set_sensitive (GtkCellRenderer *cell,
|
||||
@@ -1070,6 +1099,8 @@ gtk_cell_renderer_set_sensitive (GtkCellRenderer *cell,
|
||||
* Returns the cell renderer’s sensitivity.
|
||||
*
|
||||
* Returns: %TRUE if the cell renderer is sensitive
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell)
|
||||
@@ -1087,6 +1118,8 @@ gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell)
|
||||
* Checks whether the cell renderer can do something when activated.
|
||||
*
|
||||
* Returns: %TRUE if the cell renderer can do anything when activated
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_renderer_is_activatable (GtkCellRenderer *cell)
|
||||
@@ -1115,6 +1148,8 @@ gtk_cell_renderer_is_activatable (GtkCellRenderer *cell)
|
||||
* This function should be called by cell renderer implementations
|
||||
* in response to the `GtkCellEditable::editing-done` signal of
|
||||
* `GtkCellEditable`.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_stop_editing (GtkCellRenderer *cell,
|
||||
@@ -1164,7 +1199,7 @@ gtk_cell_renderer_real_get_preferred_size (GtkCellRenderer *cell,
|
||||
}
|
||||
}
|
||||
|
||||
static GtkSizeRequestMode
|
||||
static GtkSizeRequestMode
|
||||
gtk_cell_renderer_real_get_request_mode (GtkCellRenderer *cell)
|
||||
{
|
||||
/* By default cell renderers are height-for-width. */
|
||||
@@ -1177,7 +1212,7 @@ gtk_cell_renderer_real_get_preferred_width (GtkCellRenderer *cell,
|
||||
int *minimum_size,
|
||||
int *natural_size)
|
||||
{
|
||||
gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_HORIZONTAL,
|
||||
gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_HORIZONTAL,
|
||||
minimum_size, natural_size);
|
||||
}
|
||||
|
||||
@@ -1187,7 +1222,7 @@ gtk_cell_renderer_real_get_preferred_height (GtkCellRenderer *cell,
|
||||
int *minimum_size,
|
||||
int *natural_size)
|
||||
{
|
||||
gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_VERTICAL,
|
||||
gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_VERTICAL,
|
||||
minimum_size, natural_size);
|
||||
}
|
||||
|
||||
@@ -1236,35 +1271,35 @@ gtk_cell_renderer_real_get_aligned_area (GtkCellRenderer *cell,
|
||||
/* Trim up the aligned size */
|
||||
if (gtk_cell_renderer_get_request_mode (cell) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
|
||||
{
|
||||
gtk_cell_renderer_get_preferred_width (cell, widget,
|
||||
gtk_cell_renderer_get_preferred_width (cell, widget,
|
||||
NULL, &natural_size);
|
||||
|
||||
aligned_area->width = MIN (aligned_area->width, natural_size);
|
||||
|
||||
gtk_cell_renderer_get_preferred_height_for_width (cell, widget,
|
||||
aligned_area->width,
|
||||
gtk_cell_renderer_get_preferred_height_for_width (cell, widget,
|
||||
aligned_area->width,
|
||||
NULL, &opposite_size);
|
||||
|
||||
aligned_area->height = MIN (opposite_size, aligned_area->height);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_cell_renderer_get_preferred_height (cell, widget,
|
||||
gtk_cell_renderer_get_preferred_height (cell, widget,
|
||||
NULL, &natural_size);
|
||||
|
||||
aligned_area->height = MIN (aligned_area->width, natural_size);
|
||||
|
||||
gtk_cell_renderer_get_preferred_width_for_height (cell, widget,
|
||||
aligned_area->height,
|
||||
gtk_cell_renderer_get_preferred_width_for_height (cell, widget,
|
||||
aligned_area->height,
|
||||
NULL, &opposite_size);
|
||||
|
||||
aligned_area->width = MIN (opposite_size, aligned_area->width);
|
||||
}
|
||||
|
||||
/* offset the cell position */
|
||||
_gtk_cell_renderer_calc_offset (cell, cell_area,
|
||||
_gtk_cell_renderer_calc_offset (cell, cell_area,
|
||||
gtk_widget_get_direction (widget),
|
||||
aligned_area->width,
|
||||
aligned_area->width,
|
||||
aligned_area->height,
|
||||
&x_offset, &y_offset);
|
||||
|
||||
@@ -1287,7 +1322,7 @@ _gtk_cell_renderer_calc_offset (GtkCellRenderer *cell,
|
||||
int height,
|
||||
int *x_offset,
|
||||
int *y_offset)
|
||||
{
|
||||
{
|
||||
GtkCellRendererPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
|
||||
@@ -1299,7 +1334,7 @@ _gtk_cell_renderer_calc_offset (GtkCellRenderer *cell,
|
||||
if (x_offset)
|
||||
{
|
||||
*x_offset = (((direction == GTK_TEXT_DIR_RTL) ?
|
||||
(1.0 - priv->xalign) : priv->xalign) *
|
||||
(1.0 - priv->xalign) : priv->xalign) *
|
||||
(cell_area->width - width));
|
||||
*x_offset = MAX (*x_offset, 0);
|
||||
}
|
||||
@@ -1319,6 +1354,8 @@ _gtk_cell_renderer_calc_offset (GtkCellRenderer *cell,
|
||||
* or a width-for-height layout.
|
||||
*
|
||||
* Returns: The `GtkSizeRequestMode` preferred by this renderer.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkSizeRequestMode
|
||||
gtk_cell_renderer_get_request_mode (GtkCellRenderer *cell)
|
||||
@@ -1336,6 +1373,8 @@ gtk_cell_renderer_get_request_mode (GtkCellRenderer *cell)
|
||||
* @natural_size: (out) (optional): location to store the natural size
|
||||
*
|
||||
* Retrieves a renderer’s natural size when rendered to @widget.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_preferred_width (GtkCellRenderer *cell,
|
||||
@@ -1367,8 +1406,8 @@ gtk_cell_renderer_get_preferred_width (GtkCellRenderer *cell,
|
||||
|
||||
#if DEBUG_CELL_SIZE_REQUEST
|
||||
g_message ("%s returning minimum width: %d and natural width: %d",
|
||||
G_OBJECT_TYPE_NAME (cell),
|
||||
minimum_size ? *minimum_size : 20000,
|
||||
G_OBJECT_TYPE_NAME (cell),
|
||||
minimum_size ? *minimum_size : 20000,
|
||||
natural_size ? *natural_size : 20000);
|
||||
#endif
|
||||
}
|
||||
@@ -1382,6 +1421,8 @@ gtk_cell_renderer_get_preferred_width (GtkCellRenderer *cell,
|
||||
* @natural_size: (out) (optional): location to store the natural size
|
||||
*
|
||||
* Retrieves a renderer’s natural size when rendered to @widget.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_preferred_height (GtkCellRenderer *cell,
|
||||
@@ -1413,8 +1454,8 @@ gtk_cell_renderer_get_preferred_height (GtkCellRenderer *cell,
|
||||
|
||||
#if DEBUG_CELL_SIZE_REQUEST
|
||||
g_message ("%s returning minimum height: %d and natural height: %d",
|
||||
G_OBJECT_TYPE_NAME (cell),
|
||||
minimum_size ? *minimum_size : 20000,
|
||||
G_OBJECT_TYPE_NAME (cell),
|
||||
minimum_size ? *minimum_size : 20000,
|
||||
natural_size ? *natural_size : 20000);
|
||||
#endif
|
||||
}
|
||||
@@ -1428,8 +1469,10 @@ gtk_cell_renderer_get_preferred_height (GtkCellRenderer *cell,
|
||||
* @minimum_width: (out) (optional): location for storing the minimum size
|
||||
* @natural_width: (out) (optional): location for storing the preferred size
|
||||
*
|
||||
* Retrieves a cell renderers’s minimum and natural width if it were rendered to
|
||||
* Retrieves a cell renderers’s minimum and natural width if it were rendered to
|
||||
* @widget with the specified @height.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_preferred_width_for_height (GtkCellRenderer *cell,
|
||||
@@ -1463,7 +1506,7 @@ gtk_cell_renderer_get_preferred_width_for_height (GtkCellRenderer *cell,
|
||||
#if DEBUG_CELL_SIZE_REQUEST
|
||||
g_message ("%s width for height: %d is minimum %d and natural: %d",
|
||||
G_OBJECT_TYPE_NAME (cell), height,
|
||||
minimum_width ? *minimum_width : 20000,
|
||||
minimum_width ? *minimum_width : 20000,
|
||||
natural_width ? *natural_width : 20000);
|
||||
#endif
|
||||
}
|
||||
@@ -1476,8 +1519,10 @@ gtk_cell_renderer_get_preferred_width_for_height (GtkCellRenderer *cell,
|
||||
* @minimum_height: (out) (optional): location for storing the minimum size
|
||||
* @natural_height: (out) (optional): location for storing the preferred size
|
||||
*
|
||||
* Retrieves a cell renderers’s minimum and natural height if it were rendered to
|
||||
* Retrieves a cell renderers’s minimum and natural height if it were rendered to
|
||||
* @widget with the specified @width.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_preferred_height_for_width (GtkCellRenderer *cell,
|
||||
@@ -1511,7 +1556,7 @@ gtk_cell_renderer_get_preferred_height_for_width (GtkCellRenderer *cell,
|
||||
#if DEBUG_CELL_SIZE_REQUEST
|
||||
g_message ("%s height for width: %d is minimum %d and natural: %d",
|
||||
G_OBJECT_TYPE_NAME (cell), width,
|
||||
minimum_height ? *minimum_height : 20000,
|
||||
minimum_height ? *minimum_height : 20000,
|
||||
natural_height ? *natural_height : 20000);
|
||||
#endif
|
||||
}
|
||||
@@ -1525,6 +1570,8 @@ gtk_cell_renderer_get_preferred_height_for_width (GtkCellRenderer *cell,
|
||||
*
|
||||
* Retrieves the minimum and natural size of a cell taking
|
||||
* into account the widget’s preference for height-for-width management.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_preferred_size (GtkCellRenderer *cell,
|
||||
@@ -1586,6 +1633,8 @@ gtk_cell_renderer_get_preferred_size (GtkCellRenderer *cell,
|
||||
*
|
||||
* Gets the aligned area used by @cell inside @cell_area. Used for finding
|
||||
* the appropriate edit and focus rectangle.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_get_aligned_area (GtkCellRenderer *cell,
|
||||
@@ -1621,6 +1670,8 @@ gtk_cell_renderer_get_aligned_area (GtkCellRenderer *cell,
|
||||
* the given `GtkCellRenderer`State.
|
||||
*
|
||||
* Returns: the widget state flags applying to @cell
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
GtkStateFlags
|
||||
gtk_cell_renderer_get_state (GtkCellRenderer *cell,
|
||||
@@ -1665,6 +1716,8 @@ gtk_cell_renderer_get_state (GtkCellRenderer *cell,
|
||||
* @is_expander: whether @cell is an expander
|
||||
*
|
||||
* Sets whether the given `GtkCellRenderer` is an expander.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_set_is_expander (GtkCellRenderer *cell,
|
||||
@@ -1691,6 +1744,8 @@ gtk_cell_renderer_set_is_expander (GtkCellRenderer *cell,
|
||||
* Checks whether the given `GtkCellRenderer` is an expander.
|
||||
*
|
||||
* Returns: %TRUE if @cell is an expander, and %FALSE otherwise
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_renderer_get_is_expander (GtkCellRenderer *cell)
|
||||
@@ -1708,6 +1763,8 @@ gtk_cell_renderer_get_is_expander (GtkCellRenderer *cell)
|
||||
* @is_expanded: whether @cell should be expanded
|
||||
*
|
||||
* Sets whether the given `GtkCellRenderer` is expanded.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
void
|
||||
gtk_cell_renderer_set_is_expanded (GtkCellRenderer *cell,
|
||||
@@ -1734,6 +1791,8 @@ gtk_cell_renderer_set_is_expanded (GtkCellRenderer *cell,
|
||||
* Checks whether the given `GtkCellRenderer` is expanded.
|
||||
*
|
||||
* Returns: %TRUE if the cell renderer is expanded
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
gboolean
|
||||
gtk_cell_renderer_get_is_expanded (GtkCellRenderer *cell)
|
@@ -22,7 +22,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcelleditable.h>
|
||||
#include <gtk/deprecated/gtkcelleditable.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -171,49 +171,49 @@ struct _GtkCellRendererClass
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_renderer_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkSizeRequestMode gtk_cell_renderer_get_request_mode (GtkCellRenderer *cell);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_preferred_width (GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
int *minimum_size,
|
||||
int *natural_size);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_preferred_height_for_width (GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
int width,
|
||||
int *minimum_height,
|
||||
int *natural_height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_preferred_height (GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
int *minimum_size,
|
||||
int *natural_size);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_preferred_width_for_height (GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
int height,
|
||||
int *minimum_width,
|
||||
int *natural_width);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_preferred_size (GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
GtkRequisition *minimum_size,
|
||||
GtkRequisition *natural_size);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_aligned_area (GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
GtkCellRendererState flags,
|
||||
const GdkRectangle *cell_area,
|
||||
GdkRectangle *aligned_area);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_snapshot (GtkCellRenderer *cell,
|
||||
GtkSnapshot *snapshot,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *background_area,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_renderer_activate (GtkCellRenderer *cell,
|
||||
GdkEvent *event,
|
||||
GtkWidget *widget,
|
||||
@@ -221,7 +221,7 @@ gboolean gtk_cell_renderer_activate (GtkCellRenderer *cell,
|
||||
const GdkRectangle *background_area,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellEditable *gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
|
||||
GdkEvent *event,
|
||||
GtkWidget *widget,
|
||||
@@ -230,65 +230,65 @@ GtkCellEditable *gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,
|
||||
int width,
|
||||
int height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_set_alignment (GtkCellRenderer *cell,
|
||||
float xalign,
|
||||
float yalign);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_alignment (GtkCellRenderer *cell,
|
||||
float *xalign,
|
||||
float *yalign);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_set_padding (GtkCellRenderer *cell,
|
||||
int xpad,
|
||||
int ypad);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_get_padding (GtkCellRenderer *cell,
|
||||
int *xpad,
|
||||
int *ypad);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_set_visible (GtkCellRenderer *cell,
|
||||
gboolean visible);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_renderer_get_visible (GtkCellRenderer *cell);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_set_sensitive (GtkCellRenderer *cell,
|
||||
gboolean sensitive);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_renderer_is_activatable (GtkCellRenderer *cell);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_set_is_expander (GtkCellRenderer *cell,
|
||||
gboolean is_expander);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_renderer_get_is_expander (GtkCellRenderer *cell);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_set_is_expanded (GtkCellRenderer *cell,
|
||||
gboolean is_expanded);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
gboolean gtk_cell_renderer_get_is_expanded (GtkCellRenderer *cell);
|
||||
|
||||
|
||||
|
||||
|
||||
/* For use by cell renderer implementations only */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
void gtk_cell_renderer_stop_editing (GtkCellRenderer *cell,
|
||||
gboolean canceled);
|
||||
|
||||
@@ -301,7 +301,7 @@ void _gtk_cell_renderer_calc_offset (GtkCellRenderer *cell,
|
||||
int *x_offset,
|
||||
int *y_offset);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkStateFlags gtk_cell_renderer_get_state (GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
GtkCellRendererState cell_state);
|
@@ -31,6 +31,7 @@
|
||||
#include "gtknative.h"
|
||||
#include "gtkbinlayout.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRendererAccel:
|
||||
@@ -40,6 +41,10 @@
|
||||
* `GtkCellRendererAccel` displays a keyboard accelerator (i.e. a key
|
||||
* combination like `Control + a`). If the cell renderer is editable,
|
||||
* the accelerator can be changed by simply typing the new combination.
|
||||
*
|
||||
* Deprecated: 4.10: Applications editing keyboard accelerators should
|
||||
* provide their own implementation according to platform design
|
||||
* guidelines
|
||||
*/
|
||||
|
||||
|
||||
@@ -51,7 +56,7 @@ static void gtk_cell_renderer_accel_set_property (GObject *object,
|
||||
guint param_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_cell_renderer_accel_get_preferred_width
|
||||
static void gtk_cell_renderer_accel_get_preferred_width
|
||||
(GtkCellRenderer *cell,
|
||||
GtkWidget *widget,
|
||||
int *minimum_size,
|
||||
@@ -176,7 +181,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class)
|
||||
G_MAXINT,
|
||||
0,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
|
||||
/**
|
||||
* GtkCellRendererAccel:accel-mods:
|
||||
*
|
||||
@@ -195,7 +200,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class)
|
||||
* The hardware keycode of the accelerator. Note that the hardware keycode is
|
||||
* only relevant if the key does not have a keyval. Normally, the keyboard
|
||||
* configuration should assign keyvals to all keys.
|
||||
*/
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_KEYCODE,
|
||||
g_param_spec_uint ("keycode", NULL, NULL,
|
||||
@@ -218,7 +223,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class)
|
||||
GTK_TYPE_CELL_RENDERER_ACCEL_MODE,
|
||||
GTK_CELL_RENDERER_ACCEL_MODE_GTK,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
|
||||
/**
|
||||
* GtkCellRendererAccel::accel-edited:
|
||||
* @accel: the object reveiving the signal
|
||||
@@ -263,8 +268,10 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class)
|
||||
* gtk_cell_renderer_accel_new:
|
||||
*
|
||||
* Creates a new `GtkCellRendererAccel`.
|
||||
*
|
||||
*
|
||||
* Returns: the new cell renderer
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_renderer_accel_new (void)
|
||||
@@ -285,7 +292,7 @@ convert_keysym_state_to_string (GtkCellRendererAccel *accel,
|
||||
* a disabled accelerator key combination.
|
||||
*/
|
||||
return g_strdup (C_("Accelerator", "Disabled"));
|
||||
else
|
||||
else
|
||||
{
|
||||
if (priv->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK)
|
||||
{
|
||||
@@ -298,7 +305,7 @@ convert_keysym_state_to_string (GtkCellRendererAccel *accel,
|
||||
|
||||
return gtk_accelerator_get_label (keysym, mask);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
char *name;
|
||||
|
||||
@@ -399,7 +406,7 @@ gtk_cell_renderer_accel_set_property (GObject *object,
|
||||
g_object_notify (object, "accel-mode");
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
@@ -534,7 +541,7 @@ key_controller_key_pressed (GtkEventControllerKey *key,
|
||||
event = gtk_event_controller_get_current_event (GTK_EVENT_CONTROLLER (key));
|
||||
if (!gdk_key_event_get_match (event, &accel_key, &accel_mods))
|
||||
return FALSE;
|
||||
|
||||
|
||||
if (accel_mods == 0)
|
||||
{
|
||||
switch (keyval)
|
||||
@@ -576,8 +583,8 @@ static void
|
||||
gtk_cell_editable_widget_unrealize (GtkWidget *widget)
|
||||
{
|
||||
gtk_grab_remove (widget);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_cell_editable_widget_parent_class)->unrealize (widget);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_cell_editable_widget_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static void
|
@@ -22,7 +22,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellrenderertext.h>
|
||||
#include <gtk/deprecated/gtkcellrenderertext.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -48,7 +48,7 @@ typedef enum
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_renderer_accel_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_renderer_accel_new (void);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererAccel, g_object_unref)
|
@@ -19,13 +19,14 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "gtkentry.h"
|
||||
#include "gtkcelllayout.h"
|
||||
#include "deprecated/gtkcelllayout.h"
|
||||
#include "gtkcellrenderercombo.h"
|
||||
#include "gtkcellrenderertext.h"
|
||||
#include "gtkcombobox.h"
|
||||
#include "deprecated/gtkcellrenderertext.h"
|
||||
#include "deprecated/gtkcombobox.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRendererCombo:
|
||||
@@ -42,6 +43,9 @@
|
||||
* box and sets it to display the column specified by its
|
||||
* `GtkCellRendererCombo`:text-column property. Further properties of the combo box
|
||||
* can be set in a handler for the `GtkCellRenderer::editing-started` signal.
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets to display their contents. You
|
||||
* should use [class@Gtk.DropDown] instead
|
||||
*/
|
||||
|
||||
typedef struct _GtkCellRendererComboPrivate GtkCellRendererComboPrivate;
|
||||
@@ -124,7 +128,7 @@ gtk_cell_renderer_combo_class_init (GtkCellRendererComboClass *klass)
|
||||
/**
|
||||
* GtkCellRendererCombo:model:
|
||||
*
|
||||
* Holds a tree model containing the possible values for the combo box.
|
||||
* Holds a tree model containing the possible values for the combo box.
|
||||
* Use the text_column property to specify the column holding the values.
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
@@ -136,14 +140,14 @@ gtk_cell_renderer_combo_class_init (GtkCellRendererComboClass *klass)
|
||||
/**
|
||||
* GtkCellRendererCombo:text-column:
|
||||
*
|
||||
* Specifies the model column which holds the possible values for the
|
||||
* combo box.
|
||||
* Specifies the model column which holds the possible values for the
|
||||
* combo box.
|
||||
*
|
||||
* Note that this refers to the model specified in the model property,
|
||||
* not the model backing the tree view to which
|
||||
* Note that this refers to the model specified in the model property,
|
||||
* not the model backing the tree view to which
|
||||
* this cell renderer is attached.
|
||||
*
|
||||
* `GtkCellRendererCombo` automatically adds a text cell renderer for
|
||||
*
|
||||
* `GtkCellRendererCombo` automatically adds a text cell renderer for
|
||||
* this column to its combo box.
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
@@ -154,11 +158,11 @@ gtk_cell_renderer_combo_class_init (GtkCellRendererComboClass *klass)
|
||||
-1,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
/**
|
||||
/**
|
||||
* GtkCellRendererCombo:has-entry:
|
||||
*
|
||||
* If %TRUE, the cell renderer will include an entry and allow to enter
|
||||
* values other than the ones in the popup list.
|
||||
* If %TRUE, the cell renderer will include an entry and allow to enter
|
||||
* values other than the ones in the popup list.
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_HAS_ENTRY,
|
||||
@@ -225,11 +229,13 @@ gtk_cell_renderer_combo_init (GtkCellRendererCombo *self)
|
||||
* a different string in each row of the `GtkTreeView`.
|
||||
*
|
||||
* Returns: the new cell renderer
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_renderer_combo_new (void)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_CELL_RENDERER_COMBO, NULL);
|
||||
return g_object_new (GTK_TYPE_CELL_RENDERER_COMBO, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -237,13 +243,13 @@ gtk_cell_renderer_combo_finalize (GObject *object)
|
||||
{
|
||||
GtkCellRendererCombo *cell = GTK_CELL_RENDERER_COMBO (object);
|
||||
GtkCellRendererComboPrivate *priv = gtk_cell_renderer_combo_get_instance_private (cell);
|
||||
|
||||
|
||||
if (priv->model)
|
||||
{
|
||||
g_object_unref (priv->model);
|
||||
priv->model = NULL;
|
||||
}
|
||||
|
||||
|
||||
G_OBJECT_CLASS (gtk_cell_renderer_combo_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -260,7 +266,7 @@ gtk_cell_renderer_combo_get_property (GObject *object,
|
||||
{
|
||||
case PROP_MODEL:
|
||||
g_value_set_object (value, priv->model);
|
||||
break;
|
||||
break;
|
||||
case PROP_TEXT_COLUMN:
|
||||
g_value_set_int (value, priv->text_column);
|
||||
break;
|
||||
@@ -366,7 +372,7 @@ gtk_cell_renderer_combo_editing_done (GtkCellEditable *combo,
|
||||
entry = GTK_ENTRY (gtk_combo_box_get_child (GTK_COMBO_BOX (combo)));
|
||||
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
|
||||
|
||||
@@ -392,17 +398,17 @@ gtk_cell_renderer_combo_focus_change (GtkWidget *widget,
|
||||
gtk_cell_renderer_combo_editing_done (GTK_CELL_EDITABLE (widget), data);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
GtkCellRendererCombo *cell;
|
||||
gboolean found;
|
||||
GtkTreeIter iter;
|
||||
} SearchData;
|
||||
|
||||
static gboolean
|
||||
find_text (GtkTreeModel *model,
|
||||
GtkTreePath *path,
|
||||
GtkTreeIter *iter,
|
||||
static gboolean
|
||||
find_text (GtkTreeModel *model,
|
||||
GtkTreePath *path,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
SearchData *search_data = (SearchData *)data;
|
||||
@@ -421,7 +427,7 @@ find_text (GtkTreeModel *model,
|
||||
|
||||
g_free (cell_text);
|
||||
g_free (text);
|
||||
|
||||
|
||||
return search_data->found;
|
||||
}
|
||||
|
||||
@@ -471,7 +477,7 @@ gtk_cell_renderer_combo_start_editing (GtkCellRenderer *cell,
|
||||
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), priv->model);
|
||||
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
|
||||
cell, "text", priv->text_column,
|
||||
NULL);
|
||||
|
@@ -22,8 +22,8 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtktreemodel.h>
|
||||
#include <gtk/gtkcellrenderertext.h>
|
||||
#include <gtk/deprecated/gtktreemodel.h>
|
||||
#include <gtk/deprecated/gtkcellrenderertext.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct _GtkCellRendererCombo GtkCellRendererCombo;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_renderer_combo_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_renderer_combo_new (void);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererCombo, g_object_unref)
|
@@ -29,6 +29,8 @@
|
||||
#include <cairo-gobject.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRendererPixbuf:
|
||||
*
|
||||
@@ -46,6 +48,9 @@
|
||||
* renders that pixbuf, if the `GtkCellRenderer:is-expanded` property is %FALSE
|
||||
* and the `GtkCellRendererPixbuf:pixbuf-expander-closed` property is set to a
|
||||
* pixbuf, it renders that one.
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets to display their contents. You
|
||||
* should use [class@Gtk.Image] for icons, and [class@Gtk.Picture] for images
|
||||
*/
|
||||
|
||||
|
||||
@@ -319,13 +324,13 @@ take_image_definition (GtkCellRendererPixbuf *cellpixbuf,
|
||||
{
|
||||
GtkCellRendererPixbufPrivate *priv = gtk_cell_renderer_pixbuf_get_instance_private (cellpixbuf);
|
||||
GtkImageType old_storage_type, new_storage_type;
|
||||
|
||||
|
||||
if (def == NULL)
|
||||
def = gtk_image_definition_new_empty ();
|
||||
|
||||
old_storage_type = gtk_image_definition_get_storage_type (priv->image_def);
|
||||
new_storage_type = gtk_image_definition_get_storage_type (def);
|
||||
|
||||
|
||||
if (new_storage_type != old_storage_type)
|
||||
notify_storage_type (cellpixbuf, old_storage_type);
|
||||
|
||||
@@ -399,7 +404,7 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
|
||||
/**
|
||||
* gtk_cell_renderer_pixbuf_new:
|
||||
*
|
||||
*
|
||||
* Creates a new `GtkCellRendererPixbuf`. Adjust rendering
|
||||
* parameters using object properties. Object properties can be set
|
||||
* globally (with g_object_set()). Also, with `GtkTreeViewColumn`, you
|
||||
@@ -407,8 +412,10 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
* can bind the “pixbuf” property on the cell renderer to a pixbuf value
|
||||
* in the model, thus rendering a different image in each row of the
|
||||
* `GtkTreeView`.
|
||||
*
|
||||
*
|
||||
* Returns: the new cell renderer
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_renderer_pixbuf_new (void)
|
||||
@@ -465,7 +472,7 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRendererPixbuf *self,
|
||||
pixbuf_height = gdk_paintable_get_intrinsic_height (paintable);
|
||||
}
|
||||
else
|
||||
pixbuf_width = pixbuf_height = gtk_icon_helper_get_size (icon_helper);
|
||||
pixbuf_width = pixbuf_height = gtk_icon_helper_get_size (icon_helper);
|
||||
|
||||
g_object_unref (icon_helper);
|
||||
gtk_style_context_restore (context);
|
||||
@@ -484,7 +491,7 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRendererPixbuf *self,
|
||||
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
|
||||
calc_width = (int) xpad * 2 + pixbuf_width;
|
||||
calc_height = (int) ypad * 2 + pixbuf_height;
|
||||
|
||||
|
||||
if (cell_area && pixbuf_width > 0 && pixbuf_height > 0)
|
||||
{
|
||||
float xalign, yalign;
|
||||
@@ -512,7 +519,7 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRendererPixbuf *self,
|
||||
|
||||
if (width)
|
||||
*width = calc_width;
|
||||
|
||||
|
||||
if (height)
|
||||
*height = calc_height;
|
||||
}
|
||||
@@ -536,7 +543,7 @@ gtk_cell_renderer_pixbuf_snapshot (GtkCellRenderer *cell,
|
||||
|
||||
gtk_cell_renderer_pixbuf_get_size (cellpixbuf, widget,
|
||||
cell_area,
|
||||
&pix_rect.x,
|
||||
&pix_rect.x,
|
||||
&pix_rect.y,
|
||||
&pix_rect.width,
|
||||
&pix_rect.height);
|
@@ -22,7 +22,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellrenderer.h>
|
||||
#include <gtk/deprecated/gtkcellrenderer.h>
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
@@ -36,7 +36,7 @@ typedef struct _GtkCellRendererPixbuf GtkCellRendererPixbuf;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_renderer_pixbuf_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_renderer_pixbuf_new (void);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererPixbuf, g_object_unref)
|
@@ -30,9 +30,10 @@
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include "gtkorientable.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtksnapshot.h"
|
||||
#include "deprecated/gtkrender.h"
|
||||
#include "gtkstylecontext.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRendererProgress:
|
||||
@@ -41,6 +42,9 @@
|
||||
*
|
||||
* `GtkCellRendererProgress` renders a numeric value as a progress par in a cell.
|
||||
* Additionally, it can display a text on top of the progress bar.
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets to display their contents.
|
||||
* You should use [class@Gtk.ProgressBar] instead
|
||||
*/
|
||||
|
||||
|
||||
@@ -718,6 +722,8 @@ gtk_cell_renderer_progress_init (GtkCellRendererProgress *cellprogress)
|
||||
* Creates a new `GtkCellRendererProgress`.
|
||||
*
|
||||
* Returns: the new cell renderer
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
GtkCellRenderer*
|
||||
gtk_cell_renderer_progress_new (void)
|
@@ -30,7 +30,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellrenderer.h>
|
||||
#include <gtk/deprecated/gtkcellrenderer.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -42,7 +42,7 @@ typedef struct _GtkCellRendererProgress GtkCellRendererProgress;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_renderer_progress_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer* gtk_cell_renderer_progress_new (void);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererProgress, g_object_unref)
|
@@ -28,6 +28,7 @@
|
||||
#include "gtkentry.h"
|
||||
#include "gtkeventcontrollerkey.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRendererSpin:
|
||||
@@ -46,7 +47,8 @@
|
||||
* of `GtkCellRendererSpin:digits` to display. Other `GtkSpinButton` properties
|
||||
* can be set in a handler for the `GtkCellRenderer::editing-started` signal.
|
||||
*
|
||||
* The `GtkCellRendererSpin` cell renderer was added in GTK 2.10.
|
||||
* Deprecated: 4.10: List views use widgets to display their contents.
|
||||
* You should use [class@Gtk.SpinButton] instead
|
||||
*/
|
||||
|
||||
typedef struct _GtkCellRendererSpinClass GtkCellRendererSpinClass;
|
||||
@@ -121,7 +123,7 @@ gtk_cell_renderer_spin_class_init (GtkCellRendererSpinClass *klass)
|
||||
/**
|
||||
* GtkCellRendererSpin:adjustment:
|
||||
*
|
||||
* The adjustment that holds the value of the spinbutton.
|
||||
* The adjustment that holds the value of the spinbutton.
|
||||
* This must be non-%NULL for the cell renderer to be editable.
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
@@ -140,7 +142,7 @@ gtk_cell_renderer_spin_class_init (GtkCellRendererSpinClass *klass)
|
||||
PROP_CLIMB_RATE,
|
||||
g_param_spec_double ("climb-rate", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
GTK_PARAM_READWRITE));
|
||||
GTK_PARAM_READWRITE));
|
||||
/**
|
||||
* GtkCellRendererSpin:digits:
|
||||
*
|
||||
@@ -150,7 +152,7 @@ gtk_cell_renderer_spin_class_init (GtkCellRendererSpinClass *klass)
|
||||
PROP_DIGITS,
|
||||
g_param_spec_uint ("digits", NULL, NULL,
|
||||
0, 20, 0,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -365,9 +367,11 @@ gtk_cell_renderer_spin_start_editing (GtkCellRenderer *cell,
|
||||
/**
|
||||
* gtk_cell_renderer_spin_new:
|
||||
*
|
||||
* Creates a new `GtkCellRendererSpin`.
|
||||
* Creates a new `GtkCellRendererSpin`.
|
||||
*
|
||||
* Returns: a new `GtkCellRendererSpin`
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_renderer_spin_new (void)
|
@@ -22,7 +22,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellrenderertext.h>
|
||||
#include <gtk/deprecated/gtkcellrenderertext.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef struct _GtkCellRendererSpin GtkCellRendererSpin;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_renderer_spin_get_type (void);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_renderer_spin_new (void);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererSpin, g_object_unref)
|
@@ -37,6 +37,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRendererSpinner:
|
||||
*
|
||||
@@ -52,6 +54,9 @@
|
||||
* at regular intervals. The usual way to set the cell renderer properties
|
||||
* for each cell is to bind them to columns in your tree model using e.g.
|
||||
* gtk_tree_view_column_add_attribute().
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets to display their contents.
|
||||
* You should use [class@Gtk.Spinner] instead
|
||||
*/
|
||||
|
||||
|
||||
@@ -223,6 +228,8 @@ gtk_cell_renderer_spinner_init (GtkCellRendererSpinner *cell)
|
||||
* activity.
|
||||
*
|
||||
* Returns: a new `GtkCellRenderer`
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
*/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_renderer_spinner_new (void)
|
@@ -25,7 +25,7 @@
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcellrenderer.h>
|
||||
#include <gtk/deprecated/gtkcellrenderer.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef struct _GtkCellRendererSpinner GtkCellRendererSpinner;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_cell_renderer_spinner_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_10
|
||||
GtkCellRenderer *gtk_cell_renderer_spinner_new (void);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererSpinner, g_object_unref)
|
@@ -26,12 +26,14 @@
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtksizerequest.h"
|
||||
#include "gtksnapshot.h"
|
||||
#include "deprecated/gtkrender.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtktreeprivate.h"
|
||||
#include "deprecated/gtktreeprivate.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/**
|
||||
* GtkCellRendererText:
|
||||
*
|
||||
@@ -43,6 +45,9 @@
|
||||
*
|
||||
* If the `GtkCellRenderer:mode` is %GTK_CELL_RENDERER_MODE_EDITABLE,
|
||||
* the `GtkCellRendererText` allows to edit its text using an entry.
|
||||
*
|
||||
* Deprecated: 4.10: List views use widgets to display their contents.
|
||||
* You should use [class@Gtk.Inscription] or [class@Gtk.Label] instead
|
||||
*/
|
||||
|
||||
|
||||
@@ -236,7 +241,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
|
||||
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
|
||||
|
||||
object_class->finalize = gtk_cell_renderer_text_finalize;
|
||||
|
||||
|
||||
object_class->get_property = gtk_cell_renderer_text_get_property;
|
||||
object_class->set_property = gtk_cell_renderer_text_set_property;
|
||||
|
||||
@@ -621,7 +626,7 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
case PROP_FONT:
|
||||
g_value_take_string (value, pango_font_description_to_string (priv->font));
|
||||
break;
|
||||
|
||||
|
||||
case PROP_FONT_DESC:
|
||||
g_value_set_boxed (value, priv->font);
|
||||
break;
|
||||
@@ -657,7 +662,7 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
case PROP_SCALE:
|
||||
g_value_set_double (value, priv->font_scale);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_EDITABLE:
|
||||
g_value_set_boolean (value, priv->editable);
|
||||
break;
|
||||
@@ -672,7 +677,7 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
|
||||
case PROP_RISE:
|
||||
g_value_set_int (value, priv->rise);
|
||||
break;
|
||||
break;
|
||||
|
||||
case PROP_LANGUAGE:
|
||||
g_value_set_static_string (value, pango_language_to_string (priv->language));
|
||||
@@ -681,7 +686,7 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
case PROP_ELLIPSIZE:
|
||||
g_value_set_enum (value, priv->ellipsize);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_WRAP_MODE:
|
||||
g_value_set_enum (value, priv->wrap_mode);
|
||||
break;
|
||||
@@ -689,7 +694,7 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
case PROP_WRAP_WIDTH:
|
||||
g_value_set_int (value, priv->wrap_width);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_ALIGN:
|
||||
g_value_set_enum (value, priv->align);
|
||||
break;
|
||||
@@ -711,14 +716,14 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
{
|
||||
PangoFontMask mask = get_property_font_set_mask (param_id);
|
||||
g_value_set_boolean (value, (pango_font_description_get_set_fields (priv->font) & mask) != 0);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PROP_SCALE_SET:
|
||||
g_value_set_boolean (value, priv->scale_set);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_EDITABLE_SET:
|
||||
g_value_set_boolean (value, priv->editable_set);
|
||||
break;
|
||||
@@ -746,14 +751,14 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
case PROP_ALIGN_SET:
|
||||
g_value_set_boolean (value, priv->align_set);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_WIDTH_CHARS:
|
||||
g_value_set_int (value, priv->width_chars);
|
||||
break;
|
||||
break;
|
||||
|
||||
case PROP_MAX_WIDTH_CHARS:
|
||||
g_value_set_int (value, priv->max_width_chars);
|
||||
break;
|
||||
break;
|
||||
|
||||
case PROP_PLACEHOLDER_TEXT:
|
||||
g_value_set_string (value, priv->placeholder_text);
|
||||
@@ -826,7 +831,7 @@ set_font_desc_fields (PangoFontDescription *desc,
|
||||
PangoFontMask to_set)
|
||||
{
|
||||
PangoFontMask changed_mask = 0;
|
||||
|
||||
|
||||
if (to_set & PANGO_FONT_MASK_FAMILY)
|
||||
{
|
||||
const char *family = pango_font_description_get_family (desc);
|
||||
@@ -854,7 +859,7 @@ set_font_desc_fields (PangoFontDescription *desc,
|
||||
size = 10 * PANGO_SCALE;
|
||||
changed_mask |= PANGO_FONT_MASK_SIZE;
|
||||
}
|
||||
|
||||
|
||||
pango_font_description_set_size (desc, size);
|
||||
}
|
||||
|
||||
@@ -1288,7 +1293,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
|
||||
|
||||
/**
|
||||
* gtk_cell_renderer_text_new:
|
||||
*
|
||||
*
|
||||
* Creates a new `GtkCellRendererText`. Adjust how text is drawn using
|
||||
* object properties. Object properties can be
|
||||
* set globally (with g_object_set()). Also, with `GtkTreeViewColumn`,
|
||||
@@ -1296,8 +1301,10 @@ gtk_cell_renderer_text_set_property (GObject *object,
|
||||
* you can bind the “text” property on the cell renderer to a string
|
||||
* value in the model, thus rendering a different string in each row
|
||||
* of the `GtkTreeView`.
|
||||
*
|
||||
*
|
||||
* Returns: the new cell renderer
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
GtkCellRenderer *
|
||||
gtk_cell_renderer_text_new (void)
|
||||
@@ -1320,7 +1327,7 @@ add_attr (PangoAttrList *attr_list,
|
||||
{
|
||||
attr->start_index = 0;
|
||||
attr->end_index = G_MAXINT;
|
||||
|
||||
|
||||
pango_attr_list_insert (attr_list, attr);
|
||||
}
|
||||
|
||||
@@ -1352,11 +1359,11 @@ get_layout (GtkCellRendererText *celltext,
|
||||
if (!placeholder_layout && cell_area)
|
||||
{
|
||||
/* Add options that affect appearance but not size */
|
||||
|
||||
|
||||
/* note that background doesn't go here, since it affects
|
||||
* background_area not the PangoLayout area
|
||||
*/
|
||||
|
||||
|
||||
if (priv->foreground_set
|
||||
&& (flags & GTK_CELL_RENDERER_SELECTED) == 0)
|
||||
{
|
||||
@@ -1493,7 +1500,7 @@ get_layout (GtkCellRendererText *celltext,
|
||||
|
||||
pango_layout_set_alignment (layout, align);
|
||||
}
|
||||
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
||||
@@ -1550,7 +1557,7 @@ get_size (GtkCellRenderer *cell,
|
||||
gtk_cell_renderer_set_fixed_size (cell,
|
||||
cell_width, 2 * ypad +
|
||||
priv->fixed_height_rows * PANGO_PIXELS (row_height));
|
||||
|
||||
|
||||
if (height)
|
||||
{
|
||||
*height = cell_height;
|
||||
@@ -1727,7 +1734,7 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
|
||||
if (priv->text)
|
||||
gtk_editable_set_text (GTK_EDITABLE (priv->entry), priv->text);
|
||||
g_object_set_data_full (G_OBJECT (priv->entry), I_(GTK_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
|
||||
|
||||
|
||||
gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);
|
||||
|
||||
priv->in_entry_menu = FALSE;
|
||||
@@ -1750,7 +1757,7 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
|
||||
* gtk_cell_renderer_text_set_fixed_height_from_font:
|
||||
* @renderer: A `GtkCellRendererText`
|
||||
* @number_of_rows: Number of rows of text each cell renderer is allocated, or -1
|
||||
*
|
||||
*
|
||||
* Sets the height of a renderer to explicitly be determined by the “font” and
|
||||
* “y_pad” property set on it. Further changes in these properties do not
|
||||
* affect the height, so they must be accompanied by a subsequent call to this
|
||||
@@ -1758,6 +1765,8 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
|
||||
* if calculating the size of a cell is too slow (ie, a massive number of cells
|
||||
* displayed). If @number_of_rows is -1, then the fixed height is unset, and
|
||||
* the height is determined by the properties again.
|
||||
*
|
||||
* Deprecated: 4.10
|
||||
**/
|
||||
void
|
||||
gtk_cell_renderer_text_set_fixed_height_from_font (GtkCellRendererText *renderer,
|
||||
@@ -1853,7 +1862,7 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
|
||||
if (priv->max_width_chars > 0)
|
||||
{
|
||||
int max_width = xpad * 2 + PANGO_PIXELS (char_width) * priv->max_width_chars;
|
||||
|
||||
|
||||
min_width = MIN (min_width, max_width);
|
||||
nat_width = MIN (nat_width, max_width);
|
||||
}
|
||||
@@ -1925,7 +1934,7 @@ gtk_cell_renderer_text_get_aligned_area (GtkCellRenderer *cell,
|
||||
int y_offset = 0;
|
||||
|
||||
layout = get_layout (celltext, widget, cell_area, flags);
|
||||
get_size (cell, widget, cell_area, layout, &x_offset, &y_offset,
|
||||
get_size (cell, widget, cell_area, layout, &x_offset, &y_offset,
|
||||
&aligned_area->width, &aligned_area->height);
|
||||
|
||||
aligned_area->x = cell_area->x + x_offset;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user