<commit_before>#include "core/drunken_bishop.h"

#include "core/assert.h"

namespace euphoria::core
{
    template<typename T, int total_bytes>
    std::vector<u8>
    ToBytesGeneric(T hash)
    {
        auto bytes = std::vector<u8>{};
        for(int byte_index=0; byte_index<total_bytes; byte_index +=1)
        {
            const u8 byte = hash >> (((total_bytes-1)-byte_index) * 8);
            bytes.emplace_back(byte);
        }
        return bytes;
    }

    std::vector<u8>
    ToBytes(u32 hash)
    {
        return ToBytesGeneric<u32, 4>(hash);
    }

    std::vector<u8>
    ToBytes(u64 hash)
    {
        return ToBytesGeneric<u32, 8>(hash);
    }

    std::vector<int>
    ToCodes(u8 byte, bool msb_first)
    {
        auto codes = std::vector<int>{};
        for(int s=0; s<8; s+=2)
        {
            const auto b = msb_first
                ? (byte >> (6-s)) & 3
                : (byte >> s) & 3
                ;
            codes.emplace_back(b);
        }
        return codes;
    }

    std::vector<int>
    ToCodes(const std::vector<u8>& bytes, bool msb_first)
    {
        auto codes = std::vector<int>{};
        for(auto byte: bytes)
        {
            const auto cc = ToCodes(byte, msb_first);
            for(auto c: cc)
            {
                codes.emplace_back(c);
            }
        }
        return codes;
    }

    Table<int>
    DrunkenBishop
    (
        u32 hash,
        int width,
        int height,
        bool msb_first,
        int startx,
        int starty
    )
    {
        return DrunkenBishop
        (
            ToCodes(ToBytes(hash), msb_first),
            width,
            height,
            startx,
            starty
        );
    }

    Table<int>
    DrunkenBishop
    (
        u64 hash,
        int width,
        int height,
        bool msb_first,
        int startx,
        int starty
    )
    {
        return DrunkenBishop
        (
            ToCodes(ToBytes(hash), msb_first),
            width,
            height,
            startx,
            starty
        );
    }

    Table<int>
    DrunkenBishop
    (
        const std::vector<int>& codes,
        int width,
        int height,
        int startx,
        int starty
    )
    {
        auto table = Table<int>::FromWidthHeight(width, height);
        auto x = startx != -1? startx : width/2;
        auto y = starty != -1? starty : height/2;

        for(auto code: codes)
        {
            constexpr int vertical_mask = 0b10;
            constexpr int horizontal_mask = 0b01;

            const auto dy = (vertical_mask & code) ? 1 : -1;
            const auto dx = (horizontal_mask & code) ? 1 : -1;

            x = KeepWithin(table.Indices().GetXRange(), x + dx);
            y = KeepWithin(table.Indices().GetYRange(), y + dy);

            table(x, y) += 1;
        }

        return table;
    }

    std::vector<std::string>
    GetSshCharacters()
    {
        return
        {
            " ", ".", "o", "+", "=",
            "*", "B", "O", "X", "@",
            "%", "&", "#", "/", "?"
        };
    }

    std::vector<std::string>
    Collapse
    (
        const Table<int>& table,
        const std::vector<std::string> characters
    )
    {
        auto rr = std::vector<std::string>{};

        for(int y=0; y<table.GetHeight(); y+=1)
        {
            std::string r = "";
            for(int x=0; x<table.GetWidth(); x+=1)
            {
                const auto v =
                std::max
                (
                    0,
                    std::min
                    (
                        table(x,y),
                        Csizet_to_int(characters.size())
                    )
                );
                r += characters[v];
            }
            rr.emplace_back(r);
        }

        return rr;
    }

    // todo: add image collapse with palette
}

<commit_msg>added missing include<commit_after>#include "core/drunken_bishop.h"

#include "core/assert.h"

#include <algorithm>

namespace euphoria::core
{
    template<typename T, int total_bytes>
    std::vector<u8>
    ToBytesGeneric(T hash)
    {
        auto bytes = std::vector<u8>{};
        for(int byte_index=0; byte_index<total_bytes; byte_index +=1)
        {
            const u8 byte = hash >> (((total_bytes-1)-byte_index) * 8);
            bytes.emplace_back(byte);
        }
        return bytes;
    }

    std::vector<u8>
    ToBytes(u32 hash)
    {
        return ToBytesGeneric<u32, 4>(hash);
    }

    std::vector<u8>
    ToBytes(u64 hash)
    {
        return ToBytesGeneric<u32, 8>(hash);
    }

    std::vector<int>
    ToCodes(u8 byte, bool msb_first)
    {
        auto codes = std::vector<int>{};
        for(int s=0; s<8; s+=2)
        {
            const auto b = msb_first
                ? (byte >> (6-s)) & 3
                : (byte >> s) & 3
                ;
            codes.emplace_back(b);
        }
        return codes;
    }

    std::vector<int>
    ToCodes(const std::vector<u8>& bytes, bool msb_first)
    {
        auto codes = std::vector<int>{};
        for(auto byte: bytes)
        {
            const auto cc = ToCodes(byte, msb_first);
            for(auto c: cc)
            {
                codes.emplace_back(c);
            }
        }
        return codes;
    }

    Table<int>
    DrunkenBishop
    (
        u32 hash,
        int width,
        int height,
        bool msb_first,
        int startx,
        int starty
    )
    {
        return DrunkenBishop
        (
            ToCodes(ToBytes(hash), msb_first),
            width,
            height,
            startx,
            starty
        );
    }

    Table<int>
    DrunkenBishop
    (
        u64 hash,
        int width,
        int height,
        bool msb_first,
        int startx,
        int starty
    )
    {
        return DrunkenBishop
        (
            ToCodes(ToBytes(hash), msb_first),
            width,
            height,
            startx,
            starty
        );
    }

    Table<int>
    DrunkenBishop
    (
        const std::vector<int>& codes,
        int width,
        int height,
        int startx,
        int starty
    )
    {
        auto table = Table<int>::FromWidthHeight(width, height);
        auto x = startx != -1? startx : width/2;
        auto y = starty != -1? starty : height/2;

        for(auto code: codes)
        {
            constexpr int vertical_mask = 0b10;
            constexpr int horizontal_mask = 0b01;

            const auto dy = (vertical_mask & code) ? 1 : -1;
            const auto dx = (horizontal_mask & code) ? 1 : -1;

            x = KeepWithin(table.Indices().GetXRange(), x + dx);
            y = KeepWithin(table.Indices().GetYRange(), y + dy);

            table(x, y) += 1;
        }

        return table;
    }

    std::vector<std::string>
    GetSshCharacters()
    {
        return
        {
            " ", ".", "o", "+", "=",
            "*", "B", "O", "X", "@",
            "%", "&", "#", "/", "?"
        };
    }

    std::vector<std::string>
    Collapse
    (
        const Table<int>& table,
        const std::vector<std::string> characters
    )
    {
        auto rr = std::vector<std::string>{};

        for(int y=0; y<table.GetHeight(); y+=1)
        {
            std::string r = "";
            for(int x=0; x<table.GetWidth(); x+=1)
            {
                const auto v =
                std::max
                (
                    0,
                    std::min
                    (
                        table(x,y),
                        Csizet_to_int(characters.size())
                    )
                );
                r += characters[v];
            }
            rr.emplace_back(r);
        }

        return rr;
    }

    // todo: add image collapse with palette
}

<|endoftext|>


<commit_before>#include "core/generator_maze.h"

#include "core/random.h"
#include "core/draw.h"
#include "core/colors.h"

namespace generator
{
  void RecursiveBacktracker::Setup()
  {
    maze->Clear(Cell::None);

    const auto random_position = point2i {
      random->NextRange(maze->Width()),
      random->NextRange(maze->Height())
    };

    stack.push(random_position);
    maze->Value(random_position.x, random_position.y, Cell::Visited);
    visited_cells = 1;
  }

  bool RecursiveBacktracker::HasMoreWork() const
  {
    return visited_cells < maze->Width() * maze->Height();
  }

  vec2i d2o(const Dir d)
  {
    switch(d)
    {
      case Dir::South: return vec2i{0, -1};
      case Dir::North: return vec2i{0,  1};
      case Dir::West : return vec2i{-1, 0};
      case Dir::East : return vec2i{ 1, 0};
      default: return vec2i(0,0);
    }
  }

  Dir flipdir(const Dir d)
  {
    switch(d)
    {
      case Dir::North: return Dir::South;
      case Dir::South: return Dir::North;
      case Dir::East:  return Dir::West;
      case Dir::West:  return Dir::East;
      default: return Dir::North;
    }
  }

  Cell::Type dir2path(const Dir d)
  {
    switch(d)
    {
      case Dir::North: return Cell::PathNorth;
      case Dir::South: return Cell::PathSouth;
      case Dir::East:  return Cell::PathEast;
      case Dir::West:  return Cell::PathWest;
      default: return Cell::PathNorth;
    }
  }

  point2i add_step(Maze* maze, const point2i& c, Dir dir)
  {
    const auto o = d2o(dir);
    const auto np = c + o;
    maze->RefValue(np.x, np.y) |= Cell::Visited | dir2path(flipdir(dir));
    maze->RefValue(c.x, c.y) |= dir2path(dir);
    return np;
  }

