Commit Graph

539 Commits

Author SHA1 Message Date
Adel Gadllah
730e8ffdf9 Add get_horizontal/vertical_padding() methods
Add get_horizontal_padding() and get_vertical_padding() methods,
that return the total padding (LEFT+RIGHT or TOP+BOTTOM).

https://bugzilla.gnome.org/show_bug.cgi?id=597983
2010-03-11 18:04:37 +01:00
Dan Winship
d128cc5af3 st_widget_get_theme_node: g_error if called on an unparented widget
It's wrong to do anything that requires looking up a widget's style
before you add the widget to the stage, since its final style may
depend on properties inherited from its parents.
st_widget_get_theme_node() used to emit a warning in this case, but
many would-be contributors apparently didn't notice. Help them out.

https://bugzilla.gnome.org/show_bug.cgi?id=610279
2010-03-10 09:29:48 -05:00
Colin Walters
e752193a54 [StTextureCache] The requested size needs to be part of the cache key
Otherwise we'll only render it once, which is clearly wrong.
2010-03-09 14:08:22 -05:00
Colin Walters
3333f30c42 Convert border_width, border_radius to integers
This saves the consumers from having to deal with rounding.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 16:46:47 -05:00
Colin Walters
a4481b38d2 Remove st_widget accessors for background and border actors
StButton animated the background for button transitions; since these aren't
presently part of the shell design, simply remove them.  We can readd
these in the future.

StTooltip should probably have :vertical and :horizontal pseudo classes
to make the arrow work but it should still function.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 16:28:34 -05:00
Colin Walters
176487834a Add st_texture_cache_load
Function for caching texture data from an arbitrary origin.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 15:50:59 -05:00
Colin Walters
394e01850b Rework internals to be string based
Rather than having ShellTextureCache know about the type of each
item it's caching, this lays the foundation for simply caching
arbitrary string -> CoglHandle.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 15:10:35 -05:00
Florian Müllner
5f8391314a Add hover style property
Set the entry's pseudo class to "hover" when the pointer enters the
inactive widget and reset it appropriately on leave.

https://bugzilla.gnome.org/show_bug.cgi?id=611095
2010-03-08 19:33:12 +01:00
Thomas Wood
d593877548 fix issues with hint text
Add a "hint_visible" private variable to keep track of when the hint text
is visible. Use this to determine whether to return the text from the
internal ClutterText or whether to return an empty string.

Fixes: http://bugzilla.moblin.org/show_bug.cgi?id=6837
       http://bugzilla.moblin.org/show_bug.cgi?id=6836

https://bugzilla.gnome.org/show_bug.cgi?id=611095
2010-03-08 19:33:11 +01:00
Florian Müllner
a0b5a44fe9 [StEntry] Make the cursor size stylable
Just as the cursor color can be styled using the "caret-color"
property, expose the cursor size as "caret-size".

https://bugzilla.gnome.org/show_bug.cgi?id=611095
2010-03-07 23:45:44 +01:00
Colin Walters
5ce1e3fe92 Add st_texture_cache_load_file_to_cogl_texture
For StWidget we want the ability to load raw CoglHandle references
rather than having a big pile of actors backing StWidget.

Several bits of StWidget expect to be able to synchronously load
textures; this is a crutch to support that until we can cleanly
make this asynchronous.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-05 17:08:36 -05:00
Colin Walters
22948b3d39 Merge St.TextureCache and Shell.TextureCache
Brute force merge these two by essentially replacing St.TextureCache
with a (renamed) Shell.TextureCache.

One function was added for convenience, namely "st_texture_cache_load_file_simple".
St.TextureCache had a function to load a texture from a filename, and it
returned NULL on error but only half the callers actually checked this.  This
function is better.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-05 16:19:40 -05:00
Colin Walters
1a0d507316 [ShellGenericContainer] When removing actors, remove them from skip_paint
This fixes a regression introduced by the previous patch.
2010-03-04 17:38:35 -05:00
Dan Winship
b5853fe7e5 [ShellGenericContainer] make this an StWidget
https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:43:02 -05:00
Dan Winship
0f81c7efe0 [ShellGenericContainer] minor style fixes
https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:41:26 -05:00
Dan Winship
0f0e3d9644 [ShellGenericContainer] remove example
There are plenty of examples in js/ui/ now

https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:41:26 -05:00
Dan Winship
f6b4fa6e7e [St] share common ClutterContainer implementation code
https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:41:25 -05:00
Colin Walters
c635cb7016 [ShellGenericContainer] Add method to get number of skipped children
This will be used in search results.

https://bugzilla.gnome.org/show_bug.cgi?id=610740
2010-03-04 14:08:13 -05:00
Owen W. Taylor
6423cbfc92 Fix problems on destruction
StScrollBar: Be robust against being disposed multiple times,
  which can happen, and in fact, normally happens when destroying
  the parent.

StScrollView: Implement remove() for the hscroll and vscroll members,
  and just destroy them in dispose() and let them be removed.
  unparent the shadows, instead of just unref'ing them directly.

https://bugzilla.gnome.org/show_bug.cgi?id=611203
2010-03-02 16:37:05 -05:00
Adel Gadllah
40a8e9c1a6 Fix tracking of single-process multi app cases
When starting oocalc or ooimpress from oowriter's menu get_app_for_window,
fails to recognize the newly started up as such, which result into the appMenu
still showing "Openoffice.org Writer" as app name.

Fix this by trying to window itself first before using the group for finding the app.

