Skip to content

Commit

Permalink
core: Make CogPlatform.get_view_type static
Browse files Browse the repository at this point in the history
Remove the CogPlatform parameter to the .get_view_type vfunc, making it
a static method. This allows directly using a cog_<xyz>_view_get_type
function.
  • Loading branch information
aperezdc authored and psaavedra committed Oct 25, 2023
1 parent 7158e8e commit bcd1a40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/cog-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct _CogPlatformClass {
void (*init_web_view)(CogPlatform *, WebKitWebView *);
WebKitInputMethodContext *(*create_im_context)(CogPlatform *);

GType (*get_view_type)(CogPlatform *self);
GType (*get_view_type)(void);
};

void cog_platform_set_default(CogPlatform *);
Expand Down
4 changes: 2 additions & 2 deletions core/cog-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* [struct@WPEWebKit.WebViewBackend] to the current [class@CogPlatform]
* implementation. Optionally, platform plug-in implementations can
* provide their own view class implementation by overriding
* [vfunc@CogPlatform.get_view_type].
* the [func@CogPlatform.get_view_type] method.
*
* A number of utility functions are also provided.
*/
Expand Down Expand Up @@ -150,7 +150,7 @@ _cog_view_get_impl_type_init(GType *type)
if (platform) {
CogPlatformClass *platform_class = COG_PLATFORM_GET_CLASS(platform);
if (platform_class->get_view_type) {
GType view_type = (*platform_class->get_view_type)(platform);
GType view_type = (*platform_class->get_view_type)();
*type = view_type;
}
}
Expand Down

0 comments on commit bcd1a40

Please sign in to comment.