Commit 43777ea2 authored by Jim Krehl's avatar Jim Krehl

initial checkin

parent 6988d900
This diff is collapsed.
SUBDIRS = \
utils \
libslab/src \
libtile \
libslab \
application-browser/etc \
application-browser/src \
control-center/etc \
......
desktopdir = $(datadir)/applications
desktop_DATA = application-browser.desktop
@INTLTOOL_DESKTOP_RULE@
schemasdir = @GCONF_SCHEMA_FILE_DIR@
schemas_DATA = application-browser.schemas
@INTLTOOL_SCHEMAS_RULE@
$(desktop_DATA).in: $(desktop_DATA).in.in
sed -e "s|\@BINDIR\@|$(bindir)|" $< > $@
install-data-local:
if test -z "$(DESTDIR)" ; then \
for p in $(schemas_DATA) ; do \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p; \
done \
fi
EXTRA_DIST = $(desktop_DATA).in.in $(schemas_DATA).in
CLEANFILES = $(desktop_DATA) $(schemas_DATA) $(desktop_DATA).in
[Desktop Entry]
X-SuSE-translate=true
_Name=Application Browser
Exec=@BINDIR@/application-browser
Terminal=false
Type=Application
StartupNotify=true
Encoding=UTF-8
NoDisplay=true
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/ab_new_apps_file_key</key>
<applyto>/desktop/gnome/applications/main-menu/ab_new_apps_file_key</applyto>
<owner>application-browser</owner>
<type>string</type>
<default>.config/ab-newapps.txt</default>
<locale name="C">
<short>Filename of existing .desktop files</short>
<long>Filename of existing .desktop files</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/ab_new_apps_max_items</key>
<applyto>/desktop/gnome/applications/main-menu/ab_new_apps_max_items</applyto>
<owner>application-browser</owner>
<type>int</type>
<default>9</default>
<locale name="C">
<short>Max number of New Applications</short>
<long>The maximum number of applications that will be displayed in the New Applications category</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_start</key>
<applyto>/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_start</applyto>
<owner>application-browser</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Exit shell on start action performed</short>
<long>Indicates whether to close the shell when a start action is performed</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_help</key>
<applyto>/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_help</applyto>
<owner>application-browser</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Exit shell on help action performed</short>
<long>Indicates whether to close the shell when a help action is performed</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_add_remove</key>
<applyto>/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_add_remove</applyto>
<owner>application-browser</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Exit shell on add or remove action performed</short>
<long>Indicates whether to close the shell when an add or remove action is performed</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_upgrade_uninstall</key>
<applyto>/desktop/gnome/applications/main-menu/ab_exit_shell_on_action_upgrade_uninstall</applyto>
<owner>application-browser</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Exit shell on upgrade or uninstall action performed</short>
<long>Indicates whether to close the shell when an upgrade or uninstall action is performed</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
INCLUDES = \
$(APPLICATION_BROWSER_CFLAGS) \
-I$(top_srcdir)/libtile \
-I$(top_srcdir)/libslab \
-I$(top_srcdir)/utils \
$(WARN_CFLAGS)
bin_PROGRAMS = application-browser
application_browser_SOURCES = \
app-layout.c \
app-layout.h \
application-browser.c \
app-window.c \
app-window.h
application_browser_LDADD = \
$(APPLICATION_BROWSER_LIBS) \
$(top_builddir)/libtile/libtile.la \
$(top_builddir)/libslab/libslab.la \
$(top_builddir)/utils/libutils.la
AM_CPPFLAGS = \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
/*
* This file is part of the Control Center.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Control Center is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Control Center 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Control Center; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This file is part of the Main Menu.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Main Menu is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Main Menu 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Main Menu; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <gtk/gtk.h>
#include "app-layout.h"
static gint aval_table_width = -1;
gint
calculate_launcher_width ()
{
/* FIXME - right now we hard code the width, do we want to
dynamically determine the optimal size */
return 230;
}
void
OLD_remove_container_entries (GtkContainer * widget)
{
GList *children = gtk_container_get_children (widget);
if (children == NULL)
return;
do {
GtkWidget *child = GTK_WIDGET (children->data);
GtkWidget *parent =
gtk_widget_get_parent (GTK_WIDGET (child));
if (parent) {
gtk_container_remove (GTK_CONTAINER (parent),
GTK_WIDGET (child));
}
}
while (NULL != (children = g_list_next (children)));
}
void
set_available_table_width (gint width)
{
aval_table_width = width;
}
gint
get_available_table_width ()
{
/* Make sure we set this before we call to get it */
if (aval_table_width == -1)
g_assert_not_reached ();
return aval_table_width;
}
void
OLD_resize_table (GtkTable * table, GList * launcher_list)
{
static gboolean initial_setup = TRUE;
OLD_remove_container_entries (GTK_CONTAINER (table));
gint launcher_width = calculate_launcher_width ();
gint table_width = -1;
if (initial_setup) { /* should only be true when called before the
window is shown - ie initial setup */
initial_setup = FALSE;
set_available_table_width (launcher_width * INITIAL_NUM_COLS);
printf ("TABLE WIDTH NOT SET YET\n");
}
table_width = get_available_table_width ();
gint columns = table_width / launcher_width;
if (columns < 1) {
printf ("resize_table() - columns less than 1\n");
columns = 1;
}
float rows =
((float) g_list_length (launcher_list)) / (float) columns;
float remainder = rows - ((int) rows);
if (remainder != 0.0)
rows += 1;
gtk_table_resize (table, (int) rows, columns);
}
/*
* This file is part of the Control Center.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Control Center is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Control Center 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Control Center; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This file is part of the Main Menu.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Main Menu is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Main Menu 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Main Menu; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __APPBROWSER_LAYOUT_H__
#define __APPBROWSER_LAYOUT_H__
#include <glib.h>
#include <gtk/gtktable.h>
G_BEGIN_DECLS
#define INITIAL_NUM_COLS 3
void OLD_remove_container_entries (GtkContainer * widget);
void OLD_resize_table (GtkTable * table, GList * launcher_list);
gint calculate_launcher_width (void);
void set_available_table_width (gint width);
gint get_available_table_width (void);
G_END_DECLS
#endif /* __APPBROWSER_LAYOUT_H__ */
/*
* This file is part of the Control Center.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Control Center is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Control Center 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Control Center; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This file is part of the Main Menu.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Main Menu is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Main Menu 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Main Menu; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "app-window.h"
#include <gtk/gtkhbox.h>
#include <gtk/gtkalignment.h>
#include <gtk/gtkbin.h>
#include <gtk/gtkframe.h>
#include <gtk/gtklayout.h>
#include <gtk/gtkscrolledwindow.h>
#include "app-layout.h"
static GtkWindowClass *parent_class = NULL;
static void slab_window_class_init (SlabWindowClass *);
static void slab_window_init (SlabWindow *);
static void slab_window_destroy (GtkObject *);
gboolean paint_window (GtkWidget * widget, GdkEventExpose * event,
gpointer data);
#define SLAB_WINDOW_BORDER_WIDTH 6
GType
slab_window_get_type (void)
{
printf ("ENTER - SLAB-slab_window_get_type\n");
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
sizeof (SlabWindowClass),
NULL,
NULL,
(GClassInitFunc) slab_window_class_init,
NULL,
NULL,
sizeof (SlabWindow),
0,
(GInstanceInitFunc) slab_window_init
};
object_type = g_type_register_static (GTK_TYPE_FRAME,
"SlabWindow",
&object_info, 0);
}
return object_type;
}
static void
slab_window_class_init (SlabWindowClass * klass)
{
printf ("AAAAAAAAAAA\n\n");
parent_class = g_type_class_peek_parent (klass);
((GtkObjectClass *) klass)->destroy = slab_window_destroy;
}
static void
slab_window_init (SlabWindow * window)
{
printf ("AAAAAAAAAAA\n\n");
window->_hbox = NULL;
window->_left_pane = NULL;
window->_right_pane = NULL;
}
GtkWidget *
slab_window_new ()
{
printf ("AAAAAAAAAAA\n\n");
SlabWindow *window = g_object_new (SLAB_WINDOW_TYPE, NULL);
gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
window->_hbox = GTK_BOX (gtk_hbox_new (FALSE, 0));
gtk_container_add (GTK_CONTAINER (window),
GTK_WIDGET (window->_hbox));
g_signal_connect (G_OBJECT (window),
"expose-event", G_CALLBACK (paint_window), NULL);
return GTK_WIDGET (window);
}
static void
slab_window_destroy (GtkObject * obj)
{
printf ("AAAAAAAAAAA\n\n");
}
void
slab_window_reset_contents (SlabWindow * slab, GtkWidget * left_pane,
GtkWidget * right_pane)
{
printf ("AAAAAAAAAAA\n\n");
GList *children =
gtk_container_get_children (GTK_CONTAINER (slab->_left_pane));
gtk_container_remove (GTK_CONTAINER (slab->_left_pane),
GTK_WIDGET (children->data));
children = g_list_next (children); /* should only have one child
in list */
g_assert (children == NULL);
children =
gtk_container_get_children (GTK_CONTAINER
(slab->_right_pane));
gtk_container_remove (GTK_CONTAINER (slab->_right_pane),
GTK_WIDGET (children->data));
children = g_list_next (children); /* should only have one child
in list */
g_assert (children == NULL);
gtk_container_add (GTK_CONTAINER (slab->_left_pane), left_pane);
gtk_container_add (GTK_CONTAINER (slab->_right_pane), right_pane);
}
void
slab_window_set_contents (SlabWindow * slab, GtkWidget * left_pane,
GtkWidget * right_pane)
{
printf ("AAAAAAAAAAA\n\n");
slab->_left_pane = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
slab->_right_pane = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (slab->_left_pane), 15, 15,
15, 15);
gtk_alignment_set_padding (GTK_ALIGNMENT (slab->_right_pane), 0, 0, 2,
0);
gtk_box_pack_start (slab->_hbox, slab->_left_pane, FALSE, FALSE, 0);
gtk_box_pack_start (slab->_hbox, slab->_right_pane, TRUE, TRUE, 0); /* this
one
takes
any
extra
space
*/
gtk_container_add (GTK_CONTAINER (slab->_left_pane), left_pane);
gtk_container_add (GTK_CONTAINER (slab->_right_pane), right_pane);
}
gboolean
paint_window (GtkWidget * widget, GdkEventExpose * event, gpointer data)
{
printf ("ENTER - SLAB-paint_window\n");
GList *child;
GtkWidget *left_pane, *right_pane;
left_pane = SLAB_WINDOW (widget)->_left_pane;
right_pane = SLAB_WINDOW (widget)->_right_pane;
/* draw left pane background */
gdk_draw_rectangle (widget->window,
widget->style->bg_gc [GTK_STATE_ACTIVE],
TRUE,
left_pane->allocation.x, left_pane->allocation.y,
left_pane->allocation.width,
left_pane->allocation.height);
/* draw right pane background */
gdk_draw_rectangle (widget->window,
widget->style->bg_gc [GTK_STATE_ACTIVE],
TRUE,
right_pane->allocation.x,
right_pane->allocation.y,
right_pane->allocation.width,
right_pane->allocation.height);
/* draw pane separator */
gdk_draw_line (widget->window,
widget->style->dark_gc [GTK_STATE_NORMAL],
right_pane->allocation.x, right_pane->allocation.y,
right_pane->allocation.x,
right_pane->allocation.y +
right_pane->allocation.height - 1);
child = gtk_container_get_children (GTK_CONTAINER (widget));
for (; child; child = child->next)
gtk_container_propagate_expose (GTK_CONTAINER (widget),
GTK_WIDGET (child->data),
event);
return FALSE;
}
/*
* This file is part of the Control Center.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Control Center is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Control Center 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Control Center; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This file is part of the Main Menu.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Main Menu is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Main Menu 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Main Menu; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __APP_WINDOW_H__
#define __APP_WINDOW_H__
#include <glib.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkbox.h>
G_BEGIN_DECLS
#define SLAB_WINDOW_TYPE (slab_window_get_type ())
#define SLAB_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SLAB_WINDOW_TYPE, SlabWindow))
#define SLAB_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SLAB_WINDOW_TYPE, SlabWindowClass))
#define IS_SLAB_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SLAB_WINDOW_TYPE))
#define IS_SLAB_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SLAB_WINDOW_TYPE))
#define SLAB_WINDOW_GET_CLASS(obj) (G_TYPE_CHECK_GET_CLASS ((obj), SLAB_WINDOW_TYPE, SlabWindowClass))
typedef struct _SlabWindow SlabWindow;
typedef struct _SlabWindowClass SlabWindowClass;
struct _SlabWindow {
GtkWindow window;
GtkBox *_hbox;
GtkWidget *_left_pane;
GtkWidget *_right_pane;
};
struct _SlabWindowClass {
GtkWindowClass parent_class;
};
GType slab_window_get_type (void);
GtkWidget *slab_window_new (void);
void slab_window_set_contents (SlabWindow * window, GtkWidget * left_pane,
GtkWidget * right_pane);
void slab_window_reset_contents (SlabWindow * window, GtkWidget * left_pane,
GtkWidget * right_pane);
G_END_DECLS
#endif /* __APP_WINDOW_H__ */
/*
* This file is part of the Control Center.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Control Center is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Control Center 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Control Center; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This file is part of the Main Menu.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Main Menu is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Main Menu 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Main Menu; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkimage.h>