Compare commits

...

121 Commits

Author SHA1 Message Date
Matthias Clasen
16b043a127 treelistmodel: Make constructor transfer full
Make gtk_tree_list_model_new() take the root model
as first argument, and make it transfer full, for
consistency with other wrapping list constructors.

Update all callers.

Still missing here: Make the model property writable,
and allow passing NULL in the constructor.
2020-07-26 16:38:53 -04:00
Matthias Clasen
0b7f7028d9 sortlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 16:25:12 -04:00
Matthias Clasen
5dba053ad1 filterlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 15:55:44 -04:00
Matthias Clasen
cd8a810d69 slicelistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 15:38:15 -04:00
Matthias Clasen
8f63a5ab63 listlistmodel: Drop item_type
We are using G_TYPE_OBJECT throughout, so there
is no need for GtkListListModel to do anything else.

Update all callers.
2020-07-26 14:37:55 -04:00
Matthias Clasen
eb3381723f maplistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 14:23:16 -04:00
Matthias Clasen
7e87ad1887 flattenlistmodel: Make the constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 14:21:28 -04:00
Matthias Clasen
ef6babf896 Merge branch 'matthiasc/for-master' into 'master'
overlaylayout: Document minimally

See merge request GNOME/gtk!2285
2020-07-26 12:00:49 +00:00
Matthias Clasen
7f9570b95b overlaylayout: Document minimally
This layout manager is not reusable, but we
still need to make its layout properties show
up in the docs.
2020-07-25 19:02:33 -04:00
Matthias Clasen
d8d8a71a7a Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2284
2020-07-25 17:30:11 +00:00
Matthias Clasen
2ff3e3d1e4 gtk: Improve struct packing in places
Plug some holes in our structs by rearranging
a few fields. This is was done looking at
pahole output.
2020-07-25 11:57:37 -04:00
Matthias Clasen
73f4f518b8 gdk: Improve struct packing in places
Plug some holes in our structs by rearranging
a few fields. This is was done looking at
pahole output.
2020-07-25 11:57:37 -04:00
Matthias Clasen
6e9dbba130 colorswatch: Remove unused radius fields
The radius fields are never used.
2020-07-25 11:57:37 -04:00
Matthias Clasen
706aa93ab5 hsla: Just store floats
We are using floats for rgb, and we don't need more precision
for hsl colors either. We use hsl for computing color expressions
like shade(), lighter() and darker(), which are not precisely
specified anyway.

This commit updates the one test where the output changes a
tiny bit due to this.
2020-07-25 11:56:05 -04:00
Matthias Clasen
54deed9a5a headerbar: Drop the Private struct 2020-07-25 07:41:05 -04:00
Matthias Clasen
0e70ddcab3 colorplane: Drop the Private struct and padding 2020-07-24 22:56:24 -04:00
Matthias Clasen
f2bdb1fb87 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2283
2020-07-25 00:05:28 +00:00
Matthias Clasen
ec9fd76c87 Merge branch 'wip/otte/types' into 'master'
Get rid of unneeded glib types

See merge request GNOME/gtk!2282
2020-07-24 23:54:01 +00:00
Matthias Clasen
bacaa5eb9a Add another sortlistmodel test
This tests the crash fix in f7b73b2e01.
2020-07-24 19:28:54 -04:00
Matthias Clasen
9a297516ba testsuite: Add an incremental sort test
Add a test that makes changes to a model while it
is incrementally sorted.
2020-07-24 19:23:18 -04:00
Matthias Clasen
e9bff53015 timsort: Avoid a crash
We need to clear the pointer after freeing the data,
since the sortlistmodel keeps its timsort structure
around and reuses it.
2020-07-24 19:23:18 -04:00
Benjamin Otte
3078b180fe Replace "gdouble" with "double" 2020-07-25 00:47:36 +02:00
Benjamin Otte
556997f9df Replace "gfloat" with "float" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d7266b25ba Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
Matthias Clasen
2a43ce1705 testsuite: Use better names for sortlistmodel tests
Name the tests for what they do.
2020-07-24 15:37:49 -04:00
Matthias Clasen
3324a6e6b3 testsuite: Reenable tests for incremental sort
This was unintentionally disabled.
2020-07-24 15:22:14 -04:00
Matthias Clasen
46423e614d Merge branch 'remove-align-widget' into 'master'
menubutton: Remove align-widget property

See merge request GNOME/gtk!2280
2020-07-24 18:17:30 +00:00
Matthias Clasen
f7b73b2e01 sortlistmodel: Fix a crash 2020-07-24 14:15:14 -04:00
Matthias Clasen
c85e424279 dropdown: Fix popup sizing
Setting a width request is not quite enough, since
gtk_widget_set_size_request() only queues a resize
when the widget is visible. Explicitly force one
here. Without this, the popup sometimes shows up
too small.
2020-07-24 14:15:04 -04:00
Florian Müllner
b146c48e23 menubutton: Remove align-widget property
The property has been unused since commit 8701e34f74. That was four
years ago, so it's safe to say that nobody has been missing it terribly.
2020-07-24 13:55:06 +02:00
Timm Bäder
3176d69009 Merge branch 'fix-gdk-array-msvc' into 'master'
gdk/gdkarrayimpl.c: Fix build on Visual Studio

See merge request GNOME/gtk!2279
2020-07-24 09:28:21 +00:00
Chun-wei Fan
89f7d841ab gdk/gdkarrayimpl.c: Fix build on Visual Studio
It seems like initializing something to an empty array using `{}` is a GCCism,
so just stuff a 0 within the braces to accomplish the same thing.
2020-07-24 16:25:24 +08:00
Matthias Clasen
7e2fceebca Merge branch 'matthiasc/for-master' into 'master'
filechooser: Remove a leftover signal emission

Closes #2942

See merge request GNOME/gtk!2276
2020-07-24 02:58:51 +00:00
Matthias Clasen
1e00c887ec docs: Work around escaping bugs
This is truly a russian doll of documentation formats:
a string containing <> inside an xml fragment in an |[ ]|
gtk-doc example in markdown in a doc comment.

Sadly, something gets escaping wrong, so the <> end up
literally in the docbook and mess up the last step of
our document formatting, even after turning them into
entities.

Work around this with an extra level of entities that
really shouldn't be necessary.
2020-07-23 18:24:18 -04:00
Matthias Clasen
561d3c68a0 docs: Pass --standalone to pandoc
This flag causes pandoc to emit a proper doctype
declaration and, crucially, namespace declarations
for the xlink namespace that it insists on using
for href attributes. Without this, putting external
links in md documents doesn't survive the journey
through xml.
2020-07-23 18:24:18 -04:00
Matthias Clasen
03601cb794 docs: Improve shortcut trigger docs
Point out the need to escape <> in xml.
2020-07-23 18:24:18 -04:00
Matthias Clasen
3108b8b4d3 docs: Explain the shortcutcontroller example a bit
Add a reference to the the syntax for shortcut actions
in builder files.
2020-07-23 18:24:18 -04:00
Matthias Clasen
d1afe32762 filechooser: Remove a leftover signal emission
Commit 0145809a94 replace the response-requested
signal with an action, but didn't actually remove the emission
of that no-longer-existing signal.

Fixes: #2942
2020-07-23 12:54:07 -04:00
Benjamin Otte
603dd72b09 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2277
2020-07-23 14:34:33 +00:00
Benjamin Otte
e81ba8924a searchenginemodel: Remove unused code 2020-07-23 15:31:08 +02:00
Benjamin Otte
8832ab45d9 searchengine: Remove unused set_recursive() call 2020-07-23 15:31:08 +02:00
Florentina Mușat
87d6e17bc7 Update Romanian translation 2020-07-23 10:33:16 +00:00
Florentina Mușat
a5033cd79b Update Romanian translation 2020-07-23 10:32:08 +00:00
Matthias Clasen
44cbf3d605 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2275
2020-07-23 00:19:15 +00:00
Matthias Clasen
fb6288791e NEWS: Updates 2020-07-22 19:51:27 -04:00
Matthias Clasen
2160f52cbf migration guide: Add some tables
Add a table mapping event signals to their event controller
replacements, and a table mapping former GtkContainer
subclasses to their gtk_container_add replacement.
2020-07-22 19:38:58 -04:00
Benjamin Otte
8825e621c9 Merge branch 'wip/otte/for-master' into 'master'
timsort: Actually 0-terminate the array in get_runs()

See merge request GNOME/gtk!2274
2020-07-22 18:08:24 +00:00
Benjamin Otte
e22abd73f2 timsort: Actually 0-terminate the array in get_runs()
This could cause SEGVs when changing the sort during an ongoing sort
operation.
2020-07-22 18:59:22 +02:00
Yuri Chornoivan
f77d4d7fc0 Update Ukrainian translation 2020-07-22 13:27:26 +00:00
Yuri Chornoivan
8243133ca7 Update Ukrainian translation 2020-07-22 13:22:09 +00:00
Matthias Clasen
63a4345d2c Merge branch 'wip/otte/sortlistmodel2' into 'master'
Massively refactor and improve sortlistmodel

See merge request GNOME/gtk!2273
2020-07-22 13:15:45 +00:00
Piotr Drąg
56685a483d Update POTFILES.in 2020-07-22 15:01:05 +02:00
Benjamin Otte
b23f793753 gtk-demo: Add a progress bar when the colors demo resorts 2020-07-22 14:30:49 +02:00
Benjamin Otte
2b19e2fc1f sortlistmodel: Add progress estimation 2020-07-22 14:30:49 +02:00
Benjamin Otte
703f8b8136 timsort: Add progress estimation 2020-07-22 14:30:49 +02:00
Benjamin Otte
5b18968867 sortlistmodel: Make key generation part of the step function
SSave the missing keys as a bitset and iterate over that bitset in the
step function.

Solves the problem with a large UI block at the beginning of a sort
operation when all the keys were generated, in particular when key
generation was slow.

Benchmarks for maximum time taken by a single main loop callback:

     initial sort with complex GFileInfo keys
                       old      new
      32,000 items   137ms      3ms
     128,000 items   520ms     31ms

     initial sort with string keys
                       old      new
      32,000 items   187ms      1ms
     128,000 items   804ms      3ms
2020-07-22 14:30:49 +02:00
Benjamin Otte
e8c4e1205a gtk-demo: Make colors demo do incremental sorting 2020-07-22 14:30:49 +02:00
Benjamin Otte
bf5c540357 sortlistmodel: Properly compute runs
When updating a (partially) sorted model, take the known runs for the
existing sort and apply them to the new sort. That way, we don't have to
check the whole model again.

Benchmarks:

      appending half the items to a model of strings
                        old      new
      512,000 items   437ms    389ms
    1,024,000 items  1006ms    914ms

      appending 10% of the items to a model of strings
                        old      new
      512,000 items   206ms    132ms
    1,024,000 items   438ms    301ms

      appending 1 item to a model of strings
                        old      new
       64,000 items   1.8ms   0.00ms
      512,000 items     ---   0.01ms
2020-07-22 14:30:49 +02:00
Benjamin Otte
c03383d3e5 sortlistmodel: Make sort stable again
Previously, the sort was not stable when items were added/removed while
sorting or the sort algorithm was changed.

Now the sort looks at the item position (via the key's location in the
keys array) to make sure each comparison stays stable with respect to
this position.
2020-07-22 14:30:49 +02:00
Benjamin Otte
eaaa287078 multisorter: Implement GtkSortKeys 2020-07-22 14:30:49 +02:00
Benjamin Otte
554defaf1a treelistrowsorter: Implement GtkSortKeys 2020-07-22 14:30:49 +02:00
Benjamin Otte
659fe52b7b numericsorter: Implement GtkSortKeys 2020-07-22 14:30:49 +02:00
Benjamin Otte
0970077af9 stringsorter: Implement GtkSortKeys 2020-07-22 14:30:49 +02:00
Benjamin Otte
814c88fbc1 sortkeys: Add an equal sort keys
Compares every element as equal.
This is useful when sorters are in an invalid configuration.
2020-07-22 14:30:49 +02:00
Benjamin Otte
3b24c8a0a4 sortlistmodel: Use GtkSortKeys
This massively speeds up sorting with expensive sort functions that it's
the most worthwhile optimization of this whole branch.
It's slower for simple sort functions though.

It's also quite a lot slower when the model doesn't support sort keys
(like GtkCustomSorter), but all the other sorters do support keys.

Of course, this depends on the number of items in the model - the number
of comparisons scales O(N * log N) while the overhead for key handling
scales O(N).
So as the log N part grows, generating keys gets more and more
beneficial.

Benchmarks:

       initial sort of a GFileInfo model with display-name keys
                       items     keys
         8,000 items   715ms     50ms
        64,000 items     ---    554ms

       initial sort of a GFileInfo model with complex keys
                       items     keys
        64,000 items   340ms    295ms
       128,000 items   641ms    605ms

       removing half a GFileInfo model with display-name keys
       (no comparisons, just key freeing overhead of a complex sorter)
                       items     keys
       512,000 items    14ms     21ms
     2,048,000 items    40ms     62ms

       removing half a GFileInfo model with complex keys
       (no comparisons, just key freeing overhead of a complex sorter)
                       items     keys
       512,000 items    90ms    237ms
     2,048,000 items   247ms    601ms
2020-07-22 14:30:49 +02:00
Benjamin Otte
e34c7e6796 sorter: Introduce GtkSortKeys
GtkSortKeys is an immutable struct that can be used to manage "sort
keys" for items.

Sort keys are memory that is created specifically for sorting. Because
sorting involves lots of comparisons, it's a good idea to prepare the
data relevant for sorting in advance and sort on that data.

In measurements with a PropertyExpression on a string sorter, it's about
??? faster
2020-07-22 14:30:49 +02:00
Benjamin Otte
8c608e9c1c sortlistmodel: Split the SortItem into 2 arrays
Instead of one item keeping the item + its position and sorting that
list, keep the items in 1 array and put the positions into a 2nd array.

This is generally slower while sorting, but allows multiple improvements:

1. We can replace items with keys
   This allows avoiding multiple slow lookups when using complex
   comparisons

2. We can keep multiple position arrays
   This allows doing a sorting in the background without actually
   emitting items-changed() until the array is completely sorted.

3. The main list tracks the items in the original model
   So only a single memmove() is necessary there, while the old version
   had to upgrade the position in every item.
Benchmarks:

        sorting a model of simple strings
                          old      new
        256,000 items   256ms    268ms
        512,000 items   569ms    638ms

        sorting a model of file trees, directories first, by size
                          old      new
         64,000 items   350ms    364ms
        128,000 items   667ms    691ms

        removing half the model
                          old      new
        512,000 items    24ms     15ms
      1,024,000 items    49ms     25ms
2020-07-22 14:30:49 +02:00
Benjamin Otte
283c3b70dd sortlistmodel: Add an incremental property
Also refactor a large part of the sortmodel to make this convenient.

A large amount of time has been spent on getting items-changed regions
minimized.
2020-07-22 14:30:49 +02:00
Benjamin Otte
93599c2c48 testsuite: Add exhaustive sortlistmodel test
This is basically a copy/paste from the filterlistmodel test, but
adapted for sorting.
2020-07-22 14:04:40 +02:00
Benjamin Otte
080e625090 sortlistmodel: Make the sort callback useful
1. Run step() for a while to avoid very short steps
   This way, we batch items-changed() emissions.

2. Track the change region accurately
   This way, we can avoid invalidating the whole list if our step just
   touched a small part of a huge list.
   As this is a merge sort, this is a common occurence when we're buys
   merging chunks: The rest of the model outside those chunks isn't
   changed.

Note that the tracking is accurate: It determines the minimum change
region in the model.

This will be important, because the testsuite is going to test this.
2020-07-22 14:04:40 +02:00
Benjamin Otte
26696a741e timsort: Add change tracking to gtk_tim_sort_step() 2020-07-22 14:04:40 +02:00
Benjamin Otte
a209e54b8f timsort: Add gtk_tim_sort_set_max_merge_size()
Makes the SOrtListModel responsive when incrementally sorting.

By making it configurable we can avoid losting performance in the
non-incremental case.
2020-07-22 14:04:40 +02:00
Benjamin Otte
8921dadaa1 timsort: Make sure merges don't take too long
Limit the size of the merged areas and thereby chunk larger merges into
smaller ones.
2020-07-22 14:04:40 +02:00
Benjamin Otte
47232acbd8 sortlistmodel: Make sorting incremental
This is just an experiment so far to see how long it takes to sort.
2020-07-22 14:04:40 +02:00
Benjamin Otte
cbad8ec2e4 timsort: Add gtk_tim_sort_set_runs()
... and use it in the SortListModel

