diff --git a/.gitignore b/.gitignore index 92559859e393de53f3b0ede270fd9df88ed425db..64d653cb4e153ee2bb0ce3d6cf6cf648a8d5b83d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ libphosh/sys/target target/ +subprojects/gvc/ +subprojects/libcall-ui/ subprojects/phosh/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d15b8072a2ece8ef3ca82dcc41c3ffb6c2905cf..d63837216e11b95560dc459a4c397aa2d6ac08bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - test+docs - deploy -image: debian:trixie +image: debian:forky default: # Protect CI infra from rogue jobs diff --git a/Cargo.lock b/Cargo.lock index 1848ca71cc3b177366537e0fa624e96febd62d5c..4f3d8242d0b139b9533dcf9ea982c1a1bf86362d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,7 +22,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -59,7 +59,7 @@ checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -69,7 +69,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", - "target-lexicon", + "target-lexicon 0.12.14", +] + +[[package]] +name = "cfg-expr" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a2c5f3bf25ec225351aa1c8e230d04d880d3bd89dea133537dafad4ae291e5c" +dependencies = [ + "smallvec", + "target-lexicon 0.13.2", ] [[package]] @@ -211,7 +221,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -228,7 +238,7 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -259,7 +269,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.2.2", "winapi", ] @@ -307,7 +317,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -318,7 +328,7 @@ checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -357,7 +367,7 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -422,12 +432,12 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps", + "system-deps 6.2.2", ] [[package]] name = "libphosh" -version = "0.0.6" +version = "0.0.7" dependencies = [ "gdk", "gio", @@ -439,7 +449,7 @@ dependencies = [ [[package]] name = "libphosh-sys" -version = "0.0.6" +version = "0.0.7" dependencies = [ "gdk-pixbuf-sys", "gdk-sys", @@ -451,7 +461,7 @@ dependencies = [ "libhandy-sys", "pango-sys", "shell-words", - "system-deps", + "system-deps 7.0.5", "tempfile", ] @@ -504,7 +514,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -661,9 +671,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "syn" @@ -692,7 +702,20 @@ version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ - "cfg-expr", + "cfg-expr 0.15.8", + "heck 0.5.0", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "system-deps" +version = "7.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4be53aa0cba896d2dc615bd42bbc130acdcffa239e0a2d965ea5b3b2a86ffdb" +dependencies = [ + "cfg-expr 0.20.3", "heck 0.5.0", "pkg-config", "toml", @@ -705,6 +728,12 @@ version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +[[package]] +name = "target-lexicon" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" + [[package]] name = "tempfile" version = "3.10.1" diff --git a/Phosh-0.gir b/Phosh-0.gir index ca96dfb4148682c104335e682b62f503cef9a338..23ab206cea9e12063b86cf6d21b4a5be0c55f88d 100644 --- a/Phosh-0.gir +++ b/Phosh-0.gir @@ -5,6 +5,7 @@ and/or use gtk-doc annotations. --> @@ -15,6 +16,7 @@ and/or use gtk-doc annotations. --> + Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Shell-Screenshot.top_of_page">org.gnome.Shell.Screenshot</link>. + line="2715">Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Shell-Screenshot.top_of_page">org.gnome.Shell.Screenshot</link>. The skeleton object. + line="2720">The skeleton object. @@ -2799,7 +2801,7 @@ compositor. glib:type-struct="LockscreenClass"> The main lock screen + line="42">The main lock screen The lock screen displayed on the primary output featuring the clock and unlock keypad. It handles displaying ongoing calls when the @@ -2833,7 +2835,7 @@ Other outputs are locked via PhoshLockshields. c:identifier="phosh_lockscreen_add_extra_page"> Inserts a custom widget into the "extra" page of the lockscreen. This page sits in-between the + line="1280">Inserts a custom widget into the "extra" page of the lockscreen. This page sits in-between the info page and the keypad page. By default, this page does not exist and is not used. Once an extra page is added, it can be navigated to by swiping and also via calls to [method@Lockscreen.set_default_page]. @@ -2845,13 +2847,13 @@ extra page is added, it can be navigated to by swiping and also via calls to The `PhoshLockscreen` + line="1282">The `PhoshLockscreen` The extra #GtkWidget to insert into the lockscreen carousel + line="1283">The extra #GtkWidget to insert into the lockscreen carousel @@ -2860,7 +2862,7 @@ extra page is added, it can be navigated to by swiping and also via calls to c:identifier="phosh_lockscreen_clear_pin_entry"> Clears the current contents of the keypad PIN entry buffer + line="1240">Clears the current contents of the keypad PIN entry buffer @@ -2869,7 +2871,7 @@ extra page is added, it can be navigated to by swiping and also via calls to The `PhoshLockscreen` + line="1242">The `PhoshLockscreen` @@ -2881,14 +2883,14 @@ extra page is added, it can be navigated to by swiping and also via calls to The #PhoshLockscreenPage that is currently shown + line="1140">The #PhoshLockscreenPage that is currently shown The `PhoshLockscreen` + line="1138">The `PhoshLockscreen` @@ -2897,19 +2899,19 @@ extra page is added, it can be navigated to by swiping and also via calls to c:identifier="phosh_lockscreen_get_pin_entry"> Get the current contents of the keypad PIN entry buffer + line="1222">Get the current contents of the keypad PIN entry buffer the contents of the entry buffer + line="1228">the contents of the entry buffer The `PhoshLockscreen` + line="1224">The `PhoshLockscreen` @@ -2918,7 +2920,7 @@ extra page is added, it can be navigated to by swiping and also via calls to c:identifier="phosh_lockscreen_set_default_page"> Specifies which page should be shown by default when the lockscreen is made visible. This will + line="1204">Specifies which page should be shown by default when the lockscreen is made visible. This will also be the page that is shown when the keypad idle timer is reached. @@ -2928,7 +2930,7 @@ also be the page that is shown when the keypad idle timer is reached. The `PhoshLockscreen` + line="1206">The `PhoshLockscreen` page: the page to show by default @@ -2940,7 +2942,7 @@ page: the page to show by default Scrolls to a specific page in the carousel. The state of the deck + line="1166">Scrolls to a specific page in the carousel. The state of the deck isn't changed. @@ -2950,7 +2952,7 @@ isn't changed. The `PhoshLockscreen` + line="1168">The `PhoshLockscreen` page: The page to scroll to @@ -2963,7 +2965,7 @@ page: The page to scroll to c:identifier="phosh_lockscreen_set_unlock_status"> Sets the text displayed in the unlock status label. + line="1301">Sets the text displayed in the unlock status label. @@ -2972,13 +2974,13 @@ page: The page to scroll to The `PhoshLockscreen` + line="1303">The `PhoshLockscreen` The status text + line="1304">The status text @@ -2987,7 +2989,7 @@ page: The page to scroll to c:identifier="phosh_lockscreen_shake_pin_entry"> Triggers an animation that shakes the PIN entry left and right for a brief period. + line="1255">Triggers an animation that shakes the PIN entry left and right for a brief period. After the animation is complete, the PIN entry buffer is cleared. Used to visually indicate authentication errors. @@ -2998,7 +3000,7 @@ authentication errors. The `PhoshLockscreen` + line="1257">The `PhoshLockscreen` @@ -3010,7 +3012,7 @@ authentication errors. transfer-ownership="none"> The calls manager handling incoming and active calls. + line="988">The calls manager handling incoming and active calls. default-value="PHOSH_LOCKSCREEN_PAGE_UNLOCK"> The currently active carousel page + line="1007">The currently active carousel page default-value="FALSE"> Require entering PIN or password to unlock. If false, unlock by swiping up. + line="998">Require entering PIN or password to unlock. If false, unlock by swiping up. @@ -3037,7 +3039,7 @@ authentication errors. This signal is emitted when authentication was successful and the + line="1020">This signal is emitted when authentication was successful and the session should be unlocked. @@ -3046,7 +3048,7 @@ session should be unlocked. Emitted when the output showing the lock screen should be woken + line="1030">Emitted when the output showing the lock screen should be woken up. @@ -3163,7 +3165,7 @@ up. glib:type-struct="LockscreenManagerClass"> The singleton that manages screen locking + line="31">The singleton that manages screen locking The #PhoshLockscreenManager is responsible for putting the #PhoshLockscreen on the primary output and a #PhoshLockshield on other outputs when the session @@ -3198,19 +3200,19 @@ becomes idle or when invoked explicitly via phosh_lockscreen_manager_set_locked( c:identifier="phosh_lockscreen_manager_get_lockscreen"> Gets the current [type@Lockscreen], if one exists (NULL otherwise). + line="638">Gets the current [type@Lockscreen], if one exists (NULL otherwise). The lockscreen + line="644">The lockscreen The lockscreen manager + line="640">The lockscreen manager @@ -3220,14 +3222,14 @@ becomes idle or when invoked explicitly via phosh_lockscreen_manager_set_locked( The currently shown #PhoshLockscreenPage in the #PhoshLockscreen + line="602">The currently shown #PhoshLockscreenPage in the #PhoshLockscreen The #PhoshLockscreenManager + line="600">The #PhoshLockscreenManager @@ -3275,12 +3277,15 @@ becomes idle or when invoked explicitly via phosh_lockscreen_manager_set_locked( setter="set_locked" getter="get_locked" default-value="FALSE"> + Whether the screen is locked Emitted when the outputs should be woken up. + line="531">Emitted when the outputs should be woken up. @@ -3346,14 +3351,14 @@ AcceleratorActivated events over DBus glib:type-struct="QuickSettingClass"> A `PhoshQuickSetting` represents a state of an entity (like Wi-Fi, Bluetooth) using an icon + line="17">A `PhoshQuickSetting` represents a state of an entity (like Wi-Fi, Bluetooth) using an icon and label. It should be added to a PhoshQuickSettingsBox for better integration. A quick-setting displays the state using an icon and label. The state is set by -[class@Phosh.StatusIcon], which must be added as a child. It can also have a status-page, which -can be used to expose additional features. For example, a Wi-Fi quick-setting can show available -Wi-Fi hotspots as an extra option. When a status widget is set, the quick-setting displays an -arrow at the right end. +[class@Phosh.StatusIcon], which must be set as a [property@Phosh.QuickSetting:status-icon]. It +can also have a status-page, which can be used to expose additional features. For example, a +Wi-Fi quick-setting can show available Wi-Fi hotspots as an extra option. When a status widget is +set, the quick-setting displays an arrow at the right end. A quick-setting itself does not have any provision to display its status-page. It is completely upto the user to display and hide the status-pages as required. However the @@ -3371,8 +3376,8 @@ that the children's `can-show-status` are synchronized with it. A quick-setting can be in an active or inactive state. However clicking the quick-setting does not toggle its state. The user must set the state using [property@Phosh.QuickSetting:active]. If -the child [class@StatusIcon] has an `enabled` property it will be automatically bound to the -[property@Phosh.QuickSetting:active] property. +the status-icon [class@StatusIcon] has an `enabled` property it will be automatically bound to +the [property@Phosh.QuickSetting:active] property. When a quick-setting is clicked, [signal@Phosh.QuickSetting::clicked] is emitted. When it is long-pressed or right-clicked, [signal@PhoshQuickSetting::long-pressed] is emitted. @@ -3382,12 +3387,12 @@ avoid duplicating this process for each quick-setting, the user can set [property@Phosh.QuickSetting:long-press-action-name] and [property@Phosh.QuickSetting:long-press-action-target]. The quick-setting then launches that appropriate action. - + - + @@ -3400,7 +3405,7 @@ appropriate action. - + @@ -3413,7 +3418,7 @@ appropriate action. - + @@ -3426,7 +3431,7 @@ appropriate action. - + @@ -3439,7 +3444,7 @@ appropriate action. - + @@ -3452,7 +3457,7 @@ appropriate action. - + @@ -3462,24 +3467,46 @@ appropriate action. + + Get the current status-icon of the quick-setting. + + + The status-icon or `NULL`. + + + + + A quick-setting + + + + Get the current status widget of the quick-setting. - + line="637">Get the current status widget of the quick-setting. + The status-page or `NULL`. + line="643">The status-page or `NULL`. A quick-setting + line="639">A quick-setting @@ -3487,7 +3514,7 @@ appropriate action. - + @@ -3503,7 +3530,7 @@ appropriate action. - + @@ -3519,7 +3546,7 @@ appropriate action. - + @@ -3535,7 +3562,7 @@ appropriate action. - + @@ -3551,7 +3578,7 @@ appropriate action. - + @@ -3564,13 +3591,38 @@ appropriate action. + + Set the status-icon of the quick-setting. Use `NULL` to remove existing icon. + + + + + + + A quick-setting + + + + A status-icon or `NULL` + + + + Set the status-page of the quick-setting. - + line="590">Set the status-page of the quick-setting. + @@ -3578,13 +3630,13 @@ appropriate action. A quick-setting + line="592">A quick-setting A status-page or `NULL` + line="593">A status-page or `NULL` @@ -3597,7 +3649,7 @@ appropriate action. default-value="FALSE"> The active state of the child. + line="299">The active state of the child. default-value="FALSE"> If the child can display its status. + line="317">If the child can display its status. default-value="NULL"> Action name to trigger on long-press. + line="344">Action name to trigger on long-press. default-value="NULL"> Action target for `long-press-action-name`. + line="353">Action target for `long-press-action-name`. default-value="FALSE"> If the child is displaying its status. + line="308">If the child is displaying its status. + + The status-icon. + + getter="get_status_page"> The status-page. + line="335">The status-page. @@ -3681,13 +3743,13 @@ appropriate action. - + - + @@ -3695,7 +3757,7 @@ appropriate action. - + @@ -3703,7 +3765,7 @@ appropriate action. - + @@ -3711,7 +3773,7 @@ appropriate action. - + @@ -3719,7 +3781,7 @@ appropriate action. - + @@ -3727,7 +3789,7 @@ appropriate action. - + @@ -3735,7 +3797,7 @@ appropriate action. - + @@ -3743,7 +3805,7 @@ appropriate action. - + @@ -3751,7 +3813,7 @@ appropriate action. - + @@ -3759,7 +3821,7 @@ appropriate action. - + @@ -3792,20 +3854,20 @@ taking screenshots. c:identifier="phosh_screenshot_manager_take_screenshot"> Initiate a screenshot of all outputs or the given area. If `copy_to_clipboard` is + line="1356">Initiate a screenshot of all outputs or the given area. If `copy_to_clipboard` is `TRUE` the screenshot is also copied to the clipboard. `FALSE` on failure, otherwise `TRUE` + line="1367">`FALSE` on failure, otherwise `TRUE` The screenshot manager + line="1358">The screenshot manager allow-none="1"> The area to capture or %NULL to capture all outputs + line="1359">The area to capture or %NULL to capture all outputs allow-none="1"> The output filename or %NULL to autogenerate a filename + line="1360">The output filename or %NULL to autogenerate a filename Whether to use the clipboard + line="1361">Whether to use the clipboard Whether to include the cursor + line="1362">Whether to include the cursor @@ -3859,7 +3921,7 @@ taking screenshots. glib:type-struct="ShellClass"> The shell singleton + line="107">The shell singleton #PhoshShell is responsible for instantiating the GUI parts of the shell#PhoshTopPanel, #PhoshHome,… and the managers that @@ -3877,12 +3939,12 @@ and coordinates between them. Get the shell singleton + line="2198">Get the shell singleton The shell singleton + line="2203">The shell singleton @@ -3918,14 +3980,14 @@ and coordinates between them. %TRUE if the shell is currently locked, otherwise %FALSE. + line="2452">%TRUE if the shell is currently locked, otherwise %FALSE. The #PhoshShell singleton + line="2450">The #PhoshShell singleton @@ -3934,19 +3996,19 @@ and coordinates between them. c:identifier="phosh_shell_get_lockscreen_manager"> Get the lockscreen manager + line="1660">Get the lockscreen manager The lockscreen manager + line="1666">The lockscreen manager The shell singleton + line="1662">The shell singleton @@ -3967,19 +4029,19 @@ and coordinates between them. c:identifier="phosh_shell_get_screenshot_manager"> Get the screenshot manager + line="1780">Get the screenshot manager The screenshot manager + line="1786">The screenshot manager The shell singleton + line="1782">The shell singleton @@ -3988,7 +4050,7 @@ and coordinates between them. c:identifier="phosh_shell_get_usable_area"> Gives the usable area in pixels usable by a client on the primary + line="2098">Gives the usable area in pixels usable by a client on the primary display. @@ -3998,7 +4060,7 @@ display. The shell + line="2100">The shell nullable="1"> The x coordinate where client usable area starts + line="2101">The x coordinate where client usable area starts nullable="1"> The y coordinate where client usable area starts + line="2102">The y coordinate where client usable area starts nullable="1"> The width of the client usable area + line="2103">The width of the client usable area nullable="1"> The height of the client usable area + line="2104">The height of the client usable area @@ -4046,7 +4108,7 @@ display. Set the PhoshShell singleton that is returned by `phosh_shell_get_default()` + line="2181">Set the PhoshShell singleton that is returned by `phosh_shell_get_default()` @@ -4055,7 +4117,7 @@ display. The shell to use + line="2183">The shell to use @@ -4066,7 +4128,7 @@ display. transfer-ownership="none"> The built in monitor. This is a hardware property and hence can + line="1260">The built in monitor. This is a hardware property and hence can only be read. It can be %NULL when not present or disabled. @@ -4076,7 +4138,7 @@ only be read. It can be %NULL when not present or disabled. default-value="FALSE"> Whether the device is currently docked. This mirrors the property + line="1249">Whether the device is currently docked. This mirrors the property from #PhoshDockedManager for easier access. @@ -4087,7 +4149,7 @@ from #PhoshDockedManager for easier access. default-value="FALSE"> Whether the screen is currently locked. This mirrors the property + line="1239">Whether the screen is currently locked. This mirrors the property from #PhoshLockscreenManager for easier access. @@ -4097,7 +4159,7 @@ from #PhoshLockscreenManager for easier access. default-value="TRUE"> Whether to display the `PhoshHome` (overview and home bar) + line="1296">Whether to display the `PhoshHome` (overview and home bar) transfer-ownership="none"> The primary monitor that has the panels, lock screen etc. + line="1272">The primary monitor that has the panels, lock screen etc. default-value="PHOSH_STATE_NONE"> The state of the shell (locked, modal dialog shown, …) + line="1283">The state of the shell (locked, modal dialog shown, …) @@ -4126,7 +4188,7 @@ from #PhoshLockscreenManager for easier access. The ready signal is emitted once when the shell finished starting + line="1308">The ready signal is emitted once when the shell finished starting up. @@ -4270,19 +4332,19 @@ recommended (but not required) that derived classes implement a glib:get-property="extra-widget"> Get the extra widget or %NULL if there's no extra widget - + line="441">Get the extra widget or %NULL if there's no extra widget + The extra widget + line="447">The extra widget A status icon + line="443">A status icon @@ -4290,7 +4352,7 @@ recommended (but not required) that derived classes implement a - + @@ -4302,13 +4364,25 @@ recommended (but not required) that derived classes implement a + glib:get-property="icon-size" + deprecated="1" + deprecated-version="0.47"> + Return the size of status-icon. + Use [method@Phosh.StatusIcon.get_pixel_size]. + The size of status-icon. + The status-icon @@ -4316,7 +4390,7 @@ recommended (but not required) that derived classes implement a - + @@ -4326,11 +4400,12 @@ recommended (but not required) that derived classes implement a - - + + - + @@ -4341,7 +4416,7 @@ recommended (but not required) that derived classes implement a - + @@ -4357,7 +4432,7 @@ recommended (but not required) that derived classes implement a - + @@ -4372,16 +4447,28 @@ recommended (but not required) that derived classes implement a + glib:set-property="icon-size" + deprecated="1" + deprecated-version="0.47"> + Set the size of status-icon. + Use [method@Phosh.StatusIcon.set_pixel_size]. + The status-icon + The size of icon @@ -4389,7 +4476,7 @@ recommended (but not required) that derived classes implement a - + @@ -4402,9 +4489,10 @@ recommended (but not required) that derived classes implement a - - + + @@ -4412,8 +4500,8 @@ recommended (but not required) that derived classes implement a - - + + @@ -4424,7 +4512,7 @@ recommended (but not required) that derived classes implement a getter="get_extra_widget"> An extra widget to display. This is used for extra information when + line="224">An extra widget to display. This is used for extra information when used in PhoshTopPanel. When used in [type@QuickSetting] this is not needed. @@ -4437,7 +4525,7 @@ is not needed. default-value="NULL"> The name of the icon to display in the widget + line="196">The name of the icon to display in the widget default-value="GTK_ICON_SIZE_LARGE_TOOLBAR"> The size of the icon to display in the widget + line="205">The size of the icon to display in the widget default-value="NULL"> Textual information to display. Think of it as the [type@StatusIcon]'s + line="235">Textual information to display. Think of it as the [type@StatusIcon]'s label. + + The size of the icon to display in the widget + + @@ -4587,24 +4686,46 @@ This is displayed when the quick setting needs to show status. + + Get the content widget of the status page + + + The status page content + + + + + A quick setting status page + + + + Get the footer of the status page - + line="385">Get the footer of the status page + The status page footer + line="391">The status page footer A quick setting status page + line="387">A quick setting status page @@ -4614,19 +4735,19 @@ This is displayed when the quick setting needs to show status. glib:get-property="header"> Get the header widget of the status page + line="281">Get the header widget of the status page The status page header + line="287">The status page header A quick setting status page + line="283">A quick setting status page @@ -4644,13 +4765,36 @@ This is displayed when the quick setting needs to show status. + + Set the content widget of the status page. See [property@StatusPage:content]. Use `NULL` to +remove existing content. + + + + + + + A quick setting status page + + + + + + + Set the footer widget shown at the bottom of a status page - + line="352">Set the footer widget shown at the bottom of a status page + @@ -4658,7 +4802,7 @@ This is displayed when the quick setting needs to show status. A quick setting status page + line="354">A quick setting status page @@ -4671,7 +4815,7 @@ This is displayed when the quick setting needs to show status. glib:set-property="header"> Set the header widget of the status page. See + line="248">Set the header widget of the status page. See [property@StatusPage:header]. @@ -4681,7 +4825,7 @@ This is displayed when the quick setting needs to show status. A quick setting status page + line="250">A quick setting status page @@ -4705,6 +4849,16 @@ This is displayed when the quick setting needs to show status. + + The content of status page. + + getter="get_footer"> Widget displayed at the very bottom - usually a button. + line="166">Widget displayed at the very bottom - usually a button. getter="get_header"> An extra widget to add to end of the status page's header + line="148">An extra widget to add to end of the status page's header default-value="NULL"> The status page title + line="139">The status page title @@ -4742,7 +4896,7 @@ This is displayed when the quick setting needs to show status. The status page should be closed + line="178">The status page should be closed @@ -4845,10 +4999,10 @@ This is displayed when the quick setting needs to show status. glib:type-struct="WallClockClass"> Wall clock used for fetching date and time - + line="23">Wall clock used for fetching date and time + - + @@ -4856,44 +5010,44 @@ This is displayed when the quick setting needs to show status. Get the wall clock singleton - + line="190">Get the wall clock singleton + The wall clock singleton + line="195">The wall clock singleton Gets the current clock string, if time_only is true this will be just the + line="206">Gets the current clock string, if time_only is true this will be just the current time, otherwise the date + time. - + the clock time string + line="214">the clock time string The wall clock + line="208">The wall clock whether to return full clock string or just the time + line="209">whether to return full clock string or just the time - + @@ -4906,26 +5060,26 @@ current time, otherwise the date + time. Gets the current clock string, if time_only is true this will be just the + line="206">Gets the current clock string, if time_only is true this will be just the current time, otherwise the date + time. - + the clock time string + line="214">the clock time string The wall clock + line="208">The wall clock whether to return full clock string or just the time + line="209">whether to return full clock string or just the time @@ -4933,22 +5087,22 @@ current time, otherwise the date + time. Get the local date as string + line="253">Get the local date as string We honor LC_MESSAGES so we e.g. don't get a translated date when the user has LC_MESSAGES=en_US.UTF-8 but LC_TIME to their local time zone. - + The local date as string + line="262">The local date as string The wall clock + line="255">The wall clock @@ -4956,9 +5110,9 @@ time zone. Set the wall clock singleton. This sets the singleton returned by + line="172">Set the wall clock singleton. This sets the singleton returned by `phosh_wall_clock_get_default()`. - + @@ -4966,14 +5120,14 @@ time zone. The clock to use + line="174">The clock to use - + @@ -5008,30 +5162,30 @@ time zone. - + - + the clock time string + line="214">the clock time string The wall clock + line="208">The wall clock whether to return full clock string or just the time + line="209">whether to return full clock string or just the time @@ -5039,7 +5193,7 @@ time zone. - + @@ -5052,7 +5206,7 @@ time zone. - + @@ -5060,7 +5214,7 @@ time zone. - + @@ -5068,7 +5222,7 @@ time zone. - + @@ -5076,7 +5230,7 @@ time zone. - + @@ -5084,7 +5238,7 @@ time zone. - + @@ -5092,7 +5246,7 @@ time zone. - + @@ -5100,7 +5254,7 @@ time zone. - + @@ -5108,7 +5262,7 @@ time zone. - + diff --git a/README.md b/README.md index 23348c1436b07e05c2d6fc7fd171bdd0a381c39e..e835131209ce427e98a02f6e81e757f518fb539c 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ There's two examples demoing the libphosh-rs usage: ### Documentation -API documentation is at +API documentation is at [phosh]: https://gitlab.gnome.org/World/Phosh/phosh [phosh-deps]: https://gitlab.gnome.org/World/Phosh/phosh#dependencies diff --git a/fix.sh b/fix.sh index 0fb960e152596062d5088d8477850eaad458a246..35636e7f10f4343cbb59908fc9c93b0ba0248d9f 100755 --- a/fix.sh +++ b/fix.sh @@ -11,8 +11,10 @@ xmlstarlet ed -L \ -i '//_:interface[@name="Connection"]/_:method[@name="diff"]//_:parameter[@name="out_settings"]//_:type[@c:type="uint32"]' -t 'attr' -n 'name' -v 'guint32' \ NM-1.0.gir -# Nuke gcr rather than fixing Gck +# Nuke gcr rather than fixing Gck and don't care about GnomeBluetooth +# Drop doc:format (see https://github.com/gtk-rs/gir/issues/1642) xmlstarlet ed -L \ -d '///_:include[@name="Gcr"]' \ - -d '///_:include[@name="GnomeBluetooth"]' \ + -d '///_:include[@name="GnomeBluetooth"]' \ + -d '///doc:format[@name="unknown"]' \ Phosh-0.gir diff --git a/gir b/gir index 5223ce91b97a833b09d6cbd04bbeab1bf18112b7..be9aa145267cb915b3c79c4ae6d896beecc061ee 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 5223ce91b97a833b09d6cbd04bbeab1bf18112b7 +Subproject commit be9aa145267cb915b3c79c4ae6d896beecc061ee diff --git a/libphosh/Cargo.toml b/libphosh/Cargo.toml index e7e7992ba840b229d6ab30cfa3a90b09ab6e3ec6..0f412d48409f850307deb89547a532ca7e2ef404 100644 --- a/libphosh/Cargo.toml +++ b/libphosh/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "libphosh" -version = "0.0.6" +version = "0.0.7" authors = ["Guido Günther "] edition = "2021" readme = "../README.md" -homepage = "https://gitlab.gnome.org/guidog/libphosh-rs" +homepage = "https://gitlab.gnome.org/World/Phosh/libphosh-rs" description = "Rust bindings for libphosh" license = "MIT" -repository = "https://gitlab.gnome.org/guidog/libphosh-rs.git" +repository = "https://gitlab.gnome.org/World/Phosh/libphosh-rs.git" categories = ["api-bindings"] keywords = ["phosh", "gnome"] @@ -57,4 +57,4 @@ features = ["v3_24"] [dependencies.ffi] package = "libphosh-sys" path = './sys' -version = "0.0.6" +version = "0.0.7" diff --git a/libphosh/src/auto/enums.rs b/libphosh/src/auto/enums.rs index 948af5bf00465d94121518d42c8505ef7f5f379c..50376d3734a14d143ae1d406e87394201a04e869 100644 --- a/libphosh/src/auto/enums.rs +++ b/libphosh/src/auto/enums.rs @@ -3,6 +3,7 @@ // from ../gir-files // DO NOT EDIT +use crate::{ffi}; use glib::{prelude::*,translate::*}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] diff --git a/libphosh/src/auto/lockscreen.rs b/libphosh/src/auto/lockscreen.rs index 1e9ac06d6a8da562f9e8c7edc715196b47fdd5cc..cb82e882de009e564af5fa71e2b5c62b69b4ddff 100644 --- a/libphosh/src/auto/lockscreen.rs +++ b/libphosh/src/auto/lockscreen.rs @@ -3,8 +3,8 @@ // from ../gir-files // DO NOT EDIT -use crate::{LockscreenPage}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use crate::{ffi,LockscreenPage}; +use glib::{object::ObjectType as _,prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { @@ -396,15 +396,11 @@ pub struct LockscreenBuilder { /// Build the [`Lockscreen`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Lockscreen { +assert_initialized_main_thread!(); self.builder.build() } } -mod sealed { - pub trait Sealed {} - impl> Sealed for T {} -} - -pub trait LockscreenExt: IsA + sealed::Sealed + 'static { +pub trait LockscreenExt: IsA + 'static { #[doc(alias = "phosh_lockscreen_add_extra_page")] fn add_extra_page(&self, widget: &impl IsA) { unsafe { @@ -481,8 +477,8 @@ pub trait LockscreenExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"lockscreen-unlock\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(lockscreen_unlock_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"lockscreen-unlock".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(lockscreen_unlock_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -494,8 +490,8 @@ pub trait LockscreenExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"wakeup-output\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(wakeup_output_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"wakeup-output".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(wakeup_output_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -507,8 +503,8 @@ pub trait LockscreenExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::page\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_page_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::page".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_page_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -520,8 +516,8 @@ pub trait LockscreenExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::require-unlock\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_require_unlock_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::require-unlock".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_require_unlock_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libphosh/src/auto/lockscreen_manager.rs b/libphosh/src/auto/lockscreen_manager.rs index 592839d4b179e57e29fa5b394c0507db01800e2f..1140bbb3d5da82f5e80d001b0a1dceab29bf4d4f 100644 --- a/libphosh/src/auto/lockscreen_manager.rs +++ b/libphosh/src/auto/lockscreen_manager.rs @@ -3,8 +3,8 @@ // from ../gir-files // DO NOT EDIT -use crate::{Lockscreen,LockscreenPage}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use crate::{ffi,Lockscreen,LockscreenPage}; +use glib::{object::ObjectType as _,prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { @@ -36,6 +36,7 @@ impl LockscreenManager { #[doc(alias = "phosh_lockscreen_manager_get_locked")] #[doc(alias = "get_locked")] + #[doc(alias = "locked")] pub fn is_locked(&self) -> bool { unsafe { from_glib(ffi::phosh_lockscreen_manager_get_locked(self.to_glib_none().0)) @@ -59,6 +60,7 @@ impl LockscreenManager { } #[doc(alias = "phosh_lockscreen_manager_set_locked")] + #[doc(alias = "locked")] pub fn set_locked(&self, state: bool) { unsafe { ffi::phosh_lockscreen_manager_set_locked(self.to_glib_none().0, state.into_glib()); @@ -80,8 +82,8 @@ impl LockscreenManager { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"wakeup-outputs\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(wakeup_outputs_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"wakeup-outputs".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(wakeup_outputs_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -93,8 +95,8 @@ impl LockscreenManager { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::locked\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_locked_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::locked".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_locked_trampoline:: as *const ())), Box_::into_raw(f)) } } } @@ -121,5 +123,6 @@ pub struct LockscreenManagerBuilder { /// Build the [`LockscreenManager`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> LockscreenManager { +assert_initialized_main_thread!(); self.builder.build() } } diff --git a/libphosh/src/auto/quick_setting.rs b/libphosh/src/auto/quick_setting.rs index 228ad0260a390061c0c18b32bf76a6c03a224fbb..db28d08cce95ac30afabcd70bd72c0cb80f5df5c 100644 --- a/libphosh/src/auto/quick_setting.rs +++ b/libphosh/src/auto/quick_setting.rs @@ -3,8 +3,8 @@ // from ../gir-files // DO NOT EDIT -use crate::{StatusPage}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use crate::{ffi,StatusIcon,StatusPage}; +use glib::{object::ObjectType as _,prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { @@ -78,6 +78,10 @@ pub struct QuickSettingBuilder { Self { builder: self.builder.property("showing-status", showing_status), } } + pub fn status_icon(self, status_icon: &impl IsA) -> Self { + Self { builder: self.builder.property("status-icon", status_icon.clone().upcast()), } + } + pub fn status_page(self, status_page: &impl IsA) -> Self { Self { builder: self.builder.property("status-page", status_page.clone().upcast()), } } @@ -285,17 +289,14 @@ pub struct QuickSettingBuilder { /// Build the [`QuickSetting`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> QuickSetting { +assert_initialized_main_thread!(); self.builder.build() } } -mod sealed { - pub trait Sealed {} - impl> Sealed for T {} -} - -pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { +pub trait QuickSettingExt: IsA + 'static { #[doc(alias = "phosh_quick_setting_get_active")] #[doc(alias = "get_active")] + #[doc(alias = "active")] fn is_active(&self) -> bool { unsafe { from_glib(ffi::phosh_quick_setting_get_active(self.as_ref().to_glib_none().0)) @@ -304,6 +305,7 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_quick_setting_get_can_show_status")] #[doc(alias = "get_can_show_status")] + #[doc(alias = "can-show-status")] fn can_show_status(&self) -> bool { unsafe { from_glib(ffi::phosh_quick_setting_get_can_show_status(self.as_ref().to_glib_none().0)) @@ -312,6 +314,7 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_quick_setting_get_long_press_action_name")] #[doc(alias = "get_long_press_action_name")] + #[doc(alias = "long-press-action-name")] fn long_press_action_name(&self) -> glib::GString { unsafe { from_glib_none(ffi::phosh_quick_setting_get_long_press_action_name(self.as_ref().to_glib_none().0)) @@ -320,6 +323,7 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_quick_setting_get_long_press_action_target")] #[doc(alias = "get_long_press_action_target")] + #[doc(alias = "long-press-action-target")] fn long_press_action_target(&self) -> glib::GString { unsafe { from_glib_none(ffi::phosh_quick_setting_get_long_press_action_target(self.as_ref().to_glib_none().0)) @@ -328,14 +332,25 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_quick_setting_get_showing_status")] #[doc(alias = "get_showing_status")] + #[doc(alias = "showing-status")] fn is_showing_status(&self) -> bool { unsafe { from_glib(ffi::phosh_quick_setting_get_showing_status(self.as_ref().to_glib_none().0)) } } + #[doc(alias = "phosh_quick_setting_get_status_icon")] + #[doc(alias = "get_status_icon")] + #[doc(alias = "status-icon")] + fn status_icon(&self) -> StatusIcon { + unsafe { + from_glib_none(ffi::phosh_quick_setting_get_status_icon(self.as_ref().to_glib_none().0)) + } + } + #[doc(alias = "phosh_quick_setting_get_status_page")] #[doc(alias = "get_status_page")] + #[doc(alias = "status-page")] fn status_page(&self) -> StatusPage { unsafe { from_glib_none(ffi::phosh_quick_setting_get_status_page(self.as_ref().to_glib_none().0)) @@ -343,6 +358,7 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_quick_setting_set_active")] + #[doc(alias = "active")] fn set_active(&self, active: bool) { unsafe { ffi::phosh_quick_setting_set_active(self.as_ref().to_glib_none().0, active.into_glib()); @@ -350,6 +366,7 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_quick_setting_set_can_show_status")] + #[doc(alias = "can-show-status")] fn set_can_show_status(&self, can_show_status: bool) { unsafe { ffi::phosh_quick_setting_set_can_show_status(self.as_ref().to_glib_none().0, can_show_status.into_glib()); @@ -357,6 +374,7 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_quick_setting_set_long_press_action_name")] + #[doc(alias = "long-press-action-name")] fn set_long_press_action_name(&self, action_name: &str) { unsafe { ffi::phosh_quick_setting_set_long_press_action_name(self.as_ref().to_glib_none().0, action_name.to_glib_none().0); @@ -364,6 +382,7 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_quick_setting_set_long_press_action_target")] + #[doc(alias = "long-press-action-target")] fn set_long_press_action_target(&self, action_target: &str) { unsafe { ffi::phosh_quick_setting_set_long_press_action_target(self.as_ref().to_glib_none().0, action_target.to_glib_none().0); @@ -371,13 +390,23 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_quick_setting_set_showing_status")] + #[doc(alias = "showing-status")] fn set_showing_status(&self, showing_status: bool) { unsafe { ffi::phosh_quick_setting_set_showing_status(self.as_ref().to_glib_none().0, showing_status.into_glib()); } } + #[doc(alias = "phosh_quick_setting_set_status_icon")] + #[doc(alias = "status-icon")] + fn set_status_icon(&self, status_icon: &impl IsA) { + unsafe { + ffi::phosh_quick_setting_set_status_icon(self.as_ref().to_glib_none().0, status_icon.as_ref().to_glib_none().0); + } + } + #[doc(alias = "phosh_quick_setting_set_status_page")] + #[doc(alias = "status-page")] fn set_status_page(&self, status_page: &impl IsA) { unsafe { ffi::phosh_quick_setting_set_status_page(self.as_ref().to_glib_none().0, status_page.as_ref().to_glib_none().0); @@ -392,8 +421,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"clicked\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(clicked_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"clicked".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(clicked_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -405,8 +434,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"hide-status\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(hide_status_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"hide-status".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(hide_status_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -418,8 +447,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"long-pressed\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(long_pressed_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"long-pressed".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(long_pressed_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -431,8 +460,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"show-status\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(show_status_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"show-status".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(show_status_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -444,8 +473,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_active_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::active".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_active_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -457,8 +486,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::can-show-status\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_can_show_status_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::can-show-status".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_can_show_status_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -470,8 +499,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::long-press-action-name\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_long_press_action_name_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::long-press-action-name".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_long_press_action_name_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -483,8 +512,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::long-press-action-target\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_long_press_action_target_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::long-press-action-target".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_long_press_action_target_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -496,8 +525,21 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::showing-status\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_showing_status_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::showing-status".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_showing_status_trampoline:: as *const ())), Box_::into_raw(f)) + } + } + + #[doc(alias = "status-icon")] + fn connect_status_icon_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_status_icon_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + let f: &F = &*(f as *const F); + f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, c"notify::status-icon".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_status_icon_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -509,8 +551,8 @@ pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::status-page\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_status_page_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::status-page".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_status_page_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libphosh/src/auto/screenshot_manager.rs b/libphosh/src/auto/screenshot_manager.rs index cd436e7fd6c43dd250ec4bb92b19f72ca626a159..1820e9ab63dfcdd7cdf884d2c9f56f24bf348962 100644 --- a/libphosh/src/auto/screenshot_manager.rs +++ b/libphosh/src/auto/screenshot_manager.rs @@ -3,6 +3,7 @@ // from ../gir-files // DO NOT EDIT +use crate::{ffi}; use glib::{translate::*}; glib::wrapper! { diff --git a/libphosh/src/auto/shell.rs b/libphosh/src/auto/shell.rs index 9b330092d975939de7d7fdddbea31aef53b681d1..fed862c844c10d7ab1c4a4447ed389ca457e5bb2 100644 --- a/libphosh/src/auto/shell.rs +++ b/libphosh/src/auto/shell.rs @@ -3,8 +3,8 @@ // from ../gir-files // DO NOT EDIT -use crate::{LockscreenManager,ScreenshotManager}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use crate::{ffi,LockscreenManager,ScreenshotManager}; +use glib::{object::ObjectType as _,prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { @@ -83,15 +83,11 @@ pub struct ShellBuilder { /// Build the [`Shell`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Shell { +assert_initialized_main_thread!(); self.builder.build() } } -mod sealed { - pub trait Sealed {} - impl> Sealed for T {} -} - -pub trait ShellExt: IsA + sealed::Sealed + 'static { +pub trait ShellExt: IsA + 'static { #[doc(alias = "phosh_shell_fade_out")] fn fade_out(&self, timeout: u32) { unsafe { @@ -101,6 +97,7 @@ pub trait ShellExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_shell_get_locked")] #[doc(alias = "get_locked")] + #[doc(alias = "locked")] fn is_locked(&self) -> bool { unsafe { from_glib(ffi::phosh_shell_get_locked(self.as_ref().to_glib_none().0)) @@ -181,8 +178,8 @@ pub trait ShellExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"ready\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(ready_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"ready".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(ready_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -194,8 +191,8 @@ pub trait ShellExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::docked\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_docked_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::docked".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_docked_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -207,8 +204,8 @@ pub trait ShellExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::locked\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_locked_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::locked".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_locked_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -220,8 +217,8 @@ pub trait ShellExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::overview-visible\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_overview_visible_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::overview-visible".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_overview_visible_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libphosh/src/auto/status_icon.rs b/libphosh/src/auto/status_icon.rs index 0a804c249ed0642d80a80dcf6712069d729b357b..840210fbd10f6e5ea76f5267ac2e55fa8b221430 100644 --- a/libphosh/src/auto/status_icon.rs +++ b/libphosh/src/auto/status_icon.rs @@ -3,6 +3,7 @@ // from ../gir-files // DO NOT EDIT +use crate::{ffi}; use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; @@ -73,6 +74,10 @@ pub struct StatusIconBuilder { Self { builder: self.builder.property("info", info.into()), } } + pub fn pixel_size(self, pixel_size: u32) -> Self { + Self { builder: self.builder.property("pixel-size", pixel_size), } + } + pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } @@ -276,17 +281,14 @@ pub struct StatusIconBuilder { /// Build the [`StatusIcon`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> StatusIcon { +assert_initialized_main_thread!(); self.builder.build() } } -mod sealed { - pub trait Sealed {} - impl> Sealed for T {} -} - -pub trait StatusIconExt: IsA + sealed::Sealed + 'static { +pub trait StatusIconExt: IsA + 'static { #[doc(alias = "phosh_status_icon_get_extra_widget")] #[doc(alias = "get_extra_widget")] + #[doc(alias = "extra-widget")] fn extra_widget(&self) -> Option { unsafe { from_glib_none(ffi::phosh_status_icon_get_extra_widget(self.as_ref().to_glib_none().0)) @@ -295,18 +297,13 @@ pub trait StatusIconExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_status_icon_get_icon_name")] #[doc(alias = "get_icon_name")] + #[doc(alias = "icon-name")] fn icon_name(&self) -> glib::GString { unsafe { from_glib_full(ffi::phosh_status_icon_get_icon_name(self.as_ref().to_glib_none().0)) } } - //#[doc(alias = "phosh_status_icon_get_icon_size")] - //#[doc(alias = "get_icon_size")] - //fn icon_size(&self) -> /*Ignored*/gtk::IconSize { - // unsafe { TODO: call ffi:phosh_status_icon_get_icon_size() } - //} - #[doc(alias = "phosh_status_icon_get_info")] #[doc(alias = "get_info")] fn info(&self) -> glib::GString { @@ -315,15 +312,17 @@ pub trait StatusIconExt: IsA + sealed::Sealed + 'static { } } - #[doc(alias = "phosh_status_icon_get_show_always")] - #[doc(alias = "get_show_always")] - fn shows_always(&self) -> bool { + #[doc(alias = "phosh_status_icon_get_pixel_size")] + #[doc(alias = "get_pixel_size")] + #[doc(alias = "pixel-size")] + fn pixel_size(&self) -> u32 { unsafe { - from_glib(ffi::phosh_status_icon_get_show_always(self.as_ref().to_glib_none().0)) + ffi::phosh_status_icon_get_pixel_size(self.as_ref().to_glib_none().0) } } #[doc(alias = "phosh_status_icon_set_extra_widget")] + #[doc(alias = "extra-widget")] fn set_extra_widget(&self, widget: &impl IsA) { unsafe { ffi::phosh_status_icon_set_extra_widget(self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0); @@ -331,31 +330,39 @@ pub trait StatusIconExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_status_icon_set_icon_name")] + #[doc(alias = "icon-name")] fn set_icon_name(&self, icon_name: &str) { unsafe { ffi::phosh_status_icon_set_icon_name(self.as_ref().to_glib_none().0, icon_name.to_glib_none().0); } } - //#[doc(alias = "phosh_status_icon_set_icon_size")] - //fn set_icon_size(&self, size: /*Ignored*/gtk::IconSize) { - // unsafe { TODO: call ffi:phosh_status_icon_set_icon_size() } - //} - #[doc(alias = "phosh_status_icon_set_info")] + #[doc(alias = "info")] fn set_info(&self, info: &str) { unsafe { ffi::phosh_status_icon_set_info(self.as_ref().to_glib_none().0, info.to_glib_none().0); } } - #[doc(alias = "phosh_status_icon_set_show_always")] - fn set_show_always(&self, show_always: bool) { + #[doc(alias = "phosh_status_icon_set_pixel_size")] + #[doc(alias = "pixel-size")] + fn set_pixel_size(&self, size: u32) { unsafe { - ffi::phosh_status_icon_set_show_always(self.as_ref().to_glib_none().0, show_always.into_glib()); + ffi::phosh_status_icon_set_pixel_size(self.as_ref().to_glib_none().0, size); } } + //#[doc(alias = "icon-size")] + //fn icon_size(&self) -> /*Ignored*/gtk::IconSize { + // ObjectExt::property(self.as_ref(), "icon-size") + //} + + //#[doc(alias = "icon-size")] + //fn set_icon_size(&self, icon_size: /*Ignored*/gtk::IconSize) { + // ObjectExt::set_property(self.as_ref(),"icon-size", icon_size) + //} + #[doc(alias = "extra-widget")] fn connect_extra_widget_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_extra_widget_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusIcon, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { @@ -364,8 +371,8 @@ pub trait StatusIconExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::extra-widget\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_extra_widget_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::extra-widget".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_extra_widget_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -377,8 +384,8 @@ pub trait StatusIconExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::icon-name\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_icon_name_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::icon-name".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_icon_name_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -390,8 +397,8 @@ pub trait StatusIconExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::icon-size\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_icon_size_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::icon-size".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_icon_size_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -403,8 +410,21 @@ pub trait StatusIconExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::info\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_info_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::info".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_info_trampoline:: as *const ())), Box_::into_raw(f)) + } + } + + #[doc(alias = "pixel-size")] + fn connect_pixel_size_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_pixel_size_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusIcon, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + let f: &F = &*(f as *const F); + f(StatusIcon::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, c"notify::pixel-size".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_pixel_size_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libphosh/src/auto/status_page.rs b/libphosh/src/auto/status_page.rs index a804ebf506e24bdbc6effbe0d32d8770ae37f457..593f9d6b344211942c6afe56910d0b101da63c06 100644 --- a/libphosh/src/auto/status_page.rs +++ b/libphosh/src/auto/status_page.rs @@ -3,7 +3,8 @@ // from ../gir-files // DO NOT EDIT -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use crate::{ffi}; +use glib::{object::ObjectType as _,prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { @@ -57,6 +58,10 @@ pub struct StatusPageBuilder { Self { builder: glib::object::Object::builder() } } + pub fn content(self, content: &impl IsA) -> Self { + Self { builder: self.builder.property("content", content.clone().upcast()), } + } + pub fn footer(self, footer: &impl IsA) -> Self { Self { builder: self.builder.property("footer", footer.clone().upcast()), } } @@ -272,15 +277,19 @@ pub struct StatusPageBuilder { /// Build the [`StatusPage`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> StatusPage { +assert_initialized_main_thread!(); self.builder.build() } } -mod sealed { - pub trait Sealed {} - impl> Sealed for T {} -} +pub trait StatusPageExt: IsA + 'static { + #[doc(alias = "phosh_status_page_get_content")] + #[doc(alias = "get_content")] + fn content(&self) -> gtk::Widget { + unsafe { + from_glib_none(ffi::phosh_status_page_get_content(self.as_ref().to_glib_none().0)) + } + } -pub trait StatusPageExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_status_page_get_footer")] #[doc(alias = "get_footer")] fn footer(&self) -> gtk::Widget { @@ -305,7 +314,16 @@ pub trait StatusPageExt: IsA + sealed::Sealed + 'static { } } + #[doc(alias = "phosh_status_page_set_content")] + #[doc(alias = "content")] + fn set_content(&self, content: &impl IsA) { + unsafe { + ffi::phosh_status_page_set_content(self.as_ref().to_glib_none().0, content.as_ref().to_glib_none().0); + } + } + #[doc(alias = "phosh_status_page_set_footer")] + #[doc(alias = "footer")] fn set_footer(&self, footer: &impl IsA) { unsafe { ffi::phosh_status_page_set_footer(self.as_ref().to_glib_none().0, footer.as_ref().to_glib_none().0); @@ -313,6 +331,7 @@ pub trait StatusPageExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_status_page_set_header")] + #[doc(alias = "header")] fn set_header(&self, header: &impl IsA) { unsafe { ffi::phosh_status_page_set_header(self.as_ref().to_glib_none().0, header.as_ref().to_glib_none().0); @@ -320,6 +339,7 @@ pub trait StatusPageExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "phosh_status_page_set_title")] + #[doc(alias = "title")] fn set_title(&self, title: &str) { unsafe { ffi::phosh_status_page_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0); @@ -334,8 +354,21 @@ pub trait StatusPageExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"done\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(done_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"done".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(done_trampoline:: as *const ())), Box_::into_raw(f)) + } + } + + #[doc(alias = "content")] + fn connect_content_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_content_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + let f: &F = &*(f as *const F); + f(StatusPage::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, c"notify::content".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_content_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -347,8 +380,8 @@ pub trait StatusPageExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::footer\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_footer_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::footer".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_footer_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -360,8 +393,8 @@ pub trait StatusPageExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::header\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_header_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::header".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_header_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -373,8 +406,8 @@ pub trait StatusPageExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_title_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::title".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_title_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libphosh/src/auto/versions.txt b/libphosh/src/auto/versions.txt index 4390cb6623793543a6a5fcdedc75fc226e636934..5d930cef507a018cc264a27f7e7ccd767db9d570 100644 --- a/libphosh/src/auto/versions.txt +++ b/libphosh/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) -from .. (@ eb5ea3018a51+) +Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +from .. (@ b4c1dbc27547+) from ../gir-files (@ 6cd7b656acd6) diff --git a/libphosh/src/auto/wall_clock.rs b/libphosh/src/auto/wall_clock.rs index ef8065982858fa536163f6474f8c2a56e774f702..e88cce93832f6726fef04706c1d37f876aa1612e 100644 --- a/libphosh/src/auto/wall_clock.rs +++ b/libphosh/src/auto/wall_clock.rs @@ -3,6 +3,7 @@ // from ../gir-files // DO NOT EDIT +use crate::{ffi}; use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; @@ -43,12 +44,7 @@ impl Default for WallClock { } } -mod sealed { - pub trait Sealed {} - impl> Sealed for T {} -} - -pub trait WallClockExt: IsA + sealed::Sealed + 'static { +pub trait WallClockExt: IsA + 'static { #[doc(alias = "phosh_wall_clock_get_clock")] #[doc(alias = "get_clock")] fn clock(&self, time_only: bool) -> glib::GString { @@ -93,8 +89,8 @@ pub trait WallClockExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::date-time\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_date_time_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::date-time".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_date_time_trampoline:: as *const ())), Box_::into_raw(f)) } } @@ -106,8 +102,8 @@ pub trait WallClockExt: IsA + sealed::Sealed + 'static { } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::time\0".as_ptr() as *const _, - Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_time_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw(self.as_ptr() as *mut _, c"notify::time".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_time_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libphosh/src/lib.rs b/libphosh/src/lib.rs index 65a26b43588991865134b8412154e793211d4184..91e3c5b690915c4c29215270d69ec1aa802be51a 100644 --- a/libphosh/src/lib.rs +++ b/libphosh/src/lib.rs @@ -10,6 +10,7 @@ macro_rules! skip_assert_initialized { () => {}; } +pub use ffi; pub use auto::*; #[allow(unused_imports)] mod auto; diff --git a/libphosh/sys/Cargo.toml b/libphosh/sys/Cargo.toml index 3a64f9a423c84ff876b06a2d7899fc58d12d9691..58d9ee7186a40007777d9ef76479983c0470f2cf 100644 --- a/libphosh/sys/Cargo.toml +++ b/libphosh/sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libphosh-sys" -version = "0.0.6" +version = "0.0.7" edition = "2021" build = "build.rs" authors = ["Guido Günther "] @@ -51,7 +51,7 @@ package = "libhandy-sys" version = "0.11" [build-dependencies] -system-deps = "6" +system-deps = "7" [dev-dependencies] shell-words = "1.0.0" diff --git a/libphosh/sys/build.rs b/libphosh/sys/build.rs index 7fa342ad6ef22ed8084d9b220d06166c57d4f781..67349f1506396a0a323d297fd93d73706884ed82 100644 --- a/libphosh/sys/build.rs +++ b/libphosh/sys/build.rs @@ -1,5 +1,5 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) -// from ../.. (@ eb5ea3018a51+) +// Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +// from ../.. (@ b4c1dbc27547+) // from ../../gir-files (@ 6cd7b656acd6) // DO NOT EDIT diff --git a/libphosh/sys/src/lib.rs b/libphosh/sys/src/lib.rs index 51fb029964a6a05cf2f78d1281c517f994dc154b..289a2129cdf3aff99e50cfa76664e04bfae29745 100644 --- a/libphosh/sys/src/lib.rs +++ b/libphosh/sys/src/lib.rs @@ -1,5 +1,5 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) -// from ../.. (@ eb5ea3018a51+) +// Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +// from ../.. (@ b4c1dbc27547+) // from ../../gir-files (@ 6cd7b656acd6) // DO NOT EDIT @@ -17,9 +17,10 @@ use pango_sys as pango; use handy_sys as handy; #[allow(unused_imports)] -use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, - c_short, c_ushort, c_long, c_ulong, - c_void, size_t, ssize_t, time_t, off_t, intptr_t, uintptr_t, FILE}; +use std::ffi::{c_int, c_char, c_uchar, c_float, c_uint, c_double, + c_short, c_ushort, c_long, c_ulong, c_void}; +#[allow(unused_imports)] +use libc::{size_t, ssize_t, time_t, off_t, intptr_t, uintptr_t, FILE}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; @@ -49,6 +50,7 @@ impl ::std::fmt::Debug for PhoshDBusScreenshotProxyClass { } #[repr(C)] +#[allow(dead_code)] pub struct _PhoshDBusScreenshotProxyPrivate { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -71,6 +73,7 @@ impl ::std::fmt::Debug for PhoshDBusScreenshotSkeletonClass { } #[repr(C)] +#[allow(dead_code)] pub struct _PhoshDBusScreenshotSkeletonPrivate { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -374,6 +377,7 @@ impl ::std::fmt::Debug for PhoshLockscreen { } #[repr(C)] +#[allow(dead_code)] pub struct PhoshLockscreenManager { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -401,6 +405,7 @@ impl ::std::fmt::Debug for PhoshQuickSetting { } #[repr(C)] +#[allow(dead_code)] pub struct PhoshScreenshotManager { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -471,7 +476,6 @@ impl ::std::fmt::Debug for PhoshWallClock { // Interfaces -#[link(name = "phosh-0.45")] extern "C" { //========================================================================= @@ -535,12 +539,14 @@ extern "C" { pub fn phosh_quick_setting_get_long_press_action_name(self_: *mut PhoshQuickSetting) -> *const c_char; pub fn phosh_quick_setting_get_long_press_action_target(self_: *mut PhoshQuickSetting) -> *const c_char; pub fn phosh_quick_setting_get_showing_status(self_: *mut PhoshQuickSetting) -> gboolean; + pub fn phosh_quick_setting_get_status_icon(self_: *mut PhoshQuickSetting) -> *mut PhoshStatusIcon; pub fn phosh_quick_setting_get_status_page(self_: *mut PhoshQuickSetting) -> *mut PhoshStatusPage; pub fn phosh_quick_setting_set_active(self_: *mut PhoshQuickSetting, active: gboolean); pub fn phosh_quick_setting_set_can_show_status(self_: *mut PhoshQuickSetting, can_show_status: gboolean); pub fn phosh_quick_setting_set_long_press_action_name(self_: *mut PhoshQuickSetting, action_name: *const c_char); pub fn phosh_quick_setting_set_long_press_action_target(self_: *mut PhoshQuickSetting, action_target: *const c_char); pub fn phosh_quick_setting_set_showing_status(self_: *mut PhoshQuickSetting, showing_status: gboolean); + pub fn phosh_quick_setting_set_status_icon(self_: *mut PhoshQuickSetting, status_icon: *mut PhoshStatusIcon); pub fn phosh_quick_setting_set_status_page(self_: *mut PhoshQuickSetting, status_page: *mut PhoshStatusPage); //========================================================================= @@ -573,21 +579,23 @@ extern "C" { pub fn phosh_status_icon_get_icon_name(self_: *mut PhoshStatusIcon) -> *mut c_char; pub fn phosh_status_icon_get_icon_size(self_: *mut PhoshStatusIcon) -> gtk::GtkIconSize; pub fn phosh_status_icon_get_info(self_: *mut PhoshStatusIcon) -> *mut c_char; - pub fn phosh_status_icon_get_show_always(self_: *mut PhoshStatusIcon) -> gboolean; + pub fn phosh_status_icon_get_pixel_size(self_: *mut PhoshStatusIcon) -> c_uint; pub fn phosh_status_icon_set_extra_widget(self_: *mut PhoshStatusIcon, widget: *mut gtk::GtkWidget); pub fn phosh_status_icon_set_icon_name(self_: *mut PhoshStatusIcon, icon_name: *const c_char); pub fn phosh_status_icon_set_icon_size(self_: *mut PhoshStatusIcon, size: gtk::GtkIconSize); pub fn phosh_status_icon_set_info(self_: *mut PhoshStatusIcon, info: *const c_char); - pub fn phosh_status_icon_set_show_always(self_: *mut PhoshStatusIcon, show_always: gboolean); + pub fn phosh_status_icon_set_pixel_size(self_: *mut PhoshStatusIcon, size: c_uint); //========================================================================= // PhoshStatusPage //========================================================================= pub fn phosh_status_page_get_type() -> GType; pub fn phosh_status_page_new() -> *mut PhoshStatusPage; + pub fn phosh_status_page_get_content(self_: *mut PhoshStatusPage) -> *mut gtk::GtkWidget; pub fn phosh_status_page_get_footer(self_: *mut PhoshStatusPage) -> *mut gtk::GtkWidget; pub fn phosh_status_page_get_header(self_: *mut PhoshStatusPage) -> *mut gtk::GtkWidget; pub fn phosh_status_page_get_title(self_: *mut PhoshStatusPage) -> *const c_char; + pub fn phosh_status_page_set_content(self_: *mut PhoshStatusPage, content: *mut gtk::GtkWidget); pub fn phosh_status_page_set_footer(self_: *mut PhoshStatusPage, footer: *mut gtk::GtkWidget); pub fn phosh_status_page_set_header(self_: *mut PhoshStatusPage, header: *mut gtk::GtkWidget); pub fn phosh_status_page_set_title(self_: *mut PhoshStatusPage, title: *const c_char); diff --git a/libphosh/sys/tests/abi.rs b/libphosh/sys/tests/abi.rs index 278bf3286b96dc75e27c6e4860a71c81628e581e..e133d4f4268333c0af1bd3da06fb8771668c984e 100644 --- a/libphosh/sys/tests/abi.rs +++ b/libphosh/sys/tests/abi.rs @@ -1,5 +1,5 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) -// from ../.. (@ eb5ea3018a51+) +// Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +// from ../.. (@ b4c1dbc27547+) // from ../../gir-files (@ 6cd7b656acd6) // DO NOT EDIT diff --git a/libphosh/sys/tests/constant.c b/libphosh/sys/tests/constant.c index 3b9826bee338452e267264dbbbbdf2563fe9725e..ebce88100367bbf740ebd07ae970572c17d3f1a6 100644 --- a/libphosh/sys/tests/constant.c +++ b/libphosh/sys/tests/constant.c @@ -1,5 +1,5 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) -// from ../.. (@ eb5ea3018a51+) +// Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +// from ../.. (@ b4c1dbc27547+) // from ../../gir-files (@ 6cd7b656acd6) // DO NOT EDIT diff --git a/libphosh/sys/tests/layout.c b/libphosh/sys/tests/layout.c index 790b05ac99c88d90aed9671042e72afaa15ba0fe..3c33ac751a12ec8dbf509fcbe75033b8bf7b3055 100644 --- a/libphosh/sys/tests/layout.c +++ b/libphosh/sys/tests/layout.c @@ -1,5 +1,5 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) -// from ../.. (@ eb5ea3018a51+) +// Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +// from ../.. (@ b4c1dbc27547+) // from ../../gir-files (@ 6cd7b656acd6) // DO NOT EDIT diff --git a/subprojects/phosh.wrap b/subprojects/phosh.wrap index 722c54ef7c61c77f259da30516d6cbfe41eaede5..8f2a35d02b90a7e428c44d175dc3966af5b0e542 100644 --- a/subprojects/phosh.wrap +++ b/subprojects/phosh.wrap @@ -1,5 +1,5 @@ [wrap-git] directory=phosh url=https://gitlab.gnome.org/World/Phosh/phosh.git -revision=main +revision=v0.49.0 depth=1