File: ol_app_chooser_widget.h

package info (click to toggle)
osdlyrics 0.5.5~rc2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,608 kB
  • sloc: ansic: 19,115; python: 4,837; sh: 563; makefile: 354; sed: 16
file content (78 lines) | stat: -rw-r--r-- 2,789 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* -*- mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
/*
 * Copyright (C) 2011  Tiger Soldier
 *
 * This file is part of OSD Lyrics.
 * 
 * OSD Lyrics 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.
 *
 * OSD Lyrics 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 OSD Lyrics.  If not, see <https://www.gnu.org/licenses/>. 
 */

#ifndef _OL_APP_CHOOSER_WIDGET_H_
#define _OL_APP_CHOOSER_WIDGET_H_

#include <gtk/gtk.h>

#define OL_TYPE_APP_CHOOSER_WIDGET                                      \
  ol_app_chooser_widget_get_type ()
#define OL_APP_CHOOSER_WIDGET(obj)                                      \
  GTK_CHECK_CAST (obj, OL_TYPE_APP_CHOOSER_WIDGET, OlAppChooserWidget)
#define OL_APP_CHOOSER_WIDGET_CLASS(klass)                              \
  GTK_CHECK_CLASS_CAST (klass, OL_TYPE_APP_CHOOSER_WIDGET, OlAppChooserWidgetClass)
#define OL_IS_APP_CHOOSER_WIDGET(obj)               \
  GTK_CHECK_TYPE (obj, OL_TYPE_APP_CHOOSER_WIDGET)
#define OL_APP_CHOOSER_WIDGET_GET_CLASS(obj)                            \
  (G_TYPE_INSTANCE_GET_CLASS ((obj),                                    \
                              OL_TYPE_APP_CHOOSER_WIDGET,               \
                              OlAppChooserWidgetClass))

typedef struct _OlAppChooserWidget OlAppChooserWidget;
typedef struct _OlAppChooserWidgetClass OlAppChooserWidgetClass;

struct _OlAppChooserWidget
{
  GtkTable parent;
};

struct _OlAppChooserWidgetClass
{
  GtkTableClass parent_class;
};

GType ol_app_chooser_widget_get_type (void);

GtkWidget *ol_app_chooser_widget_new (void);

/** 
 * Sets the app infos to the app chooser.
 * 
 * @param chooser 
 * @param app_list A GList of GAppInfo*.
 * @param n_columns The number of columns to show the apps. If it is set to 0, the
 *                  number of columns will be calculated according to the number
 *                  of apps.
 */
void ol_app_chooser_widget_set_app_list (OlAppChooserWidget *chooser,
                                         GList *app_list,
                                         guint n_columns);

/** 
 * Gets the number of columns of displayed apps.
 *
 * The number is guaranteed to be non-zero after setting the app_list.
 * @param chooser 
 * 
 * @return 
 */
guint ol_app_chooser_widget_get_columns (OlAppChooserWidget *chooser);
#endif /* _OL_APP_CHOOSER_WIDGET_H_ */