Setting runs allows declaring already sorted regions so the sort does
not attempt to sort them again.

This massively speeds up partial inserts where we can reuse the sorted
model as a run and only resort the newly inserted parts.

Benchmarks:

    appending half the model
                    qsort  timsort
    128,000 items    94ms     69ms
    256,000 items   202ms    143ms
    512,000 items   488ms    328ms

    appending 1 item
                    qsort  timsort
      8,000 items   1.5ms    0.0ms
     16,000 items   3.1ms    0.0ms
              ...
    512,000 items     ---    1.8ms
2020-07-22 14:04:40 +02:00
Benjamin Otte
800170b47d sortlistmodel: Use timsort
Simply replace the old qsort() call with a timsort() call.

This is ultimately relevant because timsort is a LOT faster in merging
to already sorted lists (think items-chaged adding some items) or
reversing an existing list (think columnview sort order changes).

Benchmarks:

    initially sorting the model
                    qsort  timsort
    128,000 items   124ms    111ms
    256,000 items   264ms    250ms
2020-07-22 14:04:40 +02:00
Benjamin Otte
97c5cb3514 Add a timsort() implementation 2020-07-22 14:04:40 +02:00
Benjamin Otte
081afc0477 sortlistmodel: Track item positions
The model now tracks the original positions on top of just the items so that
it can remove items in an items-changed emission.

It now takes twice as much memory but removes items much faster.

Benchmarks:

Removing 50% of a model:
                   before    after
   250,000 items    135ms     10ms
   500,000 items    300ms     25ms

Removing 1 item:
     4,000 items    2.2ms      0ms
     8,000 items    4.6ms      0ms
   500,000 items      ---   0.01ms
2020-07-22 14:04:40 +02:00
Benjamin Otte
e807fc3be0 sortlistmodel: Replace with an array-based model
This is the dumbest possible sortmodel using an array:
Just grab all the items, put them in the array, qsort() the array.

Some benchmarks (setting a new model):

  125,000 items - old: 549ms
                  new: 115ms
  250,000 items - new: 250ms

This performance can not be kept for simple additions and removals
though.
2020-07-22 14:04:40 +02:00
Boyuan Yang
a1bd3389ed Update Chinese (China) translation 2020-07-22 02:58:46 +00:00
Boyuan Yang
03a3b5a0b1 Update Chinese (China) translation 2020-07-22 02:39:21 +00:00
Boyuan Yang
1ee2d9a5fa Update Chinese (China) translation 2020-07-22 02:20:08 +00:00
Matthias Clasen
2e07fcd680 Merge branch 'wip/chergert/quartz4u' into 'master'
Merge GDK macOS branch

See merge request GNOME/gtk!2272
2020-07-21 22:22:41 +00:00
Matthias Clasen
d3365d5a60 Merge branch 'matthiasc/for-master' into 'master'
gdk: Update gdkkeysyms.h

See merge request GNOME/gtk!2271
2020-07-21 21:53:16 +00:00
Christian Hergert
9dbf99d91a macos: prototype new GDK backend for macOS
This is fairly substantial rewrite of the GDK backend for quartz and
renamed to macOS to allow for a greenfield implementation.

Many things have come across from the quartz implementation fairly
intact such as the eventloop integration design and discovery of
event windows from the NSEvent.

However much has been changed to fit in with the new GDK design and
how removal of child GdkWindow have been completely eliminated.
Furthermore, the new GdkPopup allows for regular NSWindow to be used
to provide popovers unlike the previous implementation.

The object design more closely follows the ideal for a GDK backend.

Views have been broken out into subclasses so that we can support
multiple GSK renderer paths such as GL and Cairo (and Metal in the
future). However mixed mode GL and Cairo will not be supported. Currently
only the Cairo renderer has been implemented.

A new frame clock implementation using CVDisplayLink provides more
accurate information about when to draw drawing the next frame. Some
testing will need to be done here to understand the power implications
of this.

This implementation has also gained edge snapping for CSD windows. Some
work was also done to ensure that CSD windows have opaque regions
registered with the display server.

     ** This is still very much a work-in-progress **

Some outstanding work that needs to be done:

 - Finish a GL context for macOS and alternate NSView for GL rendering
   (possibly using speciailized CALayer for OpenGL).
 - Input rework to ensure that we don't loose remapping of keys that was
   dropped from GDK during GTK 4 development.
 - Make sure input methods continue to work.
 - Drag-n-Drop is still very much a work in progress
 - High resolution input scrolling needs various work in GDK to land
   first before we can plumb that to NSEvent.
 - gtk/ has a number of things based on GDK_WINDOWING_QUARTZ that need
   to be updated to use the macOS backend.

But this is good enough to start playing with and breaking things which
is what I'd like to see.
2020-07-21 14:45:12 -07:00
Christian Hergert
0154a7f528 gdk: disable file transfer portal on macOS 2020-07-21 14:45:12 -07:00
Christian Hergert
add47bebc6 build: add ATK fallback subproject wrapper
Very similar to the other fallbacks we use.
2020-07-21 14:45:12 -07:00
Christian Hergert
514b62223d build: squash various warnings with Clang
Otherwise we have really chatty builds that make it difficult to catch
new issues when compiling.
2020-07-21 14:45:12 -07:00
Christian Hergert
7884ab6161 build: fix linking support on macOS with Clang
This was preventing any sort of building on macOS, even though the quartz
backend is currently non-functional. Fixing this is a pre-requisite to
getting a new macOS backend compiling.
2020-07-21 14:45:12 -07:00
Matthias Clasen
bc542c5304 gdk: Update gdkkeysyms.h
Run the gdkkeysyms-update.pl script to pick up several
new keysyms:
GDK_dead_lowline
GDK_dead_aboveverticalline
GDK_dead_belowverticalline
GDK_dead_longsolidusoverlay
GDK_Keyboard
GDK_WWAN
GDK_RFKill
GDK_AudioPreset
2020-07-21 16:55:28 -04:00
Matthias Clasen
d66ac4981e Merge branch 'matthiasc/for-master' into 'master'
inspector: Make picking objects show them

Closes #1876

See merge request GNOME/gtk!2269
2020-07-20 22:06:42 +00:00
Matthias Clasen
9b647a47d1 inspector: Make picking objects show them
Changing the selection in the object tree is
not a useful action if we are already in the
object details. Most likely, a user who picks
an object wants to inspect its details, so
just always show them.

Fixes: #1876
2020-07-20 17:30:16 -04:00
Benjamin Otte
b67ffe9650 sortlistmodel: Test that the model is stable
Stability is measured relative to the child model, not relative to the
previous sorter.
2020-07-20 22:28:01 +02:00
Benjamin Otte
2c519b006d testsuite: Fix a leak 2020-07-20 22:28:01 +02:00
Matthias Clasen
852429d163 Merge branch 'barthalion/asan-runner' into 'master'
ci: Switch ASAN tests to runners tagged so

See merge request GNOME/gtk!2267
2020-07-20 16:17:49 +00:00
Matthias Clasen
ee9c6bbf75 Merge branch 'action-muxer-speedup' into 'master'
Action muxer speedup

See merge request GNOME/gtk!1754
2020-07-20 16:17:17 +00:00
Bartłomiej Piotrowski
d9ece94377 ci: Switch ASAN tests to runners tagged so 2020-07-20 16:41:46 +02:00
Matthias Clasen
486fbce42b actionmuxer: Update docs and clean up headers
Update the doc comment at the top to describe the
current  functionality of GtkActionMuxer.
2020-07-20 08:24:54 -04:00
Matthias Clasen
ed92026632 actionmuxer: Use an array for accels
We have a lot of accels across all the muxers, but the vast
majority has just one or two, so an array is going to be
smaller and faster for this.
2020-07-20 08:24:54 -04:00
Matthias Clasen
05e614feb7 actionmuxer: Create observed_actions and groups on demand
The vast majority of action muxers don't have observers or
groups, so we can avoid the overhead of carrying all these
empty hash tables.
2020-07-20 08:24:54 -04:00
Matthias Clasen
14059afdf1 inspector: Make the actions tab work again
Bring back the actions tab; we don't receive
changes anymore, since GtkActionMuxer lost
the GActionGroup signals for this, and the
action observer machinery has no way to listen
for all changes.
2020-07-20 08:24:54 -04:00
Matthias Clasen
9b294eb94e Add gtk_action_muxer_list_actions
This is needed to reinstate the actions support
in the inspector.
2020-07-20 08:24:53 -04:00
Matthias Clasen
96d42cf1cc actionmuxer: Stop implementing GActionGroup
Instead of implementing the GActionGroup interface
and using its signals for propagating changes up
and down the muxer hierarchy, use the GtkActionObserver
mechanism. This cuts down on the signal emission
overhead.
2020-07-20 08:24:53 -04:00
Matthias Clasen
4786a16696 actionmuxer: Port internal users
Port all internal users of the action muxer
from the GActionGroup interface to the new
action muxer apis.
2020-07-20 08:24:52 -04:00
Matthias Clasen
14bb12125f actionmuxer: Add some more api
We want to drop the GActionGroup interface from
GtkActionMuxer, so add the necessary api directly
to GtkActionMuxer itself.
2020-07-20 08:24:14 -04:00
Matthias Clasen
07e8dafcea inspector: Remove action support temporarily
This is using the action muxer as a GActionGroup,
and we want to remove that interface from GtkActionMuxer.

The support will come back later.
2020-07-20 08:24:14 -04:00
Matthias Clasen
ab67a81f11 Speed up action muxer setup more
Don't emit signals for group insertion/removal
if nobody is listening.
2020-07-20 08:24:14 -04:00
Matthias Clasen
aa76f7e210 Speed up action muxer setup
We don't need to duplicate all these action names and
emit all these signals if nobody is listening.
2020-07-20 08:24:14 -04:00
Matthias Clasen
0c15463e41 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2266
2020-07-20 12:23:12 +00:00
Matthias Clasen
5df1356295 gsk: Remove an unused debug flag
GSK_DEBUG_DIFF was not used anywhere, so remove it.
2020-07-20 07:03:08 -04:00
Matthias Clasen
95fc81c565 inspector: Add a few more debug flags
Add check buttons for GTK_DEBUG=constraints and
GTK_DEBUG=layout in the logs page.
2020-07-20 07:03:08 -04:00
Matthias Clasen
378e594f75 Tweak the GTK_DEBUG=help output
I got the layout flag wrong when I added the
improved help output. It is about layout managers,
not about showing layout borders.
2020-07-20 07:03:08 -04:00
Matthias Clasen
86c7fceb09 Merge branch 'list-model-docs' into 'master'
List model docs

See merge request GNOME/gtk!2182
2020-07-19 23:50:09 +00:00
Matthias Clasen
b5e20a3e37 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2265
2020-07-19 19:14:04 +00:00
Matthias Clasen
75a30b1f98 windowhandle: Don't use an action muxer needlessly
The api that is meant to be used here is
gtk_widget_activate_action.
2020-07-19 13:50:23 -04:00
Matthias Clasen
c64a021af4 NEWS: Updates 2020-07-18 18:28:51 -04:00
Matthias Clasen
9b64635925 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2264
2020-07-18 17:31:31 +00:00
Rico Tzschichholz
4da3edd42e Merge branch 'wip/ricotz/annotations' into 'master'
gtk: Improve g-i annotations for methods of GtkExpression subclasses

See merge request GNOME/gtk!2263
2020-07-18 11:06:47 +00:00
Rico Tzschichholz
6b59626817 gtk: Improve g-i annotations for methods of GtkExpression subclasses 2020-07-18 12:30:05 +02:00
Matthias Clasen
130bd5937c docs: Add guidance about list model performance
Add a section about the performance tradeoffs between
different list model implementations.
2020-07-03 09:29:19 -04:00
1094 changed files with 34471 additions and 31742 deletions

View File

@@ -184,7 +184,7 @@ static-scan:
# since it is incompatible with asan
asan-build:
image: $FEDORA_IMAGE
tags: [ privileged ]
tags: [ asan ]
stage: analysis
variables:
script:

11
NEWS
View File

@@ -1,7 +1,7 @@
Overview of Changes in GTK 3.99.0
=================================
* Add GtkEditableLabel
* Add GtkEditableLabel, a label that can be edited
* Add GtkBookmarkList, a list model for bookmarks
@@ -36,6 +36,14 @@ Overview of Changes in GTK 3.99.0
* GtkFilterListModel:
- Add incremental filtering
* GtkSortListModel:
- Use timsort
- Add various tweaks that massively speed up sorting
- Add incremental sorting
* GtkWidget:
- Massively speed up action handling
* GtkEntry:
- Make entry completion work again
- Drop action support from GtkEntryCompletion
@@ -49,6 +57,7 @@ Overview of Changes in GTK 3.99.0
- Keep a scroll history
- Clean up GdkDevice api
- Improve frame clock accuracy
- Add a new macOS backend
* GSK:
- Use GL_ARB_framebuffer_object

View File

