From a00b7ff9298a450ee108aeaf86ad2669470461f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 12:14:39 +0200 Subject: [PATCH 01/11] gitignore: Add phosh's submodules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They're pulled in when building phosh as subproject to get libphosh Signed-off-by: Guido Günther Part-of: --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9255985..64d653c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ libphosh/sys/target target/ +subprojects/gvc/ +subprojects/libcall-ui/ subprojects/phosh/ -- GitLab From 954def0476a3d7f4f6174d121a0840d859f7d48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 09:58:26 +0200 Subject: [PATCH 02/11] Update phosh gir from 0.49 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have some new symbols Signed-off-by: Guido Günther Part-of: --- Phosh-0.gir | 534 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 344 insertions(+), 190 deletions(-) diff --git a/Phosh-0.gir b/Phosh-0.gir index ca96dfb..23ab206 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. - + -- GitLab From 466afff4d8158c17557c96dece3f99582d5f7fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 10:43:10 +0200 Subject: [PATCH 03/11] phosh: Use 0.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guido Günther Part-of: --- subprojects/phosh.wrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/phosh.wrap b/subprojects/phosh.wrap index 722c54e..8f2a35d 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 -- GitLab From 1edab0144724b66ec80b6f57b6ad4dff864f988f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 10:42:18 +0200 Subject: [PATCH 04/11] ci: Use forky MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want newer rust crates Signed-off-by: Guido Günther Part-of: --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d15b80..d638372 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 -- GitLab From 0c20821804c29cdb8abe32aac445dbc694e9196e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 10:31:38 +0200 Subject: [PATCH 05/11] treewide: Update URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guido Günther Part-of: --- README.md | 2 +- libphosh/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23348c1..e835131 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/libphosh/Cargo.toml b/libphosh/Cargo.toml index e7e7992..de96bad 100644 --- a/libphosh/Cargo.toml +++ b/libphosh/Cargo.toml @@ -4,10 +4,10 @@ version = "0.0.6" 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"] -- GitLab From 656188df9f9a46a1d201af9532e44d4631f046d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 10:04:49 +0200 Subject: [PATCH 06/11] gir: Update to current main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch to be9aa145 ("Merge pull request #1675 from jbicha/rustdoc-stripper-release") Signed-off-by: Guido Günther Part-of: --- gir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir b/gir index 5223ce9..be9aa14 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 5223ce91b97a833b09d6cbd04bbeab1bf18112b7 +Subproject commit be9aa145267cb915b3c79c4ae6d896beecc061ee -- GitLab From 2d140c000122e990eabd56fb71cf390d0bb28e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 10:14:48 +0200 Subject: [PATCH 07/11] fix: Fix comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gbp-Dch: Ignore Signed-off-by: Guido Günther Part-of: --- fix.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fix.sh b/fix.sh index 0fb960e..6a72c74 100755 --- a/fix.sh +++ b/fix.sh @@ -11,8 +11,8 @@ 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 xmlstarlet ed -L \ -d '///_:include[@name="Gcr"]' \ - -d '///_:include[@name="GnomeBluetooth"]' \ + -d '///_:include[@name="GnomeBluetooth"]' \ Phosh-0.gir -- GitLab From c0a63b63a80b845a22908a91ab0aefdf665f59d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 10:19:34 +0200 Subject: [PATCH 08/11] fix: Drop doc:format generated by newer gir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/gtk-rs/gir/issues/1642 Signed-off-by: Guido Günther Part-of: --- fix.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fix.sh b/fix.sh index 6a72c74..35636e7 100755 --- a/fix.sh +++ b/fix.sh @@ -12,7 +12,9 @@ xmlstarlet ed -L \ NM-1.0.gir # 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 '///doc:format[@name="unknown"]' \ Phosh-0.gir -- GitLab From d2559c59525a640395df2c56bf27e3ac08edf15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 12:12:09 +0200 Subject: [PATCH 09/11] libphosh: Use ffi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we fail like ``` warning: `libphosh-sys` (lib) generated 3 warnings (run `cargo fix --lib -p libphosh-sys` to apply 3 suggestions) error[E0432]: unresolved import `crate::ffi` --> libphosh/src/auto/lockscreen.rs:6:13 | 6 | use crate::{ffi,LockscreenPage}; | ^^^ no `ffi` in the root | = help: consider importing one of these items instead: std::ffi std::os::unix::ffi core::ffi gdk::ffi gio::ffi glib::ffi gtk::ffi ``` Signed-off-by: Guido Günther Part-of: --- libphosh/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/libphosh/src/lib.rs b/libphosh/src/lib.rs index 65a26b4..91e3c5b 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; -- GitLab From d31e460744109589fcaca3c228359dc826d069c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 8 Feb 2025 19:16:26 +0100 Subject: [PATCH 10/11] treewide: Bump version to 0.0.7 Part-of: --- libphosh/Cargo.toml | 4 ++-- libphosh/sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libphosh/Cargo.toml b/libphosh/Cargo.toml index de96bad..0f412d4 100644 --- a/libphosh/Cargo.toml +++ b/libphosh/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libphosh" -version = "0.0.6" +version = "0.0.7" authors = ["Guido Günther "] edition = "2021" readme = "../README.md" @@ -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/sys/Cargo.toml b/libphosh/sys/Cargo.toml index 3a64f9a..817b86e 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 "] -- GitLab From 278d8a72b8b95c116cee246118fb13feaf8586d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Sep 2025 10:26:03 +0200 Subject: [PATCH 11/11] libphosh: Update generated code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guido Günther Part-of: --- Cargo.lock | 63 +++++++++++----- libphosh/src/auto/enums.rs | 1 + libphosh/src/auto/lockscreen.rs | 28 +++---- libphosh/src/auto/lockscreen_manager.rs | 15 ++-- libphosh/src/auto/quick_setting.rs | 98 ++++++++++++++++++------- libphosh/src/auto/screenshot_manager.rs | 1 + libphosh/src/auto/shell.rs | 29 ++++---- libphosh/src/auto/status_icon.rs | 84 +++++++++++++-------- libphosh/src/auto/status_page.rs | 61 +++++++++++---- libphosh/src/auto/versions.txt | 4 +- libphosh/src/auto/wall_clock.rs | 16 ++-- libphosh/sys/Cargo.toml | 2 +- libphosh/sys/build.rs | 4 +- libphosh/sys/src/lib.rs | 24 ++++-- libphosh/sys/tests/abi.rs | 4 +- libphosh/sys/tests/constant.c | 4 +- libphosh/sys/tests/layout.c | 4 +- 17 files changed, 284 insertions(+), 158 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1848ca7..4f3d824 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/libphosh/src/auto/enums.rs b/libphosh/src/auto/enums.rs index 948af5b..50376d3 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 1e9ac06..cb82e88 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 592839d..1140bbb 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 228ad02..db28d08 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 cd436e7..1820e9a 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 9b33009..fed862c 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 0a804c2..840210f 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 a804ebf..593f9d6 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 4390cb6..5d930ce 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 ef80659..e88cce9 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/sys/Cargo.toml b/libphosh/sys/Cargo.toml index 817b86e..58d9ee7 100644 --- a/libphosh/sys/Cargo.toml +++ b/libphosh/sys/Cargo.toml @@ -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 7fa342a..67349f1 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 51fb029..289a212 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 278bf32..e133d4f 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 3b9826b..ebce881 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 790b05a..3c33ac7 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 -- GitLab