00001 #include "vapiGtkInterface.h"
00002 #include "vapiOptions.h"
00003 #include "vapiTypes.h"
00004 #include "vapiGtkOptions.h"
00005
00006 int
00007 vapiGtkOptionsCreateCustomOperations (vOptions * Options,
00008 vOptionsSettings *
00009 OptionsSettings,
00010 GList ** OptionsList[3],
00011 GList ** tempList[3], int i,
00012 int widgetsWidth,
00013 GCallback EventFunc, vpointer EventData)
00014 {
00015 vEffectSettings *OperationSettings =
00016 OptionsSettings->CustomOptionsSettings;
00017 if (OperationSettings->HasOriginalOption)
00018 {
00019 *OptionsList[1] =
00020 g_list_append (*OptionsList[1],
00021 gtk_check_button_new ());
00022 *tempList[1] =
00023 g_list_append (*tempList[1],
00024 gtk_label_new
00025 ("Utilizar a Imagem Original da câmara"));
00026
00027 gtk_toggle_button_set_active ((GtkToggleButton *)
00028 g_list_nth_data (*OptionsList
00029 [1], i),
00030 FALSE);
00031 ++i;
00032 }
00033 if (OperationSettings->runSeveralTimes)
00034 {
00035
00036
00037
00038
00039 *OptionsList[1] =
00040 g_list_append (*OptionsList[1],
00041 gtk_hscale_new_with_range (1, 100, 1));
00042 *tempList[1] =
00043 g_list_append (*tempList[1],
00044 gtk_label_new ("Repetir"));
00045 gtk_widget_set_size_request ((GtkWidget *)
00046 g_list_nth_data (*tempList[1],
00047 i),
00048 widgetsWidth, 15);
00049
00050 ++i;
00051 }
00052 return i;
00053 }
00054
00055 int
00056 vapiGtkOptionsPopulateCustomOperations (vOptions * Options,
00057 vOptionsSettings * OptionsSettings,
00058 GList ** OptionsList[3], int i)
00059 {
00060 vEffectSettings *OperationSettings =
00061 OptionsSettings->CustomOptionsSettings;
00062 vEffectOptions *OperationOptions = Options->CustomOptions;
00063
00064 if (OperationSettings->HasOriginalOption)
00065 {
00066 if (OperationOptions->original)
00067 {
00068 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00069 (g_list_nth_data
00070 (*OptionsList[1], i)),
00071 TRUE);
00072 }
00073
00074 else
00075 {
00076 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
00077 (g_list_nth_data
00078 (*OptionsList[1], i)),
00079 FALSE);
00080 }
00081 i++;
00082 }
00083 if (OperationSettings->runSeveralTimes)
00084 {
00085 gtk_range_set_value ((GtkRange *)
00086 g_list_nth_data
00087 (*OptionsList[1], i),
00088 ((vEffectOptions *) Options->
00089 CustomOptions)->times);
00090 ++i;
00091 }
00092 return i;
00093 }
00094
00095 int
00096 vapiGtkOptionsCountCustomOperationsMembers (vOptionsSettings *
00097 OptionsSettings)
00098 {
00099 vEffectSettings *OperationSettings =
00100 OptionsSettings->CustomOptionsSettings;
00101 int times;
00102 times = 0;
00103 if (OperationSettings->HasOriginalOption)
00104 {
00105 ++times;
00106 }
00107 if (OperationSettings->runSeveralTimes)
00108 {
00109 ++times;
00110 }
00111 return times;
00112 }
00113
00114 int
00115 vapiGtkOptionsGetOptionsCustomOperations (vOptions * options,
00116 vOptionsSettings * OptionsSettings,
00117 GList ** OptionsData)
00118 {
00119 vEffectSettings *OperationSettings =
00120 OptionsSettings->CustomOptionsSettings;
00121 vEffectOptions *OperationOptions = options->CustomOptions;
00122 int i = 0;
00123
00124 if (OperationSettings->HasOriginalOption)
00125 {
00126 if (gtk_toggle_button_get_active ((GtkToggleButton
00127 *) (GtkRange *)
00128 g_list_nth_data
00129 (*OptionsData, i)))
00130 {
00131 OperationOptions->original = vTRUE;
00132 }
00133 else
00134 {
00135 OperationOptions->original = vFALSE;
00136 }
00137 i++;
00138 }
00139 if (OperationSettings->runSeveralTimes)
00140 {
00141 OperationOptions->times =
00142 gtk_range_get_value ((GtkRange *)
00143 g_list_nth_data (*OptionsData,
00144 i));
00145 i++;
00146 }
00147 return i;
00148 }