Commit edc7a195 authored by Elliot Lee's avatar Elliot Lee

Fix warnings Try (unsuccessfully) to get proper icon reflow by calling



* libnautilus/{gdk-extensions.c,gnome-icon-container.c}: Fix warnings
* libnautilus/gnome-icon-container.c: Try (unsuccessfully) to get
  proper icon reflow by calling icon_grid_resize() instead of
  icon_grid_set_visible_width(), in size_allocate().
* src/*.*: Add ntl-app.[ch].
* src/file-manager/desktop-*.c: Fix warnings.
* src/file-manager/fm-directory-view.c: Remove incorrect warning,
  allow turning off use of icon_layout altogether.
parent 6d4ffeff
1999-12-16 Elliot Lee <sopwith@redhat.com>
* libnautilus/{gdk-extensions.c,gnome-icon-container.c}: Fix warnings
* libnautilus/gnome-icon-container.c: Try (unsuccessfully) to get
proper icon reflow by calling icon_grid_resize() instead of
icon_grid_set_visible_width(), in size_allocate().
* src/*.*: Add ntl-app.[ch].
* src/file-manager/desktop-*.c: Fix warnings.
* src/file-manager/fm-directory-view.c: Remove incorrect warning,
allow turning off use of icon_layout altogether.
1999-12-16 John Sullivan <sullivan@eazel.com>
* src/ntl-window.c:
......
......@@ -96,7 +96,6 @@ gdk_fill_rectangle_with_gradient (GdkDrawable *drawable,
const GdkColor *end_color,
gboolean horizontal)
{
GdkGCValues saved_values;
GdkRectangle band_box;
gint16 *position;
guint16 *size;
......
......@@ -96,7 +96,6 @@ gdk_fill_rectangle_with_gradient (GdkDrawable *drawable,
const GdkColor *end_color,
gboolean horizontal)
{
GdkGCValues saved_values;
GdkRectangle band_box;
gint16 *position;
guint16 *size;
......
......@@ -96,7 +96,6 @@ gdk_fill_rectangle_with_gradient (GdkDrawable *drawable,
const GdkColor *end_color,
gboolean horizontal)
{
GdkGCValues saved_values;
GdkRectangle band_box;
gint16 *position;
guint16 *size;
......
......@@ -18,6 +18,8 @@ LDADD= file-manager/libntl-file-manager.la \
$(VFS_LIBS)
nautilus_SOURCES= \
ntl-app.h \
ntl-app.c \
ntl-content-view.h \
ntl-content-view.c \
ntl-main.c \
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include "desktop-canvas.h"
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include <libgnomeui/gnome-canvas-text.h>
#include <gnome.h>
#include <gtk/gtk.h>
#include "desktop-menu.h"
......@@ -95,7 +94,7 @@ desktop_canvas_init (DesktopCanvas *dcanvas)
/* the attachment holds a refcount and eventually destroys
the popup */
gnome_popup_menu_attach(dcanvas->popup, dcanvas, NULL);
gnome_popup_menu_attach(dcanvas->popup, GTK_WIDGET(dcanvas), NULL);
}
static void
......
......@@ -207,6 +207,8 @@ desktop_layout_new (void)
layout->hpadding = 8;
layout->vpadding = 8;
return layout;
}
void
......
......@@ -37,6 +37,7 @@
#define FM_DEBUG(x) g_message x
#define WITH_LAYOUT TRUE
#define DISPLAY_TIMEOUT_INTERVAL 500
#define ENTRIES_PER_CB 1
......@@ -250,7 +251,7 @@ load_icon_container (FMDirectoryView *view,
g_return_if_fail(info);
add_to_icon_container (view, icm,
icon_container, info, TRUE);
icon_container, info, WITH_LAYOUT);
position = gnome_vfs_directory_list_position_next
(position);
......@@ -628,7 +629,7 @@ display_pending_entries (FMDirectoryView *view)
if (icon_container != NULL)
add_to_icon_container (view, icon_manager,
icon_container, info, TRUE);
icon_container, info, WITH_LAYOUT);
else
add_to_flist (icon_manager, flist, info);
......@@ -731,22 +732,14 @@ directory_load_cb (GnomeVFSAsyncHandle *handle,
g_assert(entries_read <= ENTRIES_PER_CB);
FM_DEBUG (("Entering function, %d entries read: %s",
entries_read, gnome_vfs_result_to_string (result)));
entries_read, gnome_vfs_result_to_string (result)));
view = FM_DIRECTORY_VIEW (callback_data);
/* FIXME: This should be an assert, changed to a warning for now
* so we can continue developing other features until this is resolved.
*/
if (!view->directory_list || view->directory_list == list) {
g_warning("unexpected view->directory_list!");
}
if (view->directory_list == NULL) {
if (result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF) {
setup_base_uri (view);
view->directory_list = list;
/* FIXME just to make sure. But these should be
......@@ -769,16 +762,12 @@ directory_load_cb (GnomeVFSAsyncHandle *handle,
}
}
if (view->current_position == GNOME_VFS_DIRECTORY_LIST_POSITION_NONE
&& list) {
if(!view->current_position && list)
view->current_position
= gnome_vfs_directory_list_get_first_position (list);
g_message("Reset current position, length now %d",
g_list_length(view->current_position));
}
= gnome_vfs_directory_list_get_position (list);
view->entries_to_display += entries_read;
g_message("%d new entries makes %d total (%d real total)\n",
g_message("%d new entries makes %d total (%d real total)",
entries_read, view->entries_to_display,
g_list_length(view->current_position));
......@@ -970,7 +959,7 @@ fm_directory_view_get_icon_layout (FMDirectoryView *view)
void
fm_directory_view_set_icon_layout (FMDirectoryView *view,
const GnomeIconContainerLayout *layout)
const GnomeIconContainerLayout *layout)
{
g_return_if_fail (view != NULL);
......
#include "nautilus.h"
#include <file-manager/fm-public-api.h>
static int window_count = 0;
static GnomeObject *
nautilus_make_object(GnomeGenericFactory *gfact, const char *goad_id, gpointer closure)
{
GtkObject *theobj = NULL;
if(!strcmp(goad_id, "ntl_file_manager"))
theobj = gtk_object_new(fm_directory_view_get_type(), NULL);
if(!theobj)
return NULL;
if(GNOME_IS_OBJECT(theobj))
return GNOME_OBJECT(theobj);
if(NAUTILUS_IS_VIEW_CLIENT(theobj))
{
gtk_widget_show(GTK_WIDGET(theobj));
return nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(theobj));
}
gtk_object_destroy(theobj);
return NULL;
}
void
nautilus_app_init(void)
{
NautilusWindow *mainwin;
/* Create our CORBA objects */
gnome_generic_factory_new_multi("nautilus_factory", nautilus_make_object, NULL);
/* Set default configuration */
mainwin = nautilus_app_create_window();
bonobo_activate();
nautilus_window_set_initial_state(mainwin);
}
static void
nautilus_app_destroy_window(GtkObject *obj)
{
window_count--;
if(window_count <= 0)
gtk_main_quit();
}
NautilusWindow *
nautilus_app_create_window(void)
{
GtkWidget *win = gtk_widget_new(nautilus_window_get_type(), "app_id", "nautilus", NULL);
window_count++;
gtk_signal_connect(GTK_OBJECT(win), "destroy", nautilus_app_destroy_window, NULL);
gtk_widget_show(win);
return NAUTILUS_WINDOW(win);
}
#ifndef NTL_APP_H
#define NTL_APP_H 1
void nautilus_app_init(void);
NautilusWindow *nautilus_app_create_window(void);
#endif
......@@ -26,35 +26,6 @@
#include "config.h"
#include "nautilus.h"
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo/gnome-bonobo.h>
#include <file-manager/fm-public-api.h>
static GnomeObject *
nautilus_make_object(GnomeGenericFactory *gfact, const char *goad_id, gpointer closure)
{
GtkObject *theobj = NULL;
if(!strcmp(goad_id, "ntl_file_manager"))
theobj = gtk_object_new(fm_directory_view_get_type(), NULL);
if(!theobj)
return NULL;
if(GNOME_IS_OBJECT(theobj))
return GNOME_OBJECT(theobj);
if(NAUTILUS_IS_VIEW_CLIENT(theobj))
{
gtk_widget_show(GTK_WIDGET(theobj));
return nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(theobj));
}
gtk_object_destroy(theobj);
return NULL;
}
int main(int argc, char *argv[])
{
......@@ -64,8 +35,6 @@ int main(int argc, char *argv[])
struct poptOption options[] = {
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
};
GtkWidget *mainwin;
GnomeGenericFactory *gfact;
/* FIXME: This should also include G_LOG_LEVEL_WARNING, but I had to take it
* out temporarily so we could continue to work on other parts of the software
......@@ -79,12 +48,7 @@ int main(int argc, char *argv[])
g_thread_init(NULL);
gnome_vfs_init();
gfact = gnome_generic_factory_new_multi("nautilus_factory", nautilus_make_object, NULL);
mainwin = gtk_widget_new(nautilus_window_get_type(), "app_id", "nautilus", NULL);
bonobo_activate();
nautilus_window_set_initial_state(NAUTILUS_WINDOW(mainwin));
gtk_widget_show(mainwin);
nautilus_app_init();
bonobo_main();
return 0;
......
......@@ -3,6 +3,10 @@
#ifndef NAUTILUS_H
#define NAUTILUS_H 1
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo/gnome-bonobo.h>
#include "ntl-types.h"
#include "ntl-window.h"
#include "ntl-window-state.h"
......@@ -12,4 +16,6 @@
#include "ntl-content-view.h"
#include "ntl-uri-map.h"
#include "ntl-app.h"
#endif
#include "nautilus.h"
#include <file-manager/fm-public-api.h>
static int window_count = 0;
static GnomeObject *
nautilus_make_object(GnomeGenericFactory *gfact, const char *goad_id, gpointer closure)
{
GtkObject *theobj = NULL;
if(!strcmp(goad_id, "ntl_file_manager"))
theobj = gtk_object_new(fm_directory_view_get_type(), NULL);
if(!theobj)
return NULL;
if(GNOME_IS_OBJECT(theobj))
return GNOME_OBJECT(theobj);
if(NAUTILUS_IS_VIEW_CLIENT(theobj))
{
gtk_widget_show(GTK_WIDGET(theobj));
return nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(theobj));
}
gtk_object_destroy(theobj);
return NULL;
}
void
nautilus_app_init(void)
{
NautilusWindow *mainwin;
/* Create our CORBA objects */
gnome_generic_factory_new_multi("nautilus_factory", nautilus_make_object, NULL);
/* Set default configuration */
mainwin = nautilus_app_create_window();
bonobo_activate();
nautilus_window_set_initial_state(mainwin);
}
static void
nautilus_app_destroy_window(GtkObject *obj)
{
window_count--;
if(window_count <= 0)
gtk_main_quit();
}
NautilusWindow *
nautilus_app_create_window(void)
{
GtkWidget *win = gtk_widget_new(nautilus_window_get_type(), "app_id", "nautilus", NULL);
window_count++;
gtk_signal_connect(GTK_OBJECT(win), "destroy", nautilus_app_destroy_window, NULL);
gtk_widget_show(win);
return NAUTILUS_WINDOW(win);
}
#ifndef NTL_APP_H
#define NTL_APP_H 1
void nautilus_app_init(void);
NautilusWindow *nautilus_app_create_window(void);
#endif
......@@ -26,35 +26,6 @@
#include "config.h"
#include "nautilus.h"
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo/gnome-bonobo.h>
#include <file-manager/fm-public-api.h>
static GnomeObject *
nautilus_make_object(GnomeGenericFactory *gfact, const char *goad_id, gpointer closure)
{
GtkObject *theobj = NULL;
if(!strcmp(goad_id, "ntl_file_manager"))
theobj = gtk_object_new(fm_directory_view_get_type(), NULL);
if(!theobj)
return NULL;
if(GNOME_IS_OBJECT(theobj))
return GNOME_OBJECT(theobj);
if(NAUTILUS_IS_VIEW_CLIENT(theobj))
{
gtk_widget_show(GTK_WIDGET(theobj));
return nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(theobj));
}
gtk_object_destroy(theobj);
return NULL;
}
int main(int argc, char *argv[])
{
......@@ -64,8 +35,6 @@ int main(int argc, char *argv[])
struct poptOption options[] = {
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
};
GtkWidget *mainwin;
GnomeGenericFactory *gfact;
/* FIXME: This should also include G_LOG_LEVEL_WARNING, but I had to take it
* out temporarily so we could continue to work on other parts of the software
......@@ -79,12 +48,7 @@ int main(int argc, char *argv[])
g_thread_init(NULL);
gnome_vfs_init();
gfact = gnome_generic_factory_new_multi("nautilus_factory", nautilus_make_object, NULL);
mainwin = gtk_widget_new(nautilus_window_get_type(), "app_id", "nautilus", NULL);
bonobo_activate();
nautilus_window_set_initial_state(NAUTILUS_WINDOW(mainwin));
gtk_widget_show(mainwin);
nautilus_app_init();
bonobo_main();
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment