ui_filters.h 2.75 KB
Newer Older
1
2
3
4
5
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
Cedric Roux's avatar
Cedric Roux committed
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

winckel's avatar
winckel committed
22
23
24
25
26
27
28
#ifndef UI_FILTERS_H_
#define UI_FILTERS_H_

#include <stdint.h>

#include "itti_types.h"

winckel's avatar
winckel committed
29
30
#define SIGNAL_NAME_LENGTH  100
#define COLOR_SIZE          10
31

winckel's avatar
winckel committed
32
33
typedef enum
{
winckel's avatar
winckel committed
34
    FILTER_UNKNOWN, FILTER_MESSAGES, FILTER_ORIGIN_TASKS, FILTER_DESTINATION_TASKS, FILTER_INSTANCES,
winckel's avatar
winckel committed
35
36
} ui_filter_e;

winckel's avatar
winckel committed
37
38
39
40
41
typedef enum
{
    ENTRY_ENABLED_FALSE, ENTRY_ENABLED_TRUE, ENTRY_ENABLED_UNDEFINED,
} ui_entry_enabled_e;

winckel's avatar
winckel committed
42
43
44
45
46
typedef struct
{
    uint32_t id;
    char name[SIGNAL_NAME_LENGTH];
    uint8_t enabled;
47
48
    char foreground[COLOR_SIZE];
    char background[COLOR_SIZE];
49
    GtkWidget *menu_item;
winckel's avatar
winckel committed
50
51
52
53
} ui_filter_item_t;

typedef struct
{
winckel's avatar
winckel committed
54
    char *name;
winckel's avatar
winckel committed
55
56
57
58
59
60
61
    uint32_t allocated;
    uint32_t used;
    ui_filter_item_t *items;
} ui_filter_t;

typedef struct
{
62
    gboolean filters_enabled;
winckel's avatar
winckel committed
63
64
65
    ui_filter_t messages;
    ui_filter_t origin_tasks;
    ui_filter_t destination_tasks;
winckel's avatar
winckel committed
66
    ui_filter_t instances;
winckel's avatar
winckel committed
67
68
69
70
71
72
} ui_filters_t;

extern ui_filters_t ui_filters;

int ui_init_filters(int reset, int clear_ids);

73
74
gboolean ui_filters_enable(gboolean enabled);

75
76
int ui_filters_search_id(ui_filter_t *filter, uint32_t value);

77
void ui_filters_add(ui_filter_e filter, uint32_t value, const char *name, ui_entry_enabled_e entry_enabled,
78
                    const char *foreground, const char *background);
winckel's avatar
winckel committed
79

80
81
gboolean ui_filters_message_enabled(const uint32_t message, const uint32_t origin_task, const uint32_t destination_task,
                                    const uint32_t instance);
winckel's avatar
winckel committed
82

winckel's avatar
winckel committed
83
int ui_filters_read(const char *file_name);
84

winckel's avatar
winckel committed
85
int ui_filters_file_write(const char *file_name);
winckel's avatar
winckel committed
86

87
void ui_create_filter_menus(void);
88

89
90
void ui_destroy_filter_menus(void);

winckel's avatar
winckel committed
91
92
void ui_destroy_filter_menu(ui_filter_e filter);

93
94
void ui_show_filter_menu(GtkWidget **menu, ui_filter_t *filter);

winckel's avatar
winckel committed
95
#endif /* UI_FILTERS_H_ */