Commit Graph

15 Commits

Author SHA1 Message Date
Maxim Ermilov
3d60245b18 Add sections to the all apps view
Separate out the main app view into different sections based on the categories
in the desktop file. The configuration is done via gmenu and the desktop menu
specification, we set XDG_MENU_PREFIX="gs-" on startup, so that gmenu reads
gs-applications.menu, which we install.

There is no support for "submenus" - only the menus directly under
Applications will be displayed as categories.
https://bugzilla.gnome.org/show_bug.cgi?id=614131
2010-06-06 02:53:27 +04:00
Colin Walters
fe52a9e1a1 Add shell_app_system_get_app_for_path
Allows looking up an app given an absolute path to its
desktop file; will be used for startup-notification.

https://bugzilla.gnome.org/show_bug.cgi?id=612833
2010-03-30 17:36:04 -04:00
Colin Walters
3aea09b614 Fix app icon fading
The way we were loading data into a CoglTexture, then pulling it out
and manipulating it on the CPU, then loading it back into a texture
was a bit lame.

Clean things up a bit here by loading directly into the CPU, doing
the fading, then creating a texture.

Also cache the faded data in StTextureCache.

https://bugzilla.gnome.org/show_bug.cgi?id=612759
2010-03-13 12:50:38 -05:00
Maxim Ermilov
c793d7d0a4 get_app_for_window_direct search ShellApp by window, before create.
https://bugzilla.gnome.org/show_bug.cgi?id=610324
2010-02-21 03:19:24 +03:00
Colin Walters
b7646d18ae Add search.js, rebase search system on top
The high level goal is to separate the concern of searching for
things with display of those things; for example in newer mockups,
applications are displayed exactly the same as they look in the
AppWell.

Another goal was optimizing for speed; for example,
application search was pushed mostly down into C, and we avoid
lowercasing and normalizing every item over and over.

https://bugzilla.gnome.org/show_bug.cgi?id=603523
2009-12-18 10:07:22 -05:00
Dan Winship
6d9aadfa4d Add emacs modelines to all .c and .h files that were missing them 2009-10-27 11:27:45 -04:00
Colin Walters
e941e8088b Split ShellAppMonitor into ShellWindowTracker, ShellAppUsage
The two parts were mapping windows to applications, and
recording application usage statistics.  The latter part
(now called ShellAppUsage) is much more naturally built on top of
the former (now called ShellWindowTracker).

ShellWindowTracker retains the startup-notification handling.

ShellWindowTracker also gains a focus-app property, which is
what most things in the shell UI are interested in (instead of
window focus).

ShellAppSystem moves to exporting ShellApp from more of its
public API, rather than ShellAppInfo.  ShellAppSystem also
ensures that ShellApp instances are unique by holding
a hash on the ids.

ShellApp's private API is split off into a shell-app-private.h,
so shell-app.h can be included in shell-app-system.h.

Favorites handling is removed from ShellAppSystem, now inside
appFavorites.js.

Port all of the JavaScript for these changes.

https://bugzilla.gnome.org/show_bug.cgi?id=598646
2009-10-20 12:55:07 -04:00
Colin Walters
d94606587b Add shell_app_system_create_from_window
For various cases such as when we don't know a .desktop file
for a window, it's desirable to "fake" an application from
the contents of a MetaWindow*.
2009-08-18 23:00:47 -04:00
Colin Walters
9bd22dc033 ShellAppSystem: Support loading a .desktop file directly
Previously, ShellAppSystem only loaded (and cached) the set of
.desktop files from applications.menu and settings.menu, using
the gnome-menus library.  The ShellAppInfo structure was
a "hidden typedef" for GMenuTreeEntry.

But we need to support loading an arbitrary .desktop file.  Thus,
refactor the ShellAppInfo into a real struct, with a refcount,
and allow it to point to either a GMenuTreeEntry or a GKeyFile.

Also, in the case where we fail to lookup an icon for an
application, ensure we return a 0 opacity texture.
2009-08-09 09:53:06 -04:00
Siegfried-Angel Gevatter Pujals
93ea4b07c1 Add appInfo.get_desktop_file_path method
Add shell_app_info_get_desktop_file_path, matching *_get_executable,
*_get_id, etc. This is useful for Zeitgeist.
2009-07-29 23:40:23 +02:00
Colin Walters
cc2d3fd56d Major rework of application data structures and caching
Before, we looked up application data in several ways; the ShellAppSystem
exported just application ids (though it parsed the .desktop files internally),
and we'd create a Gio.DesktopAppInfo object (reparsing the desktop file again),
wrapping that inside a JavaScript AppInfo class, and finally the AppDisplay
would again parse the .desktop file to get the categories.

Also, to look up applications by id previously, we traversed the entire
menu structure each time.

Some qualities such as the NoDisplay flag were not easily exposed in the old
system.  And if we wanted to expose them we'd have to change several different
application information wrapper classes.

All in all, it was quite suboptimal.

The theme of this new code is basically "just use libgnome-menus".  We do
not call into Gio for app lookups anymore.  The new Shell.AppInfo class
is a disguised pointer for the GMenuTreeEntry item.

To fix the caching, we keep a simple hash table of desktop id -> ShellAppInfo.
2009-07-08 11:33:47 -04:00
Colin Walters
88c9a23866 ShellAppSystem: Add favorites API and shell_app_system_lookup_basename
Add a GConf key for favorites, and API for retrieving them.

Also add shell_app_system_lookup_basename, which we use from
the app monitor to look up WM_CLASS ids.
2009-06-30 16:35:16 -04:00
Colin Walters
e7771b4eb0 Make ShellAppMonitor and ShellAppSystem singletons, remove unused code in appDisplay
We shouldn't create multiple instances of either.  Also remove a bit
of unused code in appDisplay.
2009-06-18 12:27:19 -04:00
Colin Walters
5416f53351 Bug 581944 - Fully rebase on ShellAppSystem, don't use Gio to load apps
To avoid loading applications from two different systems, use
ShellAppSystem solely.  This unifies the initial load and the
reload.

Extend ShellAppSystem to also load settings/preferences, and
ensure they appear in the search.
2009-05-26 10:52:56 -04:00
Colin Walters
b632801c7c Rename ShellAppMonitor to ShellAppSystem
This makes it clearer that really we're now an API, not just a
monitor.
2009-04-22 15:34:14 -04:00