  bool HasVisited(Maze* maze, const point2i& np)
  {
    return (maze->Value(np.x, np.y) & Cell::Visited) != 0;
  }

  bool CanVisitWithoutMakingLoop(Maze* maze, const point2i& np)
  {
    const auto world_size = Recti::FromWidthHeight(maze->Width()-1, maze->Height() - 1);
    return world_size.ContainsInclusive(np) && !HasVisited(maze, np);
  }

  void RecursiveBacktracker::Work()
  {
    const auto c = stack.top();
    std::vector<Dir> neighbours;
    auto add_neighbour = [&](Dir d) {
      const auto np = c + d2o(d);
      if(CanVisitWithoutMakingLoop(maze, np))
      {
        neighbours.push_back(d);
      }
    };
    add_neighbour(Dir::North);
    add_neighbour(Dir::South);
    add_neighbour(Dir::East);
    add_neighbour(Dir::West);

    if(neighbours.empty())
    {
      stack.pop();
    }
    else
    {
      const Dir dir = random->Next(neighbours);
      auto np = add_step(maze, c, dir);
      stack.push(np);
      visited_cells += 1;
    }
  }

  Drawer::Drawer()
    : wall_color( Color::Black )
    , cell_color( Color::Gray )
    , cell_visited_color( Color::White )
    , unit_color ( Color::Red )
    , corridor_color ( Color::White )
  {}

  Rgbi Drawer::CalculateCellColor(int x, int y) const
  {
    const auto cell_value = maze->Value(x,y);

    if(tracker && tracker->HasMoreWork() && !tracker->stack.empty())
    {
      const auto t = tracker->stack.top();
      if(x == t.x && y == t.y)
      {
        return unit_color;
      }
    }

    if( cell_value & Cell::Visited )
    {
      return cell_visited_color;
    }
    else
    {
      return cell_color;
    }
  }

  void Drawer::Draw()
  {
    const auto path_size = cell_size + wall_size;

    image.SetupNoAlphaSupport(
        wall_size + maze->Width()*path_size,
        wall_size + maze->Height() * path_size);

    auto draw = ::Draw{&image};
    draw.Clear(wall_color);

    for(unsigned int x=0; x<maze->Width(); x+=1)
    {
      for(unsigned int y=0; y<maze->Height(); y+=1)
      {
        const auto px = wall_size + x * path_size;
        const auto py = wall_size + y * path_size + cell_size - 1;

        draw.Square(CalculateCellColor(x, y), px, py, cell_size);

        const auto xywh = [](int x, int y, int w, int h)
        {
          return Recti::FromTopLeftWidthHeight(y+1,x,w,h);
        };

        const auto cell_value = maze->Value(x,y);

        if(cell_value & Cell::PathSouth)
        {
          draw.Rect(corridor_color, xywh(px, py-cell_size, cell_size, wall_size));
        }
        if(cell_value & Cell::PathEast)
        {
          draw.Rect(corridor_color, xywh(px+cell_size, py, wall_size, cell_size));
        }
      }
    }
  }
}

<commit_msg>refactor: better local function names<commit_after>#include "core/generator_maze.h"

#include "core/random.h"
#include "core/draw.h"
#include "core/colors.h"

namespace generator
{
  void RecursiveBacktracker::Setup()
  {
    maze->Clear(Cell::None);

    const auto random_position = point2i {
      random->NextRange(maze->Width()),
      random->NextRange(maze->Height())
    };

    stack.push(random_position);
    maze->Value(random_position.x, random_position.y, Cell::Visited);
    visited_cells = 1;
  }

  bool RecursiveBacktracker::HasMoreWork() const
  {
    return visited_cells < maze->Width() * maze->Height();
  }

  vec2i DirectionToOffset(const Dir d)
  {
    switch(d)
    {
      case Dir::South: return vec2i{0, -1};
      case Dir::North: return vec2i{0,  1};
      case Dir::West : return vec2i{-1, 0};
      case Dir::East : return vec2i{ 1, 0};
      default: return vec2i(0,0);
    }
  }

  Dir FlipDirection(const Dir d)
  {
    switch(d)
    {
      case Dir::North: return Dir::South;
      case Dir::South: return Dir::North;
      case Dir::East:  return Dir::West;
      case Dir::West:  return Dir::East;
      default: return Dir::North;
    }
  }

  Cell::Type DirToCellPath(const Dir d)
  {
    switch(d)
    {
      case Dir::North: return Cell::PathNorth;
      case Dir::South: return Cell::PathSouth;
      case Dir::East:  return Cell::PathEast;
      case Dir::West:  return Cell::PathWest;
      default: return Cell::PathNorth;
    }
  }

  point2i AddStepToMaze(Maze* maze, const point2i& c, Dir dir)
  {
    const auto o = DirectionToOffset(dir);
    const auto np = c + o;
    maze->RefValue(np.x, np.y) |= Cell::Visited | DirToCellPath(FlipDirection(dir));
    maze->RefValue(c.x, c.y) |= DirToCellPath(dir);
    return np;
  }

  bool HasVisited(Maze* maze, const point2i& np)
  {
    return (maze->Value(np.x, np.y) & Cell::Visited) != 0;
  }

  bool CanVisitWithoutMakingLoop(Maze* maze, const point2i& np)
  {
    const auto world_size = Recti::FromWidthHeight(maze->Width()-1, maze->Height() - 1);
    return world_size.ContainsInclusive(np) && !HasVisited(maze, np);
  }

  void RecursiveBacktracker::Work()
  {
    const auto c = stack.top();
    std::vector<Dir> neighbours;
    auto add_neighbour = [&](Dir d) {
      const auto np = c + DirectionToOffset(d);
      if(CanVisitWithoutMakingLoop(maze, np))
      {
        neighbours.push_back(d);
      }
    };
    add_neighbour(Dir::North);
    add_neighbour(Dir::South);
    add_neighbour(Dir::East);
    add_neighbour(Dir::West);

    if(neighbours.empty())
    {
      stack.pop();
    }
    else
    {
      const Dir dir = random->Next(neighbours);
      auto np = AddStepToMaze(maze, c, dir);
      stack.push(np);
      visited_cells += 1;
    }
  }

  Drawer::Drawer()
    : wall_color( Color::Black )
    , cell_color( Color::Gray )
    , cell_visited_color( Color::White )
    , unit_color ( Color::Red )
    , corridor_color ( Color::White )
  {}

  Rgbi Drawer::CalculateCellColor(int x, int y) const
  {
    const auto cell_value = maze->Value(x,y);

    if(tracker && tracker->HasMoreWork() && !tracker->stack.empty())
    {
      const auto t = tracker->stack.top();
      if(x == t.x && y == t.y)
      {
        return unit_color;
      }
    }

    if( cell_value & Cell::Visited )
    {
      return cell_visited_color;
    }
    else
    {
      return cell_color;
    }
  }

  void Drawer::Draw()
  {
    const auto path_size = cell_size + wall_size;

    image.SetupNoAlphaSupport(
        wall_size + maze->Width()*path_size,
        wall_size + maze->Height() * path_size);

    auto draw = ::Draw{&image};
    draw.Clear(wall_color);

    for(unsigned int x=0; x<maze->Width(); x+=1)
    {
      for(unsigned int y=0; y<maze->Height(); y+=1)
      {
        const auto px = wall_size + x * path_size;
        const auto py = wall_size + y * path_size + cell_size - 1;

        draw.Square(CalculateCellColor(x, y), px, py, cell_size);

        const auto xywh = [](int x, int y, int w, int h)
        {
          return Recti::FromTopLeftWidthHeight(y+1,x,w,h);
        };

        const auto cell_value = maze->Value(x,y);

        if(cell_value & Cell::PathSouth)
        {
          draw.Rect(corridor_color, xywh(px, py-cell_size, cell_size, wall_size));
        }
        if(cell_value & Cell::PathEast)
        {
          draw.Rect(corridor_color, xywh(px+cell_size, py, wall_size, cell_size));
        }
      }
    }
  }
}

<|endoftext|>


