~ubuntu-branches/debian/jessie/mate-control-center/jessie

« back to all changes in this revision

Viewing changes to libslab/app-shell.h

  • Committer: Package Import Robot
  • Author(s): Mike Gabriel
  • Date: 2014-05-02 23:20:06 UTC
  • Revision ID: package-import@ubuntu.com-20140502232006-9626h14ggaz2hc9h
Tags: upstream-1.8.1+dfsg1
ImportĀ upstreamĀ versionĀ 1.8.1+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of libslab.
 
3
 *
 
4
 * Copyright (c) 2006 Novell, Inc.
 
5
 *
 
6
 * Libslab is free software; you can redistribute it and/or modify it under the
 
7
 * terms of the GNU Lesser General Public License as published by the Free
 
8
 * Software Foundation; either version 2 of the License, or (at your option)
 
9
 * any later version.
 
10
 *
 
11
 * Libslab is distributed in the hope that it will be useful, but WITHOUT ANY
 
12
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
13
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
 
14
 * more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public License
 
17
 * along with libslab; if not, write to the Free Software Foundation, Inc., 51
 
18
 * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
 
20
 
 
21
#ifndef __APP_SHELL_H__
 
22
#define __APP_SHELL_H__
 
23
 
 
24
#include <glib.h>
 
25
#include <gtk/gtk.h>
 
26
#include <gio/gio.h>
 
27
#define MATEMENU_I_KNOW_THIS_IS_UNSTABLE
 
28
#include <matemenu-tree.h>
 
29
#include <libmate-desktop/mate-desktop-item.h>
 
30
 
 
31
#include <libslab/slab-section.h>
 
32
#include <libslab/tile.h>
 
33
 
 
34
#ifdef __cplusplus
 
35
extern "C" {
 
36
#endif
 
37
 
 
38
#define CATEGORY_SPACING 0
 
39
#define GROUP_POSITION_NUMBER_KEY "Unique Group Position Number"
 
40
#define APP_ACTION_KEY  "Unique Application Action Key"
 
41
 
 
42
/* constants for initial sizing */
 
43
#define SIZING_SCREEN_WIDTH_LARGE  1024
 
44
#define SIZING_SCREEN_WIDTH_MEDIUM 800
 
45
#define SIZING_SCREEN_WIDTH_SMALL  640
 
46
#define SIZING_SCREEN_WIDTH_LARGE_NUMCOLS  3
 
47
#define SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS 2
 
48
#define SIZING_SCREEN_WIDTH_SMALL_NUMCOLS  1
 
49
#define SIZING_TILE_WIDTH 230
 
50
#define SIZING_HEIGHT_PERCENT 0.8
 
51
 
 
52
typedef struct
 
53
{
 
54
        const gchar *name;
 
55
        gint max_items;
 
56
        GArray *garray;
 
57
} NewAppConfig;
 
58
 
 
59
typedef struct _AppShellData
 
60
{
 
61
        GtkWidget *main_app;
 
62
        gint main_app_window_x;
 
63
        gint main_app_window_y;
 
64
        gboolean main_app_window_shown_once;
 
65
 
 
66
        GtkWidget *shell;
 
67
        GtkWidget *groups_section;
 
68
 
 
69
        GtkWidget *actions_section;
 
70
        /*
 
71
                NULL      - if the available actions depend on the current tile selected
 
72
                NON-NULL  - a list of AppAction that are always shown
 
73
        */
 
74
        GSList *static_actions;
 
75
 
 
76
        GtkWidget *filter_section;
 
77
        gchar *filter_string;
 
78
        GdkCursor *busy_cursor;
 
79
 
 
80
        GtkWidget *category_layout;
 
81
        GList *categories_list;
 
82
        GList *cached_tables_list;      /* list of currently showing (not filtered out) tables */
 
83
        Tile *last_clicked_launcher;
 
84
        SlabSection *selected_group;
 
85
        GtkIconSize icon_size;
 
86
        const gchar *menu_name;
 
87
        NewAppConfig *new_apps;
 
88
        MateMenuTree *tree;
 
89
        GHashTable *hash;
 
90
 
 
91
        guint filter_changed_timeout;
 
92
        gboolean stop_incremental_relayout;
 
93
        GList *incremental_relayout_cat_list;
 
94
        gboolean filtered_out_everything;
 
95
        GtkWidget *filtered_out_everything_widget;
 
96
        GtkLabel *filtered_out_everything_widget_label;
 
97
 
 
98
        gboolean show_tile_generic_name;
 
99
        gboolean exit_on_close;
 
100
 
 
101
        GSettings *settings;
 
102
} AppShellData;
 
103
 
 
104
typedef struct
 
105
{
 
106
        gchar *category;
 
107
        Tile *group_launcher;
 
108
 
 
109
        SlabSection *section;
 
110
        GList *launcher_list;
 
111
        GList *filtered_launcher_list;
 
112
} CategoryData;
 
113
 
 
114
typedef struct
 
115
{
 
116
        const gchar *name;
 
117
        MateDesktopItem *item;
 
118
} AppAction;
 
119
 
 
120
typedef struct
 
121
{
 
122
        long time;
 
123
        MateDesktopItem *item;
 
124
} NewAppData;
 
125
 
 
126
void generate_categories (AppShellData * app_data);
 
127
 
 
128
/* If new_apps_max_items is 0 then the new applications category is not created */
 
129
AppShellData *appshelldata_new (const gchar * menu_name,
 
130
        GtkIconSize icon_size, gboolean show_tile_generic_name, gboolean exit_on_close, gint new_apps_max_items);
 
131
 
 
132
void layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar * groups_title,
 
133
        const gchar * actions_title, GSList * actions,
 
134
        void (*actions_handler) (Tile *, TileEvent *, gpointer));
 
135
 
 
136
gboolean create_main_window (AppShellData * app_data, const gchar * app_name, const gchar * title,
 
137
        const gchar * window_icon, gint width, gint height, gboolean hidden);
 
138
 
 
139
void hide_shell (AppShellData * app_data);
 
140
 
 
141
void show_shell (AppShellData * app_data);
 
142
 
 
143
#ifdef __cplusplus
 
144
}
 
145
#endif
 
146
#endif /* __APP_SHELL_H__ */