Commit Graph

64704 Commits

Author SHA1 Message Date
Christian Hergert
7500f9b255 treeview: allow subclassing GtkTreeView
Porting code from GTK 3 without the ability to subclass GtkTreeView
directly can cause an extreme amount of pain on application developers.
It can also complicate performance when it comes to dealing with
encapsulation as the outer widget would also encapsulate the GtkScrollable
implementation from GtkTreeView, typically through GtkViewport.

Fixes #2936
2020-07-16 17:06:15 -07:00
Matthias Clasen
31a7cac4a6 Merge branch 'matthiasc/arrays' into 'master'
Matthiasc/arrays

See merge request GNOME/gtk!2253
2020-07-16 23:31:31 +00:00
Matthias Clasen
5eec736b07 multifilter: Use GdkArray for the filters 2020-07-16 18:44:25 -04:00
Matthias Clasen
cf4a8e2152 multisorter: Use GdkArray for the sorters 2020-07-16 18:44:25 -04:00
Matthias Clasen
31bb969cce Merge branch 'matthiasc/for-master' into 'master'
gtk-demo: Use better api

See merge request GNOME/gtk!2254
2020-07-16 21:03:21 +00:00
Matthias Clasen
f4a7c7f6bf gtk-demo: Use better api
We have a getter for the model, lets use it.
2020-07-16 16:26:41 -04:00
Benjamin Otte
495069c868 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2251
2020-07-16 19:43:45 +00:00
Matthias Clasen
dfe470475b Merge branch 'missing-exports' into 'master'
Add missing exports for GtkColumnView methods.

See merge request GNOME/gtk!2252
2020-07-16 18:52:22 +00:00
Benjamin Otte
de56e892aa listitemmanager: Do a better job on double items
Previously, we would unparent the existing item that we were about
to reuse, and not the duplicate one.

Change that.
2020-07-16 20:43:16 +02:00
Benjamin Otte
e518c1f2f3 stringfilter: Make the constructor take an expression
An expression is critically important for a string filter and people
should be made aware of it when constructing the filter.
2020-07-16 20:43:16 +02:00
Benjamin Otte
c5ea59d7d1 gtk-demo: Don't make demos modal
That way, demo windows can be maximized and multiple demos can run at
once.

It's especially useful when using --run because the main window is
invisible then.
2020-07-16 20:43:16 +02:00
Benjamin Otte
22eccbdbb6 testsuite: Don't be too exhaustive
The test was taking over 60s on CI, that's a but much.
2020-07-16 20:43:16 +02:00
Benjamin Otte
58e85c85e4 testsuite: Add a case with escaped Latin-1 code
This came up in recent g_uri_escape() discussions.
2020-07-16 20:43:11 +02:00
Matthias Clasen
6b89148487 Merge branch 'wip/otte/vector' into 'master'
Arrays

See merge request GNOME/gtk!2197
2020-07-16 18:05:43 +00:00
Matthias Clasen
ddb9e428ec Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2250
2020-07-16 17:39:16 +00:00
Andreas Persson
b7fa353db2 Add missing exports for GtkColumnView methods.
GDK_AVAILABLE_IN_ALL was missing for one method in GtkColumnView and one
in GtkColumnViewColumn.
2020-07-16 18:58:41 +02:00
Matthias Clasen
87b5eadb7c treesorter tests: Add a comment
This looks like a leak, but isn't one.
Add a comment to that effect.
2020-07-16 12:14:28 -04:00
Benjamin Otte
60a09e59e8 stringlist: Convert to array
Stringlists are usually built and then never modified, and accessing
items through an array is faster.
2020-07-16 18:09:58 +02:00
Benjamin Otte
6f8e9bf3a9 snapshot: Use GdkArray for the state stack 2020-07-16 18:09:58 +02:00
Benjamin Otte
90b7b84337 array: Add a bunch of new features
* GDK_ARRAY_BY_VALUE
  #define this to get GArray-like behavior
* gdk_array_splice (v, 0, 0, NULL, 25)
  Adding items but passing NULL as the items will zero() them.
* gdk_array_set_size()
  A nicer way to call gdk_array_splice()
* constify getters
2020-07-16 18:09:58 +02:00
Benjamin Otte
088b5fc57f icontheme: Use GdkArray 2020-07-16 18:09:58 +02:00
Benjamin Otte
a4cd974912 array: Add null-termination 2020-07-16 18:09:57 +02:00
Benjamin Otte
65359dcc59 snapshot: Port node list to GdkArray 2020-07-16 18:09:57 +02:00
Benjamin Otte
ac8b398c50 snapshot: Move structs into .c file
They aren't used anywhere else.
2020-07-16 18:09:57 +02:00
Benjamin Otte
aac2417893 Remove preallocated array code
Now with GdkArray, we can use that one instead.
2020-07-16 18:09:57 +02:00
Benjamin Otte
ad8892df10 main: Use a GdkArray 2020-07-16 18:09:57 +02:00
Benjamin Otte
edc7977c4e cssselector: Use GdkArray 2020-07-16 18:09:57 +02:00
Benjamin Otte
8bf8ac5076 Add GdkArray
This is a scary idea where you #define a bunch of preprocessor values
and then #include "gdkarrayimpl.c" and end up with a dynamic array for
that data type.

See https://en.wikipedia.org/wiki/X_Macro for what's going on.

What are the advantages over using GArray or GPtrArray?

 * It's typesafe
   Because it works like C++ templates, we can use the actual type of
   the object instead of having to use gpointer.

 * It's one less indirection
   instead of 2 indirections via self->array->data, this array is
   embedded, so self->array is the actual data, and just one indirection
   away. This is pretty irrelevant in general, but can be very noticable
   in tight loops.

 * It's all inline
   Because the whole API is defined as static inline functions, the
   compiler has full access to everything and can (and does) optimize
   out unnecessary calls, thereby speeding up some operations quite
   significantly, when full optimizations are enabled.

 * It has more features
   In particular preallocation allows for avoiding malloc() calls, which
   can again speed up tight loops a lot.
   But there's also splice(), which is very useful when used with
   listmodels.
2020-07-16 18:09:57 +02:00
Benjamin Otte
c36cbd5140 sortlistmodel: Remove forgotten G_PARAM_CONSTRUCT_ONLY 2020-07-16 17:33:29 +02:00
Matthias Clasen
ee96bc7185 multiselection tests: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
f94f325636 filterlistmodel tests: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
6c1217dd93 filter tests: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
edb792503b printunixdialog: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
3a43859286 Cosmetics 2020-07-16 08:54:36 -04:00
Matthias Clasen
c55dd104d4 placessidebar: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
497d137fb8 filechoosernativewin32: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
df01c5c7a4 columnlistitemfactory: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
2d1135fba6 applicationaccels: Plug a leak
g_list_model_get_item is transfer full.
2020-07-16 08:54:36 -04:00
Matthias Clasen
f54ed6f7dc columviewsorter: Add an assertion 2020-07-16 08:54:36 -04:00
Matthias Clasen
b7efd896b6 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2249
2020-07-16 12:52:46 +00:00
Matthias Clasen
46eb51bc30 inspector: Avoid losing a reference
This was copying the example in the treelistrowsorter
docs that the previous commit fixed, so we apply
the same fix here.
2020-07-16 07:14:01 -04:00
Matthias Clasen
500dbaabc3 treelistrowsorter: Fix a faulty example
gtk_tree_list_row_sorter_new() consumes the
sorter, so we can't pass gtk_column_view_get_sorter(),
since that is transfer none.
2020-07-16 07:14:01 -04:00
Matthias Clasen
594ec3d822 inspector: Don't derive from GtkBox
We don't do that anymore. A bin layout
is sufficient here.
2020-07-16 07:14:01 -04:00
Matthias Clasen
f280508209 inspector: Drop a Private struct
These are really not needed in the inspector.
2020-07-16 07:14:01 -04:00
Matthias Clasen
480b88c776 inspector: Drop an unused field 2020-07-16 07:14:01 -04:00
Efstathios Iosifidis
a4e63905b1 Update Greek translation 2020-07-15 18:12:26 +00:00
Matthias Clasen
5666127dbc Merge branch 'matthiasc/for-master' into 'master'
inspector: Use substring matching in the property list

See merge request GNOME/gtk!2247
2020-07-15 16:52:05 +00:00
Matthias Clasen
c1c110ba65 inspector: Use substring matching in the property list
This is convenient for things like "set both hexpand and
vexpand", since you can then search for "expand"
2020-07-15 11:29:06 -04:00
Florentina Mușat
eb2a839892 Update Romanian translation 2020-07-15 08:58:58 +00:00
Matthias Clasen
1c537a6d2e Merge branch 'wip/jimmac/file-dialog-sidebar-color' into 'master'
Adwaita: sidebar color for file picker

See merge request GNOME/gtk!2242
2020-07-15 01:41:35 +00:00