<commit_before>/*
 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

// CLASS HEADER
#include <dali-toolkit/internal/text/clipping/text-clipper.h>

// EXTERNAL INCLUDES
#include <algorithm>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/integration-api/debug.h>

namespace
{

// Currently on desktop machines 2k x 2k is the maximum frame buffer size, on target is 4k x 4k.
const float MAX_OFFSCREEN_RENDERING_SIZE = 2048.f;

} // namespace

namespace Dali
{

namespace Toolkit
{

namespace Text
{

ClipperPtr Clipper::New( const Vector2& size )
{
  ClipperPtr clipper( new Clipper() );

  // Second-phase init
  clipper->Initialize( size );

  return clipper;
}

Actor Clipper::GetRootActor() const
{
  return mOffscreenRootActor;
}

ImageActor Clipper::GetImageActor() const
{
  return mImageActor;
}

void Clipper::Refresh( const Vector2& size )
{
  const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
                            std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );

  const bool sizeChanged = offscreenSize != mCurrentOffscreenSize;

  if( sizeChanged )
  {
    // Reconfigure camera for current size.
    mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );

    // Recreate frame buffer for offscreen rendering when the size changes.
    FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
                                                               offscreenSize.height,
                                                               Pixel::RGBA8888 );
    mImageActor.SetImage( frameBufferImage );
    mRenderTask.SetTargetFrameBuffer( frameBufferImage );

    // Stores current size to avoid create new Dali resources if text changes.
    mCurrentOffscreenSize = offscreenSize;
  }

  mRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
}

void Clipper::Initialize( const Vector2& size )
{
  const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
                            std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );

  // Create a root actor and an image actor for offscreen rendering.
  mOffscreenRootActor = Layer::New();
  mOffscreenRootActor.SetColorMode( USE_OWN_COLOR );
  mOffscreenRootActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION );
  mOffscreenRootActor.SetInheritRotation( false );
  mOffscreenRootActor.SetInheritScale( false );
  mOffscreenRootActor.SetDepthTestDisabled( true );
  mOffscreenRootActor.SetSize( offscreenSize );
  mOffscreenRootActor.SetPosition( 0.0f, 0.0f, 0.0f );

  mImageActor = ImageActor::New();
  mImageActor.SetAnchorPoint( ParentOrigin::CENTER );
  mImageActor.SetParentOrigin( ParentOrigin::CENTER );
  mImageActor.SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
                            BlendingFactor::ONE, BlendingFactor::ONE );
  mImageActor.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
  mImageActor.SetSize( offscreenSize );

  // Creates a new camera actor.
  mOffscreenCameraActor = CameraActor::New();
  mOffscreenCameraActor.SetParentOrigin( ParentOrigin::CENTER );
  mOffscreenCameraActor.SetAnchorPoint( AnchorPoint::CENTER );
  mOffscreenCameraActor.SetRotation(Degree(180.f), Vector3::YAXIS);
  mOffscreenCameraActor.SetType( Dali::Camera::FREE_LOOK ); // Inherits position from the offscreen root actor.
  mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );
  mOffscreenRootActor.Add( mOffscreenCameraActor ); // camera to shoot the offscreen text

  // Creates a new render task.
  mRenderTask = Stage::GetCurrent().GetRenderTaskList().CreateTask();
  mRenderTask.SetSourceActor( mOffscreenRootActor );
  mRenderTask.SetInputEnabled( false );
  mRenderTask.SetClearColor( Color::TRANSPARENT );
  mRenderTask.SetClearEnabled( true );
  mRenderTask.SetExclusive( true );
  mRenderTask.SetCameraActor( mOffscreenCameraActor );

  // Creates a frame buffer for offscreen rendering
  FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
                                                             offscreenSize.height,
                                                             Pixel::RGBA8888 );
  mImageActor.SetImage( frameBufferImage );
  mRenderTask.SetTargetFrameBuffer( frameBufferImage );

  // Stores current size to avoid create new Dali resources if text changes.
  mCurrentOffscreenSize = offscreenSize;
}

Clipper::Clipper()
{
}

Clipper::~Clipper()
{
  if( Stage::IsInstalled() )
  {
    UnparentAndReset( mOffscreenRootActor );
    UnparentAndReset( mImageActor );

    Stage::GetCurrent().GetRenderTaskList().RemoveTask( mRenderTask );
  }
}

} // namespace Text

} // namespace Toolkit

} // namespace Dali
<commit_msg>Removed some pointless setters<commit_after>/*
 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

// CLASS HEADER
#include <dali-toolkit/internal/text/clipping/text-clipper.h>

// EXTERNAL INCLUDES
#include <algorithm>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/integration-api/debug.h>

namespace
{

// Currently on desktop machines 2k x 2k is the maximum frame buffer size, on target is 4k x 4k.
const float MAX_OFFSCREEN_RENDERING_SIZE = 2048.f;

} // namespace

namespace Dali
{

namespace Toolkit
{

namespace Text
{

ClipperPtr Clipper::New( const Vector2& size )
{
  ClipperPtr clipper( new Clipper() );

  // Second-phase init
  clipper->Initialize( size );

  return clipper;
}

Actor Clipper::GetRootActor() const
{
  return mOffscreenRootActor;
}

ImageActor Clipper::GetImageActor() const
{
  return mImageActor;
}

void Clipper::Refresh( const Vector2& size )
{
  const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
                            std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );

  const bool sizeChanged = offscreenSize != mCurrentOffscreenSize;

  if( sizeChanged )
  {
    // Reconfigure camera for current size.
    mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );

    // Recreate frame buffer for offscreen rendering when the size changes.
    FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
                                                               offscreenSize.height,
                                                               Pixel::RGBA8888 );
    mImageActor.SetImage( frameBufferImage );
    mRenderTask.SetTargetFrameBuffer( frameBufferImage );

    // Stores current size to avoid create new Dali resources if text changes.
    mCurrentOffscreenSize = offscreenSize;
  }

  mRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
}

void Clipper::Initialize( const Vector2& size )
{
  const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
                            std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );

  // Create a root actor and an image actor for offscreen rendering.
  mOffscreenRootActor = Layer::New();
  mOffscreenRootActor.SetColorMode( USE_OWN_COLOR );
  mOffscreenRootActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION );
  mOffscreenRootActor.SetInheritRotation( false );
  mOffscreenRootActor.SetInheritScale( false );
  mOffscreenRootActor.SetDepthTestDisabled( true );
  mOffscreenRootActor.SetSize( offscreenSize );

  mImageActor = ImageActor::New();
  mImageActor.SetParentOrigin( ParentOrigin::CENTER );
  mImageActor.SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
                            BlendingFactor::ONE, BlendingFactor::ONE );
  mImageActor.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
  mImageActor.SetSize( offscreenSize );

  // Creates a new camera actor.
  mOffscreenCameraActor = CameraActor::New();
  mOffscreenCameraActor.SetParentOrigin( ParentOrigin::CENTER );
  mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );
  mOffscreenRootActor.Add( mOffscreenCameraActor ); // camera to shoot the offscreen text

  // Creates a new render task.
  mRenderTask = Stage::GetCurrent().GetRenderTaskList().CreateTask();
  mRenderTask.SetSourceActor( mOffscreenRootActor );
  mRenderTask.SetClearColor( Color::TRANSPARENT );
  mRenderTask.SetClearEnabled( true );
  mRenderTask.SetExclusive( true );
  mRenderTask.SetCameraActor( mOffscreenCameraActor );

  // Creates a frame buffer for offscreen rendering
  FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
                                                             offscreenSize.height,
                                                             Pixel::RGBA8888 );
  mImageActor.SetImage( frameBufferImage );
  mRenderTask.SetTargetFrameBuffer( frameBufferImage );

  // Stores current size to avoid create new Dali resources if text changes.
  mCurrentOffscreenSize = offscreenSize;
}

Clipper::Clipper()
{
}

Clipper::~Clipper()
{
  if( Stage::IsInstalled() )
  {
    UnparentAndReset( mOffscreenRootActor );
    UnparentAndReset( mImageActor );

    Stage::GetCurrent().GetRenderTaskList().RemoveTask( mRenderTask );
  }
}

} // namespace Text

} // namespace Toolkit

} // namespace Dali
<|endoftext|>


<commit_before>#include "gtest/gtest.h"
#include "cpp/ylikuutio/common/any_value.hpp"
#include "cpp/ylikuutio/callback/callback_engine.hpp"
#include "cpp/ylikuutio/callback/callback_object.hpp"
#include "cpp/ylikuutio/callback/callback_parameter.hpp"
#include "cpp/ylikuutio/hierarchy/hierarchy_templates.hpp"

// Include standard headers
#include <stdint.h> // uint32_t etc.
#include <string>   // std::string
#include <iostream> // std::cout, std::cin, std::cerr

AnyValue square(std::vector<callback_system::CallbackParameter*> input_parameters)
{
    if (input_parameters.size() != 1)
    {
        std::cout << "The size of input_parameter is " << input_parameters.size() << "\n";
        return AnyValue();
    }

    AnyValue any_value = input_parameters.at(0);

    if (any_value.type == datatypes::INT32_T)
    {
        int32_t factor = any_value.int32_t_value;
        int32_t squared = factor * factor;
        std::cout << "Square of " << factor << " is " << squared << ".\n";
        return AnyValue(squared);
    }
    std::cout << "The datatype of any_value.type is " << any_value.type << "\n";
    return AnyValue();
}

TEST(callback_engine_must_be_function_properly, three_squared_equals_nine)
{
    callback_system::CallbackEngine* callback_engine = new callback_system::CallbackEngine();

    InputParametersToAnyValueCallback square_callback = □
    callback_system::CallbackObject* callback_object = new callback_system::CallbackObject(square_callback, callback_engine);

    std::string parameter_name = "foo";
    int32_t three = 3;
    AnyValue three_value = AnyValue(three);

    bool is_reference_3 = false;
    callback_system::CallbackParameter* callback_parameter_3 = new callback_system::CallbackParameter(parameter_name, three, is_reference_3, callback_object);

    AnyValue result = callback_engine->execute();
    ASSERT_EQ(result.type, datatypes::INT32_T);
    ASSERT_EQ(result.int32_t_value, 9);

    delete callback_engine;
}
<commit_msg>Bugfix to `AnyValue square`.<commit_after>#include "gtest/gtest.h"
#include "cpp/ylikuutio/common/any_value.hpp"
#include "cpp/ylikuutio/callback/callback_engine.hpp"
#include "cpp/ylikuutio/callback/callback_object.hpp"
#include "cpp/ylikuutio/callback/callback_parameter.hpp"
#include "cpp/ylikuutio/hierarchy/hierarchy_templates.hpp"

// Include standard headers
#include <stdint.h> // uint32_t etc.
#include <string>   // std::string
#include <iostream> // std::cout, std::cin, std::cerr

AnyValue square(std::vector<callback_system::CallbackParameter*> input_parameters)
{
    if (input_parameters.size() != 1)
    {
        std::cout << "The size of input_parameter is " << input_parameters.size() << "\n";
        return AnyValue();
    }

    AnyValue any_value = input_parameters.at(0)->get_any_value();

    if (any_value.type == datatypes::INT32_T)
    {
        int32_t factor = any_value.int32_t_value;
        int32_t squared = factor * factor;
        std::cout << "Square of " << factor << " is " << squared << ".\n";
        return AnyValue(squared);
    }
    std::cout << "The datatype of any_value.type is " << any_value.type << "\n";
    return AnyValue();
}

TEST(callback_engine_must_be_function_properly, three_squared_equals_nine)
{
    callback_system::CallbackEngine* callback_engine = new callback_system::CallbackEngine();

    InputParametersToAnyValueCallback square_callback = □
    callback_system::CallbackObject* callback_object = new callback_system::CallbackObject(square_callback, callback_engine);

    std::string parameter_name = "foo";
    int32_t three = 3;
    AnyValue three_value = AnyValue(three);

    bool is_reference_3 = false;
    callback_system::CallbackParameter* callback_parameter_3 = new callback_system::CallbackParameter(parameter_name, three, is_reference_3, callback_object);

    AnyValue result = callback_engine->execute();
    ASSERT_EQ(result.type, datatypes::INT32_T);
    ASSERT_EQ(result.int32_t_value, 9);

    delete callback_engine;
}
<|endoftext|>


<commit_before>// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
/*
 *  Copyright 2010 ZXing authors. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <zxing/common/BitArray.h>
#include <zxing/common/Array.h>
#include <cstring>

using std::vector;
using zxing::BitArray;

// VC++
using zxing::Ref;

int BitArray::makeArraySize(int size) {
    return (size + bitsPerWord-1) >> logBits;
}

BitArray::BitArray(): size(0), bits(1) {}

BitArray::BitArray(int size_)
    : size(size_), bits(makeArraySize(size)) {}

BitArray::~BitArray() {
}

int BitArray::getSize() const {
    return size;
}

int BitArray::getSizeInBytes() const
{
    return (size + 7)/8;\
}

void BitArray::setBulk(int i, int newBits) {
    bits[i >> logBits] = newBits;
}

void BitArray::clear() {
    int max = bits->size();
    for (int i = 0; i < max; i++) {
        bits[i] = 0;
    }
}

bool BitArray::isRange(int start, int end, bool value) {
    if (end < start) {
        throw IllegalArgumentException();
    }
    if (end == start) {
        return true; // empty range matches
    }
    end--; // will be easier to treat this as the last actually set bit -- inclusive
    int firstInt = start >> logBits;
    int lastInt = end >> logBits;
    for (int i = firstInt; i <= lastInt; i++) {
        int firstBit = i > firstInt ? 0 : start & bitsMask;
        int lastBit = i < lastInt ? (bitsPerWord-1) : end & bitsMask;
        int mask;
        if (firstBit == 0 && lastBit == (bitsPerWord-1)) {
            mask = -1;
        } else {
            mask = 0;
            for (int j = firstBit; j <= lastBit; j++) {
                mask |= 1 << j;
            }
        }

        // Return false if we're looking for 1s and the masked bits[i] isn't all 1s (that is,
        // equals the mask, or we're looking for 0s and the masked portion is not all 0s
        if ((bits[i] & mask) != (value ? mask : 0)) {
            return false;
        }
    }
    return true;
}

vector<int>& BitArray::getBitArray() {
    return bits->values();
}

void BitArray::reverse() {
    ArrayRef<int> newBits(bits->size());
    int size = this->size;
    for (int i = 0; i < size; i++) {
        if (get(size - i - 1)) {
            newBits[i >> logBits] |= 1 << (i & bitsMask);
        }
    }
    bits = newBits;
}

BitArray::Reverse::Reverse(Ref<BitArray> array_) : array(array_) {
    array->reverse();
}

BitArray::Reverse::~Reverse() {
    array->reverse();
}

namespace {
// N.B.: This only works for 32 bit ints ...
int numberOfTrailingZeros(int i) {
    // HD, Figure 5-14
    int y;
    if (i == 0) return 32;
    int n = 31;
    y = i <<16; if (y != 0) { n = n -16; i = y; }
    y = i << 8; if (y != 0) { n = n - 8; i = y; }
    y = i << 4; if (y != 0) { n = n - 4; i = y; }
    y = i << 2; if (y != 0) { n = n - 2; i = y; }
    return n - (((unsigned int)(i << 1)) >> 31);
}
}

int BitArray::getNextSet(int from) {
    if (from >= size) {
        return size;
    }
    int bitsOffset = from >> logBits;
    int currentBits = bits[bitsOffset];
    // mask off lesser bits first
    currentBits &= ~((1 << (from & bitsMask)) - 1);
    while (currentBits == 0) {
        if (++bitsOffset == (int)bits->size()) {
            return size;
        }
        currentBits = bits[bitsOffset];
    }
    int result = (bitsOffset << logBits) + numberOfTrailingZeros(currentBits);
    return result > size ? size : result;
}

int BitArray::getNextUnset(int from) {
    if (from >= size) {
        return size;
    }
    int bitsOffset = from >> logBits;
    int currentBits = ~bits[bitsOffset];
    // mask off lesser bits first
    currentBits &= ~((1 << (from & bitsMask)) - 1);
    while (currentBits == 0) {
        if (++bitsOffset == (int)bits->size()) {
            return size;
        }
        currentBits = ~bits[bitsOffset];
    }
    int result = (bitsOffset << logBits) + numberOfTrailingZeros(currentBits);
    return result > size ? size : result;
}

void BitArray::appendBit(bool bit)
{
    ensureCapacity(size + 1);
    if (bit) {
        bits[size / 32] |= 1 << (size & 0x1F);
    }
    size++;
}

void BitArray::appendBits(int value, int numBits)
{
    if (numBits < 0 || numBits > 32) {
        throw IllegalArgumentException("Num bits must be between 0 and 32");
    }
    ensureCapacity(size + numBits);
    for (int numBitsLeft = numBits; numBitsLeft > 0; numBitsLeft--) {
        appendBit(((value >> (numBitsLeft - 1)) & 0x01) == 1);
    }
}

void BitArray::appendBitArray(const BitArray& other)
{
    int otherSize = other.size;
    ensureCapacity(size + otherSize);
    for (int i = 0; i < otherSize; i++) {
        appendBit(other.get(i));
    }
}

void BitArray::ensureCapacity(int size)
{
    if (size > bits->size() * 32)
    {
        ArrayRef<int> newBits = makeArray(size);
        //memcpy(bits, newBits->, bits->size());
        for (size_t i=0; i<bits->size(); ++i) {
            newBits[i] = bits[i];
        }
        bits = newBits;

    }
}

void BitArray::xor_(const BitArray& other)
{
    if (bits->size() != other.bits->size()) {
        throw IllegalArgumentException("Sizes don't match");
    }
    for (int i = 0; i < bits->size(); i++) {
        // The last byte could be incomplete (i.e. not have 8 bits in
        // it) but there is no problem since 0 XOR 0 == 0.
        bits[i] ^= other.bits[i];
    }
}

void BitArray::toBytes(int bitOffset, std::vector<char>& array, int offset, int numBytes) const
{
    if(array.size() < (numBytes + offset))
        array.resize(numBytes + offset);

    for (int i = 0; i < numBytes; i++) {
        int theByte = 0;
        for (int j = 0; j < 8; j++) {
            if (get(bitOffset)) {
                theByte |= 1 << (7 - j);
            }
            bitOffset++;
        }
        array[offset + i] = (char) theByte;
    }
}
<commit_msg>Minor edit: Removed dummy character from BitArray.cpp<commit_after>// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
/*
 *  Copyright 2010 ZXing authors. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <zxing/common/BitArray.h>
#include <zxing/common/Array.h>
#include <cstring>

using std::vector;
using zxing::BitArray;

// VC++
using zxing::Ref;

int BitArray::makeArraySize(int size) {
    return (size + bitsPerWord-1) >> logBits;
}

BitArray::BitArray(): size(0), bits(1) {}

BitArray::BitArray(int size_)
    : size(size_), bits(makeArraySize(size)) {}

BitArray::~BitArray() {
}

int BitArray::getSize() const {
    return size;
}

int BitArray::getSizeInBytes() const
{
    return (size + 7)/8;
}

void BitArray::setBulk(int i, int newBits) {
    bits[i >> logBits] = newBits;
}

void BitArray::clear() {
    int max = bits->size();
    for (int i = 0; i < max; i++) {
        bits[i] = 0;
    }
}

bool BitArray::isRange(int start, int end, bool value) {
    if (end < start) {
        throw IllegalArgumentException();
    }
    if (end == start) {
        return true; // empty range matches
    }
    end--; // will be easier to treat this as the last actually set bit -- inclusive
    int firstInt = start >> logBits;
    int lastInt = end >> logBits;
    for (int i = firstInt; i <= lastInt; i++) {
        int firstBit = i > firstInt ? 0 : start & bitsMask;
        int lastBit = i < lastInt ? (bitsPerWord-1) : end & bitsMask;
        int mask;
        if (firstBit == 0 && lastBit == (bitsPerWord-1)) {
            mask = -1;
        } else {
            mask = 0;
            for (int j = firstBit; j <= lastBit; j++) {
                mask |= 1 << j;
            }
        }

        // Return false if we're looking for 1s and the masked bits[i] isn't all 1s (that is,
        // equals the mask, or we're looking for 0s and the masked portion is not all 0s
        if ((bits[i] & mask) != (value ? mask : 0)) {
            return false;
        }
    }
    return true;
}

vector<int>& BitArray::getBitArray() {
    return bits->values();
}

void BitArray::reverse() {
    ArrayRef<int> newBits(bits->size());
    int size = this->size;
    for (int i = 0; i < size; i++) {
        if (get(size - i - 1)) {
            newBits[i >> logBits] |= 1 << (i & bitsMask);
        }
    }
    bits = newBits;
}

BitArray::Reverse::Reverse(Ref<BitArray> array_) : array(array_) {
    array->reverse();
}

BitArray::Reverse::~Reverse() {
    array->reverse();
}

namespace {
// N.B.: This only works for 32 bit ints ...
int numberOfTrailingZeros(int i) {
    // HD, Figure 5-14
    int y;
    if (i == 0) return 32;
    int n = 31;
    y = i <<16; if (y != 0) { n = n -16; i = y; }
    y = i << 8; if (y != 0) { n = n - 8; i = y; }
    y = i << 4; if (y != 0) { n = n - 4; i = y; }
    y = i << 2; if (y != 0) { n = n - 2; i = y; }
    return n - (((unsigned int)(i << 1)) >> 31);
}
}

int BitArray::getNextSet(int from) {
    if (from >= size) {
        return size;
    }
    int bitsOffset = from >> logBits;
    int currentBits = bits[bitsOffset];
    // mask off lesser bits first
    currentBits &= ~((1 << (from & bitsMask)) - 1);
    while (currentBits == 0) {
        if (++bitsOffset == (int)bits->size()) {
            return size;
        }
        currentBits = bits[bitsOffset];
    }
    int result = (bitsOffset << logBits) + numberOfTrailingZeros(currentBits);
    return result > size ? size : result;
}

int BitArray::getNextUnset(int from) {
    if (from >= size) {
        return size;
    }
    int bitsOffset = from >> logBits;
    int currentBits = ~bits[bitsOffset];
    // mask off lesser bits first
    currentBits &= ~((1 << (from & bitsMask)) - 1);
    while (currentBits == 0) {
        if (++bitsOffset == (int)bits->size()) {
            return size;
        }
        currentBits = ~bits[bitsOffset];
    }
    int result = (bitsOffset << logBits) + numberOfTrailingZeros(currentBits);
    return result > size ? size : result;
}

void BitArray::appendBit(bool bit)
{
    ensureCapacity(size + 1);
    if (bit) {
        bits[size / 32] |= 1 << (size & 0x1F);
    }
    size++;
}

void BitArray::appendBits(int value, int numBits)
{
    if (numBits < 0 || numBits > 32) {
        throw IllegalArgumentException("Num bits must be between 0 and 32");
    }
    ensureCapacity(size + numBits);
    for (int numBitsLeft = numBits; numBitsLeft > 0; numBitsLeft--) {
        appendBit(((value >> (numBitsLeft - 1)) & 0x01) == 1);
    }
}

void BitArray::appendBitArray(const BitArray& other)
{
    int otherSize = other.size;
    ensureCapacity(size + otherSize);
    for (int i = 0; i < otherSize; i++) {
        appendBit(other.get(i));
    }
}

void BitArray::ensureCapacity(int size)
{
    if (size > bits->size() * 32)
    {
        ArrayRef<int> newBits = makeArray(size);
        //memcpy(bits, newBits->, bits->size());
        for (size_t i=0; i<bits->size(); ++i) {
            newBits[i] = bits[i];
        }
        bits = newBits;

    }
}

void BitArray::xor_(const BitArray& other)
{
    if (bits->size() != other.bits->size()) {
        throw IllegalArgumentException("Sizes don't match");
    }
    for (int i = 0; i < bits->size(); i++) {
        // The last byte could be incomplete (i.e. not have 8 bits in
        // it) but there is no problem since 0 XOR 0 == 0.
        bits[i] ^= other.bits[i];
    }
}

void BitArray::toBytes(int bitOffset, std::vector<char>& array, int offset, int numBytes) const
{
    if(array.size() < (numBytes + offset))
        array.resize(numBytes + offset);

    for (int i = 0; i < numBytes; i++) {
        int theByte = 0;
        for (int j = 0; j < 8; j++) {
            if (get(bitOffset)) {
                theByte |= 1 << (7 - j);
            }
            bitOffset++;
        }
        array[offset + i] = (char) theByte;
    }
}
<|endoftext|>


<commit_before>/*
   For more information, please see: http://software.sci.utah.edu

   The MIT License

   Copyright (c) 2009 Scientific Computing and Imaging Institute,
   University of Utah.

   Permission is hereby granted, free of charge, to any person obtaining a
   copy of this software and associated documentation files (the "Software"),
   to deal in the Software without restriction, including without limitation
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included
   in all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   DEALINGS IN THE SOFTWARE.
*/