https://bugzilla.gnome.org/show_bug.cgi?id=611288
2010-03-01 19:29:39 +01:00
Colin Walters
2e98aab2e7 Revert "(autobuilder test) Really break the build"
This reverts commit 760b6ad9ed.
2010-03-01 10:59:51 -05:00
Colin Walters
760b6ad9ed (autobuilder test) Really break the build 2010-03-01 10:52:31 -05:00
Florian Müllner
b7c60b02d1 [StEntry] Add annotations
All setters in StEntry allow to pass NULL - add appropriate annotations.
2010-02-27 18:03:37 +01:00
Colin Walters
8552721983 [gnome-shell.in] When we don't have DISPLAY, attempt to pull in running session
This is a convenience for debugging when logging in over ssh.  Longer term
we should stick this code (in a more OS portable fashion) into ConsoleKit.
2010-02-25 14:46:27 -05:00
Colin Walters
c4e0e4197d [ShellGlobal] Add shell_global_breakpoint
This is useful for debugging with gdb.
2010-02-23 18:51:27 -05:00
Dan Winship
ef4c9b6f1f [StThemeNode] allow "background-gradient-direction: none"
this lets a more-specific CSS rule turn off the gradient inherited
from a less-specific rule

https://bugzilla.gnome.org/show_bug.cgi?id=610856
2010-02-23 14:44:57 -05:00
Owen W. Taylor
1f1f4432f6 Use gjs_context_get_native_context()
When exported into a public header, gjs_context_get_context() was
renamed to gjs_context_get_native_context(). Adapt, and remove
local prototype.

