static void action_calendar_taskpad_print_cb (GtkAction *action, ECalShellView *cal_shell_view) { ECalShellContent *cal_shell_content; ECalModelComponent *comp_data; ETaskTable *task_table; ECalComponent *comp; ECalModel *model; icalcomponent *clone; GSList *list; cal_shell_content = cal_shell_view->priv->cal_shell_content; task_table = e_cal_shell_content_get_task_table (cal_shell_content); model = e_task_table_get_model (task_table); list = e_task_table_get_selected (task_table); g_return_if_fail (list != NULL); comp_data = list->data; g_slist_free (list); /* XXX We only print the first selected task. */ comp = e_cal_component_new (); clone = icalcomponent_new_clone (comp_data->icalcomp); e_cal_component_set_icalcomponent (comp, clone); print_comp ( comp, comp_data->client, e_cal_model_get_timezone (model), e_cal_model_get_use_24_hour_format (model), GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); g_object_unref (comp); }
/* Multiplies the complex with the real and prints to the user. */ void mult_comp_real(params* arg) { complex comp; comp.a = arg->vals[0].c->a * arg->vals[1].d; comp.b = arg->vals[0].c->b * arg->vals[1].d; arg->vals[0].c = ∁ print_comp(arg); }
/* Subs the complex(s) values and prints to the user. */ void sub_comp(params* arg) { complex comp; comp.a = arg->vals[0].c->a - arg->vals[1].c->a; comp.b = arg->vals[0].c->b - arg->vals[1].c->b; arg->vals[0].c = ∁ print_comp(arg); }
/* Adds the complex(s) values and prints to the user. */ void add_comp(params* arg) { complex comp; comp.a = arg->vals[0].c->a + arg->vals[1].c->a; comp.b = arg->vals[0].c->b + arg->vals[1].c->b; arg->vals[0].c = ∁ print_comp(arg); }
/* Multiplies the two complex and prints to the user. */ void mult_comp_comp(params* arg) { complex comp; comp.a = (arg->vals[0].c->a * arg->vals[1].c->a) - (arg->vals[0].c->b * arg->vals[1].c->b); comp.b = (arg->vals[0].c->a * arg->vals[1].c->b) + (arg->vals[0].c->b * arg->vals[1].c->a); arg->vals[0].c = ∁ print_comp(arg); }
/* Reads the given arguments into the given complex pointers. */ void read_comp(params* arg) { arg->vals[0].c->a = arg->vals[1].d; arg->vals[0].c->b = arg->vals[2].d; print_comp(arg); /* Prints the updated complex. (DEBUGGING)*/ }