#include <Modules/BrainStimulator/SimulateForwardMagneticField.h>
#include <Core/Algorithms/BrainStimulator/SimulateForwardMagneticFieldAlgorithm.h>
#include <Core/Datatypes/Legacy/Field/Field.h>
#include <Core/Algorithms/Base/AlgorithmPreconditions.h>
#include <Core/Datatypes/DenseMatrix.h>
#include <vector>

using namespace SCIRun::Modules::BrainStimulator;
using namespace SCIRun::Core::Datatypes;
using namespace SCIRun::Core::Algorithms::BrainStimulator;
using namespace SCIRun::Core::Algorithms;
using namespace SCIRun::Dataflow::Networks;

SimulateForwardMagneticFieldModule::SimulateForwardMagneticFieldModule() : Module(ModuleLookupInfo("SimulateForwardMagneticField", "BrainStimulator", "SCIRun"),false)
{
 INITIALIZE_PORT(ElectricField);
 INITIALIZE_PORT(ConductivityTensor);
 INITIALIZE_PORT(DipoleSources);
 INITIALIZE_PORT(DetectorLocations);
 INITIALIZE_PORT(MagneticField);
 INITIALIZE_PORT(MagneticFieldMagnitudes);
}

void SimulateForwardMagneticFieldModule::setStateDefaults()
{
 // setStateIntFromAlgo(SimulateForwardMagneticFieldAlgorithm::refnode());
}