https://bugzilla.gnome.org/show_bug.cgi?id=610845
2010-02-23 11:54:56 -05:00
Owen W. Taylor
2dc8d9b462 Fix include path when building Shell-1.0.gir
Since shell-slicer.h includes st.h, and that includes
<st/*.h>, we need to add -I $(srcdir) to the command line when
running g-ir-scanner to generate Shell-1.0.gir.
2010-02-22 22:07:52 -05:00
Owen W. Taylor
ce6dd21cd3 Don't generate st.h in a subdir
For srcdir != builddir, in the builddir, the st/ subdirectory doesn't
exist, so we can't generate st.h there. Just switch to building st.h
directly in the current directory. (The other option would be to
create a st/ subdirectory in the builddir if necessary; might be a
little cleaner, but this works for now and gets things distchecking.)
2010-02-22 19:37:49 -05:00
Maxim Ermilov
fc39919856 Add top and bottom shadows to app browser
Add a 'vshadow' property to StScrollView, which, when turned on,
overlays gradient shadows on the top and bottom of the StScrollView.

Turn this on for the StScrollView used for the app browser.
https://bugzilla.gnome.org/show_bug.cgi?id=609604
2010-02-23 01:12:13 +03:00
Colin Walters
fb9fd6925a [StScrollView] Fix incorrect assertion, defaults, and test case
The type we don't currently handle is _ALWAYS, my original use
of g_return_if_fail was wrong.

Also the default should be AUTOMATIC in the properties, not ALWAYS.

Finally the test case was still using the incorrect St.ScrollPolicy.

https://bugzilla.gnome.org/show_bug.cgi?id=609015
2010-02-22 12:06:56 -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
18c5405b79 [StScrollView] Add support for GtkPolicyType for scrollbars
Previously we were hacking out the vertical scrollbar, this patch
allow us to sanely say in which directions we want to scroll.

Note this patch intentionally changes St to depend on GTK+ in the
API.  I believe this is a correct long term change where we should
view St as co-evolving with GTK+ rather than replacing or paralleling.

https://bugzilla.gnome.org/show_bug.cgi?id=609015
2010-02-19 15:37:40 -05:00
Maxim Ermilov
5b1d52c5e7 Fix build problem with mutter 2.29
Query mutter's version more or equal 2.29.0
2010-02-19 20:54:47 +03:00
Florian Müllner
94d3e27c53 [Overview] Fix tiled background images
Tiled backgrounds are only displayed once in the upper left corner when
in the overview - they should be tiled just like outside the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=610203
2010-02-17 17:34:38 +01:00
Dan Winship
721e1ea863 [St] Implement max-width/max-height in the CSS parser
st_theme_node_adjust_preferred_width/height now limit the content area
of an actor to the max, if given. (The requested width/height may be
larger to make room for borders, etc.)

https://bugzilla.gnome.org/show_bug.cgi?id=606755
2010-02-16 14:08:17 -05:00
Dan Winship
5331d3e360 [St] Make allocation handling more consistent
In StBin, StBoxLayout, and StTable, if a child has a potential
allocation that is larger than its preferred size, we give it its
preferred size instead. However, the corresponding
get_preferred_height/width methods were not making the same
assumption, which meant that if we had more width than the widget
wanted, we would allocate it its preferred width, but with the height
that corresponded to the larger width.

Fix this by defining new helpers _st_actor_get_preferred_width() and
_st_actor_get_preferred_height() and using them everywhere. Also, make
StBin and StTable use _st_allocate_fill() rather than having
nearly-identical duplicate copies of the code.

https://bugzilla.gnome.org/show_bug.cgi?id=609848
2010-02-16 14:06:39 -05:00
Dan Winship
f52744cfbc [StTable] fix x-align/y-align properties to be StAlign, not double
This puts it in sync with StBin and StBoxLayout

https://bugzilla.gnome.org/show_bug.cgi?id=609848
2010-02-16 14:06:39 -05:00
Adel Gadllah
4749393ab5 Remove panel-run-dialog/main-menu handling from shell-global
This is handled by the shellwm (takeover_keybinding) nowdays.

https://bugzilla.gnome.org/show_bug.cgi?id=610039
2010-02-16 16:50:40 +01:00
Colin Walters
11656ebd89 Remove duplicate GETTEXT_PACKAGE 2010-02-11 15:29:58 -05:00
Florian Müllner
36e761b7a5 Fix annotation of shell_recorder_set_pipeline()
There are two minor errors here: the documented parameter name does not
match the real one, and there should be an (allow-none) annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=609522
2010-02-10 13:18:24 +01:00
Florian Müllner
32e2ff7573 [StScrollbar] Allocate steppers according to size requests
The forward/backward steppers are always allocated a square region at the
scroll bar's ends. Change the allocation to be based on the steppers' size
requests instead.

https://bugzilla.gnome.org/show_bug.cgi?id=609401
2010-02-10 10:13:00 +01:00
Adel Gadllah
3e1b1d5789 Make parameters configureable
Make the framerate, file extension and gstreamer pipeline used by the
screencast recorder configureable using gconf.

This patch does not change the defaults, it justs provides a way for
the user to override them.

https://bugzilla.gnome.org/show_bug.cgi?id=608995
2010-02-08 21:31:30 +01:00
Dan Winship
8e759d7f32 Initialize global->root_pixmap to the stage color
Fixes drawing of the overview in the case where there is no root pixmap
(eg, --xephyr mode).

(And the workaround for not drawing an unintialized ClutterTexture can
be removed now, since the texture will always have been initialized.)

https://bugzilla.gnome.org/show_bug.cgi?id=609339
2010-02-08 14:47:04 -05:00
Owen W. Taylor
dce4b2f325 Remove C99 use of non-constant initializers
To comply with C89, structure initializers should have
only constant values.

(Not a thorough check for this throughout the codebase, just
StWidget is fixed up in this commit.)

https://bugzilla.gnome.org/show_bug.cgi?id=608746
2010-02-08 14:04:45 -05:00
Florian Müllner
fb7ed1ee28 [ShellEmbeddedWindow] Set window type in g_object_new
As of 2a78adc5e3, gobject no longer allows for setting construct-only
properties via g_object_set() during object initialization; set the
properties in a custom constructor instead.

https://bugzilla.gnome.org/show_bug.cgi?id=608802
2010-02-08 18:50:05 +01:00
Adel Gadllah
c88d21d487 Use GL_MESA_pack_invert if available
Use GL_MESA_pack_invert if available to avoid doing flipping in software.

https://bugzilla.gnome.org/show_bug.cgi?id=609053
2010-02-05 22:25:40 +01:00
Colin Walters
ed129b40a3 [ShellWindowTracker] Add shell_window_tracker_app_from_pid
In some situations we might need to look up an application from
a process identifier, such as the notification system where we
will determine application from the message sender.
2010-02-03 19:07:22 -05:00
Florian Müllner
fd1ce40ee7 Improve handling of gradients
By calling clutter_actor_get_allocation() in st_widget_recompute_style()
to determine whether to redraw gradients, we triggered a complete
reallocation of the stage for each gradient.

As gradients are processed in st_widget_real_style_changed() anyway, the
additional checks in st_widget_recompute_style() are redundant and can
be removed altogether.

https://bugzilla.gnome.org/show_bug.cgi?id=608847
2010-02-03 23:38:42 +01:00
Florian Müllner
2b15f38730 Pick up change from gradient to solid background
On style changes from gradient to solid backgrounds, the new background
must be drawn unconditionally, not depending on whether old and new
background color differ.

https://bugzilla.gnome.org/show_bug.cgi?id=608914
2010-02-03 21:16:40 +01:00
Maxim Ermilov
86515f3943 show background when nautilus isn't drawing the desktop.
If window with type Meta.WindowType.DESKTOP doesn't exist, then draw
background.
https://bugzilla.gnome.org/show_bug.cgi?id=591912
2010-02-03 22:52:25 +03:00
Owen W. Taylor
ed36517615 [ShellGenericContainer] Simplify tracking of skip-paint children
The current way we keep track of skip-paint children is more
difficult than it needs to be, and can lead to subtle bugs.
(For one, the skip-paint state of a child is remembered
when it is removed then added back again, which is completely
unexpected.)

Instead of using weak references to track children, just remove
items from the skip-paint list by overriding the remove() virtual
function of the ClutterContainer interface.

The 'skip_paint' hash table is then destroyed in finalize rather than
dispose since it doesn't hold references to memory any more but just
passively tracks an attribute of the children that are currently in
the container.

https://bugzilla.gnome.org/show_bug.cgi?id=608848
2010-02-03 12:00:56 -05:00
Florian Müllner
3e19f41cba [StWidget] Limit gradient redraws to size changes
When moving a widget with a gradient, its allocation changes
continuously, resulting in constant redraws.
Checking for actual size changes before the operation avoids
unnecessary redraws.

https://bugzilla.gnome.org/show_bug.cgi?id=608715
2010-02-02 00:24:35 +01:00
Colin Walters
b1007ed811 Add shell_global_gc
Primarily useful for debugging.  This was originally a patch against
gjs: https://bugzilla.gnome.org/show_bug.cgi?id=595323

But rather than add a random toplevel module just for this function
effectively, we can easily enough define it here.  Adding toplevel
modules to GScript should have a bit more formal process to it.

https://bugzilla.gnome.org/show_bug.cgi?id=608095
2010-02-01 16:08:43 -05:00
William Jon McCann
e3be74a31a Fix invalid unreference of CoglTexture
cogl_texture_get_data doesn't increase the refcount, so don't try
to decrement it.

Signed-off-by: Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=608512
2010-02-01 10:15:15 -05:00
Owen W. Taylor
8db212db99 ShellRecorder: Fix interaction of glReadPixels with Cogl
The screen recording wasn't working because of two bad interactions
with Cogl:

 - Buffered primitives weren't being flushed out
 - Cogl changes the pixel store values away from their default values

Thanks for Jon Nettleton for tracking down the source of the
problems with the recorder.

https://bugzilla.gnome.org/show_bug.cgi?id=598390
2010-01-28 13:54:58 -05:00
Colin Walters
d7e0051bc6 [StButton] Hold ref to self until animation completes
StButton has an internal animation for the border-image actor, then
it connects to the "completed" signal passing itself as data.  However,
if the button is destroyed, nothing prevents the animation's completed
signal from then causing a reference to freed memory.

Holding a reference to the button is the most straightforward fix here.

https://bugzilla.gnome.org/show_bug.cgi?id=607825
2010-01-26 14:28:57 -05:00
Colin Walters
2aa305b51d [StShadowTexture] Fix invalid unref of CoglHandle
This code appeared to treat the return value of clutter_texture_get_cogl_texture
as having a new reference, but in fact it doesn't.

https://bugzilla.gnome.org/show_bug.cgi?id=608119
2010-01-26 13:03:43 -05:00
Maxim Ermilov
d9008054cf Handle resolution changes
Added signal 'screen-size-changed' to ShellGlobal.
Connect to this signal in main.js and run the _relayout() method.
If Overview or calendar are visible when this signal emit, they will be hiding.
https://bugzilla.gnome.org/show_bug.cgi?id=584526
2010-01-19 21:32:36 +03:00
Florian Müllner
f8acd0f6f6 Match on executable names as well
Include matches on desktop entries' exec property in addition to the
name and comment ones.

https://bugzilla.gnome.org/show_bug.cgi?id=606743
2010-01-15 23:03:18 +01:00
Florian Müllner
ccc6a23f68 Fix missing translations for 'time ago' strings
Replace ngettext with dngettext and set the correct translation
domain, so gnome-shell's domain is searched for translations
rather than mutter's.

https://bugzilla.gnome.org/show_bug.cgi?id=597882
2010-01-15 17:14:03 +01:00
Dan Winship
11276a3505 Initial implementation of the message tray and notification daemon
From the message-tray branch. Most of the UI parts were written by
Marina, and most of the D-Bus parts by me.
2010-01-13 15:13:20 -05:00
Dan Winship
c90371d9d5 [ShellTextureCache] add methods for caching raw image data
shell_texture_cache_load_from_data() takes the contents of an image
file, while shell_texture_cache_load_from_raw() takes the actual pixel
data.
2010-01-13 15:13:20 -05:00
Marina Zhurakhinskaya
038a32330f [St] Add st_box_layout_move_child and st_box_layout_insert_actor 2010-01-13 15:13:20 -05:00
Florian Müllner
59d6029f47 Implement radial gradients for StWidget
Some theme authors have stated interest in radial gradient backgrounds.
The w3c has some draft:

http://dev.w3.org/csswg/css3-images/#radial-gradients

As this is rather complex, we add only some very basic support, which
extends our syntax for linear gradients:

background-gradient-direction: [vertical|horizontal|radial]

Gradients are centered circles, whose size is determined by the closest
side.

https://bugzilla.gnome.org/show_bug.cgi?id=604945
2010-01-11 23:38:34 +01:00
Florian Müllner
7486c09fbb Change handling of gradients
Some changes to the way we handle CSS gradients:

 * draw without padding, thus interpreting gradients as part of the
   background rather than as content

 * clip to (rounded) border area

 * draw the border along the gradient instead of trying to align the
   gradient layer with the background/border layer

 * use the border_image actor instead of the background_image one

https://bugzilla.gnome.org/show_bug.cgi?id=606257
2010-01-11 23:38:34 +01:00
Colin Walters
c17e1249d5 [panel] Scale up, center and fade application icon in app menu
Per 20091114 design.

https://bugzilla.gnome.org/show_bug.cgi?id=605491
2010-01-07 18:33:01 -05:00
Colin Walters
262f92e0be [ShellSlicer] New class to display center of child
A #StBin that has 0 minimum size, and will clip its child
in the middle.

https://bugzilla.gnome.org/show_bug.cgi?id=605491
2010-01-07 18:33:00 -05:00
Colin Walters
da797dff35 [Makefile-st.am] Generate st/st.h
All of the st-$foo.h files say to include st.h, but we didn't have
one.  Therefore, generate it.

https://bugzilla.gnome.org/show_bug.cgi?id=605491
2010-01-07 18:33:00 -05:00
Colin Walters
98a8dd682d [ShellAppUsage] Fix use-after-free
We were holding on to UsageData structure pointers in previously_running,
but those can be purged by the unused app cleanup.  Instead just hold
onto dup'd copies of the application id strings.
2010-01-06 13:34:11 -05:00
Florian Müllner
2dfe113a42 Implement -st-shadow for StWidget
Add support for a new -st-shadow property, which is based loosely
on the CSS3 box-shadow property:
http://www.css3.info/preview/box-shadow/

It defers from the specification as follows:

 * no multiple shadows
 * the optional color argument may be placed anywhere
 * the shape is not determined by the widget's bounding box,
   but by the background-image property

https://bugzilla.gnome.org/show_bug.cgi?id=603691
2010-01-05 21:48:09 +01:00
Carlos Martín Nieto
767fe0ebc2 [St] Don't leak the font family name
A copy of the string is made by pango_font_description_set_family()
and we don't need the string anymore, so we should free it

https://bugzilla.gnome.org/show_bug.cgi?id=605035
2010-01-04 13:49:47 -05:00
Siegfried-Angel Gevatter Pujals
e326202477 Use the preferred text editor when opening an extension's .js file
Change "./src/gnome-shell --create-extension" to use "gnome-open"
when opening the newly created .js file, so that it is launched
with the user's preferred text editor, instead of hardcoding gedit.
2009-12-18 20:26:41 +01:00
Siegfried-Angel Gevatter Pujals
45f4292259 Make "gnome-shell --create-extension" compatible with Python 2.5
Fallback to using the json-py module on systems with a Python
version older than 2.6 (which introduced native JSON support).
2009-12-18 20:22:51 +01:00
Colin Walters
288eae91e2 [ShellAppSystem] Initialize collation keys for info on-demand
In case of duplicate infos structures with the same id, the
info structures we get from looking up the id in app_id_to_info
aren't necessarily the same as those we used to match, so we
can't rely on matching to implicitly initialize info->casefolded_name.

Since the name collation key isn't used in matching results,
just in sorting, init it on-demand in the sorting which is also more
efficient.
2009-12-18 12:36:16 -05:00
Colin Walters
2cb4dfb4a4 [lookingGlass] Add primitive extensions list
In the future this should be more like the Firefox Addons UI
probably with enable/disable/update checking, but stub it out
here for now.

https://bugzilla.gnome.org/show_bug.cgi?id=599661
2009-12-18 11:20:05 -05:00
Colin Walters
55fbb9d0af [St] Implement text-decoration: [underline|strikethrough]
Move CSS handling of StLabel and StButton for their underlying
ClutterText objects into st_private, and implement support for
the underline and strikethrough St text-decoration properties.

Overline isn't implemented for lack of a corresponding Pango
attribute, and blink, well...

https://bugzilla.gnome.org/show_bug.cgi?id=599661
2009-12-18 11:20:05 -05:00
Colin Walters
aa9d3515a1 Add extensionSystem
Consumer documentation will live at http://live.gnome.org/GnomeShell/Extensions

In terms of implementation; basically we load extensions from the well-known
directories.  Add a GConf key to disable extensions by uuid.  There is a new
option --create-extension for the gnome-shell script which takes a bit of
interactive input, sets up some sample files, and launches gedit.

No extensions UI in this patch; that will come later.

https://bugzilla.gnome.org/show_bug.cgi?id=599661
2009-12-18 11:19:59 -05: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
Colin Walters
14df7cd62c [StOverflowBox] Vertical box which skips painting underallocated children
https://bugzilla.gnome.org/show_bug.cgi?id=603523
2009-12-18 10:01:36 -05:00
Colin Walters
5a3c3efbeb [ShellDocSystem] Check GTK+ version for constness of argument 2009-12-15 16:29:21 -05:00
Colin Walters
a442dfea14 Add class for handling recent docs
Push some of the JS docInfo down into C; crucially, this lets us
use the GIO async API.

https://bugzilla.gnome.org/show_bug.cgi?id=603522
2009-12-15 15:54:42 -05:00
Colin Walters
42757a0c87 Move Main.currentTime() and Main.createAppLaunchContext() into ShellGlobal
Primarily motivated by wanting these functions accessible from C.

https://bugzilla.gnome.org/show_bug.cgi?id=603522
2009-12-15 15:54:38 -05:00
Colin Walters
81b7c0170d Add set_skip_paint method
Ideally we'd be able to override _paint, but given that we can't
at the moment, this method gives a way to implement containers
which don't happen to paint all of their children.

https://bugzilla.gnome.org/show_bug.cgi?id=603522
2009-12-15 15:53:08 -05:00
Colin Walters
b6cc9c7ff6 Add functions to dynamically load/unload stylesheets
For implementing extensions, we want the ability to add a stylesheet
dynamically, and unload it as well.

https://bugzilla.gnome.org/show_bug.cgi?id=599661
2009-12-01 15:00:56 -05:00
Florian Müllner
6b816fa7dc Replace includes of glib/gi18n.h with glib/gi18n-lib.h
https://bugzilla.gnome.org/show_bug.cgi?id=602802
2009-11-24 15:26:09 -05:00
Colin Walters
e2ac769fd1 Bump save timeout to 5 minutes, close output asynchronously
The synchronous close causes us to block in fsync() which has extremely
poor interactivity implications on ext3.

Also, the 5 second timeout was an accidental commit from debugging, 5
minutes is fine.

https://bugzilla.gnome.org/show_bug.cgi?id=602456
2009-11-24 13:22:32 -05:00
Dan Winship
dd8f05c81d include "config.h" in all .c files
Also, fix shell-global.c to actually compile with config.h included.

Was supposed to fix bug 602802, but doesn't...
2009-11-24 09:15:35 -05:00
Colin Walters
2f1ca7bf28 Remove ShellButtonBox, button.js; Use St.Clickable in panel.js
StClickable replaces ShellButtonBox.  Reduce the number of
button-like things by deleting button.js.

To do so, add CSS style for the actitivies button.

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-23 14:33:49 -05:00
Colin Walters
93f3412f70 Import ShellButtonBox as StClickable
Now a StBin, and add hover/active style properties.  Also, add the
event to the CLICKED signal.  Otherwise a straightforward namespace
transformation.

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-23 14:33:48 -05:00
Colin Walters
f815844eb4 Move ShellDrawingArea to StDrawingArea
It's nicer to have ShellDrawingArea as a St widget so it can
participate more cleanly in CSS styling, such as queuing a redraw
automatically on style changes, and allowing subclasses to use
CSS styling.

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-23 14:33:48 -05:00
Colin Walters
7b9f5b7643 Implement gradients for StWidget
Rather than having gradients be individually implemented by higher
level JS widgets, move basic gradient functionality into StWidget.
There is prior art in WebKit for CSS gradients:

http://webkit.org/blog/175/introducing-css-gradients/

However, implementing this would be quite a lot of work; all we
need in the Shell design at the moment is basic horizontal/vertical
linear gradients.  So, the syntax now supported is:

background-gradient-type: [vertical|horizontal]
background-gradient-start: color;
background-gradient-end: color;

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-20 19:51:41 -05:00
Colin Walters
8ac97fe1a0 [StThemeNode] Re-add erroneously deleted (out) annotations
An earlier commit was overzealous in removing (out) annotations;
introspection supports (out) for integral types just fine, we
only need to remove them for (out) types where the caller needs
to allocate a boxed type.

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-17 18:43:34 -05:00
Abderrahim Kitouni
3529b8c915 [StTable] now RTL aware
https://bugzilla.gnome.org/show_bug.cgi?id=584662
2009-11-16 11:46:29 -05:00
Abderrahim Kitouni
4e8206d60e [StBoxLayout] now RTL aware
https://bugzilla.gnome.org/show_bug.cgi?id=584662
2009-11-16 11:46:22 -05:00
Abderrahim Kitouni
a5edc78fac [StWidget] add API support for right-to-left UI
https://bugzilla.gnome.org/show_bug.cgi?id=584662
2009-11-16 11:46:09 -05:00
Dan Winship
8334b063f1 Deal with title-less windows
https://bugzilla.gnome.org/show_bug.cgi?id=601290
2009-11-13 16:04:17 -05:00
Dan Winship
050e710770 Use gnome-terminal rather than xterm+xeyes+xlogo in --xephyr mode
https://bugzilla.gnome.org/show_bug.cgi?id=588056
2009-11-13 14:43:10 -05:00
Dan Winship
985d707788 Port ShellStatusMenu to javascript
https://bugzilla.gnome.org/show_bug.cgi?id=601458
2009-11-13 14:21:31 -05:00
Dan Winship
9ddebf0480 Introspect src/gdmuser
In addition to the Makefile changes, we also change uid_t to gulong in
the public API (which matches how it was already represented in the
gobject properties).

https://bugzilla.gnome.org/show_bug.cgi?id=601458
2009-11-13 14:20:45 -05:00
Colin Walters
8c05003acf Add gnome-shell --eval-file
Convenience utility function for evaluating an arbitrary
JavaScript file.
2009-11-13 12:45:46 -05:00
Colin Walters
263d738ef6 [StTooltip] Fix _get_preferred_width
It was ignoring the label width.

https://bugzilla.gnome.org/show_bug.cgi?id=600734
2009-11-12 11:42:00 -05:00
Colin Walters
8040ad61c6 [StBoxLayout] Add missing _queue_relayout in _add_actor
https://bugzilla.gnome.org/show_bug.cgi?id=600734
2009-11-12 11:42:00 -05:00
Colin Walters
057f0effed [StBoxLayout] Add st_box_layout_get_n_children
https://bugzilla.gnome.org/show_bug.cgi?id=600734
2009-11-12 11:42:00 -05:00
Colin Walters
bf7b166237 [StBoxLayout] Add st_box_layout_remove_all, st_box_layout_destroy_children
In a variety of places we're using boxes as data-modeling displays,
and in doing so we often want to either remove the children or
explictly destroy them.

Now ideally Gjs would support callbacks, and this would make using
the for_each functions possible, but even then these functions
are more efficient and shorter to type, at least.

https://bugzilla.gnome.org/show_bug.cgi?id=600734
2009-11-12 11:42:00 -05:00
Colin Walters
dcd7762253 [StThemeNode] Don't give negative width/height for content boxes
If the space we're allocated is too small for our border + padding
constraints, don't give negative allocations to callers.  Squash
to zero.

It isn't really useful for callers to get negative content sizes,
and certainly breaks most allocation code.

https://bugzilla.gnome.org/show_bug.cgi?id=600734
2009-11-05 15:28:56 -05:00
Colin Walters
4f456b9689 Implement non-uniform borders (when not using corner_radius)
StTheme CSS supports different border widths for different sides.  Implement
it for StWidget by drawing the border internally.  However, we don't support
a nonzero corner-radius with nonuniform borders.

https://bugzilla.gnome.org/show_bug.cgi?id=599442
2009-11-04 16:47:17 -05:00
Colin Walters
e2e513ff08 Remove (out) "caller-allocates" annotations
GObject Introspection+gjs doesn't presently support (out) for caller-allocates
scenarios.

https://bugzilla.gnome.org/show_bug.cgi?id=599442
2009-11-04 16:47:17 -05:00
Colin Walters
37a948e4eb Add missing allow-none for set_style_pseudo_class
https://bugzilla.gnome.org/show_bug.cgi?id=599442
2009-11-04 16:47:17 -05:00
Colin Walters
b8d9319c32 Add missing allow-none for st_bin_set_child
https://bugzilla.gnome.org/show_bug.cgi?id=599442
2009-11-04 16:47:17 -05:00
Colin Walters
f549269934 [StBoxLayout] Implement raise and lower
Code copied from ClutterGroup.

https://bugzilla.gnome.org/show_bug.cgi?id=599442
2009-11-04 16:47:11 -05:00
Owen W. Taylor
2103a4da24 Add shell-global-private.h to Makefile.am
Distribute shell-global-private.h (as a non_gir_sources, since it
includes gjs.h and isn't scannable by gobject-introspection.)
2009-10-28 15:46:46 -04:00
Owen W. Taylor
627f86a9dc shell-global-private.h fixes:
- Include private header so shell-global.c compiles
- Move _shell_global_set_plugin to private header
2009-10-28 12:59:01 -04:00
Colin Walters
baf823c466 Store GjsContext pointer in ShellGlobal
Future functionality in ShellGlobal needs access to the GjsContext.

https://bugzilla.gnome.org/show_bug.cgi?id=599561
2009-10-28 12:31:58 -04: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
d9ff1f2ec1 [ShellApp] Ignore removal of windows we're not interested in
Previously shell_app_remove_window assumed that it was being
passed a window in its list; rather than having callers check
whether a window is interesting and only if so removing it
from the app, just ignore removal of windows we aren't interested
in, like how we ignore addition of windows we already have.

https://bugzilla.gnome.org/show_bug.cgi?id=598502
2009-10-23 13:19:29 -04:00
Colin Walters
10991d363d [ShellWindowTracker] Create fallback apps again
Creating window-based apps got lost in the code refactoring.
2009-10-23 12:26:05 -04:00
Colin Walters
369e0c2c6f [ShellApp] Signal windows-changed when removing a window
https://bugzilla.gnome.org/show_bug.cgi?id=599412
2009-10-23 10:59:04 -04:00
Steve Frécinaux
7239eb2f90 [StThemeNode] Add support for 'width' and 'height' CSS properties.
The behavior in respect to borders matches CSS - the properties set the size of
the content exclusive of the borders (CSS3 box-sizing property - not implemented
here - changes this).

min-width/min-height correspond very closely to the CSS meanings.

width/height are a little different from the CSS meanings - the CSS meaning is
"exactly this size unless overridden by min/max-width/height" - but within the
realm of our layout algorithm, making them control natural size is pretty
close.

This way we can force elements to have a fixed natural or minimum size.

https://bugzilla.gnome.org/show_bug.cgi?id=598651
2009-10-21 20:18:32 +02:00
Steve Frécinaux
5b769138b6 [StThemeNode] round padding values intead of truncating them.
This way, 49.9999 will end up as 50 instead of 49.

https://bugzilla.gnome.org/show_bug.cgi?id=598651
2009-10-21 20:17:28 +02:00
Colin Walters
81d579aca0 Disconnect from window signal handlers when removing a window
We need to remove all of our signal handlers attached to a window
when being disposed.

https://bugzilla.gnome.org/show_bug.cgi?id=598502
2009-10-21 11:44:07 -04:00
Colin Walters
7548f2d71e [ShellWindowTracker] Don't skip "uninteresting" windows for focus
For the purposes of determining which application is focused, don't
skip "uninteresting" windows.  The old get_focused_window code
was used for usage tracking, but here we want reliable application
association.

Also convert a .text= to .set_text that was missed with the last
patch.

https://bugzilla.gnome.org/show_bug.cgi?id=599206
2009-10-21 11:30:13 -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
7f5c600133 Use a fixed ordering for well-known icons
Define the ordering for well-known icons; see
the page http://live.gnome.org/Features/StandardIconOrdering

https://bugzilla.gnome.org/show_bug.cgi?id=598313
2009-10-19 14:57:02 -04:00
Colin Walters
cd33dc7f22 Annotate list setters
Without these bindings don't know the type of list elements.

https://bugzilla.gnome.org/show_bug.cgi?id=598691
2009-10-16 16:04:46 -04:00
Dan Winship
79a614240b [ShellApp] fix app/window sort order
The window lists were not being resorted when user-time changed, and
the app list was mistakenly "penalizing" apps for having *any*
minimized windows, rather than for having *only* minimized windows.

https://bugzilla.gnome.org/show_bug.cgi?id=598389
2009-10-16 11:15:21 -04:00
Colin Walters
7c954898a2 Support fixed position children
When doing layout, check for whether x/y have been explicitly
specified, and if so honor those positions.

https://bugzilla.gnome.org/show_bug.cgi?id=598462
2009-10-15 17:40:58 -04:00
Colin Walters
497c74f4d8 Minor code cleanup: use child variable consistently
Preparation for a subsequent patch.

https://bugzilla.gnome.org/show_bug.cgi?id=598462
2009-10-15 17:40:58 -04:00
Colin Walters
d705c1bb52 [ShellApp] Fix handler signature for workspace switch
This was causing crashes or undefined behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=598227
2009-10-15 14:05:19 -04:00
Colin Walters
d9df7c1b1e [AppWell] Fix D&D for ShellApp
The drag and drop case needed to be updated to use ShellApp
correctly.  Export _is_transient for better compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=598227
2009-10-15 13:24:19 -04:00
Colin Walters
38c06ca837 Create ShellApp, rebase things on it
Previously, we had ShellAppInfo, which contains fundamental
information about an application, and methods on ShellAppMonitor
to retrieve "live" information like the window list.

AppIcon ended up being used as the "App" class which was painful
for various reasons; among them that we need to handle window
list changes, and some consumers weren't ready for that.

Clean things up a bit by introducing a new ShellApp class in C,
which currently wraps a ShellAppInfo.

AppIcon then is more like the display actor for a ShellApp.  Notably,
the ".windows" property moves out of it.  The altTab code which
won't handle dynamic changes instead is changed to maintain a
cached version.

ShellAppMonitor gains some more methods related to ShellApp now.

In the future, we might consider changing ShellApp to be a GInterface,
which could be implemented by ShellDesktopFileApp, ShellWindowApp.

Then we could axe ShellAppInfo from the "public" API and it would
return to being an internal loss mitigation layer for GMenu.

https://bugzilla.gnome.org/show_bug.cgi?id=598227
2009-10-14 14:37:34 -04:00
Colin Walters
ab0460ad59 Use clutter_actor_destroy in dispose, add _dispose where needed
ClutterGroup calls _destroy, but most of St was just calling _unparent.
This caused problems because the DESTROY signal was not emitted
for child elements after destroying a toplevel.  Also, in a GC'd
binding it would cause unpredictable lifetime of children.

Some St widgets simply didn't have _dispose at all; implement it.

Note because of the usage of the background_image in StButton,
we can't cleanly destroy it inside the StWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=597845
2009-10-09 16:19:33 -04:00
Owen W. Taylor
a26b0b60d1 Fix srcdir != builddir build of St.gir
We need to use st_cflags which has -I$(srcdir) not ST_CFLAGS
when building St.gir.
2009-10-07 19:32:00 -04:00
Owen W. Taylor
60dbb19c2d Reference Meta-2.28.gir
Now that Mutter has been bumped to 2.28.0, we need to reference
Meta-2.28.gir not Meta-2.27.gir.
2009-10-07 19:27:17 -04:00
Owen W. Taylor
ff39edd1ee Deal with unknown flags from ClutterEvent.get_state()
When we get a ClutterModifierType from Clutter, it might contain
bits not in the enumeration. See bug 59771 for a similar problem
with GdkModifierType.

Add a wrapper Shell.get_event_state() around clutter_event_get_state()
to mask these bits out and only return approved bits.

https://bugzilla.gnome.org/show_bug.cgi?id=597735
2009-10-07 17:22:37 -04:00
Owen W. Taylor
400326e549 Add docs and (transfer none) to st_widget_get_theme_node()
st_widget_get_theme_node() was missing the (transfer none)
GObject Introspection causing crashes. Add that and document the
function.
2009-10-07 14:26:14 -04:00
Dan Winship
439daf828f [AppSwitcher] add a workaround for a gjs problem with GdkModifierType
gdk_display_get_pointer() sometimes returns values for the mask that
aren't part of the GdkModifierType enumeration, which gjs doesn't like
(bug 597292). Work around that by adding a C wrapper that strips out
the extra flags.

https://bugzilla.gnome.org/show_bug.cgi?id=597559
2009-10-06 16:07:37 -04:00
Owen W. Taylor
53fbabe2ca Use GtkIMContext instead of ClutterIMContext
Add StIMText, which is a drop-in replacement for ClutterIMText but
uses GtkIMContext instead of ClutterIMContext.

StIMText doesn't have preedit support (would need ClutterText
changes), so isn't going to be useful for complicated input methods,
but is good enough to get dead keys and similar working.

entry.js: Simple test case of StEntry
gnome-shell.modules: Remove clutter-imcontext module

https://bugzilla.gnome.org/show_bug.cgi?id=597471
2009-10-06 14:48:32 -04:00
Dan Winship
ff4ac0d02e [AppIcon] Improve shell_draw_box_pointer()
Add a new enum type for the pointer direction, rather than abusing
ClutterGravity, and implement the missing directions.

https://bugzilla.gnome.org/show_bug.cgi?id=597498
2009-10-06 09:53:47 -04:00
Owen W. Taylor
4ddc1118bb Work around libcroco < 0.6.2 parsing bug for 'rgba'
To work around a problem where libcroco < 0.6.2 can't handle
functions starting with 'r' or 'u', preconvert 'rgba' to 'RGBA'
when parsing stylesheets and then check for rgba()
case-insensitively.

(libcroco is uniformly case-sensitive, though the CSS spec requires
that ASCII should be handled case-insensitively.)

https://bugzilla.gnome.org/show_bug.cgi?id=597054
2009-10-05 16:25:38 -04:00
Colin Walters
2f2df61093 Cache applications for a menu
Rather than recomputing this each time someone asks, have a
cache of the apps for a given menu.

https://bugzilla.gnome.org/show_bug.cgi?id=597167
2009-10-02 19:30:42 -04:00
Colin Walters
c5ce405859 Ignore releases of buttons other than the activating button
Before we hardcoded popdowns to only button 1 before. But we need
to actually pop down on the release of the activating button.
(Once the button is released, if the we don't pop-down the menu,
then subsequently we let the user use any button.)

https://bugzilla.gnome.org/show_bug.cgi?id=596371
2009-10-02 19:28:25 -04:00
Richard Hughes
cbb3a3aec8 Fix make dist by including all the private files and the tests in the tarball 2009-10-02 17:02:25 +01:00
Siegfried-Angel Gevatter Pujals
243824ab80 Replace "round(x)" with "(int)(0.5 + x)"
round() is a C99 addition, so causes portability problems:
different C library versions require different #defines to
enable it. So simply avoid using it.
2009-10-01 22:39:04 +02:00
Owen W. Taylor
2cc41c6726 StButton: Fix property enumeration names
Property enumeration names should correspond exactly to the property names;
in particular the ACTIVE vs :checked disparity was confusing reading the
code.

http://bugzilla.moblin.org/show_bug.cgi?id=6504
2009-10-01 14:46:33 -04:00
Owen W. Taylor
5a42179a96 Port StTable to StThemeNode
Convert the StTable code from StStylable to StThemeNode. The
:row-spacing and :col-spacing GObject properties are converted
into spacing-rows and spacing-columns style properties.

A new interactive test is added for StTable.

https://bugzilla.gnome.org/show_bug.cgi?id=596811
2009-10-01 14:46:33 -04:00
Owen W. Taylor
af3ec56ca1 Handle adding children to StTable from Javascript
Remove the StTable specific methods to add actors:

 st_table_add_actor()
 st_table_add_actor_with_properties()

Since they shadow the generic ClutterContainer add_actor() method,
and patch in our add() convenience function as we do for
StBoxLayout.

https://bugzilla.gnome.org/show_bug.cgi?id=596811
2009-10-01 14:46:33 -04:00
Owen W. Taylor
289b19aa31 Import MxTable as StTable
Import table code from Mx library

https://bugzilla.gnome.org/show_bug.cgi?id=596811
2009-10-01 14:46:33 -04:00
Owen W. Taylor
91eb613d69 Turn StBoxLayout:spacing into a style property
Remove the StBoxLayout:spacing GObject property, and instead make
BoxLayout look up the spacing from the CSS style. This makes it
consistent with padding and will allow the use of units. (The
removal of the GObject property entirely instead of making it an
override is consistent with how we handle color, font, padding, etc.)

https://bugzilla.gnome.org/show_bug.cgi?id=596803
2009-10-01 14:46:32 -04:00
Owen W. Taylor
b77b205d37 Add clutter-text properties to StEntry and StLabel
Add clutter-text properties to allow getting access to the underlying
ClutterText actor. This corresponds to the get_clutter_text() methods.

The PROP_LABEL and PROP_ENTRY enum values are renamed to PROP_TEXT to
match the names of the properties that they correspond to, and the
properties of StEntry are reordered into alphabetical order.

Based on a patch from Colin Walters
https://bugzilla.gnome.org/show_bug.cgi?id=591245
http://bugzilla.moblin.org/show_bug.cgi?id=6313
2009-10-01 14:41:20 -04:00