/* 
 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; version 2 of the
 * License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301  USA
 */
#include "tut_stdafx.h"

#include "../stub_view.h"

namespace mforms { namespace stub {


ViewImpl::ViewImpl(::mforms::View *view)
  : ObjectImpl(view)
{}

void __stdcall ViewImpl::show(::mforms::View *self, bool show)
{
}

bool __stdcall ViewImpl::is_shown(::mforms::View *self)
{
  return false;
}


void __stdcall ViewImpl::set_tooltip(::mforms::View *self, const std::string &text)
{
}


int __stdcall ViewImpl::get_width(::mforms::View *self)
{
  return 0;
}

int __stdcall ViewImpl::get_height(::mforms::View *self)
{
  return 0;
}

int __stdcall ViewImpl::get_preferred_width(::mforms::View *self)
{
  return 0;
}

int ViewImpl::get_preferred_width()
{
  return 0;
}

int __stdcall ViewImpl::get_preferred_height(::mforms::View *self)
{
  return 0;
}

int ViewImpl::get_preferred_height()
{
  return 0;
}

int __stdcall ViewImpl::get_x(::mforms::View *self)
{
  return 0;
}

int __stdcall ViewImpl::get_y(::mforms::View *self)
{
  return 0;
}

void __stdcall ViewImpl::set_size(::mforms::View *self, int w, int h)
{
}

void ViewImpl::set_size(int width, int height)
{
}

void __stdcall ViewImpl::set_position(::mforms::View *self, int x, int y)
{
}

void __stdcall ViewImpl::set_enabled(::mforms::View *self, bool flag)
{
}


void ViewImpl::set_name(::mforms::View *view, const std::string &name)
{
}

void ViewImpl::relayout(::mforms::View *view)
{
  // noop
}

void ViewImpl::set_needs_repaint(::mforms::View *view)
{
}


void ViewImpl::size_changed()
{
}

void ViewImpl::setup()
{
}


void ViewImpl::move_child(ViewImpl *child, int x, int y)
{
}

void __stdcall ViewImpl::set_front_color(::mforms::View *self, const std::string &color)
{
}

void __stdcall ViewImpl::set_back_color(::mforms::View *self, const std::string &color)
{
}

void __stdcall ViewImpl::set_back_image(::mforms::View *self, const std::string &path, mforms::ImageLayout layout)
{
}
  
void __stdcall ViewImpl::destroy(View *self)
{
}

void __stdcall ViewImpl::set_padding(View *self, int left, int top, int right, int bottom)
{
}

void __stdcall ViewImpl::client_to_screen(View *self,int& x, int& y)
{
}

  
void ViewImpl::init()
{
  ::mforms::ControlFactory *f= ::mforms::ControlFactory::get_instance();

  f->_view_impl.get_width            = &ViewImpl::get_width;
  f->_view_impl.get_height           = &ViewImpl::get_height;
  f->_view_impl.get_preferred_width  = &ViewImpl::get_preferred_width;
  f->_view_impl.get_preferred_height = &ViewImpl::get_preferred_height;
  f->_view_impl.set_size             = &ViewImpl::set_size;

  f->_view_impl.get_x                = &ViewImpl::get_x;
  f->_view_impl.get_y                = &ViewImpl::get_y;
  f->_view_impl.set_position         = &ViewImpl::set_position;

  f->_view_impl.show                 = &ViewImpl::show;
  f->_view_impl.is_shown             = &ViewImpl::is_shown;

  f->_view_impl.set_tooltip          = &ViewImpl::set_tooltip;
  f->_view_impl.set_name             = &ViewImpl::set_name;

  f->_view_impl.set_enabled          = &ViewImpl::set_enabled;
  f->_view_impl.relayout             = &ViewImpl::relayout;
  f->_view_impl.set_front_color      = &ViewImpl::set_front_color;
  f->_view_impl.set_back_color       = &ViewImpl::set_back_color;
  f->_view_impl.set_back_image       = &ViewImpl::set_back_image;

  f->_view_impl.set_needs_repaint    = &ViewImpl::set_needs_repaint;
  
  f->_view_impl.destroy              = &ViewImpl::destroy;
  f->_view_impl.set_padding          = &ViewImpl::set_padding;
  f->_view_impl.client_to_screen     = &ViewImpl::client_to_screen;
};

};
};