void SimulateForwardMagneticFieldModule::execute()
{
  auto EField = getRequiredInput(ElectricField);
  auto CondTensor = getRequiredInput(ConductivityTensor);
  auto Dipoles = getRequiredInput(DipoleSources);
  auto Detectors = getRequiredInput(DetectorLocations);

  // obtaining electrode values from state map
 // auto elc_vals_from_state = get_state()->getValue(Parameters::ElectrodeTableValues).getList();
 // algo().set(Parameters::ELECTRODE_VALUES, elc_vals_from_state);

  if(!CondTensor)
  {
   std::cout << " xxxx "<< std::endl;
  }

  if (needToExecute())
  {
    //algo().set(SimulateForwardMagneticFieldAlgorithm::refnode(), get_state()->getValue(SimulateForwardMagneticFieldAlgorithm::refnode()).getInt());
    std::cout << " 1 "<< std::endl;
    auto output = algo().run_generic(make_input((ElectricField, EField)(ConductivityTensor, CondTensor)(DipoleSources, Dipoles)(DetectorLocations, Detectors)));

    sendOutputFromAlgorithm(MagneticField, output);
    sendOutputFromAlgorithm(MagneticFieldMagnitudes, output);
  }
}
<commit_msg>after dan's review<commit_after>/*
   For more information, please see: http://software.sci.utah.edu

   The MIT License

   Copyright (c) 2009 Scientific Computing and Imaging Institute,
   University of Utah.

   Permission is hereby granted, free of charge, to any person obtaining a
   copy of this software and associated documentation files (the "Software"),
   to deal in the Software without restriction, including without limitation
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included
   in all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   DEALINGS IN THE SOFTWARE.
*/

#include <Modules/BrainStimulator/SimulateForwardMagneticField.h>
#include <Core/Algorithms/BrainStimulator/SimulateForwardMagneticFieldAlgorithm.h>
#include <Core/Datatypes/Legacy/Field/Field.h>
#include <Core/Algorithms/Base/AlgorithmPreconditions.h>
#include <Core/Datatypes/DenseMatrix.h>
#include <vector>

using namespace SCIRun::Modules::BrainStimulator;
using namespace SCIRun::Core::Datatypes;
using namespace SCIRun::Core::Algorithms::BrainStimulator;
using namespace SCIRun::Core::Algorithms;
using namespace SCIRun::Dataflow::Networks;

