From fe16da8cedec9e6895851c4a82d3d7933600e55b Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 19 Mar 2025 18:12:36 -0300 Subject: [PATCH] utils: Add util function for selection widgetry Will be used by the week grid --- src/utils/gcal-gui-utils.c | 32 ++++++++++++++++++++++++++++++++ src/utils/gcal-gui-utils.h | 30 ++++++++++++++++++++++++++++++ src/utils/meson.build | 1 + 3 files changed, 63 insertions(+) create mode 100644 src/utils/gcal-gui-utils.c create mode 100644 src/utils/gcal-gui-utils.h diff --git a/src/utils/gcal-gui-utils.c b/src/utils/gcal-gui-utils.c new file mode 100644 index 00000000..2941582b --- /dev/null +++ b/src/utils/gcal-gui-utils.c @@ -0,0 +1,32 @@ +/* + * gcal-gui-utils.c + * + * Copyright 2025 Georges Basile Stavracas Neto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include "gcal-gui-utils.h" + +#include + +GtkWidget* +gcal_create_selection_widget (void) +{ + return g_object_new (ADW_TYPE_BIN, + "css-name", "selection", + NULL); +} diff --git a/src/utils/gcal-gui-utils.h b/src/utils/gcal-gui-utils.h new file mode 100644 index 00000000..06a7c11f --- /dev/null +++ b/src/utils/gcal-gui-utils.h @@ -0,0 +1,30 @@ +/* + * gcal-gui-utils.h + * + * Copyright 2025 Georges Basile Stavracas Neto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#pragma once + +#include + +G_BEGIN_DECLS + +GtkWidget* gcal_create_selection_widget (void); + +G_END_DECLS diff --git a/src/utils/meson.build b/src/utils/meson.build index 45be896c..319719dd 100644 --- a/src/utils/meson.build +++ b/src/utils/meson.build @@ -2,6 +2,7 @@ calendar_incs += include_directories('.') sources += files( 'gcal-date-time-utils.c', + 'gcal-gui-utils.c', 'gcal-source-discoverer.c', 'gcal-utils.c', )