| 1 |
/* |
| 2 |
* ConnMan GTK GUI |
| 3 |
* |
| 4 |
* Copyright (C) 2015 Intel Corporation. All rights reserved. |
| 5 |
* Author: Jaakko Hannikainen <[email protected]> |
| 6 |
* |
| 7 |
* This program is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation, either version 2 of the License, or |
| 10 |
* (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef _CONNMAN_GTK_UTIL_H |
| 22 |
#define _CONNMAN_GTK_UTIL_H |
| 23 |
|
| 24 |
#include <glib.h> |
| 25 |
#include <gtk/gtk.h> |
| 26 |
#include "config.h" |
| 27 |
|
| 28 |
gchar *variant_str_array_to_str(GVariant *variant); |
| 29 |
gchar **variant_to_strv(GVariant *variant); |
| 30 |
gchar *variant_to_str(GVariant *variant); |
| 31 |
gboolean variant_to_bool(GVariant *variant); |
| 32 |
guint64 variant_to_uint(GVariant *variant); |
| 33 |
gint64 variant_to_int(GVariant *variant); |
| 34 |
const gchar *status_localized(const gchar *status); |
| 35 |
const gchar *failure_localized(const gchar *status); |
| 36 |
gboolean valid_ipv4(const gchar *address); |
| 37 |
gboolean valid_ipv6(const gchar *address); |
| 38 |
void list_item_selected(GtkListBox *box, GtkListBoxRow *row, gpointer data); |
| 39 |
void combo_box_changed(GtkComboBox *widget, gpointer data); |
| 40 |
|
| 41 |
typedef struct DualHashTable_t DualHashTable; |
| 42 |
typedef void(*DualHashTableIter)(const gchar *key, const gchar *subkey, |
| 43 |
gpointer value, gpointer user_data); |
| 44 |
DualHashTable *dual_hash_table_new(GDestroyNotify free_value); |
| 45 |
DualHashTable *dual_hash_table_ref(DualHashTable *table); |
| 46 |
void dual_hash_table_unref(DualHashTable *table); |
| 47 |
void *hash_table_get_dual_key(DualHashTable *table, const gchar *key, |
| 48 |
const gchar *subkey); |
| 49 |
void hash_table_set_dual_key(DualHashTable *table, const gchar *key, |
| 50 |
const gchar *subkey, void *value); |
| 51 |
void dual_hash_table_foreach(DualHashTable *table, DualHashTableIter cb, |
| 52 |
gpointer user_data); |
| 53 |
GVariant *dual_hash_table_to_variant(DualHashTable *table); |
| 54 |
|
| 55 |
gboolean handle_keyboard_shortcut(GtkWidget *widget, GdkEventKey *event, gpointer data); |
| 56 |
|
| 57 |
#endif /* _CONNMAN_GTK_UTIL_H */ |