+Thu Oct 19 09:35:18 2006 John Ellis <johne@verizon.net>
+
+ * layout.[ch] (layout_new_with_geometry): New function to create a
+ layout sized to an X geometry string.
+ * main.c: Add support for --geometry on the command line.
+
Thu Oct 19 07:42:38 2006 John Ellis <johne@verizon.net>
* utilops.c: Fix minimum allowed auto-rename value to be zero again,
> Added 'Fast jpeg thumbnailing'.
> xvpics is now hidden option.
> Holding down shift will now scroll more when panning with mouse.
+ > add --geometry command line option
> add blurb about moving images between collections with shift+drag
> Initiating full screen from the command line should not
show main window until full screen is exited.
+d> add --geometry suipport
+
> Add shortcut to jump to next folder within parent folder.
> add animated image support
}
LayoutWindow *layout_new(const gchar *path, gint popped, gint hidden)
+{
+ return layout_new_with_geometry(path, popped, hidden, NULL);
+}
+
+LayoutWindow *layout_new_with_geometry(const gchar *path, gint popped, gint hidden,
+ const gchar *geometry)
{
LayoutWindow *lw;
- GdkGeometry geometry;
- GdkWindowHints hints;
+ GdkGeometry hint;
+ GdkWindowHints hint_mask;
lw = g_new0(LayoutWindow, 1);
if (save_window_positions)
{
- hints = GDK_HINT_USER_POS;
+ hint_mask = GDK_HINT_USER_POS;
}
else
{
- hints = 0;
+ hint_mask = 0;
}
- geometry.min_width = 32;
- geometry.min_height = 32;
- geometry.base_width = MAINWINDOW_DEF_WIDTH;
- geometry.base_height = MAINWINDOW_DEF_HEIGHT;
- gtk_window_set_geometry_hints(GTK_WINDOW(lw->window), NULL, &geometry,
- GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints);
+ hint.min_width = 32;
+ hint.min_height = 32;
+ hint.base_width = 0;
+ hint.base_height = 0;
+ gtk_window_set_geometry_hints(GTK_WINDOW(lw->window), NULL, &hint,
+ GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hint_mask);
if (save_window_positions)
{
lw->last_time = 0;
lw->last_time_id = g_timeout_add(5000, layout_check_for_update_cb, lw);
+ if (geometry)
+ {
+ if (!gtk_window_parse_geometry(GTK_WINDOW(lw->window), geometry))
+ {
+ print_term(_("Invalid geometry\n"));
+ }
+ }
+
gtk_widget_show(lw->window);
layout_tools_hide(lw, lw->tools_hidden);
LayoutWindow *layout_new(const gchar *path, gint popped, gint hidden);
+LayoutWindow *layout_new_with_geometry(const gchar *path, gint popped, gint hidden,
+ const gchar *geometry);
void layout_close(LayoutWindow *lw);
void layout_free(LayoutWindow *lw);
}
static void parse_command_line(int argc, char *argv[], gchar **path, gchar **file,
- GList **cmd_list, GList **collection_list)
+ GList **cmd_list, GList **collection_list,
+ gchar **geometry)
{
GList *list = NULL;
GList *remote_list = NULL;
{
startup_command_line_collection = TRUE;
}
+ else if (strncmp(cmd_line, "--geometry=", 11) == 0)
+ {
+ if (!*geometry) *geometry = g_strdup(cmd_line + 11);
+ }
else if (strcmp(cmd_line, "-r") == 0 ||
strcmp(cmd_line, "--remote") == 0)
{
print_term(_(" -f, --fullscreen start in full screen mode\n"));
print_term(_(" -s, --slideshow start in slideshow mode\n"));
print_term(_(" -l, --list open collection window for command line\n"));
+ print_term(_(" --geometry=GEOMETRY set main window location\n"));
print_term(_(" -r, --remote send following commands to open window\n"));
print_term(_(" -rh,--remote-help print remote command list\n"));
print_term(_(" --debug turn on debug output\n"));
GList *cmd_list = NULL;
GList *collection_list = NULL;
CollectionData *first_collection = NULL;
+ gchar *geometry = NULL;
gchar *buf;
gchar *bufl;
setup_default_options();
load_options();
- parse_command_line(argc, argv, &cmd_path, &cmd_file, &cmd_list, &collection_list);
+ parse_command_line(argc, argv, &cmd_path, &cmd_file, &cmd_list, &collection_list, &geometry);
gtk_init (&argc, &argv);
path = get_current_dir();
}
- lw = layout_new(NULL, tools_float, tools_hidden);
+ lw = layout_new_with_geometry(NULL, tools_float, tools_hidden, geometry);
layout_sort_set(lw, file_sort_method, file_sort_ascending);
if (collection_list && !startup_command_line_collection)
}
}
+ g_free(geometry);
g_free(cmd_path);
g_free(cmd_file);
path_list_free(cmd_list);