SimulateForwardMagneticFieldModule::SimulateForwardMagneticFieldModule() : Module(ModuleLookupInfo("SimulateForwardMagneticField", "BrainStimulator", "SCIRun"),false)
{
 INITIALIZE_PORT(ElectricField);
 INITIALIZE_PORT(ConductivityTensor);
 INITIALIZE_PORT(DipoleSources);
 INITIALIZE_PORT(DetectorLocations);
 INITIALIZE_PORT(MagneticField);
 INITIALIZE_PORT(MagneticFieldMagnitudes);
}

void SimulateForwardMagneticFieldModule::setStateDefaults()
{

}

void SimulateForwardMagneticFieldModule::execute()
{
  auto EField = getRequiredInput(ElectricField);
  auto CondTensor = getRequiredInput(ConductivityTensor);
  auto Dipoles = getRequiredInput(DipoleSources);
  auto Detectors = getRequiredInput(DetectorLocations);

  if (needToExecute())
  {
     auto output = algo().run_generic(make_input((ElectricField, EField)(ConductivityTensor, CondTensor)(DipoleSources, Dipoles)(DetectorLocations, Detectors)));
    sendOutputFromAlgorithm(MagneticField, output);
    sendOutputFromAlgorithm(MagneticFieldMagnitudes, output);
  }
}
<|endoftext|>


<commit_before>#pragma once

#include <stdint.h>
#include <stddef.h>
#include <exception>
#include <setjmp.h>

#include <list>
#include <vector>

namespace eosio { namespace chain {

class apply_context;

namespace eosvmoc {

class code_cache_base;
class memory;
struct code_descriptor;

class executor {
   public:
      executor(const code_cache_base& cc);
      ~executor();

      void execute(const code_descriptor& code, const memory& mem, apply_context& context);

   private:
      uint8_t* code_mapping;
      size_t code_mapping_size;
      bool mapping_is_executable;

      std::exception_ptr executors_exception_ptr;
      sigjmp_buf executors_sigjmp_buf;
      std::list<std::vector<std::byte>> executors_bounce_buffers;
};

}}}
<commit_msg>add cstddef include for std:byte, possibly needed on some platforms<commit_after>#pragma once

#include <stdint.h>
#include <stddef.h>
#include <exception>
#include <setjmp.h>

#include <list>
#include <vector>
#include <cstddef>

namespace eosio { namespace chain {

class apply_context;

namespace eosvmoc {

class code_cache_base;
class memory;
struct code_descriptor;

class executor {
   public:
      executor(const code_cache_base& cc);
      ~executor();

      void execute(const code_descriptor& code, const memory& mem, apply_context& context);

   private:
      uint8_t* code_mapping;
      size_t code_mapping_size;
      bool mapping_is_executable;

      std::exception_ptr executors_exception_ptr;
      sigjmp_buf executors_sigjmp_buf;
      std::list<std::vector<std::byte>> executors_bounce_buffers;
};

}}}
<|endoftext|>


<commit_before>/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: formtoolbars.cxx,v $
 *
 *  $Revision: 1.9 $
 *
 *  last change: $Author: ihi $ $Date: 2007-04-16 16:21:44 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"

#ifndef SVX_SOURCE_INC_FORMTOOLBARS_HXX
#include "formtoolbars.hxx"
#endif

/** === begin UNO includes === **/
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
#endif
/** === end UNO includes === **/

#ifndef _SVX_SVXIDS_HRC
#include "svxids.hrc"
#endif

//........................................................................
namespace svxform
{
//........................................................................

    using namespace ::com::sun::star::uno;
    using namespace ::com::sun::star::frame;
    using namespace ::com::sun::star::beans;
    using namespace ::com::sun::star::frame;

    //====================================================================
    //= FormToolboxes
    //====================================================================
    //--------------------------------------------------------------------
    FormToolboxes::FormToolboxes( const Reference< XFrame >& _rxFrame )
    {
        // the layout manager
        Reference< XPropertySet > xFrameProps( _rxFrame, UNO_QUERY );
        if ( xFrameProps.is() )
            xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ) >>= m_xLayouter;
    }

    //--------------------------------------------------------------------
    void FormToolboxes::toggleToolbox( USHORT _nSlotId ) const
    {
        try
        {
            Reference< XLayoutManager > xManager( m_xLayouter );
            OSL_ENSURE( xManager. is(), "FormToolboxes::toggleToolbox: couldn't obtain the layout manager!" );
            if ( xManager. is() )
            {
                ::rtl::OUString sToolboxResource( getToolboxResourceName( _nSlotId ) );
                if ( xManager->isElementVisible( sToolboxResource ) )
                {
                    xManager->hideElement( sToolboxResource );
                    xManager->destroyElement( sToolboxResource );
                }
                else
                {
                    xManager->createElement( sToolboxResource );
                    xManager->showElement( sToolboxResource );
                }
            }
        }
        catch( const Exception& )
        {
            OSL_ENSURE( sal_False, "FormToolboxes::toggleToolbox: caught an exception!" );
        }
    }

    //--------------------------------------------------------------------
    bool FormToolboxes::isToolboxVisible( USHORT _nSlotId ) const
    {
        return m_xLayouter.is() && m_xLayouter->isElementVisible(
            getToolboxResourceName( _nSlotId ) );
    }

    //--------------------------------------------------------------------
    ::rtl::OUString FormToolboxes::getToolboxResourceName( USHORT _nSlotId ) const
    {
        OSL_ENSURE( ( _nSlotId == SID_FM_MORE_CONTROLS ) || ( _nSlotId == SID_FM_FORM_DESIGN_TOOLS ) || ( _nSlotId == SID_FM_CONFIG ),
            "FormToolboxes::getToolboxResourceName: unsupported slot!" );

        const sal_Char* pToolBarName = "formcontrols";
        if ( _nSlotId == SID_FM_MORE_CONTROLS )
            pToolBarName = "moreformcontrols";
        else if ( _nSlotId == SID_FM_FORM_DESIGN_TOOLS )
            pToolBarName = "formdesign";

        ::rtl::OUString aToolBarResStr( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/" ));
        aToolBarResStr += ::rtl::OUString::createFromAscii( pToolBarName );
        return aToolBarResStr;
    }

//........................................................................
} // namespace svxform
//........................................................................

<commit_msg>INTEGRATION: CWS vgbugs07 (1.9.66); FILE MERGED 2007/06/04 13:27:00 vg 1.9.66.1: #i76605# Remove -I .../inc/module hack introduced by hedaburemove01<commit_after>/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: formtoolbars.cxx,v $
 *
 *  $Revision: 1.10 $
 *
 *  last change: $Author: hr $ $Date: 2007-06-27 18:17:39 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"

#ifndef SVX_SOURCE_INC_FORMTOOLBARS_HXX
#include "formtoolbars.hxx"
#endif

/** === begin UNO includes === **/
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
#endif
/** === end UNO includes === **/

#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
#endif

//........................................................................
namespace svxform
{
//........................................................................

    using namespace ::com::sun::star::uno;
    using namespace ::com::sun::star::frame;
    using namespace ::com::sun::star::beans;
    using namespace ::com::sun::star::frame;

    //====================================================================
    //= FormToolboxes
    //====================================================================
    //--------------------------------------------------------------------
    FormToolboxes::FormToolboxes( const Reference< XFrame >& _rxFrame )
    {
        // the layout manager
        Reference< XPropertySet > xFrameProps( _rxFrame, UNO_QUERY );
        if ( xFrameProps.is() )
            xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ) >>= m_xLayouter;
    }

    //--------------------------------------------------------------------
    void FormToolboxes::toggleToolbox( USHORT _nSlotId ) const
    {
        try
        {
            Reference< XLayoutManager > xManager( m_xLayouter );
            OSL_ENSURE( xManager. is(), "FormToolboxes::toggleToolbox: couldn't obtain the layout manager!" );
            if ( xManager. is() )
            {
                ::rtl::OUString sToolboxResource( getToolboxResourceName( _nSlotId ) );
                if ( xManager->isElementVisible( sToolboxResource ) )
                {
                    xManager->hideElement( sToolboxResource );
                    xManager->destroyElement( sToolboxResource );
                }
                else
                {
                    xManager->createElement( sToolboxResource );
                    xManager->showElement( sToolboxResource );
                }
            }
        }
        catch( const Exception& )
        {
            OSL_ENSURE( sal_False, "FormToolboxes::toggleToolbox: caught an exception!" );
        }
    }

    //--------------------------------------------------------------------
    bool FormToolboxes::isToolboxVisible( USHORT _nSlotId ) const
    {
        return m_xLayouter.is() && m_xLayouter->isElementVisible(
            getToolboxResourceName( _nSlotId ) );
    }

    //--------------------------------------------------------------------
    ::rtl::OUString FormToolboxes::getToolboxResourceName( USHORT _nSlotId ) const
    {
        OSL_ENSURE( ( _nSlotId == SID_FM_MORE_CONTROLS ) || ( _nSlotId == SID_FM_FORM_DESIGN_TOOLS ) || ( _nSlotId == SID_FM_CONFIG ),
            "FormToolboxes::getToolboxResourceName: unsupported slot!" );

        const sal_Char* pToolBarName = "formcontrols";
        if ( _nSlotId == SID_FM_MORE_CONTROLS )
            pToolBarName = "moreformcontrols";
        else if ( _nSlotId == SID_FM_FORM_DESIGN_TOOLS )
            pToolBarName = "formdesign";

        ::rtl::OUString aToolBarResStr( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/" ));
        aToolBarResStr += ::rtl::OUString::createFromAscii( pToolBarName );
        return aToolBarResStr;
    }

//........................................................................
} // namespace svxform
//........................................................................

