File: app-shell.h

package info (click to toggle)
slab 0.0.cvs.20061028-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,724 kB
  • ctags: 1,564
  • sloc: ansic: 13,346; sh: 8,876; makefile: 253; xml: 8
file content (133 lines) | stat: -rw-r--r-- 3,845 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 * This file is part of libslab.
 *
 * Copyright (c) 2006 Novell, Inc.
 *
 * Libslab is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * Libslab 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 Lesser General Public License for
 * more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with libslab; if not, write to the Free Software Foundation, Inc., 51
 * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __APP_SHELL_H__
#define __APP_SHELL_H__

#include <glib.h>
#include <gtk/gtk.h>
#include <gtk/gtkeventbox.h>
#define GMENU_I_KNOW_THIS_IS_UNSTABLE
#include <gmenu-tree.h>

#include "slab-section.h"
#include "tile.h"

G_BEGIN_DECLS
#define CATEGORY_SPACING 0
#define GROUP_POSITION_NUMBER_KEY "Unique Group Position Number"
#define APP_ACTION_KEY  "Unique Application Action Key"
/* constants for initial sizing */
#define SIZING_SCREEN_WIDTH_LARGE  1024
#define SIZING_SCREEN_WIDTH_MEDIUM 800
#define SIZING_SCREEN_WIDTH_SMALL  640
#define SIZING_SCREEN_WIDTH_LARGE_NUMCOLS  3
#define SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS 2
#define SIZING_SCREEN_WIDTH_SMALL_NUMCOLS  1
#define SIZING_TILE_WIDTH 230
#define SIZING_HEIGHT_PERCENT 0.8
	typedef struct {
	const gchar *name;
	gint max_items;
	GArray *garray;
} NewAppConfig;

typedef struct _AppShellData {
	GtkWidget *main_gnome_app;
	gint main_gnome_app_window_x;
	gint main_gnome_app_window_y;
	gboolean main_gnome_app_window_shown_once;

	GtkWidget *shell;
	GtkWidget *groups_section;

	GtkWidget *actions_section;
	/* NULL - if the available actions depend on the current tile
	   selected NON-NULL - a list of AppAction that are always shown */
	GSList *static_actions;

	GtkWidget *filter_section;
	gchar *filter_string;
	GdkCursor *busy_cursor;

	GtkWidget *category_layout;
	GList *categories_list;
	GList *cached_tables_list;	/* list of currently showing (not
					   filtered out) tables */
	Tile *last_clicked_launcher;
	SlabSection *selected_group;
	GtkIconSize icon_size;
	const gchar *gconf_prefix;
	const gchar *menu_name;
	NewAppConfig *new_apps;
	GMenuTree *tree;
	GHashTable *hash;

	guint filter_changed_timeout;
	gboolean stop_incremental_relayout;
	GList *incremental_relayout_cat_list;
	gboolean filtered_out_everything;
	GtkWidget *filtered_out_everything_widget;
	GtkLabel *filtered_out_everything_widget_label;
} AppShellData;

typedef struct {
	gchar *category;
	Tile *group_launcher;

	SlabSection *section;
	GList *launcher_list;
	GList *filtered_launcher_list;
} CategoryData;

typedef struct {
	const gchar *name;
	GnomeDesktopItem *item;
} AppAction;

typedef struct {
	long time;
	GnomeDesktopItem *item;
} NewAppData;

void generate_categories (AppShellData * app_data);

/* If new_apps is NULL then the new applications category is not created */
AppShellData *appshelldata_new (const gchar * menu_name,
				NewAppConfig * new_apps,
				const gchar * gconf_keys_prefix,
				GtkIconSize icon_size);

void layout_shell (AppShellData * app_data, const gchar * filter_title,
		   const gchar * groups_title, const gchar * actions_title,
		   GSList * actions, void (*actions_handler) (Tile *,
							      TileEvent *,
							      gpointer));

gboolean create_main_window (AppShellData * app_data, const gchar * app_name,
			     const gchar * title, const gchar * window_icon,
			     gint width, gint height, gboolean hidden);

void hide_shell (AppShellData * app_data);

void show_shell (AppShellData * app_data);

G_END_DECLS
#endif /* __APP_SHELL_H__ */