"Fossies" - the Fresh Open Source Software Archive

Member "mapgenerator-1.1.2/src/htmlfile.h" (26 Oct 2003, 3727 Bytes) of package /linux/www/old/mapgenerator-1.1.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "htmlfile.h" see the Fossies "Dox" file reference documentation.

    1 //
    2 // File: htmlfile.h
    3 // Created by:  Gabriel Huber<Gabriel-Huber@gmx.de>
    4 // Created on: Tue Aug 19 17:58:02 2003
    5 // under the terms of the GPL version 2.0 or higher
    6 
    7 #ifndef _HTMLFILE_H_
    8 #define _HTMLFILE_H_
    9 #include "../config.h"
   10 #include <string>
   11 #include <vector>
   12 #include <fstream>
   13 #include <FL/Fl_Window.H>
   14 #include <FL/Fl_Hold_Browser.H>
   15 #include <FL/fl_file_chooser.H>
   16 #include <FL/Fl_Button.H>
   17 #include <FL/Fl.H>
   18 #include "Frame_Buffer.h"
   19 #include "read_jpeg.h"
   20 #include "read_png.h"
   21 #include "read_gif.h"
   22 #include <FL/fl_ask.H>
   23 #include <FL/fl_message.H>
   24 
   25 #ifndef enum_Objects
   26 #define enum_Objects
   27 enum {objCircle,objSquare,objPolygon,objSelector};
   28 #endif
   29 
   30 class htmlfile
   31 {
   32     private:
   33         Frame_Buffer *fb;
   34         int img_selected;
   35         std::string html_name;
   36         std::string short_img_name;
   37         std::string img_name;
   38         std::string map_name;
   39         std::string tmpfile;
   40         std::vector<int> coords;
   41         int coord; int coord_max;
   42         bool close_img_select;
   43         bool use_a;
   44         bool write;
   45         int state;
   46         std::fstream dat;
   47         Fl_Button *Edit;
   48         Fl_Hold_Browser* Image_select;
   49     
   50         bool equal_string(const std::string & str1,const std::string & str2);
   51         void sort(int & b1, int & b2, int & b3, int & b4, int & e1, int & e2, int & e3, int & e4);
   52         void htmlfile::str_search(int & beg,int & end,const std::string & str,const std::string & search);
   53         void get_content(std::string & content,const std::string & tag);
   54         void getothattr(std::string & str,const std::string & natr1,
   55                 const std::string & natr2="", const std::string & natr3="", const std::string & natr4="");
   56         bool getattribute(std::string & content,const std::string & name);
   57         int find_images(std::string & img_sel);
   58         void get_dir_name(std::string & nname, const std::string & name);
   59         bool gotobeg(const std::string & name);
   60         bool gotoend(const std::string & name);
   61         unsigned int count_tags(const std::string & search_name,
   62                 const std::string & end_name);
   63         Frame_Buffer* read_image(const std::string & name);
   64         void copy(const std::string & oldpath, const std::string & newpath);
   65         void change_imagemap(const std::string & name);
   66         void copy_part(const std::string & newpath,const std::string & oldpath,
   67                 int beg,int end=0);
   68         void add_part(const std::string & addpath,const std::string & oldpath,
   69         int beg,int end=0);
   70         void move_lastpart();
   71         void add_lastpart();
   72         void remove_map();
   73         void move(const std::string & oldpath, const std::string & newpath);
   74     
   75         void edit_call();
   76         static void edit_cb(Fl_Widget*,void* o); //o should be this;
   77         
   78     public:
   79         size_t width() const { return fb->width(); }
   80         size_t height() const { return fb->height(); }
   81         size_t pixels() const { return fb->pixels(); }
   82         size_t components() const { return fb->components();}
   83         Frame_Buffer * framebuffer(){return fb;}
   84         const unsigned char* buffer() const { return fb->buffer(); }
   85         unsigned char* buffer() { return fb->buffer(); }
   86         bool open(int & width,int & height);   
   87         bool getmap(std::string & oth_attr);
   88         bool getobj(int & object,std::string & url, std::string & alt_text,
   89                 std::string & oth_attr);
   90         bool get_coords(int &x,int &y);
   91         bool get_coords(int &r);
   92         void close_map();
   93         void save(const std::string & oth_attr="", bool use_a=false); 
   94         void sav_circle(const std::string & url,int x,int y,int r,
   95                 const std::string & alt_text="", const std::string & oth_attr=""); 
   96         void sav_square(const std::string & url,int x1,int y1,int x2,int y2,
   97                 const std::string & alt_text="", const std::string & oth_attr=""); 
   98         void sav_polygon(const std::string & url,int x,int y);
   99         void sav_addpoly(int x,int y);
  100         void close_polygon(const std::string & alt_text="",
  101                 const std::string & oth_attr="");
  102         void close_save();
  103         htmlfile();
  104         ~htmlfile();
  105 };
  106 
  107 
  108 #endif  //_HTMLFILE_H_