eek-preview.cpp revision 723b4d8bde8ce8503d1d01ee0f2e3548ec0dc88c
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
*/
/* ***** 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 ***** */
#include "eek-preview.h"
#define PRIME_BUTTON_MAGIC_NUMBER 1
#define FOCUS_PROP_ID 1
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;
}
GtkWidget* eek_preview_area_new(void)
{
return NULL;
}
{
if ( !worked ) {
width = 16;
height = 16;
}
width *= 3;
}
}
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_DRAWABLE( widget ) ) {
NULL,
NULL,
0, 0,
}
gc,
TRUE,
/* Draw arrow */
GdkRectangle possible = {insetX, insetY, (widget->allocation.width - (insetX * 2)), (widget->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 */
);
}
}
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, GtkIconSize size )
{
}
{
/* gtk_widget_add_events( widg, GDK_ALL_EVENTS_MASK );*/
/*
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)
{
}