starting thumbnail index. gdk-pixbuf rocks.

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@660 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Scott Fritzinger
2000-07-12 22:45:31 +00:00
parent 56925f09d9
commit cacfa20949
5 changed files with 41 additions and 8 deletions

View File

@@ -130,7 +130,6 @@ int fujitsu_write_packet (gpio_device *dev, char *packet) {
}
fujitsu_dump_packet(packet);
r=0;
x=0;
while (x<length) {
@@ -426,6 +425,10 @@ int fujitsu_get_int_register (gpio_device *dev, int reg, int *value) {
if (fujitsu_read_packet(dev, buf)==GP_ERROR)
return (GP_ERROR);
/* DC1 = invalid register or value */
if (buf[0] == DC1)
return (GP_ERROR);
if (buf[0] == TYPE_DATA_END) {
// fujitsu_write_ack(dev);
r =((unsigned char)buf[4]) +
@@ -486,10 +489,13 @@ int fujitsu_set_string_register (gpio_device *dev, int reg, char *s, int length)
return (GP_ERROR);
c = (unsigned char)buf[0];
if (c == DC1)
return (GP_ERROR);
if (c == ACK)
done = 1;
else {
if ((c != DC1) && (c != NAK))
if (c != NAK)
return (GP_ERROR);
}
@@ -544,6 +550,8 @@ int fujitsu_get_string_register (gpio_device *dev, int reg, char *s, int *length
while (!done) {
if (fujitsu_read_packet(dev, packet)==GP_ERROR)
return (GP_ERROR);
if (packet[0] == DC1)
return (GP_ERROR);
if (do_percent)
gp_progress((float)x/(float)(*length));
if (fujitsu_write_ack(dev)==GP_ERROR)

View File

@@ -475,7 +475,7 @@ int get_picture_common(int num, int thumbnail) {
OPTION_CALLBACK(get_picture) {
return (get_picture_common(atoi(arg)-1, 0));
return (get_picture_common(atoi(arg), 0));
}
OPTION_CALLBACK(get_thumbnail) {
@@ -485,7 +485,7 @@ OPTION_CALLBACK(get_thumbnail) {
return (GP_ERROR);
}
return (get_picture_common(atoi(arg)-1, 1));
return (get_picture_common(atoi(arg), 1));
}
OPTION_CALLBACK(delete_picture) {

View File

@@ -14,6 +14,8 @@ gphoto2_gtk_SOURCES = \
support.c support.h \
interface.c interface.h \
callbacks.c callbacks.h \
util.c util.h
util.c util.h \
gtkiconlist.c gtkiconlist.h \
gtkitementry.c gtkitementry.h
gphoto2_gtk_LDADD = @GTK_LIBS@ $(INTLLIBS)

View File

@@ -10,11 +10,14 @@
#include <gphoto2.h>
#include "callbacks.h"
#include "gtkiconlist.h"
#include "interface.h"
#include "support.h"
#include "globals.h"
#include "util.h"
#include "../pixmaps/no_thumbnail.xpm"
void debug_print (char *message) {
if (gp_gtk_debug)
printf("%s\n", message);
@@ -425,11 +428,21 @@ camera_select_again:
}
void camera_index_thumbnails() {
GtkWidget *icon_list, *icon, *pixmap;
GtkIconListItem *item;
char buf[1024];
debug_print("camera index thumbnails");
if (!gp_gtk_camera_init)
if (camera_set()==GP_ERROR) {return;}
icon_list = (GtkWidget*) lookup_widget(gp_gtk_main_window, "icons");
strcpy(buf,"A Thumbnail");
item = gtk_icon_list_add_from_data(GTK_ICON_LIST(icon_list),nothumbnail_xpm,buf,NULL);
gtk_entry_set_editable(GTK_ENTRY(item->entry), FALSE);
}
void camera_index_no_thumbnails() {

View File

@@ -15,6 +15,7 @@
#include <gtk/gtk.h>
#include <gphoto2.h>
#include "gtkiconlist.h"
#include "callbacks.h"
#include "interface.h"
#include "support.h"
@@ -73,7 +74,7 @@ GtkWidget*
create_main_window (void)
{
/* __main */
/* widget labels: "camera_label" "camera_tree" "progress bar" "thumbnail_table"
/* widget labels: "camera_label" "camera_tree" "progress bar" "icons"
"status_bar" "notebook"
*/
@@ -192,7 +193,7 @@ create_main_window (void)
GtkWidget *progress_bar;
GtkWidget *scrolledwindow2;
GtkWidget *viewport2;
GtkWidget *table1;
GtkWidget *icons;
GtkWidget *status_bar;
GtkAccelGroup *accel_group;
@@ -1223,13 +1224,22 @@ create_main_window (void)
gtk_widget_show (viewport2);
gtk_container_add (GTK_CONTAINER (scrolledwindow2), viewport2);
icons = gtk_icon_list_new(80, GTK_ICON_LIST_TEXT_BELOW);
gtk_widget_ref (icons);
gtk_object_set_data_full (GTK_OBJECT (main_window), "icons", icons,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (icons);
gtk_icon_list_set_selection_mode(GTK_ICON_LIST(icons), GTK_SELECTION_MULTIPLE);
gtk_container_add (GTK_CONTAINER (viewport2), icons);
/*
table1 = gtk_table_new (100, 5, FALSE);
gtk_widget_ref (table1);
gtk_object_set_data_full (GTK_OBJECT (main_window), "thumbnail_table", table1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table1);
gtk_container_add (GTK_CONTAINER (viewport2), table1);
*/
status_bar = gtk_statusbar_new ();
gtk_widget_ref (status_bar);
gtk_object_set_data_full (GTK_OBJECT (main_window), "status_bar", status_bar,