Commit e0b1c72a authored by Cosimo Cecchi's avatar Cosimo Cecchi

Remove static libslab

parent c8c12c79
......@@ -5,7 +5,6 @@ NAUTILUS_DIR=
endif
SUBDIRS = \
libslab \
application-browser/etc \
application-browser/src \
main-menu/etc \
......
INCLUDES = \
$(APPLICATION_BROWSER_CFLAGS) \
-I$(top_srcdir)/libslab \
$(WARN_CFLAGS)
bin_PROGRAMS = application-browser
......@@ -9,8 +8,7 @@ application_browser_SOURCES = \
application-browser.c
application_browser_LDADD = \
$(APPLICATION_BROWSER_LIBS) \
$(top_builddir)/libslab/libslab.la
$(APPLICATION_BROWSER_LIBS)
AM_CPPFLAGS = \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
......@@ -50,17 +50,13 @@ COMMON_MODULES="glib-2.0 >= $GLIB_REQUIRED \
gio-2.0 >= $GLIB_REQUIRED \
gobject-2.0 \
gtk+-2.0 >= $GTK_REQUIRED \
gdk-2.0"
gdk-2.0 \
libslab"
PKG_CHECK_MODULES(GLADE, libglade-2.0)
AC_SUBST(GLADE_CFLAGS)
AC_SUBST(GLADE_LIBS)
PKG_CHECK_MODULES(LIBSLAB, [ $COMMON_MODULES libgnomeui-2.0 gnome-desktop-2.0 librsvg-2.0 libgnome-menu pango ])
AC_SUBST(LIBSLAB_CFLAGS)
AC_SUBST(LIBSLAB_LIBS)
PKG_CHECK_MODULES(MAIN_MENU, [ $COMMON_MODULES libpanelapplet-2.0 gnome-desktop-2.0 gconf-2.0 libgtop-2.0 libgnome-2.0 libgnomeui-2.0 dbus-glib-1 NetworkManager libnm_glib >= 0.7.0 hal-storage cairo ])
AC_CHECK_HEADERS(iwlib.h, [ AC_CHECK_LIB(iw, iw_sockets_open, have_iwlib=yes, have_iwlib=no)], have_iwlib=no)
......@@ -180,8 +176,6 @@ AC_CONFIG_FILES([
Makefile
application-browser/etc/Makefile
application-browser/src/Makefile
libslab/Makefile
libslab/libslab.pc
main-menu/etc/Makefile
main-menu/src/Makefile
nautilus-main-menu/Makefile
......
.deps
.libs
Makefile
Makefile.in
nld-marshal.c
nld-marshal.h
search-entry-watermark.h
libslab.pc
=== ChangeLog discontinued ===
With the move to Git, gnome-main-menu is switching from a ChangeLog file
to relying on commit messages to provide change history.
2009-01-07 Magnus Boman <captain.magnus@gmail.com>
reviewed by: Magnus Boman
* app-resizer.c:
* app-resizer.h:
* app-shell.c (delete_old_data):
* app-shell.h:
* application-tile.c (application_tile_setup):
* directory-tile.c (directory_tile_new):
* document-tile.c (document_tile_new):
* nameplate-tile.c (nameplate_tile_class_init),
(nameplate_tile_get_property), (nameplate_tile_set_property):
* search-bar.h:
* search-context-picker.c:
* search-context-picker.h:
- Use single GTK inclues - Fix bgo#551850#c2
Patch by Cosimo Cecchi
- Compile with G*_DISABLE_DEPRECATED - Fixes bgo#551850#c3
Patch by Cosimo Cecchi
==================== 0.9.12 ====================
2008-11-06 Federico Mena Quintero <federico@novell.com>
Use the new GtkTooltip mechanism rather than the deprecated
GtkTooltips. This also fixes a leak of GtkTooltips objects.
* nameplate-tile.c (NameplateTilePrivate): Removed the "tooltips" field.
(nameplate_tile_set_property): Use gtk_widget_set_tooltip_text()
rather than creating a GtkTooltips object and setting the tooltips there.
(nameplate_tile_get_property): Use gtk_widget_get_tooltip_text()
instead of getting a GtkTooltipsData object.
2008-11-06 Federico Mena Quintero <federico@novell.com>
* bookmark-agent.c (create_app_item): Free the title of the
bookmark file.
2008-10-27 Federico Mena Quintero <federico@novell.com>
Fix some memory leaks:
* tile.c (tile_finalize): Actually destroy the context menu, don't
ref/sink it.
(tile_set_property): Attach the context menu to the tile, don't
just store its pointer.
* nameplate-tile.c (nameplate_tile_finalize): Free the tooltips.
* bookmark-agent.c (create_app_item): Free the URI.
(create_doc_item): Likewise.
(create_dir_item): Likewise.
2008-09-22 Scott Reeves <sreeves@novell.com>
* document-tile.c:
show remote docs - use gio for tooltip, show icon
==================== 0.9.11 ====================
2008-09-07 Cosimo Cecchi <cosimoc@gnome.org>
* app-shell.c: (show_no_results_message):
Escape the markup text properly.
Patch by Denis Washington (#518749).
2008-08-22 Cosimo Cecchi <cosimoc@gnome.org>
* Makefile.am:
* app-shell.c: (generate_new_apps):
* bookmark-agent.c: (bookmark_agent_move_item),
(bookmark_agent_remove_item), (bookmark_agent_new), (finalize),
(update_user_spec_path), (store_monitor_cb),
(recent_item_mru_comp_func):
* directory-tile.c: (directory_tile_new),
(directory_tile_private_setup), (directory_tile_finalize),
(rename_entry_activate_cb), (move_to_trash_trigger),
(delete_trigger), (open_with_default_trigger):
* document-tile.c: (document_tile_new),
(document_tile_private_setup), (document_tile_finalize),
(rename_entry_activate_cb), (open_with_default_trigger),
(move_to_trash_trigger), (delete_trigger), (user_docs_trigger):
* recent-files.c: (main_menu_recent_monitor_init),
(main_menu_recent_file_init), (main_menu_recent_monitor_finalize),
(main_menu_recent_file_finalize), (main_menu_recent_monitor_new),
(get_files), (main_menu_recent_file_get_uri),
(main_menu_recent_file_get_mime_type),
(main_menu_recent_file_get_modified),
(main_menu_rename_recent_file), (main_menu_remove_recent_file),
(recent_file_store_monitor_cb), (recent_item_mru_comp_func):
* slab-gnome-util.c: (copy_file):
Port to GIO and drop gnome-vfs dependency (#527903).
2008-08-11 A. Walton <awalton@gnome.org>
reviewed by: Federico Mena Quintero
* directory-tile.c (delete_trigger):
* document-tile.c (delete_trigger):
Remove Eel dependency from libslab. Bug #524778.
2008-07-28 Federico Mena Quintero <federico@novell.com>
https://bugzilla.novell.com/show_bug.cgi?id=402256 - Main-menu has
high CPU usage on NIS/NFS home directories.
* document-tile.c (load_image): Don't do thumbnailing ourselves,
as we don't have the threading logic to do it in the background.
Instead, let Nautilus handle thumbnailing by itself.
2008-07-24 Cosimo Cecchi <cosimoc@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=544538
* app-shell.c: (generate_launchers):
Fix a build warning.
==================== 0.9.10 ====================
2008-05-13 Federico Mena Quintero <federico@novell.com>
* application-tile.c (application_tile_setup): Ensure that name
and desc are non-NULL before comparing them.
2008-05-09 Magnus Boman <captain.magnus@gmail.com>
https://bugzilla.novell.com/show_bug.cgi?id=224885 -
Don't display both generic name and description if they are the same.
* libslab/application-tile.c (application_tile_setup): Set subheader
to NULL if description is the same as generic name.
2008-04-28 Scott Reeves <sreeves@novell.com>
* bookmark-agent.c:
Fix for BNC#308998 - missing translation in menu
2008-04-23 Federico Mena Quintero <federico@novell.com>
* libslab-utils.c (create_thumbnail_factory): Continue the fix for
the last bug; when a second instance of the applet gets added, it
will want to initialize the thumbnail factory again.
2008-04-23 Federico Mena Quintero <federico@novell.com>
https://bugzilla.novell.com/show_bug.cgi?id=380339 - Crash when
there are two main-menu applets.
* libslab-utils.c (libslab_thumbnail_factory_preinit): Check if
the idle handler is already set up, so we don't try to initialize
the factory twice if there is more than one main-menu applet
(e.g. for multiple monitors).
2008-04-09 Federico Mena Quintero <federico@novell.com>
* bookmark-agent.c (create_doc_item): Don't leak the template
filename.
2008-04-08 Federico Mena Quintero <federico@novell.com>
* bookmark-agent.c (bookmark_agent_remove_item): Free the uris we
got from the GBookmarkFile.
(load_xbel_store): Likewise.
2008-04-04 Federico Mena Quintero <federico@novell.com>
* libslab-utils.c (libslab_checkpoint_init): New public function;
initializes a checkpoint file.
(libslab_checkpoint): New public function to add checkpoints to
the code for profiling purposes.
(libslab_thumbnail_factory_preinit): New public function to queue
the initialization of the thumbnail factory in an idle handler.
With this we can create the thumbnail factory between the applet
hitting the main loop initially and the user activating the
Computer menu.
(libslab_thumbnail_factory_get): New public function.
* bookmark-agent.c (bookmark_agent_update_from_bookmark_file): New
public function; allows the caller to update a BookmarkAgent
explicitly from a given GBookmarkFile. This makes the
BookmarkAgent not monitor the recent-files store on its own, to
give more control to the caller.
* document-tile.c (document_tile_new): Don't call load_image()
here; it already gets done in document_tile_style_set().
(load_image): Use libslab_thumbnail_factory_get() to use the
global thumbnail factory, instead of one of our own.
2008-03-10 Rodrigo Moya <rodrigo@gnome-db.org>
* Makefile.am: only set libtool versioning when building dynamic lib.
==================== 0.9.9 ====================
2008-02-17 Jens Granseuer <jensgr@gmx.net>
* slab-gnome-util.c: (get_slab_gconf_bool), (get_slab_gconf_int),
(get_slab_gconf_string), (free_list_of_strings),
(free_slab_gconf_slist_of_strings),
(get_package_name_from_desktop_item): fix a few leaks and don't
open-code g_(s)list_foreach
2008-02-08 Federico Mena Quintero <federico@novell.com>
* Makefile.am (libslab_la_LDFLAGS): Specify libtool versioning
info. Copied from libgnomeui/libgnomeui/Makefile.am.
2007-09-16 Andre Klapper <a9016009@gmx.de>
* system-tile.c: revert to svn revision 339 (=before
GNOME string freeze break).
2007-02-12 Rodrigo Moya <rodrigo@gnome-db.org>
* application-tile.c (application_tile_setup): check strings before
calling g_str_has_prefix().
2007-02-12 Damien Carbery <damien.carbery@sun.com>
Fixes #383022
* document-tile.c:
* gnome-utils.c: use more portable G_GNUC_FUNCTION instead of
__FUNCTION__.
2007-02-06 Rodrigo Moya <rodrigo@gnome-db.org>
* application-tile.[ch] (application_tile_new_full): added 'gconf_prefix'
argument, so that the AppTile object is able to disable context menu
items based on the presence of some GConf keys.
(application_tile_set_property): free previous values for not leaking.
* app-shell.c (insert_launcher_into_category): pass the GConf prefix we
get from the application to the App tiles.
2007-02-01 Scott Reeves <sreeves@novell.com>
* application-tile.c: small fixup of previous patch to not try and
add the menu item when no help available.
2007-02-01 Rodrigo Moya <rodrigo@gnome-db.org>
* application-tile.c (application_tile_setup): don't show the 'Help
unavailable' item when there is no documentation.
INCLUDES = \
$(LIBSLAB_CFLAGS) \
$(WARN_CFLAGS)
HEADER_FILES= \
$(BUILT_SOURCES) \
app-resizer.h \
app-shell.h \
app-shell-startup.h \
application-tile.h \
directory-tile.h \
document-tile.h \
gnome-utils.h \
nameplate-tile.h \
search-bar.h \
search-context-picker.h \
search-entry.h \
shell-window.h \
slab-gnome-util.h \
slab-section.h \
system-tile.h \
tile.h
if ENABLE_DYNAMIC_LIBSLAB
lib_LTLIBRARIES = libslab.la
SOURCE_HEADER_FILES=
else
noinst_LTLIBRARIES = libslab.la
SOURCE_HEADER_FILES=$(HEADER_FILES)
endif
libslab_la_SOURCES = \
$(SOURCE_HEADER_FILES) \
$(MARSHAL_GENERATED) \
app-resizer.c \
app-shell.c \
app-shell-startup.c \
application-tile.c \
bookmark-agent.h \
bookmark-agent.c \
directory-tile.c \
document-tile.c \
double-click-detector.c \
double-click-detector.h \
gnome-utils.c \
libslab-utils.c \
libslab-utils.h \
nameplate-tile.c \
search-bar.c \
search-context-picker.c \
search-entry-watermark.h \
search-entry.c \
shell-window.c \
slab-gnome-util.c \
slab-section.c \
system-tile.c \
themed-icon.c \
themed-icon.h \
tile-action.c \
tile.c
if ENABLE_DYNAMIC_LIBSLAB
libslab_includedir = $(includedir)/slab
libslab_include_HEADERS = $(HEADER_FILES)
libslab_la_LDFLAGS = \
-version-info $(LT_VERSION)
endif
libslab_la_LIBADD = $(LIBSLAB_LIBS)
if ENABLE_DYNAMIC_LIBSLAB
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libslab.pc
endif
search-entry-watermark.h: search-entry-watermark.svg
echo '#define SEARCH_ENTRY_WATERMARK_SVG "\' > $@; \
sed -e 's/"/\\"/g' -e 's/$$/\\/' -e 's/#000000/#%s/g' $< >> $@; \
echo '"' >> $@
MARSHAL_GENERATED = nld-marshal.c nld-marshal.h
nld-marshal.h: nld-marshal.list
( @GLIB_GENMARSHAL@ --prefix=nld_marshal $(srcdir)/nld-marshal.list --header > nld-marshal.tmp \
&& mv nld-marshal.tmp nld-marshal.h ) \
|| ( rm -f nld-marshal.tmp && exit 1 )
nld-marshal.c: nld-marshal.h
( (echo '#include "nld-marshal.h"'; @GLIB_GENMARSHAL@ --prefix=nld_marshal $(srcdir)/nld-marshal.list --body) > nld-marshal.tmp \
&& mv nld-marshal.tmp nld-marshal.c ) \
|| ( rm -f nld-marshal.tmp && exit 1 )
BUILT_SOURCES = \
search-entry-watermark.h \
$(MARSHAL_GENERATED)
CLEANFILES = \
search-entry-watermark.h \
$(MARSHAL_GENERATED)
EXTRA_DIST= \
search-entry-watermark.svg \
nld-marshal.list
/*
* 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
*/
#include <gtk/gtk.h>
#include <libgnome/gnome-desktop-item.h>
#include "app-shell.h"
#include "app-resizer.h"
static GtkLayoutClass *parent_class = NULL;
static void app_resizer_class_init (AppResizerClass *);
static void app_resizer_init (AppResizer *);
static void app_resizer_destroy (GtkObject *);
static void app_resizer_size_allocate (GtkWidget * resizer, GtkAllocation * allocation);
static gboolean app_resizer_paint_window (GtkWidget * widget, GdkEventExpose * event,
AppShellData * app_data);
GType
app_resizer_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info = {
sizeof (AppResizerClass),
NULL,
NULL,
(GClassInitFunc) app_resizer_class_init,
NULL,
NULL,
sizeof (AppResizer),
0,
(GInstanceInitFunc) app_resizer_init
};
object_type =
g_type_register_static (GTK_TYPE_LAYOUT, "AppResizer", &object_info, 0);
}
return object_type;
}
static void
app_resizer_class_init (AppResizerClass * klass)
{
GtkWidgetClass *widget_class;
parent_class = g_type_class_peek_parent (klass);
((GtkObjectClass *) klass)->destroy = app_resizer_destroy;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->size_allocate = app_resizer_size_allocate;
}
static void
app_resizer_init (AppResizer * window)
{
}
void
remove_container_entries (GtkContainer * widget)
{
GList *children, *l;
children = gtk_container_get_children (widget);
for (l = children; l; l = l->next)
{
GtkWidget *child = GTK_WIDGET (l->data);
gtk_container_remove (GTK_CONTAINER (widget), GTK_WIDGET (child));
}
if (children)
g_list_free (children);
}
static void
resize_table (GtkTable * table, gint columns, GList * launcher_list)
{
float rows, remainder;
remove_container_entries (GTK_CONTAINER (table));
rows = ((float) g_list_length (launcher_list)) / (float) columns;
remainder = rows - ((int) rows);
if (remainder != 0.0)
rows += 1;
gtk_table_resize (table, (int) rows, columns);
}
static void
relayout_table (GtkTable * table, GList * element_list)
{
gint maxcols = (GTK_TABLE (table))->ncols;
gint row = 0, col = 0;
do
{
GtkWidget *element = GTK_WIDGET (element_list->data);
gtk_table_attach (table, element, col, col + 1, row, row + 1, GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 0);
col++;
if (col == maxcols)
{
col = 0;
row++;
}
}
while (NULL != (element_list = g_list_next (element_list)));
}
void
app_resizer_layout_table_default (AppResizer * widget, GtkTable * table, GList * element_list)
{
resize_table (table, widget->cur_num_cols, element_list);
relayout_table (table, element_list);
}
static void
relayout_tables (AppResizer * widget, gint num_cols)
{
GtkTable *table;
GList *table_list, *launcher_list;
for (table_list = widget->cached_tables_list; table_list != NULL;
table_list = g_list_next (table_list))
{
table = GTK_TABLE (table_list->data);
launcher_list = gtk_container_get_children (GTK_CONTAINER (table));
launcher_list = g_list_reverse (launcher_list); /* Fixme - ugly hack because table stores prepend */
resize_table (table, num_cols, launcher_list);
relayout_table (table, launcher_list);
g_list_free (launcher_list);
}
}
static gint
calculate_num_cols (AppResizer * resizer, gint avail_width)
{
if (resizer->table_elements_homogeneous)
{
gint num_cols;
if (resizer->cached_element_width == -1)
{
GtkTable *table = GTK_TABLE (resizer->cached_tables_list->data);
GList *children = gtk_container_get_children (GTK_CONTAINER (table));
GtkWidget *table_element = GTK_WIDGET (children->data);
g_list_free (children);
resizer->cached_element_width = table_element->allocation.width;
resizer->cached_table_spacing = gtk_table_get_default_col_spacing (table);
}
num_cols =
(avail_width +
resizer->cached_table_spacing) / (resizer->cached_element_width +
resizer->cached_table_spacing);
return num_cols;
}
else
g_assert_not_reached (); /* Fixme - implement... */
}
static gint
relayout_tables_if_needed (AppResizer * widget, gint avail_width, gint current_num_cols)
{
gint num_cols = calculate_num_cols (widget, avail_width);
if (num_cols < 1)
{
num_cols = 1; /* just horiz scroll if avail_width is less than one column */
}
if (current_num_cols != num_cols)
{
relayout_tables (widget, num_cols);
current_num_cols = num_cols;
}
return current_num_cols;
}
void
app_resizer_set_table_cache (AppResizer * widget, GList * cache_list)
{
widget->cached_tables_list = cache_list;
}
void
app_resizer_set_homogeneous (AppResizer * widget, gboolean homogeneous)
{
widget->table_elements_homogeneous = homogeneous;
}
static void
app_resizer_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
{
/* printf("ENTER - app_resizer_size_allocate\n"); */
AppResizer *resizer = APP_RESIZER (widget);
GtkWidget *child = GTK_WIDGET (APP_RESIZER (resizer)->child);
static gboolean first_time = TRUE;
gint new_num_cols;
gint useable_area;
if (first_time)
{
/* we are letting the first show be the "natural" size of the child widget so do nothing. */
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
(*GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
first_time = FALSE;
gtk_layout_set_size (GTK_LAYOUT (resizer), child->allocation.width,
child->allocation.height);
return;
}
if (!resizer->cached_tables_list) /* if everthing is currently filtered out - just return */
{
GtkAllocation child_allocation;
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
(*GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
/* We want the message to center itself and only scroll if it's bigger than the available real size. */
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.width = MAX (allocation->width, child->requisition.width);
child_allocation.height = MAX (allocation->height, child->requisition.height);
gtk_widget_size_allocate (child, &child_allocation);
gtk_layout_set_size (GTK_LAYOUT (resizer), child_allocation.width,
child_allocation.height);
return;
}
useable_area =
allocation->width - (child->requisition.width -
GTK_WIDGET (resizer->cached_tables_list->data)->requisition.width);
new_num_cols =
relayout_tables_if_needed (APP_RESIZER (resizer), useable_area,
resizer->cur_num_cols);
if (resizer->cur_num_cols != new_num_cols)
{
GtkRequisition req;
/* Have to do this so that it requests, and thus gets allocated, new amount */
gtk_widget_size_request (child, &req);
resizer->cur_num_cols = new_num_cols;
}
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
(*GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
gtk_layout_set_size (GTK_LAYOUT (resizer), child->allocation.width,
child->allocation.height);
}
GtkWidget *
app_resizer_new (GtkVBox * child, gint initial_num_columns, gboolean homogeneous,
AppShellData * app_data)
{
AppResizer *widget;
g_assert (child != NULL);
g_assert (GTK_IS_VBOX (child));
widget = g_object_new (APP_RESIZER_TYPE, NULL);
widget->cached_element_width = -1;
widget->cur_num_cols = initial_num_columns;
widget->table_elements_homogeneous = homogeneous;
widget->setting_style = FALSE;
widget->app_data = app_data;
g_signal_connect (G_OBJECT (widget), "expose-event", G_CALLBACK (app_resizer_paint_window),
app_data);
gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (child));
widget->child = child;
return GTK_WIDGET (widget);
}
static void
app_resizer_destroy (GtkObject * obj)
{
}
void
app_resizer_set_vadjustment_value (GtkWidget * widget, gdouble value)
{
GtkAdjustment *adjust = gtk_layout_get_vadjustment (GTK_LAYOUT (widget));
if (value > adjust->upper - adjust->page_size)
{
value = adjust->upper - adjust->page_size;
}
gtk_adjustment_set_value (adjust, value);
}
static gboolean
app_resizer_paint_window (GtkWidget * widget, GdkEventExpose * event, AppShellData * app_data)
{
/*
printf("ENTER - app_resizer_paint_window\n");
printf("Area: %d, %d, %d, %d\n", event->area.x, event->area.y, event->area.width, event->area.height);
printf("Allocation:%d, %d, %d, %d\n\n", widget->allocation.x, widget->allocation.y, widget->allocation.width, widget->allocation.height);
*/
gdk_draw_rectangle (GTK_LAYOUT (widget)->bin_window,
widget->style->base_gc[GTK_STATE_NORMAL], TRUE, event-&g