Permalink
Browse files

Pho 0.9.6-pre1, 2008-08-11:

  Add Keyword mode. Add slideshow mode. Swap -f and -F.
  Add PHO_REMOTE environment variable.
  Lots of performance and stability work.
  • Loading branch information...
1 parent 7e359f4 commit 8b2af423d0f0e33445042937fd647a509b2992e7 @akkana committed Jan 12, 2010
Showing with 1,553 additions and 546 deletions.
  1. +83 −0 ChangeLog
  2. +6 −6 Makefile
  3. +60 −7 TODO
  4. +0 −5 debian/changelog
  5. +1 −1 debian/control
  6. +2 −2 debian/copyright
  7. +1 −1 debian/files
  8. +1 −1 debian/pho.substvars
  9. +20 −3 dialogs.h
  10. +110 −0 focustest.c
  11. +126 −76 gdialogs.c
  12. +400 −227 gmain.c
  13. +25 −34 imagenote.c
  14. +258 −0 keydialog.c
  15. +29 −14 pho.1
  16. +299 −124 pho.c
  17. +52 −18 pho.h
  18. +80 −27 pho.html
View
@@ -0,0 +1,83 @@
+N/N/2007, Pho 0.9.6-pre1:
+ Add new Keywords mode and keywords dialog.
+ Add stay-on-top code for prompt and keywords dialogs.
+ Clean up a lot of spurious expose events that gtk was sending,
+ in the hopes of curing the double-draws visible on slow machines.
+ (There are still some a few left, from resize events.)
+ A few minor fixes to work better with xinerama.
+
+8/6/2007, Pho 0.9.5.1:
+ Fix a buffer overflow bug on the 'g' (gimp-remote) key.
+
+3/20/2007, Pho 0.9.5:
+ No changes from pre5 except some manual and html page updates.
+
+3/5/2007, Pho 0.9.5-pre5:
+ Check for a PHO_ARGS environment variable. Add a -P argument to force non-presentation mode. Fix a few bugs with double/half size and with scaling.
+ Make note 0 work properly.
+
+7/24/2005, Pho 0.9.5-pre4:
+ Double and half size weren't working properly;
+ couldn't use arrow and spacebar to get out of the final Quit confirmation dialog (though ESC always worked).
+
+10/9/2004, Pho 0.9.5-pre3:
+ Fixed a crash bug when revisiting an image which was previously rotated.
+ Added a workaround for Metacity's evil window size handling.
+ Made the background black when in presentation mode.
+
+9/30/2004, Pho 0.9.5-pre2:
+ Fixed some bugs involving ending up at the wrong image when deleting or pressing HOME. Cleaned up handing of image list.
+ Fixed an aspect ratio problem.
+
+7/13/2004, Pho 0.9.5-pre1:
+ Rewrote the image list handling to use a linked list. Lots of associated code cleanup.
+ Port to gtk2, and build under either gtk1 or gtk2.
+ Add new "fullscreen mode" (e.g. for presentations, or for difficult window managers).
+ Various futile attempts to hang on to window focus in various window managers.
+
+9/30/2003, Pho 0.9.2:
+ Don't try to move the window unless the image size has changed (fix the annoying bug where pho wouldn't let you move windows).
+ Also fix a crash after dismissing the info dialog by clicking on the windowmanager "X".
+
+2/26/2003, Pho 0.9.1:
+ Rusty Russell: fix an off-by-one error in rotation code, reducing the need for extra memory;
+ Brian Langenberger: bracket printed filenames with quotes if they contain spaces or quote characters.
+
+1/8/2003, Pho 0.9:
+ Fix pho.spec version, and a make clean bug.
+
+12/3/2002, Pho 0.9pre2:
+ Fix a crash in the quit dialog.
+
+11/27/2002, Pho 0.9pre1:
+ Add EXIF handling, using code from jhead, by Matthias Wandel.
+
+10/18/2002, Pho 0.8:
+ Build RPM and deb; show image size in titlebar; add home key.
+
+8/13/2002, Pho 0.7:
+ Put image name in titlebar; prompt after last image before quitting; add fullscreen mode.
+
+7/28/2002, Pho 0.6.1:
+ Fixed a bug with printing a note set on the last image.
+
+7/21/2002, Pho 0.6:
+ Code cleanup, change the handling of the notes structures.
+
+7/21/2002, Pho 0.5.1:
+ Fix a bug where image rotations were wrong when going backward.
+
+7/11/2002, Pho 0.5:
+ Add delete dialog, and really delete files on disk.
+
+7/3/2002, Pho 0.4:
+ Fixed a bug with gif rotation.
+
+7/1/2002, Pho 0.3:
+ Rename yass to pho, add info dialog.
+
+6/28/2002, Yass 0.2
+ Some added features; add manual and make install target.
+
+6/24/2002, Yass 0.1:
+ First release.
View
@@ -1,16 +1,16 @@
# Makefile for pho
-VERSION = 0.9.5.1
+VERSION = 0.9.6-pre1
# Locate the gtk/gdk libraries (thanks to nev for this!)
-CFLAGS = -g -O -Wall -DVERSION='"$(VERSION)"'
+CFLAGS = -g -Wall -DVERSION='"$(VERSION)"'
G1FLAGS := $(shell gdk-pixbuf-config --cflags 2> /dev/null)
-G2FLAGS := $(shell pkg-config --cflags gdk-pixbuf-2.0 gtk+-2.0 gdk-2.0 2> /dev/null)
+G2FLAGS := $(shell pkg-config --cflags gtk+-2.0 gdk-2.0 2> /dev/null)
CFLAGS := $(CFLAGS) $(shell if test -n "${G2FLAGS}"; then echo "${G2FLAGS}"; else echo "${G1FLAGS}"; fi)
-XLIBS := $(shell pkg-config --libs gdk-pixbuf-xlib-2.0 2> /dev/null)
+XLIBS := $(shell pkg-config --libs gtk+-2.0 > /dev/null)
# GLIBS := $(shell gdk-pixbuf-config --libs)
-GLIBS := $(shell if test "${G2FLAGS}"; then pkg-config --libs gdk-pixbuf-2.0 gtk+-2.0 gdk-2.0; else gdk-pixbuf-config --libs; fi)
+GLIBS := $(shell if test "${G2FLAGS}"; then pkg-config --libs gtk+-2.0 gdk-2.0; else gdk-pixbuf-config --libs; fi)
CWD = $(shell pwd)
CWDBASE = $(shell basename `pwd`)
@@ -23,7 +23,7 @@ TARFILE = pho-$(VERSION).tar.gz
EXIFLIB = exif/libphoexif.a
-SRCS = pho.c gmain.c imagenote.c gdialogs.c
+SRCS = pho.c gmain.c imagenote.c gdialogs.c keydialog.c
OBJS = $(subst .c,.o,$(SRCS))
View
@@ -2,8 +2,64 @@ Ideas for improving pho (in no particular order).
If you have more ideas, or want to contribute to the project,
let me know!
-Coming in the next release:
-- "Keywords mode", assigning keywords to notes fields (for categorizing photos)
+QUICK FIXES before releasing 0.9.6-pre1:
+- One d toggles Deleted flag, prints at end
+- Event handler for info dialog (so you can ctrl-space, etc.) DONE
+- Comments field more greppable when printing at end. DONE
+- exif fields in info dialog not editable DONE
+
+CURRENT SUSPECTED CRITICAL BUGS:
+- Non-presentation mode: rotate horizontal to vertical.
+ Displays in left half of window but doesn't resize window.
+ (CAN'T REPRO)
+
+- Random gtk error messages on stdout (CAN'T REPRO)
+
+- keyword mode, then f, then f, then /, then rotate:
+ doesn't resize window. (CAN'T REPRO)
+
+BUGS WITH KEYWORD MODE:
+
+- shifted (capital) letters are treated like ctrl-
+ actually looks like only F and D
+ (Should be fixed now)
+
+- Show cursor in text fields in keywords dialog (gtk bug, can't fix)
+
+Regression tests:
+- make sure keywords on current image get saved when you quit.
+
+- Info dialog still doesn't init first time (maybe fixed? but find out why)
+
+- with exif rotation, ScaleImage in pho.c is passed inverted monitor sizes
+ (width passed as height and vice versa)
+ so the keywords mode check doesn't work right. Ick!
+ Wouldn't it be better to rotate the image first? Oh, but it's better
+ to scale down before rotating (for performance).
+ (I think I fixed this.)
+
+HIGH PRIORITY:
+
+- Investigate possible memory leak of PhoImage.filename.
+ Check comment (probably not a leak) at the same time.
+
+- On Mac: if the image size isn't changing, and we're not in presentation
+ mode, going to the next img doesn't actually draw the next image.
+ But only if the image size is bigger than the screen; in /2 mode
+ it works fine.
+
+- Finish Keywords mode (see bugs above)
+
+FUTURE FEATURE WORK:
+
+- Parse and write Keywords file
+
+- Change set of working images
+ - Question: what does pho print out at the end?
+ Everything from the session, probably;
+ but with full pathnames, or directory separators then single filenames?
+
+Other ideas for possible future work:
Should be relatively easy:
@@ -15,11 +71,8 @@ Slightly harder:
- Save notes to EXIF.
-- Save images at the proper rotation.
- (Should preserve EXIF, though!)
-
-Difficult:
+- Save images at the proper rotation, preserving EXIF.
-- Left mouse button pans image on screen (if image is larger than screen).
+- Use libexif
View
@@ -1,8 +1,3 @@
-pho (0.9.5.1) unstable; urgency=medium
- * Fix a buffer overflow problem calling gimp with the 'g' key.
-
- -- Akkana Peck <akkana@shallowsky.com> Mon, 4 Aug 2007 22:57:53 -0800
-
pho (0.9.5) unstable; urgency=low
* Code cleanup: rewrote the image list handling to use a linked list.
View
@@ -2,7 +2,7 @@ Source: pho
Section: x11
Priority: optional
Maintainer: Akkana Peck <akkana@shallowsky.com>
-Build-Depends: debhelper (>> 3.0.0), libgtk2.0-dev
+Build-Depends: debhelper (>> 3.0.0), libgtk2.0-dev, libgdk-pixbuf-dev (>= 0.14)
Standards-Version: 3.5.2
Package: pho
View
@@ -1,12 +1,12 @@
This package was debianized by Akkana Peck <akkana@shallowsky.com> on
Tue, 15 Oct 2002 21:49:27 -0700.
-It was downloaded from http://shallowsky.com/software/pho.html
+It was downloaded from http://www.shallowsky.com/software/pho.html
Upstream Author(s): Akkana Peck <akkana@shallowsky.com
Copyright:
-This software is copyright (c) 2002,2003,2004,2007 by Akkana Peck.
+This software is copyright (c) 2002,2003,2004 by Akkana Peck.
You are free to distribute this software under the terms of
View
@@ -1 +1 @@
-pho_0.9.5.1_i386.deb x11 optional
+pho_0.9.5_i386.deb x11 optional
@@ -1 +1 @@
-shlibs:Depends=libatk1.0-0 (>= 1.13.1), libc6 (>= 2.5-0ubuntu1), libcairo2 (>= 1.4.2), libfontconfig1 (>= 2.4.0), libglib2.0-0 (>= 2.12.9), libgtk2.0-0 (>= 2.10.3), libpango1.0-0 (>= 1.16.2), libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxfixes3 (>= 1:4.0.1), libxi6, libxinerama1, libxrandr2 (>= 2:1.2.0), libxrender1
+shlibs:Depends=libatk1.0-0 (>= 1.6.0), libc6 (>= 2.3.2.ds1-4), libglib2.0-0 (>= 2.4.6), libgtk2.0-0 (>= 2.4.4), libpango1.0-0 (>= 1.4.1)
View
@@ -9,8 +9,25 @@
extern int Prompt(char* msg, char* yesStr, char* noStr,
char* yesChars, char* noChars);
-/* Show or hide the info dialog. */
+/* Show or hide the Info dialog. */
extern void ToggleInfo();
+extern void UpdateInfoDialog();
+
+/* Show or hide the Keywords dialog. Show will also update it;
+ * Hide will update the underlying flags.
+ */
+extern void InitKeywords();
+extern void ShowKeywordsDialog();
+extern void HideKeywordsDialog();
+extern void UpdateKeywordsDialog();
+
+/* A function dialogs must call to stay on top of the image window */
+extern void KeepOnTop(GtkWidget* dialog);
+
+/* Dialogs need to know the ID of the app's current image window,
+ * so they can be transient to it.
+ */
+extern GtkWidget *gWin;
+
+#define IsVisible(dlg) (dlg && dlg->window && (GTK_WIDGET_FLAGS(dlg) & GTK_VISIBLE))
-/* Update the info dialog, e.g. when the image changes */
-void UpdateInfoDialog(PhoImage* img);
View
@@ -0,0 +1,110 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Test of focus.
+ *
+ * This program tests whether focus reverts to another window when
+ * the focused window resizes out from under the cursor.
+ * Some window managers have this bug, while others don't.
+ * It only matters when you're using pointer focus, not click-to-type.
+ *
+ * It also tests whether gtk_window_present() can take the focus
+ * for window managers that have this bug. See the call to
+ * gtk_window_present() in line 62.
+ *
+ * To test:
+ * 1. Make sure you have pointer focus set.
+ * 2. Compile, then run focustest.
+ * 3. Spacebar will toggle between portrait and landscape shaped windows.
+ * Toggle a few times to see.
+ * 4. Put your mouse in a place where it's in the window, but once
+ * the window resizes the mouse will be outside the window and
+ * in another window underneath.
+ * 5. Hit spacebar to toggle, and see if the window loses focus.
+ *
+ * If it does lose focus, then uncomment the call to gtk_window_present()
+ * (line 62) and try again. See if it's any better.
+ *
+ * Copyright 2007 by Akkana Peck.
+ * You are free to use or modify this code under the Gnu Public License.
+ *
+ * Sample compile line:
+ * cc -g -Wall -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -o focustest focustest.c -lgtk-x11-2.0 -lgdk-x11-2.0 -lX11
+ */
+
+#include <stdlib.h> /* for getenv() */
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include <gdk/gdkx.h> /* for gdk_x11_display_grab */
+
+GtkWidget *gWin = 0;
+static GtkWidget *sDrawingArea = 0;
+static gint gMonitorWidth, gMonitorHeight;
+
+gint HandleKeys(GtkWidget* widget, GdkEventKey* event)
+{
+ gint width, height;
+ switch (event->keyval)
+ {
+ case GDK_space: /* swap dimensions */
+ gdk_drawable_get_size(sDrawingArea->window, &width, &height);
+ gtk_window_resize(GTK_WINDOW(gWin), height, width);
+
+ /* The next line tries to set focus explicitly.
+ * Comment it out if you're just trying to find out
+ * whether your windowmanager has the bug.
+ */
+ //gtk_window_present(GTK_WINDOW(gWin));
+ return TRUE;
+ case GDK_q:
+ exit(0);
+ }
+ return FALSE;
+}
+
+int main(int argc, char** argv)
+{
+ gtk_init(&argc, &argv);
+
+ gMonitorWidth = gdk_screen_width();
+ gMonitorHeight = gdk_screen_height();
+
+ /* Make it possible to resize smaller as well as larger: */
+ gWin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+
+ gtk_widget_set_size_request(GTK_WIDGET(gWin), 1, 1);
+
+ /* Window manager delete */
+ gtk_signal_connect(GTK_OBJECT(gWin), "delete_event",
+ (GtkSignalFunc)exit, 0);
+
+ /* This event occurs when we call gtk_widget_destroy() on the window,
+ * or if we return FALSE in the "delete_event" callback.
+ gtk_signal_connect(GTK_OBJECT(gWin), "destroy",
+ (GtkSignalFunc)HandleDestroy, 0);
+ */
+
+ /* KeyPress events on the drawing area don't come through --
+ * they have to be on the window.
+ */
+ gtk_signal_connect(GTK_OBJECT(gWin), "key_press_event",
+ (GtkSignalFunc)HandleKeys, 0);
+
+ sDrawingArea = gtk_drawing_area_new();
+ gtk_container_add(GTK_CONTAINER(gWin), sDrawingArea);
+ gtk_widget_show(sDrawingArea);
+
+ gtk_drawing_area_size(GTK_DRAWING_AREA(sDrawingArea), 800, 600);
+ gtk_window_resize(GTK_WINDOW(gWin), 800, 600);
+
+ gtk_widget_show(gWin);
+
+ gtk_main();
+ return 0;
+}
+
Oops, something went wrong.

0 comments on commit 8b2af42

Please sign in to comment.