<|endoftext|>


<commit_before>/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#include <unotest/filters-test.hxx>
#include <unotest/bootstrapfixturebase.hxx>

#include <osl/file.hxx>
#include <osl/process.h>
#include <sot/storage.hxx>
#include <sot/storinfo.hxx>

using namespace ::com::sun::star;

namespace
{
    class SotTest
        : public test::FiltersTest
        , public test::BootstrapFixtureBase
    {
    public:
        SotTest() {}

        bool checkStream( const SotStorageRef &xObjStor,
                          const OUString &rStreamName,
                          sal_uLong nSize );
        bool checkStorage( const SotStorageRef &xObjStor );

        virtual bool load(const OUString &,
            const OUString &rURL, const OUString &,
            unsigned int, unsigned int, unsigned int) SAL_OVERRIDE;

        void test();

        CPPUNIT_TEST_SUITE(SotTest);
        CPPUNIT_TEST(test);
        CPPUNIT_TEST_SUITE_END();
    };

    bool SotTest::checkStream( const SotStorageRef &xObjStor,
                               const OUString &rStreamName,
                               sal_uLong nSize )
    {
        unsigned char *pData = (unsigned char*)malloc( nSize );
        sal_uLong nReadableSize = 0;
        if( !pData )
            return true;

        {   // Read the data in one block
            SotStorageStreamRef xStream( xObjStor->OpenSotStream( rStreamName ) );
            xStream->Seek(0);
            sal_uLong nRemaining = xStream->GetSize() - xStream->Tell();

            CPPUNIT_ASSERT_MESSAGE( "check size", nRemaining == nSize );
            CPPUNIT_ASSERT_MESSAGE( "check size #2", xStream->remainingSize() == nSize );

            // Read as much as we can, a corrupted FAT chain can cause real grief here
            nReadableSize = xStream->Read( (void *)pData, nSize );
//            fprintf(stderr, "readable size %d vs size %d remaining %d\n", nReadableSize, nSize, nReadableSize);
        }
        {   // Read the data backwards as well
            SotStorageStreamRef xStream( xObjStor->OpenSotStream( rStreamName ) );
            for( sal_uLong i = nReadableSize; i > 0; i-- )
            {
                CPPUNIT_ASSERT_MESSAGE( "sot reading error", !xStream->GetError() );
                unsigned char c;
                xStream->Seek( i - 1 );
                CPPUNIT_ASSERT_MESSAGE( "sot storage reading byte",
                                        xStream->Read( &c, 1 ) == 1);
                CPPUNIT_ASSERT_MESSAGE( "mismatching data storage reading byte",
                                        pData[i - 1] == c );
            }
        }

        return true;
    }

    bool SotTest::checkStorage( const SotStorageRef &xObjStor )
    {
        SvStorageInfoList aInfoList;
        xObjStor->FillInfoList( &aInfoList );

        for( SvStorageInfoList::iterator aIt = aInfoList.begin();
             aIt != aInfoList.end(); ++aIt )
        {
            if( aIt->IsStorage() )
            {
                SotStorageRef xChild( xObjStor->OpenSotStorage( aIt->GetName() ) );
                checkStorage( xChild );
            }
            else if( aIt->IsStream() )
                checkStream( xObjStor, aIt->GetName(), aIt->GetSize() );
        }

        return true;
    }

    bool SotTest::load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, unsigned int, unsigned int)
    {
        SvFileStream aStream(rURL, STREAM_READ);
        SotStorageRef xObjStor = new SotStorage(aStream);
        if (!xObjStor.Is() || xObjStor->GetError())
            return false;

        CPPUNIT_ASSERT_MESSAGE("sot storage is not valid", xObjStor->Validate());
        return checkStorage (xObjStor);
    }

    void SotTest::test()
    {
        testDir(OUString(),
            getURLFromSrc("/sot/qa/cppunit/data/"),
            OUString());
    }

    CPPUNIT_TEST_SUITE_REGISTRATION(SotTest);
}

CPPUNIT_PLUGIN_IMPLEMENT();

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<commit_msg>Fix memory leak<commit_after>/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#include <unotest/filters-test.hxx>
#include <unotest/bootstrapfixturebase.hxx>

#include <osl/file.hxx>
#include <osl/process.h>
#include <sot/storage.hxx>
#include <sot/storinfo.hxx>

using namespace ::com::sun::star;

namespace
{
    class SotTest
        : public test::FiltersTest
        , public test::BootstrapFixtureBase
    {
    public:
        SotTest() {}

        bool checkStream( const SotStorageRef &xObjStor,
                          const OUString &rStreamName,
                          sal_uLong nSize );
        bool checkStorage( const SotStorageRef &xObjStor );

        virtual bool load(const OUString &,
            const OUString &rURL, const OUString &,
            unsigned int, unsigned int, unsigned int) SAL_OVERRIDE;

        void test();

        CPPUNIT_TEST_SUITE(SotTest);
        CPPUNIT_TEST(test);
        CPPUNIT_TEST_SUITE_END();
    };

    bool SotTest::checkStream( const SotStorageRef &xObjStor,
                               const OUString &rStreamName,
                               sal_uLong nSize )
    {
        unsigned char *pData = (unsigned char*)malloc( nSize );
        sal_uLong nReadableSize = 0;
        if( !pData )
            return true;

        {   // Read the data in one block
            SotStorageStreamRef xStream( xObjStor->OpenSotStream( rStreamName ) );
            xStream->Seek(0);
            sal_uLong nRemaining = xStream->GetSize() - xStream->Tell();

            CPPUNIT_ASSERT_MESSAGE( "check size", nRemaining == nSize );
            CPPUNIT_ASSERT_MESSAGE( "check size #2", xStream->remainingSize() == nSize );

            // Read as much as we can, a corrupted FAT chain can cause real grief here
            nReadableSize = xStream->Read( (void *)pData, nSize );
//            fprintf(stderr, "readable size %d vs size %d remaining %d\n", nReadableSize, nSize, nReadableSize);
        }
        {   // Read the data backwards as well
            SotStorageStreamRef xStream( xObjStor->OpenSotStream( rStreamName ) );
            for( sal_uLong i = nReadableSize; i > 0; i-- )
            {
                CPPUNIT_ASSERT_MESSAGE( "sot reading error", !xStream->GetError() );
                unsigned char c;
                xStream->Seek( i - 1 );
                CPPUNIT_ASSERT_MESSAGE( "sot storage reading byte",
                                        xStream->Read( &c, 1 ) == 1);
                CPPUNIT_ASSERT_MESSAGE( "mismatching data storage reading byte",
                                        pData[i - 1] == c );
            }
        }
        free(pData);
        return true;
    }

    bool SotTest::checkStorage( const SotStorageRef &xObjStor )
    {
        SvStorageInfoList aInfoList;
        xObjStor->FillInfoList( &aInfoList );

        for( SvStorageInfoList::iterator aIt = aInfoList.begin();
             aIt != aInfoList.end(); ++aIt )
        {
            if( aIt->IsStorage() )
            {
                SotStorageRef xChild( xObjStor->OpenSotStorage( aIt->GetName() ) );
                checkStorage( xChild );
            }
            else if( aIt->IsStream() )
                checkStream( xObjStor, aIt->GetName(), aIt->GetSize() );
        }

        return true;
    }

    bool SotTest::load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, unsigned int, unsigned int)
    {
        SvFileStream aStream(rURL, STREAM_READ);
        SotStorageRef xObjStor = new SotStorage(aStream);
        if (!xObjStor.Is() || xObjStor->GetError())
            return false;

        CPPUNIT_ASSERT_MESSAGE("sot storage is not valid", xObjStor->Validate());
        return checkStorage (xObjStor);
    }

    void SotTest::test()
    {
        testDir(OUString(),
            getURLFromSrc("/sot/qa/cppunit/data/"),
            OUString());
    }

    CPPUNIT_TEST_SUITE_REGISTRATION(SotTest);
}

CPPUNIT_PLUGIN_IMPLEMENT();

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<|endoftext|>


<commit_before>/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: fmprop.cxx,v $
 *
 *  $Revision: 1.18 $
 *
 *  last change: $Author: hr $ $Date: 2006-06-19 15:56:22 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

#ifndef _SVX_FMPROP_HRC
#include "fmprop.hrc"
#endif

#ifndef _FM_STATIC_HXX_
#include "fmstatic.hxx"
#endif

#include <set>

