eek-preview.cpp revision a1b28d52ac43223194b105f3e32e33c1f54fa129
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Eek Preview Stuffs.
*
* The Initial Developer of the Original Code is
* Jon A. Cruz.
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "eek-preview.h"
#define PRIME_BUTTON_MAGIC_NUMBER 1
#define FOCUS_PROP_ID 1
/* Keep in sycn with last value in eek-preview.h */
#define PREVIEW_SIZE_LAST PREVIEW_SIZE_HUGE
#define PREVIEW_MAX_RATIO 500
static GtkWidgetClass* parent_class = 0;
{
}
{
}
}
GType eek_preview_get_type(void)
{
static GType preview_type = 0;
if (!preview_type) {
static const GTypeInfo preview_info = {
sizeof( EekPreviewClass ),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof( EekPreview ),
0, /* n_preallocs */
NULL /* value_table */
};
preview_type = g_type_register_static( GTK_TYPE_DRAWING_AREA, "EekPreview", &preview_info, (GTypeFlags)0 );
}
return preview_type;
}
{
guint i = 0;
for ( i = 0; i < count; ++i ) {
if ( worked ) {
}
}
}
}
for ( i = 0; i < G_N_ELEMENTS(sizeThings); ++i ) {
}
}
{
if ( !setupDone ) {
GtkIconSize sizes[] = {
};
}
width *= 3;
}
if ( width < 0 ) {
width = 1;
}
}
}
enum {
};
{
/* g_message("Exposed!!! %s", gtk_widget_has_focus(widget) ? "XXX" : "---" ); */
(void)event;
/*
gint lower = widget->allocation.width;
lower = (widget->allocation.height < lower) ? widget->allocation.height : lower;
if ( lower > 16 ) {
insetX++;
if ( lower > 18 ) {
insetX++;
if ( lower > 22 ) {
insetX++;
if ( lower > 24 ) {
insetX++;
if ( lower > 32 ) {
insetX++;
}
}
}
}
insetY = insetX;
}
*/
if ( gtk_widget_is_drawable( widget ) ) {
NULL,
NULL,
0, 0,
}
if ( preview->_previewPixbuf ) {
}
}
}
/* Draw arrow */
GdkRectangle possible = {insetX, insetY, (allocation.width - (insetX * 2)), (allocation.height - (insetY * 2)) };
/* Make it square */
/* Center it horizontally */
}
NULL, /* clip area. &area, */
widget, /* may be NULL */
NULL, /* detail */
);
}
}
NULL, /* clip area. &area, */
widget, /* may be NULL */
NULL, /* detail */
);
}
}
NULL, /* clip area. &area, */
widget, /* may be NULL */
NULL, /* detail */
);
}
area.y,
}
NULL,
NULL,
}
area.y,
}
NULL,
NULL,
}
}
if ( gtk_widget_has_focus(widget) ) {
NULL, /* GdkRectangle *area, */
NULL,
0 + 1, 0 + 1,
}
}
return FALSE;
}
{
}
return FALSE;
}
{
}
return FALSE;
}
/*
static gboolean eek_preview_focus_in_event( GtkWidget* widget, GdkEventFocus* event )
{
g_message("focus IN");
gboolean blip = parent_class->focus_in_event ? parent_class->focus_in_event(widget, event) : FALSE;
return blip;
}
static gboolean eek_preview_focus_out_event( GtkWidget* widget, GdkEventFocus* event )
{
g_message("focus OUT");
gboolean blip = parent_class->focus_out_event ? parent_class->focus_out_event(widget, event) : FALSE;
return blip;
}
*/
{
}
}
}
}
return FALSE;
}
{
if ( isAlt ) {
} else {
}
}
}
return FALSE;
}
{
(void)widget;
(void)event;
g_message("TICK");
return FALSE;
}
{
(void)widget;
(void)event;
g_message("tock");
return FALSE;
}
{
switch ( property_id ) {
case FOCUS_PROP_ID:
{
}
break;
default:
{
if ( gobjClass->get_property ) {
}
}
}
}
{
switch ( property_id ) {
case FOCUS_PROP_ID:
{
}
}
break;
default:
{
if ( gobjClass->set_property ) {
}
}
}
}
{
/* g_message("Do the popup!"); */
return blip;
}
{
/*GtkObjectClass* objectClass = (GtkObjectClass*)klass;*/
/*objectClass->destroy = eek_preview_destroy;*/
/*widgetClass->map = ;*/
/*widgetClass->unmap = ;*/
/*widgetClass->realize = ;*/
/*widgetClass->unrealize = ;*/
/*widgetClass->size_allocate = ;*/
/*widgetClass->state_changed = ;*/
/*widgetClass->style_set = ;*/
/*widgetClass->grab_notify = ;*/
/*widgetClass->delete_event = ;*/
/*widgetClass->destroy_event = ;*/
/* widgetClass->key_press_event = eek_preview_key_press_event; */
/* widgetClass->key_release_event = eek_preview_key_release_event; */
/*widgetClass->configure_event = ;*/
/*widgetClass->focus_in_event = eek_preview_focus_in_event;*/
/*widgetClass->focus_out_event = eek_preview_focus_out_event;*/
/* selection */
/*widgetClass->selection_get = ;*/
/*widgetClass->selection_received = ;*/
/* drag source: */
/*widgetClass->drag_begin = ;*/
/*widgetClass->drag_end = ;*/
/*widgetClass->drag_data_get = ;*/
/*widgetClass->drag_data_delete = ;*/
/* drag target: */
/*widgetClass->drag_leave = ;*/
/*widgetClass->drag_motion = ;*/
/*widgetClass->drag_drop = ;*/
/*widgetClass->drag_data_received = ;*/
/* For keybindings: */
/*widgetClass->show_help = ;*/
/* Accessibility support: */
/*widgetClass->get_accessible = ;*/
/*widgetClass->screen_changed = ;*/
/*widgetClass->can_activate_accel = ;*/
g_signal_new( "clicked",
g_signal_new( "alt-clicked",
1, G_TYPE_INT );
"focus-on-click",
NULL,
"flag to grab focus when clicked",
TRUE,
)
);
}
{
}
}
{
}
{
return preview->_takesFocus;
}
{
}
}
void eek_preview_set_details( EekPreview* preview, PreviewStyle prevstyle, ViewType view, PreviewSize size, guint ratio )
{
if ( size > PREVIEW_SIZE_LAST ) {
}
if ( ratio > PREVIEW_MAX_RATIO ) {
}
}
{
/* gtk_widget_add_events( widg, GDK_ALL_EVENTS_MASK );*/
preview->_previewPixbuf = 0;
/*
GdkColor color = {0};
color.red = (255 << 8) | 255;
GdkColor whack = {0};
whack.green = (255 << 8) | 255;
gtk_widget_modify_bg( widg, GTK_STATE_NORMAL, &color );
gtk_widget_modify_bg( widg, GTK_STATE_PRELIGHT, &whack );
*/
/* GTK_STATE_ACTIVE, */
/* GTK_STATE_PRELIGHT, */
/* GTK_STATE_SELECTED, */
/* GTK_STATE_INSENSITIVE */
if ( 0 ) {
}
}
GtkWidget* eek_preview_new(void)
{
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :