6 * Copyright (C) 2015 Adam Williams <broadcast at earthling dot net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 // functions for handling proxies
26 #include "arraylist.h"
29 #include "formattools.inc"
30 #include "loadbalance.h"
32 #include "mwindow.inc"
39 class ProxyMenuItem : public BC_MenuItem
42 ProxyMenuItem(MWindow *mwindow);
45 void create_objects();
51 class FromProxyMenuItem : public BC_MenuItem
54 FromProxyMenuItem(MWindow *mwindow);
60 class ProxyThread : public BC_DialogThread
63 ProxyThread(MWindow *mwindow);
66 void handle_close_event(int result);
67 static void to_proxy_path(char *new_path, Asset *asset, int scale);
68 static void from_proxy_path(char *new_path, Asset *asset, int scale);
71 // increment the frame count by 1
72 void update_progress();
73 // if user canceled progress bar
75 // calculate possible sizes based on the original size
76 void calculate_sizes();
77 void scale_to_text(char *string, int scale);
81 MainProgressBar *progress;
88 char *size_text[MAX_SIZES];
89 int size_factors[MAX_SIZES];
93 class ProxyReset : public BC_GenericButton
96 ProxyReset(MWindow *mwindow, ProxyWindow *pwindow,
100 ProxyWindow *pwindow;
103 class ProxyMenu : public BC_PopupMenu
106 ProxyMenu(MWindow *mwindow, ProxyWindow *pwindow,
107 int x, int y, int w, const char *text);
110 ProxyWindow *pwindow;
114 class ProxyTumbler : public BC_Tumbler
117 ProxyTumbler(MWindow *mwindow, ProxyWindow *pwindow, int x, int y);
119 int handle_up_event();
120 int handle_down_event();
122 ProxyWindow *pwindow;
127 class ProxyWindow : public BC_Window
130 ProxyWindow(MWindow *mwindow, ProxyThread *thread,
134 void create_objects();
139 FormatTools *format_tools;
140 BC_Title *new_dimensions;
141 BC_PopupMenu *scale_factor;
147 class ProxyPackage : public LoadPackage
155 class ProxyClient : public LoadClient
158 ProxyClient(MWindow *mwindow, ProxyThread *thread,
160 void process_package(LoadPackage *package);
167 class ProxyFarm : public LoadServer
170 ProxyFarm(MWindow *mwindow, ProxyThread *thread,
171 ArrayList<Asset*> *proxy_assets, ArrayList<Asset*> *orig_assets);
173 void init_packages();
174 LoadClient* new_client();
175 LoadPackage* new_package();
179 ArrayList<Asset*> *proxy_assets;
180 ArrayList<Asset*> *orig_assets;