namespace svxform
{
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAME,"Name");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CLASSID,"ClassId");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNT,"RowCount");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL,"IsRowCountFinal");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FETCHSIZE,"FetchSize");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE,"Value");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXT,"Text");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LABEL,"Label");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANINSERT,"CanInsert");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANUPDATE,"CanUpdate");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANDELETE,"CanDelete");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAVIGATION,"NavigationBarMode");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION,"HasNavigationBar");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CYCLE,"Cycle");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE,"DataField");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ENABLED,"Enabled");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_READONLY,"ReadOnly");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISREADONLY,"IsReadOnly");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTER_CRITERIA,"Filter");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT,"IsAutoIncrement");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATAENTRY,"DataEntry");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_WIDTH,"Width");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SEARCHABLE,"IsSearchable");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MULTILINE,"MultiLine");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TARGET_URL,"TargetURL");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL,"DefaultControl");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN,"MaxTextLen");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EDITMASK,"EditMask");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SPIN,"Spin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE,"Date");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIME,"Time");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STATE,"State");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TRISTATE,"TriState");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST,"StringItemList");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT,"DefaultText");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED,"DefaultState");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATKEY,"FormatKey");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER,"FormatsSupplier");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE,"ListSourceType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCE,"ListSource");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ,"SelectedItems");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ,"ValueItemList");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ,"DefaultSelection");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALIGN,"Align");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE,"DefaultDate");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME,"DefaultTime");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE,"DefaultValue");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY,"DecimalAccuracy");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCE,"DataSelection");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDTYPE,"Type");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REFVALUE,"RefValue");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMIN,"ValueMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMAX,"ValueMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT,"StrictFormat");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LITERALMASK,"LiteralMask");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUESTEP,"ValueStep");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP,"ShowThousandsSeparator");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL,"CurrencySymbol");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEFORMAT,"DateFormat");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMIN,"DateMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMAX,"DateMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY,"DateShowCentury");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT, "TimeFormat");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMIN, "TimeMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMAX,"TimeMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LINECOUNT,"LineCount");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN, "BoundColumn");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONT,"FontDescriptor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR,"BackgroundColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR,"TextColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BORDER,"Border");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DROPDOWN,"Dropdown");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT,"RowHeight");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPTEXT, "HelpText");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPURL, "HelpURL");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RECORDMARKER, "HasRecordMarker");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD, "BoundField");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE, "EffectiveValue");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT, "EffectiveDefault");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN, "EffectiveMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX, "EffectiveMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HIDDEN, "Hidden");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL, "UseFilterValueProposal");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE, "FieldSource");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TABLENAME, "TableName");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER, "FilterSupplier");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER, "CurrentFilter");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS, "SelectedFields");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES, "SelectedTables");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_THREADSAFE, "ThreadSafe");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISFILTERAPPLIED, "IsFilterApplied");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL, "LabelControl");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR, "CursorColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR, "AlwaysShowCursor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON, "DisplayIsSynchron");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISMODIFIED, "IsModified");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNEW, "IsNew");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_PRIVILEGES, "Privileges");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMAND,"Command");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE,"CommandType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY, "ResultSetConcurrency");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_INSERTONLY, "IgnoreResult");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE, "ResultSetType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING, "EscapeProcessing");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_APPLYFILTER, "ApplyFilter");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNULLABLE, "IsNullable");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND, "ActiveCommand");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISCURRENCY, "IsCurrency");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_URL, "URL");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION, "ActiveConnection");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SORT, "Order");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATASOURCE, "DataSourceName");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REALNAME,"RealName");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY,"DataFieldProperty");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR, "TextLineColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK, "FontEmphasisMark");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTRELIEF, "FontRelief");

    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN,             "ScrollValueMin"            );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX,             "ScrollValueMax"            );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE,         "DefaultScrollValue"        );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT,               "LineIncrement"             );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT,              "BlockIncrement"            );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_ORIENTATION,                 "Orientation"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEAT,                      "Repeat"                    );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEATDELAY,                 "RepeatDelay"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR,                 "SymbolColor"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE,                "VisibleSize"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN,               "SpinValueMin"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX,               "SpinValueMax"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE,           "DefaultSpinValue"          );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPININCREMENT,               "SpinIncrement"             );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT,               "LineEndFormat"             );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_TOGGLE,                      "Toggle"                    );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK,                "FocusOnClick"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION,       "HideInactiveSelection"     );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT,                "VisualEffect"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR,                 "BorderColor"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER,      "DynamicControlBorder"      );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS,  "ControlBorderColorOnFocus" );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE,  "ControlBorderColorOnHover" );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID,"ControlBorderColorOnInvalid" );

    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE, "ButtonType" );

}   // namespace svxform

<commit_msg>INTEGRATION: CWS pchfix02 (1.18.116); FILE MERGED 2006/09/01 17:46:51 kaib 1.18.116.1: #i68856# Added header markers and pch files<commit_after>/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: fmprop.cxx,v $
 *
 *  $Revision: 1.19 $
 *
 *  last change: $Author: obo $ $Date: 2006-09-17 05:08:26 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"

#ifndef _SVX_FMPROP_HRC
#include "fmprop.hrc"
#endif

#ifndef _FM_STATIC_HXX_
#include "fmstatic.hxx"
#endif

#include <set>

namespace svxform
{
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAME,"Name");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CLASSID,"ClassId");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNT,"RowCount");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL,"IsRowCountFinal");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FETCHSIZE,"FetchSize");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE,"Value");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXT,"Text");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LABEL,"Label");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANINSERT,"CanInsert");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANUPDATE,"CanUpdate");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANDELETE,"CanDelete");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAVIGATION,"NavigationBarMode");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION,"HasNavigationBar");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CYCLE,"Cycle");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE,"DataField");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ENABLED,"Enabled");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_READONLY,"ReadOnly");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISREADONLY,"IsReadOnly");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTER_CRITERIA,"Filter");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT,"IsAutoIncrement");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATAENTRY,"DataEntry");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_WIDTH,"Width");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SEARCHABLE,"IsSearchable");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MULTILINE,"MultiLine");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TARGET_URL,"TargetURL");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL,"DefaultControl");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN,"MaxTextLen");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EDITMASK,"EditMask");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SPIN,"Spin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE,"Date");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIME,"Time");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STATE,"State");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TRISTATE,"TriState");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST,"StringItemList");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT,"DefaultText");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED,"DefaultState");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATKEY,"FormatKey");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER,"FormatsSupplier");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE,"ListSourceType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCE,"ListSource");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ,"SelectedItems");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ,"ValueItemList");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ,"DefaultSelection");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALIGN,"Align");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE,"DefaultDate");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME,"DefaultTime");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE,"DefaultValue");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY,"DecimalAccuracy");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCE,"DataSelection");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDTYPE,"Type");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REFVALUE,"RefValue");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMIN,"ValueMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMAX,"ValueMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT,"StrictFormat");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LITERALMASK,"LiteralMask");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUESTEP,"ValueStep");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP,"ShowThousandsSeparator");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL,"CurrencySymbol");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEFORMAT,"DateFormat");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMIN,"DateMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMAX,"DateMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY,"DateShowCentury");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT, "TimeFormat");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMIN, "TimeMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMAX,"TimeMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LINECOUNT,"LineCount");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN, "BoundColumn");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONT,"FontDescriptor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR,"BackgroundColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR,"TextColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BORDER,"Border");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DROPDOWN,"Dropdown");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT,"RowHeight");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPTEXT, "HelpText");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPURL, "HelpURL");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RECORDMARKER, "HasRecordMarker");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD, "BoundField");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE, "EffectiveValue");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT, "EffectiveDefault");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN, "EffectiveMin");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX, "EffectiveMax");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HIDDEN, "Hidden");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL, "UseFilterValueProposal");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE, "FieldSource");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TABLENAME, "TableName");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER, "FilterSupplier");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER, "CurrentFilter");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS, "SelectedFields");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES, "SelectedTables");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_THREADSAFE, "ThreadSafe");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISFILTERAPPLIED, "IsFilterApplied");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL, "LabelControl");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR, "CursorColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR, "AlwaysShowCursor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON, "DisplayIsSynchron");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISMODIFIED, "IsModified");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNEW, "IsNew");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_PRIVILEGES, "Privileges");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMAND,"Command");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE,"CommandType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY, "ResultSetConcurrency");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_INSERTONLY, "IgnoreResult");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE, "ResultSetType");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING, "EscapeProcessing");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_APPLYFILTER, "ApplyFilter");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNULLABLE, "IsNullable");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND, "ActiveCommand");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISCURRENCY, "IsCurrency");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_URL, "URL");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION, "ActiveConnection");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SORT, "Order");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATASOURCE, "DataSourceName");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REALNAME,"RealName");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY,"DataFieldProperty");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR, "TextLineColor");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK, "FontEmphasisMark");
    IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTRELIEF, "FontRelief");

    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN,             "ScrollValueMin"            );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX,             "ScrollValueMax"            );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE,         "DefaultScrollValue"        );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT,               "LineIncrement"             );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT,              "BlockIncrement"            );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_ORIENTATION,                 "Orientation"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEAT,                      "Repeat"                    );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEATDELAY,                 "RepeatDelay"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR,                 "SymbolColor"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE,                "VisibleSize"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN,               "SpinValueMin"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX,               "SpinValueMax"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE,           "DefaultSpinValue"          );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPININCREMENT,               "SpinIncrement"             );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT,               "LineEndFormat"             );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_TOGGLE,                      "Toggle"                    );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK,                "FocusOnClick"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION,       "HideInactiveSelection"     );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT,                "VisualEffect"              );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR,                 "BorderColor"               );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER,      "DynamicControlBorder"      );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS,  "ControlBorderColorOnFocus" );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE,  "ControlBorderColorOnHover" );
    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID,"ControlBorderColorOnInvalid" );

    IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE, "ButtonType" );

}   // namespace svxform

<|endoftext|>