@@ -81,11 +81,11 @@ constraint_editor_application_activate (GApplication *app)
static void
constraint_editor_application_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
ConstraintEditorWindow *win;
gint i;
int i;
for (i = 0; i < n_files; i++)
{

View File

@@ -193,7 +193,7 @@ constraint_editor_window_load (ConstraintEditorWindow *self,
static void
open_response_cb (GtkNativeDialog *dialog,
gint response,
int response,
ConstraintEditorWindow *self)
{
gtk_native_dialog_hide (dialog);
@@ -285,7 +285,7 @@ serialize_model (GListModel *list)
static void
save_response_cb (GtkNativeDialog *dialog,
gint response,
int response,
ConstraintEditorWindow *self)
{
gtk_native_dialog_hide (dialog);

View File

@@ -174,28 +174,25 @@ constraint_view_init (ConstraintView *self)
manager = gtk_constraint_layout_new ();
gtk_widget_set_layout_manager (GTK_WIDGET (self), manager);
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
all_constraints = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (manager));
guides = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (manager));
all_constraints = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (manager));
filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
constraints = (GListModel *)gtk_filter_list_model_new (all_constraints, filter);
g_object_unref (filter);
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
children = (GListModel *)gtk_filter_list_model_new (all_children, filter);
g_object_unref (filter);
list = g_list_store_new (G_TYPE_LIST_MODEL);
g_list_store_append (list, children);
g_list_store_append (list, guides);
g_list_store_append (list, constraints);
self->model = G_LIST_MODEL (gtk_flatten_list_model_new (G_LIST_MODEL (list)));
g_object_unref (children);
g_object_unref (guides);
g_object_unref (constraints);
g_object_unref (all_children);
g_object_unref (all_constraints);
g_object_unref (list);
self->model = G_LIST_MODEL (gtk_flatten_list_model_new (G_LIST_MODEL (list)));
controller = (GtkEventController *)gtk_gesture_drag_new ();
g_signal_connect (controller, "drag-begin", G_CALLBACK (drag_begin), self);

View File

@@ -34,7 +34,7 @@ static void create_window (GApplication *app, const char *contents);
static void
show_action_dialog (GSimpleAction *action)
{
const gchar *name;
const char *name;
GtkWidget *dialog;
name = g_action_get_name (G_ACTION (action));
@@ -58,9 +58,9 @@ show_action_infobar (GSimpleAction *action,
gpointer data)
{
DemoApplicationWindow *window = data;
gchar *text;
const gchar *name;
const gchar *value;
char *text;
const char *name;
const char *value;
name = g_action_get_name (G_ACTION (action));
value = g_variant_get_string (parameter, NULL);
@@ -92,7 +92,7 @@ activate_new (GSimpleAction *action,
static void
open_response_cb (GtkNativeDialog *dialog,
gint response_id,
int response_id,
gpointer user_data)
{
GtkFileChooserNative *native = user_data;
@@ -185,7 +185,7 @@ activate_about (GSimpleAction *action,
{
GtkWidget *window = user_data;
const gchar *authors[] = {
const char *authors[] = {
"Peter Mattis",
"Spencer Kimball",
"Josh MacDonald",
@@ -193,7 +193,7 @@ activate_about (GSimpleAction *action,
NULL
};
const gchar *documentors[] = {
const char *documentors[] = {
"Owen Taylor",
"Tony Gale",
"Matthias Clasen <mclasen@redhat.com>",
@@ -244,9 +244,9 @@ static void
update_statusbar (GtkTextBuffer *buffer,
DemoApplicationWindow *window)
{
gchar *msg;
gint row, col;
gint count;
char *msg;
int row, col;
int count;
GtkTextIter iter;
/* clear any previous message, underflow is allowed */

View File

@@ -16,8 +16,8 @@ static GtkWidget *placeholder;
static void
on_name_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
const char *name,
const char *name_owner,
gpointer user_data)
{
name_seen = TRUE;
@@ -25,7 +25,7 @@ on_name_appeared (GDBusConnection *connection,
static void
on_name_vanished (GDBusConnection *connection,
const gchar *name,
const char *name,
gpointer user_data)
{
if (!name_seen)
@@ -55,7 +55,7 @@ do_application_demo (GtkWidget *toplevel)
if (placeholder == NULL)
{
const gchar *command;
const char *command;
GError *error = NULL;
if (g_file_test ("./gtk4-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))

View File

@@ -12,7 +12,7 @@ static GtkWidget *progress_bar = NULL;
static gboolean
apply_changes_gradually (gpointer data)
{
gdouble fraction;
double fraction;
/* Work, work, work... */
fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progress_bar));
@@ -47,8 +47,8 @@ on_assistant_close_cancel (GtkWidget *widget, gpointer data)
static void
on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data)
{
gint current_page, n_pages;
gchar *title;
int current_page, n_pages;
char *title;
current_page = gtk_assistant_get_current_page (GTK_ASSISTANT (widget));
n_pages = gtk_assistant_get_n_pages (GTK_ASSISTANT (widget));
@@ -70,8 +70,8 @@ on_entry_changed (GtkWidget *widget, gpointer data)
{
GtkAssistant *assistant = GTK_ASSISTANT (data);
GtkWidget *current_page;
gint page_number;
const gchar *text;
int page_number;
const char *text;
page_number = gtk_assistant_get_current_page (assistant);
current_page = gtk_assistant_get_nth_page (assistant, page_number);

View File

@@ -38,7 +38,7 @@ create_icon_store (void)
GtkTreeIter iter;
GtkListStore *store;
gint i;
int i;
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
@@ -77,7 +77,7 @@ set_sensitive (GtkCellLayout *cell_layout,
gpointer data)
{
GtkTreePath *path;
gint *indices;
int *indices;
gboolean sensitive;
path = gtk_tree_model_get_path (tree_model, iter);
@@ -175,7 +175,7 @@ create_capital_store (void)
GtkTreeIter iter, iter2;
GtkTreeStore *store;
gint i;
int i;
store = gtk_tree_store_new (1, G_TYPE_STRING);

View File

@@ -38,14 +38,14 @@ struct {
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static void
update_css_for_blend_mode (GtkCssProvider *provider,
const gchar *blend_mode)
const char *blend_mode)
{
GBytes *bytes;
gchar *css;
char *css;
bytes = g_resources_lookup_data ("/css_blendmodes/css_blendmodes.css", 0, NULL);
css = g_strdup_printf ((gchar*) g_bytes_get_data (bytes, NULL),
css = g_strdup_printf ((char *) g_bytes_get_data (bytes, NULL),
blend_mode,
blend_mode,
blend_mode);
@@ -62,7 +62,7 @@ row_activated (GtkListBox *listbox,
GtkListBoxRow *row,
GtkCssProvider *provider)
{
const gchar *blend_mode;
const char *blend_mode;
blend_mode = blend_modes[gtk_list_box_row_get_index (row)].id;
@@ -75,7 +75,7 @@ setup_listbox (GtkBuilder *builder,
{
GtkWidget *normal_row;
GtkWidget *listbox;
gint i;
int i;
normal_row = NULL;
listbox = gtk_list_box_new ();

View File

@@ -17,7 +17,7 @@ G_DEFINE_TYPE(DemoImage, demo_image, GTK_TYPE_WIDGET)
static GdkPaintable *
get_image_paintable (GtkImage *image)
{
const gchar *icon_name;
const char *icon_name;
GtkIconTheme *icon_theme;
GtkIconPaintable *icon;

View File

@@ -16,7 +16,7 @@ message_dialog_clicked (GtkButton *button,
gpointer user_data)
{
GtkWidget *dialog;
static gint i = 1;
static int i = 1;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,

View File

@@ -64,8 +64,8 @@ scribble_draw (GtkDrawingArea *da,
/* Draw a rectangle on the screen */
static void
draw_brush (GtkWidget *widget,
gdouble x,
gdouble y)
double x,
double y)
{
GdkRectangle update_rect;
cairo_t *cr;

View File

@@ -16,9 +16,9 @@
typedef struct
{
gint number;
gchar *product;
gint yummy;
int number;
char *product;
int yummy;
}
Item;
@@ -74,7 +74,7 @@ add_items (void)
static GtkTreeModel *
create_items_model (void)
{
gint i = 0;
int i = 0;
GtkListStore *model;
GtkTreeIter iter;
@@ -109,7 +109,7 @@ static GtkTreeModel *
create_numbers_model (void)
{
#define N_NUMBERS 10
gint i = 0;
int i = 0;
GtkListStore *model;
GtkTreeIter iter;
@@ -192,7 +192,7 @@ remove_item (GtkWidget *widget, gpointer data)
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
{
gint i;
int i;
GtkTreePath *path;
path = gtk_tree_model_get_path (model, &iter);
@@ -211,7 +211,7 @@ separator_row (GtkTreeModel *model,
gpointer data)
{
GtkTreePath *path;
gint idx;
int idx;
path = gtk_tree_model_get_path (model, iter);
idx = gtk_tree_path_get_indices (path)[0];
@@ -224,7 +224,7 @@ separator_row (GtkTreeModel *model,
static void
editing_started (GtkCellRenderer *cell,
GtkCellEditable *editable,
const gchar *path,
const char *path,
gpointer data)
{
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (editable),
@@ -233,15 +233,15 @@ editing_started (GtkCellRenderer *cell,
static void
cell_edited (GtkCellRendererText *cell,
const gchar *path_string,
const gchar *new_text,
const char *path_string,
const char *new_text,
gpointer data)
{
GtkTreeModel *model = (GtkTreeModel *)data;
GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
GtkTreeIter iter;
gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));
int column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));
gtk_tree_model_get_iter (model, &iter, path);
@@ -249,7 +249,7 @@ cell_edited (GtkCellRendererText *cell,
{
case COLUMN_ITEM_NUMBER:
{
gint i;
int i;
i = gtk_tree_path_get_indices (path)[0];
g_array_index (articles, Item, i).number = atoi (new_text);
@@ -261,8 +261,8 @@ cell_edited (GtkCellRendererText *cell,
case COLUMN_ITEM_PRODUCT:
{
gint i;
gchar *old_text;
int i;
char *old_text;
gtk_tree_model_get (model, &iter, column, &old_text, -1);
g_free (old_text);

View File

@@ -13,7 +13,7 @@
static GtkWidget *window = NULL;
static void
response_cb (GtkDialog *dialog, gint response_id)
response_cb (GtkDialog *dialog, int response_id)
{
gtk_window_destroy (GTK_WINDOW (window));
window = NULL;

View File

@@ -22,8 +22,8 @@ format_number (GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer data)
{
gint num;
gchar *text;
int num;
char *text;
gtk_tree_model_get (model, iter, GPOINTER_TO_INT (data), &num, -1);
text = g_strdup_printf ("%d", num);
@@ -35,11 +35,11 @@ static void
filter_modify_func (GtkTreeModel *model,
GtkTreeIter *iter,
GValue *value,
gint column,
int column,
gpointer data)
{
GtkTreeModelFilter *filter_model = GTK_TREE_MODEL_FILTER (model);
gint width, height;
int width, height;
GtkTreeModel *child_model;
GtkTreeIter child_iter;
@@ -75,7 +75,7 @@ visible_func (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
gint width;
int width;
gtk_tree_model_get (model, iter,
WIDTH_COLUMN, &width,

View File

@@ -29,7 +29,7 @@ draw_color (GtkDrawingArea *drawingarea,
}
static GtkWidget *
color_swatch_new (const gchar *color)
color_swatch_new (const char *color)
{
GtkWidget *button, *area;
@@ -48,7 +48,7 @@ do_flowbox (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *scrolled, *flowbox;
const gchar *colors[] = {
const char *colors[] = {
"AliceBlue",
"AntiqueWhite",
"AntiqueWhite1",
@@ -716,7 +716,7 @@ do_flowbox (GtkWidget *do_widget)
"YellowGreen",
NULL
};
gint i;
int i;
if (!window)
{

View File

@@ -295,7 +295,7 @@ update_display (void)
GList *l;
PangoAttrList *attrs;
PangoAttribute *attr;
gint ins, bound;
int ins, bound;
guint start, end;
PangoLanguage *lang;
char *font_desc;
@@ -479,7 +479,7 @@ update_script_combo (void)
{
GtkListStore *store;
hb_font_t *hb_font;
gint i, j, k;
int i, j, k;
PangoFont *pango_font;
GHashTable *tags;
GHashTableIter iter;
@@ -593,7 +593,7 @@ update_script_combo (void)
static void
update_features (void)
{
gint i, j;
int i, j;
GtkTreeModel *model;
GtkTreeIter iter;
guint script_index, lang_index;
@@ -728,8 +728,8 @@ static void
entry_activated (GtkEntry *entry,
GtkAdjustment *adjustment)
{
gdouble value;
gchar *err = NULL;
double value;
char *err = NULL;
value = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
if (err != NULL)
@@ -939,7 +939,7 @@ instance_changed (GtkComboBox *combo)
{
Axis *axis;
Axis akey;
gdouble value;
double value;
value = coords[ai[i].axis_index];

View File

@@ -36,11 +36,11 @@ adjustment_get_normalized_value (GtkAdjustment *adj)
static void
val_to_xy (GtkFontPlane *plane,
gint *x,
gint *y)
int *x,
int *y)
{
gdouble u, v;
gint width, height;
double u, v;
int width, height;
width = gtk_widget_get_allocated_width (GTK_WIDGET (plane));
height = gtk_widget_get_allocated_height (GTK_WIDGET (plane));
@@ -57,8 +57,8 @@ plane_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
GtkFontPlane *plane = GTK_FONT_PLANE (widget);
gint x, y;
gint width, height;
int x, y;
int width, height;
cairo_t *cr;
val_to_xy (plane, &x, &y);
@@ -125,11 +125,11 @@ adjustment_set_normalized_value (GtkAdjustment *adj,
static void
update_value (GtkFontPlane *plane,
gint x,
gint y)
int x,
int y)
{
GtkWidget *widget = GTK_WIDGET (plane);
gdouble u, v;
double u, v;
u = CLAMP (x * (1.0 / gtk_widget_get_allocated_width (widget)), 0, 1);
v = CLAMP (1 - y * (1.0 / gtk_widget_get_allocated_height (widget)), 0, 1);
@@ -142,8 +142,8 @@ update_value (GtkFontPlane *plane,
static void
plane_drag_gesture_begin (GtkGestureDrag *gesture,
gdouble start_x,
gdouble start_y,
double start_x,
double start_y,
GtkFontPlane *plane)
{
guint button;
@@ -164,11 +164,11 @@ plane_drag_gesture_begin (GtkGestureDrag *gesture,
static void
plane_drag_gesture_update (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y,
double offset_x,
double offset_y,
GtkFontPlane *plane)
{
gdouble start_x, start_y;
double start_x, start_y;
gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (gesture),
&start_x, &start_y);
@@ -177,8 +177,8 @@ plane_drag_gesture_update (GtkGestureDrag *gesture,
static void
plane_drag_gesture_end (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y,
double offset_x,
double offset_y,
GtkFontPlane *plane)
{
set_cross_cursor (GTK_WIDGET (plane), FALSE);

View File

@@ -9,8 +9,8 @@
static GtkGesture *rotate = NULL;
static GtkGesture *zoom = NULL;
static gdouble swipe_x = 0;
static gdouble swipe_y = 0;
static double swipe_x = 0;
static double swipe_y = 0;
static gboolean long_pressed = FALSE;
static gboolean
@@ -26,8 +26,8 @@ touchpad_swipe_gesture_begin (GtkGesture *gesture,
static void
swipe_gesture_swept (GtkGestureSwipe *gesture,
gdouble velocity_x,
gdouble velocity_y,
double velocity_x,
double velocity_y,
GtkWidget *widget)
{
swipe_x = velocity_x / 10;
@@ -37,8 +37,8 @@ swipe_gesture_swept (GtkGestureSwipe *gesture,
static void
long_press_gesture_pressed (GtkGestureLongPress *gesture,
gdouble x,
gdouble y,
double x,
double y,
GtkWidget *widget)
{
long_pressed = TRUE;
@@ -56,8 +56,8 @@ long_press_gesture_end (GtkGesture *gesture,
static void
rotation_angle_changed (GtkGestureRotate *gesture,
gdouble angle,
gdouble delta,
double angle,
double delta,
GtkWidget *widget)
{
gtk_widget_queue_draw (widget);
@@ -65,7 +65,7 @@ rotation_angle_changed (GtkGestureRotate *gesture,
static void
zoom_scale_changed (GtkGestureZoom *gesture,
gdouble scale,
double scale,
GtkWidget *widget)
{
gtk_widget_queue_draw (widget);
@@ -93,8 +93,8 @@ drawing_area_draw (GtkDrawingArea *area,
{
cairo_pattern_t *pat;
cairo_matrix_t matrix;
gdouble angle, scale;
gdouble x_center, y_center;
double angle, scale;
double x_center, y_center;
gtk_gesture_get_bounding_box_center (GTK_GESTURE (zoom), &x_center, &y_center);

View File

@@ -98,7 +98,7 @@ gtk_fishbowl_measure (GtkWidget *widget,
GHashTableIter iter;
gpointer key, value;
GtkFishbowlChild *child;
gint child_min, child_nat;
int child_min, child_nat;
*minimum = 0;
*natural = 0;

View File

@@ -18,7 +18,7 @@ static void
insert_link (GtkTextBuffer *buffer,
GtkTextIter *iter,
const char *text,
gint page)
int page)
{
GtkTextTag *tag;
@@ -35,7 +35,7 @@ insert_link (GtkTextBuffer *buffer,
*/
static void
show_page (GtkTextBuffer *buffer,
gint page)
int page)
{
GtkTextIter iter;
@@ -91,7 +91,7 @@ follow_if_link (GtkWidget *text_view,
for (tagp = tags; tagp != NULL; tagp = tagp->next)
{
GtkTextTag *tag = tagp->data;
gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
int page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
if (page != 0)
{
@@ -134,14 +134,14 @@ key_pressed (GtkEventController *controller,
}
static void set_cursor_if_appropriate (GtkTextView *text_view,
gint x,
gint y);
int x,
int y);
static void
released_cb (GtkGestureClick *gesture,
guint n_press,
gdouble x,
gdouble y,
double x,
double y,
GtkWidget *text_view)
{
GtkTextIter start, end, iter;
@@ -168,8 +168,8 @@ released_cb (GtkGestureClick *gesture,
static void
motion_cb (GtkEventControllerMotion *controller,
gdouble x,
gdouble y,
double x,
double y,
GtkTextView *text_view)
{
set_cursor_if_appropriate (text_view, x, y);
@@ -183,8 +183,8 @@ static gboolean hovering_over_link = FALSE;
*/
static void
set_cursor_if_appropriate (GtkTextView *text_view,
gint x,
gint y)
int x,
int y)
{
GSList *tags = NULL, *tagp = NULL;
GtkTextIter iter;
@@ -196,7 +196,7 @@ set_cursor_if_appropriate (GtkTextView *text_view,
for (tagp = tags; tagp != NULL; tagp = tagp->next)
{
GtkTextTag *tag = tagp->data;
gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
int page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
if (page != 0)
{

View File

@@ -25,7 +25,7 @@ enum
static GdkPixbuf *file_pixbuf, *folder_pixbuf;
gchar *parent;
char *parent;
GtkWidget *up_button;
/* Loads the images for the demo and returns whether the operation succeeded */
@@ -47,7 +47,7 @@ static void
fill_store (GtkListStore *store)
{
GDir *dir;
const gchar *name;
const char *name;
GtkTreeIter iter;
/* First clear the store */
@@ -62,7 +62,7 @@ fill_store (GtkListStore *store)
name = g_dir_read_name (dir);
while (name != NULL)
{
gchar *path, *display_name;
char *path, *display_name;
gboolean is_dir;
/* We ignore hidden files that start with a '.' */
@@ -90,14 +90,14 @@ fill_store (GtkListStore *store)
g_dir_close (dir);
}
static gint
static int
sort_func (GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
gpointer user_data)
{
gboolean is_dir_a, is_dir_b;
gchar *name_a, *name_b;
char *name_a, *name_b;
int ret;
/* We need this function because we want to sort
@@ -158,7 +158,7 @@ item_activated (GtkIconView *icon_view,
gpointer user_data)
{
GtkListStore *store;
gchar *path;
char *path;
GtkTreeIter iter;
gboolean is_dir;
@@ -192,7 +192,7 @@ up_clicked (GtkButton *item,
gpointer user_data)
{
GtkListStore *store;
gchar *dir_name;
char *dir_name;
store = GTK_LIST_STORE (user_data);

View File

@@ -19,8 +19,8 @@ static void
fill_store (GtkListStore *store)
{
GtkTreeIter iter;
const gchar *text[] = { "Red", "Green", "Blue", "Yellow" };
gint i;
const char *text[] = { "Red", "Green", "Blue", "Yellow" };
int i;
/* First clear the store */
gtk_list_store_clear (store);
@@ -49,7 +49,7 @@ set_cell_color (GtkCellLayout *cell_layout,
GtkTreeIter *iter,
gpointer data)
{
gchar *text;
char *text;
GdkRGBA color;
guint32 pixel = 0;
GdkPixbuf *pixbuf;
@@ -60,10 +60,10 @@ set_cell_color (GtkCellLayout *cell_layout,
if (gdk_rgba_parse (&color, text))
pixel =
((gint)(color.red * 255)) << 24 |
((gint)(color.green * 255)) << 16 |
((gint)(color.blue * 255)) << 8 |
((gint)(color.alpha * 255));
((int)(color.red * 255)) << 24 |
((int)(color.green * 255)) << 16 |
((int)(color.blue * 255)) << 8 |
((int)(color.alpha * 255));
g_free (text);
@@ -77,8 +77,8 @@ set_cell_color (GtkCellLayout *cell_layout,
static void
edited (GtkCellRendererText *cell,
gchar *path_string,
gchar *text,
char *path_string,
char *text,
gpointer data)
{
GtkTreeModel *model;

View File

@@ -43,10 +43,10 @@ progressive_prepared_callback (GdkPixbufLoader *loader,
static void
progressive_updated_callback (GdkPixbufLoader *loader,
gint x,
gint y,
gint width,
gint height,
int x,
int y,
int width,
int height,
gpointer data)
{
GtkWidget *picture;
@@ -58,7 +58,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
gtk_picture_set_pixbuf (GTK_PICTURE (picture), pixbuf);
}
static gint
static int
progressive_timeout (gpointer data)
{
GtkWidget *picture;

View File

@@ -8,7 +8,7 @@
static void
on_bar_response (GtkInfoBar *info_bar,
gint response_id,
int response_id,
gpointer user_data)
{
GtkWidget *dialog;

View File

@@ -9,7 +9,7 @@
static void
response_cb (GtkWidget *dialog,
gint response_id,
int response_id,
gpointer data)
{
gtk_window_destroy (GTK_WINDOW (dialog));
@@ -17,7 +17,7 @@ response_cb (GtkWidget *dialog,
static gboolean
activate_link (GtkWidget *label,
const gchar *uri,
const char *uri,
gpointer data)
{
if (g_strcmp0 (uri, "keynav") == 0)

View File

@@ -81,7 +81,7 @@ spinner_timeout (gpointer data)
static GtkTreeModel *
create_model (void)
{
gint i = 0;
int i = 0;
GtkListStore *store;
GtkTreeIter iter;

View File

@@ -89,14 +89,14 @@ static GParamSpec *color_properties[N_COLOR_PROPS] = { NULL, };
static void
rgb_to_hsv (GdkRGBA *rgba,
gdouble *h_out,
gdouble *s_out,
gdouble *v_out)
double *h_out,
double *s_out,
double *v_out)
{
gdouble red, green, blue;
gdouble h, s, v;
gdouble min, max;
gdouble delta;
double red, green, blue;
double h, s, v;
double min, max;
double delta;
red = rgba->red;
green = rgba->green;
@@ -662,7 +662,6 @@ create_color_grid (void)
{
GtkWidget *gridview;
GtkListItemFactory *factory;
GListModel *model, *selection;
gridview = gtk_grid_view_new ();
gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
@@ -676,13 +675,6 @@ create_color_grid (void)
gtk_grid_view_set_max_columns (GTK_GRID_VIEW (gridview), 24);
gtk_grid_view_set_enable_rubberband (GTK_GRID_VIEW (gridview), TRUE);
model = G_LIST_MODEL (gtk_sort_list_model_new (gtk_color_list_new (0), NULL));
selection = G_LIST_MODEL (gtk_multi_selection_new (model));
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), selection);
g_object_unref (selection);
g_object_unref (model);
return gridview;
}
@@ -835,6 +827,22 @@ update_selection_average (GListModel *model,
g_object_unref (color);
}
static void
update_progress_cb (GtkSortListModel *model,
GParamSpec *pspec,
GtkProgressBar *progress)
{
guint total;
guint pending;
total = g_list_model_get_n_items (G_LIST_MODEL (model));
total = MAX (total, 1); /* avoid div by 0 below */
pending = gtk_sort_list_model_get_pending (model);
gtk_widget_set_visible (GTK_WIDGET (progress), pending != 0);
gtk_progress_bar_set_fraction (progress, (total - pending) / (double) total);
}
static GtkWidget *window = NULL;
GtkWidget *
@@ -842,10 +850,11 @@ do_listview_colors (GtkWidget *do_widget)
{
if (window == NULL)
{
GtkWidget *header, *gridview, *sw, *box, *dropdown;
GtkMultiSelection *selection;
GtkSortListModel *sort_model;
GtkWidget *header, *overlay, *gridview, *sw, *box, *dropdown;
GtkListItemFactory *factory;
GListStore *factories;
GListModel *model;
GtkSorter *sorter;
GtkSorter *multi_sorter;
GListStore *sorters;
@@ -863,6 +872,7 @@ do_listview_colors (GtkWidget *do_widget)
GtkWidget *selection_average_picture;
GtkWidget *selection_info_toggle;
GtkWidget *selection_info_revealer;
GtkWidget *progress;
GtkCssProvider *provider;
provider = gtk_css_provider_new ();
@@ -872,6 +882,10 @@ do_listview_colors (GtkWidget *do_widget)
800);
g_object_unref (provider);
sort_model = gtk_sort_list_model_new (gtk_color_list_new (0), NULL);
gtk_sort_list_model_set_incremental (sort_model, TRUE);
selection = GTK_MULTI_SELECTION (gtk_multi_selection_new (G_LIST_MODEL (sort_model)));
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Colors");
header = gtk_header_bar_new ();
@@ -882,8 +896,17 @@ do_listview_colors (GtkWidget *do_widget)
gtk_widget_get_display (do_widget));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer*)&window);
overlay = gtk_overlay_new ();
gtk_window_set_child (GTK_WINDOW (window), overlay);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_window_set_child (GTK_WINDOW (window), box);
gtk_overlay_set_child (GTK_OVERLAY (overlay), box);
progress = gtk_progress_bar_new ();
gtk_widget_set_hexpand (progress, TRUE);
gtk_widget_set_valign (progress, GTK_ALIGN_START);
g_signal_connect (sort_model, "notify::pending", G_CALLBACK (update_progress_cb), progress);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), progress);
selection_info_revealer = gtk_revealer_new ();
gtk_box_append (GTK_BOX (box), selection_info_revealer);
@@ -936,12 +959,12 @@ do_listview_colors (GtkWidget *do_widget)
gtk_box_append (GTK_BOX (box), sw);
gridview = create_color_grid ();
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), G_LIST_MODEL (selection));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview);
gtk_widget_set_hexpand (sw, TRUE);
gtk_widget_set_vexpand (sw, TRUE);
model = gtk_grid_view_get_model (GTK_GRID_VIEW (gridview));
selection_filter = G_LIST_MODEL (gtk_selection_filter_model_new (GTK_SELECTION_MODEL (model)));
selection_filter = G_LIST_MODEL (gtk_selection_filter_model_new (GTK_SELECTION_MODEL (selection)));
g_signal_connect (selection_filter, "items-changed", G_CALLBACK (update_selection_count), selection_size_label);
g_signal_connect (selection_filter, "items-changed", G_CALLBACK (update_selection_average), selection_average_picture);
@@ -950,9 +973,6 @@ do_listview_colors (GtkWidget *do_widget)
g_object_unref (selection_filter);
g_object_unref (no_selection);
model = gtk_multi_selection_get_model (GTK_MULTI_SELECTION (model));
g_object_ref (model);
selection_info_toggle = gtk_toggle_button_new ();
gtk_button_set_icon_name (GTK_BUTTON (selection_info_toggle), "emblem-important-symbolic");
gtk_widget_set_tooltip_text (selection_info_toggle, "Show selection info");
@@ -965,7 +985,7 @@ do_listview_colors (GtkWidget *do_widget)
button = gtk_button_new_with_mnemonic ("_Refill");
g_signal_connect (button, "clicked",
G_CALLBACK (refill),
gtk_sort_list_model_get_model (GTK_SORT_LIST_MODEL (model)));
gtk_sort_list_model_get_model (sort_model));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), button);
@@ -980,15 +1000,14 @@ do_listview_colors (GtkWidget *do_widget)
gtk_label_set_width_chars (GTK_LABEL (label), len + 2);
gtk_label_set_xalign (GTK_LABEL (label), 1);
g_signal_connect (gtk_grid_view_get_model (GTK_GRID_VIEW (gridview)),
"items-changed", G_CALLBACK (items_changed_cb), label);
g_signal_connect (selection, "items-changed", G_CALLBACK (items_changed_cb), label);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), label);
dropdown = gtk_drop_down_new ();
gtk_drop_down_set_from_strings (GTK_DROP_DOWN (dropdown), (const char *[]) { "8", "64", "512", "4096", "32768", "262144", "2097152", "16777216", NULL });
g_signal_connect (dropdown, "notify::selected",
G_CALLBACK (limit_changed_cb),
gtk_sort_list_model_get_model (GTK_SORT_LIST_MODEL (model)));
gtk_sort_list_model_get_model (sort_model));
g_signal_connect (dropdown, "notify::selected",
G_CALLBACK (limit_changed_cb2),
label);
@@ -1080,7 +1099,7 @@ do_listview_colors (GtkWidget *do_widget)
gtk_drop_down_set_model (GTK_DROP_DOWN (dropdown), G_LIST_MODEL (sorters));
g_object_unref (sorters);
g_object_bind_property (dropdown, "selected-item", model, "sorter", G_BINDING_SYNC_CREATE);
g_object_bind_property (dropdown, "selected-item", sort_model, "sorter", G_BINDING_SYNC_CREATE);
factories = g_list_store_new (GTK_TYPE_LIST_ITEM_FACTORY);
@@ -1112,7 +1131,6 @@ do_listview_colors (GtkWidget *do_widget)
g_object_unref (factories);
g_object_bind_property (dropdown, "selected-item", gridview, "factory", G_BINDING_SYNC_CREATE);
g_object_unref (model);
}
if (!gtk_widget_get_visible (window))

View File

@@ -242,16 +242,11 @@ transform_settings_to_keys (GBinding *binding,
g_object_unref (settings);
sort_model = gtk_sort_list_model_new (G_LIST_MODEL (store),
gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data)));
g_object_unref (store);
g_object_ref (gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data))));
filter = gtk_string_filter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name"));
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (sort_model), filter);
g_object_unref (sort_model);
g_set_object (&current_filter, filter);
g_object_unref (filter);
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (sort_model), filter);
selection_model = gtk_no_selection_new (G_LIST_MODEL (filter_model));
g_object_unref (filter_model);
@@ -403,8 +398,8 @@ do_listview_settings (GtkWidget *do_widget)
g_object_unref (actions);
model = create_settings_model (NULL, NULL);
treemodel = gtk_tree_list_model_new (FALSE,
model,
treemodel = gtk_tree_list_model_new (model,
FALSE,
TRUE,
create_settings_model,
NULL,
@@ -419,7 +414,6 @@ do_listview_settings (GtkWidget *do_widget)
gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
g_object_unref (selection);
g_object_unref (treemodel);
g_object_unref (model);
name_column = GTK_COLUMN_VIEW_COLUMN (gtk_builder_get_object (builder, "name_column"));
sorter = gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name"));

View File

@@ -13,7 +13,7 @@
static GtkWidget *info_view;
static GtkWidget *source_view;
static gchar *current_file = NULL;
static char *current_file = NULL;
static GtkWidget *notebook;
static GtkSingleSelection *selection;
@@ -141,7 +141,7 @@ activate_about (GSimpleAction *action,
gpointer user_data)
{
GtkApplication *app = user_data;
const gchar *authors[] = {
const char *authors[] = {
"The GTK Team",
NULL
};
@@ -252,11 +252,9 @@ static const char *types[] =
"static",
"const ",
"void",
"gint",
" int ",
" char ",
"gchar ",
"gfloat",
"char ",
"float",
"double",
"gint8",
@@ -272,8 +270,6 @@ static const char *types[] =
"gshort",
"gushort",
"gulong",
"gdouble",
"gldouble",
"gpointer",
"NULL",
"GList",
@@ -385,14 +381,14 @@ static const char *control[] =
NULL
};
void
parse_chars (gchar *text,
gchar **end_ptr,
gint *state,
parse_chars (char *text,
char **end_ptr,
int *state,
const char **tag,
gboolean start)
{
gint i;
gchar *next_token;
int i;
char *next_token;
/* Handle comments first */
if (*state == STATE_IN_COMMENT)
@@ -462,7 +458,7 @@ parse_chars (gchar *text,
/* check for string */
if (text[0] == '"')
{
gint maybe_escape = FALSE;
int maybe_escape = FALSE;
*end_ptr = text + 1;
*tag = "string";
@@ -525,9 +521,9 @@ void
fontify (GtkTextBuffer *source_buffer)
{
GtkTextIter start_iter, next_iter, tmp_iter;
gint state;
gchar *text;
gchar *start_ptr, *end_ptr;
int state;
char *text;
char *start_ptr, *end_ptr;
const char *tag;
gtk_text_buffer_create_tag (source_buffer, "source",
@@ -695,10 +691,10 @@ static struct {
};
static void
add_data_tab (const gchar *demoname)
add_data_tab (const char *demoname)
{
gchar *resource_dir, *resource_name;
gchar **resources;
char *resource_dir, *resource_name;
char **resources;
GtkWidget *widget, *label;
guint i, j;
@@ -742,15 +738,15 @@ add_data_tab (const gchar *demoname)
static void
remove_data_tabs (void)
{
gint i;
int i;
for (i = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) - 1; i > 1; i--)
gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), i);
}
void
load_file (const gchar *demoname,
const gchar *filename)
load_file (const char *demoname,
const char *filename)
{
GtkTextBuffer *info_buffer, *source_buffer;
GtkTextIter start, end;
@@ -758,9 +754,9 @@ load_file (const gchar *demoname,
GError *err = NULL;
int state = 0;
gboolean in_para = 0;
gchar **lines;
char **lines;
GBytes *bytes;
gint i;
int i;
if (!g_strcmp0 (current_file, filename))
return;
@@ -800,9 +796,9 @@ load_file (const gchar *demoname,
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
for (i = 0; lines[i] != NULL; i++)
{
gchar *p;
gchar *q;
gchar *r;
char *p;
char *q;
char *r;
/* Make sure \r is stripped at the end for the poor windows people */
lines[i] = g_strchomp (lines[i]);
@@ -1140,8 +1136,8 @@ activate (GApplication *app)
g_signal_connect (search_bar, "notify::search-mode-enabled", G_CALLBACK (clear_search), NULL);
listmodel = create_demo_model ();
treemodel = gtk_tree_list_model_new (FALSE,
G_LIST_MODEL (listmodel),
treemodel = gtk_tree_list_model_new (G_LIST_MODEL (listmodel),
FALSE,
TRUE,
get_child_model,
NULL,
@@ -1149,6 +1145,7 @@ activate (GApplication *app)
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (treemodel), NULL);
filter = gtk_custom_filter_new ((GtkCustomFilterFunc)demo_filter_by_name, filter_model, NULL);
gtk_filter_list_model_set_filter (filter_model, filter);
g_object_unref (filter);
search_entry = GTK_WIDGET (gtk_builder_get_object (builder, "search-entry"));
g_signal_connect (search_entry, "search-changed", G_CALLBACK (demo_search_changed_cb), filter);
@@ -1190,12 +1187,12 @@ list_demos (void)
}
}
static gint
static int
command_line (GApplication *app,
GApplicationCommandLine *cmdline)
{
GVariantDict *options;
const gchar *name = NULL;
const char *name = NULL;
gboolean autoquit = FALSE;
gboolean list = FALSE;
DemoData *d, *c;
@@ -1298,8 +1295,8 @@ main (int argc, char **argv)
{ "inspector", activate_inspector, NULL, NULL, NULL },
};
struct {
const gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *accelerators[2];
} accels[] = {
{ "app.about", { "F1", NULL } },
{ "app.quit", { "<Control>q", NULL } },

View File

@@ -21,7 +21,7 @@ source_toggled (GtkToggleButton *button)
{
GtkTextBuffer *buffer;
GtkTextIter start, end;
gchar *markup;
char *markup;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view2));
gtk_text_buffer_get_bounds (buffer, &start, &end);
@@ -50,7 +50,7 @@ do_markup (GtkWidget *do_widget)
GtkTextBuffer *buffer;
GtkTextIter iter;
GBytes *bytes;
const gchar *markup;
const char *markup;
GtkWidget *header;
GtkWidget *show_source;
@@ -102,7 +102,7 @@ do_markup (GtkWidget *do_widget)
gtk_stack_add_named (GTK_STACK (stack), sw, "source");
bytes = g_resources_lookup_data ("/markup/markup.txt", 0, NULL);
markup = (const gchar *)g_bytes_get_data (bytes, NULL);
markup = (const char *)g_bytes_get_data (bytes, NULL);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_get_start_iter (buffer, &iter);

View File

@@ -12,9 +12,9 @@ static void
margin_changed (GtkAdjustment *adjustment,
GtkTextView *text)
{
gint value;
int value;
value = (gint)gtk_adjustment_get_value (adjustment);
value = (int)gtk_adjustment_get_value (adjustment);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (text), value);
g_object_set (tag, "pixels-above-lines", value, NULL);
}

View File

@@ -9,7 +9,7 @@
#include <gtk/gtkunixprint.h>
static void
done_cb (GtkDialog *dialog, gint response, gpointer data)
done_cb (GtkDialog *dialog, int response, gpointer data)
{
gtk_window_destroy (GTK_WINDOW (dialog));
}

View File

@@ -20,7 +20,7 @@ typedef struct
cairo_t *cr;
GdkRGBA draw_color;
GtkPadController *pad_controller;
gdouble brush_size;
double brush_size;
} DrawingArea;
typedef struct
@@ -38,7 +38,7 @@ static GtkPadActionEntry pad_actions[] = {
{ GTK_PAD_ACTION_STRIP, -1, -1, N_("Brush size"), "pad.brush_size" },
};
static const gchar *pad_colors[] = {
static const char *pad_colors[] = {
"black",
"pink",
"green",
@@ -55,8 +55,8 @@ static void drawing_area_set_color (DrawingArea *area,
static void
drawing_area_ensure_surface (DrawingArea *area,
gint width,
gint height)
int width,
int height)
{
if (!area->surface ||
cairo_image_surface_get_width (area->surface) != width ||
@@ -154,7 +154,7 @@ on_pad_button_activate (GSimpleAction *action,
GVariant *parameter,
DrawingArea *area)
{
const gchar *color = g_object_get_data (G_OBJECT (action), "color");
const char *color = g_object_get_data (G_OBJECT (action), "color");
GdkRGBA rgba;
gdk_rgba_parse (&rgba, color);
@@ -166,7 +166,7 @@ on_pad_knob_change (GSimpleAction *action,
GVariant *parameter,
DrawingArea *area)
{
gdouble value = g_variant_get_double (parameter);
double value = g_variant_get_double (parameter);
area->brush_size = value;
}
@@ -195,7 +195,7 @@ drawing_area_root (GtkWidget *widget)
GSimpleActionGroup *action_group;
GSimpleAction *action;
GtkWidget *toplevel;
gint i;
int i;
GTK_WIDGET_CLASS (drawing_area_parent_class)->root (widget);
@@ -255,9 +255,9 @@ drawing_area_class_init (DrawingAreaClass *klass)
static void
drawing_area_apply_stroke (DrawingArea *area,
GdkDeviceTool *tool,
gdouble x,
gdouble y,
gdouble pressure)
double x,
double y,
double pressure)
{
if (gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
{
@@ -281,8 +281,8 @@ drawing_area_apply_stroke (DrawingArea *area,
static void
stylus_gesture_down (GtkGestureStylus *gesture,
gdouble x,
gdouble y,
double x,
double y,
DrawingArea *area)
{
cairo_new_path (area->cr);
@@ -290,13 +290,13 @@ stylus_gesture_down (GtkGestureStylus *gesture,
static void
stylus_gesture_motion (GtkGestureStylus *gesture,
gdouble x,
gdouble y,
double x,
double y,
DrawingArea *area)
{
GdkTimeCoord *backlog;
GdkDeviceTool *tool;
gdouble pressure;
double pressure;
guint n_items;
tool = gtk_gesture_stylus_get_device_tool (gesture);

View File

@@ -47,9 +47,9 @@ toggle_shrink (GtkWidget *widget,
static GtkWidget *
create_pane_options (GtkPaned *paned,
const gchar *frame_label,
const gchar *label1,
const gchar *label2)
const char *frame_label,
const char *label1,
const char *label2)
{
GtkWidget *child1, *child2;
GtkWidget *frame;

View File

@@ -39,7 +39,7 @@ static GdkPixbuf *frame;
/* Background image */
static GdkPixbuf *background;
static gint back_width, back_height;
static int back_width, back_height;
/* Images */
static GdkPixbuf *images[N_IMAGES];
@@ -51,7 +51,7 @@ static GtkWidget *da;
static gboolean
load_pixbufs (GError **error)
{
gint i;
int i;
if (background)
return TRUE; /* already loaded earlier */

View File

@@ -14,13 +14,13 @@
typedef struct
{
gchar *resourcename;
gdouble font_size;
char *resourcename;
double font_size;
gint lines_per_page;
gchar **lines;
gint num_lines;
gint num_pages;
int lines_per_page;
char **lines;
int num_lines;
int num_pages;
} PrintData;
static void
@@ -55,17 +55,17 @@ begin_print (GtkPrintOperation *operation,
static void
draw_page (GtkPrintOperation *operation,
GtkPrintContext *context,
gint page_nr,
int page_nr,
gpointer user_data)
{
PrintData *data = (PrintData *)user_data;
cairo_t *cr;
PangoLayout *layout;
gint text_width, text_height;
gdouble width;
gint line, i;
int text_width, text_height;
double width;
int line, i;
PangoFontDescription *desc;
gchar *page_str;
char *page_str;
cr = gtk_print_context_get_cairo_context (context);
width = gtk_print_context_get_width (context);

View File

@@ -6,7 +6,7 @@
#include <gtk/gtk.h>
static gint count = 0;
static int count = 0;
static guint timeout = 0;
static void
@@ -25,7 +25,7 @@ static gboolean
reveal_one (gpointer data)
{
GtkWidget *window = data;
gchar *name;
char *name;
GtkRevealer *revealer;
name = g_strdup_printf ("revealer%d", count);

View File

@@ -123,7 +123,7 @@ set_search_by (GSimpleAction *action,
static void
icon_press_cb (GtkEntry *entry,
gint position,
int position,
gpointer data)
{
if (position == GTK_ENTRY_ICON_PRIMARY)

View File

@@ -8,12 +8,12 @@
static void
show_shortcuts (GtkWidget *window,
const gchar *id,
const gchar *view)
const char *id,
const char *view)
{
GtkBuilder *builder;
GtkWidget *overlay;
gchar *path;
char *path;
path = g_strdup_printf ("/shortcuts/%s.ui", id);
builder = gtk_builder_new_from_resource (path);

View File

@@ -18,7 +18,7 @@ do_sidebar (GtkWidget *do_widget)
GtkWidget *box;
GtkWidget *widget;
GtkWidget *header;
const gchar* pages[] = {
const char * pages[] = {
"Welcome to GTK",
"GtkStackSidebar Widget",
"Automatic navigation",
@@ -30,7 +30,7 @@ do_sidebar (GtkWidget *do_widget)
"Page 9",
NULL
};
const gchar *c = NULL;
const char *c = NULL;
guint i;
if (!window)

View File

@@ -11,13 +11,13 @@
#include <math.h>
#include <stdlib.h>
gint
int
spinbutton_hex_spin_input (GtkSpinButton *spin_button,
gdouble *new_val)
double *new_val)
{
const gchar *buf;
gchar *err;
gdouble res;
const char *buf;
char *err;
double res;
buf = gtk_editable_get_text (GTK_EDITABLE (spin_button));
res = strtol (buf, &err, 16);
@@ -28,19 +28,19 @@ spinbutton_hex_spin_input (GtkSpinButton *spin_button,
return TRUE;
}
gint
int
spinbutton_hex_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
gchar *buf;
gdouble val;
char *buf;
double val;
adjustment = gtk_spin_button_get_adjustment (spin_button);
val = gtk_adjustment_get_value (adjustment);
if (fabs (val) < 1e-5)
buf = g_strdup ("0x00");
else
buf = g_strdup_printf ("0x%.2X", (gint) val);
buf = g_strdup_printf ("0x%.2X", (int) val);
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
g_free (buf);
@@ -48,17 +48,17 @@ spinbutton_hex_spin_output (GtkSpinButton *spin_button)
return TRUE;
}
gint
int
spinbutton_time_spin_input (GtkSpinButton *spin_button,
gdouble *new_val)
double *new_val)
{
const gchar *text;
gchar **str;
const char *text;
char **str;
gboolean found = FALSE;
gint hours;
gint minutes;
gchar *endh;
gchar *endm;
int hours;
int minutes;
char *endh;
char *endm;
text = gtk_editable_get_text (GTK_EDITABLE (spin_button));
str = g_strsplit (text, ":", 2);
@@ -87,13 +87,13 @@ spinbutton_time_spin_input (GtkSpinButton *spin_button,
return TRUE;
}
gint
int
spinbutton_time_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
gchar *buf;
gdouble hours;
gdouble minutes;
char *buf;
double hours;
double minutes;
adjustment = gtk_spin_button_get_adjustment (spin_button);
hours = gtk_adjustment_get_value (adjustment) / 60.0;
@@ -121,12 +121,12 @@ static const char *month[12] = {
"December"
};
gint
int
spinbutton_month_spin_input (GtkSpinButton *spin_button,
gdouble *new_val)
double *new_val)
{
gint i;
gchar *tmp1, *tmp2;
int i;
char *tmp1, *tmp2;
gboolean found = FALSE;
for (i = 1; i <= 12; i++)
@@ -145,17 +145,17 @@ spinbutton_month_spin_input (GtkSpinButton *spin_button,
*new_val = 0.0;
return GTK_INPUT_ERROR;
}
*new_val = (gdouble) i;
*new_val = (double) i;
return TRUE;
}
gint
int
spinbutton_month_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
gdouble value;
gint i;
double value;
int i;
adjustment = gtk_spin_button_get_adjustment (spin_button);
value = gtk_adjustment_get_value (adjustment);

View File

@@ -14,7 +14,7 @@
typedef struct _TreeItem TreeItem;
struct _TreeItem
{
const gchar *label;
const char *label;
gboolean alex;
gboolean havoc;
gboolean tim;
@@ -222,7 +222,7 @@ create_model (void)
static void
item_toggled (GtkCellRendererToggle *cell,
gchar *path_str,
char *path_str,
gpointer data)
{
GtkTreeModel *model = (GtkTreeModel *)data;
@@ -230,7 +230,7 @@ item_toggled (GtkCellRendererToggle *cell,
GtkTreeIter iter;
gboolean toggle_item;
gint *column;
int *column;
column = g_object_get_data (G_OBJECT (cell), "column");
@@ -252,7 +252,7 @@ item_toggled (GtkCellRendererToggle *cell,
static void
add_columns (GtkTreeView *treeview)
{
gint col_offset;
int col_offset;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeModel *model = gtk_tree_view_get_model (treeview);
@@ -272,7 +272,7 @@ add_columns (GtkTreeView *treeview)
/* alex column */
renderer = gtk_cell_renderer_toggle_new ();
g_object_set (renderer, "xalign", 0.0, NULL);
g_object_set_data (G_OBJECT (renderer), "column", (gint *)ALEX_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)ALEX_COLUMN);
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
@@ -294,7 +294,7 @@ add_columns (GtkTreeView *treeview)
/* havoc column */
renderer = gtk_cell_renderer_toggle_new ();
g_object_set (renderer, "xalign", 0.0, NULL);
g_object_set_data (G_OBJECT (renderer), "column", (gint *)HAVOC_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)HAVOC_COLUMN);
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
@@ -315,7 +315,7 @@ add_columns (GtkTreeView *treeview)
/* tim column */
renderer = gtk_cell_renderer_toggle_new ();
g_object_set (renderer, "xalign", 0.0, NULL);
g_object_set_data (G_OBJECT (renderer), "column", (gint *)TIM_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)TIM_COLUMN);
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
@@ -337,7 +337,7 @@ add_columns (GtkTreeView *treeview)
/* owen column */
renderer = gtk_cell_renderer_toggle_new ();
g_object_set (renderer, "xalign", 0.0, NULL);
g_object_set_data (G_OBJECT (renderer), "column", (gint *)OWEN_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)OWEN_COLUMN);
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
@@ -358,7 +358,7 @@ add_columns (GtkTreeView *treeview)
/* dave column */
renderer = gtk_cell_renderer_toggle_new ();
g_object_set (renderer, "xalign", 0.0, NULL);
g_object_set_data (G_OBJECT (renderer), "column", (gint *)DAVE_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)DAVE_COLUMN);
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);

View File

@@ -43,7 +43,7 @@ about_activated (GSimpleAction *action,
gpointer user_data)
{
GtkApplication *app = user_data;
const gchar *authors[] = {
const char *authors[] = {
"The GTK Team",
NULL
};
@@ -103,7 +103,7 @@ static GActionEntry app_entries[] =
static void
icon_browser_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (icon_browser_app_parent_class)->startup (app);

View File

@@ -44,13 +44,13 @@ icon_browser_window_get_icon_theme (IconBrowserWindow *win)
static void
add_icon (IconBrowserWindow *win,
const gchar *name,
const gchar *description,
const gchar *context)
const char *name,
const char *description,
const char *context)
{
GtkIconTheme *icon_theme = icon_browser_window_get_icon_theme (win);
gchar *regular_name;
gchar *symbolic_name;
char *regular_name;
char *symbolic_name;
IbIcon *icon;
regular_name = g_strdup (name);
@@ -77,9 +77,9 @@ add_icon (IconBrowserWindow *win,
static void
add_context (IconBrowserWindow *win,
const gchar *id,
const gchar *name,
const gchar *description)
const char *id,
const char *name,
const char *description)
{
IbContext *context;
@@ -161,7 +161,7 @@ copy_to_clipboard (GtkButton *button,
}
static void
set_image (GtkWidget *image, const gchar *name, gint size)
set_image (GtkWidget *image, const char *name, int size)
{
gtk_image_set_from_icon_name (GTK_IMAGE (image), name);
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
@@ -219,7 +219,7 @@ item_activated (GtkGridView *view,
static GdkPaintable *
get_image_paintable (GtkImage *image)
{
const gchar *icon_name;
const char *icon_name;
GtkIconTheme *icon_theme;
GtkIconPaintable *icon;
int size;

View File

@@ -199,11 +199,11 @@ node_editor_application_activate (GApplication *app)
static void
node_editor_application_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
NodeEditorWindow *win;
gint i;
int i;
for (i = 0; i < n_files; i++)
{

View File

@@ -80,7 +80,7 @@ text_view_error_free (TextViewError *e)
g_free (e->message);
}
static gchar *
static char *
get_current_text (GtkTextBuffer *buffer)
{
GtkTextIter start, end;
@@ -288,14 +288,14 @@ text_view_query_tooltip_cb (GtkWidget *widget,
if (keyboard_tip)
{
gint offset;
int offset;
g_object_get (self->text_buffer, "cursor-position", &offset, NULL);
gtk_text_buffer_get_iter_at_offset (self->text_buffer, &iter, offset);
}
else
{
gint bx, by, trailing;
int bx, by, trailing;
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (self->text_view), GTK_TEXT_WINDOW_TEXT,
x, y, &bx, &by);
@@ -399,7 +399,7 @@ node_editor_window_load (NodeEditorWindow *self,
static void
open_response_cb (GtkWidget *dialog,
gint response,
int response,
NodeEditorWindow *self)
{
gtk_widget_hide (dialog);
@@ -448,7 +448,7 @@ open_cb (GtkWidget *button,
static void
save_response_cb (GtkWidget *dialog,
gint response,
int response,
NodeEditorWindow *self)
{
gtk_widget_hide (dialog);
@@ -577,7 +577,7 @@ create_cairo_texture (NodeEditorWindow *self)
static void
export_image_response_cb (GtkWidget *dialog,
gint response,
int response,
GdkTexture *texture)
{
gtk_widget_hide (dialog);

View File

@@ -33,8 +33,8 @@ update_title (GtkWindow *window)
static void
update_statusbar (void)
{
gchar *msg;
gint row, col;
char *msg;
int row, col;
GtkTextIter iter;
const char *print_str;
@@ -675,7 +675,7 @@ static GActionEntry app_entries[] = {
{ "print", activate_print, NULL, NULL, NULL }
};
static const gchar ui_info[] =
static const char ui_info[] =
"<interface>"
" <menu id='menubar'>"
" <submenu>"

View File

@@ -139,9 +139,9 @@ get_busy (GSimpleAction *action,
gtk_widget_set_sensitive (window, FALSE);
}
static gint current_page = 0;
static int current_page = 0;
static gboolean
on_page (gint i)
on_page (int i)
{
return current_page == i;
}
@@ -250,12 +250,12 @@ activate_about (GSimpleAction *action,
gpointer user_data)
{
GtkApplication *app = user_data;
const gchar *authors[] = {
const char *authors[] = {
"Andrea Cimitan",
"Cosimo Cecchi",
NULL
};
gchar *version;
char *version;
GString *s;
s = g_string_new ("");
@@ -422,8 +422,8 @@ static void
spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
{
GtkWidget *w;
gint v;
gchar *text;
int v;
char *text;
v = (int)gtk_adjustment_get_value (adjustment);
@@ -454,8 +454,8 @@ spin_value_reset (GtkWidget *button, GtkAdjustment *adjustment)
dismiss (button);
}
static gint pulse_time = 250;
static gint pulse_entry_mode = 0;
static int pulse_time = 250;
static int pulse_entry_mode = 0;
static void
remove_pulse (gpointer pulse_id)
@@ -482,7 +482,7 @@ pulse_it (GtkWidget *widget)
static void
update_pulse_time (GtkAdjustment *adjustment, GtkWidget *widget)
{
gdouble value;
double value;
guint pulse_id;
value = gtk_adjustment_get_value (adjustment);
@@ -537,12 +537,12 @@ on_entry_icon_release (GtkEntry *entry,
static void
on_scale_button_value_changed (GtkScaleButton *button,
gdouble value,
double value,
gpointer user_data)
{
GtkAdjustment *adjustment;
gdouble val;
gchar *str;
double val;
char *str;
adjustment = gtk_scale_button_get_adjustment (button);
val = gtk_scale_button_get_value (button);
@@ -557,9 +557,9 @@ on_scale_button_value_changed (GtkScaleButton *button,
}
else
{
gint percent;
int percent;
percent = (gint) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
percent = (int) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
str = g_strdup_printf (C_("volume percentage", "%d%%"), percent);
}
@@ -627,7 +627,7 @@ static void
on_range_from_changed (GtkSpinButton *from)
{
GtkSpinButton *to;
gint v1, v2;
int v1, v2;
to = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (from), "range_to_spin"));
@@ -642,7 +642,7 @@ static void
on_range_to_changed (GtkSpinButton *to)
{
GtkSpinButton *from;
gint v1, v2;
int v1, v2;
from = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (to), "range_from_spin"));
@@ -654,7 +654,7 @@ on_range_to_changed (GtkSpinButton *to)
}
static void
info_bar_response (GtkWidget *infobar, gint response_id)
info_bar_response (GtkWidget *infobar, int response_id)
{
if (response_id == GTK_RESPONSE_CLOSE)
gtk_widget_hide (infobar);
@@ -703,7 +703,7 @@ action_dialog_button_clicked (GtkButton *button, GtkWidget *page)
static void
page_changed_cb (GtkWidget *stack, GParamSpec *pspec, gpointer data)
{
const gchar *name;
const char *name;
GtkWidget *window;
GtkWidget *page;
@@ -853,10 +853,10 @@ update_title_header (GtkListBoxRow *row,
gpointer data)
{
GtkWidget *header;
gchar *title;
char *title;
header = gtk_list_box_row_get_header (row);
title = (gchar *)g_object_get_data (G_OBJECT (row), "title");
title = (char *)g_object_get_data (G_OBJECT (row), "title");
if (!header && title)
{
title = g_strdup_printf ("<b>%s</b>", title);
@@ -881,8 +881,8 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
{
GtkWidget *box, *row, *label, *swatch;
GdkRGBA rgba;
const gchar *color;
gchar *text;
const char *color;
char *text;
GtkWidget *silver;
GtkWidget *gold;
@@ -983,7 +983,7 @@ set_color (GtkListBox *box, GtkListBoxRow *row, GtkColorChooser *chooser)
static void
populate_colors (GtkWidget *widget, GtkWidget *chooser)
{
struct { const gchar *name; const gchar *color; const gchar *title; } colors[] = {
struct { const char *name; const char *color; const char *title; } colors[] = {
{ "2.5", "#C8828C", "Red" },
{ "5", "#C98286", NULL },
{ "7.5", "#C9827F", NULL },
@@ -1025,7 +1025,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
{ "7.5", "#C48299", NULL },
{ "10", "#C68292", NULL }
};
gint i;
int i;
GtkWidget *row, *box, *label, *swatch;
GtkWidget *sw;
GdkRGBA rgba;
@@ -1081,7 +1081,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
typedef struct {
GtkWidget *flowbox;
gchar *filename;
char *filename;
} BackgroundData;
static void
@@ -1127,11 +1127,11 @@ background_loaded_cb (GObject *source,
static void
populate_flowbox (GtkWidget *flowbox)
{
const gchar *location;
const char *location;
GDir *dir;
GError *error = NULL;
const gchar *name;
gchar *filename;
const char *name;
char *filename;
GFile *file;
GInputStream *stream;
BackgroundData *bd;
@@ -1288,7 +1288,7 @@ my_text_view_class_init (MyTextViewClass *class)
}
static void
my_text_view_set_background (MyTextView *tv, const gchar *filename, gboolean is_resource)
my_text_view_set_background (MyTextView *tv, const char *filename, gboolean is_resource)
{
GError *error = NULL;
GFile *file;
@@ -1331,12 +1331,12 @@ my_text_view_set_adjustment (MyTextView *tv, GtkAdjustment *adjustment)
}
static void
close_selection_dialog (GtkWidget *dialog, gint response, GtkWidget *tv)
close_selection_dialog (GtkWidget *dialog, int response, GtkWidget *tv)
{
GtkWidget *box;
GtkWidget *child;
GList *children;
const gchar *filename;
const char *filename;
gboolean is_resource;
gtk_widget_hide (dialog);
@@ -1352,7 +1352,7 @@ close_selection_dialog (GtkWidget *dialog, gint response, GtkWidget *tv)
return;
child = children->data;
filename = (const gchar *)g_object_get_data (G_OBJECT (child), "filename");
filename = (const char *)g_object_get_data (G_OBJECT (child), "filename");
is_resource = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (child), "is-resource"));
g_list_free (children);
@@ -1377,8 +1377,8 @@ static void
handle_insert (GtkWidget *button, GtkWidget *textview)
{
GtkTextBuffer *buffer;
const gchar *id;
const gchar *text;
const char *id;
const char *text;
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
@@ -1402,7 +1402,7 @@ handle_cutcopypaste (GtkWidget *button, GtkWidget *textview)
{
GtkTextBuffer *buffer;
GdkClipboard *clipboard;
const gchar *id;
const char *id;
clipboard = gtk_widget_get_clipboard (textview);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
@@ -1421,7 +1421,7 @@ handle_cutcopypaste (GtkWidget *button, GtkWidget *textview)
static void
clipboard_formats_notify (GdkClipboard *clipboard, GdkEvent *event, GtkWidget *button)
{
const gchar *id;
const char *id;
gboolean has_text;
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
@@ -1434,7 +1434,7 @@ clipboard_formats_notify (GdkClipboard *clipboard, GdkEvent *event, GtkWidget *b
static void
textbuffer_notify_selection (GObject *object, GParamSpec *pspec, GtkWidget *button)
{
const gchar *id;
const char *id;
gboolean has_selection;
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
@@ -1469,7 +1469,7 @@ page_combo_separator_func (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
gchar *text;
char *text;
gboolean res;
gtk_tree_model_get (model, iter, 0, &text, -1);
@@ -1594,7 +1594,7 @@ text_view_add_to_context_menu (GtkTextView *text_view)
static void
open_popover_text_changed (GtkEntry *entry, GParamSpec *pspec, GtkWidget *button)
{
const gchar *text;
const char *text;
text = gtk_editable_get_text (GTK_EDITABLE (entry));
gtk_widget_set_sensitive (button, strlen (text) > 0);
@@ -1864,8 +1864,8 @@ activate (GApplication *app)
{ "print", activate_print, NULL, NULL, NULL },
};
struct {
const gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *accelerators[2];
} accels[] = {
{ "app.about", { "F1", NULL } },
{ "app.quit", { "<Control>q", NULL } },
@@ -1878,15 +1878,15 @@ activate (GApplication *app)
{ "win.lock", { "<Control>l", NULL } },
};
struct {
const gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *accelerators[2];
} late_accels[] = {
{ "app.cut", { "<Control>x", NULL } },
{ "app.copy", { "<Control>c", NULL } },
{ "app.paste", { "<Control>v", NULL } },
{ "win.delete", { "Delete", NULL } },
};
gint i;
int i;
GPermission *permission;
GAction *action;
GError *error = NULL;
@@ -2282,7 +2282,7 @@ main (int argc, char *argv[])
{ "check-off-disabled", NULL, NULL, "false", NULL },
{ "radio-x-disabled", NULL, "s", "'x'", NULL },
};
gint status;
int status;
app = gtk_application_new ("org.gtk.WidgetFactory4", G_APPLICATION_NON_UNIQUE);

View File

@@ -474,19 +474,19 @@ The maximum width of each column is given by the longest element in the
column:
```c
void gtk_type_set_property (GtkType *type,
const gchar *value,
GError **error);
const gchar *gtk_type_get_property (GtkType *type);
void gtk_type_set_property (GtkType *type,
const char *value,
GError **error);
const char *gtk_type_get_property (GtkType *type);
```
It is also possible to align the columns to the next tab:
```c
void gtk_type_set_prop (GtkType *type,
gfloat value);
gfloat gtk_type_get_prop (GtkType *type);
gint gtk_type_update_foobar (GtkType *type);
float value);
float gtk_type_get_prop (GtkType *type);
int gtk_type_update_foobar (GtkType *type);
```
Public headers should never be included directly:

View File

@@ -426,8 +426,8 @@ draw_cb (GtkDrawingArea *drawing_area,
/* Draw a rectangle on the surface at the given position */
static void
draw_brush (GtkWidget *widget,
gdouble x,
gdouble y)
double x,
double y)
{
cairo_t *cr;
@@ -797,8 +797,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;
@@ -1138,7 +1138,7 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
const gchar *quit_accels[2] = { "&lt;Ctrl&gt;Q", NULL };
const char *quit_accels[2] = { "&lt;Ctrl&gt;Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
@@ -1476,7 +1476,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;

View File

@@ -177,6 +177,7 @@ def ConvertToDocbook(infile, outfile):
subprocess.check_call(["pandoc", infile, "-o", outfile,
"--from=" + input_format,
"--to=" + output_format,
"--standalone",
"--top-level-division=" + division])
def ExpandGtkDocAbbreviations(infile, outfile):

View File

@@ -2041,8 +2041,6 @@ gtk_menu_button_get_menu_model
GtkArrowType
gtk_menu_button_set_direction
gtk_menu_button_get_direction
gtk_menu_button_set_align_widget
gtk_menu_button_get_align_widget
gtk_menu_button_set_icon_name
gtk_menu_button_get_icon_name
gtk_menu_button_set_label
@@ -2832,6 +2830,9 @@ gtk_sort_list_model_set_sorter
gtk_sort_list_model_get_sorter
gtk_sort_list_model_set_model
gtk_sort_list_model_get_model
gtk_sort_list_model_set_incremental
gtk_sort_list_model_get_incremental
gtk_sort_list_model_get_peanding
<SUBSECTION Standard>
GTK_SORT_LIST_MODEL
GTK_IS_SORT_LIST_MODEL

View File

@@ -137,8 +137,41 @@ use gtk_button_new_from_icon_name().
### Stop using GtkWidget event signals
Event controllers and #GtkGestures replace event signals in GTK 4.
They have been backported to GTK 3.x so you can prepare for this change.
Event controllers and gestures replace event signals in GTK 4.
Most of them have been backported to GTK 3.x so you can prepare
for this change.
| Signal | Event controller |
| --- | --- |
| ::event | #GtkEventControllerLegacy |
| ::event-after | #GtkEventControllerLegacy |
| ::button-press-event | #GtkGestureClick |
| ::button-release-event | #GtkGestureClick |
| ::touch-event | various touch gestures |
| ::scroll-event | #GtkEventControllerScroll |
| ::motion-notify-event | #GtkEventControllerMotion |
| ::delete-event | - |
| ::key-press-event | #GtkEventControllerKey |
| ::key-release-event | #GtkEventControllerKey |
| ::enter-notify-event | #GtkEventControllerMotion |
| ::leave-notify-event | #GtkEventControllerMotion |
| ::configure-event | replaced by #GdkSurface::size-changed |
| ::focus-in-event | #GtkEventControllerFocus |
| ::focus-out-event | #GtkEventControllerFocus |
| ::map-event | replaced by #GdkSurface:mapped |
| ::unmap-event | replaced by #GdkSurface:mapped |
| ::property-notify-event | replaced by #GdkClipboard |
| ::selection-clear-event | replaced by #GdkClipboard |
| ::selection-request-event | replaced by #GdkClipboard |
| ::selection-notify-event | replaced by #GdkClipboard |
| Drag-and-Drop signals | #GtkDragSource, #GtkDropTarget |
| ::proximity-in-event | #GtkGestureStylus |
| ::proximity-out-event | #GtkGestureStylus |
| ::visibility-notify-event | - |
| ::window-state-event | replaced by #GdkToplevel:state |
| ::damage-event | - |
| ::grab-broken-event | - |
### Set a proper application ID
@@ -531,6 +564,26 @@ by a layout manager (if they are layout-related), or handled in some
other way. One possibility is to use child meta objects, as seen with
GtkAssistantPage, GtkStackPage and the like.
The replacements for gtk_container_add() are:
| Widget | Replacement |
| ------ | ----------- |
| GtkActionBar | gtk_action_bar_pack_start(), gtk_action_bar_pack_end() |
| GtkBox | gtk_box_append() |
| GtkExpander | gtk_expander_set_child() |
| GtkFixed | gtk_fixed_put() |
| GtkFlowBox | gtk_flow_box_insert() |
| GtkGrid | gtk_grid_attach() |
| GtkHeaderBar | gtk_header_bar_pack_start(), gtk_header_bar_pack_end() |
| GtkIconView | - |
| GtkInfoBar | gtk_info_bar_add_child() |
| GtkListBox | gtk_list_box_insert() |
| GtkNotebook | gtk_notebook_append_page() |
| GtkPaned | gtk_paned_set_start_child(), gtk_paned_set_end_child() |
| GtkStack | gtk_stack_add_named() |
| GtkTextView | gtk_text_view_add_child_at_anchor(), gtk_text_view_add_overlay() |
| GtkTreeView | - |
### Stop using GtkContainer::border-width
GTK 4 has removed the #GtkContainer::border-width property (together

View File

@@ -123,6 +123,32 @@ the number of listitems they create such as with gtk_grid_view_set_max_columns()
and developers running into performance problems should definitely study the
tradeoffs of those and experiment with them.
## Choosing the right model {#model-choosing}
GTK offers a wide variety of wrapping models which change or supplement an
existing model (or models) in some way. But when it comes to storing your
actual data, there are only a few ready-made choices available: #GListStore
and #GtkStringList.
GListStore is backed by a balanced tree and has performance characteristics
that are expected for that data structure. It works reasonably well for dataset
sizes in the 1,000,000 range, and can handle insertions and deletions. It uses
a cached iter to make linear access to the items fast.
GtkStringList is not a general store - it can only handle strings. It is
backed by an dynamically allocated array and has performance characteristics
that are expected for that data structure. GtkStringList is a good fit for any
place where you would otherwise use `char*[]` and works best if the dataset
is not very dynamic.
If these models don't fit your use case or scalability requirements, you
should make a custom #GListModel. It is a small interface and not very hard
to implement.
For asymptotic performance comparisons between tree- and array-based
implementations, see this
[article](https://en.wikipedia.org/wiki/Dynamic_array#Performance).
## Displaying trees {#displaying-trees}
While #GtkTreeView provided built-in support for trees, the list widgets, and

View File

@@ -189,7 +189,7 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
{
GtkTreeIter iter;
GtkTreeModel *model;
gchar *author;
char *author;
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{

View File

@@ -141,8 +141,8 @@ take_window_shot (Window child,
XWindowAttributes attrs;
Window xid;
Display *dpy;
gint x = 0, y = 0;
gint width, height;
int x = 0, y = 0;
int width, height;
GdkPixbuf *tmp, *tmp2;
GdkPixbuf *retval = NULL;

View File

@@ -797,7 +797,7 @@ static WidgetInfo *
create_about_dialog (void)
{
GtkWidget *widget;
const gchar *authors[] = {
const char *authors[] = {
"Peter Mattis",
"Spencer Kimball",
"Josh MacDonald",

View File

@@ -15,7 +15,7 @@ typedef enum
typedef struct WidgetInfo
{
GtkWidget *window;
gchar *name;
char *name;
gboolean no_focus;
gboolean include_decorations;
WidgetSize size;

View File

@@ -32,7 +32,7 @@ static GActionEntry win_entries[] = {
{ "close", action_activated },
};
const gchar *menu_ui =
const char *menu_ui =
"<interface>"
" <menu id='doc-menu'>"
" <section>"

View File

@@ -27,8 +27,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -25,7 +25,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -55,7 +55,7 @@ static void
find_word (GtkButton *button,
ExampleAppWindow *win)
{
const gchar *word;
const char *word;
word = gtk_button_get_label (button);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
@@ -69,7 +69,7 @@ update_words (ExampleAppWindow *win)
GtkWidget *tab, *view, *row;
GtkTextBuffer *buffer;
GtkTextIter start, end;
gchar *word, *key;
char *word, *key;
GtkWidget *child;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
@@ -121,7 +121,7 @@ update_lines (ExampleAppWindow *win)
GtkWidget *tab, *view;
GtkTextBuffer *buffer;
int count;
gchar *lines;
char *lines;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
@@ -248,9 +248,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
GtkTextBuffer *buffer;
GtkTextTag *tag;

View File

@@ -27,8 +27,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -27,8 +27,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -36,9 +36,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
basename = g_file_get_basename (file);

View File

@@ -39,7 +39,7 @@ static GActionEntry app_entries[] =
static void
example_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
@@ -63,8 +63,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -46,9 +46,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
basename = g_file_get_basename (file);

View File

@@ -39,7 +39,7 @@ static GActionEntry app_entries[] =
static void
example_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
@@ -63,8 +63,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -66,9 +66,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
GtkTextBuffer *buffer;
GtkTextTag *tag;

View File

@@ -46,7 +46,7 @@ static GActionEntry app_entries[] =
static void
example_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
@@ -70,8 +70,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -67,9 +67,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
GtkTextBuffer *buffer;
GtkTextTag *tag;

View File

@@ -46,7 +46,7 @@ static GActionEntry app_entries[] =
static void
example_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
@@ -70,8 +70,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -20,7 +20,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -120,9 +120,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
GtkTextBuffer *buffer;
GtkTextTag *tag;

View File

@@ -46,7 +46,7 @@ static GActionEntry app_entries[] =
static void
example_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
@@ -70,8 +70,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -23,7 +23,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -53,7 +53,7 @@ static void
find_word (GtkButton *button,
ExampleAppWindow *win)
{
const gchar *word;
const char *word;
word = gtk_button_get_label (button);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
@@ -67,7 +67,7 @@ update_words (ExampleAppWindow *win)
GtkWidget *tab, *view, *row;
GtkTextBuffer *buffer;
GtkTextIter start, end;
gchar *word, *key;
char *word, *key;
GtkWidget *child;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
@@ -212,9 +212,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
GtkTextBuffer *buffer;
GtkTextTag *tag;

View File

@@ -46,7 +46,7 @@ static GActionEntry app_entries[] =
static void
example_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
@@ -70,8 +70,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -25,7 +25,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -55,7 +55,7 @@ static void
find_word (GtkButton *button,
ExampleAppWindow *win)
{
const gchar *word;
const char *word;
word = gtk_button_get_label (button);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
@@ -69,7 +69,7 @@ update_words (ExampleAppWindow *win)
GtkWidget *tab, *view, *row;
GtkTextBuffer *buffer;
GtkTextIter start, end;
gchar *word, *key;
char *word, *key;
GtkWidget *child;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
@@ -121,7 +121,7 @@ update_lines (ExampleAppWindow *win)
GtkWidget *tab, *view;
GtkTextBuffer *buffer;
int count;
gchar *lines;
char *lines;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
@@ -246,9 +246,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *contents;
gsize length;
GtkTextBuffer *buffer;
GtkTextTag *tag;

View File

@@ -77,7 +77,7 @@ change_justify_state (GSimpleAction *action,
gpointer user_data)
{
GtkTextView *text = g_object_get_data (user_data, "bloatpad-text");
const gchar *str;
const char *str;
str = g_variant_get_string (state, NULL);
@@ -150,7 +150,7 @@ text_buffer_changed_cb (GtkTextBuffer *buffer,
{
GtkWindow *window = user_data;
BloatPad *app;
gint old_n, n;
int old_n, n;
app = (BloatPad *) gtk_window_get_application (window);
@@ -265,7 +265,7 @@ new_window (GApplication *app,
if (file != NULL)
{
gchar *contents;
char *contents;
gsize length;
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))
@@ -293,10 +293,10 @@ bloat_pad_activate (GApplication *application)
static void
bloat_pad_open (GApplication *application,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
gint i;
int i;
for (i = 0; i < n_files; i++)
new_window (application, files[i]);
@@ -345,9 +345,9 @@ combo_changed (GtkComboBox *combo,
gpointer user_data)
{
GtkEntry *entry = g_object_get_data (user_data, "entry");
const gchar *action;
gchar **accels;
gchar *str;
const char *action;
char **accels;
char *str;
action = gtk_combo_box_get_active_id (combo);
@@ -368,9 +368,9 @@ response (GtkDialog *dialog,
{
GtkEntry *entry = g_object_get_data (user_data, "entry");
GtkComboBox *combo = g_object_get_data (user_data, "combo");
const gchar *action;
const gchar *str;
gchar **accels;
const char *action;
const char *str;
char **accels;
if (response_id == GTK_RESPONSE_CLOSE)
{
@@ -386,7 +386,7 @@ response (GtkDialog *dialog,
str = gtk_editable_get_text (GTK_EDITABLE (entry));
accels = g_strsplit (str, ",", 0);
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const gchar **) accels);
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const char **) accels);
g_strfreev (accels);
}
@@ -398,9 +398,9 @@ edit_accels (GSimpleAction *action,
GtkApplication *app = user_data;
GtkWidget *combo;
GtkWidget *entry;
gchar **actions;
char **actions;
GtkWidget *dialog;
gint i;
int i;
dialog = gtk_dialog_new ();
gtk_window_set_application (GTK_WINDOW (dialog), app);
@@ -426,7 +426,7 @@ update_time (gpointer user_data)
{
BloatPad *bloatpad = user_data;
GDateTime *now;
gchar *time;
char *time;
while (g_menu_model_get_n_items (G_MENU_MODEL (bloatpad->time)))
g_menu_remove (bloatpad->time, 0);
@@ -481,14 +481,14 @@ static GActionEntry app_entries[] = {
static void
dump_accels (GtkApplication *app)
{
gchar **actions;
gint i;
char **actions;
int i;
actions = gtk_application_list_action_descriptions (app);
for (i = 0; actions[i]; i++)
{
gchar **accels;
gchar *str;
char **accels;
char *str;
accels = gtk_application_get_accels_for_action (app, actions[i]);
@@ -512,10 +512,10 @@ bloat_pad_startup (GApplication *application)
GIcon *icon2;
GEmblem *emblem;
GFile *file;
gint i;
int i;
struct {
const gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *accelerators[2];
} accels[] = {
{ "app.new", { "<Control>n", NULL } },
{ "app.quit", { "<Control>q", NULL } },
@@ -592,7 +592,7 @@ bloat_pad_startup (GApplication *application)
g_object_unref (item);
g_object_unref (icon);
const gchar *new_accels[] = { "<Control>n", "<Control>t", NULL };
const char *new_accels[] = { "<Control>n", "<Control>t", NULL };
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels);
dump_accels (GTK_APPLICATION (application));
@@ -657,7 +657,7 @@ main (int argc, char **argv)
{
BloatPad *bloat_pad;
int status;
const gchar *accels[] = { "F11", NULL };
const char *accels[] = { "F11", NULL };
bloat_pad = bloat_pad_new ();

View File

@@ -59,8 +59,8 @@ draw_cb (GtkDrawingArea *drawing_area,
/* Draw a rectangle on the surface at the given position */
static void
draw_brush (GtkWidget *widget,
gdouble x,
gdouble y)
double x,
double y)
{
cairo_t *cr;

View File

@@ -99,7 +99,7 @@ new_window (GApplication *app,
if (file != NULL)
{
gchar *contents;
char *contents;
gsize length;
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))
@@ -124,10 +124,10 @@ plug_man_activate (GApplication *application)
static void
plug_man_open (GApplication *application,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
gint i;
int i;
for (i = 0; i < n_files; i++)
new_window (application, files[i]);
@@ -184,7 +184,7 @@ static gboolean is_red_plugin_enabled;
static gboolean is_black_plugin_enabled;
static gboolean
plugin_enabled (const gchar *name)
plugin_enabled (const char *name)
{
if (g_strcmp0 (name, "red") == 0)
return is_red_plugin_enabled;
@@ -228,7 +228,7 @@ plugin_action (GAction *action,
}
static void
enable_plugin (const gchar *name)
enable_plugin (const char *name)
{
GMenuModel *plugin_menu;
GAction *action;
@@ -246,8 +246,8 @@ enable_plugin (const gchar *name)
{
GMenu *section;
GMenuItem *item;
gchar *label;
gchar *action_name;
char *label;
char *action_name;
section = g_menu_new ();
label = g_strdup_printf ("Turn text %s", name);
@@ -272,7 +272,7 @@ enable_plugin (const gchar *name)
}
static void
disable_plugin (const gchar *name)
disable_plugin (const char *name)
{
GMenuModel *plugin_menu;
@@ -281,11 +281,11 @@ disable_plugin (const gchar *name)
plugin_menu = find_plugin_menu ();
if (plugin_menu)
{
gint i;
int i;
for (i = 0; i < g_menu_model_get_n_items (plugin_menu); i++)
{
gchar *id;
char *id;
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id))
{
if (g_strcmp0 (id, name) == 0)
@@ -311,7 +311,7 @@ disable_plugin (const gchar *name)
static void
enable_or_disable_plugin (GtkToggleButton *button,
const gchar *name)
const char *name)
{
if (plugin_enabled (name))
disable_plugin (name);
@@ -498,7 +498,7 @@ main (int argc, char **argv)
{
PlugMan *plug_man;
int status;
const gchar *accels[] = { "F11", NULL };
const char *accels[] = { "F11", NULL };
plug_man = plug_man_new ();
gtk_application_set_accels_for_action (GTK_APPLICATION (plug_man),

View File

@@ -32,9 +32,9 @@ activate_cb (GtkApplication *app,
gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (search_bar), window);
}
gint
main (gint argc,
gchar *argv[])
int
main (int argc,
char *argv[])
{
GtkApplication *app;

View File

@@ -30,7 +30,7 @@ new_window (GApplication *app,
if (file != NULL)
{
gchar *contents;
char *contents;
gsize length;
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))
@@ -55,10 +55,10 @@ activate (GApplication *application)
static void
open (GApplication *application,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
gint i;
int i;
for (i = 0; i < n_files; i++)
new_window (application, files[i]);

View File

@@ -310,7 +310,7 @@ broadway_output_set_transient_for (BroadwayOutput *output,
append_uint16 (output, parent_id);
}
static gint append_node_depth = -1;
static int append_node_depth = -1;
static void
append_type (BroadwayOutput *output, guint32 type, BroadwayNode *node)

View File

@@ -63,7 +63,7 @@ struct _BroadwayServer {
GList *surfaces;
BroadwaySurface *root;
gint32 focused_surface_id; /* -1 => none */
gint show_keyboard;
int show_keyboard;
guint32 next_texture_id;
GHashTable *textures;
@@ -970,7 +970,7 @@ broadway_server_get_screen_size (BroadwayServer *server,
static void
broadway_server_fake_roundtrip_reply (BroadwayServer *server,
gint id,
int id,
guint32 tag)
{
BroadwayInputMsg msg;
@@ -1001,7 +1001,7 @@ broadway_server_flush (BroadwayServer *server)
void
broadway_server_roundtrip (BroadwayServer *server,
gint id,
int id,
guint32 tag)
{
if (server->output)
@@ -1060,8 +1060,8 @@ send_error (HttpRequest *request,
#define SEC_WEB_SOCKET_KEY_MAGIC "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
/* 'x3JJHMbDL1EzLkh9GBhXDw==' generates 'HSmrc0sMlYUkAGmm5OPpG2HaGWk=' */
static gchar *
generate_handshake_response_wsietf_v7 (const gchar *key)
static char *
generate_handshake_response_wsietf_v7 (const char *key)
{
gsize digest_len = 20;
guchar digest[20];
@@ -1565,7 +1565,7 @@ broadway_server_query_mouse (BroadwayServer *server,
void
broadway_server_destroy_surface (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
@@ -1594,7 +1594,7 @@ broadway_server_destroy_surface (BroadwayServer *server,
gboolean
broadway_server_surface_show (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
gboolean sent = FALSE;
@@ -1616,7 +1616,7 @@ broadway_server_surface_show (BroadwayServer *server,
gboolean
broadway_server_surface_hide (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
gboolean sent = FALSE;
@@ -1646,7 +1646,7 @@ broadway_server_surface_hide (BroadwayServer *server,
void
broadway_server_surface_raise (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
@@ -1676,7 +1676,7 @@ broadway_server_set_show_keyboard (BroadwayServer *server,
void
broadway_server_surface_lower (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
@@ -1693,7 +1693,7 @@ broadway_server_surface_lower (BroadwayServer *server,
void
broadway_server_surface_set_transient_for (BroadwayServer *server,
gint id, gint parent)
int id, int parent)
{
BroadwaySurface *surface;
@@ -1865,7 +1865,7 @@ decode_nodes (BroadwayServer *server,
/* passes ownership of nodes */
void
broadway_server_surface_update_nodes (BroadwayServer *server,
gint id,
int id,
guint32 data[],
int len,
GHashTable *client_texture_map)
@@ -1946,7 +1946,7 @@ broadway_server_release_texture (BroadwayServer *server,
gboolean
broadway_server_surface_move_resize (BroadwayServer *server,
gint id,
int id,
gboolean with_move,
int x,
int y,
@@ -1989,7 +1989,7 @@ broadway_server_surface_move_resize (BroadwayServer *server,
void
broadway_server_focus_surface (BroadwayServer *server,
gint new_focused_surface)
int new_focused_surface)
{
BroadwayInputMsg focus_msg;
@@ -2010,8 +2010,8 @@ broadway_server_focus_surface (BroadwayServer *server,
guint32
broadway_server_grab_pointer (BroadwayServer *server,
gint client_id,
gint id,
int client_id,
int id,
gboolean owner_events,
guint32 event_mask,
guint32 time_)

View File

@@ -60,7 +60,7 @@ gboolean broadway_server_has_client (BroadwayServer *
void broadway_server_flush (BroadwayServer *server);
void broadway_server_sync (BroadwayServer *server);
void broadway_server_roundtrip (BroadwayServer *server,
gint id,
int id,
guint32 tag);
void broadway_server_get_screen_size (BroadwayServer *server,
guint32 *width,
@@ -76,8 +76,8 @@ void broadway_server_query_mouse (BroadwayServer *
gint32 *root_y,
guint32 *mask);
guint32 broadway_server_grab_pointer (BroadwayServer *server,
gint client_id,
gint id,
int client_id,
int id,
gboolean owner_events,
guint32 event_mask,
guint32 time_);
@@ -93,23 +93,23 @@ guint32 broadway_server_new_surface (BroadwayServer *
int width,
int height);
void broadway_server_destroy_surface (BroadwayServer *server,
gint id);
int id);
gboolean broadway_server_surface_show (BroadwayServer *server,
gint id);
int id);
gboolean broadway_server_surface_hide (BroadwayServer *server,
gint id);
int id);
void broadway_server_surface_raise (BroadwayServer *server,
gint id);
int id);
void broadway_server_surface_lower (BroadwayServer *server,
gint id);
int id);
void broadway_server_surface_set_transient_for (BroadwayServer *server,
gint id,
gint parent);
int id,
int parent);
gboolean broadway_server_surface_translate (BroadwayServer *server,
gint id,
int id,
cairo_region_t *area,
gint dx,
gint dy);
int dx,
int dy);
guint32 broadway_server_upload_texture (BroadwayServer *server,
GBytes *texture);
void broadway_server_release_texture (BroadwayServer *server,
@@ -117,19 +117,19 @@ void broadway_server_release_texture (BroadwayServer *
cairo_surface_t * broadway_server_create_surface (int width,
int height);
void broadway_server_surface_update_nodes (BroadwayServer *server,
gint id,
int id,
guint32 data[],
int len,
GHashTable *client_texture_map);
gboolean broadway_server_surface_move_resize (BroadwayServer *server,
gint id,
int id,
gboolean with_move,
int x,
int y,
int width,
int height);
void broadway_server_focus_surface (BroadwayServer *server,
gint new_focused_surface);
int new_focused_surface);
#endif /* __BROADWAY_SERVER__ */

View File

@@ -501,7 +501,7 @@ _gdk_broadway_server_new_surface (GdkBroadwayServer *server,
void
_gdk_broadway_server_destroy_surface (GdkBroadwayServer *server,
gint id)
int id)
{
BroadwayRequestDestroySurface msg;
@@ -512,7 +512,7 @@ _gdk_broadway_server_destroy_surface (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_show (GdkBroadwayServer *server,
gint id)
int id)
{
BroadwayRequestShowSurface msg;
@@ -525,7 +525,7 @@ _gdk_broadway_server_surface_show (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
gint id)
int id)
{
BroadwayRequestHideSurface msg;
@@ -538,7 +538,7 @@ _gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
void
_gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
gint id)
int id)
{
BroadwayRequestFocusSurface msg;
@@ -549,7 +549,7 @@ _gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
void
_gdk_broadway_server_surface_set_transient_for (GdkBroadwayServer *server,
gint id, gint parent)
int id, int parent)
{
BroadwayRequestSetTransientFor msg;
@@ -692,7 +692,7 @@ gdk_broadway_server_surface_set_nodes (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_move_resize (GdkBroadwayServer *server,
gint id,
int id,
gboolean with_move,
int x,
int y,
@@ -716,7 +716,7 @@ _gdk_broadway_server_surface_move_resize (GdkBroadwayServer *server,
GdkGrabStatus
_gdk_broadway_server_grab_pointer (GdkBroadwayServer *server,
gint id,
int id,
gboolean owner_events,
guint32 event_mask,
guint32 time_)

View File

@@ -32,7 +32,7 @@ void _gdk_broadway_server_query_mouse (GdkBroadwaySer
gint32 *root_y,
guint32 *mask);
GdkGrabStatus _gdk_broadway_server_grab_pointer (GdkBroadwayServer *server,
gint id,
int id,
gboolean owner_events,
guint32 event_mask,
guint32 time_);
@@ -45,23 +45,23 @@ guint32 _gdk_broadway_server_new_surface (GdkBroadwaySe
int width,
int height);
void _gdk_broadway_server_destroy_surface (GdkBroadwayServer *server,
gint id);
int id);
gboolean _gdk_broadway_server_surface_show (GdkBroadwayServer *server,
gint id);
int id);
gboolean _gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
gint id);
int id);
void _gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
gint id);
int id);
void _gdk_broadway_server_surface_set_transient_for (GdkBroadwayServer *server,
gint id,
gint parent);
int id,
int parent);
void _gdk_broadway_server_set_show_keyboard (GdkBroadwayServer *server,
gboolean show_keyboard);
gboolean _gdk_broadway_server_surface_translate (GdkBroadwayServer *server,
gint id,
int id,
cairo_region_t *area,
gint dx,
gint dy);
int dx,
int dy);
guint32 gdk_broadway_server_upload_texture (GdkBroadwayServer *server,
GdkTexture *texture);
void gdk_broadway_server_release_texture (GdkBroadwayServer *server,
@@ -70,7 +70,7 @@ void gdk_broadway_server_surface_set_nodes (GdkBroadwaySe
guint32 id,
GArray *nodes);
gboolean _gdk_broadway_server_surface_move_resize (GdkBroadwayServer *server,
gint id,
int id,
gboolean with_move,
int x,
int y,

View File

@@ -24,8 +24,8 @@
#include "gdkprivate-broadway.h"
static void gdk_broadway_device_get_state (GdkDevice *device,
GdkSurface *surface,
gdouble *axes,
GdkSurface *surface,
double *axes,
GdkModifierType *mask);
static void gdk_broadway_device_set_surface_cursor (GdkDevice *device,
GdkSurface *surface,
@@ -46,8 +46,8 @@ static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
static void gdk_broadway_device_ungrab (GdkDevice *device,
guint32 time_);
static GdkSurface * gdk_broadway_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
double *win_x,
double *win_y,
GdkModifierType *mask);
@@ -79,11 +79,11 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core)
static void
gdk_broadway_device_get_state (GdkDevice *device,
GdkSurface *surface,
gdouble *axes,
GdkSurface *surface,
double *axes,
GdkModifierType *mask)
{
gdouble x, y;
double x, y;
gdk_surface_get_device_position (surface, device, &x, &y, mask);
@@ -271,8 +271,8 @@ gdk_broadway_device_ungrab (GdkDevice *device,
static GdkSurface *
gdk_broadway_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
double *win_x,
double *win_y,
GdkModifierType *mask)
{
GdkSurface *surface = NULL;

View File

@@ -175,7 +175,7 @@ create_touchscreen (GdkDisplay *display)
}
GdkDisplay *
_gdk_broadway_display_open (const gchar *display_name)
_gdk_broadway_display_open (const char *display_name)
{
GdkDisplay *display;
GdkBroadwayDisplay *broadway_display;
@@ -225,12 +225,12 @@ _gdk_broadway_display_open (const gchar *display_name)
return display;
}
static const gchar *
static const char *
gdk_broadway_display_get_name (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
return (gchar *) "Broadway";
return (char *) "Broadway";
}
static void
@@ -311,7 +311,7 @@ gdk_broadway_display_finalize (GObject *object)
static void
gdk_broadway_display_notify_startup_complete (GdkDisplay *display,
const gchar *startup_id)
const char *startup_id)
{
}

View File

@@ -25,7 +25,7 @@
#include <stdlib.h>
static gboolean gdk_event_source_prepare (GSource *source,
gint *timeout);
int *timeout);
static gboolean gdk_event_source_check (GSource *source);
static gboolean gdk_event_source_dispatch (GSource *source,
GSourceFunc callback,
@@ -54,7 +54,7 @@ static GList *event_sources = NULL;
static gboolean
gdk_event_source_prepare (GSource *source,
gint *timeout)
int *timeout)
{
GdkDisplay *display = ((GdkEventSource*) source)->display;
gboolean retval;

View File

@@ -142,7 +142,7 @@ gdk_broadway_keymap_get_entries_for_keycode (GdkKeymap *keymap,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries)
int *n_entries)
{
if (n_entries)
*n_entries = 1;
@@ -171,10 +171,10 @@ static gboolean
gdk_broadway_keymap_translate_keyboard_state (GdkKeymap *keymap,
guint hardware_keycode,
GdkModifierType state,
gint group,
int group,
guint *keyval,
gint *effective_group,
gint *level,
int *effective_group,
int *level,
GdkModifierType *consumed_modifiers)
{
if (keyval)

View File

@@ -55,8 +55,8 @@ GdkDrag * _gdk_broadway_surface_drag_begin (GdkSurface *surface,
double dy);
void _gdk_broadway_surface_translate (GdkSurface *surface,
cairo_region_t *area,
gint dx,
gint dy);
int dx,
int dy);
gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
BroadwayInputMsg *msg);
gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
@@ -69,13 +69,13 @@ void _gdk_broadway_surface_grab_check_unmap (GdkSurface *surface,
gulong serial);
void gdk_broadway_surface_move_resize (GdkSurface *surface,
gint x,
gint y,
gint width,
gint height);
int x,
int y,
int width,
int height);
void _gdk_keymap_keys_changed (GdkDisplay *display);
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,
int _gdk_broadway_get_group_for_state (GdkDisplay *display,
GdkModifierType state);
void _gdk_keymap_add_virtual_modifiers_compat (GdkKeymap *keymap,
GdkModifierType *modifiers);
@@ -89,10 +89,10 @@ void _gdk_broadway_events_got_input (GdkDisplay *display,
BroadwayInputMsg *message);
void _gdk_broadway_display_init_root_window (GdkDisplay *display);
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
GdkDisplay * _gdk_broadway_display_open (const char *display_name);
void _gdk_broadway_display_queue_events (GdkDisplay *display);
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
const char *name);
GdkCursor *_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
GdkTexture *texture,
int x,

View File

@@ -405,7 +405,7 @@ gdk_broadway_surface_hide (GdkSurface *surface)
_gdk_surface_clear_update_area (surface);
}
static gint
static int
gdk_broadway_surface_get_scale_factor (GdkSurface *surface)
{
GdkBroadwayDisplay *broadway_display;
@@ -456,10 +456,10 @@ sync_child_root_pos (GdkSurface *parent)
static void
gdk_broadway_surface_move_resize_internal (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
int x,
int y,
int width,
int height)
{
GdkBroadwaySurface *impl = GDK_BROADWAY_SURFACE (surface);
GdkBroadwayDisplay *broadway_display;
@@ -522,10 +522,10 @@ gdk_broadway_surface_move_resize_internal (GdkSurface *surface,
void
gdk_broadway_surface_move_resize (GdkSurface *surface,
gint x,
gint y,
gint width,
gint height)
int x,
int y,
int width,
int height)
{
gdk_broadway_surface_move_resize_internal (surface, TRUE,
x, y,
@@ -534,8 +534,8 @@ gdk_broadway_surface_move_resize (GdkSurface *surface,
static void
gdk_broadway_surface_toplevel_resize (GdkSurface *surface,
gint width,
gint height)
int width,
int height)
{
gdk_broadway_surface_move_resize_internal (surface, FALSE,
0, 0,
@@ -544,8 +544,8 @@ gdk_broadway_surface_toplevel_resize (GdkSurface *surface,
static void
gdk_broadway_surface_move (GdkSurface *surface,
gint x,
gint y)
int x,
int y)
{
gdk_broadway_surface_move_resize_internal (surface, TRUE, x, y, -1, -1);
}
@@ -660,13 +660,13 @@ gdk_broadway_surface_set_geometry_hints (GdkSurface *surface,
static void
gdk_broadway_surface_set_title (GdkSurface *surface,
const gchar *title)
const char *title)
{
}
static void
gdk_broadway_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
const char *startup_id)
{
}
@@ -696,10 +696,10 @@ gdk_broadway_surface_set_transient_for (GdkSurface *surface,
static void
gdk_broadway_surface_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height)
int *x,
int *y,
int *width,
int *height)
{
g_return_if_fail (GDK_IS_SURFACE (surface));
@@ -718,10 +718,10 @@ gdk_broadway_surface_get_geometry (GdkSurface *surface,
static void
gdk_broadway_surface_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
gint *root_y)
int x,
int y,
int *root_x,
int *root_y)
{
GdkBroadwaySurface *impl;
@@ -736,8 +736,8 @@ gdk_broadway_surface_get_root_coords (GdkSurface *surface,
static gboolean
gdk_broadway_surface_get_device_state (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
double *x,
double *y,
GdkModifierType *mask)
{
GdkSurface *child;
@@ -839,13 +839,13 @@ struct _MoveResizeData
GdkSurface *moveresize_emulation_surface;
gboolean is_resize;
GdkSurfaceEdge resize_edge;
gint moveresize_button;
gint moveresize_x;
gint moveresize_y;
gint moveresize_orig_x;
gint moveresize_orig_y;
gint moveresize_orig_width;
gint moveresize_orig_height;
int moveresize_button;
int moveresize_x;
int moveresize_y;
int moveresize_orig_x;
int moveresize_orig_y;
int moveresize_orig_width;
int moveresize_orig_height;
long moveresize_process_time;
GdkSurfaceHints moveresize_geom_mask;
GdkGeometry moveresize_geometry;
@@ -876,17 +876,17 @@ get_move_resize_data (GdkDisplay *display,
static void
update_pos (MoveResizeData *mv_resize,
gint new_root_x,
gint new_root_y)
int new_root_x,
int new_root_y)
{
gint dx, dy;
int dx, dy;
dx = new_root_x - mv_resize->moveresize_x;
dy = new_root_y - mv_resize->moveresize_y;
if (mv_resize->is_resize)
{
gint x, y, w, h;
int x, y, w, h;
x = mv_resize->moveresize_orig_x;
y = mv_resize->moveresize_orig_y;
@@ -951,7 +951,7 @@ update_pos (MoveResizeData *mv_resize,
}
else
{
gint x, y;
int x, y;
x = mv_resize->moveresize_orig_x + dx;
y = mv_resize->moveresize_orig_y + dy;
@@ -1129,7 +1129,7 @@ create_moveresize_surface (MoveResizeData *mv_resize,
static void
calculate_unmoving_origin (MoveResizeData *mv_resize)
{
gint x, y, width, height;
int x, y, width, height;
if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY &&
mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC)

View File

@@ -30,7 +30,7 @@ void gdk_display_set_cursor_theme (GdkDisplay *display,
gboolean gdk_running_in_sandbox (void);
gboolean gdk_should_use_portal (void);
const gchar * gdk_get_startup_notification_id (void);
const char * gdk_get_startup_notification_id (void);
PangoDirection gdk_unichar_direction (gunichar ch);
PangoDirection gdk_find_base_dir (const char *text,

View File

@@ -163,7 +163,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
G_DEFINE_CONSTRUCTOR(stash_desktop_startup_notification_id)
#endif
static gchar *startup_notification_id = NULL;
static char *startup_notification_id = NULL;
static void
stash_desktop_startup_notification_id (void)
@@ -209,8 +209,8 @@ gdk_parse_debug_var (const char *variable,
guint i;
guint result = 0;
const char *string;
const gchar *p;
const gchar *q;
const char *p;
const char *q;
gboolean invert;
gboolean help;
@@ -352,7 +352,7 @@ gdk_display_open_default (void)
* Returns: (nullable) (transfer none): the original value of the
* DESKTOP_STARTUP_ID environment variable, or %NULL.
*/
const gchar *
const char *
gdk_get_startup_notification_id (void)
{
return startup_notification_id;
@@ -402,11 +402,11 @@ gdk_unichar_direction (gunichar ch)
}
PangoDirection
gdk_find_base_dir (const gchar *text,
gint length)
gdk_find_base_dir (const char *text,
int length)
{
PangoDirection dir = PANGO_DIRECTION_NEUTRAL;
const gchar *p;
const char *p;
g_return_val_if_fail (text != NULL || length == 0, PANGO_DIRECTION_NEUTRAL);

View File

@@ -60,14 +60,14 @@
*/
static void gdk_app_launch_context_finalize (GObject *object);
static gchar * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
static char * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static gchar * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
static char * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static void gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
const gchar *startup_notify_id);
const char *startup_notify_id);
enum
@@ -157,7 +157,7 @@ gdk_app_launch_context_finalize (GObject *object)
G_OBJECT_CLASS (gdk_app_launch_context_parent_class)->finalize (object);
}
static gchar *
static char *
gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
@@ -205,7 +205,7 @@ gdk_app_launch_context_get_display (GdkAppLaunchContext *context)
*/
void
gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
gint desktop)
int desktop)
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
@@ -298,6 +298,6 @@ gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
static void
gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
const gchar *startup_notify_id)
const char *startup_notify_id)
{
}

View File

@@ -43,7 +43,7 @@ GdkDisplay * gdk_app_launch_context_get_display (GdkAppLaunchContext *
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
gint desktop);
int desktop);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context,
guint32 timestamp);

View File

@@ -35,7 +35,7 @@ struct _GdkAppLaunchContext
GAppLaunchContext parent_instance;
GdkDisplay *display;
gint workspace;
int workspace;
guint32 timestamp;
GIcon *icon;
char *icon_name;

View File

@@ -73,7 +73,7 @@ gdk_array(init) (GdkArray *self)
self->end = self->start;
self->end_allocation = self->start + GDK_ARRAY_PREALLOC;
#ifdef GDK_ARRAY_NULL_TERMINATED
*self->start = *(_T_[1]) {};
*self->start = *(_T_[1]) { 0 };
#endif
#else
self->start = NULL;
@@ -165,7 +165,7 @@ gdk_array(reserve) (GdkArray *self,
if (self->start == NULL)
{
self->start = g_new (_T_, new_size);
*self->start = *(_T_[1]) {};
*self->start = *(_T_[1]) { 0 };
}
else
#endif

Some files were not shown because too many files have changed in this diff Show More